@elliemae/ds-system 3.24.2 → 3.25.0-next.2

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.
Files changed (35) hide show
  1. package/dist/cjs/styled/generated-attributes/generateAttributes.js +22 -7
  2. package/dist/cjs/styled/generated-attributes/generateAttributes.js.map +2 -2
  3. package/dist/cjs/styled/generated-attributes/utils/refMerger.js +1 -10
  4. package/dist/cjs/styled/generated-attributes/utils/refMerger.js.map +2 -2
  5. package/dist/cjs/styled/helpers.js +2 -0
  6. package/dist/cjs/styled/helpers.js.map +2 -2
  7. package/dist/cjs/styled/styledFunction.js +32 -2
  8. package/dist/cjs/styled/styledFunction.js.map +3 -3
  9. package/dist/cjs/styled/transformers/dsStyledComponentTransform.js +41 -0
  10. package/dist/cjs/styled/transformers/dsStyledComponentTransform.js.map +7 -0
  11. package/dist/cjs/styled/transformers/index.js +2 -0
  12. package/dist/cjs/styled/transformers/index.js.map +2 -2
  13. package/dist/cjs/styled/types.js.map +1 -1
  14. package/dist/cjs/th.js.map +2 -2
  15. package/dist/esm/styled/generated-attributes/generateAttributes.js +23 -8
  16. package/dist/esm/styled/generated-attributes/generateAttributes.js.map +2 -2
  17. package/dist/esm/styled/generated-attributes/utils/refMerger.js +1 -10
  18. package/dist/esm/styled/generated-attributes/utils/refMerger.js.map +2 -2
  19. package/dist/esm/styled/helpers.js +2 -0
  20. package/dist/esm/styled/helpers.js.map +2 -2
  21. package/dist/esm/styled/styledFunction.js +33 -3
  22. package/dist/esm/styled/styledFunction.js.map +3 -3
  23. package/dist/esm/styled/transformers/dsStyledComponentTransform.js +11 -0
  24. package/dist/esm/styled/transformers/dsStyledComponentTransform.js.map +7 -0
  25. package/dist/esm/styled/transformers/index.js +2 -0
  26. package/dist/esm/styled/transformers/index.js.map +2 -2
  27. package/dist/esm/th.js.map +2 -2
  28. package/dist/types/styled/generated-attributes/generateAttributes.d.ts +5 -1
  29. package/dist/types/styled/generated-attributes/utils/refMerger.d.ts +1 -6
  30. package/dist/types/styled/helpers.d.ts +1 -0
  31. package/dist/types/styled/transformers/dsStyledComponentTransform.d.ts +4 -0
  32. package/dist/types/styled/transformers/index.d.ts +1 -0
  33. package/dist/types/styled/types.d.ts +12 -4
  34. package/dist/types/xStyledWrapper.d.ts +1 -1
  35. package/package.json +2 -2
@@ -28,13 +28,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var generateAttributes_exports = {};
30
30
  __export(generateAttributes_exports, {
31
- generateAttributes: () => generateAttributes
31
+ generateAttributes: () => generateAttributes,
32
+ getPartProps: () => getPartProps
32
33
  });
33
34
  module.exports = __toCommonJS(generateAttributes_exports);
34
35
  var React = __toESM(require("react"));
35
36
  var import_helpers = require("../helpers.js");
36
37
  var import_callbackMerger = require("./utils/callbackMerger.js");
37
- var import_refMerger = require("./utils/refMerger.js");
38
38
  const generateClassName = (props, meta) => {
39
39
  if (meta.displayName === null)
40
40
  return {};
@@ -49,23 +49,38 @@ const generateDataTestId = (props, meta) => {
49
49
  "data-testid": props["data-testid"] ?? (0, import_helpers.displayNameToKebabCase)(meta.displayName)
50
50
  };
51
51
  };
52
- const generateGlobalAttributes = (props) => {
52
+ const generateDataDimsumSlot = (props, meta) => {
53
+ if (meta.displayName === null)
54
+ return {};
55
+ return {
56
+ "data-dimsum-slot": (0, import_helpers.displayNameToPropCase)(meta.displayName)
57
+ };
58
+ };
59
+ const getPartProps = (props) => {
53
60
  const { getOwnerProps, getOwnerPropsArguments } = props;
54
61
  if (getOwnerProps === void 0)
55
62
  return {};
56
63
  const ownerPropsValue = getOwnerProps();
57
64
  const ownerPropsArgumentsValue = getOwnerPropsArguments?.() ?? {};
58
- const elementProps = ownerPropsValue[props["data-testid"]];
65
+ const elementProps = ownerPropsValue[props["data-dimsum-slot"]] ?? ownerPropsValue[props["data-testid"]];
59
66
  if (elementProps === void 0 || elementProps === null)
60
67
  return {};
61
68
  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);
69
+ return resultingObject;
70
+ };
71
+ const generateGlobalAttributes = (props) => {
72
+ const resultingObject = getPartProps(props);
73
+ const resultingObjectWithCallbackMerged = (0, import_callbackMerger.callbackMerger)(props, resultingObject);
64
74
  return resultingObjectWithCallbackMerged;
65
75
  };
66
76
  const wrap = (func, meta) => (props) => func(props, meta);
67
77
  const generateAttributes = (options, displayName) => {
68
78
  const meta = { options, displayName };
69
- return [wrap(generateClassName, meta), wrap(generateDataTestId, meta), wrap(generateGlobalAttributes, meta)];
79
+ return [
80
+ wrap(generateClassName, meta),
81
+ wrap(generateDataTestId, meta),
82
+ wrap(generateDataDimsumSlot, meta),
83
+ wrap(generateGlobalAttributes, meta)
84
+ ];
70
85
  };
71
86
  //# sourceMappingURL=generateAttributes.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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;",
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { displayNameToKebabCase, displayNameToPropCase } from '../helpers.js';\nimport type { AttrsFunc, InternalAttrsFunc, Options, OwnerInterface, PartProps } from '../types.js';\nimport { callbackMerger } from './utils/callbackMerger.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 generateDataDimsumSlot: InternalAttrsFunc = (props, meta) => {\n if (meta.displayName === null) return {};\n return {\n 'data-dimsum-slot': displayNameToPropCase(meta.displayName),\n };\n};\n\nexport const getPartProps = (\n props: { 'data-testid': string; 'data-dimsum-slot': string } & OwnerInterface,\n): Record<string, unknown> => {\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 // TODO: @carusox deprecate data-testid usage in favor of data-dimsum-slot\n const elementProps = ownerPropsValue[props['data-dimsum-slot']] ?? 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 return resultingObject;\n};\n\nconst generateGlobalAttributes: InternalAttrsFunc<\n { 'data-testid': string; 'data-dimsum-slot': string } & OwnerInterface\n> = (props) => {\n const resultingObject = getPartProps(props);\n\n const resultingObjectWithCallbackMerged = callbackMerger(props, resultingObject);\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 [\n wrap(generateClassName, meta),\n wrap(generateDataTestId, meta),\n wrap(generateDataDimsumSlot, meta),\n wrap(generateGlobalAttributes, meta),\n ];\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,qBAA8D;AAE9D,4BAA+B;AAE/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C,KAAK,0BAA0B,IAAI;AAAA,EACrC;AACF;",
6
6
  "names": []
7
7
  }
@@ -28,7 +28,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var refMerger_exports = {};
30
30
  __export(refMerger_exports, {
31
- refMerger: () => refMerger
31
+ mergeRefs: () => mergeRefs
32
32
  });
33
33
  module.exports = __toCommonJS(refMerger_exports);
34
34
  var React = __toESM(require("react"));
