@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,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { styledFunction } from "./styledFunction.js";
|
|
3
|
+
import { styled as baseStyled } from "./system.js";
|
|
4
|
+
const keyofJsxIntrinsicElements = Object.keys(baseStyled);
|
|
5
|
+
const styledObject = keyofJsxIntrinsicElements.reduce((obj, key) => {
|
|
6
|
+
obj[key] = styledFunction(key);
|
|
7
|
+
return obj;
|
|
8
|
+
}, {});
|
|
9
|
+
export {
|
|
10
|
+
styledObject
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=styledObject.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/styled/styledObject.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { styledFunction } from './styledFunction.js';\nimport { styled as baseStyled } from './system.js';\n\ntype PreStyledObject = {\n [TTag in keyof JSX.IntrinsicElements]: unknown;\n};\n\nexport type StyledObject = {\n [TTag in keyof JSX.IntrinsicElements]: ReturnType<typeof styledFunction<TTag>>;\n};\n\nconst keyofJsxIntrinsicElements = Object.keys(baseStyled) as (keyof JSX.IntrinsicElements)[];\n\nexport const styledObject = keyofJsxIntrinsicElements.reduce((obj, key) => {\n obj[key] = styledFunction(key);\n return obj;\n}, {} as PreStyledObject) as StyledObject;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sBAAsB;AAC/B,SAAS,UAAU,kBAAkB;AAUrC,MAAM,4BAA4B,OAAO,KAAK,UAAU;AAEjD,MAAM,eAAe,0BAA0B,OAAO,CAAC,KAAK,QAAQ;AACzE,MAAI,GAAG,IAAI,eAAe,GAAG;AAC7B,SAAO;AACT,GAAG,CAAC,CAAoB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { style, compose } from "@xstyled/system";
|
|
3
|
+
import { th } from "../../th.js";
|
|
4
|
+
const bgColorGetter = (value) => (props) => `${th.color(value, value)(props)}`;
|
|
5
|
+
bgColorGetter.meta = {};
|
|
6
|
+
const bg = style({
|
|
7
|
+
prop: ["backgroundColor", "bg"],
|
|
8
|
+
css: "background-color",
|
|
9
|
+
themeGet: bgColorGetter
|
|
10
|
+
});
|
|
11
|
+
const background = compose(bg);
|
|
12
|
+
export {
|
|
13
|
+
background
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=background.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/styled/system-utilities/background.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { style, compose, type ThemeGetter } from '@xstyled/system';\nimport { th } from '../../th.js';\nimport type { PropsWithTheme } from '../types.js';\nimport type { BackgroundProps } from '../system-types.js';\n\ninterface DSThemeGetter extends ThemeGetter {\n (value: string): (props: PropsWithTheme) => string;\n meta: Record<string, unknown>;\n}\n\nconst bgColorGetter: DSThemeGetter = (value: string) => (props) => `${th.color(value, value)(props as PropsWithTheme)}`;\n\nbgColorGetter.meta = {};\n\nconst bg = style({\n prop: ['backgroundColor', 'bg'],\n css: 'background-color',\n themeGet: bgColorGetter,\n});\n\nexport const background = compose<BackgroundProps>(bg);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,OAAO,eAAiC;AACjD,SAAS,UAAU;AASnB,MAAM,gBAA+B,CAAC,UAAkB,CAAC,UAAU,GAAG,GAAG,MAAM,OAAO,KAAK,EAAE,KAAuB;AAEpH,cAAc,OAAO,CAAC;AAEtB,MAAM,KAAK,MAAM;AAAA,EACf,MAAM,CAAC,mBAAmB,IAAI;AAAA,EAC9B,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAEM,MAAM,aAAa,QAAyB,EAAE;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { style, compose } from "@xstyled/system";
|
|
3
|
+
import { th } from "../../th.js";
|
|
4
|
+
const colorReg = /(?:neutral|brand|success|danger|warning)-[0-9]{3}(?:-a[0-9]{2})?/;
|
|
5
|
+
const borderGetter = (value) => (props) => {
|
|
6
|
+
const color = value?.match?.(colorReg);
|
|
7
|
+
let borderCss = ``;
|
|
8
|
+
if (color) {
|
|
9
|
+
const widthAndStyle = value.replace(color[0], "").trim();
|
|
10
|
+
borderCss = `${th.color(color[0])(props)} ${widthAndStyle}`;
|
|
11
|
+
} else {
|
|
12
|
+
borderCss = value;
|
|
13
|
+
}
|
|
14
|
+
return borderCss;
|
|
15
|
+
};
|
|
16
|
+
borderGetter.meta = {};
|
|
17
|
+
const borderColorGetter = (value) => (props) => `${th.color(value, value)(props)}`;
|
|
18
|
+
borderColorGetter.meta = {};
|
|
19
|
+
function borderStyleGetter(value) {
|
|
20
|
+
return () => value;
|
|
21
|
+
}
|
|
22
|
+
borderStyleGetter.meta = {};
|
|
23
|
+
const borderWidthGetter = (value) => (props) => `${th.space(value, value)(props)}`;
|
|
24
|
+
borderWidthGetter.meta = {};
|
|
25
|
+
const borderRadiusGetter = (value) => (props) => `${th.space(value, value)(props)}`;
|
|
26
|
+
borderRadiusGetter.meta = {};
|
|
27
|
+
const border = style({
|
|
28
|
+
prop: "border",
|
|
29
|
+
css: "border",
|
|
30
|
+
themeGet: borderGetter
|
|
31
|
+
});
|
|
32
|
+
const borderTop = style({
|
|
33
|
+
prop: "borderTop",
|
|
34
|
+
css: "border-top",
|
|
35
|
+
themeGet: borderGetter
|
|
36
|
+
});
|
|
37
|
+
const borderBottom = style({
|
|
38
|
+
prop: "borderBottom",
|
|
39
|
+
css: "border-bottom",
|
|
40
|
+
themeGet: borderGetter
|
|
41
|
+
});
|
|
42
|
+
const borderRight = style({
|
|
43
|
+
prop: "borderRight",
|
|
44
|
+
css: "border-right",
|
|
45
|
+
themeGet: borderGetter
|
|
46
|
+
});
|
|
47
|
+
const borderLeft = style({
|
|
48
|
+
prop: "borderLeft",
|
|
49
|
+
css: "border-left",
|
|
50
|
+
themeGet: borderGetter
|
|
51
|
+
});
|
|
52
|
+
const borderColor = style({
|
|
53
|
+
prop: "borderColor",
|
|
54
|
+
css: "border-color",
|
|
55
|
+
themeGet: borderColorGetter
|
|
56
|
+
});
|
|
57
|
+
const borderTopColor = style({
|
|
58
|
+
prop: "borderTopColor",
|
|
59
|
+
css: "border-top-color",
|
|
60
|
+
themeGet: borderColorGetter
|
|
61
|
+
});
|
|
62
|
+
const borderBottomColor = style({
|
|
63
|
+
prop: "borderBottomColor",
|
|
64
|
+
css: "border-bottom-color",
|
|
65
|
+
themeGet: borderColorGetter
|
|
66
|
+
});
|
|
67
|
+
const borderRightColor = style({
|
|
68
|
+
prop: "borderRightColor",
|
|
69
|
+
css: "border-right-color",
|
|
70
|
+
themeGet: borderColorGetter
|
|
71
|
+
});
|
|
72
|
+
const borderLeftColor = style({
|
|
73
|
+
prop: "borderLeftColor",
|
|
74
|
+
css: "border-left-color",
|
|
75
|
+
themeGet: borderColorGetter
|
|
76
|
+
});
|
|
77
|
+
const borderStyle = style({
|
|
78
|
+
prop: "borderStyle",
|
|
79
|
+
css: "border-style",
|
|
80
|
+
themeGet: borderStyleGetter
|
|
81
|
+
});
|
|
82
|
+
const borderTopStyle = style({
|
|
83
|
+
prop: "borderTopStyle",
|
|
84
|
+
css: "border-top-style",
|
|
85
|
+
themeGet: borderStyleGetter
|
|
86
|
+
});
|
|
87
|
+
const borderBottomStyle = style({
|
|
88
|
+
prop: "borderBottomStyle",
|
|
89
|
+
css: "border-bottom-style",
|
|
90
|
+
themeGet: borderStyleGetter
|
|
91
|
+
});
|
|
92
|
+
const borderRightStyle = style({
|
|
93
|
+
prop: "borderRightStyle",
|
|
94
|
+
css: "border-right-style",
|
|
95
|
+
themeGet: borderStyleGetter
|
|
96
|
+
});
|
|
97
|
+
const borderLeftStyle = style({
|
|
98
|
+
prop: "borderLeftStyle",
|
|
99
|
+
css: "border-left-style",
|
|
100
|
+
themeGet: borderStyleGetter
|
|
101
|
+
});
|
|
102
|
+
const borderWidth = style({
|
|
103
|
+
prop: "borderWidth",
|
|
104
|
+
css: "border-width",
|
|
105
|
+
themeGet: borderWidthGetter
|
|
106
|
+
});
|
|
107
|
+
const borderTopWidth = style({
|
|
108
|
+
prop: "borderTopWidth",
|
|
109
|
+
css: "border-top-width",
|
|
110
|
+
themeGet: borderWidthGetter
|
|
111
|
+
});
|
|
112
|
+
const borderBottomWidth = style({
|
|
113
|
+
prop: "borderBottomWidth",
|
|
114
|
+
css: "border-bottom-width",
|
|
115
|
+
themeGet: borderWidthGetter
|
|
116
|
+
});
|
|
117
|
+
const borderRightWidth = style({
|
|
118
|
+
prop: "borderRightWidth",
|
|
119
|
+
css: "border-right-width",
|
|
120
|
+
themeGet: borderWidthGetter
|
|
121
|
+
});
|
|
122
|
+
const borderLeftWidth = style({
|
|
123
|
+
prop: "borderLeftWidth",
|
|
124
|
+
css: "border-left-width",
|
|
125
|
+
themeGet: borderWidthGetter
|
|
126
|
+
});
|
|
127
|
+
const borderRadius = style({
|
|
128
|
+
prop: "borderRadius",
|
|
129
|
+
css: "border-radius",
|
|
130
|
+
themeGet: borderRadiusGetter
|
|
131
|
+
});
|
|
132
|
+
const borders = compose(
|
|
133
|
+
border,
|
|
134
|
+
borderTop,
|
|
135
|
+
borderBottom,
|
|
136
|
+
borderLeft,
|
|
137
|
+
borderRight,
|
|
138
|
+
borderColor,
|
|
139
|
+
borderTopColor,
|
|
140
|
+
borderBottomColor,
|
|
141
|
+
borderLeftColor,
|
|
142
|
+
borderRightColor,
|
|
143
|
+
borderStyle,
|
|
144
|
+
borderTopStyle,
|
|
145
|
+
borderBottomStyle,
|
|
146
|
+
borderLeftStyle,
|
|
147
|
+
borderRightStyle,
|
|
148
|
+
borderWidth,
|
|
149
|
+
borderTopWidth,
|
|
150
|
+
borderBottomWidth,
|
|
151
|
+
borderLeftWidth,
|
|
152
|
+
borderRightWidth,
|
|
153
|
+
borderRadius
|
|
154
|
+
);
|
|
155
|
+
export {
|
|
156
|
+
borders
|
|
157
|
+
};
|
|
158
|
+
//# sourceMappingURL=border.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/styled/system-utilities/border.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable prettier/prettier */\n/* eslint-disable max-lines */\nimport { style, compose, type ThemeGetter } from '@xstyled/system';\nimport { th } from '../../th.js';\nimport type { PropsWithTheme } from '../types.js';\ninterface DSThemeGetter extends ThemeGetter {\n (value: string): (props: PropsWithTheme) => string;\n}\nconst colorReg = /(?:neutral|brand|success|danger|warning)-[0-9]{3}(?:-a[0-9]{2})?/;\n\nconst borderGetter: DSThemeGetter =\n (value: string) =>\n (props): string => {\n const color = value?.match?.(colorReg);\n let borderCss = ``;\n\n if (color) {\n const widthAndStyle = value.replace(color[0], '').trim();\n borderCss = `${th.color(color[0])(props as PropsWithTheme)} ${widthAndStyle}`;\n } else {\n borderCss = value;\n }\n\n return borderCss;\n };\n\nborderGetter.meta = {};\n\nconst borderColorGetter: DSThemeGetter =\n (value: string) =>\n (props): string =>\n `${th.color(value, value)(props as PropsWithTheme)}`;\n\nborderColorGetter.meta = {};\n\nfunction borderStyleGetter(value: string) {\n return (): string => value;\n}\n\nborderStyleGetter.meta = {};\n\nconst borderWidthGetter: DSThemeGetter =\n (value: string) =>\n (props): string =>\n `${th.space(value, value)(props as PropsWithTheme)}`;\n\nborderWidthGetter.meta = {};\n\nconst borderRadiusGetter: DSThemeGetter =\n (value: string) =>\n (props): string =>\n `${th.space(value, value)(props as PropsWithTheme)}`;\n\nborderRadiusGetter.meta = {};\n\nconst border = style({\n prop: 'border',\n css: 'border',\n themeGet: borderGetter,\n});\n\nconst borderTop = style({\n prop: 'borderTop',\n css: 'border-top',\n themeGet: borderGetter,\n});\n\nconst borderBottom = style({\n prop: 'borderBottom',\n css: 'border-bottom',\n themeGet: borderGetter,\n});\n\nconst borderRight = style({\n prop: 'borderRight',\n css: 'border-right',\n themeGet: borderGetter,\n});\n\nconst borderLeft = style({\n prop: 'borderLeft',\n css: 'border-left',\n themeGet: borderGetter,\n});\n\nconst borderColor = style({\n prop: 'borderColor',\n css: 'border-color',\n themeGet: borderColorGetter,\n});\n\nconst borderTopColor = style({\n prop: 'borderTopColor',\n css: 'border-top-color',\n themeGet: borderColorGetter,\n});\n\nconst borderBottomColor = style({\n prop: 'borderBottomColor',\n css: 'border-bottom-color',\n themeGet: borderColorGetter,\n});\n\nconst borderRightColor = style({\n prop: 'borderRightColor',\n css: 'border-right-color',\n themeGet: borderColorGetter,\n});\n\nconst borderLeftColor = style({\n prop: 'borderLeftColor',\n css: 'border-left-color',\n themeGet: borderColorGetter,\n});\n\nconst borderStyle = style({\n prop: 'borderStyle',\n css: 'border-style',\n themeGet: borderStyleGetter,\n});\n\nconst borderTopStyle = style({\n prop: 'borderTopStyle',\n css: 'border-top-style',\n themeGet: borderStyleGetter,\n});\n\nconst borderBottomStyle = style({\n prop: 'borderBottomStyle',\n css: 'border-bottom-style',\n themeGet: borderStyleGetter,\n});\n\nconst borderRightStyle = style({\n prop: 'borderRightStyle',\n css: 'border-right-style',\n themeGet: borderStyleGetter,\n});\n\nconst borderLeftStyle = style({\n prop: 'borderLeftStyle',\n css: 'border-left-style',\n themeGet: borderStyleGetter,\n});\n\nconst borderWidth = style({\n prop: 'borderWidth',\n css: 'border-width',\n themeGet: borderWidthGetter,\n});\n\nconst borderTopWidth = style({\n prop: 'borderTopWidth',\n css: 'border-top-width',\n themeGet: borderWidthGetter,\n});\n\nconst borderBottomWidth = style({\n prop: 'borderBottomWidth',\n css: 'border-bottom-width',\n themeGet: borderWidthGetter,\n});\n\nconst borderRightWidth = style({\n prop: 'borderRightWidth',\n css: 'border-right-width',\n themeGet: borderWidthGetter,\n});\n\nconst borderLeftWidth = style({\n prop: 'borderLeftWidth',\n css: 'border-left-width',\n themeGet: borderWidthGetter,\n});\n\nconst borderRadius = style({\n prop: 'borderRadius',\n css: 'border-radius',\n themeGet: borderRadiusGetter,\n});\n\nexport const borders = compose(\n border,\n borderTop,\n borderBottom,\n borderLeft,\n borderRight,\n borderColor,\n borderTopColor,\n borderBottomColor,\n borderLeftColor,\n borderRightColor,\n borderStyle,\n borderTopStyle,\n borderBottomStyle,\n borderLeftStyle,\n borderRightStyle,\n borderWidth,\n borderTopWidth,\n borderBottomWidth,\n borderLeftWidth,\n borderRightWidth,\n borderRadius,\n);\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { style, compose } from "@xstyled/system";
|
|
3
|
+
import { th } from "../../th.js";
|
|
4
|
+
function colorGetter(value) {
|
|
5
|
+
return (props) => `${th.color(value, value)(props)}`;
|
|
6
|
+
}
|
|
7
|
+
colorGetter.meta = {};
|
|
8
|
+
const colorStyled = style({
|
|
9
|
+
prop: ["color"],
|
|
10
|
+
css: ["color"],
|
|
11
|
+
themeGet: colorGetter
|
|
12
|
+
});
|
|
13
|
+
const color = compose(colorStyled);
|
|
14
|
+
export {
|
|
15
|
+
color
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=color.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/styled/system-utilities/color.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { Theme, Props } from '@xstyled/system';\nimport { style, compose } from '@xstyled/system';\nimport { th } from '../../th.js';\nimport type { PropsWithTheme } from '../types.js';\nimport type { ColorProps } from '../system-types.js';\n\nfunction colorGetter(value: string) {\n return (props: PropsWithTheme | Props<Theme>): string => `${th.color(value, value)(props as PropsWithTheme)}`;\n}\n\ncolorGetter.meta = {};\n\nconst colorStyled = style<ColorProps>({\n prop: ['color'],\n css: ['color'],\n themeGet: colorGetter,\n});\n\nexport const color = compose(colorStyled);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,OAAO,eAAe;AAC/B,SAAS,UAAU;AAInB,SAAS,YAAY,OAAe;AAClC,SAAO,CAAC,UAAiD,GAAG,GAAG,MAAM,OAAO,KAAK,EAAE,KAAuB;AAC5G;AAEA,YAAY,OAAO,CAAC;AAEpB,MAAM,cAAc,MAAkB;AAAA,EACpC,MAAM,CAAC,OAAO;AAAA,EACd,KAAK,CAAC,OAAO;AAAA,EACb,UAAU;AACZ,CAAC;AAEM,MAAM,QAAQ,QAAQ,WAAW;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { layout, flexboxes, grids, boxShadow, fontSize } from "@xstyled/system";
|
|
3
|
+
import { background } from "./background.js";
|
|
4
|
+
import { borders } from "./border.js";
|
|
5
|
+
import { color } from "./color.js";
|
|
6
|
+
import { sizing } from "./sizing.js";
|
|
7
|
+
import { space } from "./space.js";
|
|
8
|
+
export {
|
|
9
|
+
background,
|
|
10
|
+
borders,
|
|
11
|
+
boxShadow as boxShadows,
|
|
12
|
+
color,
|
|
13
|
+
flexboxes,
|
|
14
|
+
fontSize,
|
|
15
|
+
grids,
|
|
16
|
+
layout,
|
|
17
|
+
sizing,
|
|
18
|
+
space
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/styled/system-utilities/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { layout, flexboxes, grids, boxShadow as boxShadows, fontSize } from '@xstyled/system';\nexport { background } from './background.js';\nexport { borders } from './border.js';\nexport { color } from './color.js';\nexport { sizing } from './sizing.js';\nexport { space } from './space.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,WAAW,OAAoB,WAAY,gBAAgB;AAC5E,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AACxB,SAAS,aAAa;AACtB,SAAS,cAAc;AACvB,SAAS,aAAa;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { style, compose, getSize } from "@xstyled/system";
|
|
3
|
+
const width = style({
|
|
4
|
+
prop: ["width", "w"],
|
|
5
|
+
css: "width",
|
|
6
|
+
themeGet: getSize
|
|
7
|
+
});
|
|
8
|
+
const height = style({
|
|
9
|
+
prop: ["height", "h"],
|
|
10
|
+
css: "height",
|
|
11
|
+
themeGet: getSize
|
|
12
|
+
});
|
|
13
|
+
const maxHeight = style({
|
|
14
|
+
prop: ["maxH", "maxHeight"],
|
|
15
|
+
css: "max-height",
|
|
16
|
+
themeGet: getSize
|
|
17
|
+
});
|
|
18
|
+
const maxWidth = style({
|
|
19
|
+
prop: ["maxW", "maxWidth"],
|
|
20
|
+
css: "max-width",
|
|
21
|
+
themeGet: getSize
|
|
22
|
+
});
|
|
23
|
+
const minHeight = style({
|
|
24
|
+
prop: ["minH", "minHeight"],
|
|
25
|
+
css: "min-height",
|
|
26
|
+
themeGet: getSize
|
|
27
|
+
});
|
|
28
|
+
const minWidth = style({
|
|
29
|
+
prop: ["minW", "minWidth"],
|
|
30
|
+
css: "min-width",
|
|
31
|
+
themeGet: getSize
|
|
32
|
+
});
|
|
33
|
+
const sizing = compose(width, maxWidth, height, maxHeight, minHeight, minWidth);
|
|
34
|
+
export {
|
|
35
|
+
sizing
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=sizing.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/styled/system-utilities/sizing.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,OAAO,SAAS,eAAe;AAExC,MAAM,QAAQ,MAAM;AAAA,EAClB,MAAM,CAAC,SAAS,GAAG;AAAA,EACnB,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,SAAS,MAAM;AAAA,EACnB,MAAM,CAAC,UAAU,GAAG;AAAA,EACpB,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,YAAY,MAAM;AAAA,EACtB,MAAM,CAAC,QAAQ,WAAW;AAAA,EAC1B,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,WAAW,MAAM;AAAA,EACrB,MAAM,CAAC,QAAQ,UAAU;AAAA,EACzB,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,YAAY,MAAM;AAAA,EACtB,MAAM,CAAC,QAAQ,WAAW;AAAA,EAC1B,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,WAAW,MAAM;AAAA,EACrB,MAAM,CAAC,QAAQ,UAAU;AAAA,EACzB,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAEM,MAAM,SAAS,QAAQ,OAAO,UAAU,QAAQ,WAAW,WAAW,QAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/styled/system-utilities/space.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { space as xstyledSpace, type StyleGenerator } from '@xstyled/system';\nimport type { SpaceProps } from '../system-types.js';\n\nexport const space = xstyledSpace as unknown as StyleGenerator<SpaceProps>;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,SAAS,oBAAyC;AAGpD,MAAM,QAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { createCss } from "@xstyled/styled-components";
|
|
3
|
+
import { system, compose } from "@xstyled/system";
|
|
4
|
+
const { css, styled, createGlobalStyle } = createCss(compose(system));
|
|
5
|
+
export {
|
|
6
|
+
createGlobalStyle,
|
|
7
|
+
css,
|
|
8
|
+
styled
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=system.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/styled/system.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createCss } from '@xstyled/styled-components';\nimport { system, compose } from '@xstyled/system';\n\n// We create our own system from the default xstyled system\nexport const { css, styled, createGlobalStyle } = createCss(compose(system));\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,iBAAiB;AAC1B,SAAS,QAAQ,eAAe;AAGzB,MAAM,EAAE,KAAK,QAAQ,kBAAkB,IAAI,UAAU,QAAQ,MAAM,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/styled/transformers/index.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { magicCssTransform } from './magicCssTransform.js';\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,yBAAyB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { th } from "../../th.js";
|
|
3
|
+
const COLOR_REGEX = /(neutral|brand|success|warning|danger)-(100|200|300|400|500|600|700|800|900|000|050|080)/g;
|
|
4
|
+
const magicfyCss = (rawValue) => {
|
|
5
|
+
let matches;
|
|
6
|
+
let lastIndex = 0;
|
|
7
|
+
const splittedValue = [];
|
|
8
|
+
const themeGetters = [];
|
|
9
|
+
while (matches = COLOR_REGEX.exec(rawValue)) {
|
|
10
|
+
const [match] = matches;
|
|
11
|
+
splittedValue.push(rawValue.slice(lastIndex, matches.index));
|
|
12
|
+
themeGetters.push(th.color(match, match));
|
|
13
|
+
lastIndex = matches.index + match.length;
|
|
14
|
+
}
|
|
15
|
+
splittedValue.push(rawValue.slice(lastIndex, rawValue.length));
|
|
16
|
+
return [splittedValue, themeGetters];
|
|
17
|
+
};
|
|
18
|
+
const magicCssTransform = (styleArg, expressions) => {
|
|
19
|
+
if (!Array.isArray(styleArg))
|
|
20
|
+
return [styleArg, expressions];
|
|
21
|
+
const magicStyleArg = [];
|
|
22
|
+
const magicExpressions = [];
|
|
23
|
+
const templateStringArray = styleArg;
|
|
24
|
+
templateStringArray.forEach((templateString, index) => {
|
|
25
|
+
const [splittedTemplateString, themeGetters] = magicfyCss(templateString);
|
|
26
|
+
magicStyleArg.push(...splittedTemplateString);
|
|
27
|
+
magicExpressions.push(...themeGetters);
|
|
28
|
+
if (index < expressions.length)
|
|
29
|
+
magicExpressions.push(expressions[index]);
|
|
30
|
+
});
|
|
31
|
+
return [Object.assign(magicStyleArg, { raw: [...magicStyleArg] }), magicExpressions];
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
magicCssTransform
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=magicCssTransform.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/styled/transformers/magicCssTransform.ts"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { th } from '../../th.js';\nimport type { Expressions, StyleArg } from '../types.js';\n\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[], Expressions] => {\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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,UAAU;AAQnB,MAAM,cAAc;AAEpB,MAAM,aAAa,CAAC,aAA8C;AAChE,MAAI;AACJ,MAAI,YAAY;AAChB,QAAM,gBAA0B,CAAC;AACjC,QAAM,eAAe,CAAC;AACtB,SAAQ,UAAU,YAAY,KAAK,QAAQ,GAAI;AAC7C,UAAM,CAAC,KAAK,IAAI;AAChB,kBAAc,KAAK,SAAS,MAAM,WAAW,QAAQ,KAAK,CAAC;AAE3D,iBAAa,KAAK,GAAG,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,YAAY,IAAI,WAAW,cAAc;AACxE,kBAAc,KAAK,GAAG,sBAAsB;AAC5C,qBAAiB,KAAK,GAAG,YAAY;AACrC,QAAI,QAAQ,YAAY;AAAQ,uBAAiB,KAAK,YAAY,KAAK,CAAC;AAAA,EAC1E,CAAC;AAED,SAAO,CAAC,OAAO,OAAO,eAAe,EAAE,KAAK,CAAC,GAAG,aAAa,EAAE,CAAC,GAAG,gBAAgB;AACrF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dist/esm/th.js
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const hexToRgba = (hex, alpha) => {
|
|
3
|
+
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
|
|
4
|
+
if (result) {
|
|
5
|
+
return `rgba(${parseInt(result[1], 16)}, ${parseInt(result[2], 16)}, ${parseInt(result[3], 16)}, ${alpha})`;
|
|
6
|
+
}
|
|
7
|
+
return ``;
|
|
8
|
+
};
|
|
9
|
+
const colorGetter = (value, dfault = "") => ({ theme }) => {
|
|
10
|
+
const colorValues = value.split("-");
|
|
11
|
+
if (colorValues.length === 1)
|
|
12
|
+
return colorValues[0];
|
|
13
|
+
if (colorValues.length > 3)
|
|
14
|
+
return dfault;
|
|
15
|
+
const [colorType, colorValue, alpha] = colorValues;
|
|
16
|
+
const themeColor = theme.colors && theme.colors[colorType]?.[colorValue];
|
|
17
|
+
if (!themeColor)
|
|
18
|
+
return dfault;
|
|
19
|
+
if (alpha) {
|
|
20
|
+
const alphaFloatingNumber = `0.${alpha.slice(1)}`;
|
|
21
|
+
return hexToRgba(themeColor, alphaFloatingNumber);
|
|
22
|
+
}
|
|
23
|
+
return themeColor;
|
|
24
|
+
};
|
|
25
|
+
const genericGetter = (property) => (value, dfault = "") => ({ theme }) => {
|
|
26
|
+
const parts = value.split("-");
|
|
27
|
+
let result = theme[property];
|
|
28
|
+
parts.forEach((part) => {
|
|
29
|
+
if (result)
|
|
30
|
+
result = result[part];
|
|
31
|
+
});
|
|
32
|
+
return result ?? dfault;
|
|
33
|
+
};
|
|
34
|
+
const th = (property) => {
|
|
35
|
+
switch (property) {
|
|
36
|
+
case "colors":
|
|
37
|
+
return colorGetter;
|
|
38
|
+
default:
|
|
39
|
+
return genericGetter(property);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
th.space = th("space");
|
|
43
|
+
th.fontSize = th("fontSizes");
|
|
44
|
+
th.fontWeight = th("fontWeights");
|
|
45
|
+
th.lineHeight = th("lineHeights");
|
|
46
|
+
th.letterSpacing = th("letterSpacings");
|
|
47
|
+
th.font = th("fonts");
|
|
48
|
+
th.color = th("colors");
|
|
49
|
+
th.breakpoint = th("breakpoints");
|
|
50
|
+
th.media = th("media");
|
|
51
|
+
th.zIndex = th("zIndex");
|
|
52
|
+
export {
|
|
53
|
+
hexToRgba,
|
|
54
|
+
th
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=th.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/th.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable indent */\nimport type { Theme } from '@elliemae/pui-theme';\nimport type { PropsWithTheme } from './styled/index.js';\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 = <T>({ theme }: PropsWithTheme<T>) => 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 zIndex: 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 <T,>(value: string, dfault = ''): ThemeStringGetter<T> =>\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');\nth.zIndex = th('zIndex');\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACIhB,MAAM,YAAY,CAAC,KAAa,UAAkB;AACvD,QAAM,SAAS,4CAA4C,KAAK,GAAG;AAEnE,MAAI,QAAQ;AACV,WAAO,QAAQ,SAAS,OAAO,CAAC,GAAG,EAAE,MAAM,SAAS,OAAO,CAAC,GAAG,EAAE,MAAM,SAAS,OAAO,CAAC,GAAG,EAAE,MAAM;AAAA,EACrG;AACA,SAAO;AACT;AAmBA,MAAM,cACJ,CAAC,OAAO,SAAS,OACjB,CAAC,EAAE,MAAM,MAAM;AACb,QAAM,cAAc,MAAM,MAAM,GAAG;AAEnC,MAAI,YAAY,WAAW;AAAG,WAAO,YAAY,CAAC;AAElD,MAAI,YAAY,SAAS;AAAG,WAAO;AAEnC,QAAM,CAAC,WAAW,YAAY,KAAK,IAAI;AAMvC,QAAM,aAAa,MAAM,UAAU,MAAM,OAAO,SAAS,IAAI,UAAU;AAEvE,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,CAAK,OAAe,SAAS,OAC7B,CAAC,EAAE,MAAM,MAAM;AACb,QAAM,QAAQ,MAAM,MAAM,GAAG;AAC7B,MAAI,SAAS,MAAM,QAAQ;AAC3B,QAAM,QAAQ,CAAC,SAAS;AACtB,QAAI;AAAQ,eAAS,OAAO,IAA2B;AAAA,EACzD,CAAC;AACD,SAAQ,UAAgC;AAC1C;AAEK,MAAM,KAAoB,CAAC,aAAuB;AACvD,UAAQ,UAAU;AAAA,IAChB,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO,cAAc,QAAQ;AAAA,EACjC;AACF;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;AACrB,GAAG,SAAS,GAAG,QAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/theme.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { getDefaultTheme } from '@elliemae/pui-theme';\nimport type { Theme } from '@elliemae/pui-theme';\n\nexport const theme = getDefaultTheme() as Theme;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,uBAAuB;AAGzB,MAAM,QAAQ,gBAAgB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { ThemeProvider } from "@xstyled/styled-components";
|
|
4
|
+
import { theme } from "./theme.js";
|
|
5
|
+
const themeProviderHOC = (Component) => {
|
|
6
|
+
const WrappedComponent = (props) => /* @__PURE__ */ jsx(ThemeProvider, { theme, children: /* @__PURE__ */ jsx(Component, { ...props }) });
|
|
7
|
+
return WrappedComponent;
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
themeProviderHOC
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=themeProviderHOC.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../src/themeProviderHOC.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { ThemeProvider } from '@xstyled/styled-components';\nimport { theme } from './theme.js';\n\nexport const themeProviderHOC = <T extends JSX.IntrinsicAttributes>(Component: React.ComponentType<T>) => {\n const WrappedComponent: React.ComponentType<T> = (props) => (\n <ThemeProvider theme={theme}>\n <Component {...props} />\n </ThemeProvider>\n );\n return WrappedComponent;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACOjB;AANN,SAAS,qBAAqB;AAC9B,SAAS,aAAa;AAEf,MAAM,mBAAmB,CAAoC,cAAsC;AACxG,QAAM,mBAA2C,CAAC,UAChD,oBAAC,iBAAc,OACb,8BAAC,aAAW,GAAG,OAAO,GACxB;AAEF,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|