@atom-learning/components 2.53.0 → 2.54.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,14 +1,9 @@
1
- # [2.53.0](https://github.com/Atom-Learning/components/compare/v2.52.0...v2.53.0) (2023-05-05)
2
-
3
-
4
- ### Bug Fixes
5
-
6
- * snapshot Sidedrawer ([cb74fbc](https://github.com/Atom-Learning/components/commit/cb74fbcfa02fc86e37de56a6af60bbd76216beec))
1
+ # [2.54.0](https://github.com/Atom-Learning/components/compare/v2.53.0...v2.54.0) (2023-05-05)
7
2
 
8
3
 
9
4
  ### Features
10
5
 
11
- * use themeMap in stitches to enable aspect ratio tokens ([b0a4c00](https://github.com/Atom-Learning/components/commit/b0a4c003bb6f46e110f5a5a8e13c8cbd794337f1))
6
+ * switch large variant ([09ccd7f](https://github.com/Atom-Learning/components/commit/09ccd7faa2fe076b7ad89bc403eaf226f7a02dbe))
12
7
 
13
8
  # [1.4.0](https://github.com/Atom-Learning/components/compare/v1.3.0...v1.4.0) (2022-04-11)
14
9
 
@@ -1,6 +1,8 @@
1
1
  import * as RadixSwitch from '@radix-ui/react-switch';
2
2
  import * as React from 'react';
3
- declare const StyledSwitch: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<RadixSwitch.SwitchProps & React.RefAttributes<HTMLButtonElement>>, {}, {
3
+ declare const StyledSwitch: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<RadixSwitch.SwitchProps & React.RefAttributes<HTMLButtonElement>>, {
4
+ size?: "md" | "lg" | undefined;
5
+ }, {
4
6
  sm: string;
5
7
  md: string;
6
8
  lg: string;
@@ -1,2 +1,2 @@
1
- import*as o from"@radix-ui/react-switch";import*as r from"react";import{styled as a}from"../../stitches.js";const n=a(o.Root,{appearance:"none",backgroundColor:"$tonal200",border:"none",borderRadius:"$round",cursor:"pointer",display:"flex",overflow:"hidden",p:"$0",position:"relative",transition:"all 50ms ease-out",width:"$4","&:hover":{backgroundColor:"$tonal300"},"&:focus":{outline:"2px solid $primary",outlineOffset:"1px"},'&[data-state="checked"]':{backgroundColor:"$primary"},'&[data-state="checked"]:hover':{backgroundColor:"$primaryMid"}}),i=a(o.Thumb,{backgroundColor:"white",borderRadius:"$round",display:"block",size:"$1",transition:"transform 50ms",willChange:"transform",'&[data-state="checked"]':{transform:"translateX(calc($sizes$2 - $space$1))"}}),e=t=>r.createElement(n,{...t},r.createElement(i,null));e.displayName="Switch";export{e as Switch};
1
+ import*as a from"@radix-ui/react-switch";import*as o from"react";import{styled as r}from"../../stitches.js";const i=r(a.Root,{appearance:"none",backgroundColor:"$tonal200",border:"none",borderRadius:"$round",cursor:"pointer",display:"flex",overflow:"hidden",position:"relative",transition:"all 50ms ease-out","&:hover":{backgroundColor:"$tonal300"},"&:focus":{outline:"2px solid $primary",outlineOffset:"1px"},'&[data-state="checked"]':{backgroundColor:"$primary"},'&[data-state="checked"]:hover':{backgroundColor:"$primaryMid"},variants:{size:{md:{p:"$0",width:"$4"},lg:{p:"$1",width:"$6"}}}}),n=r(a.Thumb,{backgroundColor:"white",borderRadius:"$round",display:"block",transition:"transform 50ms",willChange:"transform",variants:{size:{md:{size:"$1",'&[data-state="checked"]':{transform:"translateX(calc($sizes$2 - $space$1))"}},lg:{size:"$2",'&[data-state="checked"]':{transform:"translateX($space$5)"}}}}}),t=({size:e="md",...s})=>o.createElement(i,{size:e,...s},o.createElement(n,{size:e}));t.displayName="Switch";export{t as Switch};
2
2
  //# sourceMappingURL=Switch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.js","sources":["../../../src/components/switch/Switch.tsx"],"sourcesContent":["import * as RadixSwitch from '@radix-ui/react-switch'\nimport * as React from 'react'\n\nimport { styled } from '~/stitches'\n\nconst StyledSwitch = styled(RadixSwitch.Root, {\n appearance: 'none',\n backgroundColor: '$tonal200',\n border: 'none',\n borderRadius: '$round',\n cursor: 'pointer',\n display: 'flex',\n overflow: 'hidden',\n p: '$0',\n position: 'relative',\n transition: 'all 50ms ease-out',\n width: '$4',\n '&:hover': {\n backgroundColor: '$tonal300'\n },\n '&:focus': {\n outline: '2px solid $primary',\n outlineOffset: '1px'\n },\n '&[data-state=\"checked\"]': {\n backgroundColor: '$primary'\n },\n '&[data-state=\"checked\"]:hover': {\n backgroundColor: '$primaryMid'\n }\n})\n\nconst StyledThumb = styled(RadixSwitch.Thumb, {\n backgroundColor: 'white',\n borderRadius: '$round',\n display: 'block',\n size: '$1',\n transition: 'transform 50ms',\n willChange: 'transform',\n '&[data-state=\"checked\"]': {\n transform: 'translateX(calc($sizes$2 - $space$1))'\n }\n})\n\ntype SwitchProps = React.ComponentProps<typeof StyledSwitch>\n\nexport const Switch: React.FC<SwitchProps> = (props) => (\n <StyledSwitch {...props}>\n <StyledThumb />\n </StyledSwitch>\n)\n\nSwitch.displayName = 'Switch'\n"],"names":["StyledSwitch","styled","RadixSwitch","StyledThumb","Switch","props","React"],"mappings":"4GAKA,MAAMA,EAAeC,EAAOC,EAAY,KAAM,CAC5C,WAAY,OACZ,gBAAiB,YACjB,OAAQ,OACR,aAAc,SACd,OAAQ,UACR,QAAS,OACT,SAAU,SACV,EAAG,KACH,SAAU,WACV,WAAY,oBACZ,MAAO,KACP,UAAW,CACT,gBAAiB,WACnB,EACA,UAAW,CACT,QAAS,qBACT,cAAe,KACjB,EACA,0BAA2B,CACzB,gBAAiB,UACnB,EACA,gCAAiC,CAC/B,gBAAiB,aACnB,CACF,CAAC,EAEKC,EAAcF,EAAOC,EAAY,MAAO,CAC5C,gBAAiB,QACjB,aAAc,SACd,QAAS,QACT,KAAM,KACN,WAAY,iBACZ,WAAY,YACZ,0BAA2B,CACzB,UAAW,uCACb,CACF,CAAC,EAIYE,EAAiCC,GAC5CC,EAAA,cAACN,EAAA,CAAc,GAAGK,CAAAA,EAChBC,EAAA,cAACH,EAAA,IAAY,CACf,EAGFC,EAAO,YAAc"}
1
+ {"version":3,"file":"Switch.js","sources":["../../../src/components/switch/Switch.tsx"],"sourcesContent":["import * as RadixSwitch from '@radix-ui/react-switch'\nimport * as React from 'react'\n\nimport { styled } from '~/stitches'\n\nconst StyledSwitch = styled(RadixSwitch.Root, {\n appearance: 'none',\n backgroundColor: '$tonal200',\n border: 'none',\n borderRadius: '$round',\n cursor: 'pointer',\n display: 'flex',\n overflow: 'hidden',\n position: 'relative',\n transition: 'all 50ms ease-out',\n '&:hover': {\n backgroundColor: '$tonal300'\n },\n '&:focus': {\n outline: '2px solid $primary',\n outlineOffset: '1px'\n },\n '&[data-state=\"checked\"]': {\n backgroundColor: '$primary'\n },\n '&[data-state=\"checked\"]:hover': {\n backgroundColor: '$primaryMid'\n },\n variants: {\n size: {\n md: {\n p: '$0',\n width: '$4'\n },\n lg: {\n p: '$1',\n width: '$6'\n }\n }\n }\n})\n\nconst StyledThumb = styled(RadixSwitch.Thumb, {\n backgroundColor: 'white',\n borderRadius: '$round',\n display: 'block',\n transition: 'transform 50ms',\n willChange: 'transform', \n variants: {\n size: {\n md: {\n size: '$1',\n '&[data-state=\"checked\"]': {\n transform: 'translateX(calc($sizes$2 - $space$1))'\n }\n },\n lg: {\n size: '$2',\n '&[data-state=\"checked\"]': {\n transform: 'translateX($space$5)'\n },\n }\n }\n }\n})\n\ntype SwitchProps = React.ComponentProps<typeof StyledSwitch>\n\nexport const Switch: React.FC<SwitchProps> = ({ size = 'md', ...rest }) => (\n <StyledSwitch size={size} {...rest}>\n <StyledThumb size={size} />\n </StyledSwitch>\n)\n\nSwitch.displayName = 'Switch'\n"],"names":["StyledSwitch","styled","RadixSwitch","StyledThumb","Switch","size","rest","React"],"mappings":"4GAKA,MAAMA,EAAeC,EAAOC,EAAY,KAAM,CAC5C,WAAY,OACZ,gBAAiB,YACjB,OAAQ,OACR,aAAc,SACd,OAAQ,UACR,QAAS,OACT,SAAU,SACV,SAAU,WACV,WAAY,oBACZ,UAAW,CACT,gBAAiB,WACnB,EACA,UAAW,CACT,QAAS,qBACT,cAAe,KACjB,EACA,0BAA2B,CACzB,gBAAiB,UACnB,EACA,gCAAiC,CAC/B,gBAAiB,aACnB,EACA,SAAU,CACR,KAAM,CACJ,GAAI,CACF,EAAG,KACH,MAAO,IACT,EACA,GAAI,CACF,EAAG,KACH,MAAO,IACT,CACF,CACF,CACF,CAAC,EAEKC,EAAcF,EAAOC,EAAY,MAAO,CAC5C,gBAAiB,QACjB,aAAc,SACd,QAAS,QACT,WAAY,iBACZ,WAAY,YACZ,SAAU,CACR,KAAM,CACJ,GAAI,CACF,KAAM,KACN,0BAA2B,CACzB,UAAW,uCACb,CACF,EACA,GAAI,CACF,KAAM,KACN,0BAA2B,CACzB,UAAW,sBACb,CACF,CACF,CACF,CACF,CAAC,EAIYE,EAAgC,CAAC,CAAE,KAAAC,EAAO,QAASC,CAAK,IACnEC,EAAA,cAACP,EAAA,CAAa,KAAMK,EAAO,GAAGC,CAC5BC,EAAAA,EAAA,cAACJ,EAAA,CAAY,KAAME,CAAAA,CAAM,CAC3B,EAGFD,EAAO,YAAc"}