@foxford/ui 2.17.0-beta-cee51ed-20231220 → 2.18.0-beta-e3198ab-20240126

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 (39) hide show
  1. package/components/Anchor/style.js +1 -1
  2. package/components/Anchor/style.js.map +1 -1
  3. package/components/ArrowBadge/style.js +1 -1
  4. package/components/ArrowBadge/style.js.map +1 -1
  5. package/components/Badge/style.js +1 -1
  6. package/components/Badge/style.js.map +1 -1
  7. package/components/Button/Button.js +1 -1
  8. package/components/Button/Button.js.map +1 -1
  9. package/components/Button/style.js +1 -1
  10. package/components/Button/style.js.map +1 -1
  11. package/components/Tab/style.js +1 -1
  12. package/components/Tab/style.js.map +1 -1
  13. package/components/Text/style.js +1 -1
  14. package/components/Text/style.js.map +1 -1
  15. package/dts/index.d.ts +41 -53
  16. package/hocs/withMergedProps.js.map +1 -1
  17. package/index.cjs.js +1 -1
  18. package/index.cjs.js.map +1 -1
  19. package/mixins/create-responsive-props.js +2 -0
  20. package/mixins/create-responsive-props.js.map +1 -0
  21. package/mixins/responsive-margin.js +2 -0
  22. package/mixins/responsive-margin.js.map +1 -0
  23. package/mixins/responsive-size.js +2 -0
  24. package/mixins/responsive-size.js.map +1 -0
  25. package/mixins/screen.js +1 -1
  26. package/mixins/screen.js.map +1 -1
  27. package/package.json +1 -1
  28. package/shared/constants.js +2 -0
  29. package/shared/constants.js.map +1 -0
  30. package/shared/regexp.js +1 -1
  31. package/shared/regexp.js.map +1 -1
  32. package/theme/themes.js +1 -1
  33. package/theme/themes.js.map +1 -1
  34. package/mixins/margin.js +0 -2
  35. package/mixins/margin.js.map +0 -1
  36. package/mixins/size.js +0 -2
  37. package/mixins/size.js.map +0 -1
  38. package/theme/breakpoints.js +0 -2
  39. package/theme/breakpoints.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import e from'@babel/runtime/helpers/taggedTemplateLiteral';import{css as r}from'styled-components';import{screenMinM as s,screenMaxM as a,screenMaxS as n,screenMinL as t,screenMaxL as o,screenMaxXs as p,screenMaxXxs as c}from'./screen.js';import{desktopFirst as i,getMediaQueryByResponsiveProp as v}from'./shared.js';var u,M;function m(m,h){var l=new RegExp("^(".concat(m.join('|'),")$"));var x=new RegExp("^(".concat(m.join('|'),")(XXS|XS|S|M|L|XL)$"));var X=/(XXS|XS|S|M|L|XL)$/;var g=[s,a,n];var f=[t,o,a,n,p,c];return s=>{var a=Object.keys(s).reduce(((e,r)=>(l.test(r)?e[0].push(r):x.test(r)&&e[1].push(r),e)),[[],[]]);var n=a[0].reduce(((r,a)=>{var n=s[a];if(Array.isArray(n)){if(n.length>0){var t=[];var o=n.length>g.length?f:g;for(var p=0;p<n.length&&o[p];p++)t.push(o[p]()(u||(u=e(["",""])),h(a,n[p],s)));r.push(...t)}}else r.push(h(a,n,s));return r}),[]);var t=a[1].sort(i).map((r=>v(r)()(M||(M=e(["",""])),h(r.replace(X,''),s[r],s))));return r([""," ",""],n,t)}}export{m as createResponsivePropsMixin};
