@elliemae/ds-system 3.35.0 → 3.36.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/cjs/HtmlComponents.js.map +1 -1
  2. package/dist/cjs/arithmetic.js.map +1 -1
  3. package/dist/cjs/globalStyles.js.map +1 -1
  4. package/dist/cjs/mobileUtilities.js +4 -8
  5. package/dist/cjs/mobileUtilities.js.map +1 -1
  6. package/dist/cjs/spaceUtilities.js +12 -24
  7. package/dist/cjs/spaceUtilities.js.map +1 -1
  8. package/dist/cjs/styled/checkNamingConvention.js.map +1 -1
  9. package/dist/cjs/styled/generated-attributes/generateAttributes.js +5 -10
  10. package/dist/cjs/styled/generated-attributes/generateAttributes.js.map +1 -1
  11. package/dist/cjs/styled/generated-attributes/generateDisplayName.js +1 -2
  12. package/dist/cjs/styled/generated-attributes/generateDisplayName.js.map +1 -1
  13. package/dist/cjs/styled/generated-attributes/utils/refMerger.js +4 -8
  14. package/dist/cjs/styled/generated-attributes/utils/refMerger.js.map +1 -1
  15. package/dist/cjs/styled/helpers.js.map +1 -1
  16. package/dist/cjs/styled/styledFunction.js +1 -0
  17. package/dist/cjs/styled/styledFunction.js.map +2 -2
  18. package/dist/cjs/styled/system-utilities/background.js.map +1 -1
  19. package/dist/cjs/styled/system-utilities/border.js.map +1 -1
  20. package/dist/cjs/styled/system-utilities/color.js.map +1 -1
  21. package/dist/cjs/styled/transformers/dsStyledComponentTransform.js.map +1 -1
  22. package/dist/cjs/styled/transformers/magicCssTransform.js +2 -4
  23. package/dist/cjs/styled/transformers/magicCssTransform.js.map +1 -1
  24. package/dist/cjs/th.js +4 -8
  25. package/dist/cjs/th.js.map +1 -1
  26. package/dist/cjs/utils.js.map +1 -1
  27. package/dist/cjs/xStyledWrapper.js.map +1 -1
  28. package/dist/esm/HtmlComponents.js.map +1 -1
  29. package/dist/esm/arithmetic.js.map +1 -1
  30. package/dist/esm/globalStyles.js.map +1 -1
  31. package/dist/esm/mobileUtilities.js +4 -8
  32. package/dist/esm/mobileUtilities.js.map +1 -1
  33. package/dist/esm/spaceUtilities.js +12 -24
  34. package/dist/esm/spaceUtilities.js.map +1 -1
  35. package/dist/esm/styled/checkNamingConvention.js.map +1 -1
  36. package/dist/esm/styled/generated-attributes/generateAttributes.js +5 -10
  37. package/dist/esm/styled/generated-attributes/generateAttributes.js.map +1 -1
  38. package/dist/esm/styled/generated-attributes/generateDisplayName.js +1 -2
  39. package/dist/esm/styled/generated-attributes/generateDisplayName.js.map +1 -1
  40. package/dist/esm/styled/generated-attributes/utils/refMerger.js +4 -8
  41. package/dist/esm/styled/generated-attributes/utils/refMerger.js.map +1 -1
  42. package/dist/esm/styled/helpers.js.map +1 -1
  43. package/dist/esm/styled/styledFunction.js +1 -0
  44. package/dist/esm/styled/styledFunction.js.map +2 -2
  45. package/dist/esm/styled/system-utilities/background.js.map +1 -1
  46. package/dist/esm/styled/system-utilities/border.js.map +1 -1
  47. package/dist/esm/styled/system-utilities/color.js.map +1 -1
  48. package/dist/esm/styled/transformers/dsStyledComponentTransform.js.map +1 -1
  49. package/dist/esm/styled/transformers/magicCssTransform.js +2 -4
  50. package/dist/esm/styled/transformers/magicCssTransform.js.map +1 -1
  51. package/dist/esm/th.js +4 -8
  52. package/dist/esm/th.js.map +1 -1
  53. package/dist/esm/utils.js.map +1 -1
  54. package/dist/esm/xStyledWrapper.js.map +1 -1
  55. package/dist/types/styled/generated-attributes/utils/callbackMerger.d.ts +1 -2
  56. package/dist/types/styled/styledObject.d.ts +1 -0
  57. package/dist/types/utils.d.ts +0 -1
  58. package/package.json +2 -2
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/HtmlComponents.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { styled } from './index.js';\nimport type {} from '@xstyled/util';\nimport type {} from '@xstyled/system';\nimport { xStyledCommonProps } from './xStyledWrapper.js';\n\nexport const Address = styled('address')`\n ${xStyledCommonProps}\n`;\nexport const Article = styled('article')`\n ${xStyledCommonProps}\n`;\nexport const Aside = styled('aside')`\n ${xStyledCommonProps}\n`;\nexport const Footer = styled('footer')`\n ${xStyledCommonProps}\n`;\nexport const Header = styled('header')`\n ${xStyledCommonProps}\n`;\nexport const H1 = styled('h1')`\n ${xStyledCommonProps}\n`;\nexport const H2 = styled('h2')`\n ${xStyledCommonProps}\n`;\nexport const H3 = styled('h3')`\n ${xStyledCommonProps}\n`;\nexport const H4 = styled('h4')`\n ${xStyledCommonProps}\n`;\nexport const H5 = styled('h5')`\n ${xStyledCommonProps}\n`;\nexport const H6 = styled('h6')`\n ${xStyledCommonProps}\n`;\nexport const Hgroup = styled('hgroup')`\n ${xStyledCommonProps}\n`;\nexport const Main = styled('main')`\n ${xStyledCommonProps}\n`;\nexport const Nav = styled('nav')`\n ${xStyledCommonProps}\n`;\nexport const Section = styled('section')`\n ${xStyledCommonProps}\n`;\nexport const Search = styled('search')`\n ${xStyledCommonProps}\n`;\nexport const Blockquote = styled('blockquote')`\n ${xStyledCommonProps}\n`;\nexport const Dd = styled('dd')`\n ${xStyledCommonProps}\n`;\nexport const Div = styled('div')`\n ${xStyledCommonProps}\n`;\nexport const Dl = styled('dl')`\n ${xStyledCommonProps}\n`;\nexport const Dt = styled('dt')`\n ${xStyledCommonProps}\n`;\nexport const Figcaption = styled('figcaption')`\n ${xStyledCommonProps}\n`;\nexport const Figure = styled('figure')`\n ${xStyledCommonProps}\n`;\nexport const Hr = styled('hr')`\n ${xStyledCommonProps}\n`;\nexport const Li = styled('li')`\n ${xStyledCommonProps}\n`;\nexport const Menu = styled('menu')`\n ${xStyledCommonProps}\n`;\nexport const Ol = styled('ol')`\n ${xStyledCommonProps}\n`;\nexport const P = styled('p')`\n ${xStyledCommonProps}\n`;\nexport const Pre = styled('pre')`\n ${xStyledCommonProps}\n`;\nexport const Ul = styled('ul')`\n ${xStyledCommonProps}\n`;\nexport const A = styled('a')`\n ${xStyledCommonProps}\n`;\nexport const Abbr = styled('abbr')`\n ${xStyledCommonProps}\n`;\nexport const B = styled('b')`\n ${xStyledCommonProps}\n`;\nexport const Bdi = styled('bdi')`\n ${xStyledCommonProps}\n`;\nexport const Bdo = styled('bdo')`\n ${xStyledCommonProps}\n`;\nexport const Br = styled('br')`\n ${xStyledCommonProps}\n`;\nexport const Cite = styled('cite')`\n ${xStyledCommonProps}\n`;\nexport const Code = styled('code')`\n ${xStyledCommonProps}\n`;\nexport const Data = styled('data')`\n ${xStyledCommonProps}\n`;\nexport const Dfn = styled('dfn')`\n ${xStyledCommonProps}\n`;\nexport const Em = styled('em')`\n ${xStyledCommonProps}\n`;\nexport const I = styled('i')`\n ${xStyledCommonProps}\n`;\nexport const Kbd = styled('kbd')`\n ${xStyledCommonProps}\n`;\nexport const Mark = styled('mark')`\n ${xStyledCommonProps}\n`;\nexport const Q = styled('q')`\n ${xStyledCommonProps}\n`;\nexport const Rp = styled('rp')`\n ${xStyledCommonProps}\n`;\nexport const Rt = styled('rt')`\n ${xStyledCommonProps}\n`;\nexport const Ruby = styled('ruby')`\n ${xStyledCommonProps}\n`;\nexport const S = styled('s')`\n ${xStyledCommonProps}\n`;\nexport const Samp = styled('samp')`\n ${xStyledCommonProps}\n`;\nexport const Small = styled('small')`\n ${xStyledCommonProps}\n`;\nexport const Span = styled('span')`\n ${xStyledCommonProps}\n`;\nexport const Strong = styled('strong')`\n ${xStyledCommonProps}\n`;\nexport const Sub = styled('sub')`\n ${xStyledCommonProps}\n`;\nexport const Sup = styled('sup')`\n ${xStyledCommonProps}\n`;\nexport const Time = styled('time')`\n ${xStyledCommonProps}\n`;\nexport const U = styled('u')`\n ${xStyledCommonProps}\n`;\nexport const Wbr = styled('wbr')`\n ${xStyledCommonProps}\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AAAA,IACvB,wCAAkB;AAAA;AAEf,MAAM,UAAM,qBAAO,KAAK;AAAA,IAC3B,wCAAkB;AAAA;AAEf,MAAM,WAAO,qBAAO,MAAM;AAAA,IAC7B,wCAAkB;AAAA;AAEf,MAAM,QAAI,qBAAO,GAAG;AAAA,IACvB,wCAAkB;AAAA;AAEf,MAAM,SAAK,qBAAO,IAAI;AAAA,IACzB,wCAAkB;AAAA;AAEf,MAAM,SAAK,qBAAO,IAAI;AAAA,IACzB,wCAAkB;AAAA;AAEf,MAAM,WAAO,qBAAO,MAAM;AAAA,IAC7B,wCAAkB;AAAA;AAEf,MAAM,QAAI,qBAAO,GAAG;AAAA,IACvB,wCAAkB;AAAA;AAEf,MAAM,WAAO,qBAAO,MAAM;AAAA,IAC7B,wCAAkB;AAAA;AAEf,MAAM,YAAQ,qBAAO,OAAO;AAAA,IAC/B,wCAAkB;AAAA;AAEf,MAAM,WAAO,qBAAO,MAAM;AAAA,IAC7B,wCAAkB;AAAA;AAEf,MAAM,aAAS,qBAAO,QAAQ;AAAA,IACjC,wCAAkB;AAAA;AAEf,MAAM,UAAM,qBAAO,KAAK;AAAA,IAC3B,wCAAkB;AAAA;AAEf,MAAM,UAAM,qBAAO,KAAK;AAAA,IAC3B,wCAAkB;AAAA;AAEf,MAAM,WAAO,qBAAO,MAAM;AAAA,IAC7B,wCAAkB;AAAA;AAEf,MAAM,QAAI,qBAAO,GAAG;AAAA,IACvB,wCAAkB;AAAA;AAEf,MAAM,UAAM,qBAAO,KAAK;AAAA,IAC3B,wCAAkB;AAAA;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/arithmetic.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["export function getNumberAndUnit(numberStrWithUnit: string | number): { number: string; unit: string } {\n const matchResult = String(numberStrWithUnit).match(/[a-z]+|[(/^\\-?\\d*.\\d+|\\d+),?]+/gi);\n let number = '0';\n let unit = 'px';\n if (matchResult) {\n [number, unit] = matchResult;\n }\n\n return { number, unit };\n}\n\nexport function op(operator: string, n1: string, n2: string | number): string {\n const { number, unit } = getNumberAndUnit(n1);\n const { number: number2, unit: unit2 } = getNumberAndUnit(n2);\n switch (operator) {\n case '*':\n return `${Number(number) * Number(number2)}${unit || unit2}`;\n case '+':\n return `${Number(number) + Number(number2)}${unit || unit2}`;\n case '-':\n return `${Number(number) - Number(number2)}${unit || unit2}`;\n case '/':\n return `${Number(number) / Number(number2)}${unit || unit2}`;\n default:\n return `${Number(number) + Number(number2)}${unit || unit2}`;\n }\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,SAAS,iBAAiB,mBAAsE;AACrG,QAAM,cAAc,OAAO,iBAAiB,EAAE,MAAM,kCAAkC;AACtF,MAAI,SAAS;AACb,MAAI,OAAO;AACX,MAAI,aAAa;AACf,KAAC,QAAQ,IAAI,IAAI;AAAA,EACnB;AAEA,SAAO,EAAE,QAAQ,KAAK;AACxB;AAEO,SAAS,GAAG,UAAkB,IAAY,IAA6B;AAC5E,QAAM,EAAE,QAAQ,KAAK,IAAI,iBAAiB,EAAE;AAC5C,QAAM,EAAE,QAAQ,SAAS,MAAM,MAAM,IAAI,iBAAiB,EAAE;AAC5D,UAAQ,UAAU;AAAA,IAChB,KAAK;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,IACvD,KAAK;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,IACvD,KAAK;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,IACvD,KAAK;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,IACvD;AACE,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,IAAI,QAAQ;AAAA,EACzD;AACF;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,SAAS,iBAAiB,mBAAsE;AACrG,QAAM,cAAc,OAAO,iBAAiB,EAAE,MAAM,kCAAkC;AACtF,MAAI,SAAS;AACb,MAAI,OAAO;AACX,MAAI,aAAa;AACf,KAAC,QAAQ,IAAI,IAAI;AAAA,EACnB;AAEA,SAAO,EAAE,QAAQ,KAAK;AACxB;AAEO,SAAS,GAAG,UAAkB,IAAY,IAA6B;AAC5E,QAAM,EAAE,QAAQ,KAAK,IAAI,iBAAiB,EAAE;AAC5C,QAAM,EAAE,QAAQ,SAAS,MAAM,MAAM,IAAI,iBAAiB,EAAE;AAC5D,UAAQ,UAAU;AAAA,IAChB,KAAK;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,CAAC,GAAG,QAAQ,KAAK;AAAA,IAC5D,KAAK;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,CAAC,GAAG,QAAQ,KAAK;AAAA,IAC5D,KAAK;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,CAAC,GAAG,QAAQ,KAAK;AAAA,IAC5D,KAAK;AACH,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,CAAC,GAAG,QAAQ,KAAK;AAAA,IAC5D;AACE,aAAO,GAAG,OAAO,MAAM,IAAI,OAAO,OAAO,CAAC,GAAG,QAAQ,KAAK;AAAA,EAC9D;AACF;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/globalStyles.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { createGlobalStyle } from './styled/index.js';\nimport { th } from './th.js';\n\nexport const GlobalStyles = createGlobalStyle<{ device: 'desktop' | 'mobile' }>`\n // Here we setup the root font-sizes for mobile vs desktop\n :root {\n font-size: ${(props) => (props.device === 'desktop' ? '81.25%' : '100%')};\n\n @media(min-width: ${({ theme }) => theme.breakpoints.small}) {\n font-size: ${(props) => (props.device === 'mobile' ? '100%' : '81.25%')};\n }\n }\n\n body {\n overscroll-behavior-y: none;\n\n font-size: 1rem; // since we correctly have set up the root font-sizes, we can use 1rem\n }\n\n /* fix sanitize */\n ::placeholder {\n font-weight: ${th.fontWeight('regular')};\n color: ${th.color('neutral-500')};\n }\n ::-webkit-input-placeholder {\n opacity: 1;\n }\n\n :where(svg:not([fill])) {\n fill: unset;\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAkC;AAClC,gBAAmB;AAEZ,MAAM,eAAe;AAAA;AAAA;AAAA,iBAGX,CAAC,UAAW,MAAM,WAAW,YAAY,WAAW;AAAA;AAAA,wBAE7C,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY;AAAA,mBACtC,CAAC,UAAW,MAAM,WAAW,WAAW,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAYjD,aAAG,WAAW,SAAS;AAAA,aAC7B,aAAG,MAAM,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAkC;AAClC,gBAAmB;AAEZ,MAAM,eAAe;AAAA;AAAA;AAAA,iBAGX,CAAC,UAAW,MAAM,WAAW,YAAY,WAAW,MAAO;AAAA;AAAA,wBAEpD,CAAC,EAAE,MAAM,MAAM,MAAM,YAAY,KAAK;AAAA,mBAC3C,CAAC,UAAW,MAAM,WAAW,WAAW,SAAS,QAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAY1D,aAAG,WAAW,SAAS,CAAC;AAAA,aAC9B,aAAG,MAAM,aAAa,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -39,18 +39,15 @@ var import_react = require("react");
39
39
  var import_theme = require("./theme.js");
