@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,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var genVariantOverridesExpression_exports = {};
|
|
30
|
+
__export(genVariantOverridesExpression_exports, {
|
|
31
|
+
genVariantOverridesExpression: () => genVariantOverridesExpression
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(genVariantOverridesExpression_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_theme = require("../../theme.js");
|
|
36
|
+
var import_helpers = require("../helpers.js");
|
|
37
|
+
const getVariantStyles = (name, theme) => {
|
|
38
|
+
const variants = theme.components?.[name]?.variants || [];
|
|
39
|
+
return variants.reduce(
|
|
40
|
+
(styles, definition) => {
|
|
41
|
+
const key = (0, import_helpers.propsToClassKey)(definition.props);
|
|
42
|
+
styles[key] = definition.style;
|
|
43
|
+
return styles;
|
|
44
|
+
},
|
|
45
|
+
{}
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
const genVariantOverridesExpression = (componentName) => (props) => {
|
|
49
|
+
const theme = props.theme ?? import_theme.theme;
|
|
50
|
+
const variantStyles = getVariantStyles(componentName, theme);
|
|
51
|
+
const themeVariants = theme?.components?.[componentName]?.variants || [];
|
|
52
|
+
return themeVariants.reduce(
|
|
53
|
+
(resultingStyles, themeVariant) => {
|
|
54
|
+
const isMatch = Object.keys(themeVariant.props).every((key) => props[key] === themeVariant.props[key]);
|
|
55
|
+
if (isMatch) {
|
|
56
|
+
resultingStyles.push(variantStyles[(0, import_helpers.propsToClassKey)(themeVariant.props)]);
|
|
57
|
+
}
|
|
58
|
+
return resultingStyles;
|
|
59
|
+
},
|
|
60
|
+
[]
|
|
61
|
+
);
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=genVariantOverridesExpression.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/styled/expressions/genVariantOverridesExpression.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import type { PropsWithTheme, Theme } from '../types.js';\nimport { theme as defaultTheme } from '../../theme.js';\nimport type { CSSObject } from 'styled-components';\nimport { propsToClassKey } from '../helpers.js';\n\nconst getVariantStyles = (name: string, theme: Theme): Record<string, CSSObject> => {\n const variants = theme.components?.[name]?.variants || [];\n\n return variants.reduce(\n (styles, definition) => {\n const key = propsToClassKey(definition.props);\n styles[key] = definition.style;\n return styles;\n },\n {} as Record<string, CSSObject>,\n );\n};\n\nexport const genVariantOverridesExpression = (componentName: string) => (props: PropsWithTheme) => {\n const theme = props.theme ?? defaultTheme;\n const variantStyles = getVariantStyles(componentName, theme);\n\n const themeVariants = theme?.components?.[componentName]?.variants || [];\n\n return themeVariants.reduce(\n (resultingStyles, themeVariant) => {\n const isMatch = Object.keys(themeVariant.props).every((key) => props[key] === themeVariant.props[key]);\n if (isMatch) {\n resultingStyles.push(variantStyles[propsToClassKey(themeVariant.props)]);\n }\n return resultingStyles;\n },\n [] as CSSObject[keyof CSSObject][],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAsC;AAEtC,qBAAgC;AAEhC,MAAM,mBAAmB,CAAC,MAAc,UAA4C;AAClF,QAAM,WAAW,MAAM,aAAa,IAAI,GAAG,YAAY,CAAC;AAExD,SAAO,SAAS;AAAA,IACd,CAAC,QAAQ,eAAe;AACtB,YAAM,UAAM,gCAAgB,WAAW,KAAK;AAC5C,aAAO,GAAG,IAAI,WAAW;AACzB,aAAO;AAAA,IACT;AAAA,IACA,CAAC;AAAA,EACH;AACF;AAEO,MAAM,gCAAgC,CAAC,kBAA0B,CAAC,UAA0B;AACjG,QAAM,QAAQ,MAAM,SAAS,aAAAA;AAC7B,QAAM,gBAAgB,iBAAiB,eAAe,KAAK;AAE3D,QAAM,gBAAgB,OAAO,aAAa,aAAa,GAAG,YAAY,CAAC;AAEvE,SAAO,cAAc;AAAA,IACnB,CAAC,iBAAiB,iBAAiB;AACjC,YAAM,UAAU,OAAO,KAAK,aAAa,KAAK,EAAE,MAAM,CAAC,QAAQ,MAAM,GAAG,MAAM,aAAa,MAAM,GAAG,CAAC;AACrG,UAAI,SAAS;AACX,wBAAgB,KAAK,kBAAc,gCAAgB,aAAa,KAAK,CAAC,CAAC;AAAA,MACzE;AACA,aAAO;AAAA,IACT;AAAA,IACA,CAAC;AAAA,EACH;AACF;",
|
|
6
|
+
"names": ["defaultTheme"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var expressions_exports = {};
|
|
30
|
+
__export(expressions_exports, {
|
|
31
|
+
genStyleOverridesExpression: () => import_genStyleOverridesExpression.genStyleOverridesExpression,
|
|
32
|
+
genVariantOverridesExpression: () => import_genVariantOverridesExpression.genVariantOverridesExpression
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(expressions_exports);
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_genStyleOverridesExpression = require("./genStyleOverridesExpression.js");
|
|
37
|
+
var import_genVariantOverridesExpression = require("./genVariantOverridesExpression.js");
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/styled/expressions/index.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export { genStyleOverridesExpression } from './genStyleOverridesExpression.js';\nexport { genVariantOverridesExpression } from './genVariantOverridesExpression.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,yCAA4C;AAC5C,2CAA8C;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var fixStyleArg_exports = {};
|
|
30
|
+
__export(fixStyleArg_exports, {
|
|
31
|
+
fixStyleArg: () => fixStyleArg
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(fixStyleArg_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_theme = require("../theme.js");
|
|
36
|
+
const isTemplateStringsArray = (styleArg) => Array.isArray(styleArg);
|
|
37
|
+
const fixStyleArg = (styleArg, numberOfNewExpressions) => {
|
|
38
|
+
if (isTemplateStringsArray(styleArg) && numberOfNewExpressions > 0) {
|
|
39
|
+
const placeholders = new Array(numberOfNewExpressions).fill("");
|
|
40
|
+
return Object.assign([...styleArg, ...placeholders], {
|
|
41
|
+
raw: [...styleArg.raw, ...placeholders]
|
|
42
|
+
});
|
|
43
|
+
} else if (typeof styleArg === "function") {
|
|
44
|
+
return (props) => styleArg({ ...props, theme: props.theme ?? import_theme.theme });
|
|
45
|
+
}
|
|
46
|
+
return styleArg;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=fixStyleArg.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/styled/fixStyleArg.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import { theme as defaultTheme } from '../theme.js';\nimport type { PropsWithTheme, StyleArg } from './types.js';\n\nconst isTemplateStringsArray = (styleArg: StyleArg): styleArg is TemplateStringsArray => Array.isArray(styleArg);\n\nexport const fixStyleArg = (styleArg: StyleArg, numberOfNewExpressions: number): StyleArg => {\n if (isTemplateStringsArray(styleArg) && numberOfNewExpressions > 0) {\n // Here we are adding placeholders for all the new functions that we are gonna call\n const placeholders = new Array(numberOfNewExpressions).fill('') as string[];\n return Object.assign([...styleArg, ...placeholders], {\n raw: [...styleArg.raw, ...placeholders],\n });\n } else if (typeof styleArg === 'function') {\n // Here we just coerce with the default theme\n return (props: PropsWithTheme) => styleArg({ ...props, theme: props.theme ?? defaultTheme });\n }\n return styleArg;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAsC;AAGtC,MAAM,yBAAyB,CAAC,aAAyD,MAAM,QAAQ,QAAQ;AAExG,MAAM,cAAc,CAAC,UAAoB,2BAA6C;AAC3F,MAAI,uBAAuB,QAAQ,KAAK,yBAAyB,GAAG;AAElE,UAAM,eAAe,IAAI,MAAM,sBAAsB,EAAE,KAAK,EAAE;AAC9D,WAAO,OAAO,OAAO,CAAC,GAAG,UAAU,GAAG,YAAY,GAAG;AAAA,MACnD,KAAK,CAAC,GAAG,SAAS,KAAK,GAAG,YAAY;AAAA,IACxC,CAAC;AAAA,EACH,WAAW,OAAO,aAAa,YAAY;AAEzC,WAAO,CAAC,UAA0B,SAAS,EAAE,GAAG,OAAO,OAAO,MAAM,SAAS,aAAAA,MAAa,CAAC;AAAA,EAC7F;AACA,SAAO;AACT;",
|
|
6
|
+
"names": ["defaultTheme"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var generateAttributes_exports = {};
|
|
30
|
+
__export(generateAttributes_exports, {
|
|
31
|
+
generateAttributes: () => generateAttributes
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(generateAttributes_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_helpers = require("../helpers.js");
|
|
36
|
+
var import_callbackMerger = require("./utils/callbackMerger.js");
|
|
37
|
+
var import_refMerger = require("./utils/refMerger.js");
|
|
38
|
+
const generateClassName = (props, meta) => {
|
|
39
|
+
if (meta.displayName === null)
|
|
40
|
+
return {};
|
|
41
|
+
return {
|
|
42
|
+
className: meta.displayName
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
const generateDataTestId = (props, meta) => {
|
|
46
|
+
if (meta.displayName === null)
|
|
47
|
+
return {};
|
|
48
|
+
return {
|
|
49
|
+
"data-testid": props["data-testid"] ?? (0, import_helpers.displayNameToKebabCase)(meta.displayName)
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
const generateGlobalAttributes = (props) => {
|
|
53
|
+
const { getOwnerProps, getOwnerPropsArguments } = props;
|
|
54
|
+
if (getOwnerProps === void 0)
|
|
55
|
+
return {};
|
|
56
|
+
const ownerPropsValue = getOwnerProps();
|
|
57
|
+
const ownerPropsArgumentsValue = getOwnerPropsArguments?.() ?? {};
|
|
58
|
+
const elementProps = ownerPropsValue[props["data-testid"]];
|
|
59
|
+
if (elementProps === void 0 || elementProps === null)
|
|
60
|
+
return {};
|
|
61
|
+
const resultingObject = typeof elementProps === "function" ? elementProps(ownerPropsArgumentsValue) : elementProps;
|
|
62
|
+
const resultingObjectWithRefMerged = (0, import_refMerger.refMerger)(props, resultingObject);
|
|
63
|
+
const resultingObjectWithCallbackMerged = (0, import_callbackMerger.callbackMerger)(props, resultingObjectWithRefMerged);
|
|
64
|
+
return resultingObjectWithCallbackMerged;
|
|
65
|
+
};
|
|
66
|
+
const wrap = (func, meta) => (props) => func(props, meta);
|
|
67
|
+
const generateAttributes = (options, displayName) => {
|
|
68
|
+
const meta = { options, displayName };
|
|
69
|
+
return [wrap(generateClassName, meta), wrap(generateDataTestId, meta), wrap(generateGlobalAttributes, meta)];
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=generateAttributes.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/styled/generated-attributes/generateAttributes.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { displayNameToKebabCase } from '../helpers.js';\nimport type { AttrsFunc, InternalAttrsFunc, Options, OwnerInterface, PartProps } from '../types.js';\nimport { callbackMerger } from './utils/callbackMerger.js';\nimport { refMerger } from './utils/refMerger.js';\n\nconst generateClassName: InternalAttrsFunc = (props, meta) => {\n if (meta.displayName === null) return {};\n return {\n className: meta.displayName,\n };\n};\n\nconst generateDataTestId: InternalAttrsFunc<{ 'data-testid': string }> = (props, meta) => {\n if (meta.displayName === null) return {};\n return {\n 'data-testid': props['data-testid'] ?? displayNameToKebabCase(meta.displayName),\n };\n};\n\nconst generateGlobalAttributes: InternalAttrsFunc<{ 'data-testid': string } & OwnerInterface> = (props) => {\n const { getOwnerProps, getOwnerPropsArguments } = props;\n\n // If no ownerProps are provided, we won't add global attributes\n if (getOwnerProps === undefined) return {};\n\n const ownerPropsValue = getOwnerProps() as Record<string, PartProps>;\n const ownerPropsArgumentsValue = getOwnerPropsArguments?.() ?? {};\n\n const elementProps = ownerPropsValue[props['data-testid']];\n\n // If no elementProps are present, we won't add global attributes either\n if (elementProps === undefined || elementProps === null) return {};\n\n // If elementProps is a function, we call it with the ownerPropsArguments\n // Otherwise we assign it directly\n const resultingObject = typeof elementProps === 'function' ? elementProps(ownerPropsArgumentsValue) : elementProps;\n\n const resultingObjectWithRefMerged = refMerger(props, resultingObject);\n\n const resultingObjectWithCallbackMerged = callbackMerger(props, resultingObjectWithRefMerged);\n\n return resultingObjectWithCallbackMerged;\n};\n\nconst wrap =\n <T extends object>(\n func: InternalAttrsFunc<T>,\n meta: { options: Options; displayName: string | null },\n ): AttrsFunc<T> =>\n (props) =>\n func(props, meta);\n\nexport const generateAttributes = (options: Options, displayName: string | null): AttrsFunc<any>[] => {\n const meta = { options, displayName };\n\n // Comprehensive list of all the generators above\n // ORDER MATTERS: the attributes returned by previous functions, are received as props by the next ones\n return [wrap(generateClassName, meta), wrap(generateDataTestId, meta), wrap(generateGlobalAttributes, meta)];\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,qBAAuC;AAEvC,4BAA+B;AAC/B,uBAA0B;AAE1B,MAAM,oBAAuC,CAAC,OAAO,SAAS;AAC5D,MAAI,KAAK,gBAAgB;AAAM,WAAO,CAAC;AACvC,SAAO;AAAA,IACL,WAAW,KAAK;AAAA,EAClB;AACF;AAEA,MAAM,qBAAmE,CAAC,OAAO,SAAS;AACxF,MAAI,KAAK,gBAAgB;AAAM,WAAO,CAAC;AACvC,SAAO;AAAA,IACL,eAAe,MAAM,aAAa,SAAK,uCAAuB,KAAK,WAAW;AAAA,EAChF;AACF;AAEA,MAAM,2BAA0F,CAAC,UAAU;AACzG,QAAM,EAAE,eAAe,uBAAuB,IAAI;AAGlD,MAAI,kBAAkB;AAAW,WAAO,CAAC;AAEzC,QAAM,kBAAkB,cAAc;AACtC,QAAM,2BAA2B,yBAAyB,KAAK,CAAC;AAEhE,QAAM,eAAe,gBAAgB,MAAM,aAAa,CAAC;AAGzD,MAAI,iBAAiB,UAAa,iBAAiB;AAAM,WAAO,CAAC;AAIjE,QAAM,kBAAkB,OAAO,iBAAiB,aAAa,aAAa,wBAAwB,IAAI;AAEtG,QAAM,mCAA+B,4BAAU,OAAO,eAAe;AAErE,QAAM,wCAAoC,sCAAe,OAAO,4BAA4B;AAE5F,SAAO;AACT;AAEA,MAAM,OACJ,CACE,MACA,SAEF,CAAC,UACC,KAAK,OAAO,IAAI;AAEb,MAAM,qBAAqB,CAAC,SAAkB,gBAAiD;AACpG,QAAM,OAAO,EAAE,SAAS,YAAY;AAIpC,SAAO,CAAC,KAAK,mBAAmB,IAAI,GAAG,KAAK,oBAAoB,IAAI,GAAG,KAAK,0BAA0B,IAAI,CAAC;AAC7G;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var generateAutoCalculated_exports = {};
|
|
30
|
+
__export(generateAutoCalculated_exports, {
|
|
31
|
+
generateAutoCalculated: () => generateAutoCalculated
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(generateAutoCalculated_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_generateDisplayName = require("./generateDisplayName.js");
|
|
36
|
+
var import_generateAttributes = require("./generateAttributes.js");
|
|
37
|
+
const generateAutoCalculated = (options) => {
|
|
38
|
+
const displayName = (0, import_generateDisplayName.generateDisplayName)(options);
|
|
39
|
+
const attributes = (0, import_generateAttributes.generateAttributes)(options, displayName);
|
|
40
|
+
return [displayName, attributes];
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=generateAutoCalculated.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/styled/generated-attributes/generateAutoCalculated.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import type { Options } from '../types.js';\nimport { generateDisplayName } from './generateDisplayName.js';\nimport { generateAttributes } from './generateAttributes.js';\n\nexport const generateAutoCalculated = (options: Options) => {\n const displayName = generateDisplayName(options);\n\n const attributes = generateAttributes(options, displayName);\n\n return [displayName, attributes] as const;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,iCAAoC;AACpC,gCAAmC;AAE5B,MAAM,yBAAyB,CAAC,YAAqB;AAC1D,QAAM,kBAAc,gDAAoB,OAAO;AAE/C,QAAM,iBAAa,8CAAmB,SAAS,WAAW;AAE1D,SAAO,CAAC,aAAa,UAAU;AACjC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var generateDisplayName_exports = {};
|
|
30
|
+
__export(generateDisplayName_exports, {
|
|
31
|
+
generateDisplayName: () => generateDisplayName
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(generateDisplayName_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
const generateDisplayName = (options) => {
|
|
36
|
+
const { name: componentName, slot: componentSlot } = options;
|
|
37
|
+
if (componentName === null || componentSlot === null)
|
|
38
|
+
return null;
|
|
39
|
+
return `${componentName}-${componentSlot}`;
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=generateDisplayName.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/styled/generated-attributes/generateDisplayName.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import type { Options } from '../types.js';\n\nexport const generateDisplayName = (options: Options) => {\n const { name: componentName, slot: componentSlot } = options;\n\n if (componentName === null || componentSlot === null) return null;\n\n return `${componentName}-${componentSlot}`;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,sBAAsB,CAAC,YAAqB;AACvD,QAAM,EAAE,MAAM,eAAe,MAAM,cAAc,IAAI;AAErD,MAAI,kBAAkB,QAAQ,kBAAkB;AAAM,WAAO;AAE7D,SAAO,GAAG,iBAAiB;AAC7B;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var generated_attributes_exports = {};
|
|
30
|
+
__export(generated_attributes_exports, {
|
|
31
|
+
generateAutoCalculated: () => import_generateAutoCalculated.generateAutoCalculated
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(generated_attributes_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
var import_generateAutoCalculated = require("./generateAutoCalculated.js");
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/styled/generated-attributes/index.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["export { generateAutoCalculated } from './generateAutoCalculated.js';\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oCAAuC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var callbackMerger_exports = {};
|
|
30
|
+
__export(callbackMerger_exports, {
|
|
31
|
+
callbackMerger: () => callbackMerger
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(callbackMerger_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
const notARefKey = (key) => !["ref", "innerRef"].includes(key);
|
|
36
|
+
const callbackMerger = (props, object) => {
|
|
37
|
+
const newObject = { ...object };
|
|
38
|
+
Object.keys(object).forEach((key) => {
|
|
39
|
+
const propsValue = props[key];
|
|
40
|
+
const resultingObjectValue = object[key];
|
|
41
|
+
if (typeof propsValue === "function" && typeof resultingObjectValue === "function" && notARefKey(key)) {
|
|
42
|
+
newObject[key] = (...args) => {
|
|
43
|
+
propsValue(...args);
|
|
44
|
+
resultingObjectValue(...args);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return newObject;
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=callbackMerger.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/styled/generated-attributes/utils/callbackMerger.ts", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import type { StyledComponentInnerComponent, StyledComponentPropsWithRef } from 'styled-components';\n\nconst notARefKey = (key: string) => !['ref', 'innerRef'].includes(key);\n\nexport const callbackMerger = <T>(\n props: StyledComponentPropsWithRef<StyledComponentInnerComponent<React.ComponentType<T>>>,\n object: Record<string, unknown>,\n) => {\n const newObject: Record<string, unknown> = { ...object };\n\n Object.keys(object).forEach((key) => {\n const propsValue = (props as unknown as Record<string, unknown>)[key];\n const resultingObjectValue = object[key];\n // If the value is a function and the resultingObject has a function with the same key\n // We merge the 2 functions (we also check that the key is not a ref key)\n if (typeof propsValue === 'function' && typeof resultingObjectValue === 'function' && notARefKey(key)) {\n newObject[key] = (...args: unknown[]) => {\n propsValue(...args);\n resultingObjectValue(...args);\n };\n }\n });\n return newObject;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,MAAM,aAAa,CAAC,QAAgB,CAAC,CAAC,OAAO,UAAU,EAAE,SAAS,GAAG;AAE9D,MAAM,iBAAiB,CAC5B,OACA,WACG;AACH,QAAM,YAAqC,EAAE,GAAG,OAAO;AAEvD,SAAO,KAAK,MAAM,EAAE,QAAQ,CAAC,QAAQ;AACnC,UAAM,aAAc,MAA6C,GAAG;AACpE,UAAM,uBAAuB,OAAO,GAAG;AAGvC,QAAI,OAAO,eAAe,cAAc,OAAO,yBAAyB,cAAc,WAAW,GAAG,GAAG;AACrG,gBAAU,GAAG,IAAI,IAAI,SAAoB;AACvC,mBAAW,GAAG,IAAI;AAClB,6BAAqB,GAAG,IAAI;AAAA,MAC9B;AAAA,IACF;AAAA,EACF,CAAC;AACD,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var refMerger_exports = {};
|
|
30
|
+
__export(refMerger_exports, {
|
|
31
|
+
refMerger: () => refMerger
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(refMerger_exports);
|
|
34
|
+
var React = __toESM(require("react"));
|
|
35
|
+
const mergeRefs = (ref1, ref2) => (_ref) => {
|
|
36
|
+
if (typeof ref1 === "function")
|
|
37
|
+
ref1(_ref);
|
|
38
|
+
else if (ref1)
|
|
39
|
+
ref1.current = _ref;
|
|
40
|
+
if (typeof ref2 === "function")
|
|
41
|
+
ref2(_ref);
|
|
42
|
+
else if (ref2)
|
|
43
|
+
ref2.current = _ref;
|
|
44
|
+
};
|
|
45
|
+
const refMerger = (props, object) => {
|
|
46
|
+
const newObject = { ...object };
|
|
47
|
+
newObject.ref = mergeRefs(props.ref, object.ref);
|
|
48
|
+
newObject.innerRef = mergeRefs(
|
|
49
|
+
props.innerRef,
|
|
50
|
+
object.innerRef
|
|
51
|
+
);
|
|
52
|
+
return newObject;
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=refMerger.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/styled/generated-attributes/utils/refMerger.ts", "../../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["import type { StyledComponentInnerComponent, StyledComponentPropsWithRef } from 'styled-components';\nimport type { AnyStyledRef } from '../../types.js';\n\nconst mergeRefs =\n <T extends HTMLElement>(ref1: AnyStyledRef<T>, ref2: AnyStyledRef<T>) =>\n (_ref: T | null) => {\n if (typeof ref1 === 'function') ref1(_ref);\n else if (ref1) ref1.current = _ref;\n\n if (typeof ref2 === 'function') ref2(_ref);\n else if (ref2) ref2.current = _ref;\n };\n\nexport const refMerger = <T extends { ref?: AnyStyledRef<HTMLElement>; innerRef?: AnyStyledRef<HTMLElement> }>(\n props: StyledComponentPropsWithRef<StyledComponentInnerComponent<React.ComponentType<T>>>,\n object: Record<string, unknown>,\n) => {\n const newObject: Record<string, unknown> = { ...object };\n\n newObject.ref = mergeRefs(props.ref as AnyStyledRef<HTMLElement>, object.ref as AnyStyledRef<HTMLElement>);\n newObject.innerRef = mergeRefs(\n props.innerRef as AnyStyledRef<HTMLElement>,\n object.innerRef as AnyStyledRef<HTMLElement>,\n );\n\n return newObject;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,MAAM,YACJ,CAAwB,MAAuB,SAC/C,CAAC,SAAmB;AAClB,MAAI,OAAO,SAAS;AAAY,SAAK,IAAI;AAAA,WAChC;AAAM,SAAK,UAAU;AAE9B,MAAI,OAAO,SAAS;AAAY,SAAK,IAAI;AAAA,WAChC;AAAM,SAAK,UAAU;AAChC;AAEK,MAAM,YAAY,CACvB,OACA,WACG;AACH,QAAM,YAAqC,EAAE,GAAG,OAAO;AAEvD,YAAU,MAAM,UAAU,MAAM,KAAkC,OAAO,GAAgC;AACzG,YAAU,WAAW;AAAA,IACnB,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AAEA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var helpers_exports = {};
|
|
30
|
+
__export(helpers_exports, {
|
|
31
|
+
displayNameToKebabCase: () => displayNameToKebabCase,
|
|
32
|
+
propsToClassKey: () => propsToClassKey,
|
|
33
|
+
slotObjectToDataTestIds: () => slotObjectToDataTestIds
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(helpers_exports);
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
const capitalize = (string) => string.charAt(0).toUpperCase() + string.slice(1);
|
|
38
|
+
const isEmpty = (string) => string.length === 0;
|
|
39
|
+
const propsToClassKey = (props) => Object.keys(props).sort().reduce((classKey, key) => {
|
|
40
|
+
if (key === "color") {
|
|
41
|
+
return classKey + (isEmpty(String(classKey)) ? String(props[key]) : capitalize(String(props[key])));
|
|
42
|
+
}
|
|
43
|
+
return `${classKey}${isEmpty(String(classKey)) ? key : capitalize(key)}${capitalize(props[key].toString())}`;
|
|
44
|
+
}, "");
|
|
45
|
+
const displayNameToKebabCase = (displayName) => {
|
|
46
|
+
const displayNameSplitOnUppercase = displayName.split(/(?=[A-Z])/).slice(2);
|
|
47
|
+
return `ds-${displayNameSplitOnUppercase.map((part) => part.toLowerCase()).join("-")}`;
|
|
48
|
+
};
|
|
49
|
+
const slotObjectToDataTestIds = (componentName, slotObject) => {
|
|
50
|
+
const obj = {};
|
|
51
|
+
Object.keys(slotObject).forEach((slotName) => {
|
|
52
|
+
const displayName = `${componentName}-${slotObject[slotName]}`;
|
|
53
|
+
obj[slotName] = displayNameToKebabCase(displayName);
|
|
54
|
+
});
|
|
55
|
+
return obj;
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/styled/helpers.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["const capitalize = (string: string): string => string.charAt(0).toUpperCase() + string.slice(1);\n\nconst isEmpty = (string: string): boolean => string.length === 0;\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\nexport const displayNameToKebabCase = (displayName: string) => {\n // We also remove \"DS\" preffix\n const displayNameSplitOnUppercase = displayName.split(/(?=[A-Z])/).slice(2);\n\n return `ds-${displayNameSplitOnUppercase.map((part) => part.toLowerCase()).join('-')}`;\n};\n\nexport const slotObjectToDataTestIds = (\n componentName: string,\n slotObject: Record<string, string>,\n): Record<string, string> => {\n const obj = {} as Record<string, string>;\n Object.keys(slotObject).forEach((slotName) => {\n const displayName = `${componentName}-${slotObject[slotName]}`;\n obj[slotName] = displayNameToKebabCase(displayName);\n });\n return obj;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,MAAM,aAAa,CAAC,WAA2B,OAAO,OAAO,CAAC,EAAE,YAAY,IAAI,OAAO,MAAM,CAAC;AAE9F,MAAM,UAAU,CAAC,WAA4B,OAAO,WAAW;AAExD,MAAM,kBAAkB,CAAC,UAC9B,OAAO,KAAK,KAAK,EACd,KAAK,EACL,OAAO,CAAC,UAAU,QAAQ;AACzB,MAAI,QAAQ,SAAS;AACnB,WAAO,YAAY,QAAQ,OAAO,QAAQ,CAAC,IAAI,OAAO,MAAM,GAAG,CAAC,IAAI,WAAW,OAAO,MAAM,GAAG,CAAC,CAAC;AAAA,EACnG;AACA,SAAO,GAAG,WAAW,QAAQ,OAAO,QAAQ,CAAC,IAAI,MAAM,WAAW,GAAG,IAAI,WAAW,MAAM,GAAG,EAAE,SAAS,CAAC;AAC3G,GAAG,EAAE;AAEF,MAAM,yBAAyB,CAAC,gBAAwB;AAE7D,QAAM,8BAA8B,YAAY,MAAM,WAAW,EAAE,MAAM,CAAC;AAE1E,SAAO,MAAM,4BAA4B,IAAI,CAAC,SAAS,KAAK,YAAY,CAAC,EAAE,KAAK,GAAG;AACrF;AAEO,MAAM,0BAA0B,CACrC,eACA,eAC2B;AAC3B,QAAM,MAAM,CAAC;AACb,SAAO,KAAK,UAAU,EAAE,QAAQ,CAAC,aAAa;AAC5C,UAAM,cAAc,GAAG,iBAAiB,WAAW,QAAQ;AAC3D,QAAI,QAAQ,IAAI,uBAAuB,WAAW;AAAA,EACpD,CAAC;AACD,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|