@elliemae/ds-system 3.0.0-next.7 → 3.0.0-next.70

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 (95) hide show
  1. package/dist/cjs/arithmetic.js +20 -22
  2. package/dist/cjs/arithmetic.js.map +2 -2
  3. package/dist/cjs/constants.js +9 -16
  4. package/dist/cjs/constants.js.map +1 -1
  5. package/dist/cjs/ds-styled/index.js +37 -0
  6. package/dist/cjs/ds-styled/index.js.map +7 -0
  7. package/dist/cjs/ds-styled/styled.js +103 -0
  8. package/dist/cjs/ds-styled/styled.js.map +7 -0
  9. package/dist/cjs/ds-styled/types.js +20 -0
  10. package/dist/cjs/ds-styled/types.js.map +7 -0
  11. package/dist/cjs/ds-styled/utilities/background.js +41 -0
  12. package/dist/cjs/ds-styled/utilities/background.js.map +7 -0
  13. package/dist/cjs/ds-styled/utilities/border.js +174 -0
  14. package/dist/cjs/ds-styled/utilities/border.js.map +7 -0
  15. package/dist/cjs/ds-styled/utilities/helpers.js +66 -0
  16. package/dist/cjs/ds-styled/utilities/helpers.js.map +7 -0
  17. package/dist/cjs/ds-styled/utilities/index.js +27 -0
  18. package/dist/cjs/ds-styled/utilities/index.js.map +7 -0
  19. package/dist/cjs/ds-styled/utilities/magicCssTransform.js +58 -0
  20. package/dist/cjs/ds-styled/utilities/magicCssTransform.js.map +7 -0
  21. package/dist/cjs/ds-styled/utilities/resolvers.js +49 -0
  22. package/dist/cjs/ds-styled/utilities/resolvers.js.map +7 -0
  23. package/dist/cjs/ds-styled/utilities/sizing.js +59 -0
  24. package/dist/cjs/ds-styled/utilities/sizing.js.map +7 -0
  25. package/dist/cjs/globalStyles.js +11 -18
  26. package/dist/cjs/globalStyles.js.map +2 -2
  27. package/dist/cjs/index.js +18 -24
  28. package/dist/cjs/index.js.map +2 -2
  29. package/dist/cjs/mobileUtilities.js +17 -26
  30. package/dist/cjs/mobileUtilities.js.map +2 -2
  31. package/dist/cjs/spaceUtilities.js +9 -16
  32. package/dist/cjs/spaceUtilities.js.map +1 -1
  33. package/dist/cjs/th.js +48 -29
  34. package/dist/cjs/th.js.map +2 -2
  35. package/dist/cjs/theme.js +9 -16
  36. package/dist/cjs/theme.js.map +1 -1
  37. package/dist/cjs/themeProviderHOC.js +16 -20
  38. package/dist/cjs/themeProviderHOC.js.map +2 -2
  39. package/dist/cjs/utils.js +29 -37
  40. package/dist/cjs/utils.js.map +2 -2
  41. package/dist/esm/arithmetic.js +11 -6
  42. package/dist/esm/arithmetic.js.map +2 -2
  43. package/dist/esm/constants.js.map +1 -1
  44. package/dist/esm/ds-styled/index.js +14 -0
  45. package/dist/esm/ds-styled/index.js.map +7 -0
  46. package/dist/esm/{styled/index.js → ds-styled/styled.js} +35 -23
  47. package/dist/esm/ds-styled/styled.js.map +7 -0
  48. package/dist/esm/ds-styled/types.js +2 -0
  49. package/dist/esm/{styled/index.d.js.map → ds-styled/types.js.map} +0 -0
  50. package/dist/esm/ds-styled/utilities/background.js +19 -0
  51. package/dist/esm/ds-styled/utilities/background.js.map +7 -0
  52. package/dist/esm/ds-styled/utilities/border.js +152 -0
  53. package/dist/esm/ds-styled/utilities/border.js.map +7 -0
  54. package/dist/esm/ds-styled/utilities/helpers.js +46 -0
  55. package/dist/esm/ds-styled/utilities/helpers.js.map +7 -0
  56. package/dist/esm/ds-styled/utilities/index.js +8 -0
  57. package/dist/esm/ds-styled/utilities/index.js.map +7 -0
  58. package/dist/esm/ds-styled/utilities/magicCssTransform.js +36 -0
  59. package/dist/esm/ds-styled/utilities/magicCssTransform.js.map +7 -0
  60. package/dist/esm/{styled/styleGetters.js → ds-styled/utilities/resolvers.js} +2 -2
  61. package/dist/esm/ds-styled/utilities/resolvers.js.map +7 -0
  62. package/dist/esm/ds-styled/utilities/sizing.js +37 -0
  63. package/dist/esm/ds-styled/utilities/sizing.js.map +7 -0
  64. package/dist/esm/globalStyles.js +1 -1
  65. package/dist/esm/globalStyles.js.map +1 -1
  66. package/dist/esm/index.js +1 -1
  67. package/dist/esm/index.js.map +1 -1
  68. package/dist/esm/mobileUtilities.js +8 -10
  69. package/dist/esm/mobileUtilities.js.map +2 -2
  70. package/dist/esm/spaceUtilities.js.map +1 -1
  71. package/dist/esm/th.js +39 -13
  72. package/dist/esm/th.js.map +2 -2
  73. package/dist/esm/theme.js.map +1 -1
  74. package/dist/esm/themeProviderHOC.js +7 -4
  75. package/dist/esm/themeProviderHOC.js.map +2 -2
  76. package/dist/esm/utils.js +5 -6
  77. package/dist/esm/utils.js.map +2 -2
  78. package/package.json +13 -13
  79. package/dist/cjs/styled/index.d.js +0 -27
  80. package/dist/cjs/styled/index.d.js.map +0 -7
  81. package/dist/cjs/styled/index.js +0 -105
  82. package/dist/cjs/styled/index.js.map +0 -7
  83. package/dist/cjs/styled/styleGetters.js +0 -56
  84. package/dist/cjs/styled/styleGetters.js.map +0 -7
  85. package/dist/cjs/styled/types.js +0 -35
  86. package/dist/cjs/styled/types.js.map +0 -7
  87. package/dist/cjs/styled/utils.js +0 -47
  88. package/dist/cjs/styled/utils.js.map +0 -7
  89. package/dist/esm/styled/index.d.js +0 -2
  90. package/dist/esm/styled/index.js.map +0 -7
  91. package/dist/esm/styled/styleGetters.js.map +0 -7
  92. package/dist/esm/styled/types.js +0 -6
  93. package/dist/esm/styled/types.js.map +0 -7
  94. package/dist/esm/styled/utils.js +0 -18
  95. package/dist/esm/styled/utils.js.map +0 -7
