@atom-learning/components 2.54.3 → 2.55.0

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/CHANGELOG.md CHANGED
@@ -1,9 +1,9 @@
1
- ## [2.54.3](https://github.com/Atom-Learning/components/compare/v2.54.2...v2.54.3) (2023-05-10)
1
+ # [2.55.0](https://github.com/Atom-Learning/components/compare/v2.54.3...v2.55.0) (2023-05-16)
2
2
 
3
3
 
4
- ### Bug Fixes
4
+ ### Features
5
5
 
6
- * **actionicon:** allow overriding the button type ([8a955e7](https://github.com/Atom-Learning/components/commit/8a955e703a333016850c94299bfe046eada96e02))
6
+ * added new badge theme variant ([5d7556a](https://github.com/Atom-Learning/components/commit/5d7556a00dd30085ebc75270298341a81f9c92a5))
7
7
 
8
8
  # [1.4.0](https://github.com/Atom-Learning/components/compare/v1.3.0...v1.4.0) (2022-04-11)
9
9
 
@@ -219,7 +219,7 @@ declare const StyledBadge: import("@stitches/react/types/styled-component").Styl
219
219
  marginBottom: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
220
220
  };
221
221
  }>>, {
222
- theme?: "success" | "danger" | "warning" | "neutral" | "info" | undefined;
222
+ theme?: "success" | "danger" | "warning" | "purple" | "neutral" | "info" | undefined;
223
223
  size?: "sm" | "md" | "xs" | undefined;
224
224
  }, {
225
225
  sm: string;
@@ -1,2 +1,2 @@
1
- import*as t from"react";import{styled as m}from"../../stitches.js";import{Box as l}from"../box/Box.js";import{Flex as a}from"../flex/Flex.js";import{Icon as c}from"../icon/Icon.js";const d=m(a,{justifyContent:"center",alignItems:"center",borderRadius:"$0",minWidth:0,border:"1px solid #FFFFFF",fontFamily:"$body","& > *:not(:last-child)":{mr:"$1"},variants:{theme:{success:{bg:"$successLight",color:"$successMid"},warning:{bg:"$warningLight",color:"$warningText"},danger:{bg:"$dangerLight",color:"$dangerMid"},neutral:{bg:"$tonal50",color:"$tonal400"},info:{bg:"$primaryLight",color:"$primaryMid"}},size:{xs:{fontSize:"$sm",px:"$1",height:"$2"},sm:{fontSize:"$md",px:"$1",height:"$3"},md:{fontSize:"$md",px:"$2",height:"$4"}}}}),i=({theme:r="info",size:o="sm",children:n,...s})=>t.createElement(d,{role:"status",theme:r,size:o,...s},t.Children.map(n,e=>{if(typeof e=="string"||typeof e=="number")return t.createElement(l,{css:{whiteSpace:"nowrap",overflowX:"hidden",textOverflow:"ellipsis",py:"$0"}},e);if(t.isValidElement(e)&&e.type===c)return t.cloneElement(e,{size:"sm",css:{...e.props.css,flexShrink:0}})}));i.displayName="Badge";export{i as Badge};
1
+ import*as r from"react";import{styled as l}from"../../stitches.js";import{Box as m}from"../box/Box.js";import{Flex as a}from"../flex/Flex.js";import{Icon as p}from"../icon/Icon.js";const c=l(a,{justifyContent:"center",alignItems:"center",borderRadius:"$0",minWidth:0,border:"1px solid #FFFFFF",fontFamily:"$body","& > *:not(:last-child)":{mr:"$1"},variants:{theme:{success:{bg:"$successLight",color:"$successMid"},warning:{bg:"$warningLight",color:"$warningText"},danger:{bg:"$dangerLight",color:"$dangerMid"},neutral:{bg:"$tonal50",color:"$tonal400"},info:{bg:"$primaryLight",color:"$primaryMid"},purple:{bg:"$purple200",color:"$purple1000"}},size:{xs:{fontSize:"$sm",px:"$1",height:"$2"},sm:{fontSize:"$md",px:"$1",height:"$3"},md:{fontSize:"$md",px:"$2",height:"$4"}}}}),t=({theme:i="info",size:o="sm",children:n,...s})=>r.createElement(c,{role:"status",theme:i,size:o,...s},r.Children.map(n,e=>{if(typeof e=="string"||typeof e=="number")return r.createElement(m,{css:{whiteSpace:"nowrap",overflowX:"hidden",textOverflow:"ellipsis",py:"$0"}},e);if(r.isValidElement(e)&&e.type===p)return r.cloneElement(e,{size:"sm",css:{...e.props.css,flexShrink:0}})}));t.displayName="Badge";export{t as Badge};
2
2
  //# sourceMappingURL=Badge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Badge.js","sources":["../../../src/components/badge/Badge.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\n\nimport { Box } from '../box'\nimport { Flex } from '../flex'\nimport { Icon } from '../icon'\n\nconst StyledBadge = styled(Flex, {\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: '$0',\n minWidth: 0,\n border: '1px solid #FFFFFF',\n fontFamily: '$body',\n '& > *:not(:last-child)': {\n mr: '$1'\n },\n variants: {\n theme: {\n success: {\n bg: '$successLight',\n color: '$successMid'\n },\n warning: {\n bg: '$warningLight',\n color: '$warningText'\n },\n danger: {\n bg: '$dangerLight',\n color: '$dangerMid'\n },\n neutral: {\n bg: '$tonal50',\n color: '$tonal400'\n },\n info: {\n bg: '$primaryLight',\n color: '$primaryMid'\n }\n },\n size: {\n xs: {\n fontSize: '$sm',\n px: '$1',\n height: '$2'\n },\n sm: {\n fontSize: '$md',\n px: '$1',\n height: '$3'\n },\n md: {\n fontSize: '$md',\n px: '$2',\n height: '$4'\n }\n }\n }\n})\n\ntype BadgeProps = React.ComponentProps<typeof StyledBadge>\n\nexport const Badge: React.FC<BadgeProps> = ({\n theme = 'info',\n size = 'sm',\n children,\n ...rest\n}) => {\n return (\n <StyledBadge role=\"status\" theme={theme} size={size} {...rest}>\n {React.Children.map(children, (child) => {\n if (typeof child === 'string' || typeof child === 'number') {\n return (\n <Box\n css={{\n whiteSpace: 'nowrap',\n overflowX: 'hidden',\n textOverflow: 'ellipsis',\n py: '$0'\n }}\n >\n {child}\n </Box>\n )\n }\n\n if (React.isValidElement(child) && child.type === Icon) {\n return React.cloneElement(\n child as React.ReactElement<React.ComponentProps<typeof Icon>>,\n {\n size: 'sm',\n css: { ...child.props.css, flexShrink: 0 }\n }\n )\n }\n })}\n </StyledBadge>\n )\n}\n\nBadge.displayName = 'Badge'\n"],"names":["StyledBadge","styled","Flex","Badge","theme","size","children","rest","React","child","Box","Icon"],"mappings":"qLAQA,MAAMA,EAAcC,EAAOC,EAAM,CAC/B,eAAgB,SAChB,WAAY,SACZ,aAAc,KACd,SAAU,EACV,OAAQ,oBACR,WAAY,QACZ,yBAA0B,CACxB,GAAI,IACN,EACA,SAAU,CACR,MAAO,CACL,QAAS,CACP,GAAI,gBACJ,MAAO,aACT,EACA,QAAS,CACP,GAAI,gBACJ,MAAO,cACT,EACA,OAAQ,CACN,GAAI,eACJ,MAAO,YACT,EACA,QAAS,CACP,GAAI,WACJ,MAAO,WACT,EACA,KAAM,CACJ,GAAI,gBACJ,MAAO,aACT,CACF,EACA,KAAM,CACJ,GAAI,CACF,SAAU,MACV,GAAI,KACJ,OAAQ,IACV,EACA,GAAI,CACF,SAAU,MACV,GAAI,KACJ,OAAQ,IACV,EACA,GAAI,CACF,SAAU,MACV,GAAI,KACJ,OAAQ,IACV,CACF,CACF,CACF,CAAC,EAIYC,EAA8B,CAAC,CAC1C,MAAAC,EAAQ,OACR,KAAAC,EAAO,KACP,SAAAC,KACGC,CACL,IAEIC,EAAA,cAACR,EAAA,CAAY,KAAK,SAAS,MAAOI,EAAO,KAAMC,EAAO,GAAGE,GACtDC,EAAM,SAAS,IAAIF,EAAWG,GAAU,CACvC,GAAI,OAAOA,GAAU,UAAY,OAAOA,GAAU,SAChD,OACED,EAAA,cAACE,EAAA,CACC,IAAK,CACH,WAAY,SACZ,UAAW,SACX,aAAc,WACd,GAAI,IACN,CAECD,EAAAA,CACH,EAIJ,GAAID,EAAM,eAAeC,CAAK,GAAKA,EAAM,OAASE,EAChD,OAAOH,EAAM,aACXC,EACA,CACE,KAAM,KACN,IAAK,CAAE,GAAGA,EAAM,MAAM,IAAK,WAAY,CAAE,CAC3C,CACF,CAEJ,CAAC,CACH,EAIJN,EAAM,YAAc"}
1
+ {"version":3,"file":"Badge.js","sources":["../../../src/components/badge/Badge.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\n\nimport { Box } from '../box'\nimport { Flex } from '../flex'\nimport { Icon } from '../icon'\n\nconst StyledBadge = styled(Flex, {\n justifyContent: 'center',\n alignItems: 'center',\n borderRadius: '$0',\n minWidth: 0,\n border: '1px solid #FFFFFF',\n fontFamily: '$body',\n '& > *:not(:last-child)': {\n mr: '$1'\n },\n variants: {\n theme: {\n success: {\n bg: '$successLight',\n color: '$successMid'\n },\n warning: {\n bg: '$warningLight',\n color: '$warningText'\n },\n danger: {\n bg: '$dangerLight',\n color: '$dangerMid'\n },\n neutral: {\n bg: '$tonal50',\n color: '$tonal400'\n },\n info: {\n bg: '$primaryLight',\n color: '$primaryMid'\n },\n purple: {\n bg: '$purple200',\n color: '$purple1000'\n }\n },\n size: {\n xs: {\n fontSize: '$sm',\n px: '$1',\n height: '$2'\n },\n sm: {\n fontSize: '$md',\n px: '$1',\n height: '$3'\n },\n md: {\n fontSize: '$md',\n px: '$2',\n height: '$4'\n }\n }\n }\n})\n\ntype BadgeProps = React.ComponentProps<typeof StyledBadge>\n\nexport const Badge: React.FC<BadgeProps> = ({\n theme = 'info',\n size = 'sm',\n children,\n ...rest\n}) => {\n return (\n <StyledBadge role=\"status\" theme={theme} size={size} {...rest}>\n {React.Children.map(children, (child) => {\n if (typeof child === 'string' || typeof child === 'number') {\n return (\n <Box\n css={{\n whiteSpace: 'nowrap',\n overflowX: 'hidden',\n textOverflow: 'ellipsis',\n py: '$0'\n }}\n >\n {child}\n </Box>\n )\n }\n\n if (React.isValidElement(child) && child.type === Icon) {\n return React.cloneElement(\n child as React.ReactElement<React.ComponentProps<typeof Icon>>,\n {\n size: 'sm',\n css: { ...child.props.css, flexShrink: 0 }\n }\n )\n }\n })}\n </StyledBadge>\n )\n}\n\nBadge.displayName = 'Badge'\n"],"names":["StyledBadge","styled","Flex","Badge","theme","size","children","rest","React","child","Box","Icon"],"mappings":"qLAQA,MAAMA,EAAcC,EAAOC,EAAM,CAC/B,eAAgB,SAChB,WAAY,SACZ,aAAc,KACd,SAAU,EACV,OAAQ,oBACR,WAAY,QACZ,yBAA0B,CACxB,GAAI,IACN,EACA,SAAU,CACR,MAAO,CACL,QAAS,CACP,GAAI,gBACJ,MAAO,aACT,EACA,QAAS,CACP,GAAI,gBACJ,MAAO,cACT,EACA,OAAQ,CACN,GAAI,eACJ,MAAO,YACT,EACA,QAAS,CACP,GAAI,WACJ,MAAO,WACT,EACA,KAAM,CACJ,GAAI,gBACJ,MAAO,aACT,EACA,OAAQ,CACN,GAAI,aACJ,MAAO,aACT,CACF,EACA,KAAM,CACJ,GAAI,CACF,SAAU,MACV,GAAI,KACJ,OAAQ,IACV,EACA,GAAI,CACF,SAAU,MACV,GAAI,KACJ,OAAQ,IACV,EACA,GAAI,CACF,SAAU,MACV,GAAI,KACJ,OAAQ,IACV,CACF,CACF,CACF,CAAC,EAIYC,EAA8B,CAAC,CAC1C,MAAAC,EAAQ,OACR,KAAAC,EAAO,KACP,SAAAC,KACGC,CACL,IAEIC,EAAA,cAACR,EAAA,CAAY,KAAK,SAAS,MAAOI,EAAO,KAAMC,EAAO,GAAGE,CACtDC,EAAAA,EAAM,SAAS,IAAIF,EAAWG,GAAU,CACvC,GAAI,OAAOA,GAAU,UAAY,OAAOA,GAAU,SAChD,OACED,EAAA,cAACE,EAAA,CACC,IAAK,CACH,WAAY,SACZ,UAAW,SACX,aAAc,WACd,GAAI,IACN,CAAA,EAECD,CACH,EAIJ,GAAID,EAAM,eAAeC,CAAK,GAAKA,EAAM,OAASE,EAChD,OAAOH,EAAM,aACXC,EACA,CACE,KAAM,KACN,IAAK,CAAE,GAAGA,EAAM,MAAM,IAAK,WAAY,CAAE,CAC3C,CACF,CAEJ,CAAC,CACH,EAIJN,EAAM,YAAc"}