@elliemae/ds-system 3.0.0-next.64 → 3.0.0-next.67

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 (36) hide show
  1. package/dist/cjs/ds-styled/index.js +15 -0
  2. package/dist/cjs/ds-styled/index.js.map +2 -2
  3. package/dist/cjs/ds-styled/styled.js +1 -1
  4. package/dist/cjs/ds-styled/styled.js.map +2 -2
  5. package/dist/cjs/ds-styled/types.js.map +1 -1
  6. package/dist/cjs/ds-styled/utilities/{height.js → background.js} +17 -8
  7. package/dist/cjs/ds-styled/utilities/background.js.map +7 -0
  8. package/dist/cjs/ds-styled/utilities/border.js +174 -0
  9. package/dist/cjs/ds-styled/utilities/border.js.map +7 -0
  10. package/dist/cjs/ds-styled/utilities/index.js +3 -2
  11. package/dist/cjs/ds-styled/utilities/index.js.map +2 -2
  12. package/dist/cjs/ds-styled/utilities/{width.js → sizing.js} +33 -6
  13. package/dist/cjs/ds-styled/utilities/sizing.js.map +7 -0
  14. package/dist/cjs/utils.js +0 -8
  15. package/dist/cjs/utils.js.map +2 -2
  16. package/dist/esm/ds-styled/index.js +11 -0
  17. package/dist/esm/ds-styled/index.js.map +2 -2
  18. package/dist/esm/ds-styled/styled.js +2 -4
  19. package/dist/esm/ds-styled/styled.js.map +2 -2
  20. package/dist/esm/ds-styled/utilities/background.js +19 -0
  21. package/dist/esm/ds-styled/utilities/background.js.map +7 -0
  22. package/dist/esm/ds-styled/utilities/border.js +152 -0
  23. package/dist/esm/ds-styled/utilities/border.js.map +7 -0
  24. package/dist/esm/ds-styled/utilities/index.js +3 -2
  25. package/dist/esm/ds-styled/utilities/index.js.map +2 -2
  26. package/dist/esm/ds-styled/utilities/sizing.js +37 -0
  27. package/dist/esm/ds-styled/utilities/sizing.js.map +7 -0
  28. package/dist/esm/utils.js +0 -8
  29. package/dist/esm/utils.js.map +2 -2
  30. package/package.json +1 -1
  31. package/dist/cjs/ds-styled/utilities/height.js.map +0 -7
  32. package/dist/cjs/ds-styled/utilities/width.js.map +0 -7
  33. package/dist/esm/ds-styled/utilities/height.js +0 -10
  34. package/dist/esm/ds-styled/utilities/height.js.map +0 -7
  35. package/dist/esm/ds-styled/utilities/width.js +0 -10
  36. package/dist/esm/ds-styled/utilities/width.js.map +0 -7