@@ -1,47 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __reExport = (target, module2, copyDefault, desc) => {
13
- if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
- for (let key of __getOwnPropNames(module2))
15
- if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
- __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
- }
18
- return target;
19
- };
20
- var __toESM = (module2, isNodeMode) => {
21
- return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
- };
23
- var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
- return (module2, temp) => {
25
- return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
- };
27
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
- var utils_exports = {};
29
- __export(utils_exports, {
30
- coerceWithDefaultTheme: () => coerceWithDefaultTheme,
31
- isEmpty: () => isEmpty,
32
- propsToClassKey: () => propsToClassKey
33
- });
34
- var React = __toESM(require("react"));
35
- var import_ds_utilities = require("@elliemae/ds-utilities");
36
- var import_theme = require("../theme");
37
- const systemTheme = import_theme.theme;
38
- const isEmpty = (string) => string.length === 0;
39
- const coerceWithDefaultTheme = (themeInput) => themeInput ?? systemTheme;
40
- const propsToClassKey = (props) => Object.keys(props).sort().reduce((classKey, key) => {
41
- if (key === "color") {
42
- return classKey + isEmpty(String(classKey)) ? String(props[key]) : (0, import_ds_utilities.capitalize)(String(props[key]));
43
- }
44
- return `${classKey}${isEmpty(String(classKey)) ? key : (0, import_ds_utilities.capitalize)(key)}${(0, import_ds_utilities.capitalize)(props[key].toString())}`;
45
- }, "");
46
- module.exports = __toCommonJS(utils_exports);
47
- //# sourceMappingURL=utils.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/styled/utils.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { capitalize } from '@elliemae/ds-utilities';\nimport type { Theme } from './types';\nimport { theme as defaultTheme } from '../theme';\n\nconst systemTheme = defaultTheme;\n\nexport const isEmpty = (string: string): boolean => string.length === 0;\n\nexport const coerceWithDefaultTheme = (themeInput: Theme): Theme => themeInput ?? systemTheme;\n\nexport const propsToClassKey = (props: Record<string, { toString: () => string }>): string =>\n Object.keys(props)\n .sort()\n .reduce((classKey, key) => {\n if (key === 'color') {\n return classKey + isEmpty(String(classKey)) ? String(props[key]) : capitalize(String(props[key]));\n }\n return `${classKey}${isEmpty(String(classKey)) ? key : capitalize(key)}${capitalize(props[key].toString())}`;\n }, '');\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,0BAA2B;AAE3B,mBAAsC;AAEtC,MAAM,cAAc;AAEb,MAAM,UAAU,CAAC,WAA4B,OAAO,WAAW;AAE/D,MAAM,yBAAyB,CAAC,eAA6B,cAAc;AAE3E,MAAM,kBAAkB,CAAC,UAC9B,OAAO,KAAK,OACT,OACA,OAAO,CAAC,UAAU,QAAQ;AACzB,MAAI,QAAQ,SAAS;AACnB,WAAO,WAAW,QAAQ,OAAO,aAAa,OAAO,MAAM,QAAQ,oCAAW,OAAO,MAAM;AAAA;AAE7F,SAAO,GAAG,WAAW,QAAQ,OAAO,aAAa,MAAM,oCAAW,OAAO,oCAAW,MAAM,KAAK;AAAA,GAC9F;",
6
- "names": []
7
- }
@@ -1,2 +0,0 @@
1
- import * as React from "react";
2
- //# sourceMappingURL=index.d.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/styled/index.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import styled_component, { StyledComponentPropsWithRef } from 'styled-components';\nimport { Styled, StyledFunction, StyledObject } from './types';\nimport { getStyleOverrides, getVariantStyles, variantsResolver } from './styleGetters';\nimport { coerceWithDefaultTheme } from './utils';\n\nconst styledFunction: StyledFunction = (tag, options = { name: null, slot: null }) => {\n const { name: componentName = null, slot: componentSlot = null } = options;\n const func: ReturnType<StyledFunction> = (styleArg, ...expressions) => {\n /*\n * These are the internal expression written in dimsum\n * We just coerce with the default theme in case users\n * forget to add the ThemeProvider\n */\n const expressionsWithDefaultTheme = expressions\n ? expressions.map<typeof expressions[number]>((stylesArg) =>\n typeof stylesArg === 'function'\n ? (props) =>\n stylesArg({\n ...props,\n theme: coerceWithDefaultTheme(props.theme),\n })\n : stylesArg,\n )\n : [];\n\n let transformedStyleArg = styleArg;\n\n /*\n * Here we get the style overrides from the user\n */\n if (componentName && componentSlot) {\n expressionsWithDefaultTheme.push((props) => {\n const theme = coerceWithDefaultTheme(props.theme);\n const styleOverrides = getStyleOverrides(componentName, theme);\n if (styleOverrides) {\n return [styleOverrides[componentSlot]];\n }\n return null;\n });\n }\n\n /*\n * Here we get the variant overrides from the user (only for the root)\n */\n if (componentName && componentSlot === 'root') {\n expressionsWithDefaultTheme.push((props) => {\n const theme = coerceWithDefaultTheme(props.theme);\n return variantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);\n });\n }\n\n const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;\n\n if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {\n // Here we are adding placeholders for all the new functions that we are gonna call\n const placeholders: string[] = new Array(numOfCustomFnsApplied).fill('');\n transformedStyleArg = Object.assign([...styleArg, ...placeholders], {\n raw: [...(styleArg as TemplateStringsArray).raw, ...placeholders],\n });\n } else if (typeof styleArg === 'function') {\n // Here we just coerce with the default theme\n transformedStyleArg = (props) => styleArg({ ...props, theme: coerceWithDefaultTheme(props.theme) });\n }\n let Component = styled_component(tag);\n\n const displayName =\n componentName !== null && componentSlot !== null ? `${componentName}-${componentSlot}` : null;\n\n if (displayName !== null) {\n Component = Component.attrs({ className: `${componentName}${componentSlot}` } as unknown as Partial<\n StyledComponentPropsWithRef<typeof tag>\n >);\n }\n\n Component = Component(transformedStyleArg, ...expressionsWithDefaultTheme);\n\n if (displayName !== null) {\n Component.displayName = displayName;\n }\n\n return Component;\n };\n return func;\n};\n\nconst styledObject = Object.keys(styled_component).reduce((obj, key) => {\n const castedKey = key as keyof JSX.IntrinsicElements;\n obj[castedKey] = styledFunction(castedKey);\n return obj;\n}, {} as StyledObject);\n\nexport const styled: Styled = Object.assign(styledFunction, styledObject);\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACAA;AAEA;AACA;AAEA,MAAM,iBAAiC,CAAC,KAAK,UAAU,EAAE,MAAM,MAAM,MAAM,WAAW;AACpF,QAAM,EAAE,MAAM,gBAAgB,MAAM,MAAM,gBAAgB,SAAS;AACnE,QAAM,OAAmC,CAAC,aAAa,gBAAgB;AAMrE,UAAM,8BAA8B,cAChC,YAAY,IAAgC,CAAC,cAC7C,OAAO,cAAc,aACjB,CAAC,UACD,UAAU,iCACL,QADK;AAAA,MAER,OAAO,uBAAuB,MAAM;AAAA,UAEtC,aAEJ;AAEJ,QAAI,sBAAsB;AAK1B,QAAI,iBAAiB,eAAe;AAClC,kCAA4B,KAAK,CAAC,UAAU;AAC1C,cAAM,QAAQ,uBAAuB,MAAM;AAC3C,cAAM,iBAAiB,kBAAkB,eAAe;AACxD,YAAI,gBAAgB;AAClB,iBAAO,CAAC,eAAe;AAAA;AAEzB,eAAO;AAAA;AAAA;AAOX,QAAI,iBAAiB,kBAAkB,QAAQ;AAC7C,kCAA4B,KAAK,CAAC,UAAU;AAC1C,cAAM,QAAQ,uBAAuB,MAAM;AAC3C,eAAO,iBAAiB,OAAO,iBAAiB,eAAe,QAAQ,OAAO;AAAA;AAAA;AAIlF,UAAM,wBAAwB,4BAA4B,SAAS,YAAY;AAE/E,QAAI,MAAM,QAAQ,aAAa,wBAAwB,GAAG;AAExD,YAAM,eAAyB,IAAI,MAAM,uBAAuB,KAAK;AACrE,4BAAsB,OAAO,OAAO,CAAC,GAAG,UAAU,GAAG,eAAe;AAAA,QAClE,KAAK,CAAC,GAAI,SAAkC,KAAK,GAAG;AAAA;AAAA,eAE7C,OAAO,aAAa,YAAY;AAEzC,4BAAsB,CAAC,UAAU,SAAS,iCAAK,QAAL,EAAY,OAAO,uBAAuB,MAAM;AAAA;AAE5F,QAAI,YAAY,iBAAiB;AAEjC,UAAM,cACJ,kBAAkB,QAAQ,kBAAkB,OAAO,GAAG,iBAAiB,kBAAkB;AAE3F,QAAI,gBAAgB,MAAM;AACxB,kBAAY,UAAU,MAAM,EAAE,WAAW,GAAG,gBAAgB;AAAA;AAK9D,gBAAY,UAAU,qBAAqB,GAAG;AAE9C,QAAI,gBAAgB,MAAM;AACxB,gBAAU,cAAc;AAAA;AAG1B,WAAO;AAAA;AAET,SAAO;AAAA;AAGT,MAAM,eAAe,OAAO,KAAK,kBAAkB,OAAO,CAAC,KAAK,QAAQ;AACtE,QAAM,YAAY;AAClB,MAAI,aAAa,eAAe;AAChC,SAAO;AAAA,GACN;AAEI,MAAM,SAAiB,OAAO,OAAO,gBAAgB;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/styled/styleGetters.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-params */\nimport type { Theme, CSSObject } from './types';\nimport { propsToClassKey } from './utils';\n\nexport const getStyleOverrides = (name: string, theme: Theme): CSSObject | null =>\n theme.components?.[name]?.styleOverrides || null;\n\nexport const getVariantStyles = (name: string, theme: Theme): Record<string, CSSObject> => {\n const variants = theme.components?.[name]?.variants || [];\n\n return variants.reduce((styles, definition) => {\n const key = propsToClassKey(definition.props);\n styles[key] = definition.style;\n return styles;\n }, {} as Record<string, CSSObject>);\n};\n\nexport const variantsResolver = (\n props: Record<string, unknown>,\n styles: CSSObject,\n theme: Theme,\n name: string,\n): CSSObject[keyof CSSObject][] => {\n const themeVariants = theme?.components?.[name]?.variants || [];\n\n return themeVariants.reduce((variantsStyles, themeVariant) => {\n const isMatch = Object.keys(themeVariant.props).every((key) => props[key] === themeVariant.props[key]);\n if (isMatch) {\n variantsStyles.push(styles[propsToClassKey(themeVariant.props)]);\n }\n return variantsStyles;\n }, [] as CSSObject[keyof CSSObject][]);\n};\n"],
5
- "mappings": "AAAA;ACEA;AAEO,MAAM,oBAAoB,CAAC,MAAc,UAC9C,MAAM,aAAa,OAAO,kBAAkB;AAEvC,MAAM,mBAAmB,CAAC,MAAc,UAA4C;AACzF,QAAM,WAAW,MAAM,aAAa,OAAO,YAAY;AAEvD,SAAO,SAAS,OAAO,CAAC,QAAQ,eAAe;AAC7C,UAAM,MAAM,gBAAgB,WAAW;AACvC,WAAO,OAAO,WAAW;AACzB,WAAO;AAAA,KACN;AAAA;AAGE,MAAM,mBAAmB,CAC9B,OACA,QACA,OACA,SACiC;AACjC,QAAM,gBAAgB,OAAO,aAAa,OAAO,YAAY;AAE7D,SAAO,cAAc,OAAO,CAAC,gBAAgB,iBAAiB;AAC5D,UAAM,UAAU,OAAO,KAAK,aAAa,OAAO,MAAM,CAAC,QAAQ,MAAM,SAAS,aAAa,MAAM;AACjG,QAAI,SAAS;AACX,qBAAe,KAAK,OAAO,gBAAgB,aAAa;AAAA;AAE1D,WAAO;AAAA,KACN;AAAA;",
6
- "names": []
7
- }
@@ -1,6 +0,0 @@
1
- import * as React from "react";
2
- import { CSSObject as CSSObject2 } from "styled-components";
3
- export {
4
- CSSObject2 as CSSObject
5
- };
6
- //# sourceMappingURL=types.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/styled/types.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport type { Theme as PuiTheme } from '@elliemae/pui-theme';\nimport {\n AnyStyledComponent,\n CSSObject,\n Interpolation,\n InterpolationFunction,\n StyledComponent,\n StyledComponentInnerAttrs,\n StyledComponentInnerComponent,\n StyledComponentInnerOtherProps,\n StyledComponentPropsWithRef,\n ThemedStyledProps,\n StyledConfig,\n} from 'styled-components';\n\ntype Attrs<P, A extends Partial<P>, T> = ((props: ThemedStyledProps<P, T>) => A) | A;\n\nexport { CSSObject } from 'styled-components';\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 ThemedStyledFunctionBase<\n C extends keyof JSX.IntrinsicElements | React.ComponentType<any>,\n T extends object,\n O extends object = Record<string, unknown>,\n A extends keyof any = never,\n> = <U extends object = Record<string, unknown>>(\n first:\n | TemplateStringsArray\n | CSSObject\n | InterpolationFunction<ThemedStyledProps<StyledComponentPropsWithRef<C> & O & U, T>>,\n ...rest: Array<Interpolation<ThemedStyledProps<StyledComponentPropsWithRef<C> & O & U, T>>>\n) => StyledComponent<C, T, O & U, A>;\n\ninterface ThemedStyledFunction<\n C extends keyof JSX.IntrinsicElements | React.ComponentType<any>,\n T extends object,\n O extends object = Record<string, unknown>,\n A extends keyof any = never,\n> extends ThemedStyledFunctionBase<C, T, O, A> {\n attrs<\n U,\n NewA extends Partial<StyledComponentPropsWithRef<C> & U> & {\n [others: string]: any;\n } = any,\n >(\n attrs: Attrs<StyledComponentPropsWithRef<C> & U, NewA, T>,\n ): ThemedStyledFunction<C, T, O & NewA, A | keyof NewA>;\n\n withConfig: <Props extends O = O>(\n config: StyledConfig<StyledComponentPropsWithRef<C> & Props>,\n ) => ThemedStyledFunction<C, T, Props, A>;\n}\n\ntype ThemedStyledComponentFactories<T extends object> = {\n [TTag in keyof JSX.IntrinsicElements]: ThemedStyledFunction<TTag, T>;\n};\n\nexport type StyledFunction = <C extends AnyStyledComponent | keyof JSX.IntrinsicElements | React.ComponentType<any>>(\n tag: C,\n options?: { name: string | null; slot: string | null },\n) => ThemedStyledFunction<\n C extends AnyStyledComponent ? StyledComponentInnerComponent<C> : C,\n Theme,\n C extends AnyStyledComponent ? StyledComponentInnerOtherProps<C> : unknown,\n C extends AnyStyledComponent ? StyledComponentInnerAttrs<C> : never\n>;\n\nexport type StyledObject = ThemedStyledComponentFactories<Theme>;\n\nexport type Styled = StyledFunction & StyledObject;\n"],
5
- "mappings": "AAAA;ACkBA;",
6
- "names": []
7
- }
@@ -1,18 +0,0 @@
1
- import * as React from "react";
2
- import { capitalize } from "@elliemae/ds-utilities";
3
- import { theme as defaultTheme } from "../theme";
4
- const systemTheme = defaultTheme;
5
- const isEmpty = (string) => string.length === 0;
6
- const coerceWithDefaultTheme = (themeInput) => themeInput ?? systemTheme;
7
- const propsToClassKey = (props) => Object.keys(props).sort().reduce((classKey, key) => {
8
- if (key === "color") {
9
- return classKey + isEmpty(String(classKey)) ? String(props[key]) : capitalize(String(props[key]));
10
- }
11
- return `${classKey}${isEmpty(String(classKey)) ? key : capitalize(key)}${capitalize(props[key].toString())}`;
12
- }, "");
13
- export {
14
- coerceWithDefaultTheme,
15
- isEmpty,
16
- propsToClassKey
17
- };
18
- //# sourceMappingURL=utils.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/styled/utils.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { capitalize } from '@elliemae/ds-utilities';\nimport type { Theme } from './types';\nimport { theme as defaultTheme } from '../theme';\n\nconst systemTheme = defaultTheme;\n\nexport const isEmpty = (string: string): boolean => string.length === 0;\n\nexport const coerceWithDefaultTheme = (themeInput: Theme): Theme => themeInput ?? systemTheme;\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"],
5
- "mappings": "AAAA;ACAA;AAEA;AAEA,MAAM,cAAc;AAEb,MAAM,UAAU,CAAC,WAA4B,OAAO,WAAW;AAE/D,MAAM,yBAAyB,CAAC,eAA6B,cAAc;AAE3E,MAAM,kBAAkB,CAAC,UAC9B,OAAO,KAAK,OACT,OACA,OAAO,CAAC,UAAU,QAAQ;AACzB,MAAI,QAAQ,SAAS;AACnB,WAAO,WAAW,QAAQ,OAAO,aAAa,OAAO,MAAM,QAAQ,WAAW,OAAO,MAAM;AAAA;AAE7F,SAAO,GAAG,WAAW,QAAQ,OAAO,aAAa,MAAM,WAAW,OAAO,WAAW,MAAM,KAAK;AAAA,GAC9F;",
6
- "names": []
7
- }