40
40
  var import_constants = require("./constants.js");
41
41
  function __UNSAFE_SPACE_TO_DIMSUM(unit) {
42
- if (unit in import_constants.translateUnits)
43
- return import_constants.translateUnits[unit];
42
+ if (unit in import_constants.translateUnits) return import_constants.translateUnits[unit];
44
43
  return `${parseFloat(unit) * (import_constants.mobileBaseFont / import_constants.desktopBaseFont) / 2}px`;
45
44
  }
46
45
  const isMobile = () => {
47
- if (!window)
48
- return false;
46
+ if (!window) return false;
49
47
  return Number(import_theme.theme.breakpoints.medium.split("px")[0]) - window.innerWidth >= 0;
50
48
  };
51
49
  function toMobile(unit) {
52
- if (!isMobile())
53
- return unit;
50
+ if (!isMobile()) return unit;
54
51
  return `${parseFloat(unit) * (import_constants.desktopBaseFont / import_constants.mobileBaseFont)}rem`;
55
52
  }
56
53
  const useIsMobile = () => {
@@ -64,8 +61,7 @@ const useIsMobile = () => {
64
61
  window?.removeEventListener("resize", handleResize);
65
62
  };
66
63
  }, []);
67
- if (!window)
68
- return false;
64
+ if (!window) return false;
69
65
  return mobile;