@@ -42,13 +42,4 @@ const mergeRefs = (ref1, ref2) => (_ref) => {
42
42
  else if (ref2)
43
43
  ref2.current = _ref;
44
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
45
  //# sourceMappingURL=refMerger.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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;",
4
+ "sourcesContent": ["import type { AnyStyledRef } from '../../types.js';\n\nexport const mergeRefs =\n <T extends HTMLElement>(ref1: AnyStyledRef<T> | undefined, ref2: AnyStyledRef<T> | undefined) =>\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", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,YACX,CAAwB,MAAmC,SAC3D,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;",
6
6
  "names": []
7
7
  }
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  var helpers_exports = {};
30
30
  __export(helpers_exports, {
31
31
  displayNameToKebabCase: () => displayNameToKebabCase,
32
+ displayNameToPropCase: () => displayNameToPropCase,
32
33
  propsToClassKey: () => propsToClassKey,
33
34
  slotObjectToDataTestIds: () => slotObjectToDataTestIds
34
35
  });
@@ -46,6 +47,7 @@ const displayNameToKebabCase = (displayName) => {
46
47
  const displayNameSplitOnUppercase = displayName.split(/(?=[A-Z])/).slice(2);
47
48
  return `ds-${displayNameSplitOnUppercase.map((part) => part.toLowerCase()).join("-")}`;
48
49
  };
50
+ const displayNameToPropCase = (displayName) => `ds${displayName.slice(2).split("-").map(capitalize).join("")}`;
49
51
  const slotObjectToDataTestIds = (componentName, slotObject) => {
50
52
  const obj = {};
51
53
  Object.keys(slotObject).forEach((slotName) => {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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;",
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 displayNameToPropCase = (displayName: string) =>\n `ds${displayName.slice(2).split('-').map(capitalize).join('')}`;\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;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,wBAAwB,CAAC,gBACpC,KAAK,YAAY,MAAM,CAAC,EAAE,MAAM,GAAG,EAAE,IAAI,UAAU,EAAE,KAAK,EAAE;AAEvD,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
6
  "names": []
7
7
  }
@@ -32,6 +32,7 @@ __export(styledFunction_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(styledFunction_exports);
34
34
  var React = __toESM(require("react"));
35
+ var import_jsx_runtime = require("react/jsx-runtime");
35
36
  var import_checkNamingConvention = require("./checkNamingConvention.js");
36
37
  var import_system = require("./system.js");
37
38
  var import_transformers = require("./transformers/index.js");
@@ -39,10 +40,15 @@ var import_coerceWithDefaultTheme = require("./coerceWithDefaultTheme.js");
39
40
  var import_expressions = require("./expressions/index.js");
40
41
  var import_fixStyleArg = require("./fixStyleArg.js");
41
42
  var import_generated_attributes = require("./generated-attributes/index.js");
43
+ var import_generateAttributes = require("./generated-attributes/generateAttributes.js");
44
+ var import_refMerger = require("./generated-attributes/utils/refMerger.js");
45
+ var import_helpers = require("./helpers.js");
46
+ var import_react = require("react");
42
47
  const defaultOptions = {
43
48
  name: null,
44
49
  slot: null
45
50
  };
51
+ const styledFunctionCache = /* @__PURE__ */ new WeakMap();
46
52
  const styledFunction = (tag, options = defaultOptions) => {
47
53
  const { name: componentName, slot: componentSlot } = options;
48
54
  (0, import_checkNamingConvention.checkNamingConvention)(componentName, componentSlot);
@@ -52,7 +58,8 @@ const styledFunction = (tag, options = defaultOptions) => {
52
58
  withConfig: (...args) => baseStyledResolver.withConfig(...args)
53
59
  };
54
60
  const dsStyledResolver = (styleArg, ...expressions) => {
55
- const [styleArgWithMagic, expressionsWithMagic] = (0, import_transformers.magicCssTransform)(styleArg, expressions);
61
+ const expressionsWithDsStyledComponentId = (0, import_transformers.dsStyledComponentTransform)(expressions);
62
+ const [styleArgWithMagic, expressionsWithMagic] = (0, import_transformers.magicCssTransform)(styleArg, expressionsWithDsStyledComponentId);
56
63
  const expressionsWithThemeCoerced = (0, import_coerceWithDefaultTheme.coerceWithDefaultTheme)(expressionsWithMagic);
57
64
  if (componentName && componentSlot) {
58
65
  expressionsWithThemeCoerced.push((0, import_expressions.genStyleOverridesExpression)(componentName, componentSlot));
@@ -68,10 +75,33 @@ const styledFunction = (tag, options = defaultOptions) => {
68
75
  baseStyledResolver
69
76
  );
70
77
  const Component = baseStyledResolverWithAttributes(fixedStyleArg, ...expressionsWithThemeCoerced);
78
+ const MemoizedComponentWithRefsMerged = styledFunctionCache.get(Component);
79
+ const ComponentWithRefsMerged = MemoizedComponentWithRefsMerged ?? ((props) => {
80
+ const dataTestId = props["data-testid"] ?? (displayName !== null ? (0, import_helpers.displayNameToKebabCase)(displayName) : "");
81
+ const dataDimsumSlot = displayName !== null ? (0, import_helpers.displayNameToPropCase)(displayName) : "";
82
+ const partProps = (0, import_generateAttributes.getPartProps)({
83
+ ...props,
84
+ "data-testid": dataTestId,
85
+ "data-dimsum-slot": dataDimsumSlot
86
+ });
87
+ const mergedRef = (0, import_react.useMemo)(
88
+ () => (0, import_refMerger.mergeRefs)(props.innerRef, partProps.innerRef),
89
+ [props.innerRef, partProps.innerRef]
90
+ );
91
+ const propsWithRefMerged = {
92
+ ...props,
93
+ ref: mergedRef,
94
+ innerRef: mergedRef
95
+ };
96
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { ...propsWithRefMerged });
97
+ });
98
+ styledFunctionCache.set(Component, ComponentWithRefsMerged);
71
99
  if (displayName !== null) {
72
100
  Component.displayName = displayName;
73
101
  }
74
- return Component;
102
+ ComponentWithRefsMerged.dsStyledComponentId = Component.styledComponentId;
103
+ ComponentWithRefsMerged.toString = Component.toString;
104
+ return ComponentWithRefsMerged;
75
105
  };
76
106
  return Object.assign(dsStyledResolver, styledAttributes);
77
107
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../src/styled/styledFunction.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { AnyStyledComponent, ThemedStyledFunction } from 'styled-components';\nimport { checkNamingConvention } from './checkNamingConvention.js';\nimport { styled as baseStyled } from './system.js';\nimport { magicCssTransform } from './transformers/index.js';\nimport type { Options, Theme, ThemedStyledFunctionBase } from './types.js';\nimport { coerceWithDefaultTheme } from './coerceWithDefaultTheme.js';\nimport { genStyleOverridesExpression, genVariantOverridesExpression } from './expressions/index.js';\nimport { fixStyleArg } from './fixStyleArg.js';\nimport { generateAutoCalculated } from './generated-attributes/index.js';\n\nconst defaultOptions: Options = {\n name: null,\n slot: null,\n};\n\nexport const styledFunction = <C extends AnyStyledComponent | keyof JSX.IntrinsicElements | React.ComponentType<any>>(\n tag: C,\n options: Options = defaultOptions,\n) => {\n const { name: componentName, slot: componentSlot } = options;\n\n checkNamingConvention(componentName, componentSlot);\n\n // Here we use the `as` because when C is keyof JSX.IntrinsicElements we get `never` for the attributes generic\n // We want to account for string | number | symbol that's why we transform it to `keyof any`\n const baseStyledResolver = baseStyled(tag) as unknown as ThemedStyledFunction<C, Theme, {}, keyof any>;\n\n // Here we use arrow functions to preserve the `this` context\n const styledAttributes = {\n attrs: ((...args) => baseStyledResolver.attrs(...args)) as (typeof baseStyledResolver)['attrs'],\n withConfig: ((...args) => baseStyledResolver.withConfig(...args)) as (typeof baseStyledResolver)['withConfig'],\n };\n\n // Due to the recursive natura of this function, we can't type it properly\n // Since we can apply .attrs or .withConfig, we are not sure on the type of the returned function\n // @ts-expect-error explained above\n const dsStyledResolver: ThemedStyledFunctionBase<C, Theme> = (styleArg, ...expressions) => {\n /**\n * Here we apply a CSS transformation to support MAGIC styled components\n * This makes it possible to use the following syntax:\n * color: neutral-100;\n * background-color: success-900;\n */\n const [styleArgWithMagic, expressionsWithMagic] = magicCssTransform(styleArg, expressions);\n\n /**\n * We coerce all the already written expressions with the default theme\n * This prevents styled components to break when a theme is not provided\n * either with the HOC or the ThemeProvider\n */\n const expressionsWithThemeCoerced = coerceWithDefaultTheme(expressionsWithMagic);\n\n if (componentName && componentSlot) {\n // Here we add the style overrides expression\n expressionsWithThemeCoerced.push(genStyleOverridesExpression(componentName, componentSlot));\n }\n\n if (componentName && componentSlot === 'root') {\n // Here we add the variant overrides from the user (only for the root slot\n expressionsWithThemeCoerced.push(genVariantOverridesExpression(componentName));\n }\n\n /**\n * Here we will fix the format of the style argument\n * We possible added some new expressions into the mix,\n * so we need to properly adjust the style arg\n */\n const numOfExpressionsAdded = expressionsWithThemeCoerced.length - expressionsWithMagic.length;\n\n const fixedStyleArg = fixStyleArg(styleArgWithMagic, numOfExpressionsAdded);\n\n // We will add autocalculated attributes to the styled component\n const [displayName, attributes] = generateAutoCalculated(options);\n\n // For each attribute function, we will call `attrs` func with it\n // This will add the attributes to the styled component\n const baseStyledResolverWithAttributes = attributes.reduce<typeof baseStyledResolver>(\n (curStyledResolver, attributeFunc) => curStyledResolver.attrs(attributeFunc),\n baseStyledResolver,\n );\n\n const Component = baseStyledResolverWithAttributes(fixedStyleArg, ...expressionsWithThemeCoerced);\n\n if (displayName !== null) {\n Component.displayName = displayName;\n }\n\n return Component;\n };\n\n return Object.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2B;AAEhG,QAAI,gBAAgB,MAAM;AACxB,gBAAU,cAAc;AAAA,IAC1B;AAEA,WAAO;AAAA,EACT;AAEA,SAAO,OAAO,OAAO,kBAAkB,gBAAgB;AACzD;",
3
+ "sources": ["../../../src/styled/styledFunction.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable no-unused-vars */\n/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { AnyStyledComponent, StyledComponent, ThemedStyledFunction } from 'styled-components';\nimport { checkNamingConvention } from './checkNamingConvention.js';\nimport { styled as baseStyled } from './system.js';\nimport { dsStyledComponentTransform, magicCssTransform } from './transformers/index.js';\nimport type {\n AnyStyledRef,\n Options,\n OwnerInterface,\n InnerRefInterface,\n Theme,\n ThemedStyledFunctionBase,\n} from './types.js';\nimport { coerceWithDefaultTheme } from './coerceWithDefaultTheme.js';\nimport { genStyleOverridesExpression, genVariantOverridesExpression } from './expressions/index.js';\nimport { fixStyleArg } from './fixStyleArg.js';\nimport { generateAutoCalculated } from './generated-attributes/index.js';\nimport { getPartProps } from './generated-attributes/generateAttributes.js';\nimport { mergeRefs } from './generated-attributes/utils/refMerger.js';\nimport { displayNameToKebabCase, displayNameToPropCase } from './helpers.js';\nimport { useMemo } from 'react';\n\nconst defaultOptions: Options = {\n name: null,\n slot: null,\n};\n\nconst styledFunctionCache = new WeakMap<StyledComponent<any, any>, React.ComponentType<any>>();\n\nexport const styledFunction = <C extends AnyStyledComponent | keyof JSX.IntrinsicElements | React.ComponentType<any>>(\n tag: C,\n options: Options = defaultOptions,\n) => {\n const { name: componentName, slot: componentSlot } = options;\n\n checkNamingConvention(componentName, componentSlot);\n\n // Here we use the `as` because when C is keyof JSX.IntrinsicElements we get `never` for the attributes generic\n // We want to account for string | number | symbol that's why we transform it to `keyof any`\n const baseStyledResolver = baseStyled(tag) as unknown as ThemedStyledFunction<C, Theme, {}, keyof any>;\n\n // Here we use arrow functions to preserve the `this` context\n const styledAttributes = {\n attrs: ((...args) => baseStyledResolver.attrs(...args)) as (typeof baseStyledResolver)['attrs'],\n withConfig: ((...args) => baseStyledResolver.withConfig(...args)) as (typeof baseStyledResolver)['withConfig'],\n };\n\n // Due to the recursive natura of this function, we can't type it properly\n // Since we can apply .attrs or .withConfig, we are not sure on the type of the returned function\n // @ts-expect-error explained above\n const dsStyledResolver: ThemedStyledFunctionBase<C, Theme> = (styleArg, ...expressions) => {\n /**\n * Here we apply a transformation to the expressions only.\n * Since this resolver is returning a HOC of a styled-component, the syntax support for\n * selecting the className of another styled-component is not available anymore.\n * That's why we assign it a `dsStyledComponnentId`, we will replace the component's call for\n * the corresponding id\n */\n const expressionsWithDsStyledComponentId = dsStyledComponentTransform(expressions);\n\n /**\n * Here we apply a CSS transformation to support MAGIC styled components\n * This makes it possible to use the following syntax:\n * color: neutral-100;\n * background-color: success-900;\n */\n const [styleArgWithMagic, expressionsWithMagic] = magicCssTransform(styleArg, expressionsWithDsStyledComponentId);\n\n /**\n * We coerce all the already written expressions with the default theme\n * This prevents styled components to break when a theme is not provided\n * either with the HOC or the ThemeProvider\n */\n const expressionsWithThemeCoerced = coerceWithDefaultTheme(expressionsWithMagic);\n\n if (componentName && componentSlot) {\n // Here we add the style overrides expression\n expressionsWithThemeCoerced.push(genStyleOverridesExpression(componentName, componentSlot));\n }\n\n if (componentName && componentSlot === 'root') {\n // Here we add the variant overrides from the user (only for the root slot\n expressionsWithThemeCoerced.push(genVariantOverridesExpression(componentName));\n }\n\n /**\n * Here we will fix the format of the style argument\n * We possible added some new expressions into the mix,\n * so we need to properly adjust the style arg\n */\n const numOfExpressionsAdded = expressionsWithThemeCoerced.length - expressionsWithMagic.length;\n\n const fixedStyleArg = fixStyleArg(styleArgWithMagic, numOfExpressionsAdded);\n\n // We will add autocalculated attributes to the styled component\n const [displayName, attributes] = generateAutoCalculated(options);\n\n // For each attribute function, we will call `attrs` func with it\n // This will add the attributes to the styled component\n const baseStyledResolverWithAttributes = attributes.reduce<typeof baseStyledResolver>(\n (curStyledResolver, attributeFunc) => curStyledResolver.attrs(attributeFunc),\n baseStyledResolver,\n );\n\n const Component = baseStyledResolverWithAttributes(fixedStyleArg, ...expressionsWithThemeCoerced);\n\n const MemoizedComponentWithRefsMerged = styledFunctionCache.get(Component);\n\n const ComponentWithRefsMerged =\n MemoizedComponentWithRefsMerged ??\n ((props: OwnerInterface & InnerRefInterface<C> & { 'data-testid'?: string }) => {\n // we may or not have data-testid at this point, so we need to calculate it\n const dataTestId = props['data-testid'] ?? (displayName !== null ? displayNameToKebabCase(displayName) : '');\n // we also need to calculate dataDimsumSlot at this point\n const dataDimsumSlot = displayName !== null ? displayNameToPropCase(displayName) : '';\n // then we get the part props for this slot, and we cast it to use refs\n const partProps = getPartProps({\n ...props,\n 'data-testid': dataTestId,\n 'data-dimsum-slot': dataDimsumSlot,\n }) as {\n innerRef?: AnyStyledRef<HTMLElement>;\n };\n\n const mergedRef = useMemo(\n () => mergeRefs(props.innerRef, partProps.innerRef),\n [props.innerRef, partProps.innerRef],\n );\n\n const propsWithRefMerged = {\n ...props,\n ref: mergedRef,\n innerRef: mergedRef,\n } as React.ComponentProps<C>;\n\n return <Component {...propsWithRefMerged} />;\n });\n\n styledFunctionCache.set(Component, ComponentWithRefsMerged);\n\n if (displayName !== null) {\n Component.displayName = displayName;\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore We use dsStyledComponent to access the original's component id\n ComponentWithRefsMerged.dsStyledComponentId = Component.styledComponentId as string;\n ComponentWithRefsMerged.toString = Component.toString;\n\n return ComponentWithRefsMerged;\n };\n\n return Object.assign(dsStyledResolver, styledAttributes);\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADyIR;AArIf,mCAAsC;AACtC,oBAAqC;AACrC,0BAA8D;AAS9D,oC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J,oCACC,CAAC,UAA8E;AAE9E,YAAM,aAAa,MAAM,aAAa,MAAM,gBAAgB,WAAO,uCAAuB,WAAW,IAAI;AAEzG,YAAM,iBAAiB,gBAAgB,WAAO,sCAAsB,WAAW,IAAI;AAEnF,YAAM,gBAAY,wCAAa;AAAA,QAC7B,GAAG;AAAA,QACH,eAAe;AAAA,QACf,oBAAoB;AAAA,MACtB,CAAC;AAID,YAAM,gBAAY;AAAA,QAChB,UAAM,4BAAU,MAAM,UAAU,UAAU,QAAQ;AAAA,QAClD,CAAC,MAAM,UAAU,UAAU,QAAQ;AAAA,MACrC;AAEA,YAAM,qBAAqB;AAAA,QACzB,GAAG;AAAA,QACH,KAAK;AAAA,QACL,UAAU;AAAA,MACZ;AAEA,aAAO,4CAAC,aAAW,GAAG,oBAAoB;AAAA,IAC5C;AAEF,wBAAoB,IAAI,WAAW,uBAAuB;AAE1D,QAAI,gBAAgB,MAAM;AACxB,gBAAU,cAAc;AAAA,IAC1B;AAIA,4BAAwB,sBAAsB,UAAU;AACxD,4BAAwB,WAAW,UAAU;AAE7C,WAAO;AAAA,EACT;AAEA,SAAO,OAAO,OAAO,kBAAkB,gBAAgB;AACzD;",
6
6
  "names": ["baseStyled"]
7
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 dsStyledComponentTransform_exports = {};
30
+ __export(dsStyledComponentTransform_exports, {
31
+ dsStyledComponentTransform: () => dsStyledComponentTransform
32
+ });
33
+ module.exports = __toCommonJS(dsStyledComponentTransform_exports);
34
+ var React = __toESM(require("react"));
35
+ const dsStyledComponentTransform = (expressions) => expressions.map((expression) => {
36
+ if (typeof expression === "function" && "dsStyledComponentId" in expression) {
37
+ return () => `.${expression.dsStyledComponentId}`;
38
+ }
39
+ return expression;
40
+ });
41
+ //# sourceMappingURL=dsStyledComponentTransform.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/styled/transformers/dsStyledComponentTransform.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import type { Expressions } from '../types.js';\n\ntype DSStyledComponentTransform = (expressions: Expressions) => Expressions;\n\nexport const dsStyledComponentTransform: DSStyledComponentTransform = (expressions) =>\n expressions.map((expression) => {\n if (typeof expression === 'function' && 'dsStyledComponentId' in expression) {\n return () => `.${expression.dsStyledComponentId as string}`;\n }\n return expression;\n });\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIhB,MAAM,6BAAyD,CAAC,gBACrE,YAAY,IAAI,CAAC,eAAe;AAC9B,MAAI,OAAO,eAAe,cAAc,yBAAyB,YAAY;AAC3E,WAAO,MAAM,IAAI,WAAW;AAAA,EAC9B;AACA,SAAO;AACT,CAAC;",
6
+ "names": []
7
+ }
@@ -28,9 +28,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
  var transformers_exports = {};
30
30
  __export(transformers_exports, {
31
+ dsStyledComponentTransform: () => import_dsStyledComponentTransform.dsStyledComponentTransform,
31
32
  magicCssTransform: () => import_magicCssTransform.magicCssTransform
32
33
  });
33
34
  module.exports = __toCommonJS(transformers_exports);
34
35
  var React = __toESM(require("react"));
35
36
  var import_magicCssTransform = require("./magicCssTransform.js");
37
+ var import_dsStyledComponentTransform = require("./dsStyledComponentTransform.js");
36
38
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/styled/transformers/index.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export { magicCssTransform } from './magicCssTransform.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAkC;",
4
+ "sourcesContent": ["export { magicCssTransform } from './magicCssTransform.js';\nexport { dsStyledComponentTransform } from './dsStyledComponentTransform.js';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,+BAAkC;AAClC,wCAA2C;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/styled/types.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type {\n CSSObject,\n Interpolation,\n InterpolationFunction,\n StyledComponent,\n StyledComponentInnerComponent,\n StyledComponentPropsWithRef,\n ThemedStyledProps,\n} from 'styled-components';\nimport type { Theme as PuiTheme } from '@elliemae/pui-theme';\n\nexport interface Options {\n name: string | null;\n slot: string | null;\n}\n\nexport interface Theme extends PuiTheme {\n components?: {\n [componentName: string]: {\n styleOverrides?: CSSObject;\n variants?: { props: Record<string, { toString: () => string }>; style: CSSObject }[];\n };\n };\n}\n\nexport type AnyStyledRef<T extends HTMLElement> =\n | React.MutableRefObject<T | null>\n | ((_ref: T | null) => void)\n | React.Dispatch<React.SetStateAction<T | null>>\n | false;\n\nexport type StyleArg<T = any> = TemplateStringsArray | CSSObject | InterpolationFunction<T>;\nexport type Expression<T = any> = Interpolation<T>;\nexport type Expressions<T = any> = Array<Expression<T>>;\nexport type PropsWithTheme<T = Record<string, unknown>> = T & { theme: Theme };\n\nexport interface ThemedStyledFunctionBase<\n C extends keyof JSX.IntrinsicElements | React.ComponentType<any>,\n T extends object,\n O extends object = {},\n A extends keyof any = never,\n> {\n <U extends object>(\n first: StyleArg<ThemedStyledProps<StyledComponentPropsWithRef<C> & O & U & OwnerInterface, T>>,\n ...rest: Expressions<ThemedStyledProps<StyledComponentPropsWithRef<C> & O & U & OwnerInterface, T>>\n ): StyledComponent<C, T, O & U & OwnerInterface, A>;\n}\n\nexport type AttrsFunc<T extends object = Record<string, unknown>> = (\n props: StyledComponentPropsWithRef<StyledComponentInnerComponent<React.ComponentType<T>>>,\n) => Partial<StyledComponentPropsWithRef<StyledComponentInnerComponent<any>>>;\n\nexport type InternalAttrsFunc<T extends object = Record<string, unknown>> = (\n props: StyledComponentPropsWithRef<\n StyledComponentInnerComponent<React.ComponentType<T & { ref?: AnyStyledRef<HTMLElement> }>>\n >,\n meta: {\n options: Options;\n displayName: string | null;\n },\n) => Partial<StyledComponentPropsWithRef<StyledComponentInnerComponent<any>>>;\n\nexport interface OwnerInterface {\n getOwnerProps?: () => object;\n getOwnerPropsArguments?: () => object;\n}\n\nexport type PartProps = Record<string, unknown> | ((args: object) => Record<string, unknown>) | null | undefined;\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type {\n AnyStyledComponent,\n CSSObject,\n Interpolation,\n InterpolationFunction,\n StyledComponent,\n StyledComponentInnerComponent,\n StyledComponentPropsWithRef,\n ThemedStyledProps,\n} from 'styled-components';\nimport type { Theme as PuiTheme } from '@elliemae/pui-theme';\nimport type { ElementType, Ref } from 'react';\nimport type React from 'react';\n\nexport interface Options {\n name: string | null;\n slot: string | null;\n}\n\nexport interface Theme extends PuiTheme {\n components?: {\n [componentName: string]: {\n styleOverrides?: CSSObject;\n variants?: { props: Record<string, { toString: () => string }>; style: CSSObject }[];\n };\n };\n}\n\nexport type AnyStyledRef<T extends HTMLElement> =\n | React.MutableRefObject<T | null>\n | ((_ref: T | null) => void)\n | false\n | null;\n\nexport type StyleArg<T = any> = TemplateStringsArray | CSSObject | InterpolationFunction<T>;\nexport type Expression<T = any> = Interpolation<T>;\nexport type Expressions<T = any> = Array<Expression<T>>;\nexport type PropsWithTheme<T = Record<string, unknown>> = T & { theme: Theme };\n\ntype ComponentInnerRef<T extends ElementType> = T extends new (props: infer P) => React.Component<any, any>\n ? Ref<InstanceType<T>> | undefined\n : React.PropsWithRef<React.ComponentProps<T>>['ref'];\n\nexport type StyledComponentInnerRef<C extends keyof JSX.IntrinsicElements | React.ComponentType<any>> =\n C extends AnyStyledComponent ? ComponentInnerRef<StyledComponentInnerComponent<C>> : ComponentInnerRef<C>;\n\nexport interface ThemedStyledFunctionBase<\n C extends keyof JSX.IntrinsicElements | React.ComponentType<any>,\n T extends object,\n O extends object = {},\n A extends keyof any = never,\n> {\n <U extends object>(\n first: StyleArg<\n ThemedStyledProps<StyledComponentPropsWithRef<C> & O & U & OwnerInterface & InnerRefInterface<C>, T>\n >,\n ...rest: Expressions<\n ThemedStyledProps<StyledComponentPropsWithRef<C> & O & U & OwnerInterface & InnerRefInterface<C>, T>\n >\n ): StyledComponent<C, T, O & U & OwnerInterface & InnerRefInterface<C>, A>;\n}\n\nexport type AttrsFunc<T extends object = Record<string, unknown>> = (\n props: StyledComponentPropsWithRef<StyledComponentInnerComponent<React.ComponentType<T>>>,\n) => Partial<StyledComponentPropsWithRef<StyledComponentInnerComponent<any>>>;\n\nexport type InternalAttrsFunc<T extends object = Record<string, unknown>> = (\n props: StyledComponentPropsWithRef<\n StyledComponentInnerComponent<React.ComponentType<T & { ref?: AnyStyledRef<HTMLElement> }>>\n >,\n meta: {\n options: Options;\n displayName: string | null;\n },\n) => Partial<StyledComponentPropsWithRef<StyledComponentInnerComponent<any>>>;\n\nexport interface InnerRefInterface<C extends keyof JSX.IntrinsicElements | React.ComponentType<any>> {\n innerRef?: StyledComponentInnerRef<C>;\n ref?: never;\n}\n\nexport interface OwnerInterface {\n getOwnerProps?: () => object;\n getOwnerPropsArguments?: () => object;\n}\n\nexport type PartProps = Record<string, unknown> | ((args: object) => Record<string, unknown>) | null | undefined;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/th.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* 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", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AA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G,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;",
4
+ "sourcesContent": ["/* 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 (value: string, dfault = ''): ThemeStringGetter =>\n ({ theme }) => {\n const parts = value.split('-');\n let result = theme[property];\n parts.forEach((part) => {\n if (result) result = result[part as keyof typeof result];\n });\n return (result as unknown as string) ?? dfault;\n };\n\nexport const th: ThConstructor = (property): ThGetter => {\n switch (property) {\n case 'colors' as keyof Theme:\n return colorGetter;\n default:\n return genericGetter(property);\n }\n};\n\nth.space = th('space');\nth.fontSize = th('fontSizes');\nth.fontWeight = th('fontWeights');\nth.lineHeight = th('lineHeights');\nth.letterSpacing = th('letterSpacings');\nth.font = th('fonts');\nth.color = th('colors');\nth.breakpoint = th('breakpoints');\nth.media = th('media');\nth.zIndex = th('zIndex');\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADIhB,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,CAAC,OAAe,SAAS,OACzB,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
6
  "names": []
7
7
  }
@@ -1,7 +1,6 @@
1
1
  import * as React from "react";
2
- import { displayNameToKebabCase } from "../helpers.js";
2
+ import { displayNameToKebabCase, displayNameToPropCase } from "../helpers.js";
3
3
  import { callbackMerger } from "./utils/callbackMerger.js";
4
- import { refMerger } from "./utils/refMerger.js";
5
4
  const generateClassName = (props, meta) => {
6
5
  if (meta.displayName === null)
7
6
  return {};
@@ -16,26 +15,42 @@ const generateDataTestId = (props, meta) => {
16
15
  "data-testid": props["data-testid"] ?? displayNameToKebabCase(meta.displayName)
17
16
  };
18
17
  };
19
- const generateGlobalAttributes = (props) => {
18
+ const generateDataDimsumSlot = (props, meta) => {
19
+ if (meta.displayName === null)
20
+ return {};
21
+ return {
22
+ "data-dimsum-slot": displayNameToPropCase(meta.displayName)
23
+ };
24
+ };
25
+ const getPartProps = (props) => {
20
26
  const { getOwnerProps, getOwnerPropsArguments } = props;
21
27
  if (getOwnerProps === void 0)
22
28
  return {};
23
29
  const ownerPropsValue = getOwnerProps();
24
30
  const ownerPropsArgumentsValue = getOwnerPropsArguments?.() ?? {};
25
- const elementProps = ownerPropsValue[props["data-testid"]];
31
+ const elementProps = ownerPropsValue[props["data-dimsum-slot"]] ?? ownerPropsValue[props["data-testid"]];
26
32
  if (elementProps === void 0 || elementProps === null)
27
33
  return {};
28
34
  const resultingObject = typeof elementProps === "function" ? elementProps(ownerPropsArgumentsValue) : elementProps;
29
- const resultingObjectWithRefMerged = refMerger(props, resultingObject);
30
- const resultingObjectWithCallbackMerged = callbackMerger(props, resultingObjectWithRefMerged);
35
+ return resultingObject;
36
+ };
37
+ const generateGlobalAttributes = (props) => {
38
+ const resultingObject = getPartProps(props);
39
+ const resultingObjectWithCallbackMerged = callbackMerger(props, resultingObject);
31
40
  return resultingObjectWithCallbackMerged;
32
41
  };
33
42
  const wrap = (func, meta) => (props) => func(props, meta);
34
43
  const generateAttributes = (options, displayName) => {
35
44
  const meta = { options, displayName };
36
- return [wrap(generateClassName, meta), wrap(generateDataTestId, meta), wrap(generateGlobalAttributes, meta)];
45
+ return [
46
+ wrap(generateClassName, meta),
47
+ wrap(generateDataTestId, meta),
48
+ wrap(generateDataDimsumSlot, meta),
49
+ wrap(generateGlobalAttributes, meta)
50
+ ];
37
51
  };
38
52
  export {
39
- generateAttributes
53
+ generateAttributes,
54
+ getPartProps
40
55
  };
41
56
  //# sourceMappingURL=generateAttributes.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/styled/generated-attributes/generateAttributes.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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"],
5
- "mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,8BAA8B;AAEvC,SAAS,sBAAsB;AAC/B,SAAS,iBAAiB;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,KAAK,uBAAuB,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,+BAA+B,UAAU,OAAO,eAAe;AAErE,QAAM,oCAAoC,eAAe,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;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { displayNameToKebabCase, displayNameToPropCase } from '../helpers.js';\nimport type { AttrsFunc, InternalAttrsFunc, Options, OwnerInterface, PartProps } from '../types.js';\nimport { callbackMerger } from './utils/callbackMerger.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 generateDataDimsumSlot: InternalAttrsFunc = (props, meta) => {\n if (meta.displayName === null) return {};\n return {\n 'data-dimsum-slot': displayNameToPropCase(meta.displayName),\n };\n};\n\nexport const getPartProps = (\n props: { 'data-testid': string; 'data-dimsum-slot': string } & OwnerInterface,\n): Record<string, unknown> => {\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 // TODO: @carusox deprecate data-testid usage in favor of data-dimsum-slot\n const elementProps = ownerPropsValue[props['data-dimsum-slot']] ?? 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 return resultingObject;\n};\n\nconst generateGlobalAttributes: InternalAttrsFunc<\n { 'data-testid': string; 'data-dimsum-slot': string } & OwnerInterface\n> = (props) => {\n const resultingObject = getPartProps(props);\n\n const resultingObjectWithCallbackMerged = callbackMerger(props, resultingObject);\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 [\n wrap(generateClassName, meta),\n wrap(generateDataTest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pG,QAAM,OAAO,EAAE,SAAS,YAAY;AAIpC,SAAO;AAAA,IACL,KAAK,mBAAmB,IAAI;AAAA,IAC5B,KAAK,oBAAoB,IAAI;AAAA,IAC7B,KAAK,wBAAwB,IAAI;AAAA,IACjC,KAAK,0BAA0B,IAAI;AAAA,EACrC;AACF;",
6
6
  "names": []
7
7
  }
@@ -9,16 +9,7 @@ const mergeRefs = (ref1, ref2) => (_ref) => {
9
9
  else if (ref2)
10
10
  ref2.current = _ref;
11
11
  };
12
- const refMerger = (props, object) => {
13
- const newObject = { ...object };
14
- newObject.ref = mergeRefs(props.ref, object.ref);
15
- newObject.innerRef = mergeRefs(
16
- props.innerRef,
17
- object.innerRef
18
- );
19
- return newObject;
20
- };
21
12
  export {
22
- refMerger
13
+ mergeRefs
23
14
  };
24
15
  //# sourceMappingURL=refMerger.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/styled/generated-attributes/utils/refMerger.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
5
- "mappings": "AAAA,YAAY,WAAW;ACGvB,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;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { AnyStyledRef } from '../../types.js';\n\nexport const mergeRefs =\n <T extends HTMLElement>(ref1: AnyStyledRef<T> | undefined, ref2: AnyStyledRef<T> | undefined) =>\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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACEhB,MAAM,YACX,CAAwB,MAAmC,SAC3D,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;",
6
6
  "names": []
7
7
  }
@@ -11,6 +11,7 @@ const displayNameToKebabCase = (displayName) => {
11
11
  const displayNameSplitOnUppercase = displayName.split(/(?=[A-Z])/).slice(2);
12
12
  return `ds-${displayNameSplitOnUppercase.map((part) => part.toLowerCase()).join("-")}`;
13
13
  };
14
+ const displayNameToPropCase = (displayName) => `ds${displayName.slice(2).split("-").map(capitalize).join("")}`;
14
15
  const slotObjectToDataTestIds = (componentName, slotObject) => {
15
16
  const obj = {};
16
17
  Object.keys(slotObject).forEach((slotName) => {
@@ -21,6 +22,7 @@ const slotObjectToDataTestIds = (componentName, slotObject) => {
21
22
  };
22
23
  export {
23
24
  displayNameToKebabCase,
25
+ displayNameToPropCase,
24
26
  propsToClassKey,
25
27
  slotObjectToDataTestIds
26
28
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/styled/helpers.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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"],
5
- "mappings": "AAAA,YAAY,WAAW;ACAvB,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;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "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 displayNameToPropCase = (displayName: string) =>\n `ds${displayName.slice(2).split('-').map(capitalize).join('')}`;\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"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,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,wBAAwB,CAAC,gBACpC,KAAK,YAAY,MAAM,CAAC,EAAE,MAAM,GAAG,EAAE,IAAI,UAAU,EAAE,KAAK,EAAE;AAEvD,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
6
  "names": []
7
7
  }
@@ -1,15 +1,21 @@
1
1
  import * as React from "react";
2
+ import { jsx } from "react/jsx-runtime";
2
3
  import { checkNamingConvention } from "./checkNamingConvention.js";
3
4
  import { styled as baseStyled } from "./system.js";
4
- import { magicCssTransform } from "./transformers/index.js";
5
+ import { dsStyledComponentTransform, magicCssTransform } from "./transformers/index.js";
5
6
  import { coerceWithDefaultTheme } from "./coerceWithDefaultTheme.js";
6
7
  import { genStyleOverridesExpression, genVariantOverridesExpression } from "./expressions/index.js";
7
8
  import { fixStyleArg } from "./fixStyleArg.js";
8
9
  import { generateAutoCalculated } from "./generated-attributes/index.js";
10
+ import { getPartProps } from "./generated-attributes/generateAttributes.js";
11
+ import { mergeRefs } from "./generated-attributes/utils/refMerger.js";
12
+ import { displayNameToKebabCase, displayNameToPropCase } from "./helpers.js";
13
+ import { useMemo } from "react";
9
14
  const defaultOptions = {
10
15
  name: null,
11
16
  slot: null
12
17
  };
18
+ const styledFunctionCache = /* @__PURE__ */ new WeakMap();
13
19
  const styledFunction = (tag, options = defaultOptions) => {
14
20
  const { name: componentName, slot: componentSlot } = options;
15
21
  checkNamingConvention(componentName, componentSlot);
@@ -19,7 +25,8 @@ const styledFunction = (tag, options = defaultOptions) => {
19
25
  withConfig: (...args) => baseStyledResolver.withConfig(...args)
20
26
  };
21
27
  const dsStyledResolver = (styleArg, ...expressions) => {
22
- const [styleArgWithMagic, expressionsWithMagic] = magicCssTransform(styleArg, expressions);
28
+ const expressionsWithDsStyledComponentId = dsStyledComponentTransform(expressions);
29
+ const [styleArgWithMagic, expressionsWithMagic] = magicCssTransform(styleArg, expressionsWithDsStyledComponentId);
23
30
  const expressionsWithThemeCoerced = coerceWithDefaultTheme(expressionsWithMagic);
24
31
  if (componentName && componentSlot) {
25
32
  expressionsWithThemeCoerced.push(genStyleOverridesExpression(componentName, componentSlot));
@@ -35,10 +42,33 @@ const styledFunction = (tag, options = defaultOptions) => {
35
42
  baseStyledResolver
36
43
  );
37
44
  const Component = baseStyledResolverWithAttributes(fixedStyleArg, ...expressionsWithThemeCoerced);
45
+ const MemoizedComponentWithRefsMerged = styledFunctionCache.get(Component);
46
+ const ComponentWithRefsMerged = MemoizedComponentWithRefsMerged ?? ((props) => {
47
+ const dataTestId = props["data-testid"] ?? (displayName !== null ? displayNameToKebabCase(displayName) : "");
48
+ const dataDimsumSlot = displayName !== null ? displayNameToPropCase(displayName) : "";
49
+ const partProps = getPartProps({
50
+ ...props,
51
+ "data-testid": dataTestId,
52
+ "data-dimsum-slot": dataDimsumSlot
53
+ });
54
+ const mergedRef = useMemo(
55
+ () => mergeRefs(props.innerRef, partProps.innerRef),
56
+ [props.innerRef, partProps.innerRef]
57
+ );
58
+ const propsWithRefMerged = {
59
+ ...props,
60
+ ref: mergedRef,
61
+ innerRef: mergedRef
62
+ };
63
+ return /* @__PURE__ */ jsx(Component, { ...propsWithRefMerged });
64
+ });
65
+ styledFunctionCache.set(Component, ComponentWithRefsMerged);
38
66
  if (displayName !== null) {
39
67
  Component.displayName = displayName;
40
68
  }
41
- return Component;
69
+ ComponentWithRefsMerged.dsStyledComponentId = Component.styledComponentId;
70
+ ComponentWithRefsMerged.toString = Component.toString;
71
+ return ComponentWithRefsMerged;
42
72
  };
43
73
  return Object.assign(dsStyledResolver, styledAttributes);
44
74
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/styled/styledFunction.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { AnyStyledComponent, ThemedStyledFunction } from 'styled-components';\nimport { checkNamingConvention } from './checkNamingConvention.js';\nimport { styled as baseStyled } from './system.js';\nimport { magicCssTransform } from './transformers/index.js';\nimport type { Options, Theme, ThemedStyledFunctionBase } from './types.js';\nimport { coerceWithDefaultTheme } from './coerceWithDefaultTheme.js';\nimport { genStyleOverridesExpression, genVariantOverridesExpression } from './expressions/index.js';\nimport { fixStyleArg } from './fixStyleArg.js';\nimport { generateAutoCalculated } from './generated-attributes/index.js';\n\nconst defaultOptions: Options = {\n name: null,\n slot: null,\n};\n\nexport const styledFunction = <C extends AnyStyledComponent | keyof JSX.IntrinsicElements | React.ComponentType<any>>(\n tag: C,\n options: Options = defaultOptions,\n) => {\n const { name: componentName, slot: componentSlot } = options;\n\n checkNamingConvention(componentName, componentSlot);\n\n // Here we use the `as` because when C is keyof JSX.IntrinsicElements we get `never` for the attributes generic\n // We want to account for string | number | symbol that's why we transform it to `keyof any`\n const baseStyledResolver = baseStyled(tag) as unknown as ThemedStyledFunction<C, Theme, {}, keyof any>;\n\n // Here we use arrow functions to preserve the `this` context\n const styledAttributes = {\n attrs: ((...args) => baseStyledResolver.attrs(...args)) as (typeof baseStyledResolver)['attrs'],\n withConfig: ((...args) => baseStyledResolver.withConfig(...args)) as (typeof baseStyledResolver)['withConfig'],\n };\n\n // Due to the recursive natura of this function, we can't type it properly\n // Since we can apply .attrs or .withConfig, we are not sure on the type of the returned function\n // @ts-expect-error explained above\n const dsStyledResolver: ThemedStyledFunctionBase<C, Theme> = (styleArg, ...expressions) => {\n /**\n * Here we apply a CSS transformation to support MAGIC styled components\n * This makes it possible to use the following syntax:\n * color: neutral-100;\n * background-color: success-900;\n */\n const [styleArgWithMagic, expressionsWithMagic] = magicCssTransform(styleArg, expressions);\n\n /**\n * We coerce all the already written expressions with the default theme\n * This prevents styled components to break when a theme is not provided\n * either with the HOC or the ThemeProvider\n */\n const expressionsWithThemeCoerced = coerceWithDefaultTheme(expressionsWithMagic);\n\n if (componentName && componentSlot) {\n // Here we add the style overrides expression\n expressionsWithThemeCoerced.push(genStyleOverridesExpression(componentName, componentSlot));\n }\n\n if (componentName && componentSlot === 'root') {\n // Here we add the variant overrides from the user (only for the root slot\n expressionsWithThemeCoerced.push(genVariantOverridesExpression(componentName));\n }\n\n /**\n * Here we will fix the format of the style argument\n * We possible added some new expressions into the mix,\n * so we need to properly adjust the style arg\n */\n const numOfExpressionsAdded = expressionsWithThemeCoerced.length - expressionsWithMagic.length;\n\n const fixedStyleArg = fixStyleArg(styleArgWithMagic, numOfExpressionsAdded);\n\n // We will add autocalculated attributes to the styled component\n const [displayName, attributes] = generateAutoCalculated(options);\n\n // For each attribute function, we will call `attrs` func with it\n // This will add the attributes to the styled component\n const baseStyledResolverWithAttributes = attributes.reduce<typeof baseStyledResolver>(\n (curStyledResolver, attributeFunc) => curStyledResolver.attrs(attributeFunc),\n baseStyledResolver,\n );\n\n const Component = baseStyledResolverWithAttributes(fixedStyleArg, ...expressionsWithThemeCoerced);\n\n if (displayName !== null) {\n Component.displayName = displayName;\n }\n\n return Component;\n };\n\n return Object.assign(dsStyledResolver, styledAttributes);\n};\n"],
5
- "mappings": "AAAA,YAAY,WAAW;ACGvB,SAAS,6BAA6B;AACtC,SAAS,UAAU,kBAAkB;AACrC,SAAS,yBAAyB;AAElC,SAAS,8BAA8B;AACvC,SAAS,6BAA6B,qCAAqC;AAC3E,SAAS,mBAAmB;AAC5B,SAAS,8BAA8B;AAEvC,MAAM,iBAA0B;AAAA,EAC9B,MAAM;AAAA,EACN,MAAM;AACR;AAEO,MAAM,iBAAiB,CAC5B,KACA,UAAmB,mBAChB;AACH,QAAM,EAAE,MAAM,eAAe,MAAM,cAAc,IAAI;AAErD,wBAAsB,eAAe,aAAa;AAIlD,QAAM,qBAAqB,WAAW,GAAG;AAGzC,QAAM,mBAAmB;AAAA,IACvB,OAAQ,IAAI,SAAS,mBAAmB,MAAM,GAAG,IAAI;AAAA,IACrD,YAAa,IAAI,SAAS,mBAAmB,WAAW,GAAG,IAAI;AAAA,EACjE;AAKA,QAAM,mBAAuD,CAAC,aAAa,gBAAgB;AAOzF,UAAM,CAAC,mBAAmB,oBAAoB,IAAI,kBAAkB,UAAU,WAAW;AAOzF,UAAM,8BAA8B,uBAAuB,oBAAoB;AAE/E,QAAI,iBAAiB,eAAe;AAElC,kCAA4B,KAAK,4BAA4B,eAAe,aAAa,CAAC;AAAA,IAC5F;AAEA,QAAI,iBAAiB,kBAAkB,QAAQ;AAE7C,kCAA4B,KAAK,8BAA8B,aAAa,CAAC;AAAA,IAC/E;AAOA,UAAM,wBAAwB,4BAA4B,SAAS,qBAAqB;AAExF,UAAM,gBAAgB,YAAY,mBAAmB,qBAAqB;AAG1E,UAAM,CAAC,aAAa,UAAU,IAAI,uBAAuB,OAAO;AAIhE,UAAM,mCAAmC,WAAW;AAAA,MAClD,CAAC,mBAAmB,kBAAkB,kBAAkB,MAAM,aAAa;AAAA,MAC3E;AAAA,IACF;AAEA,UAAM,YAAY,iCAAiC,eAAe,GAAG,2BAA2B;AAEhG,QAAI,gBAAgB,MAAM;AACxB,gBAAU,cAAc;AAAA,IAC1B;AAEA,WAAO;AAAA,EACT;AAEA,SAAO,OAAO,OAAO,kBAAkB,gBAAgB;AACzD;",
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/styled/styledFunction.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-unused-vars */\n/* eslint-disable @typescript-eslint/ban-types */\n/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { AnyStyledComponent, StyledComponent, ThemedStyledFunction } from 'styled-components';\nimport { checkNamingConvention } from './checkNamingConvention.js';\nimport { styled as baseStyled } from './system.js';\nimport { dsStyledComponentTransform, magicCssTransform } from './transformers/index.js';\nimport type {\n AnyStyledRef,\n Options,\n OwnerInterface,\n InnerRefInterface,\n Theme,\n ThemedStyledFunctionBase,\n} from './types.js';\nimport { coerceWithDefaultTheme } from './coerceWithDefaultTheme.js';\nimport { genStyleOverridesExpression, genVariantOverridesExpression } from './expressions/index.js';\nimport { fixStyleArg } from './fixStyleArg.js';\nimport { generateAutoCalculated } from './generated-attributes/index.js';\nimport { getPartProps } from './generated-attributes/generateAttributes.js';\nimport { mergeRefs } from './generated-attributes/utils/refMerger.js';\nimport { displayNameToKebabCase, displayNameToPropCase } from './helpers.js';\nimport { useMemo } from 'react';\n\nconst defaultOptions: Options = {\n name: null,\n slot: null,\n};\n\nconst styledFunctionCache = new WeakMap<StyledComponent<any, any>, React.ComponentType<any>>();\n\nexport const styledFunction = <C extends AnyStyledComponent | keyof JSX.IntrinsicElements | React.ComponentType<any>>(\n tag: C,\n options: Options = defaultOptions,\n) => {\n const { name: componentName, slot: componentSlot } = options;\n\n checkNamingConvention(componentName, componentSlot);\n\n // Here we use the `as` because when C is keyof JSX.IntrinsicElements we get `never` for the attributes generic\n // We want to account for string | number | symbol that's why we transform it to `keyof any`\n const baseStyledResolver = baseStyled(tag) as unknown as ThemedStyledFunction<C, Theme, {}, keyof any>;\n\n // Here we use arrow functions to preserve the `this` context\n const styledAttributes = {\n attrs: ((...args) => baseStyledResolver.attrs(...args)) as (typeof baseStyledResolver)['attrs'],\n withConfig: ((...args) => baseStyledResolver.withConfig(...args)) as (typeof baseStyledResolver)['withConfig'],\n };\n\n // Due to the recursive natura of this function, we can't type it properly\n // Since we can apply .attrs or .withConfig, we are not sure on the type of the returned function\n // @ts-expect-error explained above\n const dsStyledResolver: ThemedStyledFunctionBase<C, Theme> = (styleArg, ...expressions) => {\n /**\n * Here we apply a transformation to the expressions only.\n * Since this resolver is returning a HOC of a styled-component, the syntax support for\n * selecting the className of another styled-component is not available anymore.\n * That's why we assign it a `dsStyledComponnentId`, we will replace the component's call for\n * the corresponding id\n */\n const expressionsWithDsStyledComponentId = dsStyledComponentTransform(expressions);\n\n /**\n * Here we apply a CSS transformation to support MAGIC styled components\n * This makes it possible to use the following syntax:\n * color: neutral-100;\n * background-color: success-900;\n */\n const [styleArgWithMagic, expressionsWithMagic] = magicCssTransform(styleArg, expressionsWithDsStyledComponentId);\n\n /**\n * We coerce all the already written expressions with the default theme\n * This prevents styled components to break when a theme is not provided\n * either with the HOC or the ThemeProvider\n */\n const expressionsWithThemeCoerced = coerceWithDefaultTheme(expressionsWithMagic);\n\n if (componentName && componentSlot) {\n // Here we add the style overrides expression\n expressionsWithThemeCoerced.push(genStyleOverridesExpression(componentName, componentSlot));\n }\n\n if (componentName && componentSlot === 'root') {\n // Here we add the variant overrides from the user (only for the root slot\n expressionsWithThemeCoerced.push(genVariantOverridesExpression(componentName));\n }\n\n /**\n * Here we will fix the format of the style argument\n * We possible added some new expressions into the mix,\n * so we need to properly adjust the style arg\n */\n const numOfExpressionsAdded = expressionsWithThemeCoerced.length - expressionsWithMagic.length;\n\n const fixedStyleArg = fixStyleArg(styleArgWithMagic, numOfExpressionsAdded);\n\n // We will add autocalculated attributes to the styled component\n const [displayName, attributes] = generateAutoCalculated(options);\n\n // For each attribute function, we will call `attrs` func with it\n // This will add the attributes to the styled component\n const baseStyledResolverWithAttributes = attributes.reduce<typeof baseStyledResolver>(\n (curStyledResolver, attributeFunc) => curStyledResolver.attrs(attributeFunc),\n baseStyledResolver,\n );\n\n const Component = baseStyledResolverWithAttributes(fixedStyleArg, ...expressionsWithThemeCoerced);\n\n const MemoizedComponentWithRefsMerged = styledFunctionCache.get(Component);\n\n const ComponentWithRefsMerged =\n MemoizedComponentWithRefsMerged ??\n ((props: OwnerInterface & InnerRefInterface<C> & { 'data-testid'?: string }) => {\n // we may or not have data-testid at this point, so we need to calculate it\n const dataTestId = props['data-testid'] ?? (displayName !== null ? displayNameToKebabCase(displayName) : '');\n // we also need to calculate dataDimsumSlot at this point\n const dataDimsumSlot = displayName !== null ? displayNameToPropCase(displayName) : '';\n // then we get the part props for this slot, and we cast it to use refs\n const partProps = getPartProps({\n ...props,\n 'data-testid': dataTestId,\n 'data-dimsum-slot': dataDimsumSlot,\n }) as {\n innerRef?: AnyStyledRef<HTMLElement>;\n };\n\n const mergedRef = useMemo(\n () => mergeRefs(props.innerRef, partProps.innerRef),\n [props.innerRef, partProps.innerRef],\n );\n\n const propsWithRefMerged = {\n ...props,\n ref: mergedRef,\n innerRef: mergedRef,\n } as React.ComponentProps<C>;\n\n return <Component {...propsWithRefMerged} />;\n });\n\n styledFunctionCache.set(Component, ComponentWithRefsMerged);\n\n if (displayName !== null) {\n Component.displayName = displayName;\n }\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore We use dsStyledComponent to access the original's component id\n ComponentWithRefsMerged.dsStyledComponentId = Component.styledComponentId as string;\n ComponentWithRefsMerged.toString = Component.toString;\n\n return ComponentWithRefsMerged;\n };\n\n return Object.assign(dsStyledResolver, styledAttributes);\n};\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACyIR;AArIf,SAAS,6BAA6B;AACtC,SAAS,UAAU,kBAAkB;AACrC,SAAS,4BAA4B,yBAAyB;AAS9D,SAAS,8BAA8B;AACvC,SAAS,6BAA6B,qCAAqC;AAC3E,SAAS,mBAAmB;AAC5B,SAAS,8BAA8B;AACvC,SAAS,oBAAoB;AAC7B,SAAS,iBAAiB;AAC1B,SAAS,wBAAwB,6BAA6B;AAC9D,SAAS,eAAe;AAExB,MAAM,iBAA0B;AAAA,EAC9B,MAAM;AAAA,EACN,MAAM;AACR;AAEA,MAAM,sBAAsB,oBAAI,QAA6D;AAEtF,MAAM,iBAAiB,CAC5B,KACA,UAAmB,mBAChB;AACH,QAAM,EAAE,MAAM,eAAe,MAAM,cAAc,IAAI;AAErD,wBAAsB,eAAe,aAAa;AAIlD,QAAM,qBAAqB,WAAW,GAAG;AAGzC,QAAM,mBAAmB;AAAA,IACvB,OAAQ,IAAI,SAAS,mBAAmB,MAAM,GAAG,IAAI;AAAA,IACrD,YAAa,IAAI,SAAS,mBAAmB,WAAW,GAAG,IAAI;AAAA,EACjE;AAKA,QAAM,mBAAuD,CAAC,aAAa,gBAAgB;AAQzF,UAA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ACxB,gBAAU,cAAc;AAAA,IAC1B;AAIA,4BAAwB,sBAAsB,UAAU;AACxD,4BAAwB,WAAW,UAAU;AAE7C,WAAO;AAAA,EACT;AAEA,SAAO,OAAO,OAAO,kBAAkB,gBAAgB;AACzD;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ const dsStyledComponentTransform = (expressions) => expressions.map((expression) => {
3
+ if (typeof expression === "function" && "dsStyledComponentId" in expression) {
4
+ return () => `.${expression.dsStyledComponentId}`;
5
+ }
6
+ return expression;
7
+ });
8
+ export {
9
+ dsStyledComponentTransform
10
+ };
11
+ //# sourceMappingURL=dsStyledComponentTransform.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/styled/transformers/dsStyledComponentTransform.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { Expressions } from '../types.js';\n\ntype DSStyledComponentTransform = (expressions: Expressions) => Expressions;\n\nexport const dsStyledComponentTransform: DSStyledComponentTransform = (expressions) =>\n expressions.map((expression) => {\n if (typeof expression === 'function' && 'dsStyledComponentId' in expression) {\n return () => `.${expression.dsStyledComponentId as string}`;\n }\n return expression;\n });\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACIhB,MAAM,6BAAyD,CAAC,gBACrE,YAAY,IAAI,CAAC,eAAe;AAC9B,MAAI,OAAO,eAAe,cAAc,yBAAyB,YAAY;AAC3E,WAAO,MAAM,IAAI,WAAW;AAAA,EAC9B;AACA,SAAO;AACT,CAAC;",
6
+ "names": []
7
+ }
@@ -1,6 +1,8 @@
1
1
  import * as React from "react";
2
2
  import { magicCssTransform } from "./magicCssTransform.js";
3
+ import { dsStyledComponentTransform } from "./dsStyledComponentTransform.js";
3
4
  export {
5
+ dsStyledComponentTransform,
4
6
  magicCssTransform
5
7
  };
6
8
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { magicCssTransform } from './magicCssTransform.js';\nexport { dsStyledComponentTransform } from './dsStyledComponentTransform.js';\n"],
5
+ "mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,yBAAyB;AAClC,SAAS,kCAAkC;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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;",
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 (value: string, dfault = ''): ThemeStringGetter =>\n ({ theme }) => {\n const parts = value.split('-');\n let result = theme[property];\n parts.forEach((part) => {\n if (result) result = result[part as keyof typeof result];\n });\n return (result as unknown as string) ?? dfault;\n };\n\nexport const th: ThConstructor = (property): ThGetter => {\n switch (property) {\n case 'colors' as keyof Theme:\n return colorGetter;\n default:\n return genericGetter(property);\n }\n};\n\nth.space = th('space');\nth.fontSize = th('fontSizes');\nth.fontWeight = th('fontWeights');\nth.lineHeight = th('lineHeights');\nth.letterSpacing = th('letterSpacings');\nth.font = th('fonts');\nth.color = th('colors');\nth.breakpoint = th('breakpoints');\nth.media = th('media');\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;A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,GAAG,aAAa;AAChC,GAAG,QAAQ,GAAG,OAAO;AACrB,GAAG,SAAS,GAAG,QAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,2 +1,6 @@
1
- import type { AttrsFunc, Options } from '../types.js';
1
+ import type { AttrsFunc, Options, OwnerInterface } from '../types.js';
2
+ export declare const getPartProps: (props: {
3
+ 'data-testid': string;
4
+ 'data-dimsum-slot': string;
5
+ } & OwnerInterface) => Record<string, unknown>;
2
6
  export declare const generateAttributes: (options: Options, displayName: string | null) => AttrsFunc<any>[];
@@ -1,7 +1,2 @@
1
- /// <reference types="react" />
2
- import type { StyledComponentInnerComponent, StyledComponentPropsWithRef } from 'styled-components';
3
1
  import type { AnyStyledRef } from '../../types.js';
4
- export declare const refMerger: <T extends {
5
- ref?: AnyStyledRef<HTMLElement> | undefined;
6
- innerRef?: AnyStyledRef<HTMLElement> | undefined;
7
- }>(props: StyledComponentPropsWithRef<StyledComponentInnerComponent<import("react").ComponentType<T>>>, object: Record<string, unknown>) => Record<string, unknown>;
2
+ export declare const mergeRefs: <T extends HTMLElement>(ref1: AnyStyledRef<T> | undefined, ref2: AnyStyledRef<T> | undefined) => (_ref: T | null) => void;
@@ -2,4 +2,5 @@ export declare const propsToClassKey: (props: Record<string, {
2
2
  toString: () => string;
3
3
  }>) => string;
4
4
  export declare const displayNameToKebabCase: (displayName: string) => string;
5
+ export declare const displayNameToPropCase: (displayName: string) => string;
5
6
  export declare const slotObjectToDataTestIds: (componentName: string, slotObject: Record<string, string>) => Record<string, string>;
@@ -0,0 +1,4 @@
1
+ import type { Expressions } from '../types.js';
2
+ type DSStyledComponentTransform = (expressions: Expressions) => Expressions;
3
+ export declare const dsStyledComponentTransform: DSStyledComponentTransform;
4
+ export {};
@@ -1 +1,2 @@
1
1
  export { magicCssTransform } from './magicCssTransform.js';
2
+ export { dsStyledComponentTransform } from './dsStyledComponentTransform.js';
@@ -1,6 +1,7 @@
1
- /// <reference types="react" />
2
- import type { CSSObject, Interpolation, InterpolationFunction, StyledComponent, StyledComponentInnerComponent, StyledComponentPropsWithRef, ThemedStyledProps } from 'styled-components';
1
+ import type { AnyStyledComponent, CSSObject, Interpolation, InterpolationFunction, StyledComponent, StyledComponentInnerComponent, StyledComponentPropsWithRef, ThemedStyledProps } from 'styled-components';
3
2
  import type { Theme as PuiTheme } from '@elliemae/pui-theme';
3
+ import type { ElementType, Ref } from 'react';
4
+ import type React from 'react';
4
5
  export interface Options {
5
6
  name: string | null;
6
7
  slot: string | null;
@@ -18,15 +19,17 @@ export interface Theme extends PuiTheme {
18
19
  };
19
20
  };
20
21
  }
21
- export type AnyStyledRef<T extends HTMLElement> = React.MutableRefObject<T | null> | ((_ref: T | null) => void) | React.Dispatch<React.SetStateAction<T | null>> | false;
22
+ export type AnyStyledRef<T extends HTMLElement> = React.MutableRefObject<T | null> | ((_ref: T | null) => void) | false | null;
22
23
  export type StyleArg<T = any> = TemplateStringsArray | CSSObject | InterpolationFunction<T>;
23
24
  export type Expression<T = any> = Interpolation<T>;
24
25
  export type Expressions<T = any> = Array<Expression<T>>;
25
26
  export type PropsWithTheme<T = Record<string, unknown>> = T & {
26
27
  theme: Theme;
27
28
  };
29
+ type ComponentInnerRef<T extends ElementType> = T extends new (props: infer P) => React.Component<any, any> ? Ref<InstanceType<T>> | undefined : React.PropsWithRef<React.ComponentProps<T>>['ref'];
30
+ export type StyledComponentInnerRef<C extends keyof JSX.IntrinsicElements | React.ComponentType<any>> = C extends AnyStyledComponent ? ComponentInnerRef<StyledComponentInnerComponent<C>> : ComponentInnerRef<C>;
28
31
  export interface ThemedStyledFunctionBase<C extends keyof JSX.IntrinsicElements | React.ComponentType<any>, T extends object, O extends object = {}, A extends keyof any = never> {
29
- <U extends object>(first: StyleArg<ThemedStyledProps<StyledComponentPropsWithRef<C> & O & U & OwnerInterface, T>>, ...rest: Expressions<ThemedStyledProps<StyledComponentPropsWithRef<C> & O & U & OwnerInterface, T>>): StyledComponent<C, T, O & U & OwnerInterface, A>;
32
+ <U extends object>(first: StyleArg<ThemedStyledProps<StyledComponentPropsWithRef<C> & O & U & OwnerInterface & InnerRefInterface<C>, T>>, ...rest: Expressions<ThemedStyledProps<StyledComponentPropsWithRef<C> & O & U & OwnerInterface & InnerRefInterface<C>, T>>): StyledComponent<C, T, O & U & OwnerInterface & InnerRefInterface<C>, A>;
30
33
  }
31
34
  export type AttrsFunc<T extends object = Record<string, unknown>> = (props: StyledComponentPropsWithRef<StyledComponentInnerComponent<React.ComponentType<T>>>) => Partial<StyledComponentPropsWithRef<StyledComponentInnerComponent<any>>>;
32
35
  export type InternalAttrsFunc<T extends object = Record<string, unknown>> = (props: StyledComponentPropsWithRef<StyledComponentInnerComponent<React.ComponentType<T & {
@@ -35,8 +38,13 @@ export type InternalAttrsFunc<T extends object = Record<string, unknown>> = (pro
35
38
  options: Options;
36
39
  displayName: string | null;
37
40
  }) => Partial<StyledComponentPropsWithRef<StyledComponentInnerComponent<any>>>;
41
+ export interface InnerRefInterface<C extends keyof JSX.IntrinsicElements | React.ComponentType<any>> {
42
+ innerRef?: StyledComponentInnerRef<C>;
43
+ ref?: never;
44
+ }
38
45
  export interface OwnerInterface {
39
46
  getOwnerProps?: () => object;
40
47
  getOwnerPropsArguments?: () => object;
41
48
  }
42
49
  export type PartProps = Record<string, unknown> | ((args: object) => Record<string, unknown>) | null | undefined;
50
+ export {};
@@ -1,3 +1,3 @@
1
- export declare const XStyledWrapper: import("styled-components").StyledComponent<"div", import("./index.js").Theme, import("@xstyled/util").Props<import("@xstyled/system").Theme> & import("@xstyled/system").TypographyProps<import("@xstyled/system").Theme> & import("./index.js").OwnerInterface, never>;
1
+ export declare const XStyledWrapper: import("styled-components").StyledComponent<"div", import("./index.js").Theme, import("@xstyled/util").Props<import("@xstyled/system").Theme> & import("@xstyled/system").TypographyProps<import("@xstyled/system").Theme> & import("./index.js").OwnerInterface & import("./index.js").InnerRefInterface<"div">, never>;
2
2
  export declare const xStyledCommonProps: import("@xstyled/system").StyleGenerator<import("@xstyled/system").TypographyProps<import("@xstyled/system").Theme> & import("./index.js").BackgroundProps & import("./index.js").SpaceProps & import("@xstyled/system").BoxShadowProps<import("@xstyled/system").Theme> & import("@xstyled/system").FlexboxesProps<import("@xstyled/system").Theme> & import("@xstyled/system").LayoutProps<import("@xstyled/system").Theme> & import("./index.js").ColorProps>;
3
3
  export default XStyledWrapper;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-system",
3
- "version": "3.24.2",
3
+ "version": "3.25.0-next.2",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - System",
6
6
  "files": [
@@ -100,7 +100,7 @@
100
100
  "@elliemae/pui-cli": "~9.0.0-next.31",
101
101
  "@elliemae/pui-theme": "~2.7.0",
102
102
  "styled-components": "~5.3.9",
103
- "@elliemae/ds-monorepo-devops": "3.24.2"
103
+ "@elliemae/ds-monorepo-devops": "3.25.0-next.2"
104
104
  },
105
105
  "peerDependencies": {
106
106
  "@elliemae/pui-theme": "^2.7.0",