@elliemae/ds-system 3.0.0-next.9 → 3.0.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 +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 +12 -12
- 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
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __export = (target, all) => {
|
|
25
|
+
for (var name in all)
|
|
26
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
27
|
+
};
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
+
for (let key of __getOwnPropNames(from))
|
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
33
|
+
}
|
|
34
|
+
return to;
|
|
35
|
+
};
|
|
36
|
+
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));
|
|
37
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
38
|
+
var helpers_exports = {};
|
|
39
|
+
__export(helpers_exports, {
|
|
40
|
+
coerceWithDefaultTheme: () => coerceWithDefaultTheme,
|
|
41
|
+
isEmpty: () => isEmpty,
|
|
42
|
+
propsToClassKey: () => propsToClassKey,
|
|
43
|
+
stylesArgThemeCoercion: () => stylesArgThemeCoercion
|
|
44
|
+
});
|
|
45
|
+
module.exports = __toCommonJS(helpers_exports);
|
|
46
|
+
var React = __toESM(require("react"));
|
|
47
|
+
var import_ds_utilities = require("@elliemae/ds-utilities");
|
|
48
|
+
var import_theme = require("../../theme");
|
|
49
|
+
const systemTheme = import_theme.theme;
|
|
50
|
+
const isEmpty = (string) => string.length === 0;
|
|
51
|
+
const coerceWithDefaultTheme = (themeInput) => themeInput ?? systemTheme;
|
|
52
|
+
const stylesArgThemeCoercion = (stylesArg) => {
|
|
53
|
+
if (typeof stylesArg === "function") {
|
|
54
|
+
return (props) => stylesArg(__spreadProps(__spreadValues({}, props), {
|
|
55
|
+
theme: coerceWithDefaultTheme(props.theme)
|
|
56
|
+
}));
|
|
57
|
+
}
|
|
58
|
+
return stylesArg;
|
|
59
|
+
};
|
|
60
|
+
const propsToClassKey = (props) => Object.keys(props).sort().reduce((classKey, key) => {
|
|
61
|
+
if (key === "color") {
|
|
62
|
+
return classKey + (isEmpty(String(classKey)) ? String(props[key]) : (0, import_ds_utilities.capitalize)(String(props[key])));
|
|
63
|
+
}
|
|
64
|
+
return `${classKey}${isEmpty(String(classKey)) ? key : (0, import_ds_utilities.capitalize)(key)}${(0, import_ds_utilities.capitalize)(props[key].toString())}`;
|
|
65
|
+
}, "");
|
|
66
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/ds-styled/utilities/helpers.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { Interpolation } from 'styled-components';\nimport { capitalize } from '@elliemae/ds-utilities';\nimport type { PropsWithTheme, Theme } from '../types';\nimport { theme as defaultTheme } from '../../theme';\n\nconst systemTheme = defaultTheme;\n\nexport const isEmpty = (string: string): boolean => string.length === 0;\n\nexport const coerceWithDefaultTheme = (themeInput: Theme | undefined): Theme => themeInput ?? systemTheme;\n\nexport const stylesArgThemeCoercion = (stylesArg: Interpolation<any>): Interpolation<any> => {\n if (typeof stylesArg === 'function') {\n return (props: PropsWithTheme) =>\n stylesArg({\n ...props,\n theme: coerceWithDefaultTheme(props.theme),\n });\n }\n return stylesArg;\n};\n\nexport const propsToClassKey = (props: Record<string, { toString: () => string }>): string =>\n Object.keys(props)\n .sort()\n .reduce((classKey, key) => {\n if (key === 'color') {\n return classKey + (isEmpty(String(classKey)) ? String(props[key]) : capitalize(String(props[key])));\n }\n return `${classKey}${isEmpty(String(classKey)) ? key : capitalize(key)}${capitalize(props[key].toString())}`;\n }, '');\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,0BAA2B;AAE3B,mBAAsC;AAEtC,MAAM,cAAc;AAEb,MAAM,UAAU,CAAC,WAA4B,OAAO,WAAW;AAE/D,MAAM,yBAAyB,CAAC,eAAyC,cAAc;AAEvF,MAAM,yBAAyB,CAAC,cAAsD;AAC3F,MAAI,OAAO,cAAc,YAAY;AACnC,WAAO,CAAC,UACN,UAAU,iCACL,QADK;AAAA,MAER,OAAO,uBAAuB,MAAM,KAAK;AAAA,IAC3C,EAAC;AAAA,EACL;AACA,SAAO;AACT;AAEO,MAAM,kBAAkB,CAAC,UAC9B,OAAO,KAAK,KAAK,EACd,KAAK,EACL,OAAO,CAAC,UAAU,QAAQ;AACzB,MAAI,QAAQ,SAAS;AACnB,WAAO,WAAY,SAAQ,OAAO,QAAQ,CAAC,IAAI,OAAO,MAAM,IAAI,IAAI,oCAAW,OAAO,MAAM,IAAI,CAAC;AAAA,EACnG;AACA,SAAO,GAAG,WAAW,QAAQ,OAAO,QAAQ,CAAC,IAAI,MAAM,oCAAW,GAAG,IAAI,oCAAW,MAAM,KAAK,SAAS,CAAC;AAC3G,GAAG,EAAE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __copyProps = (to, from, except, desc) => {
|
|
8
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
9
|
+
for (let key of __getOwnPropNames(from))
|
|
10
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
11
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
}
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
16
|
+
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));
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var utilities_exports = {};
|
|
19
|
+
module.exports = __toCommonJS(utilities_exports);
|
|
20
|
+
var React = __toESM(require("react"));
|
|
21
|
+
__reExport(utilities_exports, require("./magicCssTransform"), module.exports);
|
|
22
|
+
__reExport(utilities_exports, require("./resolvers"), module.exports);
|
|
23
|
+
__reExport(utilities_exports, require("./helpers"), module.exports);
|
|
24
|
+
__reExport(utilities_exports, require("./sizing"), module.exports);
|
|
25
|
+
__reExport(utilities_exports, require("./border"), module.exports);
|
|
26
|
+
__reExport(utilities_exports, require("./background"), module.exports);
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/ds-styled/utilities/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export * from './magicCssTransform';\nexport * from './resolvers';\nexport * from './helpers';\nexport * from './sizing';\nexport * from './border';\nexport * from './background';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAc,gCAAd;AACA,8BAAc,wBADd;AAEA,8BAAc,sBAFd;AAGA,8BAAc,qBAHd;AAIA,8BAAc,qBAJd;AAKA,8BAAc,yBALd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
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 });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
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);
|
|
21
|
+
var magicCssTransform_exports = {};
|
|
22
|
+
__export(magicCssTransform_exports, {
|
|
23
|
+
magicCssTransform: () => magicCssTransform
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(magicCssTransform_exports);
|
|
26
|
+
var React = __toESM(require("react"));
|
|
27
|
+
var import_th = require("../../th");
|
|
28
|
+
const COLOR_REGEX = /(neutral|brand|success|warning|danger)-(100|200|300|400|500|600|700|800|900|000|050|080)/g;
|
|
29
|
+
const magicfyCss = (rawValue) => {
|
|
30
|
+
let matches;
|
|
31
|
+
let lastIndex = 0;
|
|
32
|
+
const splittedValue = [];
|
|
33
|
+
const themeGetters = [];
|
|
34
|
+
while (matches = COLOR_REGEX.exec(rawValue)) {
|
|
35
|
+
const [match] = matches;
|
|
36
|
+
splittedValue.push(rawValue.slice(lastIndex, matches.index));
|
|
37
|
+
themeGetters.push(import_th.th.color(match, match));
|
|
38
|
+
lastIndex = matches.index + match.length;
|
|
39
|
+
}
|
|
40
|
+
splittedValue.push(rawValue.slice(lastIndex, rawValue.length));
|
|
41
|
+
return [splittedValue, themeGetters];
|
|
42
|
+
};
|
|
43
|
+
const magicCssTransform = (styleArg, expressions) => {
|
|
44
|
+
if (!Array.isArray(styleArg))
|
|
45
|
+
return [styleArg, expressions];
|
|
46
|
+
const magicStyleArg = [];
|
|
47
|
+
const magicExpressions = [];
|
|
48
|
+
const templateStringArray = styleArg;
|
|
49
|
+
templateStringArray.forEach((templateString, index) => {
|
|
50
|
+
const [splittedTemplateString, themeGetters] = magicfyCss(templateString);
|
|
51
|
+
magicStyleArg.push(...splittedTemplateString);
|
|
52
|
+
magicExpressions.push(...themeGetters);
|
|
53
|
+
if (index < expressions.length)
|
|
54
|
+
magicExpressions.push(expressions[index]);
|
|
55
|
+
});
|
|
56
|
+
return [Object.assign(magicStyleArg, { raw: [...magicStyleArg] }), magicExpressions];
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=magicCssTransform.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/ds-styled/utilities/magicCssTransform.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/ban-ts-comment */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable no-cond-assign */\nimport { CSSObject, Interpolation, InterpolationFunction } from 'styled-components';\nimport { th } from '../../th';\n\ntype StyleArg = CSSObject | InterpolationFunction<any> | TemplateStringsArray;\ntype Expressions = Interpolation<any>[];\ntype MagicCssTransform = (styleArg: StyleArg, expressions: Expressions) => [StyleArg, Expressions];\n\n// This file is heavily inspired by https://github.com/gregberge/xstyled/blob/c0c92b459bb3a5de46d7854be3667861f816baa5/packages/core/src/transform.ts#L65\n// Please refer to that file to understand of the idea of the css transformer\n\nconst COLOR_REGEX = /(neutral|brand|success|warning|danger)-(100|200|300|400|500|600|700|800|900|000|050|080)/g;\n\nconst magicfyCss = (rawValue: string): [string[], Interpolation<any>[]] => {\n let matches;\n let lastIndex = 0;\n const splittedValue: string[] = [];\n const themeGetters = [];\n while ((matches = COLOR_REGEX.exec(rawValue))) {\n const [match] = matches;\n splittedValue.push(rawValue.slice(lastIndex, matches.index));\n\n themeGetters.push(th.color(match, match));\n\n lastIndex = matches.index + match.length;\n }\n splittedValue.push(rawValue.slice(lastIndex, rawValue.length));\n return [splittedValue, themeGetters];\n};\n\nexport const magicCssTransform: MagicCssTransform = (styleArg, expressions) => {\n if (!Array.isArray(styleArg)) return [styleArg, expressions];\n\n const magicStyleArg: string[] = [];\n const magicExpressions: Expressions = [];\n\n const templateStringArray = styleArg as TemplateStringsArray;\n\n templateStringArray.forEach((templateString, index) => {\n const [splittedTemplateString, themeGetters] = magicfyCss(templateString);\n magicStyleArg.push(...splittedTemplateString);\n magicExpressions.push(...themeGetters);\n if (index < expressions.length) magicExpressions.push(expressions[index]);\n });\n\n return [Object.assign(magicStyleArg, { raw: [...magicStyleArg] }), magicExpressions];\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIvB,gBAAmB;AASnB,MAAM,cAAc;AAEpB,MAAM,aAAa,CAAC,aAAuD;AACzE,MAAI;AACJ,MAAI,YAAY;AAChB,QAAM,gBAA0B,CAAC;AACjC,QAAM,eAAe,CAAC;AACtB,SAAQ,UAAU,YAAY,KAAK,QAAQ,GAAI;AAC7C,UAAM,CAAC,SAAS;AAChB,kBAAc,KAAK,SAAS,MAAM,WAAW,QAAQ,KAAK,CAAC;AAE3D,iBAAa,KAAK,aAAG,MAAM,OAAO,KAAK,CAAC;AAExC,gBAAY,QAAQ,QAAQ,MAAM;AAAA,EACpC;AACA,gBAAc,KAAK,SAAS,MAAM,WAAW,SAAS,MAAM,CAAC;AAC7D,SAAO,CAAC,eAAe,YAAY;AACrC;AAEO,MAAM,oBAAuC,CAAC,UAAU,gBAAgB;AAC7E,MAAI,CAAC,MAAM,QAAQ,QAAQ;AAAG,WAAO,CAAC,UAAU,WAAW;AAE3D,QAAM,gBAA0B,CAAC;AACjC,QAAM,mBAAgC,CAAC;AAEvC,QAAM,sBAAsB;AAE5B,sBAAoB,QAAQ,CAAC,gBAAgB,UAAU;AACrD,UAAM,CAAC,wBAAwB,gBAAgB,WAAW,cAAc;AACxE,kBAAc,KAAK,GAAG,sBAAsB;AAC5C,qBAAiB,KAAK,GAAG,YAAY;AACrC,QAAI,QAAQ,YAAY;AAAQ,uBAAiB,KAAK,YAAY,MAAM;AAAA,EAC1E,CAAC;AAED,SAAO,CAAC,OAAO,OAAO,eAAe,EAAE,KAAK,CAAC,GAAG,aAAa,EAAE,CAAC,GAAG,gBAAgB;AACrF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
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 });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
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);
|
|
21
|
+
var resolvers_exports = {};
|
|
22
|
+
__export(resolvers_exports, {
|
|
23
|
+
getStyleOverrides: () => getStyleOverrides,
|
|
24
|
+
getVariantStyles: () => getVariantStyles,
|
|
25
|
+
variantsResolver: () => variantsResolver
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(resolvers_exports);
|
|
28
|
+
var React = __toESM(require("react"));
|
|
29
|
+
var import_helpers = require("./helpers");
|
|
30
|
+
const getStyleOverrides = (name, theme) => theme.components?.[name]?.styleOverrides || null;
|
|
31
|
+
const getVariantStyles = (name, theme) => {
|
|
32
|
+
const variants = theme.components?.[name]?.variants || [];
|
|
33
|
+
return variants.reduce((styles, definition) => {
|
|
34
|
+
const key = (0, import_helpers.propsToClassKey)(definition.props);
|
|
35
|
+
styles[key] = definition.style;
|
|
36
|
+
return styles;
|
|
37
|
+
}, {});
|
|
38
|
+
};
|
|
39
|
+
const variantsResolver = (props, styles, theme, name) => {
|
|
40
|
+
const themeVariants = theme?.components?.[name]?.variants || [];
|
|
41
|
+
return themeVariants.reduce((variantsStyles, themeVariant) => {
|
|
42
|
+
const isMatch = Object.keys(themeVariant.props).every((key) => props[key] === themeVariant.props[key]);
|
|
43
|
+
if (isMatch) {
|
|
44
|
+
variantsStyles.push(styles[(0, import_helpers.propsToClassKey)(themeVariant.props)]);
|
|
45
|
+
}
|
|
46
|
+
return variantsStyles;
|
|
47
|
+
}, []);
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=resolvers.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/ds-styled/utilities/resolvers.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-params */\nimport type { CSSObject } from 'styled-components';\nimport type { Theme } from '../types';\nimport { propsToClassKey } from './helpers';\n\nexport const getStyleOverrides = (name: string, theme: Theme): CSSObject | null =>\n theme.components?.[name]?.styleOverrides || null;\n\nexport const getVariantStyles = (name: string, theme: Theme): Record<string, CSSObject> => {\n const variants = theme.components?.[name]?.variants || [];\n\n return variants.reduce((styles, definition) => {\n const key = propsToClassKey(definition.props);\n styles[key] = definition.style;\n return styles;\n }, {} as Record<string, CSSObject>);\n};\n\nexport const variantsResolver = (\n props: Record<string, unknown>,\n styles: CSSObject,\n theme: Theme,\n name: string,\n): CSSObject[keyof CSSObject][] => {\n const themeVariants = theme?.components?.[name]?.variants || [];\n\n return themeVariants.reduce((variantsStyles, themeVariant) => {\n const isMatch = Object.keys(themeVariant.props).every((key) => props[key] === themeVariant.props[key]);\n if (isMatch) {\n variantsStyles.push(styles[propsToClassKey(themeVariant.props)]);\n }\n return variantsStyles;\n }, [] as CSSObject[keyof CSSObject][]);\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,qBAAgC;AAEzB,MAAM,oBAAoB,CAAC,MAAc,UAC9C,MAAM,aAAa,OAAO,kBAAkB;AAEvC,MAAM,mBAAmB,CAAC,MAAc,UAA4C;AACzF,QAAM,WAAW,MAAM,aAAa,OAAO,YAAY,CAAC;AAExD,SAAO,SAAS,OAAO,CAAC,QAAQ,eAAe;AAC7C,UAAM,MAAM,oCAAgB,WAAW,KAAK;AAC5C,WAAO,OAAO,WAAW;AACzB,WAAO;AAAA,EACT,GAAG,CAAC,CAA8B;AACpC;AAEO,MAAM,mBAAmB,CAC9B,OACA,QACA,OACA,SACiC;AACjC,QAAM,gBAAgB,OAAO,aAAa,OAAO,YAAY,CAAC;AAE9D,SAAO,cAAc,OAAO,CAAC,gBAAgB,iBAAiB;AAC5D,UAAM,UAAU,OAAO,KAAK,aAAa,KAAK,EAAE,MAAM,CAAC,QAAQ,MAAM,SAAS,aAAa,MAAM,IAAI;AACrG,QAAI,SAAS;AACX,qBAAe,KAAK,OAAO,oCAAgB,aAAa,KAAK,EAAE;AAAA,IACjE;AACA,WAAO;AAAA,EACT,GAAG,CAAC,CAAiC;AACvC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
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 });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
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);
|
|
21
|
+
var sizing_exports = {};
|
|
22
|
+
__export(sizing_exports, {
|
|
23
|
+
sizing: () => sizing
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(sizing_exports);
|
|
26
|
+
var React = __toESM(require("react"));
|
|
27
|
+
var import_system = require("@xstyled/system");
|
|
28
|
+
const width = (0, import_system.style)({
|
|
29
|
+
prop: ["width", "w"],
|
|
30
|
+
css: "width",
|
|
31
|
+
themeGet: import_system.getSize
|
|
32
|
+
});
|
|
33
|
+
const height = (0, import_system.style)({
|
|
34
|
+
prop: ["height", "h"],
|
|
35
|
+
css: "height",
|
|
36
|
+
themeGet: import_system.getSize
|
|
37
|
+
});
|
|
38
|
+
const maxHeight = (0, import_system.style)({
|
|
39
|
+
prop: ["maxH", "maxHeight"],
|
|
40
|
+
css: "max-height",
|
|
41
|
+
themeGet: import_system.getSize
|
|
42
|
+
});
|
|
43
|
+
const maxWidth = (0, import_system.style)({
|
|
44
|
+
prop: ["maxW", "maxWidth"],
|
|
45
|
+
css: "max-width",
|
|
46
|
+
themeGet: import_system.getSize
|
|
47
|
+
});
|
|
48
|
+
const minHeight = (0, import_system.style)({
|
|
49
|
+
prop: ["minH", "minHeight"],
|
|
50
|
+
css: "min-height",
|
|
51
|
+
themeGet: import_system.getSize
|
|
52
|
+
});
|
|
53
|
+
const minWidth = (0, import_system.style)({
|
|
54
|
+
prop: ["minW", "minWidth"],
|
|
55
|
+
css: "min-width",
|
|
56
|
+
themeGet: import_system.getSize
|
|
57
|
+
});
|
|
58
|
+
const sizing = (0, import_system.compose)(width, maxWidth, height, maxHeight, minHeight, minWidth);
|
|
59
|
+
//# sourceMappingURL=sizing.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/ds-styled/utilities/sizing.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { style, compose, getSize } from '@xstyled/system';\n\nconst width = style({\n prop: ['width', 'w'],\n css: 'width',\n themeGet: getSize,\n});\n\nconst height = style({\n prop: ['height', 'h'],\n css: 'height',\n themeGet: getSize,\n});\n\nconst maxHeight = style({\n prop: ['maxH', 'maxHeight'],\n css: 'max-height',\n themeGet: getSize,\n});\n\nconst maxWidth = style({\n prop: ['maxW', 'maxWidth'],\n css: 'max-width',\n themeGet: getSize,\n});\n\nconst minHeight = style({\n prop: ['minH', 'minHeight'],\n css: 'min-height',\n themeGet: getSize,\n});\n\nconst minWidth = style({\n prop: ['minW', 'minWidth'],\n css: 'min-width',\n themeGet: getSize,\n});\n\nexport const sizing = compose(width, maxWidth, height, maxHeight, minHeight, minWidth);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAwC;AAExC,MAAM,QAAQ,yBAAM;AAAA,EAClB,MAAM,CAAC,SAAS,GAAG;AAAA,EACnB,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,SAAS,yBAAM;AAAA,EACnB,MAAM,CAAC,UAAU,GAAG;AAAA,EACpB,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,YAAY,yBAAM;AAAA,EACtB,MAAM,CAAC,QAAQ,WAAW;AAAA,EAC1B,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,WAAW,yBAAM;AAAA,EACrB,MAAM,CAAC,QAAQ,UAAU;AAAA,EACzB,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,YAAY,yBAAM;AAAA,EACtB,MAAM,CAAC,QAAQ,WAAW;AAAA,EAC1B,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,WAAW,yBAAM;AAAA,EACrB,MAAM,CAAC,QAAQ,UAAU;AAAA,EACzB,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAEM,MAAM,SAAS,2BAAQ,OAAO,UAAU,QAAQ,WAAW,WAAW,QAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/cjs/globalStyles.js
CHANGED
|
@@ -4,34 +4,28 @@ 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 globalStyles_exports = {};
|
|
29
22
|
__export(globalStyles_exports, {
|
|
30
23
|
GlobalStyles: () => GlobalStyles
|
|
31
24
|
});
|
|
25
|
+
module.exports = __toCommonJS(globalStyles_exports);
|
|
32
26
|
var React = __toESM(require("react"));
|
|
33
|
-
var
|
|
34
|
-
const GlobalStyles =
|
|
27
|
+
var import_ds_styled = require("./ds-styled");
|
|
28
|
+
const GlobalStyles = import_ds_styled.createGlobalStyle`
|
|
35
29
|
:root, body {
|
|
36
30
|
overscroll-behavior-y: none;
|
|
37
31
|
|
|
@@ -43,5 +37,4 @@ const GlobalStyles = import_utils.createGlobalStyle`
|
|
|
43
37
|
|
|
44
38
|
}
|
|
45
39
|
`;
|
|
46
|
-
module.exports = __toCommonJS(globalStyles_exports);
|
|
47
40
|
//# sourceMappingURL=globalStyles.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/globalStyles.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import { createGlobalStyle } from './
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import { createGlobalStyle } from './ds-styled';\n\nexport const GlobalStyles = createGlobalStyle<{ device: 'desktop' | 'mobile' }>`\n :root, body {\n overscroll-behavior-y: none;\n\n font-size: ${(props) => (props.device === 'desktop' ? '13px' : '16px')};\n\n @media(min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: ${(props) => (props.device === 'mobile' ? '16px' : '13px')};\n }\n\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,uBAAkC;AAE3B,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA,iBAIX,CAAC,UAAW,MAAM,WAAW,YAAY,SAAS;AAAA;AAAA,wBAE3C,CAAC,EAAE,YAAY,MAAM,YAAY;AAAA,mBACtC,CAAC,UAAW,MAAM,WAAW,WAAW,SAAS;AAAA;AAAA;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/cjs/index.js
CHANGED
|
@@ -4,40 +4,34 @@ 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
|
|
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
20
|
+
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));
|
|
21
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
22
|
var src_exports = {};
|
|
29
23
|
__export(src_exports, {
|
|
30
24
|
themeProviderHOC: () => import_themeProviderHOC.themeProviderHOC
|
|
31
25
|
});
|
|
26
|
+
module.exports = __toCommonJS(src_exports);
|
|
32
27
|
var React = __toESM(require("react"));
|
|
33
|
-
__reExport(src_exports, require("./globalStyles"));
|
|
34
|
-
__reExport(src_exports, require("./spaceUtilities"));
|
|
35
|
-
__reExport(src_exports, require("./mobileUtilities"));
|
|
36
|
-
__reExport(src_exports, require("./utils"));
|
|
37
|
-
__reExport(src_exports, require("./arithmetic"));
|
|
38
|
-
__reExport(src_exports, require("./th"));
|
|
39
|
-
__reExport(src_exports, require("./theme"));
|
|
40
|
-
__reExport(src_exports, require("./styled"));
|
|
28
|
+
__reExport(src_exports, require("./globalStyles"), module.exports);
|
|
29
|
+
__reExport(src_exports, require("./spaceUtilities"), module.exports);
|
|
30
|
+
__reExport(src_exports, require("./mobileUtilities"), module.exports);
|
|
31
|
+
__reExport(src_exports, require("./utils"), module.exports);
|
|
32
|
+
__reExport(src_exports, require("./arithmetic"), module.exports);
|
|
33
|
+
__reExport(src_exports, require("./th"), module.exports);
|
|
34
|
+
__reExport(src_exports, require("./theme"), module.exports);
|
|
35
|
+
__reExport(src_exports, require("./ds-styled"), module.exports);
|
|
41
36
|
var import_themeProviderHOC = require("./themeProviderHOC");
|
|
42
|
-
module.exports = __toCommonJS(src_exports);
|
|
43
37
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["export * from './globalStyles';\nexport * from './spaceUtilities';\nexport * from './mobileUtilities';\nexport * from './utils';\nexport * from './arithmetic';\nexport * from './th';\nexport * from './theme';\nexport * from './styled';\nexport { themeProviderHOC } from './themeProviderHOC';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["export * from './globalStyles';\nexport * from './spaceUtilities';\nexport * from './mobileUtilities';\nexport * from './utils';\nexport * from './arithmetic';\nexport * from './th';\nexport * from './theme';\nexport * from './ds-styled';\nexport { themeProviderHOC } from './themeProviderHOC';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,wBAAc,2BAAd;AACA,wBAAc,6BADd;AAEA,wBAAc,8BAFd;AAGA,wBAAc,oBAHd;AAIA,wBAAc,yBAJd;AAKA,wBAAc,iBALd;AAMA,wBAAc,oBANd;AAOA,wBAAc,wBAPd;AAQA,8BAAiC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -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 mobileUtilities_exports = {};
|
|
29
22
|
__export(mobileUtilities_exports, {
|
|
30
23
|
__UNSAFE_SPACE_TO_DIMSUM: () => __UNSAFE_SPACE_TO_DIMSUM,
|
|
@@ -32,15 +25,21 @@ __export(mobileUtilities_exports, {
|
|
|
32
25
|
toMobile: () => toMobile,
|
|
33
26
|
useIsMobile: () => useIsMobile
|
|
34
27
|
});
|
|
28
|
+
module.exports = __toCommonJS(mobileUtilities_exports);
|
|
35
29
|
var React = __toESM(require("react"));
|
|
36
30
|
var import_react = require("react");
|
|
37
31
|
var import_theme = require("./theme");
|
|
38
32
|
var import_constants = require("./constants");
|
|
39
33
|
function __UNSAFE_SPACE_TO_DIMSUM(unit) {
|
|
40
|
-
if (import_constants.translateUnits
|
|
34
|
+
if (unit in import_constants.translateUnits)
|
|
41
35
|
return import_constants.translateUnits[unit];
|
|
42
36
|
return `${parseFloat(unit) * (import_constants.mobileBaseFont / import_constants.desktopBaseFont) / 2}px`;
|
|
43
37
|
}
|
|
38
|
+
const isMobile = () => {
|
|
39
|
+
if (!window)
|
|
40
|
+
return false;
|
|
41
|
+
return Number(import_theme.theme.breakpoints.medium.split("px")[0]) - window.innerWidth >= 0;
|
|
42
|
+
};
|
|
44
43
|
function toMobile(unit) {
|
|
45
44
|
if (!isMobile())
|
|
46
45
|
return unit;
|
|
@@ -52,21 +51,13 @@ const useIsMobile = () => {
|
|
|
52
51
|
function handleResize() {
|
|
53
52
|
setMobile(isMobile());
|
|
54
53
|
}
|
|
55
|
-
|
|
56
|
-
window.addEventListener("resize", handleResize);
|
|
54
|
+
window?.addEventListener("resize", handleResize);
|
|
57
55
|
return () => {
|
|
58
|
-
|
|
59
|
-
window.removeEventListener("resize", handleResize);
|
|
56
|
+
window?.removeEventListener("resize", handleResize);
|
|
60
57
|
};
|
|
61
58
|
}, []);
|
|
62
59
|
if (!window)
|
|
63
60
|
return false;
|
|
64
61
|
return mobile;
|
|
65
62
|
};
|
|
66
|
-
const isMobile = () => {
|
|
67
|
-
if (!window)
|
|
68
|
-
return false;
|
|
69
|
-
return Number(import_theme.theme.breakpoints.medium.split("px")[0]) - window.innerWidth >= 0;
|
|
70
|
-
};
|
|
71
|
-
module.exports = __toCommonJS(mobileUtilities_exports);
|
|
72
63
|
//# sourceMappingURL=mobileUtilities.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/mobileUtilities.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/naming-convention */\nimport { useState, useEffect } from 'react';\nimport { theme } from './theme';\nimport { desktopBaseFont, mobileBaseFont, translateUnits } from './constants';\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,kCAAkC,MAAsB;AAC7D,MAAI,QAAQ;AAAgB,WAAO,gCAAe;AAClD,SAAO,GAAI,WAAW,IAAI,IAAK,mCAAiB,oCAAoB;AACtE;AAEO,MAAM,WAAW,MAAe;AACrC,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO,OAAO,mBAAM,YAAY,OAAO,MAAM,IAAI,EAAE,EAAE,IAAI,OAAO,cAAc;AAChF;AAEO,kBAAkB,MAAsB;AAC7C,MAAI,CAAC,SAAS;AAAG,WAAO;AACxB,SAAO,GAAG,WAAW,IAAI,IAAK,oCAAkB;AAClD;AAEO,MAAM,cAAc,MAAe;AACxC,QAAM,CAAC,QAAQ,aAAa,2BAAkB,SAAS,CAAC;AAExD,8BAAU,MAAM;AACd,4BAAwB;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
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -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 spaceUtilities_exports = {};
|
|
29
22
|
__export(spaceUtilities_exports, {
|
|
30
23
|
fixSpace: () => fixSpace,
|
|
@@ -36,6 +29,7 @@ __export(spaceUtilities_exports, {
|
|
|
36
29
|
mapTemplateGrid: () => mapTemplateGrid,
|
|
37
30
|
numbersToFr: () => numbersToFr
|
|
38
31
|
});
|
|
32
|
+
module.exports = __toCommonJS(spaceUtilities_exports);
|
|
39
33
|
var React = __toESM(require("react"));
|
|
40
34
|
var import_lodash = require("lodash");
|
|
41
35
|
var import_theme = require("./theme");
|
|
@@ -90,5 +84,4 @@ function mapTemplateGrid(grid) {
|
|
|
90
84
|
}
|
|
91
85
|
return mapGrid(grid);
|
|
92
86
|
}
|
|
93
|
-
module.exports = __toCommonJS(spaceUtilities_exports);
|
|
94
87
|
//# sourceMappingURL=spaceUtilities.js.map
|