@foxford/ui 2.8.0-beta-7814470-20230824 → 2.8.0-beta-b32a5c6-20230828
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/ArrowBadge/ArrowBadge.js +1 -1
- package/components/ArrowBadge/ArrowBadge.js.map +1 -1
- package/components/ArrowBadge/SideShape.js +2 -0
- package/components/ArrowBadge/SideShape.js.map +1 -0
- package/components/ArrowBadge/style.js +1 -1
- package/components/ArrowBadge/style.js.map +1 -1
- package/index.cjs.js +1 -1
- package/index.cjs.js.map +1 -1
- package/package.json +1 -1
- package/components/ArrowBadge/Shape.js +0 -2
- package/components/ArrowBadge/Shape.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e from'@babel/runtime/helpers/objectSpread2';import s from'@babel/runtime/helpers/objectWithoutProperties';import{useClassname as r}from'../../hooks/useClassname.js';import{Root as a,Inner as
|
|
1
|
+
import e from'@babel/runtime/helpers/objectSpread2';import s from'@babel/runtime/helpers/objectWithoutProperties';import{useClassname as r}from'../../hooks/useClassname.js';import{Root as a,Inner as i,Text as o}from'./style.js';import{SideShape as t}from'./SideShape.js';import{jsx as l,jsxs as m}from'react/jsx-runtime';var n=["children","content","className","display"];function p(d){var{children:c,content:h,className:j,display:u="inline-block"}=d,b=s(d,n);var f=r(p.displayName,j);return l(a,e(e({className:f,display:u},b),{},{children:m(i,e(e({},b),{},{children:[l(t,e({},b)),l(o,e(e({},b),{},{children:c||h})),l(t,e(e({},b),{},{isRightSide:!0}))]}))}))}p.displayName='ArrowBadge';export{p as ArrowBadge};
|
|
2
2
|
//# sourceMappingURL=ArrowBadge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArrowBadge.js","sources":["../../../../src/components/ArrowBadge/ArrowBadge.tsx"],"sourcesContent":["import { useClassname } from 'hooks/useClassname'\nimport * as Styled from './style'\nimport { ArrowBadgeProps } from './types'\nimport {
|
|
1
|
+
{"version":3,"file":"ArrowBadge.js","sources":["../../../../src/components/ArrowBadge/ArrowBadge.tsx"],"sourcesContent":["import { useClassname } from 'hooks/useClassname'\nimport * as Styled from './style'\nimport { ArrowBadgeProps } from './types'\nimport { SideShape } from './SideShape'\n\nArrowBadge.displayName = 'ArrowBadge'\n\n/**\n * Расширен:\n * - [`BaseProps`](#/Миксины)\n * - [`Color`](#/Миксины)\n * - [`Display`](#/Миксины)\n */\nexport function ArrowBadge({ children, content, className, display = 'inline-block', ...restProps }: ArrowBadgeProps) {\n const _className = useClassname(ArrowBadge.displayName, className)\n\n return (\n <Styled.Root className={_className} display={display} {...restProps}>\n <Styled.Inner {...restProps}>\n <SideShape {...restProps} />\n <Styled.Text {...restProps}>{children || content}</Styled.Text>\n <SideShape {...restProps} isRightSide />\n </Styled.Inner>\n </Styled.Root>\n )\n}\n"],"names":["ArrowBadge","_ref","children","content","className","display","restProps","_objectWithoutProperties","_excluded","_className","useClassname","displayName","_jsx","Styled.Root","_objectSpread","_jsxs","Styled.Inner","SideShape","Styled.Text","isRightSide"],"mappings":"oXAaO,SAASA,EAAsGC,GAAA,IAA3FC,SAAEA,EAAFC,QAAYA,EAAZC,UAAqBA,EAArBC,QAAgCA,EAAU,gBAAiDJ,EAA9BK,EAA8BC,EAAAN,EAAAO,GACpH,IAAMC,EAAaC,EAAaV,EAAWW,YAAaP,GAExD,OACEQ,EAACC,EAADC,EAAAA,EAAA,CAAaV,UAAWK,EAAYJ,QAASA,GAAaC,GAA1D,GAAA,CAAAJ,SACEa,EAACC,SAAiBV,GAAlB,GAAA,CAAAJ,SACE,CAAAU,EAACK,EAADH,EAAA,GAAeR,IACfM,EAACM,EAADJ,EAAAA,EAAA,GAAiBR,GAAjB,GAAA,CAAAJ,SAA6BA,GAAYC,KACzCS,EAACK,EAADH,EAAAA,EAAA,GAAeR,GAAf,GAAA,CAA0Ba,aAAW,YAhB7CnB,EAAWW,YAAc"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import e from'@babel/runtime/helpers/objectSpread2';import r from'@babel/runtime/helpers/objectWithoutProperties';import{SquareShape as a,RightTailShape as t,RightArrowShape as i,LeftTailShape as s,LeftArrowShape as h}from'./style.js';import{jsx as p}from'react/jsx-runtime';var o=["isRightSide","leftShape","rightShape"];function u(u){var{isRightSide:S=!1,leftShape:l="square",rightShape:f="square"}=u,m=r(u,o);if(S)switch(f){case'arrow':return p(i,e({},m));case'tail':return p(t,e({},m));default:return p(a,e({},m))}switch(l){case'arrow':return p(h,e({},m));case'tail':return p(s,e({},m));default:return p(a,e({},m))}}export{u as SideShape};
|
|
2
|
+
//# sourceMappingURL=SideShape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SideShape.js","sources":["../../../../src/components/ArrowBadge/SideShape.tsx"],"sourcesContent":["import * as Styled from './style'\nimport { SideShapeProps } from './types'\n\nexport function SideShape({\n isRightSide = false,\n leftShape = 'square',\n rightShape = 'square',\n ...restProps\n}: SideShapeProps) {\n if (isRightSide) {\n switch (rightShape) {\n case 'arrow':\n return <Styled.RightArrowShape {...restProps} />\n case 'tail':\n return <Styled.RightTailShape {...restProps} />\n\n default:\n return <Styled.SquareShape {...restProps} />\n }\n }\n\n switch (leftShape) {\n case 'arrow':\n return <Styled.LeftArrowShape {...restProps} />\n case 'tail':\n return <Styled.LeftTailShape {...restProps} />\n\n default:\n return <Styled.SquareShape {...restProps} />\n }\n}\n"],"names":["SideShape","_ref","isRightSide","leftShape","rightShape","restProps","_objectWithoutProperties","_excluded","_jsx","Styled.RightArrowShape","_objectSpread","Styled.RightTailShape","Styled.SquareShape","Styled.LeftArrowShape","Styled.LeftTailShape"],"mappings":"kUAGO,SAASA,EAKGC,GAAA,IALOC,YACxBA,KADwBC,UAExBA,EAAY,SAFYC,WAGxBA,EAAa,UAEIH,EADdI,EACcC,EAAAL,EAAAM,GACjB,GAAIL,EACF,OAAQE,GACN,IAAK,QACH,OAAOI,EAACC,EAADC,EAAA,GAA4BL,IACrC,IAAK,OACH,OAAOG,EAACG,EAADD,EAAA,GAA2BL,IAEpC,QACE,OAAOG,EAACI,EAADF,EAAA,GAAwBL,IAIrC,OAAQF,GACN,IAAK,QACH,OAAOK,EAACK,EAADH,EAAA,GAA2BL,IACpC,IAAK,OACH,OAAOG,EAACM,EAADJ,EAAA,GAA0BL,IAEnC,QACE,OAAOG,EAACI,EAADF,EAAA,GAAwBL"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import r,{css as o}from'styled-components';import{display as a}from'../../mixins/display.js';import n from'./images/arrow.module.svg.js';import t from'./images/tail.module.svg.js';var s='xl';var i={s:24,m:20,l:40,xl:48};var e={s:10,m:14,l:22,xl:28};var c={s:6,m:8,l:13,xl:16};var l=o(["",""],(r=>{var{theme:o,secondary:a,third:n,fourth:t,small:s=!1}=r;return s?o.colors['content-onmain-primary']:a?o.colors['mother'===o.name?'content-brand-secondary':'content-onmain-primary']:n||t?o.colors['content-onmain-primary']:o.colors['content-brand-primary']}));var d=o(["",""],(r=>{var{theme:o,secondary:a,third:n,fourth:t}=r;return a?o.colors['bg-brand-secondary-100']:n?o.colors['bg-brand-tertiary-200']:t?o.colors['bg-brand-quaternary-200']:o.colors['bg-brand-primary-200']}));var m=r.div.withConfig({shouldForwardProp:r=>['children','className','style'].includes(r)}).withConfig({componentId:"fox-ui__sc-gzccd8-0"})(["",";"],(r=>r.display?a(r.display):null));var p=r.div.withConfig({componentId:"fox-ui__sc-gzccd8-1"})(["",""],(r=>{var{size:a=s,small:n=!1}=r;return o(["display:flex;height:","px;"],n?32:i[a])}));var f=r.div.withConfig({componentId:"fox-ui__sc-gzccd8-2"})(["",""],(r=>{var{size:a=s}=r;return o(["width:","px;background-color:",";"],c[a],d)}));var g=r(n).withConfig({componentId:"fox-ui__sc-gzccd8-3"})(["color:",";transform:translateX(0.5px);"],d);var h=r(g).withConfig({componentId:"fox-ui__sc-gzccd8-4"})(["transform:scaleX(-1) translateX(0.5px);"]);var u=r(t).withConfig({componentId:"fox-ui__sc-gzccd8-5"})(["color:",";transform:translateX(0.5px);"],d);var x=r(u).withConfig({componentId:"fox-ui__sc-gzccd8-6"})(["transform:scaleX(-1) translateX(0.5px);"]);var v=r.div.withConfig({componentId:"fox-ui__sc-gzccd8-7"})(["",""],(r=>{var{size:a=s,small:n=!1}=r;return o(["color:",";background-color:",";font-size:","px;line-height:","px;",";"],l,d,n?14:e[a],n?32:i[a],n?null:"\n font-family: 'TT Foxford';\n text-transform: uppercase;\n font-weight: 800;\n ")}));export{p as Inner,g as LeftArrowShape,u as LeftTailShape,h as RightArrowShape,x as RightTailShape,m as Root,f as SquareShape,v as Text};
|
|
2
2
|
//# sourceMappingURL=style.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.js","sources":["../../../../src/components/ArrowBadge/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { display } from '../../mixins/display'\nimport { ArrowBadgeProps, ArrowBadgeSize,
|
|
1
|
+
{"version":3,"file":"style.js","sources":["../../../../src/components/ArrowBadge/style.ts"],"sourcesContent":["import styled, { css } from 'styled-components'\nimport { display } from '../../mixins/display'\nimport { ArrowBadgeProps, ArrowBadgeSize, SideShapeProps } from './types'\nimport Arrow from './images/arrow.module.svg'\nimport Tail from './images/tail.module.svg'\n\nconst DEFAULT_SIZE: ArrowBadgeSize = 'xl'\n\nconst HEIGHT: Record<ArrowBadgeSize, number> = {\n s: 24,\n m: 20,\n l: 40,\n xl: 48,\n}\n\nconst SMALL_HEIGHT = 32\n\nconst TEXT_SIZES: Record<ArrowBadgeSize, number> = {\n s: 10,\n m: 14,\n l: 22,\n xl: 28,\n}\n\nconst SMALL_TEXT_SIZE = 14\n\nconst SQUARE_SHAPE_SIZES: Record<ArrowBadgeSize, number> = {\n s: 6,\n m: 8,\n l: 13,\n xl: 16,\n}\n\nconst textColor = css<ArrowBadgeProps>`\n ${({ theme, secondary, third, fourth, small = false }) => {\n const isMotherTheme = theme.name === 'mother'\n\n if (small) return theme.colors['content-onmain-primary']\n if (secondary) return theme.colors[isMotherTheme ? 'content-brand-secondary' : 'content-onmain-primary']\n if (third) return theme.colors['content-onmain-primary']\n if (fourth) return theme.colors['content-onmain-primary']\n\n return theme.colors['content-brand-primary']\n }}\n`\n\nconst backgroundColor = css<ArrowBadgeProps>`\n ${({ theme, secondary, third, fourth }) => {\n if (secondary) return theme.colors['bg-brand-secondary-100']\n if (third) return theme.colors['bg-brand-tertiary-200']\n if (fourth) return theme.colors['bg-brand-quaternary-200']\n\n return theme.colors['bg-brand-primary-200']\n }}\n`\n\nexport const Root = styled.div.withConfig<ArrowBadgeProps>({\n shouldForwardProp: (prop) => ['children', 'className', 'style'].includes(prop),\n})`\n ${(props) => (props.display ? display(props.display) : null)};\n`\n\nexport const Inner = styled.div<ArrowBadgeProps>`\n ${({ size = DEFAULT_SIZE, small = false }) => {\n const height = small ? SMALL_HEIGHT : HEIGHT[size]\n\n return css`\n display: flex;\n height: ${height}px;\n `\n }}\n`\n\nexport const SquareShape = styled.div<SideShapeProps>`\n ${({ size = DEFAULT_SIZE }) => {\n const currentSize = SQUARE_SHAPE_SIZES[size]\n\n return css`\n width: ${currentSize}px;\n background-color: ${backgroundColor};\n `\n }}\n`\n\nexport const LeftArrowShape = styled(Arrow)<SideShapeProps>`\n color: ${backgroundColor};\n transform: translateX(0.5px);\n`\n\nexport const RightArrowShape = styled(LeftArrowShape)<SideShapeProps>`\n transform: scaleX(-1) translateX(0.5px);\n`\n\nexport const LeftTailShape = styled(Tail)<SideShapeProps>`\n color: ${backgroundColor};\n transform: translateX(0.5px);\n`\n\nexport const RightTailShape = styled(LeftTailShape)<SideShapeProps>`\n transform: scaleX(-1) translateX(0.5px);\n`\n\nexport const Text = styled.div<ArrowBadgeProps>`\n ${({ size = DEFAULT_SIZE, small = false }) => {\n const fontSize: number = small ? SMALL_TEXT_SIZE : TEXT_SIZES[size]\n const lineHeight: number = small ? SMALL_HEIGHT : HEIGHT[size]\n\n return css`\n color: ${textColor};\n background-color: ${backgroundColor};\n font-size: ${fontSize}px;\n line-height: ${lineHeight}px;\n\n ${!small\n ? `\n font-family: 'TT Foxford';\n text-transform: uppercase;\n font-weight: 800;\n `\n : null};\n `\n }}\n`\n"],"names":["DEFAULT_SIZE","HEIGHT","s","m","l","xl","TEXT_SIZES","SQUARE_SHAPE_SIZES","textColor","css","_ref","theme","secondary","third","fourth","small","colors","name","backgroundColor","_ref2","Root","styled","div","withConfig","shouldForwardProp","prop","includes","componentId","props","display","Inner","_ref3","size","SquareShape","_ref4","LeftArrowShape","Arrow","RightArrowShape","LeftTailShape","Tail","RightTailShape","Text","_ref5"],"mappings":"oLAMA,IAAMA,EAA+B,KAErC,IAAMC,EAAyC,CAC7CC,EAAG,GACHC,EAAG,GACHC,EAAG,GACHC,GAAI,IAKN,IAAMC,EAA6C,CACjDJ,EAAG,GACHC,EAAG,GACHC,EAAG,GACHC,GAAI,IAKN,IAAME,EAAqD,CACzDL,EAAG,EACHC,EAAG,EACHC,EAAG,GACHC,GAAI,IAGN,IAAMG,EAAYC,EAAH,CAAA,GAAA,KACXC,IAAwD,IAAvDC,MAAEA,EAAFC,UAASA,EAATC,MAAoBA,EAApBC,OAA2BA,EAA3BC,MAAmCA,MAAoBL,EAGxD,OAAIK,EAAcJ,EAAMK,OAAO,0BAC3BJ,EAAkBD,EAAMK,OAHS,WAAfL,EAAMM,KAGuB,0BAA4B,0BAC3EJ,GACAC,EADcH,EAAMK,OAAO,0BAGxBL,EAAMK,OAAO,4BAIxB,IAAME,EAAkBT,EAAH,CAAA,GAAA,KACjBU,IAAyC,IAAxCR,MAAEA,EAAFC,UAASA,EAATC,MAAoBA,EAApBC,OAA2BA,GAAaK,EACzC,OAAIP,EAAkBD,EAAMK,OAAO,0BAC/BH,EAAcF,EAAMK,OAAO,yBAC3BF,EAAeH,EAAMK,OAAO,2BAEzBL,EAAMK,OAAO,2BAIjB,IAAMI,EAAOC,EAAOC,IAAIC,WAA4B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