@@ -4,6 +4,10 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __getProtoOf = Object.getPrototypeOf;
6
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
7
11
  var __copyProps = (to, from, except, desc) => {
8
12
  if (from && typeof from === "object" || typeof from === "function") {
9
13
  for (let key of __getOwnPropNames(from))
@@ -16,7 +20,18 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
16
20
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
17
21
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
22
  var ds_styled_exports = {};
23
+ __export(ds_styled_exports, {
24
+ boxShadows: () => import_system.boxShadow,
25
+ flexboxes: () => import_system.flexboxes,
26
+ grids: () => import_system.grids,
27
+ layout: () => import_system.layout,
28
+ space: () => import_system.space
29
+ });
19
30
  module.exports = __toCommonJS(ds_styled_exports);
20
31
  var React = __toESM(require("react"));
21
32
  __reExport(ds_styled_exports, require("./styled"), module.exports);
33
+ var import_system = require("@xstyled/system");
34
+ __reExport(ds_styled_exports, require("./utilities/border"), module.exports);
35
+ __reExport(ds_styled_exports, require("./utilities/background"), module.exports);
36
+ __reExport(ds_styled_exports, require("./utilities/sizing"), module.exports);
22
37
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/ds-styled/index.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export * from './styled';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAc,qBAAd;",
4
+ "sourcesContent": ["export * from './styled';\n\nexport { layout, space, flexboxes, grids, boxShadow as boxShadows } from '@xstyled/system';\nexport * from './utilities/border';\nexport * from './utilities/background';\nexport * from './utilities/sizing';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAc,qBAAd;AAEA,oBAAyE;AACzE,8BAAc,+BAHd;AAIA,8BAAc,mCAJd;AAKA,8BAAc,+BALd;",
6
6
  "names": []
7
7
  }
@@ -46,7 +46,7 @@ var React = __toESM(require("react"));
46
46
  var import_styled_components = require("@xstyled/styled-components");
47
47
  var import_system = require("@xstyled/system");
48
48
  var import_utilities = require("./utilities");
49
- const { css, styled: baseStyledComponent, createGlobalStyle } = (0, import_styled_components.createCss)((0, import_system.compose)(import_system.system, import_utilities.width, import_utilities.height));
49
+ const { css, styled: baseStyledComponent, createGlobalStyle } = (0, import_styled_components.createCss)((0, import_system.compose)(import_system.system));
50
50
  const styledFunction = (tag, options = { name: null, slot: null }) => {
51
51
  const { name: componentName, slot: componentSlot } = options;
52
52
  const defaultStyledResolver = baseStyledComponent(tag);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/ds-styled/styled.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable @typescript-eslint/ban-ts-comment */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/unbound-method */\n/* eslint-disable complexity */\nimport { createCss } from '@xstyled/styled-components';\nimport { system, compose } from '@xstyled/system';\nimport { StyledComponentInnerComponent, StyledComponentPropsWithRef } from 'styled-components';\nimport { DSStyledFunction, DSStyledFunctionInternal, DSStyledObject, PropsWithTheme } from './types';\nimport {\n coerceWithDefaultTheme,\n getStyleOverrides,\n magicCssTransform,\n getVariantStyles,\n height,\n stylesArgThemeCoercion,\n variantsResolver,\n width,\n} from './utilities';\n\nconst { css, styled: baseStyledComponent, createGlobalStyle } = createCss(compose(system, width, height));\n\n// @ts-ignore\nconst styledFunction: DSStyledFunction = (tag, options = { name: null, slot: null }) => {\n const { name: componentName, slot: componentSlot } = options;\n\n const defaultStyledResolver = baseStyledComponent(tag);\n\n const attributes = {\n attrs: defaultStyledResolver.attrs,\n withConfig: defaultStyledResolver.withConfig,\n };\n\n // @ts-ignore\n const dimsumStyledResolver: DSStyledFunctionInternal = (styleArg, ...expressions) => {\n /**\n * Here we apply a CSS transformation to support MAGIC styled components\n */\n\n const [styleArgWithMagic, expressionsWithMagic] = magicCssTransform(styleArg, expressions);\n\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 = expressionsWithMagic ? expressionsWithMagic.map(stylesArgThemeCoercion) : [];\n\n let transformedStyleArg = styleArgWithMagic;\n\n /*\n * Here we get the style overrides from the user\n */\n if (componentName && componentSlot) {\n expressionsWithDefaultTheme.push((props: PropsWithTheme) => {\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: PropsWithTheme) => {\n const theme = coerceWithDefaultTheme(props.theme);\n return variantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);\n });\n }\n\n const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressionsWithMagic.length;\n\n if (Array.isArray(styleArgWithMagic) && numOfCustomFnsApplied > 0) {\n // Here we are adding placeholders for all the new functions that we are gonna call\n const placeholders = new Array(numOfCustomFnsApplied).fill('') as string[];\n transformedStyleArg = Object.assign([...styleArgWithMagic, ...placeholders], {\n raw: [...(styleArgWithMagic as TemplateStringsArray).raw, ...placeholders],\n });\n } else if (typeof styleArgWithMagic === 'function') {\n // Here we just coerce with the default theme\n transformedStyleArg = (props: PropsWithTheme) =>\n styleArgWithMagic({ ...props, theme: coerceWithDefaultTheme(props.theme) });\n }\n\n const displayName = componentName !== null && componentSlot !== null ? `${componentName}-${componentSlot}` : null;\n\n const classNameObject = displayName !== null ? { className: displayName } : {};\n\n const defaultStyledResolverWithClassName = defaultStyledResolver.attrs(\n classNameObject as unknown as Partial<StyledComponentPropsWithRef<StyledComponentInnerComponent<any>>>,\n );\n\n const Component = defaultStyledResolverWithClassName(transformedStyleArg, ...expressionsWithDefaultTheme);\n\n if (displayName !== null) {\n Component.displayName = displayName;\n }\n\n return Component;\n };\n\n return Object.assign(dimsumStyledResolver, attributes);\n};\n\n// Here we create an object with the IntrinsicElements keys pointing to the styledFunction\nconst styledObject = Object.keys(baseStyledComponent).reduce((obj, key) => {\n const castedKey = key as keyof JSX.IntrinsicElements;\n obj[castedKey] = styledFunction(castedKey);\n return obj;\n}, {} as DSStyledObject);\n\nexport const styled = Object.assign(styledFunction, styledObject);\nexport { css, createGlobalStyle };\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADMvB,+BAA0B;AAC1B,oBAAgC;AAGhC,uBASO;AAEP,MAAM,EAAE,KAAK,QAAQ,qBAAqB,sBAAsB,wCAAU,2BAAQ,sBAAQ,wBAAO,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4BAAsB,CAAC,UACrB,kBAAkB,iCAAK,QAAL,EAAY,OAAO,6CAAuB,MAAM,KAAK,EAAE,EAAC;AAAA,IAC9E;AAEA,UAAM,cAAc,kBAAkB,QAAQ,kBAAkB,OAAO,GAAG,iBAAiB,kBAAkB;AAE7G,UAAM,kBAAkB,gBAAgB,OAAO,EAAE,WAAW,YAAY,IAAI,CAAC;AAE7E,UAAM,qCAAqC,sBAAsB,MAC/D,eACF;AAEA,UAAM,YAAY,mCAAmC,qBAAqB,GAAG,2BAA2B;AAExG,QAAI,gBAAgB,MAAM;AACxB,gBAAU,cAAc;AAAA,IAC1B;AAEA,WAAO;AAAA,EACT;AAEA,SAAO,OAAO,OAAO,sBAAsB,UAAU;AACvD;AAGA,MAAM,eAAe,OAAO,KAAK,mBAAmB,EAAE,OAAO,CAAC,KAAK,QAAQ;AACzE,QAAM,YAAY;AAClB,MAAI,aAAa,eAAe,SAAS;AACzC,SAAO;AACT,GAAG,CAAC,CAAmB;AAEhB,MAAM,SAAS,OAAO,OAAO,gBAAgB,YAAY;",
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/ban-ts-comment */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/unbound-method */\n/* eslint-disable complexity */\nimport { createCss } from '@xstyled/styled-components';\nimport { system, compose } from '@xstyled/system';\nimport { StyledComponentInnerComponent, StyledComponentPropsWithRef } from 'styled-components';\nimport { DSStyledFunction, DSStyledFunctionInternal, DSStyledObject, PropsWithTheme } from './types';\nimport {\n coerceWithDefaultTheme,\n getStyleOverrides,\n magicCssTransform,\n getVariantStyles,\n stylesArgThemeCoercion,\n variantsResolver,\n} from './utilities';\n\nconst { css, styled: baseStyledComponent, createGlobalStyle } = createCss(compose(system));\n\n// @ts-ignore\nconst styledFunction: DSStyledFunction = (tag, options = { name: null, slot: null }) => {\n const { name: componentName, slot: componentSlot } = options;\n\n const defaultStyledResolver = baseStyledComponent(tag);\n\n const attributes = {\n attrs: defaultStyledResolver.attrs,\n withConfig: defaultStyledResolver.withConfig,\n };\n\n // @ts-ignore\n const dimsumStyledResolver: DSStyledFunctionInternal = (styleArg, ...expressions) => {\n /**\n * Here we apply a CSS transformation to support MAGIC styled components\n */\n\n const [styleArgWithMagic, expressionsWithMagic] = magicCssTransform(styleArg, expressions);\n\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 = expressionsWithMagic ? expressionsWithMagic.map(stylesArgThemeCoercion) : [];\n\n let transformedStyleArg = styleArgWithMagic;\n\n /*\n * Here we get the style overrides from the user\n */\n if (componentName && componentSlot) {\n expressionsWithDefaultTheme.push((props: PropsWithTheme) => {\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: PropsWithTheme) => {\n const theme = coerceWithDefaultTheme(props.theme);\n return variantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);\n });\n }\n\n const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressionsWithMagic.length;\n\n if (Array.isArray(styleArgWithMagic) && numOfCustomFnsApplied > 0) {\n // Here we are adding placeholders for all the new functions that we are gonna call\n const placeholders = new Array(numOfCustomFnsApplied).fill('') as string[];\n transformedStyleArg = Object.assign([...styleArgWithMagic, ...placeholders], {\n raw: [...(styleArgWithMagic as TemplateStringsArray).raw, ...placeholders],\n });\n } else if (typeof styleArgWithMagic === 'function') {\n // Here we just coerce with the default theme\n transformedStyleArg = (props: PropsWithTheme) =>\n styleArgWithMagic({ ...props, theme: coerceWithDefaultTheme(props.theme) });\n }\n\n const displayName = componentName !== null && componentSlot !== null ? `${componentName}-${componentSlot}` : null;\n\n const classNameObject = displayName !== null ? { className: displayName } : {};\n\n const defaultStyledResolverWithClassName = defaultStyledResolver.attrs(\n classNameObject as unknown as Partial<StyledComponentPropsWithRef<StyledComponentInnerComponent<any>>>,\n );\n\n const Component = defaultStyledResolverWithClassName(transformedStyleArg, ...expressionsWithDefaultTheme);\n\n if (displayName !== null) {\n Component.displayName = displayName;\n }\n\n return Component;\n };\n\n return Object.assign(dimsumStyledResolver, attributes);\n};\n\n// Here we create an object with the IntrinsicElements keys pointing to the styledFunction\nconst styledObject = Object.keys(baseStyledComponent).reduce((obj, key) => {\n const castedKey = key as keyof JSX.IntrinsicElements;\n obj[castedKey] = styledFunction(castedKey);\n return obj;\n}, {} as DSStyledObject);\n\nexport const styled = Object.assign(styledFunction, styledObject);\nexport { css, createGlobalStyle };\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADMvB,+BAA0B;AAC1B,oBAAgC;AAGhC,uBAOO;AAEP,MAAM,EAAE,KAAK,QAAQ,qBAAqB,sBAAsB,wCAAU,2BAAQ,oBAAM,CAAC;AAGzF,MAAM,iBAAmC,CAAC,KAAK,UAAU,EAAE,MAAM,MAAM,MAAM,KAAK,MAAM;AACtF,QAAM,EAAE,MAAM,eAAe,MAAM,kBAAkB;AAErD,QAAM,wBAAwB,oBAAoB,GAAG;AAErD,QAAM,aAAa;AAAA,IACjB,OAAO,sBAAsB;AAAA,IAC7B,YAAY,sBAAsB;AAAA,EACpC;AAGA,QAAM,uBAAiD,CAAC,aAAa,gBAAgB;AAKnF,UAAM,CAAC,mBAAmB,wBAAwB,wCAAkB,UAAU,WAAW;AAOzF,UAAM,8BAA8B,uBAAuB,qBAAqB,IAAI,uCAAsB,IAAI,CAAC;AAE/G,QAAI,sBAAsB;AAK1B,QAAI,iBAAiB,eAA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AAM,eAAe,OAAO,KAAK,mBAAmB,EAAE,OAAO,CAAC,KAAK,QAAQ;AACzE,QAAM,YAAY;AAClB,MAAI,aAAa,eAAe,SAAS;AACzC,SAAO;AACT,GAAG,CAAC,CAAmB;AAEhB,MAAM,SAAS,OAAO,OAAO,gBAAgB,YAAY;",
6
6
  "names": []
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/ds-styled/types.ts", "../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type {\n AnyStyledComponent,\n StyledComponentInnerAttrs,\n StyledComponentInnerComponent,\n StyledComponentInnerOtherProps,\n CSSObject,\n StyledComponent,\n StyledComponentPropsWithRef,\n ThemedStyledProps,\n Interpolation,\n InterpolationFunction,\n StyledConfig,\n} from 'styled-components';\nimport type { Theme as PuiTheme } from '@elliemae/pui-theme';\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\ntype Attrs<P, A extends Partial<P>, T> = ((props: ThemedStyledProps<P, T>) => A) | A;\n\ninterface DSStyledConfig {\n name: string | null;\n slot: string | null;\n}\n\ntype 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>(\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 // Fun thing: 'attrs' can also provide a polymorphic 'as' prop\n // My head already hurts enough so maybe later...\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\nexport type DSStyledFunction = <C extends AnyStyledComponent | keyof JSX.IntrinsicElements | React.ComponentType<any>>(\n tag: C,\n options?: DSStyledConfig,\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 DSStyledObject = {\n [TTag in keyof JSX.IntrinsicElements]: ThemedStyledFunction<keyof JSX.IntrinsicElements, Theme>;\n};\n\nexport type DSStyledFunctionInternal = (\n ...args: Parameters<ReturnType<DSStyledFunction>>\n) => ReturnType<ReturnType<DSStyledFunction>>;\n\nexport type PropsWithTheme = { theme?: Theme } & Record<string, unknown>;\n", "import * as React from 'react';\nexport { React };\n"],
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type {\n AnyStyledComponent,\n StyledComponentInnerAttrs,\n StyledComponentInnerComponent,\n StyledComponentInnerOtherProps,\n CSSObject,\n StyledComponent,\n StyledComponentPropsWithRef,\n ThemedStyledProps,\n Interpolation,\n InterpolationFunction,\n StyledConfig,\n Props,\n} from 'styled-components';\nimport type { Theme as PuiTheme } from '@elliemae/pui-theme';\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\ntype Attrs<P, A extends Partial<P>, T> = ((props: ThemedStyledProps<P, T>) => A) | A;\n\ninterface DSStyledConfig {\n name: string | null;\n slot: string | null;\n}\n\ntype 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>(\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 // Fun thing: 'attrs' can also provide a polymorphic 'as' prop\n // My head already hurts enough so maybe later...\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\nexport type DSStyledFunction = <C extends AnyStyledComponent | keyof JSX.IntrinsicElements | React.ComponentType<any>>(\n tag: C,\n options?: DSStyledConfig,\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 DSStyledObject = {\n [TTag in keyof JSX.IntrinsicElements]: ThemedStyledFunction<keyof JSX.IntrinsicElements, Theme>;\n};\n\nexport type DSStyledFunctionInternal = (\n ...args: Parameters<ReturnType<DSStyledFunction>>\n) => ReturnType<ReturnType<DSStyledFunction>>;\n\nexport type PropsWithTheme = { theme?: Theme } & Record<string, unknown>;\n\nexport type GetterProps = Props<Theme>;\nexport type ThProps = Required<GetterProps>;\n", "import * as React from 'react';\nexport { React };\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;",
6
6
  "names": []
7
7
  }
@@ -18,15 +18,24 @@ var __copyProps = (to, from, except, desc) => {
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
- var height_exports = {};
22
- __export(height_exports, {
23
- height: () => height
21
+ var background_exports = {};
22
+ __export(background_exports, {
23
+ background: () => background
24
24
  });
25
- module.exports = __toCommonJS(height_exports);
25
+ module.exports = __toCommonJS(background_exports);
26
26
  var React = __toESM(require("react"));
27
27
  var import_system = require("@xstyled/system");
28
- const height = (0, import_system.style)({
29
- prop: ["height", "h"],
30
- css: "height"
28
+ var import_th = require("../../th");
29
+ function bgColorGetter(value) {
30
+ return function(props) {
31
+ return `${import_th.th.color(value, value)(props)}`;
32
+ };
33
+ }
34
+ bgColorGetter.meta = {};
35
+ const bg = (0, import_system.style)({
36
+ prop: ["backgroundColor", "bg"],
37
+ css: "background-color",
38
+ themeGet: bgColorGetter
31
39
  });
32
- //# sourceMappingURL=height.js.map
40
+ const background = (0, import_system.compose)(bg);
41
+ //# sourceMappingURL=background.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/ds-styled/utilities/background.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { style, compose } from '@xstyled/system';\nimport { th } from '../../th';\nimport type { GetterProps, ThProps } from '../types';\n\nfunction bgColorGetter(value: string) {\n return function (props: GetterProps): string {\n return `${th.color(value, value)(props as ThProps)}`;\n };\n}\n\nbgColorGetter.meta = {};\n\nconst bg = style({\n prop: ['backgroundColor', 'bg'],\n css: 'background-color',\n themeGet: bgColorGetter,\n});\n\nexport const background = compose(bg);\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAA+B;AAC/B,gBAAmB;AAGnB,uBAAuB,OAAe;AACpC,SAAO,SAAU,OAA4B;AAC3C,WAAO,GAAG,aAAG,MAAM,OAAO,KAAK,EAAE,KAAgB;AAAA,EACnD;AACF;AAEA,cAAc,OAAO,CAAC;AAEtB,MAAM,KAAK,yBAAM;AAAA,EACf,MAAM,CAAC,mBAAmB,IAAI;AAAA,EAC9B,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAEM,MAAM,aAAa,2BAAQ,EAAE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,174 @@
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 __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+ var border_exports = {};
22
+ __export(border_exports, {
23
+ borders: () => borders
24
+ });
25
+ module.exports = __toCommonJS(border_exports);
26
+ var React = __toESM(require("react"));
27
+ var import_system = require("@xstyled/system");
28
+ var import_th = require("../../th");
29
+ const colorReg = /(?:neutral|brand|success|danger|warning)-[0-9]{3}(?:-a[0-9]{2})?/;
30
+ function borderGetter(value) {
31
+ return function(props) {
32
+ const color = value.match(colorReg);
33
+ let borderCss = ``;
34
+ if (color) {
35
+ const widthAndStyle = value.replace(color[0], "").trim();
36
+ borderCss = `${import_th.th.color(color[0])(props)} ${widthAndStyle}`;
37
+ } else {
38
+ borderCss = value;
39
+ }
40
+ return borderCss;
41
+ };
42
+ }
43
+ borderGetter.meta = {};
44
+ function borderColorGetter(value) {
45
+ return function(props) {
46
+ return `${import_th.th.color(value, value)(props)}`;
47
+ };
48
+ }
49
+ borderColorGetter.meta = {};
50
+ function borderStyleGetter(value) {
51
+ return function(props) {
52
+ return value;
53
+ };
54
+ }
55
+ borderStyleGetter.meta = {};
56
+ function borderWidthGetter(value) {
57
+ return function(props) {
58
+ return `${import_th.th.space(value, value)(props)}`;
59
+ };
60
+ }
61
+ borderWidthGetter.meta = {};
62
+ function borderRadiusGetter(value) {
63
+ return function(props) {
64
+ return `${import_th.th.space(value, value)(props)}`;
65
+ };
66
+ }
67
+ borderRadiusGetter.meta = {};
68
+ const border = (0, import_system.style)({
69
+ prop: "border",
70
+ css: "border",
71
+ themeGet: borderGetter
72
+ });
73
+ const borderTop = (0, import_system.style)({
74
+ prop: "borderTop",
75
+ css: "border-top",
76
+ themeGet: borderGetter
77
+ });
78
+ const borderBottom = (0, import_system.style)({
79
+ prop: "borderBottom",
80
+ css: "border-bottom",
81
+ themeGet: borderGetter
82
+ });
83
+ const borderRight = (0, import_system.style)({
84
+ prop: "borderRight",
85
+ css: "border-right",
86
+ themeGet: borderGetter
87
+ });
88
+ const borderLeft = (0, import_system.style)({
89
+ prop: "borderLeft",
90
+ css: "border-left",
91
+ themeGet: borderGetter
92
+ });
93
+ const borderColor = (0, import_system.style)({
94
+ prop: "borderColor",
95
+ css: "border-color",
96
+ themeGet: borderColorGetter
97
+ });
98
+ const borderTopColor = (0, import_system.style)({
99
+ prop: "borderTopColor",
100
+ css: "border-top-color",
101
+ themeGet: borderColorGetter
102
+ });
103
+ const borderBottomColor = (0, import_system.style)({
104
+ prop: "borderBottomColor",
105
+ css: "border-bottom-color",
106
+ themeGet: borderColorGetter
107
+ });
108
+ const borderRightColor = (0, import_system.style)({
109
+ prop: "borderRightColor",
110
+ css: "border-right-color",
111
+ themeGet: borderColorGetter
112
+ });
113
+ const borderLeftColor = (0, import_system.style)({
114
+ prop: "borderLeftColor",
115
+ css: "border-left-color",
116
+ themeGet: borderColorGetter
117
+ });
118
+ const borderStyle = (0, import_system.style)({
119
+ prop: "borderStyle",
120
+ css: "border-style",
121
+ themeGet: borderStyleGetter
122
+ });
123
+ const borderTopStyle = (0, import_system.style)({
124
+ prop: "borderTopStyle",
125
+ css: "border-top-style",
126
+ themeGet: borderStyleGetter
127
+ });
128
+ const borderBottomStyle = (0, import_system.style)({
129
+ prop: "borderBottomStyle",
130
+ css: "border-bottom-style",
131
+ themeGet: borderStyleGetter
132
+ });
133
+ const borderRightStyle = (0, import_system.style)({
134
+ prop: "borderRightStyle",
135
+ css: "border-right-style",
136
+ themeGet: borderStyleGetter
137
+ });
138
+ const borderLeftStyle = (0, import_system.style)({
139
+ prop: "borderLeftStyle",
140
+ css: "border-left-style",
141
+ themeGet: borderStyleGetter
142
+ });
143
+ const borderWidth = (0, import_system.style)({
144
+ prop: "borderWidth",
145
+ css: "border-width",
146
+ themeGet: borderWidthGetter
147
+ });
148
+ const borderTopWidth = (0, import_system.style)({
149
+ prop: "borderTopWidth",
150
+ css: "border-top-width",
151
+ themeGet: borderWidthGetter
152
+ });
153
+ const borderBottomWidth = (0, import_system.style)({
154
+ prop: "borderBottomWidth",
155
+ css: "border-bottom-width",
156
+ themeGet: borderWidthGetter
157
+ });
158
+ const borderRightWidth = (0, import_system.style)({
159
+ prop: "borderRightWidth",
160
+ css: "border-right-width",
161
+ themeGet: borderWidthGetter
162
+ });
163
+ const borderLeftWidth = (0, import_system.style)({
164
+ prop: "borderLeftWidth",
165
+ css: "border-left-width",
166
+ themeGet: borderWidthGetter
167
+ });
168
+ const borderRadius = (0, import_system.style)({
169
+ prop: "borderRadius",
170
+ css: "border-radius",
171
+ themeGet: borderRadiusGetter
172
+ });
173
+ const borders = (0, import_system.compose)(border, borderTop, borderBottom, borderLeft, borderRight, borderColor, borderTopColor, borderBottomColor, borderLeftColor, borderRightColor, borderStyle, borderTopStyle, borderBottomStyle, borderLeftStyle, borderRightStyle, borderWidth, borderTopWidth, borderBottomWidth, borderLeftWidth, borderRightWidth, borderRadius);
174
+ //# sourceMappingURL=border.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/ds-styled/utilities/border.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { style, compose } from '@xstyled/system';\nimport { th } from '../../th';\nimport type { GetterProps, ThProps } from '../types';\n\nconst colorReg = /(?:neutral|brand|success|danger|warning)-[0-9]{3}(?:-a[0-9]{2})?/;\n\nfunction borderGetter(value: string) {\n return function (props: GetterProps): 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 ThProps)} ${widthAndStyle}`;\n } else {\n borderCss = value;\n }\n\n return borderCss;\n };\n}\n\nborderGetter.meta = {};\n\nfunction borderColorGetter(value: string) {\n return function (props: GetterProps): string {\n return `${th.color(value, value)(props as ThProps)}`;\n };\n}\n\nborderColorGetter.meta = {};\n\nfunction borderStyleGetter(value: string) {\n return function (props: GetterProps): string {\n return value;\n };\n}\n\nborderStyleGetter.meta = {};\n\nfunction borderWidthGetter(value: string) {\n return function (props: GetterProps): string {\n return `${th.space(value, value)(props as ThProps)}`;\n };\n}\n\nborderWidthGetter.meta = {};\n\nfunction borderRadiusGetter(value: string) {\n return function (props: GetterProps): string {\n return `${th.space(value, value)(props as ThProps)}`;\n };\n}\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;ADAvB,oBAA+B;AAC/B,gBAAmB;AAGnB,MAAM,WAAW;AAEjB,sBAAsB,OAAe;AACnC,SAAO,SAAU,OAA4B;AAC3C,UAAM,QAAQ,MAAM,MAAM,QAAQ;AAClC,QAAI,YAAY;AAEhB,QAAI,OAAO;AACT,YAAM,gBAAgB,MAAM,QAAQ,MAAM,IAAI,EAAE,EAAE,KAAK;AACvD,kBAAY,GAAG,aAAG,MAAM,MAAM,EAAE,EAAE,KAAgB,KAAK;AAAA,IACzD,OAAO;AACL,kBAAY;AAAA,IACd;AAEA,WAAO;AAAA,EACT;AACF;AAEA,aAAa,OAAO,CAAC;AAErB,2BAA2B,OAAe;AACxC,SAAO,SAAU,OAA4B;AAC3C,WAAO,G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A,iBACA,kBACA,aACA,gBACA,mBACA,iBACA,kBACA,YACF;",
6
+ "names": []
7
+ }
@@ -19,8 +19,9 @@ var utilities_exports = {};
19
19
  module.exports = __toCommonJS(utilities_exports);
20
20
  var React = __toESM(require("react"));
21
21
  __reExport(utilities_exports, require("./magicCssTransform"), module.exports);
22
- __reExport(utilities_exports, require("./height"), module.exports);
23
22
  __reExport(utilities_exports, require("./resolvers"), module.exports);
24
23
  __reExport(utilities_exports, require("./helpers"), module.exports);
25
- __reExport(utilities_exports, require("./width"), module.exports);
24
+ __reExport(utilities_exports, require("./sizing"), module.exports);
25
+ __reExport(utilities_exports, require("./border"), module.exports);
26
+ __reExport(utilities_exports, require("./background"), module.exports);
26
27
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/ds-styled/utilities/index.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["export * from './magicCssTransform';\nexport * from './height';\nexport * from './resolvers';\nexport * from './helpers';\nexport * from './width';\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAc,gCAAd;AACA,8BAAc,qBADd;AAEA,8BAAc,wBAFd;AAGA,8BAAc,sBAHd;AAIA,8BAAc,oBAJd;",
4
+ "sourcesContent": ["export * from './magicCssTransform';\nexport * from './resolvers';\nexport * from './helpers';\nexport * from './sizing';\nexport * from './border';\nexport * from './background';\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;ACAA,YAAuB;ADAvB,8BAAc,gCAAd;AACA,8BAAc,wBADd;AAEA,8BAAc,sBAFd;AAGA,8BAAc,qBAHd;AAIA,8BAAc,qBAJd;AAKA,8BAAc,yBALd;",
6
6
  "names": []
7
7
  }
@@ -18,15 +18,42 @@ var __copyProps = (to, from, except, desc) => {
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod));
20
20
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
- var width_exports = {};
22
- __export(width_exports, {
23
- width: () => width
21
+ var sizing_exports = {};
22
+ __export(sizing_exports, {
23
+ sizing: () => sizing
24
24
  });
25
- module.exports = __toCommonJS(width_exports);
25
+ module.exports = __toCommonJS(sizing_exports);
26
26
  var React = __toESM(require("react"));
27
27
  var import_system = require("@xstyled/system");
28
28
  const width = (0, import_system.style)({
29
29
  prop: ["width", "w"],
30
- css: "width"
30
+ css: "width",
31
+ themeGet: import_system.getSize
31
32
  });
32
- //# sourceMappingURL=width.js.map
33
+ const height = (0, import_system.style)({
34
+ prop: ["height", "h"],
35
+ css: "height",
36
+ themeGet: import_system.getSize
37
+ });
38
+ const maxHeight = (0, import_system.style)({
39
+ prop: ["maxH", "maxHeight"],
40
+ css: "max-height",
41
+ themeGet: import_system.getSize
42
+ });
43
+ const maxWidth = (0, import_system.style)({
44
+ prop: ["maxW", "maxWidth"],
45
+ css: "max-width",
46
+ themeGet: import_system.getSize
47
+ });
48
+ const minHeight = (0, import_system.style)({
49
+ prop: ["minH", "minHeight"],
50
+ css: "min-height",
51
+ themeGet: import_system.getSize
52
+ });
53
+ const minWidth = (0, import_system.style)({
54
+ prop: ["minW", "minWidth"],
55
+ css: "min-width",
56
+ themeGet: import_system.getSize
57
+ });
58
+ const sizing = (0, import_system.compose)(width, maxWidth, height, maxHeight, minHeight, minWidth);
59
+ //# sourceMappingURL=sizing.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/ds-styled/utilities/sizing.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import { style, compose, getSize } from '@xstyled/system';\n\nconst width = style({\n prop: ['width', 'w'],\n css: 'width',\n themeGet: getSize,\n});\n\nconst height = style({\n prop: ['height', 'h'],\n css: 'height',\n themeGet: getSize,\n});\n\nconst maxHeight = style({\n prop: ['maxH', 'maxHeight'],\n css: 'max-height',\n themeGet: getSize,\n});\n\nconst maxWidth = style({\n prop: ['maxW', 'maxWidth'],\n css: 'max-width',\n themeGet: getSize,\n});\n\nconst minHeight = style({\n prop: ['minH', 'minHeight'],\n css: 'min-height',\n themeGet: getSize,\n});\n\nconst minWidth = style({\n prop: ['minW', 'minWidth'],\n css: 'min-width',\n themeGet: getSize,\n});\n\nexport const sizing = compose(width, maxWidth, height, maxHeight, minHeight, minWidth);\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAwC;AAExC,MAAM,QAAQ,yBAAM;AAAA,EAClB,MAAM,CAAC,SAAS,GAAG;AAAA,EACnB,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,SAAS,yBAAM;AAAA,EACnB,MAAM,CAAC,UAAU,GAAG;AAAA,EACpB,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,YAAY,yBAAM;AAAA,EACtB,MAAM,CAAC,QAAQ,WAAW;AAAA,EAC1B,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,WAAW,yBAAM;AAAA,EACrB,MAAM,CAAC,QAAQ,UAAU;AAAA,EACzB,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,YAAY,yBAAM;AAAA,EACtB,MAAM,CAAC,QAAQ,WAAW;AAAA,EAC1B,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,WAAW,yBAAM;AAAA,EACrB,MAAM,CAAC,QAAQ,UAAU;AAAA,EACzB,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAEM,MAAM,SAAS,2BAAQ,OAAO,UAAU,QAAQ,WAAW,WAAW,QAAQ;",
6
+ "names": []
7
+ }
package/dist/cjs/utils.js CHANGED
@@ -22,7 +22,6 @@ var utils_exports = {};
22
22
  __export(utils_exports, {
23
23
  active: () => active,
24
24
  animation: () => animation,
25
- backgroundColorSetter: () => backgroundColorSetter,
26
25
  border: () => border,
27
26
  boxShadow: () => boxShadow,
28
27
  buttonLink: () => buttonLink,
@@ -284,11 +283,4 @@ const safariAndFirefoxBold = (color2) => `
284
283
  -webkit-text-stroke: 0.4px ${color2};
285
284
  }
286
285
  `;
287
- const backgroundColorSetter = import_styled_components2.css`
288
- ${(props) => {
289
- const { bg, backgroundColor } = props;
290
- return bg || backgroundColor ? `background-color: ${import_th.th.color(bg || backgroundColor, bg || backgroundColor)(props)};` : ``;
291
- }}
292
- }
293
- `;
294
286
  //# sourceMappingURL=utils.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/utils.tsx", "../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable no-shadow */\n/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-shadow */\n\n// https://github.com/styled-components/babel-plugin-styled-components/issues/216#issuecomment-516941240\n\nimport type { Theme } from '@elliemae/pui-theme';\nimport { lighten, rgba } from 'polished';\nimport { reduce } from 'lodash';\nimport { Keyframes, FlattenSimpleInterpolation } from 'styled-components';\nimport { css, withTheme, keyframes as kfrm, useTheme } from '@xstyled/styled-components';\nimport { theme } from './theme';\nimport { toMobile } from './mobileUtilities';\nimport { th } from './th';\n\ninterface BackgroundColorSetterT {\n bg?: string;\n backgroundColor?: string;\n}\n\nexport { withTheme, rgba, useTheme, kfrm };\n\ntype PropsWithTheme<T = Record<string, unknown>> = T & { theme: Theme };\n\nexport function truncate(width?: string) {\n return (props: PropsWithTheme<{ width?: string }>) => css`\n ${!!width || props.width ? `width: ${(props.width || width) as string};` : ''}\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n `;\n}\n\nexport function flexCenter(): string {\n return `\n display: flex;\n justify-content: center;\n align-items: center;\n `;\n}\n\nexport function disabled(): string {\n return `\n cursor: not-allowed;\n pointer-events: none;\n `;\n}\n\nexport function keyframes(obj: Record<string, string>): Keyframes {\n return kfrm`${reduce(\n obj,\n (result, value, key) => `\n ${result}\n ${key}% {\n ${value}\n }\n `,\n '',\n )}\n `;\n}\n\n// eslint-disable-next-line max-params\nexport function boxShadow(top: string, left: string, blur: string, color: string, inset = false): string {\n return `box-shadow: ${inset ? 'inset' : ''} ${top} ${left} ${blur} ${color};`;\n}\n\nexport function color(variant = 'neutral', type: string | number = 400) {\n return css`\n color: ${th.color(`${variant}-${type}`)};\n `;\n}\n\nexport function border(color = theme.colors.brand[600], size = '1px', type = 'solid'): string {\n return `${size} ${type} ${color}`;\n}\n\nexport function animation(animationKeyframes: string, animationLength: string, animationTimingFn: string) {\n return (props: { animationKeyframes?: string; animationLength?: string; animationTimingFn?: string }) => css`\n animation: ${props.animationKeyframes || animationKeyframes} ${props.animationLength || animationLength}\n ${props.animationTimingFn || animationTimingFn};\n `;\n}\n// 0.0769\nexport function focus(color: string = theme.colors.brand[600]) {\n return () => css`\n outline: none;\n border: 1px solid ${color};\n box-shadow: inset 0 0 0 1px ${lighten(0.3, color)};\n border-radius: 2px;\n `;\n}\n\nexport function focusAfter(color: string) {\n return css`\n outline: none;\n position: relative;\n &:after {\n content: '';\n z-index: 10;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n ${focus(color)}\n }\n `;\n}\n\nexport function active() {\n return (props: PropsWithTheme) => css`\n outline: none;\n border: 1px solid ${props.theme.colors.brand[700]};\n border-radius: 2px;\n `;\n}\n\nexport function hover() {\n return (props: PropsWithTheme) => css`\n outline: 1px solid ${props.theme.colors.brand[600]};\n outline-offset: -1px;\n `;\n}\n\nexport function textStyle(type: string, weight: keyof Theme['fontWeights'] = 'regular') {\n // eslint-disable-next-line complexity\n return (props: { theme: Theme }): string => {\n let cssVar = `font-weight: ${props.theme.fontWeights[weight]};`;\n // eslint-disable-next-line default-case\n switch (type) {\n case 'h1':\n cssVar += `\n font-size: ${toMobile('2.7692rem')};\n line-height: normal;\n `;\n break;\n case 'h2':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[800])};\n line-height: normal;\n `;\n break;\n case 'h3':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[700])};\n line-height: 1.2;\n `;\n break;\n case 'h4':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[600])};\n line-height: normal;\n `;\n break;\n case 'h5':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[500])};\n line-height: normal;\n `;\n break;\n case 'section-header':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[500])};\n line-height: normal;\n text-transform: uppercase;\n `;\n break;\n case 'body':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[400])};\n line-height: normal;\n `;\n break;\n case 'body-small':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[300])};\n line-height: normal;\n `;\n break;\n case 'body-micro':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.microText[200])};\n line-height: normal;\n `;\n break;\n case 'list':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[400])};\n line-height: normal;\n `;\n break;\n case 'link':\n cssVar += `\n line-height: ${props.theme.space.xl};\n color: ${props.theme.colors.brand[600]};\n cursor: pointer;\n `;\n break;\n }\n return cssVar;\n };\n}\n\nexport function iconColor(variant = 'neutral', type = 400) {\n return css`\n fill: ${th.color(`${variant}-${type}`)};\n `;\n}\n\nexport function fakeBorder() {\n return css`\n box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.neutral[200]};\n border-radius: 2px;\n `;\n}\n\nexport function fakeActive() {\n return css`\n outline: none;\n box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.brand[700]};\n border-radius: 2px;\n `;\n}\n\nexport function clearFocus(): string {\n return `\n border: none;\n box-shadow: none;\n `;\n}\n\nexport function buttonLink(): string {\n return `\n background-color: transparent;\n border: 1px solid transparent;\n cursor: pointer;\n `;\n}\n\nexport function transition(t = 'all 1s ease'): string {\n return `\n transition: ${t};\n `;\n}\n\nexport const onlySafariAndFirefox = (styles: string): FlattenSimpleInterpolation => css`\n @media not all and (min-resolution: 0.001dpcm) {\n ${styles}\n }\n @media screen and (min--moz-device-pixel-ratio: 0) {\n ${styles}\n }\n`;\n\nexport const onlySafari = (styles: string): string => `\n @media not all and (min-resolution: 0.001dpcm) {\n ${styles}\n }\n `;\n\nexport const onlyFirefox = (styles: string): string => `\n @media screen and (min--moz-device-pixel-ratio: 0) {\n ${styles}\n }\n `;\n\nexport const safariAndFirefoxBold = (color: string): string => `\n @media not all and (min-resolution: 0.001dpcm) {\n font-weight: 400;\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-text-stroke: 0.4px ${color};\n }\n @media screen and (min--moz-device-pixel-ratio: 0) {\n font-weight: 400;\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-text-stroke: 0.4px ${color};\n }\n`;\n\nexport const backgroundColorSetter = css<BackgroundColorSetterT>`\n ${(props) => {\n const { bg, backgroundColor } = props;\n return bg || backgroundColor\n ? `background-color: ${th.color((bg || backgroundColor) as string, (bg || backgroundColor) as string)(props)};`\n : ``;\n }}\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADSvB,sBAA8B;AAC9B,oBAAuB;AAEvB,gCAA4D;AAC5D,mBAA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M;AAAA,iBACxB,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAGlC;AAAA;AAEJ,WAAO;AAAA,EACT;AACF;AAEO,mBAAmB,UAAU,WAAW,OAAO,KAAK;AACzD,SAAO;AAAA,YACG,aAAG,MAAM,GAAG,WAAW,MAAM;AAAA;AAEzC;AAEO,sBAAsB;AAC3B,SAAO;AAAA,kCACyB,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAGxE;AAEO,sBAAsB;AAC3B,SAAO;AAAA;AAAA,kCAEyB,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAGtE;AAEO,sBAA8B;AACnC,SAAO;AAAA;AAAA;AAAA;AAIT;AAEO,sBAA8B;AACnC,SAAO;AAAA;AAAA;AAAA;AAAA;AAKT;AAEO,oBAAoB,IAAI,eAAuB;AACpD,SAAO;AAAA,kBACS;AAAA;AAElB;AAEO,MAAM,uBAAuB,CAAC,WAA+C;AAAA;AAAA,MAE9E;AAAA;AAAA;AAAA,MAGA;AAAA;AAAA;AAIC,MAAM,aAAa,CAAC,WAA2B;AAAA;AAAA,QAE9C;AAAA;AAAA;AAID,MAAM,cAAc,CAAC,WAA2B;AAAA;AAAA,QAE/C;AAAA;AAAA;AAID,MAAM,uBAAuB,CAAC,WAA0B;AAAA;AAAA;AAAA;AAAA,iCAI9B;AAAA;AAAA;AAAA;AAAA;AAAA,iCAKA;AAAA;AAAA;AAI1B,MAAM,wBAAwB;AAAA,IACjC,CAAC,UAAU;AACX,QAAM,EAAE,IAAI,oBAAoB;AAChC,SAAO,MAAM,kBACT,qBAAqB,aAAG,MAAO,MAAM,iBAA6B,MAAM,eAA0B,EAAE,KAAK,OACzG;AACN;AAAA;AAAA;",
4
+ "sourcesContent": ["/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable no-shadow */\n/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-shadow */\n\n// https://github.com/styled-components/babel-plugin-styled-components/issues/216#issuecomment-516941240\n\nimport type { Theme } from '@elliemae/pui-theme';\nimport { lighten, rgba } from 'polished';\nimport { reduce } from 'lodash';\nimport { Keyframes, FlattenSimpleInterpolation } from 'styled-components';\nimport { css, withTheme, keyframes as kfrm, useTheme } from '@xstyled/styled-components';\nimport { theme } from './theme';\nimport { toMobile } from './mobileUtilities';\nimport { th } from './th';\n\nexport { withTheme, rgba, useTheme, kfrm };\n\ntype PropsWithTheme<T = Record<string, unknown>> = T & { theme: Theme };\n\nexport function truncate(width?: string) {\n return (props: PropsWithTheme<{ width?: string }>) => css`\n ${!!width || props.width ? `width: ${(props.width || width) as string};` : ''}\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n `;\n}\n\nexport function flexCenter(): string {\n return `\n display: flex;\n justify-content: center;\n align-items: center;\n `;\n}\n\nexport function disabled(): string {\n return `\n cursor: not-allowed;\n pointer-events: none;\n `;\n}\n\nexport function keyframes(obj: Record<string, string>): Keyframes {\n return kfrm`${reduce(\n obj,\n (result, value, key) => `\n ${result}\n ${key}% {\n ${value}\n }\n `,\n '',\n )}\n `;\n}\n\n// eslint-disable-next-line max-params\nexport function boxShadow(top: string, left: string, blur: string, color: string, inset = false): string {\n return `box-shadow: ${inset ? 'inset' : ''} ${top} ${left} ${blur} ${color};`;\n}\n\nexport function color(variant = 'neutral', type: string | number = 400) {\n return css`\n color: ${th.color(`${variant}-${type}`)};\n `;\n}\n\nexport function border(color = theme.colors.brand[600], size = '1px', type = 'solid'): string {\n return `${size} ${type} ${color}`;\n}\n\nexport function animation(animationKeyframes: string, animationLength: string, animationTimingFn: string) {\n return (props: { animationKeyframes?: string; animationLength?: string; animationTimingFn?: string }) => css`\n animation: ${props.animationKeyframes || animationKeyframes} ${props.animationLength || animationLength}\n ${props.animationTimingFn || animationTimingFn};\n `;\n}\n// 0.0769\nexport function focus(color: string = theme.colors.brand[600]) {\n return () => css`\n outline: none;\n border: 1px solid ${color};\n box-shadow: inset 0 0 0 1px ${lighten(0.3, color)};\n border-radius: 2px;\n `;\n}\n\nexport function focusAfter(color: string) {\n return css`\n outline: none;\n position: relative;\n &:after {\n content: '';\n z-index: 10;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n ${focus(color)}\n }\n `;\n}\n\nexport function active() {\n return (props: PropsWithTheme) => css`\n outline: none;\n border: 1px solid ${props.theme.colors.brand[700]};\n border-radius: 2px;\n `;\n}\n\nexport function hover() {\n return (props: PropsWithTheme) => css`\n outline: 1px solid ${props.theme.colors.brand[600]};\n outline-offset: -1px;\n `;\n}\n\nexport function textStyle(type: string, weight: keyof Theme['fontWeights'] = 'regular') {\n // eslint-disable-next-line complexity\n return (props: { theme: Theme }): string => {\n let cssVar = `font-weight: ${props.theme.fontWeights[weight]};`;\n // eslint-disable-next-line default-case\n switch (type) {\n case 'h1':\n cssVar += `\n font-size: ${toMobile('2.7692rem')};\n line-height: normal;\n `;\n break;\n case 'h2':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[800])};\n line-height: normal;\n `;\n break;\n case 'h3':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[700])};\n line-height: 1.2;\n `;\n break;\n case 'h4':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[600])};\n line-height: normal;\n `;\n break;\n case 'h5':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[500])};\n line-height: normal;\n `;\n break;\n case 'section-header':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[500])};\n line-height: normal;\n text-transform: uppercase;\n `;\n break;\n case 'body':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[400])};\n line-height: normal;\n `;\n break;\n case 'body-small':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[300])};\n line-height: normal;\n `;\n break;\n case 'body-micro':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.microText[200])};\n line-height: normal;\n `;\n break;\n case 'list':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[400])};\n line-height: normal;\n `;\n break;\n case 'link':\n cssVar += `\n line-height: ${props.theme.space.xl};\n color: ${props.theme.colors.brand[600]};\n cursor: pointer;\n `;\n break;\n }\n return cssVar;\n };\n}\n\nexport function iconColor(variant = 'neutral', type = 400) {\n return css`\n fill: ${th.color(`${variant}-${type}`)};\n `;\n}\n\nexport function fakeBorder() {\n return css`\n box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.neutral[200]};\n border-radius: 2px;\n `;\n}\n\nexport function fakeActive() {\n return css`\n outline: none;\n box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.brand[700]};\n border-radius: 2px;\n `;\n}\n\nexport function clearFocus(): string {\n return `\n border: none;\n box-shadow: none;\n `;\n}\n\nexport function buttonLink(): string {\n return `\n background-color: transparent;\n border: 1px solid transparent;\n cursor: pointer;\n `;\n}\n\nexport function transition(t = 'all 1s ease'): string {\n return `\n transition: ${t};\n `;\n}\n\nexport const onlySafariAndFirefox = (styles: string): FlattenSimpleInterpolation => css`\n @media not all and (min-resolution: 0.001dpcm) {\n ${styles}\n }\n @media screen and (min--moz-device-pixel-ratio: 0) {\n ${styles}\n }\n`;\n\nexport const onlySafari = (styles: string): string => `\n @media not all and (min-resolution: 0.001dpcm) {\n ${styles}\n }\n `;\n\nexport const onlyFirefox = (styles: string): string => `\n @media screen and (min--moz-device-pixel-ratio: 0) {\n ${styles}\n }\n `;\n\nexport const safariAndFirefoxBold = (color: string): string => `\n @media not all and (min-resolution: 0.001dpcm) {\n font-weight: 400;\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-text-stroke: 0.4px ${color};\n }\n @media screen and (min--moz-device-pixel-ratio: 0) {\n font-weight: 400;\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-text-stroke: 0.4px ${color};\n }\n`;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;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
3
+ import { layout, space, flexboxes, grids, boxShadow } from "@xstyled/system";
4
+ export * from "./utilities/border";
5
+ export * from "./utilities/background";
6
+ export * from "./utilities/sizing";
7
+ export {
8
+ boxShadow as boxShadows,
9
+ flexboxes,
10
+ grids,
11
+ layout,
12
+ space
13
+ };
3
14
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/ds-styled/index.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './styled';\n"],
5
- "mappings": "AAAA;ACAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './styled';\n\nexport { layout, space, flexboxes, grids, boxShadow as boxShadows } from '@xstyled/system';\nexport * from './utilities/border';\nexport * from './utilities/background';\nexport * from './utilities/sizing';\n"],
5
+ "mappings": "AAAA;ACAA;AAEA;AACA;AACA;AACA;",
6
6
  "names": []
7
7
  }
@@ -25,12 +25,10 @@ import {
25
25
  getStyleOverrides,
26
26
  magicCssTransform,
27
27
  getVariantStyles,
28
- height,
29
28
  stylesArgThemeCoercion,
30
- variantsResolver,
31
- width
29
+ variantsResolver
32
30
  } from "./utilities";
33
- const { css, styled: baseStyledComponent, createGlobalStyle } = createCss(compose(system, width, height));
31
+ const { css, styled: baseStyledComponent, createGlobalStyle } = createCss(compose(system));
34
32
  const styledFunction = (tag, options = { name: null, slot: null }) => {
35
33
  const { name: componentName, slot: componentSlot } = options;
36
34
  const defaultStyledResolver = baseStyledComponent(tag);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/ds-styled/styled.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/ban-ts-comment */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/unbound-method */\n/* eslint-disable complexity */\nimport { createCss } from '@xstyled/styled-components';\nimport { system, compose } from '@xstyled/system';\nimport { StyledComponentInnerComponent, StyledComponentPropsWithRef } from 'styled-components';\nimport { DSStyledFunction, DSStyledFunctionInternal, DSStyledObject, PropsWithTheme } from './types';\nimport {\n coerceWithDefaultTheme,\n getStyleOverrides,\n magicCssTransform,\n getVariantStyles,\n height,\n stylesArgThemeCoercion,\n variantsResolver,\n width,\n} from './utilities';\n\nconst { css, styled: baseStyledComponent, createGlobalStyle } = createCss(compose(system, width, height));\n\n// @ts-ignore\nconst styledFunction: DSStyledFunction = (tag, options = { name: null, slot: null }) => {\n const { name: componentName, slot: componentSlot } = options;\n\n const defaultStyledResolver = baseStyledComponent(tag);\n\n const attributes = {\n attrs: defaultStyledResolver.attrs,\n withConfig: defaultStyledResolver.withConfig,\n };\n\n // @ts-ignore\n const dimsumStyledResolver: DSStyledFunctionInternal = (styleArg, ...expressions) => {\n /**\n * Here we apply a CSS transformation to support MAGIC styled components\n */\n\n const [styleArgWithMagic, expressionsWithMagic] = magicCssTransform(styleArg, expressions);\n\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 = expressionsWithMagic ? expressionsWithMagic.map(stylesArgThemeCoercion) : [];\n\n let transformedStyleArg = styleArgWithMagic;\n\n /*\n * Here we get the style overrides from the user\n */\n if (componentName && componentSlot) {\n expressionsWithDefaultTheme.push((props: PropsWithTheme) => {\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: PropsWithTheme) => {\n const theme = coerceWithDefaultTheme(props.theme);\n return variantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);\n });\n }\n\n const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressionsWithMagic.length;\n\n if (Array.isArray(styleArgWithMagic) && numOfCustomFnsApplied > 0) {\n // Here we are adding placeholders for all the new functions that we are gonna call\n const placeholders = new Array(numOfCustomFnsApplied).fill('') as string[];\n transformedStyleArg = Object.assign([...styleArgWithMagic, ...placeholders], {\n raw: [...(styleArgWithMagic as TemplateStringsArray).raw, ...placeholders],\n });\n } else if (typeof styleArgWithMagic === 'function') {\n // Here we just coerce with the default theme\n transformedStyleArg = (props: PropsWithTheme) =>\n styleArgWithMagic({ ...props, theme: coerceWithDefaultTheme(props.theme) });\n }\n\n const displayName = componentName !== null && componentSlot !== null ? `${componentName}-${componentSlot}` : null;\n\n const classNameObject = displayName !== null ? { className: displayName } : {};\n\n const defaultStyledResolverWithClassName = defaultStyledResolver.attrs(\n classNameObject as unknown as Partial<StyledComponentPropsWithRef<StyledComponentInnerComponent<any>>>,\n );\n\n const Component = defaultStyledResolverWithClassName(transformedStyleArg, ...expressionsWithDefaultTheme);\n\n if (displayName !== null) {\n Component.displayName = displayName;\n }\n\n return Component;\n };\n\n return Object.assign(dimsumStyledResolver, attributes);\n};\n\n// Here we create an object with the IntrinsicElements keys pointing to the styledFunction\nconst styledObject = Object.keys(baseStyledComponent).reduce((obj, key) => {\n const castedKey = key as keyof JSX.IntrinsicElements;\n obj[castedKey] = styledFunction(castedKey);\n return obj;\n}, {} as DSStyledObject);\n\nexport const styled = Object.assign(styledFunction, styledObject);\nexport { css, createGlobalStyle };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACMA;AACA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,MAAM,EAAE,KAAK,QAAQ,qBAAqB,sBAAsB,UAAU,QAAQ,QAAQ,OAAO,MAAM,CAAC;AAGxG,MAAM,iBAAmC,CAAC,KAAK,UAAU,EAAE,MAA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MAAM,KAAK,EAAE,EAAC;AAAA,IAC9E;AAEA,UAAM,cAAc,kBAAkB,QAAQ,kBAAkB,OAAO,GAAG,iBAAiB,kBAAkB;AAE7G,UAAM,kBAAkB,gBAAgB,OAAO,EAAE,WAAW,YAAY,IAAI,CAAC;AAE7E,UAAM,qCAAqC,sBAAsB,MAC/D,eACF;AAEA,UAAM,YAAY,mCAAmC,qBAAqB,GAAG,2BAA2B;AAExG,QAAI,gBAAgB,MAAM;AACxB,gBAAU,cAAc;AAAA,IAC1B;AAEA,WAAO;AAAA,EACT;AAEA,SAAO,OAAO,OAAO,sBAAsB,UAAU;AACvD;AAGA,MAAM,eAAe,OAAO,KAAK,mBAAmB,EAAE,OAAO,CAAC,KAAK,QAAQ;AACzE,QAAM,YAAY;AAClB,MAAI,aAAa,eAAe,SAAS;AACzC,SAAO;AACT,GAAG,CAAC,CAAmB;AAEhB,MAAM,SAAS,OAAO,OAAO,gBAAgB,YAAY;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/ban-ts-comment */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/unbound-method */\n/* eslint-disable complexity */\nimport { createCss } from '@xstyled/styled-components';\nimport { system, compose } from '@xstyled/system';\nimport { StyledComponentInnerComponent, StyledComponentPropsWithRef } from 'styled-components';\nimport { DSStyledFunction, DSStyledFunctionInternal, DSStyledObject, PropsWithTheme } from './types';\nimport {\n coerceWithDefaultTheme,\n getStyleOverrides,\n magicCssTransform,\n getVariantStyles,\n stylesArgThemeCoercion,\n variantsResolver,\n} from './utilities';\n\nconst { css, styled: baseStyledComponent, createGlobalStyle } = createCss(compose(system));\n\n// @ts-ignore\nconst styledFunction: DSStyledFunction = (tag, options = { name: null, slot: null }) => {\n const { name: componentName, slot: componentSlot } = options;\n\n const defaultStyledResolver = baseStyledComponent(tag);\n\n const attributes = {\n attrs: defaultStyledResolver.attrs,\n withConfig: defaultStyledResolver.withConfig,\n };\n\n // @ts-ignore\n const dimsumStyledResolver: DSStyledFunctionInternal = (styleArg, ...expressions) => {\n /**\n * Here we apply a CSS transformation to support MAGIC styled components\n */\n\n const [styleArgWithMagic, expressionsWithMagic] = magicCssTransform(styleArg, expressions);\n\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 = expressionsWithMagic ? expressionsWithMagic.map(stylesArgThemeCoercion) : [];\n\n let transformedStyleArg = styleArgWithMagic;\n\n /*\n * Here we get the style overrides from the user\n */\n if (componentName && componentSlot) {\n expressionsWithDefaultTheme.push((props: PropsWithTheme) => {\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: PropsWithTheme) => {\n const theme = coerceWithDefaultTheme(props.theme);\n return variantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);\n });\n }\n\n const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressionsWithMagic.length;\n\n if (Array.isArray(styleArgWithMagic) && numOfCustomFnsApplied > 0) {\n // Here we are adding placeholders for all the new functions that we are gonna call\n const placeholders = new Array(numOfCustomFnsApplied).fill('') as string[];\n transformedStyleArg = Object.assign([...styleArgWithMagic, ...placeholders], {\n raw: [...(styleArgWithMagic as TemplateStringsArray).raw, ...placeholders],\n });\n } else if (typeof styleArgWithMagic === 'function') {\n // Here we just coerce with the default theme\n transformedStyleArg = (props: PropsWithTheme) =>\n styleArgWithMagic({ ...props, theme: coerceWithDefaultTheme(props.theme) });\n }\n\n const displayName = componentName !== null && componentSlot !== null ? `${componentName}-${componentSlot}` : null;\n\n const classNameObject = displayName !== null ? { className: displayName } : {};\n\n const defaultStyledResolverWithClassName = defaultStyledResolver.attrs(\n classNameObject as unknown as Partial<StyledComponentPropsWithRef<StyledComponentInnerComponent<any>>>,\n );\n\n const Component = defaultStyledResolverWithClassName(transformedStyleArg, ...expressionsWithDefaultTheme);\n\n if (displayName !== null) {\n Component.displayName = displayName;\n }\n\n return Component;\n };\n\n return Object.assign(dimsumStyledResolver, attributes);\n};\n\n// Here we create an object with the IntrinsicElements keys pointing to the styledFunction\nconst styledObject = Object.keys(baseStyledComponent).reduce((obj, key) => {\n const castedKey = key as keyof JSX.IntrinsicElements;\n obj[castedKey] = styledFunction(castedKey);\n return obj;\n}, {} as DSStyledObject);\n\nexport const styled = Object.assign(styledFunction, styledObject);\nexport { css, createGlobalStyle };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;ACMA;AACA;AAGA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAM,EAAE,KAAK,QAAQ,qBAAqB,sBAAsB,UAAU,QAAQ,MAAM,CAAC;AAGzF,MAAM,iBAAmC,CAAC,KAAK,UAAU,EAAE,MAAM,MAAM,MAAM,KAAK,MAAM;AACtF,QAAM,EAAE,MAAM,eAAe,MAAM,kBAAkB;AAErD,QAAM,wBAAwB,oBAAoB,GAAG;AAErD,QAAM,aAAa;AAAA,IACjB,OAAO,sBAAsB;AAAA,IAC7B,YAAY,sBAAsB;AAAA,EACpC;AAGA,QAAM,uBAAiD,CAAC,aAAa,gBAAgB;AAKnF,UAAM,CAAC,mBAAmB,wBAAwB,kBAAkB,UAAU,WAAW;AAOzF,UAAM,8BAA8B,uBAAuB,qBAAqB,IAAI,sBAAsB,IAAI,CAAC;AAE/G,QAAI,sBAAsB;AAK1B,QAAI,iBAAiB,eAAe;AAClC,kCAA4B,KAAK,CAAC,UAA0B;AAC1D,cAAM,QAAQ,uBAAuB,MAAM,KAAK;AAChD,cAAM,iBAAiB,kBAAkB,eAAe,KAAK;AAC7D,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T,GAAG,CAAC,CAAmB;AAEhB,MAAM,SAAS,OAAO,OAAO,gBAAgB,YAAY;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ import { style, compose } from "@xstyled/system";
3
+ import { th } from "../../th";
4
+ function bgColorGetter(value) {
5
+ return function(props) {
6
+ return `${th.color(value, value)(props)}`;
7
+ };
8
+ }
9
+ bgColorGetter.meta = {};
10
+ const bg = style({
11
+ prop: ["backgroundColor", "bg"],
12
+ css: "background-color",
13
+ themeGet: bgColorGetter
14
+ });
15
+ const background = compose(bg);
16
+ export {
17
+ background
18
+ };
19
+ //# sourceMappingURL=background.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/ds-styled/utilities/background.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { style, compose } from '@xstyled/system';\nimport { th } from '../../th';\nimport type { GetterProps, ThProps } from '../types';\n\nfunction bgColorGetter(value: string) {\n return function (props: GetterProps): string {\n return `${th.color(value, value)(props as ThProps)}`;\n };\n}\n\nbgColorGetter.meta = {};\n\nconst bg = style({\n prop: ['backgroundColor', 'bg'],\n css: 'background-color',\n themeGet: bgColorGetter,\n});\n\nexport const background = compose(bg);\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AAGA,uBAAuB,OAAe;AACpC,SAAO,SAAU,OAA4B;AAC3C,WAAO,GAAG,GAAG,MAAM,OAAO,KAAK,EAAE,KAAgB;AAAA,EACnD;AACF;AAEA,cAAc,OAAO,CAAC;AAEtB,MAAM,KAAK,MAAM;AAAA,EACf,MAAM,CAAC,mBAAmB,IAAI;AAAA,EAC9B,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAEM,MAAM,aAAa,QAAQ,EAAE;",
6
+ "names": []
7
+ }
@@ -0,0 +1,152 @@
1
+ import * as React from "react";
2
+ import { style, compose } from "@xstyled/system";
3
+ import { th } from "../../th";
4
+ const colorReg = /(?:neutral|brand|success|danger|warning)-[0-9]{3}(?:-a[0-9]{2})?/;
5
+ function borderGetter(value) {
6
+ return function(props) {
7
+ const color = value.match(colorReg);
8
+ let borderCss = ``;
9
+ if (color) {
10
+ const widthAndStyle = value.replace(color[0], "").trim();
11
+ borderCss = `${th.color(color[0])(props)} ${widthAndStyle}`;
12
+ } else {
13
+ borderCss = value;
14
+ }
15
+ return borderCss;
16
+ };
17
+ }
18
+ borderGetter.meta = {};
19
+ function borderColorGetter(value) {
20
+ return function(props) {
21
+ return `${th.color(value, value)(props)}`;
22
+ };
23
+ }
24
+ borderColorGetter.meta = {};
25
+ function borderStyleGetter(value) {
26
+ return function(props) {
27
+ return value;
28
+ };
29
+ }
30
+ borderStyleGetter.meta = {};
31
+ function borderWidthGetter(value) {
32
+ return function(props) {
33
+ return `${th.space(value, value)(props)}`;
34
+ };
35
+ }
36
+ borderWidthGetter.meta = {};
37
+ function borderRadiusGetter(value) {
38
+ return function(props) {
39
+ return `${th.space(value, value)(props)}`;
40
+ };
41
+ }
42
+ borderRadiusGetter.meta = {};
43
+ const border = style({
44
+ prop: "border",
45
+ css: "border",
46
+ themeGet: borderGetter
47
+ });
48
+ const borderTop = style({
49
+ prop: "borderTop",
50
+ css: "border-top",
51
+ themeGet: borderGetter
52
+ });
53
+ const borderBottom = style({
54
+ prop: "borderBottom",
55
+ css: "border-bottom",
56
+ themeGet: borderGetter
57
+ });
58
+ const borderRight = style({
59
+ prop: "borderRight",
60
+ css: "border-right",
61
+ themeGet: borderGetter
62
+ });
63
+ const borderLeft = style({
64
+ prop: "borderLeft",
65
+ css: "border-left",
66
+ themeGet: borderGetter
67
+ });
68
+ const borderColor = style({
69
+ prop: "borderColor",
70
+ css: "border-color",
71
+ themeGet: borderColorGetter
72
+ });
73
+ const borderTopColor = style({
74
+ prop: "borderTopColor",
75
+ css: "border-top-color",
76
+ themeGet: borderColorGetter
77
+ });
78
+ const borderBottomColor = style({
79
+ prop: "borderBottomColor",
80
+ css: "border-bottom-color",
81
+ themeGet: borderColorGetter
82
+ });
83
+ const borderRightColor = style({
84
+ prop: "borderRightColor",
85
+ css: "border-right-color",
86
+ themeGet: borderColorGetter
87
+ });
88
+ const borderLeftColor = style({
89
+ prop: "borderLeftColor",
90
+ css: "border-left-color",
91
+ themeGet: borderColorGetter
92
+ });
93
+ const borderStyle = style({
94
+ prop: "borderStyle",
95
+ css: "border-style",
96
+ themeGet: borderStyleGetter
97
+ });
98
+ const borderTopStyle = style({
99
+ prop: "borderTopStyle",
100
+ css: "border-top-style",
101
+ themeGet: borderStyleGetter
102
+ });
103
+ const borderBottomStyle = style({
104
+ prop: "borderBottomStyle",
105
+ css: "border-bottom-style",
106
+ themeGet: borderStyleGetter
107
+ });
108
+ const borderRightStyle = style({
109
+ prop: "borderRightStyle",
110
+ css: "border-right-style",
111
+ themeGet: borderStyleGetter
112
+ });
113
+ const borderLeftStyle = style({
114
+ prop: "borderLeftStyle",
115
+ css: "border-left-style",
116
+ themeGet: borderStyleGetter
117
+ });
118
+ const borderWidth = style({
119
+ prop: "borderWidth",
120
+ css: "border-width",
121
+ themeGet: borderWidthGetter
122
+ });
123
+ const borderTopWidth = style({
124
+ prop: "borderTopWidth",
125
+ css: "border-top-width",
126
+ themeGet: borderWidthGetter
127
+ });
128
+ const borderBottomWidth = style({
129
+ prop: "borderBottomWidth",
130
+ css: "border-bottom-width",
131
+ themeGet: borderWidthGetter
132
+ });
133
+ const borderRightWidth = style({
134
+ prop: "borderRightWidth",
135
+ css: "border-right-width",
136
+ themeGet: borderWidthGetter
137
+ });
138
+ const borderLeftWidth = style({
139
+ prop: "borderLeftWidth",
140
+ css: "border-left-width",
141
+ themeGet: borderWidthGetter
142
+ });
143
+ const borderRadius = style({
144
+ prop: "borderRadius",
145
+ css: "border-radius",
146
+ themeGet: borderRadiusGetter
147
+ });
148
+ const borders = compose(border, borderTop, borderBottom, borderLeft, borderRight, borderColor, borderTopColor, borderBottomColor, borderLeftColor, borderRightColor, borderStyle, borderTopStyle, borderBottomStyle, borderLeftStyle, borderRightStyle, borderWidth, borderTopWidth, borderBottomWidth, borderLeftWidth, borderRightWidth, borderRadius);
149
+ export {
150
+ borders
151
+ };
152
+ //# sourceMappingURL=border.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/ds-styled/utilities/border.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { style, compose } from '@xstyled/system';\nimport { th } from '../../th';\nimport type { GetterProps, ThProps } from '../types';\n\nconst colorReg = /(?:neutral|brand|success|danger|warning)-[0-9]{3}(?:-a[0-9]{2})?/;\n\nfunction borderGetter(value: string) {\n return function (props: GetterProps): 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 ThProps)} ${widthAndStyle}`;\n } else {\n borderCss = value;\n }\n\n return borderCss;\n };\n}\n\nborderGetter.meta = {};\n\nfunction borderColorGetter(value: string) {\n return function (props: GetterProps): string {\n return `${th.color(value, value)(props as ThProps)}`;\n };\n}\n\nborderColorGetter.meta = {};\n\nfunction borderStyleGetter(value: string) {\n return function (props: GetterProps): string {\n return value;\n };\n}\n\nborderStyleGetter.meta = {};\n\nfunction borderWidthGetter(value: string) {\n return function (props: GetterProps): string {\n return `${th.space(value, value)(props as ThProps)}`;\n };\n}\n\nborderWidthGetter.meta = {};\n\nfunction borderRadiusGetter(value: string) {\n return function (props: GetterProps): string {\n return `${th.space(value, value)(props as ThProps)}`;\n };\n}\n\nborderRadiusGetter.meta = {};\n\nconst border = style({\n prop: 'border',\n css: 'border',\n themeGet: borderGetter,\n});\n\nconst borderTop = style({\n prop: 'borderTop',\n css: 'border-top',\n themeGet: borderGetter,\n});\n\nconst borderBottom = style({\n prop: 'borderBottom',\n css: 'border-bottom',\n themeGet: borderGetter,\n});\n\nconst borderRight = style({\n prop: 'borderRight',\n css: 'border-right',\n themeGet: borderGetter,\n});\n\nconst borderLeft = style({\n prop: 'borderLeft',\n css: 'border-left',\n themeGet: borderGetter,\n});\n\nconst borderColor = style({\n prop: 'borderColor',\n css: 'border-color',\n themeGet: borderColorGetter,\n});\n\nconst borderTopColor = style({\n prop: 'borderTopColor',\n css: 'border-top-color',\n themeGet: borderColorGetter,\n});\n\nconst borderBottomColor = style({\n prop: 'borderBottomColor',\n css: 'border-bottom-color',\n themeGet: borderColorGetter,\n});\n\nconst borderRightColor = style({\n prop: 'borderRightColor',\n css: 'border-right-color',\n themeGet: borderColorGetter,\n});\n\nconst borderLeftColor = style({\n prop: 'borderLeftColor',\n css: 'border-left-color',\n themeGet: borderColorGetter,\n});\n\nconst borderStyle = style({\n prop: 'borderStyle',\n css: 'border-style',\n themeGet: borderStyleGetter,\n});\n\nconst borderTopStyle = style({\n prop: 'borderTopStyle',\n css: 'border-top-style',\n themeGet: borderStyleGetter,\n});\n\nconst borderBottomStyle = style({\n prop: 'borderBottomStyle',\n css: 'border-bottom-style',\n themeGet: borderStyleGetter,\n});\n\nconst borderRightStyle = style({\n prop: 'borderRightStyle',\n css: 'border-right-style',\n themeGet: borderStyleGetter,\n});\n\nconst borderLeftStyle = style({\n prop: 'borderLeftStyle',\n css: 'border-left-style',\n themeGet: borderStyleGetter,\n});\n\nconst borderWidth = style({\n prop: 'borderWidth',\n css: 'border-width',\n themeGet: borderWidthGetter,\n});\n\nconst borderTopWidth = style({\n prop: 'borderTopWidth',\n css: 'border-top-width',\n themeGet: borderWidthGetter,\n});\n\nconst borderBottomWidth = style({\n prop: 'borderBottomWidth',\n css: 'border-bottom-width',\n themeGet: borderWidthGetter,\n});\n\nconst borderRightWidth = style({\n prop: 'borderRightWidth',\n css: 'border-right-width',\n themeGet: borderWidthGetter,\n});\n\nconst borderLeftWidth = style({\n prop: 'borderLeftWidth',\n css: 'border-left-width',\n themeGet: borderWidthGetter,\n});\n\nconst borderRadius = style({\n prop: 'borderRadius',\n css: 'border-radius',\n themeGet: borderRadiusGetter,\n});\n\nexport const borders = compose(\n border,\n borderTop,\n borderBottom,\n borderLeft,\n borderRight,\n borderColor,\n borderTopColor,\n borderBottomColor,\n borderLeftColor,\n borderRightColor,\n borderStyle,\n borderTopStyle,\n borderBottomStyle,\n borderLeftStyle,\n borderRightStyle,\n borderWidth,\n borderTopWidth,\n borderBottomWidth,\n borderLeftWidth,\n borderRightWidth,\n borderRadius,\n);\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AAGA,MAAM,WAAW;AAEjB,sBAAsB,OAAe;AACnC,SAAO,SAAU,OAA4B;AAC3C,UAAM,QAAQ,MAAM,MAAM,QAAQ;AAClC,QAAI,YAAY;AAEhB,QAAI,OAAO;AACT,YAAM,gBAAgB,MAAM,QAAQ,MAAM,IAAI,EAAE,EAAE,KAAK;AACvD,kBAAY,GAAG,GAAG,MAAM,MAAM,EAAE,EAAE,KAAgB,KAAK;AAAA,IACzD,OAAO;AACL,kBAAY;AAAA,IACd;AAEA,WAAO;AAAA,EACT;AACF;AAEA,aAAa,OAAO,CAAC;AAErB,2BAA2B,OAAe;AACxC,SAAO,SAAU,OAA4B;AAC3C,WAAO,GAAG,GAAG,MAAM,OAAO,KAAK,EAAE,KAAgB;AAAA,EACnD;AACF;AAEA,kBAAkB,OAAO,CAAC;AAE1B,2BAA2B,OAAe;AACxC,SAAO,SAAU,OAA4B;AAC3C,WAAO;AAAA,EACT;AACF;AAEA,kBAAkB,OAAO,CAAC;AAE1B,2BAA2B,OAAe;AACxC,SAAO,SAAU,OAA4B;AAC3C,WAAO,GAAG,GAAG,MAAM,OAAO,KAAK,EAAE,KAAgB;AAAA,EACnD;AACF;AAEA,kBAAkB,OAAO,CAAC;AAE1B,4BAA4B,OAAe;AACzC,SAAO,SAAU,OAA4B;AAC3C,WAAO,GAAG,GAAG,MAAM,OAAO,KAAK,EAAE,KAAgB;AAAA,EACnD;AACF;AAEA,mBAAmB,OAAO,CAAC;AAE3B,MAA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ED,MAAM,kBAAkB,MAAM;AAAA,EAC5B,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,cAAc,MAAM;AAAA,EACxB,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,iBAAiB,MAAM;AAAA,EAC3B,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,oBAAoB,MAAM;AAAA,EAC9B,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,mBAAmB,MAAM;AAAA,EAC7B,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,kBAAkB,MAAM;AAAA,EAC5B,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,eAAe,MAAM;AAAA,EACzB,MAAM;AAAA,EACN,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAEM,MAAM,UAAU,QACrB,QACA,WACA,cACA,YACA,aACA,aACA,gBACA,mBACA,iBACA,kBACA,aACA,gBACA,mBACA,iBACA,kBACA,aACA,gBACA,mBACA,iBACA,kBACA,YACF;",
6
+ "names": []
7
+ }
@@ -1,7 +1,8 @@
1
1
  import * as React from "react";
2
2
  export * from "./magicCssTransform";
3
- export * from "./height";
4
3
  export * from "./resolvers";
5
4
  export * from "./helpers";
6
- export * from "./width";
5
+ export * from "./sizing";
6
+ export * from "./border";
7
+ export * from "./background";
7
8
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/ds-styled/utilities/index.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './magicCssTransform';\nexport * from './height';\nexport * from './resolvers';\nexport * from './helpers';\nexport * from './width';\n"],
5
- "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './magicCssTransform';\nexport * from './resolvers';\nexport * from './helpers';\nexport * from './sizing';\nexport * from './border';\nexport * from './background';\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;",
6
6
  "names": []
7
7
  }
@@ -0,0 +1,37 @@
1
+ import * as React from "react";
2
+ import { style, compose, getSize } from "@xstyled/system";
3
+ const width = style({
4
+ prop: ["width", "w"],
5
+ css: "width",
6
+ themeGet: getSize
7
+ });
8
+ const height = style({
9
+ prop: ["height", "h"],
10
+ css: "height",
11
+ themeGet: getSize
12
+ });
13
+ const maxHeight = style({
14
+ prop: ["maxH", "maxHeight"],
15
+ css: "max-height",
16
+ themeGet: getSize
17
+ });
18
+ const maxWidth = style({
19
+ prop: ["maxW", "maxWidth"],
20
+ css: "max-width",
21
+ themeGet: getSize
22
+ });
23
+ const minHeight = style({
24
+ prop: ["minH", "minHeight"],
25
+ css: "min-height",
26
+ themeGet: getSize
27
+ });
28
+ const minWidth = style({
29
+ prop: ["minW", "minWidth"],
30
+ css: "min-width",
31
+ themeGet: getSize
32
+ });
33
+ const sizing = compose(width, maxWidth, height, maxHeight, minHeight, minWidth);
34
+ export {
35
+ sizing
36
+ };
37
+ //# sourceMappingURL=sizing.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/ds-styled/utilities/sizing.ts"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { style, compose, getSize } from '@xstyled/system';\n\nconst width = style({\n prop: ['width', 'w'],\n css: 'width',\n themeGet: getSize,\n});\n\nconst height = style({\n prop: ['height', 'h'],\n css: 'height',\n themeGet: getSize,\n});\n\nconst maxHeight = style({\n prop: ['maxH', 'maxHeight'],\n css: 'max-height',\n themeGet: getSize,\n});\n\nconst maxWidth = style({\n prop: ['maxW', 'maxWidth'],\n css: 'max-width',\n themeGet: getSize,\n});\n\nconst minHeight = style({\n prop: ['minH', 'minHeight'],\n css: 'min-height',\n themeGet: getSize,\n});\n\nconst minWidth = style({\n prop: ['minW', 'minWidth'],\n css: 'min-width',\n themeGet: getSize,\n});\n\nexport const sizing = compose(width, maxWidth, height, maxHeight, minHeight, minWidth);\n"],
5
+ "mappings": "AAAA;ACAA;AAEA,MAAM,QAAQ,MAAM;AAAA,EAClB,MAAM,CAAC,SAAS,GAAG;AAAA,EACnB,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,SAAS,MAAM;AAAA,EACnB,MAAM,CAAC,UAAU,GAAG;AAAA,EACpB,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,YAAY,MAAM;AAAA,EACtB,MAAM,CAAC,QAAQ,WAAW;AAAA,EAC1B,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,WAAW,MAAM;AAAA,EACrB,MAAM,CAAC,QAAQ,UAAU;AAAA,EACzB,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,YAAY,MAAM;AAAA,EACtB,MAAM,CAAC,QAAQ,WAAW;AAAA,EAC1B,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAED,MAAM,WAAW,MAAM;AAAA,EACrB,MAAM,CAAC,QAAQ,UAAU;AAAA,EACzB,KAAK;AAAA,EACL,UAAU;AACZ,CAAC;AAEM,MAAM,SAAS,QAAQ,OAAO,UAAU,QAAQ,WAAW,WAAW,QAAQ;",
6
+ "names": []
7
+ }
package/dist/esm/utils.js CHANGED
@@ -232,17 +232,9 @@ const safariAndFirefoxBold = (color2) => `
232
232
  -webkit-text-stroke: 0.4px ${color2};
233
233
  }
234
234
  `;
235
- const backgroundColorSetter = css`
236
- ${(props) => {
237
- const { bg, backgroundColor } = props;
238
- return bg || backgroundColor ? `background-color: ${th.color(bg || backgroundColor, bg || backgroundColor)(props)};` : ``;
239
- }}
240
- }
241
- `;
242
235
  export {
243
236
  active,
244
237
  animation,
245
- backgroundColorSetter,
246
238
  border,
247
239
  boxShadow,
248
240
  buttonLink,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/utils.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable no-shadow */\n/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-shadow */\n\n// https://github.com/styled-components/babel-plugin-styled-components/issues/216#issuecomment-516941240\n\nimport type { Theme } from '@elliemae/pui-theme';\nimport { lighten, rgba } from 'polished';\nimport { reduce } from 'lodash';\nimport { Keyframes, FlattenSimpleInterpolation } from 'styled-components';\nimport { css, withTheme, keyframes as kfrm, useTheme } from '@xstyled/styled-components';\nimport { theme } from './theme';\nimport { toMobile } from './mobileUtilities';\nimport { th } from './th';\n\ninterface BackgroundColorSetterT {\n bg?: string;\n backgroundColor?: string;\n}\n\nexport { withTheme, rgba, useTheme, kfrm };\n\ntype PropsWithTheme<T = Record<string, unknown>> = T & { theme: Theme };\n\nexport function truncate(width?: string) {\n return (props: PropsWithTheme<{ width?: string }>) => css`\n ${!!width || props.width ? `width: ${(props.width || width) as string};` : ''}\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n `;\n}\n\nexport function flexCenter(): string {\n return `\n display: flex;\n justify-content: center;\n align-items: center;\n `;\n}\n\nexport function disabled(): string {\n return `\n cursor: not-allowed;\n pointer-events: none;\n `;\n}\n\nexport function keyframes(obj: Record<string, string>): Keyframes {\n return kfrm`${reduce(\n obj,\n (result, value, key) => `\n ${result}\n ${key}% {\n ${value}\n }\n `,\n '',\n )}\n `;\n}\n\n// eslint-disable-next-line max-params\nexport function boxShadow(top: string, left: string, blur: string, color: string, inset = false): string {\n return `box-shadow: ${inset ? 'inset' : ''} ${top} ${left} ${blur} ${color};`;\n}\n\nexport function color(variant = 'neutral', type: string | number = 400) {\n return css`\n color: ${th.color(`${variant}-${type}`)};\n `;\n}\n\nexport function border(color = theme.colors.brand[600], size = '1px', type = 'solid'): string {\n return `${size} ${type} ${color}`;\n}\n\nexport function animation(animationKeyframes: string, animationLength: string, animationTimingFn: string) {\n return (props: { animationKeyframes?: string; animationLength?: string; animationTimingFn?: string }) => css`\n animation: ${props.animationKeyframes || animationKeyframes} ${props.animationLength || animationLength}\n ${props.animationTimingFn || animationTimingFn};\n `;\n}\n// 0.0769\nexport function focus(color: string = theme.colors.brand[600]) {\n return () => css`\n outline: none;\n border: 1px solid ${color};\n box-shadow: inset 0 0 0 1px ${lighten(0.3, color)};\n border-radius: 2px;\n `;\n}\n\nexport function focusAfter(color: string) {\n return css`\n outline: none;\n position: relative;\n &:after {\n content: '';\n z-index: 10;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n ${focus(color)}\n }\n `;\n}\n\nexport function active() {\n return (props: PropsWithTheme) => css`\n outline: none;\n border: 1px solid ${props.theme.colors.brand[700]};\n border-radius: 2px;\n `;\n}\n\nexport function hover() {\n return (props: PropsWithTheme) => css`\n outline: 1px solid ${props.theme.colors.brand[600]};\n outline-offset: -1px;\n `;\n}\n\nexport function textStyle(type: string, weight: keyof Theme['fontWeights'] = 'regular') {\n // eslint-disable-next-line complexity\n return (props: { theme: Theme }): string => {\n let cssVar = `font-weight: ${props.theme.fontWeights[weight]};`;\n // eslint-disable-next-line default-case\n switch (type) {\n case 'h1':\n cssVar += `\n font-size: ${toMobile('2.7692rem')};\n line-height: normal;\n `;\n break;\n case 'h2':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[800])};\n line-height: normal;\n `;\n break;\n case 'h3':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[700])};\n line-height: 1.2;\n `;\n break;\n case 'h4':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[600])};\n line-height: normal;\n `;\n break;\n case 'h5':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[500])};\n line-height: normal;\n `;\n break;\n case 'section-header':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[500])};\n line-height: normal;\n text-transform: uppercase;\n `;\n break;\n case 'body':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[400])};\n line-height: normal;\n `;\n break;\n case 'body-small':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[300])};\n line-height: normal;\n `;\n break;\n case 'body-micro':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.microText[200])};\n line-height: normal;\n `;\n break;\n case 'list':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[400])};\n line-height: normal;\n `;\n break;\n case 'link':\n cssVar += `\n line-height: ${props.theme.space.xl};\n color: ${props.theme.colors.brand[600]};\n cursor: pointer;\n `;\n break;\n }\n return cssVar;\n };\n}\n\nexport function iconColor(variant = 'neutral', type = 400) {\n return css`\n fill: ${th.color(`${variant}-${type}`)};\n `;\n}\n\nexport function fakeBorder() {\n return css`\n box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.neutral[200]};\n border-radius: 2px;\n `;\n}\n\nexport function fakeActive() {\n return css`\n outline: none;\n box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.brand[700]};\n border-radius: 2px;\n `;\n}\n\nexport function clearFocus(): string {\n return `\n border: none;\n box-shadow: none;\n `;\n}\n\nexport function buttonLink(): string {\n return `\n background-color: transparent;\n border: 1px solid transparent;\n cursor: pointer;\n `;\n}\n\nexport function transition(t = 'all 1s ease'): string {\n return `\n transition: ${t};\n `;\n}\n\nexport const onlySafariAndFirefox = (styles: string): FlattenSimpleInterpolation => css`\n @media not all and (min-resolution: 0.001dpcm) {\n ${styles}\n }\n @media screen and (min--moz-device-pixel-ratio: 0) {\n ${styles}\n }\n`;\n\nexport const onlySafari = (styles: string): string => `\n @media not all and (min-resolution: 0.001dpcm) {\n ${styles}\n }\n `;\n\nexport const onlyFirefox = (styles: string): string => `\n @media screen and (min--moz-device-pixel-ratio: 0) {\n ${styles}\n }\n `;\n\nexport const safariAndFirefoxBold = (color: string): string => `\n @media not all and (min-resolution: 0.001dpcm) {\n font-weight: 400;\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-text-stroke: 0.4px ${color};\n }\n @media screen and (min--moz-device-pixel-ratio: 0) {\n font-weight: 400;\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-text-stroke: 0.4px ${color};\n }\n`;\n\nexport const backgroundColorSetter = css<BackgroundColorSetterT>`\n ${(props) => {\n const { bg, backgroundColor } = props;\n return bg || backgroundColor\n ? `background-color: ${th.color((bg || backgroundColor) as string, (bg || backgroundColor) as string)(props)};`\n : ``;\n }}\n }\n`;\n"],
5
- "mappings": "AAAA;ACSA;AACA;AAEA;AACA;AACA;AACA;AAWO,kBAAkB,OAAgB;AACvC,SAAO,CAAC,UAA8C;AAAA,MAClD,CAAC,CAAC,SAAS,MAAM,QAAQ,UAAW,MAAM,SAAS,WAAsB;AAAA;AAAA;AAAA;AAAA;AAK/E;AAEO,sBAA8B;AACnC,SAAO;AAAA;AAAA;AAAA;AAAA;AAKT;AAEO,oBAA4B;AACjC,SAAO;AAAA;AAAA;AAAA;AAIT;AAEO,mBAAmB,KAAwC;AAChE,SAAO,OAAO,OACZ,KACA,CAAC,QAAQ,OAAO,QAAQ;AAAA,MACtB;AAAA,MACA;AAAA,QACE;AAAA;AAAA,KAGJ,EACF;AAAA;AAEF;AAGO,mBAAmB,KAAa,MAAc,MAAc,QAAe,QAAQ,OAAe;AACvG,SAAO,eAAe,QAAQ,UAAU,MAAM,OAAO,QAAQ,QAAQ;AACvE;AAEO,eAAe,UAAU,WAAW,OAAwB,KAAK;AACtE,SAAO;AAAA,aACI,GAAG,MAAM,GAAG,WAAW,MAAM;AAAA;AAE1C;AAEO,gBAAgB,SAAQ,MAAM,OAAO,MAAM,MAAM,OAAO,OAAO,OAAO,SAAiB;AAC5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A2B;AAAA;AAAA,QAE/C;AAAA;AAAA;AAID,MAAM,uBAAuB,CAAC,WAA0B;AAAA;AAAA;AAAA;AAAA,iCAI9B;AAAA;AAAA;AAAA;AAAA;AAAA,iCAKA;AAAA;AAAA;AAI1B,MAAM,wBAAwB;AAAA,IACjC,CAAC,UAAU;AACX,QAAM,EAAE,IAAI,oBAAoB;AAChC,SAAO,MAAM,kBACT,qBAAqB,GAAG,MAAO,MAAM,iBAA6B,MAAM,eAA0B,EAAE,KAAK,OACzG;AACN;AAAA;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-return */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable no-shadow */\n/* eslint-disable max-lines */\n/* eslint-disable @typescript-eslint/no-shadow */\n\n// https://github.com/styled-components/babel-plugin-styled-components/issues/216#issuecomment-516941240\n\nimport type { Theme } from '@elliemae/pui-theme';\nimport { lighten, rgba } from 'polished';\nimport { reduce } from 'lodash';\nimport { Keyframes, FlattenSimpleInterpolation } from 'styled-components';\nimport { css, withTheme, keyframes as kfrm, useTheme } from '@xstyled/styled-components';\nimport { theme } from './theme';\nimport { toMobile } from './mobileUtilities';\nimport { th } from './th';\n\nexport { withTheme, rgba, useTheme, kfrm };\n\ntype PropsWithTheme<T = Record<string, unknown>> = T & { theme: Theme };\n\nexport function truncate(width?: string) {\n return (props: PropsWithTheme<{ width?: string }>) => css`\n ${!!width || props.width ? `width: ${(props.width || width) as string};` : ''}\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n `;\n}\n\nexport function flexCenter(): string {\n return `\n display: flex;\n justify-content: center;\n align-items: center;\n `;\n}\n\nexport function disabled(): string {\n return `\n cursor: not-allowed;\n pointer-events: none;\n `;\n}\n\nexport function keyframes(obj: Record<string, string>): Keyframes {\n return kfrm`${reduce(\n obj,\n (result, value, key) => `\n ${result}\n ${key}% {\n ${value}\n }\n `,\n '',\n )}\n `;\n}\n\n// eslint-disable-next-line max-params\nexport function boxShadow(top: string, left: string, blur: string, color: string, inset = false): string {\n return `box-shadow: ${inset ? 'inset' : ''} ${top} ${left} ${blur} ${color};`;\n}\n\nexport function color(variant = 'neutral', type: string | number = 400) {\n return css`\n color: ${th.color(`${variant}-${type}`)};\n `;\n}\n\nexport function border(color = theme.colors.brand[600], size = '1px', type = 'solid'): string {\n return `${size} ${type} ${color}`;\n}\n\nexport function animation(animationKeyframes: string, animationLength: string, animationTimingFn: string) {\n return (props: { animationKeyframes?: string; animationLength?: string; animationTimingFn?: string }) => css`\n animation: ${props.animationKeyframes || animationKeyframes} ${props.animationLength || animationLength}\n ${props.animationTimingFn || animationTimingFn};\n `;\n}\n// 0.0769\nexport function focus(color: string = theme.colors.brand[600]) {\n return () => css`\n outline: none;\n border: 1px solid ${color};\n box-shadow: inset 0 0 0 1px ${lighten(0.3, color)};\n border-radius: 2px;\n `;\n}\n\nexport function focusAfter(color: string) {\n return css`\n outline: none;\n position: relative;\n &:after {\n content: '';\n z-index: 10;\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n ${focus(color)}\n }\n `;\n}\n\nexport function active() {\n return (props: PropsWithTheme) => css`\n outline: none;\n border: 1px solid ${props.theme.colors.brand[700]};\n border-radius: 2px;\n `;\n}\n\nexport function hover() {\n return (props: PropsWithTheme) => css`\n outline: 1px solid ${props.theme.colors.brand[600]};\n outline-offset: -1px;\n `;\n}\n\nexport function textStyle(type: string, weight: keyof Theme['fontWeights'] = 'regular') {\n // eslint-disable-next-line complexity\n return (props: { theme: Theme }): string => {\n let cssVar = `font-weight: ${props.theme.fontWeights[weight]};`;\n // eslint-disable-next-line default-case\n switch (type) {\n case 'h1':\n cssVar += `\n font-size: ${toMobile('2.7692rem')};\n line-height: normal;\n `;\n break;\n case 'h2':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[800])};\n line-height: normal;\n `;\n break;\n case 'h3':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[700])};\n line-height: 1.2;\n `;\n break;\n case 'h4':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[600])};\n line-height: normal;\n `;\n break;\n case 'h5':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[500])};\n line-height: normal;\n `;\n break;\n case 'section-header':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.title[500])};\n line-height: normal;\n text-transform: uppercase;\n `;\n break;\n case 'body':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[400])};\n line-height: normal;\n `;\n break;\n case 'body-small':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[300])};\n line-height: normal;\n `;\n break;\n case 'body-micro':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.microText[200])};\n line-height: normal;\n `;\n break;\n case 'list':\n cssVar += `\n font-size: ${toMobile(props.theme.fontSizes.value[400])};\n line-height: normal;\n `;\n break;\n case 'link':\n cssVar += `\n line-height: ${props.theme.space.xl};\n color: ${props.theme.colors.brand[600]};\n cursor: pointer;\n `;\n break;\n }\n return cssVar;\n };\n}\n\nexport function iconColor(variant = 'neutral', type = 400) {\n return css`\n fill: ${th.color(`${variant}-${type}`)};\n `;\n}\n\nexport function fakeBorder() {\n return css`\n box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.neutral[200]};\n border-radius: 2px;\n `;\n}\n\nexport function fakeActive() {\n return css`\n outline: none;\n box-shadow: inset 0 0 0 1px ${(props) => props.theme.colors.brand[700]};\n border-radius: 2px;\n `;\n}\n\nexport function clearFocus(): string {\n return `\n border: none;\n box-shadow: none;\n `;\n}\n\nexport function buttonLink(): string {\n return `\n background-color: transparent;\n border: 1px solid transparent;\n cursor: pointer;\n `;\n}\n\nexport function transition(t = 'all 1s ease'): string {\n return `\n transition: ${t};\n `;\n}\n\nexport const onlySafariAndFirefox = (styles: string): FlattenSimpleInterpolation => css`\n @media not all and (min-resolution: 0.001dpcm) {\n ${styles}\n }\n @media screen and (min--moz-device-pixel-ratio: 0) {\n ${styles}\n }\n`;\n\nexport const onlySafari = (styles: string): string => `\n @media not all and (min-resolution: 0.001dpcm) {\n ${styles}\n }\n `;\n\nexport const onlyFirefox = (styles: string): string => `\n @media screen and (min--moz-device-pixel-ratio: 0) {\n ${styles}\n }\n `;\n\nexport const safariAndFirefoxBold = (color: string): string => `\n @media not all and (min-resolution: 0.001dpcm) {\n font-weight: 400;\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-text-stroke: 0.4px ${color};\n }\n @media screen and (min--moz-device-pixel-ratio: 0) {\n font-weight: 400;\n -webkit-font-smoothing: subpixel-antialiased;\n -webkit-text-stroke: 0.4px ${color};\n }\n`;\n"],
5
+ "mappings": "AAAA;ACSA;AACA;AAEA;AACA;AACA;AACA;AAMO,kBAAkB,OAAgB;AACvC,SAAO,CAAC,UAA8C;AAAA,MAClD,CAAC,CAAC,SAAS,MAAM,QAAQ,UAAW,MAAM,SAAS,WAAsB;AAAA;AAAA;AAAA;AAAA;AAK/E;AAEO,sBAA8B;AACnC,SAAO;AAAA;AAAA;AAAA;AAAA;AAKT;AAEO,oBAA4B;AACjC,SAAO;AAAA;AAAA;AAAA;AAIT;AAEO,mBAAmB,KAAwC;AAChE,SAAO,OAAO,OACZ,KACA,CAAC,QAAQ,OAAO,QAAQ;AAAA,MACtB;AAAA,MACA;AAAA,QACE;AAAA;AAAA,KAGJ,EACF;AAAA;AAEF;AAGO,mBAAmB,KAAa,MAAc,MAAc,QAAe,QAAQ,OAAe;AACvG,SAAO,eAAe,QAAQ,UAAU,MAAM,OAAO,QAAQ,QAAQ;AACvE;AAEO,eAAe,UAAU,WAAW,OAAwB,KAAK;AACtE,SAAO;AAAA,aACI,GAAG,MAAM,GAAG,WAAW,MAAM;AAAA;AAE1C;AAEO,gBAAgB,SAAQ,MAAM,OAAO,MAAM,MAAM,OAAO,OAAO,OAAO,SAAiB;AAC5F,SAAO,GAAG,QAAQ,QAAQ;AAC5B;A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AID,MAAM,uBAAuB,CAAC,WAA0B;AAAA;AAAA;AAAA;AAAA,iCAI9B;AAAA;AAAA;AAAA;AAAA;AAAA,iCAKA;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-system",
3
- "version": "3.0.0-next.64",
3
+ "version": "3.0.0-next.67",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - System",
6
6
  "files": [
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/ds-styled/utilities/height.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { style } from '@xstyled/system';\n\nexport const height = style({\n prop: ['height', 'h'],\n css: 'height',\n});\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAsB;AAEf,MAAM,SAAS,yBAAM;AAAA,EAC1B,MAAM,CAAC,UAAU,GAAG;AAAA,EACpB,KAAK;AACP,CAAC;",
6
- "names": []
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/ds-styled/utilities/width.ts", "../../../../../../scripts/build/transpile/react-shim.js"],
4
- "sourcesContent": ["import { style } from '@xstyled/system';\n\nexport const width = style({\n prop: ['width', 'w'],\n css: 'width',\n});\n", "import * as React from 'react';\nexport { React };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,oBAAsB;AAEf,MAAM,QAAQ,yBAAM;AAAA,EACzB,MAAM,CAAC,SAAS,GAAG;AAAA,EACnB,KAAK;AACP,CAAC;",
6
- "names": []
7
- }
@@ -1,10 +0,0 @@
1
- import * as React from "react";
2
- import { style } from "@xstyled/system";
3
- const height = style({
4
- prop: ["height", "h"],
5
- css: "height"
6
- });
7
- export {
8
- height
9
- };
10
- //# sourceMappingURL=height.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/ds-styled/utilities/height.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { style } from '@xstyled/system';\n\nexport const height = style({\n prop: ['height', 'h'],\n css: 'height',\n});\n"],
5
- "mappings": "AAAA;ACAA;AAEO,MAAM,SAAS,MAAM;AAAA,EAC1B,MAAM,CAAC,UAAU,GAAG;AAAA,EACpB,KAAK;AACP,CAAC;",
6
- "names": []
7
- }
@@ -1,10 +0,0 @@
1
- import * as React from "react";
2
- import { style } from "@xstyled/system";
3
- const width = style({
4
- prop: ["width", "w"],
5
- css: "width"
6
- });
7
- export {
8
- width
9
- };
10
- //# sourceMappingURL=width.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/ds-styled/utilities/width.ts"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { style } from '@xstyled/system';\n\nexport const width = style({\n prop: ['width', 'w'],\n css: 'width',\n});\n"],
5
- "mappings": "AAAA;ACAA;AAEO,MAAM,QAAQ,MAAM;AAAA,EACzB,MAAM,CAAC,SAAS,GAAG;AAAA,EACnB,KAAK;AACP,CAAC;",
6
- "names": []
7
- }