@atom-learning/components 2.66.13 → 2.66.14
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 +2 -2
- package/dist/components/banner/banner-regular/BannerRegularActions.d.ts +2 -2
- package/dist/components/banner/banner-regular/BannerRegularActions.js +1 -1
- package/dist/components/banner/banner-regular/BannerRegularActions.js.map +1 -1
- package/dist/docgen.json +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/utilities/uri/index.js +1 -1
- package/dist/utilities/uri/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
## [2.66.
|
|
1
|
+
## [2.66.14](https://github.com/Atom-Learning/components/compare/v2.66.13...v2.66.14) (2023-09-07)
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* add window check to isExternalLink ([994e57e](https://github.com/Atom-Learning/components/commit/994e57eb4c362dc579d9584349b22fb51f2e095b))
|
|
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
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
export declare const BannerRegularActions: React.FC<React.ComponentProps<typeof
|
|
2
|
+
import { Flex } from '../../flex';
|
|
3
|
+
export declare const BannerRegularActions: React.FC<React.ComponentProps<typeof Flex>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import a from"invariant";import*as n from"react";import{overrideStitchesVariantValue as m}from"../../../utilities/override-stitches-variant-value/overrideStitchesVariantValue.js";import{Flex as y}from"../../flex/Flex.js";import{useBannerContext as f}from"../BannerContext.js";import{BannerRegularButton as t}from"./BannerRegularButton.js";const l=2,h={sm:2,md:4},N={sm:"column",md:"row"},r=({children:i,...s})=>{const{size:o}=f(),p=n.useMemo(()=>m(o,e=>h[e]),[o]),d=n.useMemo(()=>m(o,e=>N[e]),[o]);return a(n.Children.count(i)<=l,`A maximum of ${l} ${t.displayName} component(s) are permitted as children of ${r.displayName}`),n.createElement(y,{gap:p,direction:d,...s},n.Children.map(i,(e,c)=>{if(e==null)return e;if(!n.isValidElement(e))throw new Error(`Child passed to ${r.displayName} is not a valid element`);a(e.type===t,`Children of type ${e==null?void 0:e.type} aren't permitted. Only an ${t.displayName} component is allowed in ${r.displayName}`);const u={appearance:c>0?"outline":void 0};return n.cloneElement(e,u)}))};r.displayName="BannerRegularActions";export{r as BannerRegularActions};
|
|
2
2
|
//# sourceMappingURL=BannerRegularActions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BannerRegularActions.js","sources":["../../../../src/components/banner/banner-regular/BannerRegularActions.tsx"],"sourcesContent":["import invariant from 'invariant'\nimport * as React from 'react'\n\nimport { overrideStitchesVariantValue } from '~/utilities/override-stitches-variant-value/overrideStitchesVariantValue'\n\nimport {
|
|
1
|
+
{"version":3,"file":"BannerRegularActions.js","sources":["../../../../src/components/banner/banner-regular/BannerRegularActions.tsx"],"sourcesContent":["import invariant from 'invariant'\nimport * as React from 'react'\n\nimport { overrideStitchesVariantValue } from '~/utilities/override-stitches-variant-value/overrideStitchesVariantValue'\n\nimport { Flex } from '../../flex'\nimport { useBannerContext } from '../BannerContext'\nimport { BannerRegularButton } from './BannerRegularButton'\n\nconst MAX_ALLOWED_CHILDREN = 2\n\nconst toGap = {\n sm: 2,\n md: 4\n}\n\nconst toDirection = {\n sm: 'column',\n md: 'row'\n}\n\nexport const BannerRegularActions: React.FC<\n React.ComponentProps<typeof Flex>\n> = ({ children, ...props }) => {\n const { size } = useBannerContext()\n\n const gap = React.useMemo(\n () => overrideStitchesVariantValue(size, (s) => toGap[s]),\n [size]\n )\n\n const direction = React.useMemo(\n () => overrideStitchesVariantValue(size, (s) => toDirection[s]),\n [size]\n )\n\n invariant(\n React.Children.count(children) <= MAX_ALLOWED_CHILDREN,\n `A maximum of ${MAX_ALLOWED_CHILDREN} ${BannerRegularButton.displayName} component(s) are permitted as children of ${BannerRegularActions.displayName}`\n )\n\n return (\n <Flex gap={gap} direction={direction} {...props}>\n {React.Children.map(children, (child, index) => {\n // if child is undefined or null, React.isValidElement returns false and hence error is thrown.\n // This line will prevent that from happening\n if (child == null) return child\n\n if (!React.isValidElement(child)) {\n throw new Error(\n `Child passed to ${BannerRegularActions.displayName} is not a valid element`\n )\n }\n\n invariant(\n child.type === BannerRegularButton,\n `Children of type ${child?.type} aren't permitted. Only an ${BannerRegularButton.displayName} component is allowed in ${BannerRegularActions.displayName}`\n )\n\n const propsToInject: Partial<\n React.ComponentProps<typeof BannerRegularButton>\n > = {\n // Override button appearance - make the second button outlined\n appearance: index > 0 ? 'outline' : undefined\n }\n\n return React.cloneElement(\n child as React.ReactElement<\n React.ComponentProps<typeof BannerRegularButton>\n >,\n propsToInject\n )\n })}\n </Flex>\n )\n}\n\nBannerRegularActions.displayName = 'BannerRegularActions'\n"],"names":["MAX_ALLOWED_CHILDREN","toGap","toDirection","BannerRegularActions","children","props","size","useBannerContext","gap","React","overrideStitchesVariantValue","s","direction","invariant","BannerRegularButton","Flex","child","index","propsToInject"],"mappings":"mVASA,MAAMA,EAAuB,EAEvBC,EAAQ,CACZ,GAAI,EACJ,GAAI,CACN,EAEMC,EAAc,CAClB,GAAI,SACJ,GAAI,KACN,EAEaC,EAET,CAAC,CAAE,SAAAC,KAAaC,CAAM,IAAM,CAC9B,KAAM,CAAE,KAAAC,CAAK,EAAIC,IAEXC,EAAMC,EAAM,QAChB,IAAMC,EAA6BJ,EAAOK,GAAMV,EAAMU,EAAE,EACxD,CAACL,CAAI,CACP,EAEMM,EAAYH,EAAM,QACtB,IAAMC,EAA6BJ,EAAOK,GAAMT,EAAYS,EAAE,EAC9D,CAACL,CAAI,CACP,EAEA,OAAAO,EACEJ,EAAM,SAAS,MAAML,CAAQ,GAAKJ,EAClC,gBAAgBA,KAAwBc,EAAoB,yDAAyDX,EAAqB,aAC5I,EAGEM,EAAA,cAACM,EAAA,CAAK,IAAKP,EAAK,UAAWI,EAAY,GAAGP,GACvCI,EAAM,SAAS,IAAIL,EAAU,CAACY,EAAOC,IAAU,CAG9C,GAAID,GAAS,KAAM,OAAOA,EAE1B,GAAI,CAACP,EAAM,eAAeO,CAAK,EAC7B,MAAM,IAAI,MACR,mBAAmBb,EAAqB,oCAC1C,EAGFU,EACEG,EAAM,OAASF,EACf,oBAAoBE,GAAA,KAAAA,OAAAA,EAAO,kCAAkCF,EAAoB,uCAAuCX,EAAqB,aAC/I,EAEA,MAAMe,EAEF,CAEF,WAAYD,EAAQ,EAAI,UAAY,MACtC,EAEA,OAAOR,EAAM,aACXO,EAGAE,CACF,CACF,CAAC,CACH,CAEJ,EAEAf,EAAqB,YAAc"}
|