70
66
  };
71
67
  //# sourceMappingURL=mobileUtilities.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/mobileUtilities.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable @typescript-eslint/naming-convention */\nimport { useState, useEffect } from 'react';\nimport { theme } from './theme.js';\nimport { desktopBaseFont, mobileBaseFont, translateUnits } from './constants.js';\n\n// eslint-disable-next-line no-underscore-dangle\nexport function __UNSAFE_SPACE_TO_DIMSUM(unit: string): string {\n if (unit in translateUnits) return translateUnits[unit as keyof typeof translateUnits];\n return `${(parseFloat(unit) * (mobileBaseFont / desktopBaseFont)) / 2}px`;\n}\n\nexport const isMobile = (): boolean => {\n if (!window) return false;\n return Number(theme.breakpoints.medium.split('px')[0]) - window.innerWidth >= 0;\n};\n\nexport function toMobile(unit: string): string {\n if (!isMobile()) return unit;\n return `${parseFloat(unit) * (desktopBaseFont / mobileBaseFont)}rem`;\n}\n\nexport const useIsMobile = (): boolean => {\n const [mobile, setMobile] = useState<boolean>(isMobile());\n\n useEffect(() => {\n function handleResize() {\n setMobile(isMobile());\n }\n window?.addEventListener('resize', handleResize);\n return () => {\n window?.removeEventListener('resize', handleResize);\n };\n }, []);\n\n if (!window) return false;\n return mobile;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAoC;AACpC,mBAAsB;AACtB,uBAAgE;AAGzD,SAAS,yBAAyB,MAAsB;AAC7D,MAAI,QAAQ;AAAgB,WAAO,gCAAe,IAAmC;AACrF,SAAO,GAAI,WAAW,IAAI,KAAK,kCAAiB,oCAAoB;AACtE;AAEO,MAAM,WAAW,MAAe;AACrC,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO,OAAO,mBAAM,YAAY,OAAO,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,OAAO,cAAc;AAChF;AAEO,SAAS,SAAS,MAAsB;AAC7C,MAAI,CAAC,SAAS;AAAG,WAAO;AACxB,SAAO,GAAG,WAAW,IAAI,KAAK,mCAAkB;AAClD;AAEO,MAAM,cAAc,MAAe;AACxC,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAkB,SAAS,CAAC;AAExD,8BAAU,MAAM;AACd,aAAS,eAAe;AACtB,gBAAU,SAAS,CAAC;AAAA,IACtB;AACA,YAAQ,iBAAiB,UAAU,YAAY;AAC/C,WAAO,MAAM;AACX,cAAQ,oBAAoB,UAAU,YAAY;AAAA,IACpD;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO;AACT;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAoC;AACpC,mBAAsB;AACtB,uBAAgE;AAGzD,SAAS,yBAAyB,MAAsB;AAC7D,MAAI,QAAQ,gCAAgB,QAAO,gCAAe,IAAmC;AACrF,SAAO,GAAI,WAAW,IAAI,KAAK,kCAAiB,oCAAoB,CAAC;AACvE;AAEO,MAAM,WAAW,MAAe;AACrC,MAAI,CAAC,OAAQ,QAAO;AACpB,SAAO,OAAO,mBAAM,YAAY,OAAO,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,OAAO,cAAc;AAChF;AAEO,SAAS,SAAS,MAAsB;AAC7C,MAAI,CAAC,SAAS,EAAG,QAAO;AACxB,SAAO,GAAG,WAAW,IAAI,KAAK,mCAAkB,gCAAe;AACjE;AAEO,MAAM,cAAc,MAAe;AACxC,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAkB,SAAS,CAAC;AAExD,8BAAU,MAAM;AACd,aAAS,eAAe;AACtB,gBAAU,SAAS,CAAC;AAAA,IACtB;AACA,YAAQ,iBAAiB,UAAU,YAAY;AAC/C,WAAO,MAAM;AACX,cAAQ,oBAAoB,UAAU,YAAY;AAAA,IACpD;AAAA,EACF,GAAG,CAAC,CAAC;AAEL,MAAI,CAAC,OAAQ,QAAO;AACpB,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -42,36 +42,27 @@ var React = __toESM(require("react"));
42
42
  var import_lodash = require("lodash");
43
43
  var import_theme = require("./theme.js");
44
44
  function mapGap(gutter) {
45
- if (!gutter)
46
- return "0rem";
47
- if (String(gutter).includes("rem") || String(gutter).includes("px"))
48
- return gutter;
45
+ if (!gutter) return "0rem";
46
+ if (String(gutter).includes("rem") || String(gutter).includes("px")) return gutter;
49
47
  return `${import_theme.theme.space[gutter]}`;
50
48
  }
51
49
  function mapGutter(gutter) {
52
- if (!gutter)
53
- return "0rem";
50
+ if (!gutter) return "0rem";
54
51
  return `${import_theme.theme.space[gutter]} * 2`;
55
52
  }
56
53
  function mapSpace(width) {
57
- if (typeof width === "string")
58
- return (0, import_lodash.get)(import_theme.theme, width) ? `${(0, import_lodash.get)(import_theme.theme, width)}` : width;
54
+ if (typeof width === "string") return (0, import_lodash.get)(import_theme.theme, width) ? `${(0, import_lodash.get)(import_theme.theme, width)}` : width;
59
55
  return `${width * 100}%`;
60
56
  }