2
+ //# sourceMappingURL=create-responsive-props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-responsive-props.js","sources":["../../../src/mixins/create-responsive-props.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport { css } from 'styled-components'\nimport type { ThemedStyledProps, DefaultTheme, CSSObject, FlattenInterpolation, ThemeProps } from 'styled-components'\nimport { screenMinM, screenMaxM, screenMaxS, screenMinL, screenMaxL, screenMaxXs, screenMaxXxs } from 'mixins/screen'\nimport { getMediaQueryByResponsiveProp, desktopFirst } from 'mixins/shared'\nimport type { MediaQuery } from 'mixins/screen'\nimport type { Breakpoint } from 'shared/types'\n\ntype ResponsivePropKey = 'size' | keyof CSSProperties\n\ntype ResponsiveProps<K extends ResponsivePropKey, V> = {\n [key in K]?: V | [desktop: V, tablet: V, mobile: V] | [xl: V, l: V, m: V, s: V, xs: V, xxs: V]\n} & {\n [key in `${K}${Breakpoint}`]?: V\n}\n\ntype MediaFunction = ReturnType<ReturnType<MediaQuery>>\n\n/**\n *\n * Factory to create mixins to enable responsive interface for any set of props\n */\nfunction createResponsivePropsMixin<K extends ResponsivePropKey, V, P extends ResponsiveProps<K, V>>(\n propsKeys: K[],\n buildCSSObject: (propKey: K, propValue: V, props: ThemedStyledProps<P, DefaultTheme>) => CSSObject\n): (props: ThemedStyledProps<P, DefaultTheme>) => FlattenInterpolation<ThemeProps<DefaultTheme>> {\n const propsRegExp = new RegExp(`^(${propsKeys.join('|')})$`)\n const breakpointsPropsRegExp = new RegExp(`^(${propsKeys.join('|')})(XXS|XS|S|M|L|XL)$`)\n const breakpointsRegExp = /(XXS|XS|S|M|L|XL)$/\n\n const deviceQueries = [screenMinM, screenMaxM, screenMaxS]\n const breakpointsQueries = [screenMinL, screenMaxL, screenMaxM, screenMaxS, screenMaxXs, screenMaxXxs]\n\n return (props) => {\n const propsKeys = Object.keys(props).reduce(\n (groups, propKey) => {\n if (propsRegExp.test(propKey)) groups[0].push(propKey)\n else if (breakpointsPropsRegExp.test(propKey)) groups[1].push(propKey)\n\n return groups\n },\n [[], []] as [string[], string[]]\n )\n\n const interpolations = propsKeys[0].reduce((acc, propKey) => {\n const propValue: V | V[] = props[propKey]\n\n if (!Array.isArray(propValue)) {\n acc.push(buildCSSObject(propKey as K, propValue, props))\n } else if (propValue.length > 0) {\n const mediaFunctions: MediaFunction[] = []\n const queries = propValue.length > deviceQueries.length ? breakpointsQueries : deviceQueries\n\n for (let i = 0; i < propValue.length; i++) {\n if (!queries[i]) break\n mediaFunctions.push(queries[i]()`${buildCSSObject(propKey as K, propValue[i], props)}`)\n }\n\n acc.push(...mediaFunctions)\n }\n\n return acc\n }, [] as (CSSObject | MediaFunction)[])\n\n const breakpointsInterpolations = propsKeys[1]\n .sort(desktopFirst)\n .map<MediaFunction>(\n (propKey) =>\n getMediaQueryByResponsiveProp(propKey)()`${buildCSSObject(\n propKey.replace(breakpointsRegExp, '') as K,\n props[propKey],\n props\n )}`\n )\n\n return css`\n ${interpolations}\n ${breakpointsInterpolations}\n `\n }\n}\n\nexport type { ResponsiveProps }\n\nexport { createResponsivePropsMixin }\n"],"names":["createResponsivePropsMixin","propsKeys","buildCSSObject","propsRegExp","RegExp","concat","join","breakpointsPropsRegExp","breakpointsRegExp","deviceQueries","screenMinM","screenMaxM","screenMaxS","breakpointsQueries","screenMinL","screenMaxL","screenMaxXs","screenMaxXxs","props","Object","keys","reduce","groups","propKey","test","push","interpolations","acc","propValue","Array","isArray","length","mediaFunctions","queries","i","_templateObject","_taggedTemplateLiteral","breakpointsInterpolations","sort","desktopFirst","map","getMediaQueryByResponsiveProp","replace","css"],"mappings":"sUAsBA,SAASA,EACPC,EACAC,GAEA,IAAMC,EAAc,IAAIC,OAAJ,KAAAC,OAAgBJ,EAAUK,KAAK,KAAnD,OACA,IAAMC,EAAyB,IAAIH,OAAJ,KAAAC,OAAgBJ,EAAUK,KAAK,KAA9D,wBACA,IAAME,EAAoB,qBAE1B,IAAMC,EAAgB,CAACC,EAAYC,EAAYC,GAC/C,IAAMC,EAAqB,CAACC,EAAYC,EAAYJ,EAAYC,EAAYI,EAAaC,GAEzF,OAAQC,IACN,IAAMjB,EAAYkB,OAAOC,KAAKF,GAAOG,QAAAA,CAClCC,EAAQC,KACHpB,EAAYqB,KAAKD,GAAUD,EAAO,GAAGG,KAAKF,GACrChB,EAAuBiB,KAAKD,IAAUD,EAAO,GAAGG,KAAKF,GAEvDD,IAET,CAAC,GAAI,KAGP,IAAMI,EAAiBzB,EAAU,GAAGoB,QAAAA,CAAQM,EAAKJ,KAC/C,IAAMK,EAAqBV,EAAMK,GAEjC,GAAKM,MAAMC,QAAQF,IAEZ,GAAIA,EAAUG,OAAS,EAAG,CAC/B,IAAMC,EAAkC,GACxC,IAAMC,EAAUL,EAAUG,OAAStB,EAAcsB,OAASlB,EAAqBJ,EAE/E,IAAK,IAAIyB,EAAI,EAAGA,EAAIN,EAAUG,QACvBE,EAAQC,GADuBA,IAEpCF,EAAeP,KAAKQ,EAAQC,IAARD,CAApBE,IAAAA,EAAAC,EAAA,CAAA,GAAA,MAAmClC,EAAeqB,EAAcK,EAAUM,GAAIhB,KAGhFS,EAAIF,QAAQO,SAVZL,EAAIF,KAAKvB,EAAeqB,EAAcK,EAAWV,IAanD,OAAOS,IACN,IAEH,IAAMU,EAA4BpC,EAAU,GACzCqC,KAAKC,GACLC,KACEjB,GACCkB,EAA8BlB,EAA9BkB,EAAAA,CAA2CvC,IAAAA,EAAAA,EAAAA,CAAAA,GAAAA,MAAAA,EACzCqB,EAAQmB,QAAQlC,EAAmB,IACnCU,EAAMK,GACNL,MAIR,OAAOyB,EAAP,CAAA,GAAA,IAAA,IACIjB,EACAW"}
@@ -0,0 +1,2 @@
1
+ import{createResponsivePropsMixin as r}from'./create-responsive-props.js';var n=r(['margin','marginTop','marginRight','marginBottom','marginLeft'],((r,n,i)=>{var a;return null==n?{}:{[r]:'string'==typeof n?n:"".concat(n).concat(null!==(a=i.marginUnits)&&void 0!==a?a:'px')}}));export{n as responsiveMargin};
2
+ //# sourceMappingURL=responsive-margin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responsive-margin.js","sources":["../../../src/mixins/responsive-margin.ts"],"sourcesContent":["import type { CSSProperties } from 'react'\nimport { createResponsivePropsMixin } from 'mixins/create-responsive-props'\nimport type { ResponsiveProps } from 'mixins/create-responsive-props'\nimport type { CSSUnit } from 'shared/types'\n\ntype MarginProperty = 'margin' | 'marginTop' | 'marginRight' | 'marginBottom' | 'marginLeft'\n\ntype ResponsiveMarginProps = ResponsiveProps<MarginProperty, CSSProperties['margin']> & {\n marginUnits?: CSSUnit\n}\n\n/**\n *\n * Mixin enables responsive margin interface\n */\nconst responsiveMargin = createResponsivePropsMixin<MarginProperty, CSSProperties['margin'], ResponsiveMarginProps>(\n ['margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft'],\n (propKey, propValue, props) => {\n if (propValue === undefined || propValue === null) return {}\n\n return {\n [propKey]: typeof propValue === 'string' ? propValue : `${propValue}${props.marginUnits ?? 'px'}`,\n }\n }\n)\n\nexport type { ResponsiveMarginProps }\n\nexport { responsiveMargin }\n"],"names":["responsiveMargin","createResponsivePropsMixin","propKey","propValue","props","_props$marginUnits","concat","marginUnits"],"mappings":"0EAeMA,IAAAA,EAAmBC,EACvB,CAAC,SAAU,YAAa,cAAe,eAAgB,eAAA,CACtDC,EAASC,EAAWC,KAAU,IAAAC,EAC7B,OAAIF,MAAAA,EAAsD,GAEnD,CACLD,CAACA,GAA+B,iBAAdC,EAAyBA,EAAhC,GAAAG,OAA+CH,GAAYC,eAAAA,EAAAA,EAAMG,2BAAe"}
@@ -0,0 +1,2 @@
1
+ import{createResponsivePropsMixin as e}from'./create-responsive-props.js';import{isCSSGlobalValue as i}from'../shared/utils/style.js';var s=e(['size'],((e,s,o)=>{var n;return null==s?{}:'number'==typeof s||i(s)?'function'==typeof o.dynamicSizeDeclaration?o.dynamicSizeDeclaration(s,null!==(r=o.sizeUnits)&&void 0!==r?r:'px'):{fontSize:'string'==typeof s?s:"".concat(s).concat(null!==(t=o.sizeUnits)&&void 0!==t?t:'px')}:null!==(n=o.sizes[s])&&void 0!==n?n:{};var r,t}));export{s as responsiveSize};
2
+ //# sourceMappingURL=responsive-size.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responsive-size.js","sources":["../../../src/mixins/responsive-size.ts"],"sourcesContent":["import type { CSSObject } from 'styled-components'\nimport { createResponsivePropsMixin } from 'mixins/create-responsive-props'\nimport { isCSSGlobalValue } from 'shared/utils/style'\nimport type { ResponsiveProps } from 'mixins/create-responsive-props'\nimport type { CSSUnit, Size, CSSGlobalValue, Sizes } from 'shared/types'\n\ntype SizeProperty = 'size'\n\ntype SizeValue = Size | CSSGlobalValue | number\n\ntype ResponsiveSizeProps = ResponsiveProps<SizeProperty, SizeValue> & {\n sizeUnits?: CSSUnit\n sizes?: Partial<Sizes>\n}\n\ntype ResponsiveSizeInterpolationProps<T extends ResponsiveSizeProps = ResponsiveSizeProps> = Omit<T, 'size' | 'sizes'> &\n Required<Pick<T, 'size'>> & {\n sizes: Sizes\n dynamicSizeDeclaration?: (size: Exclude<SizeValue, Size>, sizeUnits: CSSUnit) => CSSObject\n }\n\n/**\n *\n * Mixin enables responsive size interface\n */\nconst responsiveSize = createResponsivePropsMixin<SizeProperty, SizeValue | void, ResponsiveSizeInterpolationProps>(\n ['size'],\n (_, sizeValue, props) => {\n if (sizeValue === undefined || sizeValue === null) return {}\n\n if (typeof sizeValue === 'number' || isCSSGlobalValue(sizeValue)) {\n const cssObject =\n typeof props.dynamicSizeDeclaration === 'function'\n ? props.dynamicSizeDeclaration(sizeValue, props.sizeUnits ?? 'px')\n : { fontSize: typeof sizeValue === 'string' ? sizeValue : `${sizeValue}${props.sizeUnits ?? 'px'}` }\n\n return cssObject\n }\n\n return (props.sizes[sizeValue] ?? {}) as CSSObject\n }\n)\n\nexport type { ResponsiveSizeProps, ResponsiveSizeInterpolationProps }\n\nexport { responsiveSize }\n"],"names":["responsiveSize","createResponsivePropsMixin","_","sizeValue","props","_props$sizes$sizeValu","isCSSGlobalValue","dynamicSizeDeclaration","sizeUnits","_props$sizeUnits","fontSize","sizes","_props$sizeUnits2"],"mappings":"sIAyBA,IAAMA,EAAiBC,EACrB,CAAC,SAAA,CACAC,EAAGC,EAAWC,KAAU,IAAAC,EACvB,OAAIF,MAAAA,EAAsD,GAEjC,iBAAdA,GAA0BG,EAAiBH,GAEV,mBAAjCC,EAAMG,uBACTH,EAAMG,uBAAuBJ,EAA7B,QAAwCC,EAAAA,EAAMI,iBAAAA,IAA9CC,EAAAA,EAA2D,MAC3D,CAAEC,SAA+B,iBAAdP,EAAyBA,EAAeA,GAAAA,OAAAA,GAAYC,eAAAA,EAAAA,EAAMI,iBAAAA,QAAa,eAKlGH,EAAQD,EAAMO,MAAMR,kBAAc,GATgC,IAAAM,EAAAG"}
package/mixins/screen.js CHANGED
@@ -1,2 +1,2 @@
1
- import{css as e}from'styled-components';import'react';import'ramda';import'../theme/global-styled.js';import{defaultTheme as r}from'../theme/themes.js';import'react/jsx-runtime';import'../theme/colors.js';var a={MAX:n=(e,r)=>"(max-width: ".concat(e[r]-.02,"px)"),MIN:s=(e,r)=>"(min-width: ".concat(e[r],"px)"),RANGE:(e,r,a)=>"".concat(s(e,r)," and ").concat(n(e,a))};var n,s;var t=function(a){for(var n=arguments.length,s=new Array(n>1?n-1:0),t=1;t<n;t++)s[t-1]=arguments[t];return n=>function(){for(var t=arguments.length,i=new Array(t),o=0;o<t;o++)i[o]=arguments[o];return t=>{var o,c;var v=null!==(o=null===(c=t.theme)||void 0===c?void 0:c.breakpoints)&&void 0!==o?o:r.breakpoints;return void 0!==n&&'function'==typeof n.condition&&!1===n.condition(t)?e([""]):e(["@media screen and "," ","{","}"],a(v,...s),void 0!==n&&'string'==typeof n.and?"and ".concat(n.and):"",e(...i))}}};var i=t(a.RANGE,'xxs','xs');var o=t(a.RANGE,'xs','s');var c=t(a.RANGE,'s','m');var v=t(a.RANGE,'m','l');var m=t(a.RANGE,'l','xl');var M=t(a.MAX,'xxs');var l=t(a.MAX,'xs');var x=t(a.MIN,'xs');var d=t(a.MAX,'s');var p=t(a.MIN,'s');var A=t(a.MAX,'m');var X=t(a.MIN,'m');var u=t(a.MAX,'l');var N=t(a.MIN,'l');var f=t(a.MAX,'xl');var h=t(a.MIN,'xl');var R=function(){return e(["@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){","}"],e(...arguments))};export{v as screenL,c as screenM,u as screenMaxL,A as screenMaxM,d as screenMaxS,f as screenMaxXl,l as screenMaxXs,M as screenMaxXxs,N as screenMinL,X as screenMinM,p as screenMinS,h as screenMinXl,x as screenMinXs,R as screenRetina,o as screenS,m as screenXl,i as screenXs};
1
+ import a from'@babel/runtime/helpers/objectSpread2';import{css as r}from'styled-components';import{BREAKPOINTS as e}from'../shared/constants.js';var n={MAX:s=(a,r)=>"(max-width: ".concat(a[r]-.02,"px)"),MIN:c=(a,r)=>"(min-width: ".concat(a[r],"px)"),RANGE:(a,r,e)=>"".concat(c(a,r)," and ").concat(s(a,e))};var s,c;var i=function(n){for(var s=arguments.length,c=new Array(s>1?s-1:0),i=1;i<s;i++)c[i-1]=arguments[i];return s=>function(){for(var i=arguments.length,t=new Array(i),o=0;o<i;o++)t[o]=arguments[o];return i=>{var o,v;var M=null!==(o=null===(v=i.theme)||void 0===v?void 0:v.breakpoints)&&void 0!==o?o:{};var x=a(a({},e),M);return void 0!==s&&'function'==typeof s.condition&&!1===s.condition(i)?r([""]):r(["@media screen and "," ","{","}"],n(x,...c),void 0!==s&&'string'==typeof s.and?"and ".concat(s.and):"",r(...t))}}};var t=i(n.RANGE,'xxs','xs');var o=i(n.RANGE,'xs','s');var v=i(n.RANGE,'s','m');var M=i(n.RANGE,'m','l');var x=i(n.RANGE,'l','xl');var d=i(n.MAX,'xxs');var l=i(n.MAX,'xs');var m=i(n.MIN,'xs');var A=i(n.MAX,'s');var p=i(n.MIN,'s');var X=i(n.MAX,'m');var u=i(n.MIN,'m');var N=i(n.MAX,'l');var f=i(n.MIN,'l');var R=i(n.MAX,'xl');var h=i(n.MIN,'xl');var E=function(){return r(["@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){","}"],r(...arguments))};export{i as createMediaQuery,M as screenL,v as screenM,N as screenMaxL,X as screenMaxM,A as screenMaxS,R as screenMaxXl,l as screenMaxXs,d as screenMaxXxs,f as screenMinL,u as screenMinM,p as screenMinS,h as screenMinXl,m as screenMinXs,E as screenRetina,o as screenS,x as screenXl,t as screenXs};
2
2
  //# sourceMappingURL=screen.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"screen.js","sources":["../../../src/mixins/screen.ts"],"sourcesContent":["import { css } from 'styled-components'\nimport type { CSSObject, ThemeProps, DefaultTheme, SimpleInterpolation, Interpolation } from 'styled-components'\nimport { theme } from '../theme'\n\ntype StyledComponentProps = {\n theme?: { breakpoints?: typeof theme.breakpoints }\n}\n\ntype MediaQueryParams = {\n and?: string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n condition?: (_props: any) => boolean\n}\n\nconst CONDITIONS = (() => {\n const maxWidth = (breakpoints: typeof theme.breakpoints, point: string) =>\n `(max-width: ${breakpoints[point] - 0.02}px)`\n const minWidth = (breakpoints: typeof theme.breakpoints, point: string) => `(min-width: ${breakpoints[point]}px)`\n\n return {\n MAX: maxWidth,\n MIN: minWidth,\n RANGE: (breakpoints: typeof theme.breakpoints, point1: string, point2: string) =>\n `${minWidth(breakpoints, point1)} and ${maxWidth(breakpoints, point2)}`,\n }\n})()\n\nconst createMediaQuery =\n (condition: (_breakpoints: typeof theme.breakpoints, ..._points: string[]) => string, ...points: string[]) =>\n (params?: MediaQueryParams) =>\n <T extends object>(...args: [CSSObject | TemplateStringsArray, ...Interpolation<T & ThemeProps<DefaultTheme>>[]]) =>\n (props: StyledComponentProps) => {\n const breakpoints = props.theme?.breakpoints ?? theme.breakpoints\n\n if (params !== undefined && typeof params.condition === 'function' && params.condition(props) === false) {\n return css``\n }\n\n return css<T>`\n @media screen and ${condition(breakpoints, ...points)} ${params !== undefined && typeof params.and === 'string'\n ? `and ${params.and}`\n : ``} {\n ${css<T>(...args)}\n }\n `\n }\n\n/**\n * @return `@media screen and (min-width: 320px) and (max-width: 374px) { ...args }`\n */\nexport const screenXs = createMediaQuery(CONDITIONS.RANGE, 'xxs', 'xs')\n\n/**\n * @return `@media screen and (min-width: 375px) and (max-width: 767px) { ...args }`\n */\nexport const screenS = createMediaQuery(CONDITIONS.RANGE, 'xs', 's')\n\n/**\n * @return `@media screen and (min-width: 768) and (max-width: 1023px) { ...args }`\n */\nexport const screenM = createMediaQuery(CONDITIONS.RANGE, 's', 'm')\n\n/**\n * @return `@media screen and (min-width: 1024px) and (max-width: 1279px) { ...args }`\n */\nexport const screenL = createMediaQuery(CONDITIONS.RANGE, 'm', 'l')\n\n/**\n * @return `@media screen and (min-width: 1280px) and (max-width: 1439px) { ...args }`\n */\nexport const screenXl = createMediaQuery(CONDITIONS.RANGE, 'l', 'xl')\n\n/**\n * @return `@media screen and (max-width: 319px) { ...args }`\n */\nexport const screenMaxXxs = createMediaQuery(CONDITIONS.MAX, 'xxs')\n\n/**\n * @return `@media screen and (max-width: 374px) { ...args }`\n */\nexport const screenMaxXs = createMediaQuery(CONDITIONS.MAX, 'xs')\n\n/**\n * @return `@media screen and (min-width: 375px) { ...args }`\n */\nexport const screenMinXs = createMediaQuery(CONDITIONS.MIN, 'xs')\n\n/**\n * @return `@media screen and (max-width: 767px) { ...args }`\n */\nexport const screenMaxS = createMediaQuery(CONDITIONS.MAX, 's')\n\n/**\n * @return `@media screen and (min-width: 768px) { ...args }`\n */\nexport const screenMinS = createMediaQuery(CONDITIONS.MIN, 's')\n\n/**\n * @return `@media screen and (max-width: 1023px) { ...args }`\n */\nexport const screenMaxM = createMediaQuery(CONDITIONS.MAX, 'm')\n\n/**\n * @return `@media screen and (min-width: 1024px) { ...args }`\n */\nexport const screenMinM = createMediaQuery(CONDITIONS.MIN, 'm')\n\n/**\n * @return `@media screen and (max-width: 1279px) { ...args }`\n */\nexport const screenMaxL = createMediaQuery(CONDITIONS.MAX, 'l')\n\n/**\n * @return `@media screen and (min-width: 1280px) { ...args }`\n */\nexport const screenMinL = createMediaQuery(CONDITIONS.MIN, 'l')\n\n/**\n * @return `@media screen and (max-width: 1439px) { ...args }`\n */\nexport const screenMaxXl = createMediaQuery(CONDITIONS.MAX, 'xl')\n\n/**\n * @return `@media screen and (min-width: 1440px) { ...args }`\n */\nexport const screenMinXl = createMediaQuery(CONDITIONS.MIN, 'xl')\n\n/**\n * @return `@media -webkit-min-device-pixel-ratio: 2 and (min-resolution: 192dpi) { ...args }`\n */\nexport const screenRetina = (...args: [CSSObject | TemplateStringsArray, SimpleInterpolation]) => css`\n @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {\n ${css(...args)}\n }\n`\n\nexport type MediaQuery = ReturnType<typeof createMediaQuery>\n"],"names":["CONDITIONS","MAX","maxWidth","breakpoints","point","MIN","minWidth","concat","RANGE","point1","point2","createMediaQuery","condition","_len","arguments","length","points","Array","_key","params","_len2","args","_key2","props","_props$theme$breakpoi","_props$theme","theme","css","undefined","and","screenXs","screenS","screenM","screenL","screenXl","screenMaxXxs","screenMaxXs","screenMinXs","screenMaxS","screenMinS","screenMaxM","screenMinM","screenMaxL","screenMinL","screenMaxXl","screenMinXl","screenRetina"],"mappings":"6MAcA,IAAMA,EAKG,CACLC,IALIC,EAAW,CAACC,EAAuCC,IACxCD,eAAAA,OAAAA,EAAYC,GAAS,IADtC,OAMEC,IAJIC,EAAW,CAACH,EAAuCC,IAAxC,eAAAG,OAAyEJ,EAAYC,GAAtG,OAKEI,MAAO,CAACL,EAAuCM,EAAgBC,cAC1DJ,EAASH,EAAaM,GAAeP,SAAAA,OAAAA,EAASC,EAAaO,KATjD,IACXR,EAEAI,EAUR,IAAMK,EACJ,SAACC,GAAD,IAAA,IAAAC,EAAAC,UAAAC,OAAyFC,EAAzF,IAAAC,MAAAJ,EAAA,EAAAA,EAAA,EAAA,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAyFF,EAAzFE,EAAA,GAAAJ,UAAAI,GAAA,OACCC,GACD,WAAA,IAAA,IAAAC,EAAAN,UAAAC,OAAsBM,EAAtB,IAAAJ,MAAAG,GAAAE,EAAA,EAAAA,EAAAF,EAAAE,IAAsBD,EAAtBC,GAAAR,UAAAQ,GAAA,OACCC,IAAgC,IAAAC,EAAAC,EAC/B,IAAMtB,EAAW,QAAGoB,EAAA,QAAAA,EAAAA,EAAMG,iBAAND,OAAAA,EAAAA,EAAatB,mBAAhB,IAAAqB,EAAAA,EAA+BE,EAAMvB,YAEtD,YAAA,IAAIgB,GAAoD,mBAArBA,EAAOP,YAAwD,IAA5BO,EAAOP,UAAUW,GAC9EI,EAAP,CAAA,KAGKA,EAAP,CAAA,qBAAA,IAAA,IAAA,KACsBf,EAAUT,KAAgBa,QAAsBY,IAAXT,GAA8C,iBAAfA,EAAOU,IAAtC,OAAAtB,OAC5CY,EAAOU,KADqC,GAGrDF,KAAUN,OAQPS,IAAAA,EAAWnB,EAAiBX,EAAWQ,MAAO,MAAO,MAKrDuB,IAAAA,EAAUpB,EAAiBX,EAAWQ,MAAO,KAAM,KAKnDwB,IAAAA,EAAUrB,EAAiBX,EAAWQ,MAAO,IAAK,KAKlDyB,IAAAA,EAAUtB,EAAiBX,EAAWQ,MAAO,IAAK,KAKlD0B,IAAAA,EAAWvB,EAAiBX,EAAWQ,MAAO,IAAK,MAKzD,IAAM2B,EAAexB,EAAiBX,EAAWC,IAAK,OAKtD,IAAMmC,EAAczB,EAAiBX,EAAWC,IAAK,MAKrD,IAAMoC,EAAc1B,EAAiBX,EAAWK,IAAK,MAKrD,IAAMiC,EAAa3B,EAAiBX,EAAWC,IAAK,KAKpD,IAAMsC,EAAa5B,EAAiBX,EAAWK,IAAK,KAKpD,IAAMmC,EAAa7B,EAAiBX,EAAWC,IAAK,KAKpD,IAAMwC,EAAa9B,EAAiBX,EAAWK,IAAK,KAKpD,IAAMqC,EAAa/B,EAAiBX,EAAWC,IAAK,KAKpD,IAAM0C,EAAahC,EAAiBX,EAAWK,IAAK,KAKpD,IAAMuC,EAAcjC,EAAiBX,EAAWC,IAAK,MAKrD,IAAM4C,EAAclC,EAAiBX,EAAWK,IAAK,MAK/CyC,IAAAA,EAAe,WAAA,OAAsEnB,EAAtE,CAAA,qEAAA,KAEtBA"}
