@atom-learning/components 3.26.1 → 3.26.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/CHANGELOG.md CHANGED
@@ -1,9 +1,9 @@
1
- ## [3.26.1](https://github.com/Atom-Learning/components/compare/v3.26.0...v3.26.1) (2024-05-15)
1
+ ## [3.26.2](https://github.com/Atom-Learning/components/compare/v3.26.1...v3.26.2) (2024-06-13)
2
2
 
3
3
 
4
4
  ### Bug Fixes
5
5
 
6
- * adding disabled style to dates that cannot be selected ([ec1686f](https://github.com/Atom-Learning/components/commit/ec1686f1ba9fff1f873aa0a3feae54860a3dc620))
6
+ * respect "as" prop when explicitely passed in TileInteractive ([8b9468a](https://github.com/Atom-Learning/components/commit/8b9468a689eb4fcf906da8d248ba489cb2830f14))
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
 
@@ -742,6 +742,8 @@ declare const StyledTileInteractive: import("@stitches/react/types/styled-compon
742
742
  marginBottom: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
743
743
  };
744
744
  }>>;
745
- declare type TTileInteractiveProps = React.ComponentProps<typeof StyledTileInteractive> & React.ButtonHTMLAttributes<HTMLButtonElement> & NavigatorActions;
745
+ declare type TTileInteractiveProps = React.ComponentProps<typeof StyledTileInteractive> & {
746
+ as?: React.ComponentType | React.ElementType;
747
+ } & React.ButtonHTMLAttributes<HTMLButtonElement> & NavigatorActions;
746
748
  export declare const TileInteractive: React.ForwardRefExoticComponent<TTileInteractiveProps>;
747
749
  export {};
@@ -1,2 +1,2 @@
1
- import e from"react";import{Tile as n}from"../tile/Tile.js";import"../flex/Flex.js";import{styled as l}from"../../stitches.js";import"../../utilities/css-wrapper/CSSWrapper.js";import"../../utilities/no-overflow-wrapper/NoOverflowWrapper.js";import"color2k";import{focusVisibleStyleBlock as c}from"../../utilities/style/focus-visible-style-block.js";import"../../utilities/style/keyframe-animations.js";const p=l.withConfig({shouldForwardStitchesProp:t=>["as"].includes(t)})(n,{"&[disabled]":{opacity:.3,cursor:"not-allowed"},"&:not([disabled])":{cursor:"pointer",transform:"translateY(0)",transition:"transform 250ms ease","&::after":{content:"",position:"absolute",inset:0,boxShadow:"$2",opacity:0,transition:"opacity 250ms ease-out",borderRadius:"inherit",pointerEvents:"none"},"&:hover":{transform:"translateY(-$space$0)","&::after":{opacity:1}},"&:active":{bg:"$base2"},"&:focus-visible":{...c()}}}),r=e.forwardRef(({onClick:t,href:o,type:i="button",...a},s)=>e.createElement(p,{...a,...o?{as:"a",href:o,onClick:void 0}:{as:"button",type:i,onClick:t},ref:s}));r.displayName="TileInteractive";export{r as TileInteractive};
1
+ import r from"react";import{Tile as l}from"../tile/Tile.js";import"../flex/Flex.js";import{styled as c}from"../../stitches.js";import"../../utilities/css-wrapper/CSSWrapper.js";import"../../utilities/no-overflow-wrapper/NoOverflowWrapper.js";import"color2k";import{focusVisibleStyleBlock as p}from"../../utilities/style/focus-visible-style-block.js";import"../../utilities/style/keyframe-animations.js";const m=c.withConfig({shouldForwardStitchesProp:t=>["as"].includes(t)})(l,{"&[disabled]":{opacity:.3,cursor:"not-allowed"},"&:not([disabled])":{cursor:"pointer",transform:"translateY(0)",transition:"transform 250ms ease","&::after":{content:"",position:"absolute",inset:0,boxShadow:"$2",opacity:0,transition:"opacity 250ms ease-out",borderRadius:"inherit",pointerEvents:"none"},"&:hover":{transform:"translateY(-$space$0)","&::after":{opacity:1}},"&:active":{bg:"$base2"},"&:focus-visible":{...p()}}}),i=r.forwardRef(({onClick:t,href:o,type:a="button",as:e,...s},n)=>r.createElement(m,{...s,...o?{as:e||"a",href:o,onClick:void 0}:{as:e||"button",type:a,onClick:t},ref:n}));i.displayName="TileInteractive";export{i as TileInteractive};
2
2
  //# sourceMappingURL=TileInteractive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TileInteractive.js","sources":["../../../src/components/tile-interactive/TileInteractive.tsx"],"sourcesContent":["import React from 'react'\n\nimport { Tile } from '~/components/tile'\nimport { styled } from '~/stitches'\nimport { NavigatorActions } from '~/types'\nimport { focusVisibleStyleBlock } from '~/utilities'\n\nconst StyledTileInteractive = styled.withConfig({\n shouldForwardStitchesProp: (propName) => ['as'].includes(propName)\n})(Tile, {\n '&[disabled]': {\n opacity: 0.3,\n cursor: 'not-allowed'\n },\n '&:not([disabled])': {\n cursor: 'pointer',\n transform: 'translateY(0)',\n transition: 'transform 250ms ease',\n '&::after': {\n content: '',\n position: 'absolute',\n inset: 0,\n boxShadow: '$2',\n opacity: 0,\n transition: 'opacity 250ms ease-out',\n borderRadius: 'inherit',\n pointerEvents: 'none'\n },\n '&:hover': {\n transform: 'translateY(-$space$0)',\n '&::after': {\n opacity: 1\n }\n },\n '&:active': {\n bg: '$base2'\n },\n '&:focus-visible': {\n ...focusVisibleStyleBlock()\n }\n }\n})\n\ntype TTileInteractiveProps = React.ComponentProps<\n typeof StyledTileInteractive\n> &\n React.ButtonHTMLAttributes<HTMLButtonElement> &\n NavigatorActions\n\nexport const TileInteractive: React.ForwardRefExoticComponent<TTileInteractiveProps> =\n React.forwardRef(({ onClick, href, type = 'button', ...rest }, ref) => {\n const isLink = !!href\n const elementSpecificProps = isLink\n ? {\n as: 'a' as React.ElementType,\n href,\n onClick: undefined\n }\n : { as: 'button' as React.ElementType, type, onClick }\n\n return (\n <StyledTileInteractive {...rest} {...elementSpecificProps} ref={ref} />\n )\n })\n\nTileInteractive.displayName = 'TileInteractive'\n"],"names":["StyledTileInteractive","styled","propName","Tile","focusVisibleStyleBlock","TileInteractive","React","onClick","href","type","rest","ref"],"mappings":"mZAOA,MAAMA,EAAwBC,EAAO,WAAW,CAC9C,0BAA4BC,GAAa,CAAC,IAAI,EAAE,SAASA,CAAQ,CACnE,CAAC,EAAEC,EAAM,CACP,cAAe,CACb,QAAS,GACT,OAAQ,aACV,EACA,oBAAqB,CACnB,OAAQ,UACR,UAAW,gBACX,WAAY,uBACZ,WAAY,CACV,QAAS,GACT,SAAU,WACV,MAAO,EACP,UAAW,KACX,QAAS,EACT,WAAY,yBACZ,aAAc,UACd,cAAe,MACjB,EACA,UAAW,CACT,UAAW,wBACX,WAAY,CACV,QAAS,CACX,CACF,EACA,WAAY,CACV,GAAI,QACN,EACA,kBAAmB,CACjB,GAAGC,EACL,CAAA,CACF,CACF,CAAC,EAQYC,EACXC,EAAM,WAAW,CAAC,CAAE,QAAAC,EAAS,KAAAC,EAAM,KAAAC,EAAO,YAAaC,CAAK,EAAGC,IAW3DL,EAAA,cAACN,EAAA,CAAuB,GAAGU,EAAO,GAVnBF,EAEb,CACE,GAAI,IACJ,KAAAA,EACA,QAAS,MACX,EACA,CAAE,GAAI,SAA+B,KAAAC,EAAM,QAAAF,CAAQ,EAGM,IAAKI,CAAAA,CAAK,CAExE,EAEHN,EAAgB,YAAc"}
1
+ {"version":3,"file":"TileInteractive.js","sources":["../../../src/components/tile-interactive/TileInteractive.tsx"],"sourcesContent":["import React from 'react'\n\nimport { Tile } from '~/components/tile'\nimport { styled } from '~/stitches'\nimport { NavigatorActions } from '~/types'\nimport { focusVisibleStyleBlock } from '~/utilities'\n\nconst StyledTileInteractive = styled.withConfig({\n shouldForwardStitchesProp: (propName) => ['as'].includes(propName)\n})(Tile, {\n '&[disabled]': {\n opacity: 0.3,\n cursor: 'not-allowed'\n },\n '&:not([disabled])': {\n cursor: 'pointer',\n transform: 'translateY(0)',\n transition: 'transform 250ms ease',\n '&::after': {\n content: '',\n position: 'absolute',\n inset: 0,\n boxShadow: '$2',\n opacity: 0,\n transition: 'opacity 250ms ease-out',\n borderRadius: 'inherit',\n pointerEvents: 'none'\n },\n '&:hover': {\n transform: 'translateY(-$space$0)',\n '&::after': {\n opacity: 1\n }\n },\n '&:active': {\n bg: '$base2'\n },\n '&:focus-visible': {\n ...focusVisibleStyleBlock()\n }\n }\n})\n\ntype TTileInteractiveProps = React.ComponentProps<\n typeof StyledTileInteractive\n> & {\n as?: React.ComponentType | React.ElementType\n} & React.ButtonHTMLAttributes<HTMLButtonElement> &\n NavigatorActions\n\nexport const TileInteractive: React.ForwardRefExoticComponent<TTileInteractiveProps> =\n React.forwardRef(({ onClick, href, type = 'button', as, ...rest }, ref) => {\n const isLink = !!href\n const elementSpecificProps = isLink\n ? {\n as: as || ('a' as React.ElementType),\n href,\n onClick: undefined\n }\n : { as: as || ('button' as React.ElementType), type, onClick }\n\n return (\n <StyledTileInteractive {...rest} {...elementSpecificProps} ref={ref} />\n )\n })\n\nTileInteractive.displayName = 'TileInteractive'\n"],"names":["StyledTileInteractive","styled","propName","Tile","focusVisibleStyleBlock","TileInteractive","React","onClick","href","type","as","rest","ref"],"mappings":"mZAOA,MAAMA,EAAwBC,EAAO,WAAW,CAC9C,0BAA4BC,GAAa,CAAC,IAAI,EAAE,SAASA,CAAQ,CACnE,CAAC,EAAEC,EAAM,CACP,cAAe,CACb,QAAS,GACT,OAAQ,aACV,EACA,oBAAqB,CACnB,OAAQ,UACR,UAAW,gBACX,WAAY,uBACZ,WAAY,CACV,QAAS,GACT,SAAU,WACV,MAAO,EACP,UAAW,KACX,QAAS,EACT,WAAY,yBACZ,aAAc,UACd,cAAe,MACjB,EACA,UAAW,CACT,UAAW,wBACX,WAAY,CACV,QAAS,CACX,CACF,EACA,WAAY,CACV,GAAI,QACN,EACA,kBAAmB,CACjB,GAAGC,EAAuB,CAC5B,CACF,CACF,CAAC,EASYC,EACXC,EAAM,WAAW,CAAC,CAAE,QAAAC,EAAS,KAAAC,EAAM,KAAAC,EAAO,SAAU,GAAAC,KAAOC,CAAK,EAAGC,IAW/DN,EAAA,cAACN,EAAA,CAAuB,GAAGW,EAAO,GAVnBH,EAEb,CACE,GAAIE,GAAO,IACX,KAAAF,EACA,QAAS,MACX,EACA,CAAE,GAAIE,GAAO,SAAgC,KAAAD,EAAM,QAAAF,CAAQ,EAGF,IAAKK,CAAAA,CAAK,CAExE,EAEHP,EAAgB,YAAc"}
@@ -743,6 +743,8 @@ declare const StyledTileToggleGroupItem: import("@stitches/react/types/styled-co
743
743
  marginBottom: string | number | import("@stitches/react/types/css-util").WithScaleValue<"space">;
744
744
  };
745
745
  }> | undefined;
746
+ } & {
747
+ as?: React.ElementType<any> | React.ComponentType<{}> | undefined;
746
748
  } & React.ButtonHTMLAttributes<HTMLButtonElement> & import("../../types").NavigatorActions>, {}, {
747
749
  sm: string;
748
750
  md: string;