61
57
  function fixSpaceGutter(width, gutter) {
62
- if (!width)
63
- return "";
64
- if (width === "fit-content")
65
- return width;
66
- if (Array.isArray(width))
67
- return width.map((w) => `calc(${mapSpace(w)} - (${mapGutter(gutter)}))`);
58
+ if (!width) return "";
59
+ if (width === "fit-content") return width;
60
+ if (Array.isArray(width)) return width.map((w) => `calc(${mapSpace(w)} - (${mapGutter(gutter)}))`);
68
61
  return `calc(${mapSpace(width)} - (${mapGutter(gutter)}))`;
69
62
  }
70
63
  function fixSpace(width) {
71
- if (!width)
72
- return "";
73
- if (Array.isArray(width))
74
- return width.map((w) => mapSpace(w));
64
+ if (!width) return "";
65
+ if (Array.isArray(width)) return width.map((w) => mapSpace(w));
75
66
  return mapSpace(width);
76
67
  }
77
68
  function numbersToFr(grid) {
@@ -79,17 +70,14 @@ function numbersToFr(grid) {
79
70
  return den.map((d) => `${d}fr`);
80
71
  }
81
72
  function mapGrid(width) {
82
- if ((0, import_lodash.get)(import_theme.theme, width))
83
- return `${(0, import_lodash.get)(import_theme.theme, width)}`;
84
- if (typeof width === "string")
85
- return width;
73
+ if ((0, import_lodash.get)(import_theme.theme, width)) return `${(0, import_lodash.get)(import_theme.theme, width)}`;
74
+ if (typeof width === "string") return width;
86
75
  const den = width < 1 ? Math.floor(1 / width) : width;
87
76
  return `${den}fr`;
88
77
  }
89
78
  function mapTemplateGrid(grid) {
90
79
  if (Array.isArray(grid)) {
91
- if (grid.some((w) => typeof w === "string"))
92
- return grid.map((w) => mapGrid(w));
80
+ if (grid.some((w) => typeof w === "string")) return grid.map((w) => mapGrid(w));
93
81
  return numbersToFr(grid);
94
82
  }
95
83
  return mapGrid(grid);
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/spaceUtilities.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { get } from 'lodash';\nimport { theme } from './theme.js';\n\nexport function mapGap(gutter: number | string): number | string {\n if (!gutter) return '0rem';\n if (String(gutter).includes('rem') || String(gutter).includes('px')) return gutter;\n return `${theme.space[gutter as keyof typeof theme.space]}`;\n}\n\nexport function mapGutter(gutter: string | number | undefined): string {\n if (!gutter) return '0rem';\n return `${theme.space[gutter as keyof typeof theme.space]} * 2`;\n}\n\nexport function mapSpace(width: string | number): string {\n if (typeof width === 'string') return get(theme, width) ? `${get(theme, width)}` : width;\n return `${width * 100}%`;\n}\n\nexport function fixSpaceGutter(\n width: string | number | string[] | number[],\n gutter?: string | number,\n): string | string[] {\n if (!width) return '';\n if (width === 'fit-content') return width;\n if (Array.isArray(width)) return width.map((w) => `calc(${mapSpace(w)} - (${mapGutter(gutter)}))`);\n return `calc(${mapSpace(width)} - (${mapGutter(gutter)}))`;\n}\n\nexport function fixSpace(width: string | number | string[] | number[]): string | string[] {\n if (!width) return '';\n if (Array.isArray(width)) return width.map((w) => mapSpace(w));\n return mapSpace(width);\n}\n\nexport function numbersToFr(grid: number[]): string[] {\n const den = grid.map((f) => (f < 1 ? Math.floor(1 / f) : f));\n return den.map((d) => `${d}fr`);\n}\nexport function mapGrid(width: string | number): string {\n if (get(theme, width)) return `${get(theme, width)}`;\n if (typeof width === 'string') return width;\n const den = width < 1 ? Math.floor(1 / width) : width;\n return `${den}fr`;\n}\n\nexport function mapTemplateGrid(grid: number | string | (number | string)[]): string | string[] {\n if (Array.isArray(grid)) {\n if (grid.some((w) => typeof w === 'string')) return grid.map((w) => mapGrid(w));\n return numbersToFr(grid as number[]);\n }\n return mapGrid(grid);\n}\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAoB;AACpB,mBAAsB;AAEf,SAAS,OAAO,QAA0C;AAC/D,MAAI,CAAC;AAAQ,WAAO;AACpB,MAAI,OAAO,MAAM,EAAE,SAAS,KAAK,KAAK,OAAO,MAAM,EAAE,SAAS,IAAI;AAAG,WAAO;AAC5E,SAAO,GAAG,mBAAM,MAAM,MAAkC;AAC1D;AAEO,SAAS,UAAU,QAA6C;AACrE,MAAI,CAAC;AAAQ,WAAO;AACpB,SAAO,GAAG,mBAAM,MAAM,MAAkC;AAC1D;AAEO,SAAS,SAAS,OAAgC;AACvD,MAAI,OAAO,UAAU;AAAU,eAAO,mBAAI,oBAAO,KAAK,IAAI,OAAG,mBAAI,oBAAO,KAAK,MAAM;AACnF,SAAO,GAAG,QAAQ;AACpB;AAEO,SAAS,eACd,OACA,QACmB;AACnB,MAAI,CAAC;AAAO,WAAO;AACnB,MAAI,UAAU;AAAe,WAAO;AACpC,MAAI,MAAM,QAAQ,KAAK;AAAG,WAAO,MAAM,IAAI,CAAC,MAAM,QAAQ,SAAS,CAAC,QAAQ,UAAU,MAAM,KAAK;AACjG,SAAO,QAAQ,SAAS,KAAK,QAAQ,UAAU,MAAM;AACvD;AAEO,SAAS,SAAS,OAAiE;AACxF,MAAI,CAAC;AAAO,WAAO;AACnB,MAAI,MAAM,QAAQ,KAAK;AAAG,WAAO,MAAM,IAAI,CAAC,MAAM,SAAS,CAAC,CAAC;AAC7D,SAAO,SAAS,KAAK;AACvB;AA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../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable no-console */\n\nexport const checkNamingConvention = (componentName: string | null, componentSlot: string | null): void => {\n // We just check that the name is correctly written, should be removed in the future\n if (componentName !== null) {\n const matches = componentName.match(/DS([A-Z]|[a-z]|[0-9])*/);\n if (!matches || matches.length === 0 || matches[0].length !== componentName.length) {\n console.warn(`BAD FORMAT FOR COMPONENT NAME ${componentName}, use DSWhateverComponentTitled`);\n }\n }\n if (componentSlot !== null) {\n const isValid = /([a-z]-)*/.test(componentSlot);\n if (!isValid) {\n console.warn(`BAD FORMAT FOR COMPONENT SLOT ${componentSlot}, use any-component-slot`);\n }\n }\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,wBAAwB,CAAC,eAA8B,kBAAuC;AAEzG,MAAI,kBAAkB,MAAM;AAC1B,UAAM,UAAU,cAAc,MAAM,wBAAwB;AAC5D,QAAI,CAAC,WAAW,QAAQ,WAAW,KAAK,QAAQ,CAAC,EAAE,WAAW,cAAc,QAAQ;AAClF,cAAQ,KAAK,iCAAiC,8CAA8C;AAAA,IAC9F;AAAA,EACF;AACA,MAAI,kBAAkB,MAAM;AAC1B,UAAM,UAAU,YAAY,KAAK,aAAa;AAC9C,QAAI,CAAC,SAAS;AACZ,cAAQ,KAAK,iCAAiC,uCAAuC;AAAA,IACvF;AAAA,EACF;AACF;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,wBAAwB,CAAC,eAA8B,kBAAuC;AAEzG,MAAI,kBAAkB,MAAM;AAC1B,UAAM,UAAU,cAAc,MAAM,wBAAwB;AAC5D,QAAI,CAAC,WAAW,QAAQ,WAAW,KAAK,QAAQ,CAAC,EAAE,WAAW,cAAc,QAAQ;AAClF,cAAQ,KAAK,iCAAiC,aAAa,iCAAiC;AAAA,IAC9F;AAAA,EACF;AACA,MAAI,kBAAkB,MAAM;AAC1B,UAAM,UAAU,YAAY,KAAK,aAAa;AAC9C,QAAI,CAAC,SAAS;AACZ,cAAQ,KAAK,iCAAiC,aAAa,0BAA0B;AAAA,IACvF;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -35,35 +35,30 @@ module.exports = __toCommonJS(generateAttributes_exports);
35
35
  var React = __toESM(require("react"));
36
36
  var import_helpers = require("../helpers.js");
37
37
  const generateClassName = (props, meta) => {
38
- if (meta.displayName === null)
39
- return {};
38
+ if (meta.displayName === null) return {};
40
39
  return {
41
40
  className: meta.displayName
42
41
  };
43
42
  };
44
43
  const generateDataTestId = (props, meta) => {
45
- if (meta.displayName === null)
46
- return {};
44
+ if (meta.displayName === null) return {};
47
45
  return {
48
46
  "data-testid": props["data-testid"] ?? (0, import_helpers.displayNameToKebabCase)(meta.displayName)
49
47
  };
50
48
  };
51
49
  const generateDataDimsumSlot = (props, meta) => {
52
- if (meta.displayName === null)
53
- return {};
50
+ if (meta.displayName === null) return {};
54
51
  return {
55
52
  "data-dimsum-slot": (0, import_helpers.displayNameToPropCase)(meta.displayName)
56
53
  };
57
54
  };
58
55
  const getPartProps = (props) => {
59
56
  const { getOwnerProps, getOwnerPropsArguments } = props;
60
- if (getOwnerProps === void 0)
61
- return {};
57
+ if (getOwnerProps === void 0) return {};
62
58
  const ownerPropsValue = getOwnerProps();
63
59
  const ownerPropsArgumentsValue = getOwnerPropsArguments?.() ?? {};
64
60
  const elementProps = ownerPropsValue[props["data-dimsum-slot"]] ?? ownerPropsValue[props["data-testid"]];
65
- if (elementProps === void 0 || elementProps === null)
66
- return {};
61
+ if (elementProps === void 0 || elementProps === null) return {};
67
62
  const resultingObject = typeof elementProps === "function" ? elementProps(ownerPropsArgumentsValue) : elementProps;
68
63
  return resultingObject;
69
64
  };
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/styled/generated-attributes/generateAttributes.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
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';\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 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(generateDataDimsumSlot, meta)];\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,qBAA8D;AAG9D,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,yBAA4C,CAAC,OAAO,SAAS;AACjE,MAAI,KAAK,gBAAgB;AAAM,WAAO,CAAC;AACvC,SAAO;AAAA,IACL,wBAAoB,sCAAsB,KAAK,WAAW;AAAA,EAC5D;AACF;AAEO,MAAM,eAAe,CAC1B,UAC4B;AAC5B,QAAM,EAAE,eAAe,uBAAuB,IAAI;AAGlD,MAAI,kBAAkB;AAAW,WAAO,CAAC;AAEzC,QAAM,kBAAkB,cAAc;AACtC,QAAM,2BAA2B,yBAAyB,KAAK,CAAC;AAGhE,QAAM,eAAe,gBAAgB,MAAM,kBAAkB,CAAC,KAAK,gBAAgB,MAAM,aAAa,CAAC;AAGvG,MAAI,iBAAiB,UAAa,iBAAiB;AAAM,WAAO,CAAC;AAIjE,QAAM,kBAAkB,OAAO,iBAAiB,aAAa,aAAa,wBAAwB,IAAI;AAEtG,SAAO;AACT;AAEA,MAAM,OACJ,CACE,MACA,SAEF,CAAC,UACC,KAAK,OAAO,IAAI;AAEb,MAAM,qBAAqB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iD;AACpG,QAAM,OAAO,EAAE,SAAS,YAAY;AAIpC,SAAO,CAAC,KAAK,mBAAmB,IAAI,GAAG,KAAK,oBAAoB,IAAI,GAAG,KAAK,wBAAwB,IAAI,CAAC;AAC3G;",
6
6
  "names": []
7
7
  }
@@ -34,8 +34,7 @@ module.exports = __toCommonJS(generateDisplayName_exports);
34
34
  var React = __toESM(require("react"));
35
35
  const generateDisplayName = (options) => {
36
36
  const { name: componentName, slot: componentSlot } = options;
37
- if (componentName === null || componentSlot === null)
38
- return null;
37
+ if (componentName === null || componentSlot === null) return null;
39
38
  return `${componentName}-${componentSlot}`;
40
39
  };
41
40
  //# sourceMappingURL=generateDisplayName.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/styled/generated-attributes/generateDisplayName.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import type { Options } from '../types.js';\n\nexport const generateDisplayName = (options: Options) => {\n const { name: componentName, slot: componentSlot } = options;\n\n if (componentName === null || componentSlot === null) return null;\n\n return `${componentName}-${componentSlot}`;\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,sBAAsB,CAAC,YAAqB;AACvD,QAAM,EAAE,MAAM,eAAe,MAAM,cAAc,IAAI;AAErD,MAAI,kBAAkB,QAAQ,kBAAkB;AAAM,WAAO;AAE7D,SAAO,GAAG,iBAAiB;AAC7B;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,sBAAsB,CAAC,YAAqB;AACvD,QAAM,EAAE,MAAM,eAAe,MAAM,cAAc,IAAI;AAErD,MAAI,kBAAkB,QAAQ,kBAAkB,KAAM,QAAO;AAE7D,SAAO,GAAG,aAAa,IAAI,aAAa;AAC1C;",
6
6
  "names": []
7
7
  }
@@ -33,13 +33,9 @@ __export(refMerger_exports, {
33
33
  module.exports = __toCommonJS(refMerger_exports);
34
34
  var React = __toESM(require("react"));
35
35
  const mergeRefs = (ref1, ref2) => (_ref) => {
36
- if (typeof ref1 === "function")
37
- ref1(_ref);
38
- else if (ref1)
39
- ref1.current = _ref;
40
- if (typeof ref2 === "function")
41
- ref2(_ref);
42
- else if (ref2)
43
- ref2.current = _ref;
36
+ if (typeof ref1 === "function") ref1(_ref);
37
+ else if (ref1) ref1.current = _ref;
38
+ if (typeof ref2 === "function") ref2(_ref);
39
+ else if (ref2) ref2.current = _ref;
44
40
  };
45
41
  //# sourceMappingURL=refMerger.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/styled/generated-attributes/utils/refMerger.ts", "../../../../../../../../scripts/build/transpile/react-shim.js"],
4
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;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEhB,MAAM,YACX,CAAwB,MAAmC,SAC3D,CAAC,SAAmB;AAClB,MAAI,OAAO,SAAS,WAAY,MAAK,IAAI;AAAA,WAChC,KAAM,MAAK,UAAU;AAE9B,MAAI,OAAO,SAAS,WAAY,MAAK,IAAI;AAAA,WAChC,KAAM,MAAK,UAAU;AAChC;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../src/styled/helpers.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
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,EAA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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,QAAQ,GAAG,QAAQ,OAAO,QAAQ,CAAC,IAAI,MAAM,WAAW,GAAG,CAAC,GAAG,WAAW,MAAM,GAAG,EAAE,SAAS,CAAC,CAAC;AAC5G,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,CAAC;AACtF;AAEO,MAAM,wBAAwB,CAAC,gBACpC,KAAK,YAAY,MAAM,CAAC,EAAE,MAAM,GAAG,EAAE,IAAI,UAAU,EAAE,KAAK,EAAE,CAAC;AAExD,MAAM,0BAA0B,CACrC,eACA,eAC2B;AAC3B,QAAM,MAAM,CAAC;AACb,SAAO,KAAK,UAAU,EAAE,QAAQ,CAAC,aAAa;AAC5C,UAAM,cAAc,GAAG,aAAa,IAAI,WAAW,QAAQ,CAAC;AAC5D,QAAI,QAAQ,IAAI,uBAAuB,WAAW;AAAA,EACpD,CAAC;AACD,SAAO;AACT;",
6
6
  "names": []
7
7
  }
@@ -88,6 +88,7 @@ const styledFunction = (tag, options = defaultOptions) => {
88
88
  const propsWithRefMerged = {
89
89
  ...restProps,
90
90
  ...resultingObjectWithCallbackMerged,
91
+ // ref: ref,
91
92
  ref: mergedRef,
92
93
  innerRef: mergedRef
93
94
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
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, 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 React, { useMemo } from 'react';\nimport { callbackMerger } from './generated-attributes/utils/callbackMerger.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 // 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 ComponentWithRefsMerged = (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 // then we merge the callbacks from the props with the ones from the part\n // this object also has all global props from the parts\n const resultingObjectWithCallbackMerged = callbackMerger(props, partProps);\n\n const mergedRef = useMemo(\n () => mergeRefs(props.innerRef, partProps.innerRef),\n [props.innerRef, partProps.innerRef],\n );\n\n // We don't want to pass the owner props to the component down the line\n const { getOwnerProps, getOwnerPropsArguments, ...restProps } = props;\n\n const propsWithRefMerged = {\n ...restProps,\n ...resultingObjectWithCallbackMerged,\n ref: mergedRef,\n innerRef: mergedRef,\n } as React.ComponentProps<C>;\n\n // TODO: check if we need to pass the ref to the component\n // Check $$typeof to see if it's a react-forward-ref\n // Check dsStyledComponentId to see if it's a styled component\n // Check what to do with span, div, etc.\n // Other cases should not receive ref...?\n\n return <Component {...propsWithRefMerged} />;\n };\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 // Here we use arrow functions to preserve the `this` context\n const styledAttributes = {\n attrs: ((...args) => {\n baseStyledResolver.attrs(...args);\n return dsStyledResolver;\n }) as (typeof baseStyledResolver)['attrs'],\n withConfig: ((...args) => {\n baseStyledResolver.withConfig(...args);\n return dsStyledResolver;\n }) as (typeof baseStyledResolver)['withConfig'],\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;AD4IV;AAxIb,mCAAsC;AACtC,oBAAqC;AACr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GAAG;AAAA,QACH,eAAe;AAAA,QACf,oBAAoB;AAAA,MACtB,CAAC;AAMD,YAAM,wCAAoC,sCAAe,OAAO,SAAS;AAEzE,YAAM,gBAAY;AAAA,QAChB,UAAM,4BAAU,MAAM,UAAU,UAAU,QAAQ;AAAA,QAClD,CAAC,MAAM,UAAU,UAAU,QAAQ;AAAA,MACrC;AAGA,YAAM,EAAE,eAAe,wBAAwB,GAAG,UAAU,IAAI;AAEhE,YAAM,qBAAqB;AAAA,QACzB,GAAG;AAAA,QACH,GAAG;AAAA,QACH,KAAK;AAAA,QACL,UAAU;AAAA,MACZ;AAQA,aAAO,4CAAC,aAAW,GAAG,oBAAoB;AAAA,IAC5C;AAEA,QAAI,gBAAgB,MAAM;AACxB,gBAAU,cAAc;AAAA,IAC1B;AAIA,4BAAwB,sBAAsB,UAAU;AACxD,4BAAwB,WAAW,UAAU;AAE7C,WAAO;AAAA,EACT;AAGA,QAAM,mBAAmB;AAAA,IACvB,OAAQ,IAAI,SAAS;AACnB,yBAAmB,MAAM,GAAG,IAAI;AAChC,aAAO;AAAA,IACT;AAAA,IACA,YAAa,IAAI,SAAS;AACxB,yBAAmB,WAAW,GAAG,IAAI;AACrC,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO,OAAO,OAAO,kBAAkB,gBAAgB;AACzD;",
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, 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 React, { useMemo } from 'react';\nimport { callbackMerger } from './generated-attributes/utils/callbackMerger.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 // 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 ComponentWithRefsMerged = (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 // then we merge the callbacks from the props with the ones from the part\n // this object also has all global props from the parts\n const resultingObjectWithCallbackMerged = callbackMerger(props, partProps);\n\n const mergedRef = useMemo(\n () => mergeRefs(props.innerRef, partProps.innerRef),\n [props.innerRef, partProps.innerRef],\n );\n\n // We don't want to pass the owner props to the component down the line\n const { getOwnerProps, getOwnerPropsArguments, ...restProps } = props;\n // TODO:\n // deploy the following code and see if we break something in a dedicated effort ASAP\n // let ref = undefined;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore : as of thue 16 may 2024, Component.target.$$typeof is undefined for non-native react components\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n // if (typeof Component?.target === 'string') {\n // ref = mergedRef;\n // }\n\n const propsWithRefMerged = {\n ...restProps,\n ...resultingObjectWithCallbackMerged,\n // ref: ref,\n ref: mergedRef,\n innerRef: mergedRef,\n } as React.ComponentProps<C>;\n\n // TODO: check if we need to pass the ref to the component\n // Check $$typeof to see if it's a react-forward-ref\n // Check dsStyledComponentId to see if it's a styled component\n // Check what to do with span, div, etc.\n // Other cases should not receive ref...?\n\n return <Component {...propsWithRefMerged} />;\n };\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 // Here we use arrow functions to preserve the `this` context\n const styledAttributes = {\n attrs: ((...args) => {\n baseStyledResolver.attrs(...args);\n return dsStyledResolver;\n }) as (typeof baseStyledResolver)['attrs'],\n withConfig: ((...args) => {\n baseStyledResolver.withConfig(...args);\n return dsStyledResolver;\n }) as (typeof baseStyledResolver)['withConfig'],\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;ADsJV;AAlJb,mCAAsC;AACtC,oBAAqC;AACrC,0BAA8D;AAS9D,oCAAuC;AACvC,yBAA2E;AAC3E,yBAA4B;AAC5B,kCAAuC;AACvC,gCAA6B;AAC7B,uBAA0B;AAC1B,qBAA8D;AAC9D,mBAA+B;AAC/B,4BAA+B;AAE/B,MAAM,iBAA0B;AAAA,EAC9B,MAA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,MAAM,UAAU,UAAU,QAAQ;AAAA,MACrC;AAGA,YAAM,EAAE,eAAe,wBAAwB,GAAG,UAAU,IAAI;AAWhE,YAAM,qBAAqB;AAAA,QACzB,GAAG;AAAA,QACH,GAAG;AAAA;AAAA,QAEH,KAAK;AAAA,QACL,UAAU;AAAA,MACZ;AAQA,aAAO,4CAAC,aAAW,GAAG,oBAAoB;AAAA,IAC5C;AAEA,QAAI,gBAAgB,MAAM;AACxB,gBAAU,cAAc;AAAA,IAC1B;AAIA,4BAAwB,sBAAsB,UAAU;AACxD,4BAAwB,WAAW,UAAU;AAE7C,WAAO;AAAA,EACT;AAGA,QAAM,mBAAmB;AAAA,IACvB,OAAQ,IAAI,SAAS;AACnB,yBAAmB,MAAM,GAAG,IAAI;AAChC,aAAO;AAAA,IACT;AAAA,IACA,YAAa,IAAI,SAAS;AACxB,yBAAmB,WAAW,GAAG,IAAI;AACrC,aAAO;AAAA,IACT;AAAA,EACF;AAEA,SAAO,OAAO,OAAO,kBAAkB,gBAAgB;AACzD;",
6
6
  "names": ["baseStyled"]
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/styled/system-utilities/background.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { style, compose, type ThemeGetter } from '@xstyled/system';\nimport { th } from '../../th.js';\nimport type { PropsWithTheme } from '../types.js';\nimport type { BackgroundProps } from '../system-types.js';\n\ninterface DSThemeGetter extends ThemeGetter {\n (value: string): (props: PropsWithTheme) => string;\n meta: Record<string, unknown>;\n}\n\nconst bgColorGetter: DSThemeGetter = (value: string) => (props) => `${th.color(value, value)(props as PropsWithTheme)}`;\n\nbgColorGetter.meta = {};\n\nconst bg = style({\n prop: ['backgroundColor', 'bg'],\n css: 'background-color',\n themeGet: bgColorGetter,\n});\n\nexport const background = compose<BackgroundProps>(bg);\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAiD;AACjD,gBAAmB;AASnB,MAAM,gBAA+B,CAAC,UAAkB,CAAC,UAAU,GAAG,aAAG,MAAM,OAAO,KAAK,EAAE,KAAuB;AAEpH,cAAc,OAAO,CAAC;AAEtB,MAAM,SAAK,qBAAM;AAAA,EACf,MAAM,CAAC,mBAAmB,IAAI;AAAA,EAC9B,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAEM,MAAM,iBAAa,uBAAyB,EAAE;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAiD;AACjD,gBAAmB;AASnB,MAAM,gBAA+B,CAAC,UAAkB,CAAC,UAAU,GAAG,aAAG,MAAM,OAAO,KAAK,EAAE,KAAuB,CAAC;AAErH,cAAc,OAAO,CAAC;AAEtB,MAAM,SAAK,qBAAM;AAAA,EACf,MAAM,CAAC,mBAAmB,IAAI;AAAA,EAC9B,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAEM,MAAM,iBAAa,uBAAyB,EAAE;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/styled/system-utilities/border.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["/* eslint-disable prettier/prettier */\n/* eslint-disable max-lines */\nimport { style, compose, type ThemeGetter } from '@xstyled/system';\nimport { th } from '../../th.js';\nimport type { PropsWithTheme } from '../types.js';\ninterface DSThemeGetter extends ThemeGetter {\n (value: string): (props: PropsWithTheme) => string;\n}\nconst colorReg = /(?:neutral|brand|success|danger|warning)-[0-9]{3}(?:-a[0-9]{2})?/;\n\nconst borderGetter: DSThemeGetter =\n (value: string) =>\n (props): string => {\n const color = value?.match?.(colorReg);\n let borderCss = ``;\n\n if (color) {\n const widthAndStyle = value.replace(color[0], '').trim();\n borderCss = `${th.color(color[0])(props as PropsWithTheme)} ${widthAndStyle}`;\n } else {\n borderCss = value;\n }\n\n return borderCss;\n };\n\nborderGetter.meta = {};\n\nconst borderColorGetter: DSThemeGetter =\n (value: string) =>\n (props): string =>\n `${th.color(value, value)(props as PropsWithTheme)}`;\n\nborderColorGetter.meta = {};\n\nfunction borderStyleGetter(value: string) {\n return (): string => value;\n}\n\nborderStyleGetter.meta = {};\n\nconst borderWidthGetter: DSThemeGetter =\n (value: string) =>\n (props): string =>\n `${th.space(value, value)(props as PropsWithTheme)}`;\n\nborderWidthGetter.meta = {};\n\nconst borderRadiusGetter: DSThemeGetter =\n (value: string) =>\n (props): string =>\n `${th.space(value, value)(props as PropsWithTheme)}`;\n\nborderRadiusGetter.meta = {};\n\nconst border = style({\n prop: 'border',\n css: 'border',\n themeGet: borderGetter,\n});\n\nconst borderTop = style({\n prop: 'borderTop',\n css: 'border-top',\n themeGet: borderGetter,\n});\n\nconst borderBottom = style({\n prop: 'borderBottom',\n css: 'border-bottom',\n themeGet: borderGetter,\n});\n\nconst borderRight = style({\n prop: 'borderRight',\n css: 'border-right',\n themeGet: borderGetter,\n});\n\nconst borderLeft = style({\n prop: 'borderLeft',\n css: 'border-left',\n themeGet: borderGetter,\n});\n\nconst borderColor = style({\n prop: 'borderColor',\n css: 'border-color',\n themeGet: borderColorGetter,\n});\n\nconst borderTopColor = style({\n prop: 'borderTopColor',\n css: 'border-top-color',\n themeGet: borderColorGetter,\n});\n\nconst borderBottomColor = style({\n prop: 'borderBottomColor',\n css: 'border-bottom-color',\n themeGet: borderColorGetter,\n});\n\nconst borderRightColor = style({\n prop: 'borderRightColor',\n css: 'border-right-color',\n themeGet: borderColorGetter,\n});\n\nconst borderLeftColor = style({\n prop: 'borderLeftColor',\n css: 'border-left-color',\n themeGet: borderColorGetter,\n});\n\nconst borderStyle = style({\n prop: 'borderStyle',\n css: 'border-style',\n themeGet: borderStyleGetter,\n});\n\nconst borderTopStyle = style({\n prop: 'borderTopStyle',\n css: 'border-top-style',\n themeGet: borderStyleGetter,\n});\n\nconst borderBottomStyle = style({\n prop: 'borderBottomStyle',\n css: 'border-bottom-style',\n themeGet: borderStyleGetter,\n});\n\nconst borderRightStyle = style({\n prop: 'borderRightStyle',\n css: 'border-right-style',\n themeGet: borderStyleGetter,\n});\n\nconst borderLeftStyle = style({\n prop: 'borderLeftStyle',\n css: 'border-left-style',\n themeGet: borderStyleGetter,\n});\n\nconst borderWidth = style({\n prop: 'borderWidth',\n css: 'border-width',\n themeGet: borderWidthGetter,\n});\n\nconst borderTopWidth = style({\n prop: 'borderTopWidth',\n css: 'border-top-width',\n themeGet: borderWidthGetter,\n});\n\nconst borderBottomWidth = style({\n prop: 'borderBottomWidth',\n css: 'border-bottom-width',\n themeGet: borderWidthGetter,\n});\n\nconst borderRightWidth = style({\n prop: 'borderRightWidth',\n css: 'border-right-width',\n themeGet: borderWidthGetter,\n});\n\nconst borderLeftWidth = style({\n prop: 'borderLeftWidth',\n css: 'border-left-width',\n themeGet: borderWidthGetter,\n});\n\nconst borderRadius = style({\n prop: 'borderRadius',\n css: 'border-radius',\n themeGet: borderRadiusGetter,\n});\n\nexport const borders = compose(\n border,\n borderTop,\n borderBottom,\n borderLeft,\n borderRight,\n borderColor,\n borderTopColor,\n borderBottomColor,\n borderLeftColor,\n borderRightColor,\n borderStyle,\n borderTopStyle,\n borderBottomStyle,\n borderLeftStyle,\n borderRightStyle,\n borderWidth,\n borderTopWidth,\n borderBottomWidth,\n borderLeftWidth,\n borderRightWidth,\n borderRadius,\n);\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,oBAAiD;AACjD,gBAAmB;AAKnB,MAAM,WAAW;AAEjB,MAAM,eACJ,CAAC,UACD,CAAC,UAAkB;AACjB,QAAM,QAAQ,OAAO,QAAQ,QAAQ;AACrC,MAAI,YAAY;AA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AAA,EAC7B,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,sBAAkB,qBAAM;AAAA,EAC5B,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,kBAAc,qBAAM;AAAA,EACxB,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,qBAAiB,qBAAM;AAAA,EAC3B,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,wBAAoB,qBAAM;AAAA,EAC9B,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,uBAAmB,qBAAM;AAAA,EAC7B,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,sBAAkB,qBAAM;AAAA,EAC5B,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,mBAAe,qBAAM;AAAA,EACzB,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAEM,MAAM,cAAU;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/styled/system-utilities/color.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import type { Theme, Props } from '@xstyled/system';\nimport { style, compose } from '@xstyled/system';\nimport { th } from '../../th.js';\nimport type { PropsWithTheme } from '../types.js';\nimport type { ColorProps } from '../system-types.js';\n\nfunction colorGetter(value: string) {\n return (props: PropsWithTheme | Props<Theme>): string => `${th.color(value, value)(props as PropsWithTheme)}`;\n}\n\ncolorGetter.meta = {};\n\nconst colorStyled = style<ColorProps>({\n prop: ['color'],\n css: ['color'],\n themeGet: colorGetter,\n});\n\nexport const color = compose(colorStyled);\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,oBAA+B;AAC/B,gBAAmB;AAInB,SAAS,YAAY,OAAe;AAClC,SAAO,CAAC,UAAiD,GAAG,aAAG,MAAM,OAAO,KAAK,EAAE,KAAuB;AAC5G;AAEA,YAAY,OAAO,CAAC;AAEpB,MAAM,kBAAc,qBAAkB;AAAA,EACpC,MAAM,CAAC,OAAO;AAAA,EACd,KAAK,CAAC,OAAO;AAAA,EACb,UAAU;AACZ,CAAC;AAEM,MAAM,YAAQ,uBAAQ,WAAW;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,oBAA+B;AAC/B,gBAAmB;AAInB,SAAS,YAAY,OAAe;AAClC,SAAO,CAAC,UAAiD,GAAG,aAAG,MAAM,OAAO,KAAK,EAAE,KAAuB,CAAC;AAC7G;AAEA,YAAY,OAAO,CAAC;AAEpB,MAAM,kBAAc,qBAAkB;AAAA,EACpC,MAAM,CAAC,OAAO;AAAA,EACd,KAAK,CAAC,OAAO;AAAA,EACb,UAAU;AACZ,CAAC;AAEM,MAAM,YAAQ,uBAAQ,WAAW;",
6
6
  "names": []
7
7
  }
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/styled/transformers/dsStyledComponentTransform.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
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;",
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,mBAA6B;AAAA,EAC3D;AACA,SAAO;AACT,CAAC;",
6
6
  "names": []
7
7
  }
@@ -49,8 +49,7 @@ const magicfyCss = (rawValue) => {
49
49
  return [splittedValue, themeGetters];
50
50
  };
51
51
  const magicCssTransform = (styleArg, expressions) => {
52
- if (!Array.isArray(styleArg))
53
- return [styleArg, expressions];
52
+ if (!Array.isArray(styleArg)) return [styleArg, expressions];
54
53
  const magicStyleArg = [];
55
54
  const magicExpressions = [];
56
55
  const templateStringArray = styleArg;
@@ -58,8 +57,7 @@ const magicCssTransform = (styleArg, expressions) => {
58
57
  const [splittedTemplateString, themeGetters] = magicfyCss(templateString);
59
58
  magicStyleArg.push(...splittedTemplateString);
60
59
  magicExpressions.push(...themeGetters);
61
- if (index < expressions.length)
62
- magicExpressions.push(expressions[index]);
60
+ if (index < expressions.length) magicExpressions.push(expressions[index]);
63
61
  });
64
62
  return [Object.assign(magicStyleArg, { raw: [...magicStyleArg] }), magicExpressions];
65
63
  };
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/styled/transformers/magicCssTransform.ts", "../../../../../../../scripts/build/transpile/react-shim.js"],
4
4
  "sourcesContent": ["import { th } from '../../th.js';\nimport type { Expressions, StyleArg } from '../types.js';\n\ntype MagicCssTransform = (styleArg: StyleArg, expressions: Expressions) => [StyleArg, Expressions];\n\n// This file is heavily inspired by https://github.com/gregberge/xstyled/blob/c0c92b459bb3a5de46d7854be3667861f816baa5/packages/core/src/transform.ts#L65\n// Please refer to that file to understand of the idea of the css transformer\n\nconst COLOR_REGEX = /(neutral|brand|success|warning|danger)-(100|200|300|400|500|600|700|800|900|000|050|080)/g;\n\nconst magicfyCss = (rawValue: string): [string[], Expressions] => {\n let matches;\n let lastIndex = 0;\n const splittedValue: string[] = [];\n const themeGetters = [];\n while ((matches = COLOR_REGEX.exec(rawValue))) {\n const [match] = matches;\n splittedValue.push(rawValue.slice(lastIndex, matches.index));\n\n themeGetters.push(th.color(match, match));\n\n lastIndex = matches.index + match.length;\n }\n splittedValue.push(rawValue.slice(lastIndex, rawValue.length));\n return [splittedValue, themeGetters];\n};\n\nexport const magicCssTransform: MagicCssTransform = (styleArg, expressions) => {\n if (!Array.isArray(styleArg)) return [styleArg, expressions];\n\n const magicStyleArg: string[] = [];\n const magicExpressions: Expressions = [];\n\n const templateStringArray = styleArg as TemplateStringsArray;\n\n templateStringArray.forEach((templateString, index) => {\n const [splittedTemplateString, themeGetters] = magicfyCss(templateString);\n magicStyleArg.push(...splittedTemplateString);\n magicExpressions.push(...themeGetters);\n if (index < expressions.length) magicExpressions.push(expressions[index]);\n });\n\n return [Object.assign(magicStyleArg, { raw: [...magicStyleArg] }), magicExpressions];\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,gBAAmB;AAQnB,MAAM,cAA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AK,QAAQ,GAAI;AAC7C,UAAM,CAAC,KAAK,IAAI;AAChB,kBAAc,KAAK,SAAS,MAAM,WAAW,QAAQ,KAAK,CAAC;AAE3D,iBAAa,KAAK,aAAG,MAAM,OAAO,KAAK,CAAC;AAExC,gBAAY,QAAQ,QAAQ,MAAM;AAAA,EACpC;AACA,gBAAc,KAAK,SAAS,MAAM,WAAW,SAAS,MAAM,CAAC;AAC7D,SAAO,CAAC,eAAe,YAAY;AACrC;AAEO,MAAM,oBAAuC,CAAC,UAAU,gBAAgB;AAC7E,MAAI,CAAC,MAAM,QAAQ,QAAQ,EAAG,QAAO,CAAC,UAAU,WAAW;AAE3D,QAAM,gBAA0B,CAAC;AACjC,QAAM,mBAAgC,CAAC;AAEvC,QAAM,sBAAsB;AAE5B,sBAAoB,QAAQ,CAAC,gBAAgB,UAAU;AACrD,UAAM,CAAC,wBAAwB,YAAY,IAAI,WAAW,cAAc;AACxE,kBAAc,KAAK,GAAG,sBAAsB;AAC5C,qBAAiB,KAAK,GAAG,YAAY;AACrC,QAAI,QAAQ,YAAY,OAAQ,kBAAiB,KAAK,YAAY,KAAK,CAAC;AAAA,EAC1E,CAAC;AAED,SAAO,CAAC,OAAO,OAAO,eAAe,EAAE,KAAK,CAAC,GAAG,aAAa,EAAE,CAAC,GAAG,gBAAgB;AACrF;",
6
6
  "names": []
7
7
  }
package/dist/cjs/th.js CHANGED
@@ -42,14 +42,11 @@ const hexToRgba = (hex, alpha) => {
42
42
  };
43
43
  const colorGetter = (value, dfault = "") => ({ theme }) => {
44
44
  const colorValues = value.split("-");
45
- if (colorValues.length === 1)
46
- return colorValues[0];
47
- if (colorValues.length > 3)
48
- return dfault;
45
+ if (colorValues.length === 1) return colorValues[0];
46
+ if (colorValues.length > 3) return dfault;
49
47
  const [colorType, colorValue, alpha] = colorValues;
50
48
  const themeColor = theme.colors && theme.colors[colorType]?.[colorValue];
51
- if (!themeColor)
52
- return dfault;
49
+ if (!themeColor) return dfault;
53
50
  if (alpha) {
54
51
  const alphaFloatingNumber = `0.${alpha.slice(1)}`;
55
52
  return hexToRgba(themeColor, alphaFloatingNumber);
@@ -60,8 +57,7 @@ const genericGetter = (property) => (value, dfault = "") => ({ theme }) => {
60
57
  const parts = value.split("-");
61
58
  let result = theme[property];
62
59
  parts.forEach((part) => {
63
- if (result)
64
- result = result[part];
60
+ if (result) result = result[part];
65
61
  });
66
62
  return result ?? dfault;
67
63
  };
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../src/th.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
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;A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