@atom-learning/components 5.13.0 → 5.14.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,15 +1,9 @@
1
- # [5.13.0](https://github.com/Atom-Learning/components/compare/v5.12.1...v5.13.0) (2025-11-21)
2
-
3
-
4
- ### Bug Fixes
5
-
6
- * made table container optional ([1f20c17](https://github.com/Atom-Learning/components/commit/1f20c17f7382686780fe5f7369e702aad3f051ad))
7
- * updated snapshots ([c56d81a](https://github.com/Atom-Learning/components/commit/c56d81a5218c66e4c1a1f9fd4ba81205a6bfa38e))
1
+ # [5.14.0](https://github.com/Atom-Learning/components/compare/v5.13.0...v5.14.0) (2025-11-28)
8
2
 
9
3
 
10
4
  ### Features
11
5
 
12
- * ui improvements for datatable ([37376d8](https://github.com/Atom-Learning/components/commit/37376d8118f7720581bf8917eee644f2a55dd149))
6
+ * add the ability to have custom icon, theme and emphasis to the notification badge ([79498e0](https://github.com/Atom-Learning/components/commit/79498e0849fc7c20a94bbf0c5c47f3fdbf0c46e3))
13
7
 
14
8
  # [1.4.0](https://github.com/Atom-Learning/components/compare/v1.3.0...v1.4.0) (2022-04-11)
15
9
 
@@ -1,6 +1,11 @@
1
1
  import React from 'react';
2
+ import { Badge } from '../badge';
3
+ type BadgeProps = React.ComponentProps<typeof Badge>;
2
4
  type NotificationBadgeProps = {
3
5
  value: number | string;
6
+ emphasis?: BadgeProps['emphasis'];
7
+ theme?: BadgeProps['theme'];
8
+ icon?: React.FC<React.SVGProps<SVGSVGElement>>;
4
9
  };
5
- export declare const NotificationBadge: ({ value, children }: React.PropsWithChildren<NotificationBadgeProps>) => React.JSX.Element;
10
+ export declare const NotificationBadge: ({ value, emphasis, theme, icon, children }: React.PropsWithChildren<NotificationBadgeProps>) => React.JSX.Element;
6
11
  export {};
@@ -1,2 +1,2 @@
1
- import e from"react";import{styled as o}from"../../stitches.js";import{Box as i}from"../box/Box.js";import{Flex as n}from"../flex/Flex.js";const l=o(i,{position:"relative"}),a=o(n,{fontFamily:"$body",fontSize:"$sm",flexDirection:"column",justifyContent:"center",position:"absolute",top:"0",right:"0",transform:"translate(calc($sizes$2 / 2), -50%)",borderRadius:"$round",p:"$2",height:"$2",minWidth:"$2",textAlign:"center",color:"#fff",bg:"$primary800"}),m=({value:t,children:r})=>e.createElement(l,null,!!t&&e.createElement(a,{role:"status"},t),r);export{m as NotificationBadge};
1
+ import e from"react";import{styled as a}from"../../stitches.js";import{Badge as m}from"../badge/Badge.js";import{Box as s}from"../box/Box.js";import{Icon as l}from"../icon/Icon.js";const c=a(s,{position:"relative"}),d={fontFamily:"$body",fontSize:"$sm",flexDirection:"row",justifyContent:"center",position:"absolute",top:"0",right:"0",transform:"translate(calc($sizes$2 / 2), -50%)",borderRadius:"$round",height:"$2",minWidth:"$2",textAlign:"center"},f=({value:t,emphasis:i="bold",theme:r="primary",icon:o,children:n})=>e.createElement(c,null,!!t&&e.createElement(m,{role:"status",emphasis:i,theme:r,css:d},o&&e.createElement(l,{is:o,role:"img","aria-hidden":"false"}),t),n);export{f as NotificationBadge};
2
2
  //# sourceMappingURL=NotificationBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationBadge.js","sources":["../../../src/components/notification-badge/NotificationBadge.tsx"],"sourcesContent":["import React from 'react'\n\nimport { styled } from '~/stitches'\n\nimport { Box } from '../box'\nimport { Flex } from '../flex'\n\nconst StyledWrapper = styled(Box, {\n position: 'relative'\n})\n\nconst StyledBadge = styled(Flex, {\n fontFamily: '$body',\n fontSize: '$sm',\n flexDirection: 'column',\n justifyContent: 'center',\n position: 'absolute',\n top: '0',\n right: '0',\n transform: 'translate(calc($sizes$2 / 2), -50%)',\n borderRadius: '$round',\n p: '$2',\n height: '$2',\n minWidth: '$2',\n textAlign: 'center',\n color: '#fff',\n bg: '$primary800'\n})\n\ntype NotificationBadgeProps = {\n value: number | string\n}\n\nexport const NotificationBadge = ({\n value,\n children\n}: React.PropsWithChildren<NotificationBadgeProps>) => (\n <StyledWrapper>\n {!!value && <StyledBadge role=\"status\">{value}</StyledBadge>}\n {children}\n </StyledWrapper>\n)\n"],"names":["StyledWrapper","styled","Box","StyledBadge","Flex","NotificationBadge","value","children","React"],"mappings":"2IAOA,MAAMA,EAAgBC,EAAOC,EAAK,CAChC,SAAU,UACZ,CAAC,EAEKC,EAAcF,EAAOG,EAAM,CAC/B,WAAY,QACZ,SAAU,MACV,cAAe,SACf,eAAgB,SAChB,SAAU,WACV,IAAK,IACL,MAAO,IACP,UAAW,sCACX,aAAc,SACd,EAAG,KACH,OAAQ,KACR,SAAU,KACV,UAAW,SACX,MAAO,OACP,GAAI,aACN,CAAC,EAMYC,EAAoB,CAAC,CAChC,MAAAC,EACA,SAAAC,CACF,IACEC,EAAA,cAACR,EAAA,KACE,CAAC,CAACM,GAASE,EAAA,cAACL,EAAA,CAAY,KAAK,QAAUG,EAAAA,CAAM,EAC7CC,CACH"}
1
+ {"version":3,"file":"NotificationBadge.js","sources":["../../../src/components/notification-badge/NotificationBadge.tsx"],"sourcesContent":["import React from 'react'\n\nimport { CSS, styled } from '~/stitches'\n\nimport { Badge } from '../badge'\nimport { Box } from '../box'\nimport { Flex } from '../flex'\nimport { Icon } from '../icon'\n\nconst StyledWrapper = styled(Box, {\n position: 'relative'\n})\n\nconst badgeCss: CSS = {\n fontFamily: '$body',\n fontSize: '$sm',\n flexDirection: 'row',\n justifyContent: 'center',\n position: 'absolute',\n top: '0',\n right: '0',\n transform: 'translate(calc($sizes$2 / 2), -50%)',\n borderRadius: '$round',\n height: '$2',\n minWidth: '$2',\n textAlign: 'center'\n}\n\ntype BadgeProps = React.ComponentProps<typeof Badge>\n\ntype NotificationBadgeProps = {\n value: number | string\n emphasis?: BadgeProps['emphasis']\n theme?: BadgeProps['theme']\n icon?: React.FC<React.SVGProps<SVGSVGElement>>\n}\n\nexport const NotificationBadge = ({\n value,\n emphasis = 'bold',\n theme = 'primary',\n icon,\n children\n}: React.PropsWithChildren<NotificationBadgeProps>) => (\n <StyledWrapper>\n {!!value && (\n <Badge role=\"status\" emphasis={emphasis} theme={theme} css={badgeCss}>\n {icon && <Icon is={icon} role=\"img\" aria-hidden=\"false\" />}\n {value}\n </Badge>\n )}\n {children}\n </StyledWrapper>\n)\n"],"names":["StyledWrapper","styled","Box","badgeCss","NotificationBadge","value","emphasis","theme","icon","children","React","Badge","Icon"],"mappings":"qLASA,MAAMA,EAAgBC,EAAOC,EAAK,CAChC,SAAU,UACZ,CAAC,EAEKC,EAAgB,CACpB,WAAY,QACZ,SAAU,MACV,cAAe,MACf,eAAgB,SAChB,SAAU,WACV,IAAK,IACL,MAAO,IACP,UAAW,sCACX,aAAc,SACd,OAAQ,KACR,SAAU,KACV,UAAW,QACb,EAWaC,EAAoB,CAAC,CAChC,MAAAC,EACA,SAAAC,EAAW,OACX,MAAAC,EAAQ,UACR,KAAAC,EACA,SAAAC,CACF,IACEC,EAAA,cAACV,EAAA,KACE,CAAC,CAACK,GACDK,EAAA,cAACC,EAAA,CAAM,KAAK,SAAS,SAAUL,EAAU,MAAOC,EAAO,IAAKJ,CAAAA,EACzDK,GAAQE,EAAA,cAACE,EAAA,CAAK,GAAIJ,EAAM,KAAK,MAAM,cAAY,OAAQ,CAAA,EACvDH,CACH,EAEDI,CACH"}