1
+ {"version":3,"file":"screen.js","sources":["../../../src/mixins/screen.ts"],"sourcesContent":["import { css } from 'styled-components'\nimport type { CSSObject, ThemeProps, DefaultTheme, SimpleInterpolation, Interpolation } from 'styled-components'\nimport { BREAKPOINTS } from 'shared/constants'\n\ntype MediaQueryParams = {\n and?: string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n condition?: (_props: any) => boolean\n}\n\ntype ThemeBreakpoints = DefaultTheme['breakpoints']\n\ntype BreakpointKey = keyof ThemeBreakpoints\n\nconst CONDITIONS = (() => {\n const maxWidth = (breakpoints: ThemeBreakpoints, point: BreakpointKey) =>\n `(max-width: ${breakpoints[point] - 0.02}px)`\n const minWidth = (breakpoints: ThemeBreakpoints, point: BreakpointKey) => `(min-width: ${breakpoints[point]}px)`\n\n return {\n MAX: maxWidth,\n MIN: minWidth,\n RANGE: (breakpoints: ThemeBreakpoints, point1: BreakpointKey, point2: BreakpointKey) =>\n `${minWidth(breakpoints, point1)} and ${maxWidth(breakpoints, point2)}`,\n }\n})()\n\nexport const createMediaQuery =\n (condition: (_breakpoints: ThemeBreakpoints, ..._points: BreakpointKey[]) => string, ...points: BreakpointKey[]) =>\n (params?: MediaQueryParams) =>\n <T extends object>(...args: [CSSObject | TemplateStringsArray, ...Interpolation<T & ThemeProps<DefaultTheme>>[]]) =>\n (props: ThemeProps<DefaultTheme>) => {\n const contextBreakpoints = props.theme?.breakpoints ?? {}\n const breakpoints: ThemeBreakpoints = { ...BREAKPOINTS, ...contextBreakpoints }\n\n if (params !== undefined && typeof params.condition === 'function' && params.condition(props) === false) {\n return css``\n }\n\n return css<T>`\n @media screen and ${condition(breakpoints, ...points)} ${params !== undefined && typeof params.and === 'string'\n ? `and ${params.and}`\n : ``} {\n ${css<T>(...args)}\n }\n `\n }\n\n/**\n * @return `@media screen and (min-width: 320px) and (max-width: 374px) { ...args }`\n */\nexport const screenXs = createMediaQuery(CONDITIONS.RANGE, 'xxs', 'xs')\n\n/**\n * @return `@media screen and (min-width: 375px) and (max-width: 767px) { ...args }`\n */\nexport const screenS = createMediaQuery(CONDITIONS.RANGE, 'xs', 's')\n\n/**\n * @return `@media screen and (min-width: 768) and (max-width: 1023px) { ...args }`\n */\nexport const screenM = createMediaQuery(CONDITIONS.RANGE, 's', 'm')\n\n/**\n * @return `@media screen and (min-width: 1024px) and (max-width: 1279px) { ...args }`\n */\nexport const screenL = createMediaQuery(CONDITIONS.RANGE, 'm', 'l')\n\n/**\n * @return `@media screen and (min-width: 1280px) and (max-width: 1439px) { ...args }`\n */\nexport const screenXl = createMediaQuery(CONDITIONS.RANGE, 'l', 'xl')\n\n/**\n * @return `@media screen and (max-width: 319px) { ...args }`\n */\nexport const screenMaxXxs = createMediaQuery(CONDITIONS.MAX, 'xxs')\n\n/**\n * @return `@media screen and (max-width: 374px) { ...args }`\n */\nexport const screenMaxXs = createMediaQuery(CONDITIONS.MAX, 'xs')\n\n/**\n * @return `@media screen and (min-width: 375px) { ...args }`\n */\nexport const screenMinXs = createMediaQuery(CONDITIONS.MIN, 'xs')\n\n/**\n * @return `@media screen and (max-width: 767px) { ...args }`\n */\nexport const screenMaxS = createMediaQuery(CONDITIONS.MAX, 's')\n\n/**\n * @return `@media screen and (min-width: 768px) { ...args }`\n */\nexport const screenMinS = createMediaQuery(CONDITIONS.MIN, 's')\n\n/**\n * @return `@media screen and (max-width: 1023px) { ...args }`\n */\nexport const screenMaxM = createMediaQuery(CONDITIONS.MAX, 'm')\n\n/**\n * @return `@media screen and (min-width: 1024px) { ...args }`\n */\nexport const screenMinM = createMediaQuery(CONDITIONS.MIN, 'm')\n\n/**\n * @return `@media screen and (max-width: 1279px) { ...args }`\n */\nexport const screenMaxL = createMediaQuery(CONDITIONS.MAX, 'l')\n\n/**\n * @return `@media screen and (min-width: 1280px) { ...args }`\n */\nexport const screenMinL = createMediaQuery(CONDITIONS.MIN, 'l')\n\n/**\n * @return `@media screen and (max-width: 1439px) { ...args }`\n */\nexport const screenMaxXl = createMediaQuery(CONDITIONS.MAX, 'xl')\n\n/**\n * @return `@media screen and (min-width: 1440px) { ...args }`\n */\nexport const screenMinXl = createMediaQuery(CONDITIONS.MIN, 'xl')\n\n/**\n * @return `@media -webkit-min-device-pixel-ratio: 2 and (min-resolution: 192dpi) { ...args }`\n */\nexport const screenRetina = (...args: [CSSObject | TemplateStringsArray, SimpleInterpolation]) => css`\n @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {\n ${css(...args)}\n }\n`\n\nexport type MediaQuery = ReturnType<typeof createMediaQuery>\n"],"names":["CONDITIONS","MAX","maxWidth","breakpoints","point","MIN","minWidth","concat","RANGE","point1","point2","createMediaQuery","condition","_len","arguments","length","points","Array","_key","params","_len2","args","_key2","props","_props$theme$breakpoi","_props$theme","contextBreakpoints","theme","_objectSpread","BREAKPOINTS","undefined","css","and","screenXs","screenS","screenM","screenL","screenXl","screenMaxXxs","screenMaxXs","screenMinXs","screenMaxS","screenMinS","screenMaxM","screenMinM","screenMaxL","screenMinL","screenMaxXl","screenMinXl","screenRetina"],"mappings":"iJAcA,IAAMA,EAKG,CACLC,IALIC,EAAW,CAACC,EAA+BC,IAChCD,eAAAA,OAAAA,EAAYC,GAAS,IADtC,OAMEC,IAJIC,EAAW,CAACH,EAA+BC,IAAhC,eAAAG,OAAwEJ,EAAYC,GAArG,OAKEI,MAAO,CAACL,EAA+BM,EAAuBC,cACzDJ,EAASH,EAAaM,GAAeP,SAAAA,OAAAA,EAASC,EAAaO,KATjD,IACXR,EAEAI,MAUKK,EACX,SAACC,GAAD,IAAA,IAAAC,EAAAC,UAAAC,OAAwFC,EAAxF,IAAAC,MAAAJ,EAAA,EAAAA,EAAA,EAAA,GAAAK,EAAA,EAAAA,EAAAL,EAAAK,IAAwFF,EAAxFE,EAAA,GAAAJ,UAAAI,GAAA,OACCC,GACD,WAAA,IAAA,IAAAC,EAAAN,UAAAC,OAAsBM,EAAtB,IAAAJ,MAAAG,GAAAE,EAAA,EAAAA,EAAAF,EAAAE,IAAsBD,EAAtBC,GAAAR,UAAAQ,GAAA,OACCC,IAAoC,IAAAC,EAAAC,EACnC,IAAMC,EAAkB,UAAG,UAAAH,EAAMI,aAAAA,IAANF,OAAAA,EAAAA,EAAatB,uBAAhBqB,EAAAA,EAA+B,GACvD,IAAMrB,EAA6ByB,EAAAA,EAAA,GAAQC,GAAgBH,GAE3D,YAAeI,IAAXX,GAAoD,mBAArBA,EAAOP,YAAAA,IAA4BO,EAAOP,UAAUW,GAC9EQ,EAAP,CAAA,KAGKA,EAAP,CAAA,qBAAA,IAAA,IAAA,KACsBnB,EAAUT,KAAgBa,QAAAA,IAAWG,GAA8C,iBAAfA,EAAOa,IAAtC,OAAAzB,OAC5CY,EAAOa,KADqC,GAGrDD,KAAUV,OAQPY,IAAAA,EAAWtB,EAAiBX,EAAWQ,MAAO,MAAO,MAKrD0B,IAAAA,EAAUvB,EAAiBX,EAAWQ,MAAO,KAAM,KAKnD2B,IAAAA,EAAUxB,EAAiBX,EAAWQ,MAAO,IAAK,KAKlD4B,IAAAA,EAAUzB,EAAiBX,EAAWQ,MAAO,IAAK,KAKlD6B,IAAAA,EAAW1B,EAAiBX,EAAWQ,MAAO,IAAK,MAKzD,IAAM8B,EAAe3B,EAAiBX,EAAWC,IAAK,OAKtD,IAAMsC,EAAc5B,EAAiBX,EAAWC,IAAK,MAKrD,IAAMuC,EAAc7B,EAAiBX,EAAWK,IAAK,MAKrD,IAAMoC,EAAa9B,EAAiBX,EAAWC,IAAK,KAKpD,IAAMyC,EAAa/B,EAAiBX,EAAWK,IAAK,KAKpD,IAAMsC,EAAahC,EAAiBX,EAAWC,IAAK,KAKpD,IAAM2C,EAAajC,EAAiBX,EAAWK,IAAK,KAKpD,IAAMwC,EAAalC,EAAiBX,EAAWC,IAAK,KAKpD,IAAM6C,EAAanC,EAAiBX,EAAWK,IAAK,KAKpD,IAAM0C,EAAcpC,EAAiBX,EAAWC,IAAK,MAKrD,IAAM+C,EAAcrC,EAAiBX,EAAWK,IAAK,MAK/C4C,IAAAA,EAAe,WAAA,OAAsElB,EAAtE,CAAA,qEAAA,KAEtBA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foxford/ui",
3
- "version": "2.17.0-beta-cee51ed-20231220",
3
+ "version": "2.18.0-beta-e3198ab-20240126",
4
4
  "description": "UI components library",
5
5
  "main": "index.cjs.js",
6
6
  "module": "index.js",
@@ -0,0 +1,2 @@
1
+ var x={xl:1440,l:1280,m:1024,s:768,xs:374,xxs:320};export{x as BREAKPOINTS};
2
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../../src/shared/constants.ts"],"sourcesContent":["import type { Breakpoint } from 'shared/types'\n\nexport const BREAKPOINTS: Readonly<Record<Lowercase<Breakpoint>, number>> = {\n xl: 1440,\n l: 1280,\n m: 1024,\n s: 768,\n xs: 374,\n xxs: 320,\n}\n"],"names":["BREAKPOINTS","xl","l","m","s","xs","xxs"],"mappings":"AAEO,IAAMA,EAA+D,CAC1EC,GAAI,KACJC,EAAG,KACHC,EAAG,KACHC,EAAG,IACHC,GAAI,IACJC,IAAK"}
package/shared/regexp.js CHANGED
@@ -1,2 +1,2 @@
1
- var r=/^(preset|sizeProperty|sizeUnits|sizes|size|dynamicSizeDeclaration|marginUnits|color|backgroundColor|cursor|borderColor|palette)$/;var e=/^(primary|secondary|tertiary|quaternary)$/;var a=/^size(XXS|XS|S|M|L|XL)$/;var i=/^(margin|marginTop|marginRight|marginBottom|marginLeft)$/;var o=/^(margin|marginTop|marginRight|marginBottom|marginLeft)(XXS|XS|S|M|L|XL)$/;export{e as colorSchemaPropKeyRegExp,r as commonPropKeyRegExp,i as marginPropKeyRegExp,o as responsiveMarginPropKeyRegExp,a as responsiveSizePropKeyRegExp};
1
+ var r=/^(preset|sizeUnits|sizes|size|dynamicSizeDeclaration|marginUnits|color|backgroundColor|cursor|borderColor|palette)$/;var a=/^(primary|secondary|tertiary|quaternary)$/;var e=/^size(XXS|XS|S|M|L|XL)$/;var i=/^(margin|marginTop|marginRight|marginBottom|marginLeft)$/;var o=/^(margin|marginTop|marginRight|marginBottom|marginLeft)(XXS|XS|S|M|L|XL)$/;export{a as colorSchemaPropKeyRegExp,r as commonPropKeyRegExp,i as marginPropKeyRegExp,o as responsiveMarginPropKeyRegExp,e as responsiveSizePropKeyRegExp};
2
2
  //# sourceMappingURL=regexp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"regexp.js","sources":["../../../src/shared/regexp.ts"],"sourcesContent":["export const commonPropKeyRegExp =\n /^(preset|sizeProperty|sizeUnits|sizes|size|dynamicSizeDeclaration|marginUnits|color|backgroundColor|cursor|borderColor|palette)$/\n\nexport const colorSchemaPropKeyRegExp = /^(primary|secondary|tertiary|quaternary)$/\n\nexport const responsiveSizePropKeyRegExp = /^size(XXS|XS|S|M|L|XL)$/\n\nexport const marginPropKeyRegExp = /^(margin|marginTop|marginRight|marginBottom|marginLeft)$/\n\nexport const responsiveMarginPropKeyRegExp = /^(margin|marginTop|marginRight|marginBottom|marginLeft)(XXS|XS|S|M|L|XL)$/\n"],"names":["commonPropKeyRegExp","colorSchemaPropKeyRegExp","responsiveSizePropKeyRegExp","marginPropKeyRegExp","responsiveMarginPropKeyRegExp"],"mappings":"AAAO,IAAMA,EACX,mIAEK,IAAMC,EAA2B,4CAEjC,IAAMC,EAA8B,0BAEpC,IAAMC,EAAsB,2DAE5B,IAAMC,EAAgC"}
1
+ {"version":3,"file":"regexp.js","sources":["../../../src/shared/regexp.ts"],"sourcesContent":["export const commonPropKeyRegExp =\n /^(preset|sizeUnits|sizes|size|dynamicSizeDeclaration|marginUnits|color|backgroundColor|cursor|borderColor|palette)$/\n\nexport const colorSchemaPropKeyRegExp = /^(primary|secondary|tertiary|quaternary)$/\n\nexport const responsiveSizePropKeyRegExp = /^size(XXS|XS|S|M|L|XL)$/\n\nexport const marginPropKeyRegExp = /^(margin|marginTop|marginRight|marginBottom|marginLeft)$/\n\nexport const responsiveMarginPropKeyRegExp = /^(margin|marginTop|marginRight|marginBottom|marginLeft)(XXS|XS|S|M|L|XL)$/\n"],"names":["commonPropKeyRegExp","colorSchemaPropKeyRegExp","responsiveSizePropKeyRegExp","marginPropKeyRegExp","responsiveMarginPropKeyRegExp"],"mappings":"AAAO,IAAMA,EACX,sHAEK,IAAMC,EAA2B,4CAEjC,IAAMC,EAA8B,0BAEpC,IAAMC,EAAsB,2DAE5B,IAAMC,EAAgC"}
package/theme/themes.js CHANGED
@@ -1,2 +1,2 @@
1
- import o from'@babel/runtime/helpers/objectSpread2';import{hexToRgbA as r}from'../shared/utils/colors.js';import{relBuilder as e}from'../shared/utils/rel-builder.js';import{SizeInput as s}from'../shared/enums/sizeInput.js';import{COMPONENT_NAME as a}from'../components/Arrow/Arrow.js';import{COMPONENT_NAME as t}from'../components/Button/Button.js';import{COMPONENT_NAME as l}from'../components/Checkbox/Checkbox.js';import{colors as m,socialColors as n,unitColors as i}from'./colors.js';import{baseColors as d,motherColors as b,babyColors as p,teenColors as h,adultColors as c}from'./colors-light.js';import{baseColors as u,motherColors as C,babyColors as f,teenColors as k,adultColors as T}from'./colors-dark.js';import{breakpoints as j}from'./breakpoints.js';var x={breakpoints:j,colors:o(o(o(o(o({},m),n),i),d),b),borderRadius:'5px',textColor:'mineShaft',fallbackColor:'mineShaft',zIndex:{modal:9e3,tooltip:80},classNamePrefix:'fox',defaultInputControlsWidth:s.l,utils:{relBuilder:e,hexToRgbA:r},mode:'light',preset:'default',name:'mother',components:{[a]:{size:'l'},[t]:{size:'m'},[l]:{size:'m'}}};var N=o(o({},x),{},{preset:'brand'});var v=o(o({},x),{},{colors:o(o(o({},x.colors),u),C),mode:'dark',preset:'brand'});var g=o(o({},x),{},{colors:o(o({},x.colors),p),preset:'brand',name:'baby'});var A=o(o({},x),{},{colors:o(o(o({},x.colors),u),f),mode:'dark',preset:'brand',name:'baby'});var y=o(o({},x),{},{colors:o(o({},x.colors),h),preset:'brand',name:'teen'});var z=o(o({},x),{},{colors:o(o(o({},x.colors),u),k),mode:'dark',preset:'brand',name:'teen'});var E=o(o({},x),{},{colors:o(o({},x.colors),c),preset:'brand',name:'adult'});var M=o(o({},x),{},{colors:o(o(o({},x.colors),u),T),mode:'dark',preset:'brand',name:'adult'});export{M as adultDarkTheme,E as adultLightTheme,A as babyDarkTheme,g as babyLightTheme,x as defaultTheme,v as motherDarkTheme,N as motherLightTheme,z as teenDarkTheme,y as teenLightTheme};
1
+ import o from'@babel/runtime/helpers/objectSpread2';import{hexToRgbA as r}from'../shared/utils/colors.js';import{relBuilder as e}from'../shared/utils/rel-builder.js';import{SizeInput as s}from'../shared/enums/sizeInput.js';import{BREAKPOINTS as a}from'../shared/constants.js';import{COMPONENT_NAME as t}from'../components/Arrow/Arrow.js';import{COMPONENT_NAME as l}from'../components/Button/Button.js';import{COMPONENT_NAME as m}from'../components/Checkbox/Checkbox.js';import{colors as n,socialColors as d,unitColors as i}from'./colors.js';import{baseColors as b,motherColors as p,babyColors as h,teenColors as c,adultColors as u}from'./colors-light.js';import{baseColors as C,motherColors as f,babyColors as T,teenColors as k,adultColors as j}from'./colors-dark.js';var N={breakpoints:a,colors:o(o(o(o(o({},n),d),i),b),p),borderRadius:'5px',textColor:'mineShaft',fallbackColor:'mineShaft',zIndex:{modal:9e3,tooltip:80},classNamePrefix:'fox',defaultInputControlsWidth:s.l,utils:{relBuilder:e,hexToRgbA:r},mode:'light',preset:'default',name:'mother',components:{[t]:{size:'l'},[l]:{size:'m'},[m]:{size:'m'}}};var x=o(o({},N),{},{preset:'brand'});var v=o(o({},N),{},{colors:o(o(o({},N.colors),C),f),mode:'dark',preset:'brand'});var g=o(o({},N),{},{colors:o(o({},N.colors),h),preset:'brand',name:'baby'});var A=o(o({},N),{},{colors:o(o(o({},N.colors),C),T),mode:'dark',preset:'brand',name:'baby'});var E=o(o({},N),{},{colors:o(o({},N.colors),c),preset:'brand',name:'teen'});var O=o(o({},N),{},{colors:o(o(o({},N.colors),C),k),mode:'dark',preset:'brand',name:'teen'});var y=o(o({},N),{},{colors:o(o({},N.colors),u),preset:'brand',name:'adult'});var z=o(o({},N),{},{colors:o(o(o({},N.colors),C),j),mode:'dark',preset:'brand',name:'adult'});export{z as adultDarkTheme,y as adultLightTheme,A as babyDarkTheme,g as babyLightTheme,N as defaultTheme,v as motherDarkTheme,x as motherLightTheme,O as teenDarkTheme,E as teenLightTheme};
2
2
  //# sourceMappingURL=themes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"themes.js","sources":["../../../src/theme/themes.ts"],"sourcesContent":["import type { DefaultTheme } from 'styled-components'\nimport { hexToRgbA } from 'shared/utils/colors'\nimport { relBuilder } from 'shared/utils/rel-builder'\nimport { SizeInput } from 'shared/enums/sizeInput'\nimport { COMPONENT_NAME as ARROW } from 'components/Arrow'\nimport { COMPONENT_NAME as BUTTON } from 'components/Button'\nimport { COMPONENT_NAME as CHECKBOX } from 'components/Checkbox'\nimport { colors, socialColors, unitColors } from './colors'\nimport * as ColorsLight from './colors-light'\nimport * as ColorsDark from './colors-dark'\nimport { breakpoints } from './breakpoints'\n\nexport const defaultTheme: DefaultTheme = {\n breakpoints,\n colors: {\n ...colors,\n ...socialColors,\n ...unitColors,\n ...ColorsLight.baseColors,\n ...ColorsLight.motherColors,\n },\n borderRadius: '5px',\n textColor: 'mineShaft',\n fallbackColor: 'mineShaft',\n zIndex: {\n modal: 9000,\n tooltip: 80,\n },\n classNamePrefix: 'fox',\n defaultInputControlsWidth: SizeInput.l,\n utils: {\n relBuilder,\n hexToRgbA,\n },\n mode: 'light',\n preset: 'default',\n name: 'mother',\n components: {\n [ARROW]: {\n size: 'l',\n },\n [BUTTON]: {\n size: 'm',\n },\n [CHECKBOX]: {\n size: 'm',\n },\n },\n}\n\nexport const motherLightTheme: DefaultTheme = {\n ...defaultTheme,\n preset: 'brand',\n}\n\nexport const motherDarkTheme: DefaultTheme = {\n ...defaultTheme,\n colors: {\n ...defaultTheme.colors,\n ...ColorsDark.baseColors,\n ...ColorsDark.motherColors,\n },\n mode: 'dark',\n preset: 'brand',\n}\n\nexport const babyLightTheme: DefaultTheme = {\n ...defaultTheme,\n colors: {\n ...defaultTheme.colors,\n ...ColorsLight.babyColors,\n },\n preset: 'brand',\n name: 'baby',\n}\n\nexport const babyDarkTheme: DefaultTheme = {\n ...defaultTheme,\n colors: {\n ...defaultTheme.colors,\n ...ColorsDark.baseColors,\n ...ColorsDark.babyColors,\n },\n mode: 'dark',\n preset: 'brand',\n name: 'baby',\n}\n\nexport const teenLightTheme: DefaultTheme = {\n ...defaultTheme,\n colors: {\n ...defaultTheme.colors,\n ...ColorsLight.teenColors,\n },\n preset: 'brand',\n name: 'teen',\n}\n\nexport const teenDarkTheme: DefaultTheme = {\n ...defaultTheme,\n colors: {\n ...defaultTheme.colors,\n ...ColorsDark.baseColors,\n ...ColorsDark.teenColors,\n },\n mode: 'dark',\n preset: 'brand',\n name: 'teen',\n}\n\nexport const adultLightTheme: DefaultTheme = {\n ...defaultTheme,\n colors: {\n ...defaultTheme.colors,\n ...ColorsLight.adultColors,\n },\n preset: 'brand',\n name: 'adult',\n}\n\nexport const adultDarkTheme: DefaultTheme = {\n ...defaultTheme,\n colors: {\n ...defaultTheme.colors,\n ...ColorsDark.baseColors,\n ...ColorsDark.adultColors,\n },\n mode: 'dark',\n preset: 'brand',\n name: 'adult',\n}\n"],"names":["defaultTheme","breakpoints","colors","socialColors","unitColors","ColorsLight","borderRadius","textColor","fallbackColor","zIndex","modal","tooltip","classNamePrefix","defaultInputControlsWidth","SizeInput","l","utils","relBuilder","hexToRgbA","mode","preset","name","components","COMPONENT_NAME","ARROW","size","COMPONENT_NAME$1","BUTTON","COMPONENT_NAME$2","CHECKBOX","motherLightTheme","_objectSpread","motherDarkTheme","ColorsDark","babyLightTheme","babyDarkTheme","teenLightTheme","teenDarkTheme","adultLightTheme","adultDarkTheme"],"mappings":"0vBAYO,IAAMA,EAA6B,CACxCC,YAAAA,EACAC,OACKA,EAAAA,EAAAA,EAAAA,EAAAA,EAAAA,GAAAA,GACAC,GACAC,GACAC,GACAA,GAELC,aAAc,MACdC,UAAW,YACXC,cAAe,YACfC,OAAQ,CACNC,MAAO,IACPC,QAAS,IAEXC,gBAAiB,MACjBC,0BAA2BC,EAAUC,EACrCC,MAAO,CACLC,WAAAA,EACAC,UAAAA,GAEFC,KAAM,QACNC,OAAQ,UACRC,KAAM,SACNC,WAAY,CACVC,CAACC,GAAQ,CACPC,KAAM,KAERC,CAACC,GAAS,CACRF,KAAM,KAERG,CAACC,GAAW,CACVJ,KAAM,OAKL,IAAMK,EAA8BC,EAAAA,EAAA,GACtC/B,GADsC,GAAA,CAEzCoB,OAAQ,UAGH,IAAMY,EAA6BD,EAAAA,EAAA,GACrC/B,GADqC,GAAA,CAExCE,OACKF,EAAAA,EAAAA,EAAAA,GAAAA,EAAaE,QACb+B,GACAA,GAELd,KAAM,OACNC,OAAQ,UAGH,IAAMc,EAA4BH,EAAAA,EAAA,GACpC/B,GADoC,GAAA,CAEvCE,OAAM6B,EAAAA,EAAA,GACD/B,EAAaE,QACbG,GAELe,OAAQ,QACRC,KAAM,SAGD,IAAMc,EAA2BJ,EAAAA,EAAA,GACnC/B,GADmC,GAAA,CAEtCE,OACKF,EAAAA,EAAAA,EAAAA,GAAAA,EAAaE,QACb+B,GACAA,GAELd,KAAM,OACNC,OAAQ,QACRC,KAAM,SAGD,IAAMe,EAA4BL,EAAAA,EAAA,GACpC/B,GADoC,GAAA,CAEvCE,OAAM6B,EAAAA,EAAA,GACD/B,EAAaE,QACbG,GAELe,OAAQ,QACRC,KAAM,SAGD,IAAMgB,EAA2BN,EAAAA,EAAA,GACnC/B,GADmC,GAAA,CAEtCE,OACKF,EAAAA,EAAAA,EAAAA,GAAAA,EAAaE,QACb+B,GACAA,GAELd,KAAM,OACNC,OAAQ,QACRC,KAAM,SAGD,IAAMiB,EAA6BP,EAAAA,EAAA,GACrC/B,GADqC,GAAA,CAExCE,OAAM6B,EAAAA,EAAA,GACD/B,EAAaE,QACbG,GAELe,OAAQ,QACRC,KAAM,UAGD,IAAMkB,EAA4BR,EAAAA,EAAA,GACpC/B,GADoC,GAAA,CAEvCE,OACKF,EAAAA,EAAAA,EAAAA,GAAAA,EAAaE,QACb+B,GACAA,GAELd,KAAM,OACNC,OAAQ,QACRC,KAAM"}
1
+ {"version":3,"file":"themes.js","sources":["../../../src/theme/themes.ts"],"sourcesContent":["import type { DefaultTheme } from 'styled-components'\nimport { hexToRgbA } from 'shared/utils/colors'\nimport { relBuilder } from 'shared/utils/rel-builder'\nimport { SizeInput } from 'shared/enums/sizeInput'\nimport { BREAKPOINTS } from 'shared/constants'\nimport { COMPONENT_NAME as ARROW } from 'components/Arrow'\nimport { COMPONENT_NAME as BUTTON } from 'components/Button'\nimport { COMPONENT_NAME as CHECKBOX } from 'components/Checkbox'\nimport { colors, socialColors, unitColors } from './colors'\nimport * as ColorsLight from './colors-light'\nimport * as ColorsDark from './colors-dark'\n\nexport const defaultTheme: DefaultTheme = {\n breakpoints: BREAKPOINTS,\n colors: {\n ...colors,\n ...socialColors,\n ...unitColors,\n ...ColorsLight.baseColors,\n ...ColorsLight.motherColors,\n },\n borderRadius: '5px',\n textColor: 'mineShaft',\n fallbackColor: 'mineShaft',\n zIndex: {\n modal: 9000,\n tooltip: 80,\n },\n classNamePrefix: 'fox',\n defaultInputControlsWidth: SizeInput.l,\n utils: {\n relBuilder,\n hexToRgbA,\n },\n mode: 'light',\n preset: 'default',\n name: 'mother',\n components: {\n [ARROW]: {\n size: 'l',\n },\n [BUTTON]: {\n size: 'm',\n },\n [CHECKBOX]: {\n size: 'm',\n },\n },\n}\n\nexport const motherLightTheme: DefaultTheme = {\n ...defaultTheme,\n preset: 'brand',\n}\n\nexport const motherDarkTheme: DefaultTheme = {\n ...defaultTheme,\n colors: {\n ...defaultTheme.colors,\n ...ColorsDark.baseColors,\n ...ColorsDark.motherColors,\n },\n mode: 'dark',\n preset: 'brand',\n}\n\nexport const babyLightTheme: DefaultTheme = {\n ...defaultTheme,\n colors: {\n ...defaultTheme.colors,\n ...ColorsLight.babyColors,\n },\n preset: 'brand',\n name: 'baby',\n}\n\nexport const babyDarkTheme: DefaultTheme = {\n ...defaultTheme,\n colors: {\n ...defaultTheme.colors,\n ...ColorsDark.baseColors,\n ...ColorsDark.babyColors,\n },\n mode: 'dark',\n preset: 'brand',\n name: 'baby',\n}\n\nexport const teenLightTheme: DefaultTheme = {\n ...defaultTheme,\n colors: {\n ...defaultTheme.colors,\n ...ColorsLight.teenColors,\n },\n preset: 'brand',\n name: 'teen',\n}\n\nexport const teenDarkTheme: DefaultTheme = {\n ...defaultTheme,\n colors: {\n ...defaultTheme.colors,\n ...ColorsDark.baseColors,\n ...ColorsDark.teenColors,\n },\n mode: 'dark',\n preset: 'brand',\n name: 'teen',\n}\n\nexport const adultLightTheme: DefaultTheme = {\n ...defaultTheme,\n colors: {\n ...defaultTheme.colors,\n ...ColorsLight.adultColors,\n },\n preset: 'brand',\n name: 'adult',\n}\n\nexport const adultDarkTheme: DefaultTheme = {\n ...defaultTheme,\n colors: {\n ...defaultTheme.colors,\n ...ColorsDark.baseColors,\n ...ColorsDark.adultColors,\n },\n mode: 'dark',\n preset: 'brand',\n name: 'adult',\n}\n"],"names":["defaultTheme","breakpoints","BREAKPOINTS","colors","socialColors","unitColors","ColorsLight","borderRadius","textColor","fallbackColor","zIndex","modal","tooltip","classNamePrefix","defaultInputControlsWidth","SizeInput","l","utils","relBuilder","hexToRgbA","mode","preset","name","components","COMPONENT_NAME","ARROW","size","COMPONENT_NAME$1","BUTTON","COMPONENT_NAME$2","CHECKBOX","motherLightTheme","_objectSpread","motherDarkTheme","ColorsDark","babyLightTheme","babyDarkTheme","teenLightTheme","teenDarkTheme","adultLightTheme","adultDarkTheme"],"mappings":"gwBAYO,IAAMA,EAA6B,CACxCC,YAAaC,EACbC,OACKA,EAAAA,EAAAA,EAAAA,EAAAA,EAAAA,GAAAA,GACAC,GACAC,GACAC,GACAA,GAELC,aAAc,MACdC,UAAW,YACXC,cAAe,YACfC,OAAQ,CACNC,MAAO,IACPC,QAAS,IAEXC,gBAAiB,MACjBC,0BAA2BC,EAAUC,EACrCC,MAAO,CACLC,WAAAA,EACAC,UAAAA,GAEFC,KAAM,QACNC,OAAQ,UACRC,KAAM,SACNC,WAAY,CACVC,CAACC,GAAQ,CACPC,KAAM,KAERC,CAACC,GAAS,CACRF,KAAM,KAERG,CAACC,GAAW,CACVJ,KAAM,OAKL,IAAMK,EAA8BC,EAAAA,EAAA,GACtChC,GADsC,GAAA,CAEzCqB,OAAQ,UAGH,IAAMY,EAA6BD,EAAAA,EAAA,GACrChC,GADqC,GAAA,CAExCG,OACKH,EAAAA,EAAAA,EAAAA,GAAAA,EAAaG,QACb+B,GACAA,GAELd,KAAM,OACNC,OAAQ,UAGH,IAAMc,EAA4BH,EAAAA,EAAA,GACpChC,GADoC,GAAA,CAEvCG,OAAM6B,EAAAA,EAAA,GACDhC,EAAaG,QACbG,GAELe,OAAQ,QACRC,KAAM,SAGD,IAAMc,EAA2BJ,EAAAA,EAAA,GACnChC,GADmC,GAAA,CAEtCG,OACKH,EAAAA,EAAAA,EAAAA,GAAAA,EAAaG,QACb+B,GACAA,GAELd,KAAM,OACNC,OAAQ,QACRC,KAAM,SAGD,IAAMe,EAA4BL,EAAAA,EAAA,GACpChC,GADoC,GAAA,CAEvCG,OAAM6B,EAAAA,EAAA,GACDhC,EAAaG,QACbG,GAELe,OAAQ,QACRC,KAAM,SAGD,IAAMgB,EAA2BN,EAAAA,EAAA,GACnChC,GADmC,GAAA,CAEtCG,OACKH,EAAAA,EAAAA,EAAAA,GAAAA,EAAaG,QACb+B,GACAA,GAELd,KAAM,OACNC,OAAQ,QACRC,KAAM,SAGD,IAAMiB,EAA6BP,EAAAA,EAAA,GACrChC,GADqC,GAAA,CAExCG,OAAM6B,EAAAA,EAAA,GACDhC,EAAaG,QACbG,GAELe,OAAQ,QACRC,KAAM,UAGD,IAAMkB,EAA4BR,EAAAA,EAAA,GACpChC,GADoC,GAAA,CAEvCG,OACKH,EAAAA,EAAAA,EAAAA,GAAAA,EAAaG,QACb+B,GACAA,GAELd,KAAM,OACNC,OAAQ,QACRC,KAAM"}
package/mixins/margin.js DELETED
@@ -1,2 +0,0 @@
1
- import e from'@babel/runtime/helpers/taggedTemplateLiteral';import r from'@babel/runtime/helpers/objectSpread2';import{css as t}from'styled-components';import{desktopFirst as s,getMediaQueryByResponsiveProp as a}from'./shared.js';import{marginPropKeyRegExp as o,responsiveMarginPropKeyRegExp as p}from'../shared/regexp.js';var i;var n=n=>t(["",""],[Object.keys(n).filter((e=>o.test(e)&&('string'==typeof n[e]||'number'==typeof n[e]))).reduce(((e,r)=>{var t;return e[r]='string'==typeof n[r]?n[r]:"".concat(n[r]).concat(null!==(t=n.marginUnits)&&void 0!==t?t:'px'),e}),{}),...Object.keys(n).filter((e=>p.test(e)&&('string'==typeof n[e]||'number'==typeof n[e]))).sort(s).reduce(((e,t)=>{var s=t.match(p);if(s){var o;var i=a(t);var m=e.find((e=>e[0]===i));var c={[s[1]]:'string'==typeof n[t]?n[t]:"".concat(n[t]).concat(null!==(o=n.marginUnits)&&void 0!==o?o:'px')};m?m[1]=r(r({},m[1]),c):e.push([i,c])}return e}),[]).map((r=>{var[t,s]=r;return t()(i||(i=e(["",""])),s)}))]);export{n as responsiveMargin};
2
- //# sourceMappingURL=margin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"margin.js","sources":["../../../src/mixins/margin.ts"],"sourcesContent":["import { css } from 'styled-components'\nimport type { ThemedStyledProps, DefaultTheme, CSSObject, FlattenInterpolation, ThemeProps } from 'styled-components'\nimport { getMediaQueryByResponsiveProp, desktopFirst } from 'mixins/shared'\nimport { marginPropKeyRegExp, responsiveMarginPropKeyRegExp } from 'shared/regexp'\nimport type { MediaQuery } from 'mixins/screen'\nimport type { ResponsiveMarginProps } from 'shared/interfaces'\n\n/**\n *\n * Mixin enables support for responsive margin in styled component\n */\nconst responsiveMargin = (\n props: ThemedStyledProps<ResponsiveMarginProps, DefaultTheme>\n): FlattenInterpolation<ThemeProps<DefaultTheme>> => {\n return css`\n ${[\n Object.keys(props)\n .filter(\n (propKey) =>\n marginPropKeyRegExp.test(propKey) &&\n (typeof props[propKey] === 'string' || typeof props[propKey] === 'number')\n )\n .reduce((cssObject, propKey) => {\n return (\n (cssObject[propKey] =\n typeof props[propKey] === 'string' ? props[propKey] : `${props[propKey]}${props.marginUnits ?? 'px'}`),\n cssObject\n )\n }, {} as CSSObject),\n ...Object.keys(props)\n .filter(\n (propKey) =>\n responsiveMarginPropKeyRegExp.test(propKey) &&\n (typeof props[propKey] === 'string' || typeof props[propKey] === 'number')\n )\n .sort(desktopFirst)\n .reduce((breakpointsTuples, propKey) => {\n const matched = propKey.match(responsiveMarginPropKeyRegExp)\n\n if (matched) {\n const mediaQuery = getMediaQueryByResponsiveProp(propKey)\n const tupleFound = breakpointsTuples.find((tuple) => tuple[0] === mediaQuery)\n\n const propertyEntry = {\n [matched[1]]:\n typeof props[propKey] === 'string' ? props[propKey] : `${props[propKey]}${props.marginUnits ?? 'px'}`,\n }\n\n if (tupleFound) tupleFound[1] = { ...tupleFound[1], ...propertyEntry }\n else breakpointsTuples.push([mediaQuery, propertyEntry])\n }\n\n return breakpointsTuples\n }, [] as [MediaQuery, CSSObject][])\n .map(([mediaQuery, cssObject]) => mediaQuery()`${cssObject}`),\n ]}\n `\n}\n\nexport { responsiveMargin }\n"],"names":["responsiveMargin","props","css","Object","keys","filter","propKey","marginPropKeyRegExp","test","reduce","cssObject","_props$marginUnits","concat","marginUnits","responsiveMarginPropKeyRegExp","sort","desktopFirst","breakpointsTuples","matched","match","_props$marginUnits2","mediaQuery","getMediaQueryByResponsiveProp","tupleFound","find","tuple","propertyEntry","_objectSpread","push","map","_ref","_templateObject","_taggedTemplateLiteral"],"mappings":"yUAWMA,IAAAA,EACJC,GAEOC,EACH,CAAA,GAAA,IAAA,CACAC,OAAOC,KAAKH,GACTI,QACEC,GACCC,EAAoBC,KAAKF,KACE,iBAAnBL,EAAMK,IAAmD,iBAAnBL,EAAMK,MAEvDG,QAAAA,CAAQC,EAAWJ,KAAY,IAAAK,EAC9B,OACGD,EAAUJ,GACiB,iBAAnBL,EAAMK,GAAwBL,EAAMK,GAAcL,GAAAA,OAAAA,EAAMK,IAA/DM,OAAA,QAAAD,EAA0EV,EAAMY,uBAAhFF,EAAAA,EAA+F,MACjGD,IAED,OACFP,OAAOC,KAAKH,GACZI,QACEC,GACCQ,EAA8BN,KAAKF,KACR,iBAAnBL,EAAMK,IAAmD,iBAAnBL,EAAMK,MAEvDS,KAAKC,GACLP,QAAAA,CAAQQ,EAAmBX,KAC1B,IAAMY,EAAUZ,EAAQa,MAAML,GAE9B,GAAII,EAAS,CAAA,IAAAE,EACX,IAAMC,EAAaC,EAA8BhB,GACjD,IAAMiB,EAAaN,EAAkBO,MAAMC,GAAUA,EAAM,KAAOJ,IAElE,IAAMK,EAAgB,CACpB,CAACR,EAAQ,IACmB,iBAAnBjB,EAAMK,GAAwBL,EAAMK,GAAcL,GAAAA,OAAAA,EAAMK,IAA/DM,OAAA,QAAAQ,EAA0EnB,EAAMY,mBAAhF,IAAAO,EAAAA,EAA+F,OAG/FG,EAAYA,EAAW,GAAXI,EAAAA,EAAA,GAAqBJ,EAAW,IAAOG,GAClDT,EAAkBW,KAAK,CAACP,EAAYK,IAG3C,OAAOT,IACN,IACFY,KAAIC,IAAA,IAAET,EAAYX,GAAdoB,EAAA,OAA6BT,GAAAA,CAA7BU,IAAAA,EAAAC,EAAA,CAAA,GAAA,MAA4CtB"}
package/mixins/size.js DELETED
@@ -1,2 +0,0 @@
1
- import e from'@babel/runtime/helpers/taggedTemplateLiteral';import{css as r}from'styled-components';import{desktopFirst as s,getMediaQueryByResponsiveProp as i}from'./shared.js';import{screenMinM as a,screenMaxM as t,screenMaxS as n,screenMinL as o,screenMaxL as p,screenMaxXs as c,screenMaxXxs as l}from'./screen.js';import{responsiveSizePropKeyRegExp as m}from'../shared/regexp.js';import{isCSSGlobalValue as z}from'../shared/utils/style.js';var v,y;var f=function(e,r,s,i,a){var t;var n=arguments.length>2&&void 0!==s?s:'fontSize';var o=arguments.length>3&&void 0!==i?i:'px';var p=arguments.length>4?a:void 0;if('number'==typeof e||z(e)){var c='function'==typeof p?p(e,n,o):{[n]:'string'==typeof e?e:"".concat(e).concat(o)};return c}return null!==(t=r[e])&&void 0!==t?t:{}};var u=z=>{if(Array.isArray(z.size)){var u=[a,t,n];var d=z.size.length>u.length?[o,p,t,n,c,l]:u;return r(["",""],z.size.map(((r,s)=>{var i=d[s];return'function'==typeof i?i()(v||(v=e(["",""])),f(r,z.sizes,z.sizeProperty,z.sizeUnits,z.dynamicSizeDeclaration)):null})))}return r(["",""],[f(z.size,z.sizes,z.sizeProperty,z.sizeUnits,z.dynamicSizeDeclaration),...Object.keys(z).filter((e=>m.test(e))).sort(s).map((r=>i(r)()(y||(y=e(["",""])),f(z[r],z.sizes,z.sizeProperty,z.sizeUnits,z.dynamicSizeDeclaration))))])};export{u as responsiveSize};
2
- //# sourceMappingURL=size.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"size.js","sources":["../../../src/mixins/size.ts"],"sourcesContent":["import { css } from 'styled-components'\nimport type { ThemedStyledProps, DefaultTheme, CSSObject, FlattenInterpolation, ThemeProps } from 'styled-components'\nimport type { CSSProperties } from 'react'\nimport { getMediaQueryByResponsiveProp, desktopFirst } from 'mixins/shared'\nimport type { MediaQuery } from 'mixins/screen'\nimport { screenMinM, screenMaxM, screenMaxS, screenMinL, screenMaxL, screenMaxXs, screenMaxXxs } from 'mixins/screen'\nimport { responsiveSizePropKeyRegExp } from 'shared/regexp'\nimport { isCSSGlobalValue } from 'shared/utils/style'\nimport type { ResponsiveSizeProps, CommonInterpolationProps, DynamicSizeDeclaration } from 'shared/interfaces'\nimport type { CSSUnit, SizeValue, Sizes } from 'shared/types'\n\nconst buildSizeCSSDeclarations = (\n size: SizeValue,\n sizes: Partial<Sizes>,\n cssProperty: keyof CSSProperties = 'fontSize',\n cssUnit: CSSUnit = 'px',\n dynamicDeclaration?: DynamicSizeDeclaration\n): CSSObject => {\n if (typeof size === 'number' || isCSSGlobalValue(size)) {\n const declarations =\n typeof dynamicDeclaration === 'function'\n ? dynamicDeclaration(size, cssProperty, cssUnit)\n : { [cssProperty]: typeof size === 'string' ? size : `${size}${cssUnit}` }\n\n return declarations as CSSObject\n }\n\n return (sizes[size] ?? {}) as CSSObject\n}\n\n/**\n *\n * Mixin enables support for responsive size in styled component\n */\nconst responsiveSize = (\n props: ThemedStyledProps<CommonInterpolationProps<ResponsiveSizeProps>, DefaultTheme>\n): FlattenInterpolation<ThemeProps<DefaultTheme>> => {\n if (Array.isArray(props.size)) {\n const deviceMediaQueries: [desktop: MediaQuery, tablet: MediaQuery, mobile: MediaQuery] = [\n screenMinM,\n screenMaxM,\n screenMaxS,\n ]\n\n const breakpointsMediaQueries: [\n xl: MediaQuery,\n l: MediaQuery,\n m: MediaQuery,\n s: MediaQuery,\n xs: MediaQuery,\n xxs: MediaQuery\n ] = [screenMinL, screenMaxL, screenMaxM, screenMaxS, screenMaxXs, screenMaxXxs]\n\n const queries: MediaQuery[] =\n props.size.length > deviceMediaQueries.length ? breakpointsMediaQueries : deviceMediaQueries\n\n return css`\n ${props.size.map((size, idx) => {\n const mediaQuery: MediaQuery | void = queries[idx]\n\n return typeof mediaQuery === 'function'\n ? mediaQuery()`${buildSizeCSSDeclarations(\n size,\n props.sizes,\n props.sizeProperty,\n props.sizeUnits,\n props.dynamicSizeDeclaration\n )}`\n : null\n })}\n `\n } else {\n return css`\n ${[\n buildSizeCSSDeclarations(\n props.size,\n props.sizes,\n props.sizeProperty,\n props.sizeUnits,\n props.dynamicSizeDeclaration\n ),\n ...Object.keys(props)\n .filter((propKey) => responsiveSizePropKeyRegExp.test(propKey))\n .sort(desktopFirst)\n .map(\n (sizeProp) =>\n getMediaQueryByResponsiveProp(sizeProp)()`${buildSizeCSSDeclarations(\n props[sizeProp],\n props.sizes,\n props.sizeProperty,\n props.sizeUnits,\n props.dynamicSizeDeclaration\n )}`\n ),\n ]}\n `\n }\n}\n\nexport { responsiveSize }\n"],"names":["buildSizeCSSDeclarations","size","sizes","t","i","s","_sizes$size","cssProperty","cssUnit","dynamicDeclaration","arguments","length","isCSSGlobalValue","declarations","concat","responsiveSize","props","Array","isArray","deviceMediaQueries","screenMinM","screenMaxM","screenMaxS","queries","screenMinL","screenMaxL","screenMaxXs","screenMaxXxs","css","map","idx","mediaQuery","_templateObject","_taggedTemplateLiteral","sizeProperty","sizeUnits","dynamicSizeDeclaration","Object","keys","filter","propKey","responsiveSizePropKeyRegExp","test","sort","desktopFirst","sizeProp","getMediaQueryByResponsiveProp"],"mappings":"ocAWA,IAAMA,EAA2B,SAC/BC,EACAC,EAF+BC,EAAAC,EAAAC,GAMjB,IAAAC,EAAA,IAHdC,+BAH+BJ,EAAAA,EAGI,WAGrB,IAFdK,+BAJ+BJ,EAAAA,EAIZ,KAEL,IADdK,EACcC,UAAAC,OAAA,EANiBN,SAO/B,GAAoB,iBAATJ,GAAqBW,EAAiBX,GAAO,CACtD,IAAMY,EAC0B,mBAAvBJ,EACHA,EAAmBR,EAAMM,EAAaC,GACtC,CAAED,CAACA,GAA8B,iBAATN,EAAoBA,EAA3B,GAAAa,OAAqCb,GAArCa,OAA4CN,IAEnE,OAAOK,EAGT,eAAAP,EAAQJ,EAAMD,UAAAA,QAAS,IAOnBc,IAAAA,EACJC,IAEA,GAAIC,MAAMC,QAAQF,EAAMf,MAAO,CAC7B,IAAMkB,EAAoF,CACxFC,EACAC,EACAC,GAYF,IAAMC,EACJP,EAAMf,KAAKU,OAASQ,EAAmBR,OAHrC,CAACa,EAAYC,EAAYJ,EAAYC,EAAYI,EAAaC,GAGUR,EAE5E,OAAOS,EAAP,CAAA,GAAA,IACIZ,EAAMf,KAAK4B,KAAAA,CAAK5B,EAAM6B,KACtB,IAAMC,EAAgCR,EAAQO,GAE9C,MAA6B,mBAAfC,EACVA,GAAAA,CADGC,IAAAA,EAAAC,EAAA,CAAA,GAAA,MACYjC,EACbC,EACAe,EAAMd,MACNc,EAAMkB,aACNlB,EAAMmB,UACNnB,EAAMoB,yBAER,SAIR,OAAOR,EACH,CAAA,GAAA,IAAA,CACA5B,EACEgB,EAAMf,KACNe,EAAMd,MACNc,EAAMkB,aACNlB,EAAMmB,UACNnB,EAAMoB,2BAELC,OAAOC,KAAKtB,GACZuB,QAAQC,GAAYC,EAA4BC,KAAKF,KACrDG,KAAKC,GACLf,KACEgB,GACCC,EAA8BD,EAA9BC,EAAAA,mBAA4C9C,EAC1CgB,EAAM6B,GACN7B,EAAMd,MACNc,EAAMkB,aACNlB,EAAMmB,UACNnB,EAAMoB"}
@@ -1,2 +0,0 @@
1
- var e=Object.freeze({xl:1440,l:1280,m:1024,s:768,xs:374,xxs:320});export{e as breakpoints};
2
- //# sourceMappingURL=breakpoints.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"breakpoints.js","sources":["../../../src/theme/breakpoints.ts"],"sourcesContent":["export const breakpoints = Object.freeze({\n xl: 1440,\n l: 1280,\n m: 1024,\n s: 768,\n xs: 374,\n xxs: 320,\n})\n"],"names":["breakpoints","Object","freeze","xl","l","m","s","xs","xxs"],"mappings":"IAAaA,EAAcC,OAAOC,OAAO,CACvCC,GAAI,KACJC,EAAG,KACHC,EAAG,KACHC,EAAG,IACHC,GAAI,IACJC,IAAK"}