@mirohq/design-system-badge 0.1.2-colors.0 → 0.1.2
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/dist/main.js +3 -3
- package/dist/main.js.map +1 -1
- package/dist/module.js +3 -3
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
package/dist/main.js
CHANGED
|
@@ -15,7 +15,7 @@ const StyledBadgeContainer = designSystemStitches.styled(designSystemPrimitive.P
|
|
|
15
15
|
});
|
|
16
16
|
const sharedStyles = {
|
|
17
17
|
alignItems: "center",
|
|
18
|
-
backgroundColor: "$blue-
|
|
18
|
+
backgroundColor: "$blue-600",
|
|
19
19
|
borderColor: "$white",
|
|
20
20
|
borderRadius: "$half",
|
|
21
21
|
color: "$white",
|
|
@@ -28,8 +28,8 @@ const sharedStyles = {
|
|
|
28
28
|
inverted: {
|
|
29
29
|
true: {
|
|
30
30
|
backgroundColor: "$white",
|
|
31
|
-
borderColor: "$blue-
|
|
32
|
-
color: "$blue-
|
|
31
|
+
borderColor: "$blue-600",
|
|
32
|
+
color: "$blue-600"
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sources":["../src/badge.styled.tsx","../src/badge.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { CSS } from '@mirohq/design-system-stitches'\n\nexport const StyledBadgeContainer = styled(Primitive.div, {\n position: 'relative',\n})\n\nconst sharedStyles: CSS = {\n alignItems: 'center',\n backgroundColor: '$blue-
|
|
1
|
+
{"version":3,"file":"main.js","sources":["../src/badge.styled.tsx","../src/badge.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { CSS } from '@mirohq/design-system-stitches'\n\nexport const StyledBadgeContainer = styled(Primitive.div, {\n position: 'relative',\n})\n\nconst sharedStyles: CSS = {\n alignItems: 'center',\n backgroundColor: '$blue-600',\n borderColor: '$white',\n borderRadius: '$half',\n color: '$white',\n display: 'flex',\n justifyContent: 'center',\n position: 'absolute',\n pointerEvents: 'none',\n zIndex: 1,\n variants: {\n inverted: {\n true: {\n backgroundColor: '$white',\n borderColor: '$blue-600',\n color: '$blue-600',\n },\n },\n },\n}\n\nexport const StyledBadge = styled(Primitive.div, {\n border: '2px solid #fff',\n boxSizing: 'border-box',\n fontFamily: 'Formular, sans-serif',\n fontSize: '$150',\n fontWeight: 650,\n height: '20px',\n left: '50%',\n minWidth: '20px',\n padding: '2px $50',\n top: '1px',\n transform: 'translateX(-50%)',\n ...sharedStyles,\n})\n\nexport const StyledDot = styled(Primitive.div, {\n borderWidth: 1,\n bottom: '1px',\n height: '4px',\n minWidth: 0,\n padding: 0,\n right: '1px',\n width: '4px',\n ...sharedStyles,\n})\n\nexport const StyledBadgeWrapper = styled(Primitive.div, {\n alignItems: 'center',\n boxSizing: 'border-box',\n display: 'flex',\n flexFlow: 'row wrap',\n height: '10px',\n placeContent: 'center',\n position: 'absolute',\n right: '-2px',\n top: '-6px',\n width: '10px',\n zIndex: '1',\n})\n\nexport type StyledBadgeProps = ComponentPropsWithRef<typeof StyledBadge>\n","import React from 'react'\nimport type { ElementRef, ReactNode, ReactElement } from 'react'\n\nimport {\n StyledBadgeContainer,\n StyledBadgeWrapper,\n StyledBadge,\n StyledDot,\n} from './badge.styled'\nimport type { StyledBadgeProps } from './badge.styled'\n\nexport interface BadgeProps extends StyledBadgeProps {\n /**\n * Content of the badge\n */\n content?: string\n\n /**\n * Handle whether the badge should be shown, if no content is provided a dot is displayed.\n */\n show: boolean\n\n /**\n * Element that shows the badge\n */\n children?: ReactNode\n\n /**\n * By default the badge is filled with blue, inverted set it to white.\n */\n inverted?: boolean\n}\n\nexport const Badge = React.forwardRef<\n ElementRef<typeof StyledBadge>,\n BadgeProps\n>(({ show, content, children, ...restProps }, forwardRef) => {\n if (!show) {\n return children as ReactElement\n }\n\n return (\n <StyledBadgeContainer data-testid='badge'>\n <StyledBadgeWrapper>\n {content !== undefined ? (\n <StyledBadge {...restProps} ref={forwardRef}>\n {content}\n </StyledBadge>\n ) : (\n <StyledDot {...restProps} ref={forwardRef} />\n )}\n </StyledBadgeWrapper>\n {children}\n </StyledBadgeContainer>\n )\n})\n"],"names":["styled","Primitive","React"],"mappings":";;;;;;;;;;;;AAKa,MAAA,oBAAA,GAAuBA,2BAAO,CAAAC,+BAAA,CAAU,GAAK,EAAA;AAAA,EACxD,QAAU,EAAA,UAAA;AACZ,CAAC,CAAA,CAAA;AAED,MAAM,YAAoB,GAAA;AAAA,EACxB,UAAY,EAAA,QAAA;AAAA,EACZ,eAAiB,EAAA,WAAA;AAAA,EACjB,WAAa,EAAA,QAAA;AAAA,EACb,YAAc,EAAA,OAAA;AAAA,EACd,KAAO,EAAA,QAAA;AAAA,EACP,OAAS,EAAA,MAAA;AAAA,EACT,cAAgB,EAAA,QAAA;AAAA,EAChB,QAAU,EAAA,UAAA;AAAA,EACV,aAAe,EAAA,MAAA;AAAA,EACf,MAAQ,EAAA,CAAA;AAAA,EACR,QAAU,EAAA;AAAA,IACR,QAAU,EAAA;AAAA,MACR,IAAM,EAAA;AAAA,QACJ,eAAiB,EAAA,QAAA;AAAA,QACjB,WAAa,EAAA,WAAA;AAAA,QACb,KAAO,EAAA,WAAA;AAAA,OACT;AAAA,KACF;AAAA,GACF;AACF,CAAA,CAAA;AAEa,MAAA,WAAA,GAAcD,2BAAO,CAAAC,+BAAA,CAAU,GAAK,EAAA;AAAA,EAC/C,MAAQ,EAAA,gBAAA;AAAA,EACR,SAAW,EAAA,YAAA;AAAA,EACX,UAAY,EAAA,sBAAA;AAAA,EACZ,QAAU,EAAA,MAAA;AAAA,EACV,UAAY,EAAA,GAAA;AAAA,EACZ,MAAQ,EAAA,M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BAC/BA,yBAAA,CAAA,aAAA,CAAA,kBAAA,EAAA,IAAA,EACE,OAAY,KAAA,KAAA,CAAA,mBACVA,yBAAA,CAAA,aAAA,CAAA,WAAA,EAAA;AAAA,IAAa,GAAG,SAAA;AAAA,IAAW,GAAK,EAAA,UAAA;AAAA,GAC9B,EAAA,OACH,oBAECA,yBAAA,CAAA,aAAA,CAAA,SAAA,EAAA;AAAA,IAAW,GAAG,SAAA;AAAA,IAAW,GAAK,EAAA,UAAA;AAAA,GAAY,CAE/C,GACC,QACH,CAAA,CAAA;AAEJ,CAAC;;;;"}
|
package/dist/module.js
CHANGED
|
@@ -7,7 +7,7 @@ const StyledBadgeContainer = styled(Primitive.div, {
|
|
|
7
7
|
});
|
|
8
8
|
const sharedStyles = {
|
|
9
9
|
alignItems: "center",
|
|
10
|
-
backgroundColor: "$blue-
|
|
10
|
+
backgroundColor: "$blue-600",
|
|
11
11
|
borderColor: "$white",
|
|
12
12
|
borderRadius: "$half",
|
|
13
13
|
color: "$white",
|
|
@@ -20,8 +20,8 @@ const sharedStyles = {
|
|
|
20
20
|
inverted: {
|
|
21
21
|
true: {
|
|
22
22
|
backgroundColor: "$white",
|
|
23
|
-
borderColor: "$blue-
|
|
24
|
-
color: "$blue-
|
|
23
|
+
borderColor: "$blue-600",
|
|
24
|
+
color: "$blue-600"
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sources":["../src/badge.styled.tsx","../src/badge.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { CSS } from '@mirohq/design-system-stitches'\n\nexport const StyledBadgeContainer = styled(Primitive.div, {\n position: 'relative',\n})\n\nconst sharedStyles: CSS = {\n alignItems: 'center',\n backgroundColor: '$blue-
|
|
1
|
+
{"version":3,"file":"module.js","sources":["../src/badge.styled.tsx","../src/badge.tsx"],"sourcesContent":["import type { ComponentPropsWithRef } from 'react'\nimport { Primitive } from '@mirohq/design-system-primitive'\nimport { styled } from '@mirohq/design-system-stitches'\nimport type { CSS } from '@mirohq/design-system-stitches'\n\nexport const StyledBadgeContainer = styled(Primitive.div, {\n position: 'relative',\n})\n\nconst sharedStyles: CSS = {\n alignItems: 'center',\n backgroundColor: '$blue-600',\n borderColor: '$white',\n borderRadius: '$half',\n color: '$white',\n display: 'flex',\n justifyContent: 'center',\n position: 'absolute',\n pointerEvents: 'none',\n zIndex: 1,\n variants: {\n inverted: {\n true: {\n backgroundColor: '$white',\n borderColor: '$blue-600',\n color: '$blue-600',\n },\n },\n },\n}\n\nexport const StyledBadge = styled(Primitive.div, {\n border: '2px solid #fff',\n boxSizing: 'border-box',\n fontFamily: 'Formular, sans-serif',\n fontSize: '$150',\n fontWeight: 650,\n height: '20px',\n left: '50%',\n minWidth: '20px',\n padding: '2px $50',\n top: '1px',\n transform: 'translateX(-50%)',\n ...sharedStyles,\n})\n\nexport const StyledDot = styled(Primitive.div, {\n borderWidth: 1,\n bottom: '1px',\n height: '4px',\n minWidth: 0,\n padding: 0,\n right: '1px',\n width: '4px',\n ...sharedStyles,\n})\n\nexport const StyledBadgeWrapper = styled(Primitive.div, {\n alignItems: 'center',\n boxSizing: 'border-box',\n display: 'flex',\n flexFlow: 'row wrap',\n height: '10px',\n placeContent: 'center',\n position: 'absolute',\n right: '-2px',\n top: '-6px',\n width: '10px',\n zIndex: '1',\n})\n\nexport type StyledBadgeProps = ComponentPropsWithRef<typeof StyledBadge>\n","import React from 'react'\nimport type { ElementRef, ReactNode, ReactElement } from 'react'\n\nimport {\n StyledBadgeContainer,\n StyledBadgeWrapper,\n StyledBadge,\n StyledDot,\n} from './badge.styled'\nimport type { StyledBadgeProps } from './badge.styled'\n\nexport interface BadgeProps extends StyledBadgeProps {\n /**\n * Content of the badge\n */\n content?: string\n\n /**\n * Handle whether the badge should be shown, if no content is provided a dot is displayed.\n */\n show: boolean\n\n /**\n * Element that shows the badge\n */\n children?: ReactNode\n\n /**\n * By default the badge is filled with blue, inverted set it to white.\n */\n inverted?: boolean\n}\n\nexport const Badge = React.forwardRef<\n ElementRef<typeof StyledBadge>,\n BadgeProps\n>(({ show, content, children, ...restProps }, forwardRef) => {\n if (!show) {\n return children as ReactElement\n }\n\n return (\n <StyledBadgeContainer data-testid='badge'>\n <StyledBadgeWrapper>\n {content !== undefined ? (\n <StyledBadge {...restProps} ref={forwardRef}>\n {content}\n </StyledBadge>\n ) : (\n <StyledDot {...restProps} ref={forwardRef} />\n )}\n </StyledBadgeWrapper>\n {children}\n </StyledBadgeContainer>\n )\n})\n"],"names":[],"mappings":";;;;AAKa,MAAA,oBAAA,GAAuB,MAAO,CAAA,SAAA,CAAU,GAAK,EAAA;AAAA,EACxD,QAAU,EAAA,UAAA;AACZ,CAAC,CAAA,CAAA;AAED,MAAM,YAAoB,GAAA;AAAA,EACxB,UAAY,EAAA,QAAA;AAAA,EACZ,eAAiB,EAAA,WAAA;AAAA,EACjB,WAAa,EAAA,QAAA;AAAA,EACb,YAAc,EAAA,OAAA;AAAA,EACd,KAAO,EAAA,QAAA;AAAA,EACP,OAAS,EAAA,MAAA;AAAA,EACT,cAAgB,EAAA,QAAA;AAAA,EAChB,QAAU,EAAA,UAAA;AAAA,EACV,aAAe,EAAA,MAAA;AAAA,EACf,MAAQ,EAAA,CAAA;AAAA,EACR,QAAU,EAAA;AAAA,IACR,QAAU,EAAA;AAAA,MACR,IAAM,EAAA;AAAA,QACJ,eAAiB,EAAA,QAAA;AAAA,QACjB,WAAa,EAAA,WAAA;AAAA,QACb,KAAO,EAAA,WAAA;AAAA,OACT;AAAA,KACF;AAAA,GACF;AACF,CAAA,CAAA;AAEa,MAAA,WAAA,GAAc,MAAO,CAAA,SAAA,CAAU,GAAK,EAAA;AAAA,EAC/C,MAAQ,EAAA,gBAAA;AAAA,EACR,SAAW,EAAA,YAAA;AAAA,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A,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,oBAAA,EAAA;AAAA,IAAqB,aAAY,EAAA,OAAA;AAAA,GAAA,kBAC/B,KAAA,CAAA,aAAA,CAAA,kBAAA,EAAA,IAAA,EACE,OAAY,KAAA,KAAA,CAAA,mBACV,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA;AAAA,IAAa,GAAG,SAAA;AAAA,IAAW,GAAK,EAAA,UAAA;AAAA,GAC9B,EAAA,OACH,oBAEC,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA;AAAA,IAAW,GAAG,SAAA;AAAA,IAAW,GAAK,EAAA,UAAA;AAAA,GAAY,CAE/C,GACC,QACH,CAAA,CAAA;AAEJ,CAAC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mirohq/design-system-badge",
|
|
3
|
-
"version": "0.1.2
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Miro",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@mirohq/design-system-primitive": "^1.0.4",
|
|
30
|
-
"@mirohq/design-system-stitches": "^2.0.11
|
|
30
|
+
"@mirohq/design-system-stitches": "^2.0.11"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@mirohq/design-system-button": "^2.0.17
|
|
33
|
+
"@mirohq/design-system-button": "^2.0.17"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "rollup -c ../../../../rollup.config.js",
|