@foxford/ui 2.19.2 → 2.20.0-beta-74e0253-20240306
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.
- package/components/Anchor/Anchor.js.map +1 -1
- package/components/ArrowBadge/ArrowBadge.js.map +1 -1
- package/components/Badge/Badge.js.map +1 -1
- package/components/Button/Button.js.map +1 -1
- package/components/FormInputLabel/FormInputLabel.js +2 -0
- package/components/FormInputLabel/FormInputLabel.js.map +1 -0
- package/components/FormInputLabel/constants.js +2 -0
- package/components/FormInputLabel/constants.js.map +1 -0
- package/components/FormInputLabel/style.js +2 -0
- package/components/FormInputLabel/style.js.map +1 -0
- package/components/FormLabel/FormLabel.js.map +1 -1
- package/components/Input/Input.js +1 -1
- package/components/Input/Input.js.map +1 -1
- package/components/Input/images/minus.module.svg.js +2 -0
- package/components/Input/images/minus.module.svg.js.map +1 -0
- package/components/Input/images/plus.module.svg.js +2 -0
- package/components/Input/images/plus.module.svg.js.map +1 -0
- package/components/Input/style.js +1 -1
- package/components/Input/style.js.map +1 -1
- package/components/Input.Phone/Input.Phone.js +1 -1
- package/components/Input.Phone/Input.Phone.js.map +1 -1
- package/components/InputCheckbox/InputCheckbox.js.map +1 -1
- package/components/InputRadio/InputRadio.js.map +1 -1
- package/components/Tab/Tab.js.map +1 -1
- package/components/Text/Text.js.map +1 -1
- package/components/Text/style.js +1 -1
- package/components/Text/style.js.map +1 -1
- package/components/Textarea/Textarea.js.map +1 -1
- package/components/Textarea/style.js.map +1 -1
- package/dts/index.d.ts +282 -273
- package/index.cjs.js +1 -1
- package/index.cjs.js.map +1 -1
- package/mixins/create-responsive-props.js +1 -1
- package/mixins/create-responsive-props.js.map +1 -1
- package/package.json +3 -5
|
@@ -1,2 +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
|
|
1
|
+
import e from'@babel/runtime/helpers/taggedTemplateLiteral';import{css as r}from'styled-components';import{screenMinM as s,screenMaxM as a,screenMaxS as t,screenMinL as n,screenMaxL as c,screenMaxXs as o,screenMaxXxs as p}from'./screen.js';import{desktopFirst as i,getMediaQueryByResponsiveProp as v}from'./shared.js';var u,h;function l(l,M){var g=new RegExp("^(".concat(l.join('|'),")$"));var m=new RegExp("^(".concat(l.join('|'),")(XXS|XS|S|M|L|XL)$"));var x=/(XXS|XS|S|M|L|XL)$/;var X=[s,a,t];var y=[n,c,a,t,o,p];return s=>{var a=Object.keys(s).reduce(((e,r)=>(g.test(r)?e[0].push(r):m.test(r)&&e[1].push(r),e)),[[],[]]);var t=a[0].reduce(((r,a)=>{var t=s[a];if(Array.isArray(t)){if(t.length>0){var n=[];var c=t.length>X.length?y:X;for(var o=0;o<t.length&&c[o];o++){var p=M(a,t[o],s);Object.keys(p).length>0&&n.push(c[o]()(u||(u=e(["",""])),p))}r.push(...n)}}else{var i=M(a,t,s);Object.keys(i).length>0&&r.push(i)}return r}),[]);var n=a[1].sort(i).reduce(((r,a)=>{var t=M(a.replace(x,''),s[a],s);return Object.keys(t).length>0&&r.push(v(a)()(h||(h=e(["",""])),t)),r}),[]);return r([""," ",""],t,n)}}export{l as createResponsivePropsMixin};
|
|
2
2
|
//# sourceMappingURL=create-responsive-props.js.map
|
|
@@ -1 +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
|
|
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 const cssObject = buildCSSObject(propKey as K, propValue, props)\n\n if (Object.keys(cssObject).length > 0) {\n acc.push(cssObject)\n }\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\n const cssObject = buildCSSObject(propKey as K, propValue[i], props)\n\n if (Object.keys(cssObject).length > 0) {\n mediaFunctions.push(queries[i]()`${cssObject}`)\n }\n }\n\n acc.push(...mediaFunctions)\n }\n\n return acc\n }, [] as (CSSObject | MediaFunction)[])\n\n const breakpointsInterpolations = propsKeys[1].sort(desktopFirst).reduce((acc, propKey) => {\n const cssObject = buildCSSObject(propKey.replace(breakpointsRegExp, '') as K, props[propKey], props)\n\n if (Object.keys(cssObject).length > 0) {\n acc.push(getMediaQueryByResponsiveProp(propKey)()`${cssObject}`)\n }\n\n return acc\n }, [] as MediaFunction[])\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","cssObject","_templateObject","_taggedTemplateLiteral","breakpointsInterpolations","sort","desktopFirst","replace","getMediaQueryByResponsiveProp","_templateObject2","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,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20240306",
|
|
4
4
|
"description": "UI components library",
|
|
5
5
|
"main": "index.cjs.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -8,14 +8,12 @@
|
|
|
8
8
|
"typings": "dts/index.d.ts",
|
|
9
9
|
"peerDependencies": {
|
|
10
10
|
"@foxford/icon-pack": ">=0.0.4 <1",
|
|
11
|
-
"@types/react-input-mask": ">=2.0",
|
|
12
11
|
"@types/react-modal": ">=3.13",
|
|
13
12
|
"clsx": ">=1.1",
|
|
14
13
|
"ramda": ">=0.25",
|
|
15
14
|
"rc-scrollbars": ">=1.1",
|
|
16
15
|
"react": ">=16 <=18",
|
|
17
16
|
"react-dom": ">=16 <=18",
|
|
18
|
-
"react-input-mask": ">=2.0",
|
|
19
17
|
"react-modal": ">=3.15",
|
|
20
18
|
"react-router-dom": ">=5.x.x",
|
|
21
19
|
"react-select": "1.3.x",
|
|
@@ -39,14 +37,13 @@
|
|
|
39
37
|
"dependencies": {
|
|
40
38
|
"@babel/runtime": ">=7.0",
|
|
41
39
|
"@foxford/icon-pack": ">=0.2.0 <1",
|
|
42
|
-
"classnames": ">=2.3",
|
|
43
40
|
"clsx": ">=1.1",
|
|
44
41
|
"ramda": ">=0.25",
|
|
45
42
|
"rc-scrollbars": ">=1.1",
|
|
46
43
|
"react": ">=16 <=18",
|
|
47
44
|
"react-dom": ">=16 <=18",
|
|
48
45
|
"react-floater": "0.8.2",
|
|
49
|
-
"react-input-mask": "
|
|
46
|
+
"react-input-mask": "2.0.4",
|
|
50
47
|
"react-modal": ">=3.15",
|
|
51
48
|
"react-router-dom": ">=5.x.x",
|
|
52
49
|
"react-select": "1.3.x",
|
|
@@ -85,3 +82,4 @@
|
|
|
85
82
|
"ui-kit"
|
|
86
83
|
]
|
|
87
84
|
}
|
|
85
|
+
|