@atom-learning/components 6.0.0-beta.35 → 6.0.0-beta.36
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Close as l}from"@atom-learning/icons";import{Content as m,Arrow as p,Close as c}from"@radix-ui/react-popover";import*as e from"react";import{styled as t}from"../../styled.js";import{ActionIcon as
|
|
1
|
+
import{Close as l}from"@atom-learning/icons";import{Content as m,Arrow as p,Close as c}from"@radix-ui/react-popover";import*as e from"react";import{styled as t}from"../../styled.js";import{ActionIcon as f}from"../action-icon/ActionIcon.js";import{Icon as h}from"../icon/Icon.js";const w=t(m,{base:["bg-white","rounded-md","shadow-lg","max-w-[90vw]","p-6","pr-10","relative","z-10","will-change-transform","will-change-opacity","animation-duration-75","[--slide-opacity-out:0]","data-[side=top]:[--slide-direction-out-y:-4px]","data-[side=right]:[--slide-direction-out-x:4px]","data-[side=bottom]:[--slide-direction-out-y:4px]","data-[side=left]:[--slide-direction-out-x:-4px]","motion-safe:data-[state=open]:animate-slide-direction-in","motion-safe:data-[state=closed]:animate-slide-direction-out"],variants:{size:{sm:["max-w-50"],md:["max-w-100"],lg:["max-w-150"]}}}),x=t(p,{base:["fill-white","z-1","in-data-[align=end]:mx-6"]}),u=({children:o,side:i="top",sideOffset:a=8,closePopoverText:s="Close popover",showCloseButton:d=!0,size:n="md",...r})=>e.createElement(w,{size:n,side:i,sideOffset:a,...r},d&&e.createElement(f,{as:c,label:s,size:"md",hasTooltip:!1,theme:"neutral",className:"absolute top-0.5 right-0.5"},e.createElement(h,{is:l})),o,e.createElement(x,{width:16,height:8}));export{u as PopoverContent};
|
|
2
2
|
//# sourceMappingURL=PopoverContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverContent.js","sources":["../../../src/components/popover/PopoverContent.tsx"],"sourcesContent":["import { Close as CloseIcon } from '@atom-learning/icons'\nimport { Arrow, Close, Content } from '@radix-ui/react-popover'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { ActionIcon } from '../action-icon/ActionIcon'\nimport { Icon } from '../icon/Icon'\n\nconst StyledContent = styled(Content, {\n base: [\n 'bg-white',\n 'rounded-md',\n 'shadow-lg',\n 'max-w-[90vw]',\n 'p-6',\n 'pr-10',\n 'relative',\n 'z-10',\n 'will-change-transform',\n 'will-change-opacity',\n 'animation-duration-75',\n '[--slide-opacity-out:0]',\n 'data-[side=top]:[--slide-direction-out-y:-4px]',\n 'data-[side=right]:[--slide-direction-out-x:4px]',\n 'data-[side=bottom]:[--slide-direction-out-y:4px]',\n 'data-[side=left]:[--slide-direction-out-x:-4px]',\n 'motion-safe:data-[state=open]:animate-slide-direction-in',\n 'motion-safe:data-[state=closed]:animate-slide-direction-out'\n ],\n variants: {\n size: {\n sm: ['max-w-
|
|
1
|
+
{"version":3,"file":"PopoverContent.js","sources":["../../../src/components/popover/PopoverContent.tsx"],"sourcesContent":["import { Close as CloseIcon } from '@atom-learning/icons'\nimport { Arrow, Close, Content } from '@radix-ui/react-popover'\nimport * as React from 'react'\n\nimport { styled } from '~/styled'\n\nimport { ActionIcon } from '../action-icon/ActionIcon'\nimport { Icon } from '../icon/Icon'\n\nconst StyledContent = styled(Content, {\n base: [\n 'bg-white',\n 'rounded-md',\n 'shadow-lg',\n 'max-w-[90vw]',\n 'p-6',\n 'pr-10',\n 'relative',\n 'z-10',\n 'will-change-transform',\n 'will-change-opacity',\n 'animation-duration-75',\n '[--slide-opacity-out:0]',\n 'data-[side=top]:[--slide-direction-out-y:-4px]',\n 'data-[side=right]:[--slide-direction-out-x:4px]',\n 'data-[side=bottom]:[--slide-direction-out-y:4px]',\n 'data-[side=left]:[--slide-direction-out-x:-4px]',\n 'motion-safe:data-[state=open]:animate-slide-direction-in',\n 'motion-safe:data-[state=closed]:animate-slide-direction-out'\n ],\n variants: {\n size: {\n sm: ['max-w-50'],\n md: ['max-w-100'],\n lg: ['max-w-150']\n }\n }\n})\n\nconst StyledArrow = styled(Arrow, {\n base: ['fill-white', 'z-1', 'in-data-[align=end]:mx-6']\n})\n\ntype PopoverContentProps = React.ComponentProps<typeof StyledContent> &\n React.ComponentProps<typeof Content> & {\n closePopoverText?: string\n showCloseButton?: boolean\n }\n\nexport const PopoverContent = ({\n children,\n side = 'top',\n sideOffset = 8,\n closePopoverText = 'Close popover',\n showCloseButton = true,\n size = 'md',\n ...remainingProps\n}: PopoverContentProps) => (\n <StyledContent\n size={size}\n side={side}\n sideOffset={sideOffset}\n {...remainingProps}\n >\n {showCloseButton && (\n <ActionIcon\n as={Close}\n label={closePopoverText}\n size=\"md\"\n hasTooltip={false}\n theme=\"neutral\"\n className=\"absolute top-0.5 right-0.5\"\n >\n <Icon is={CloseIcon} />\n </ActionIcon>\n )}\n {children}\n <StyledArrow width={16} height={8} />\n </StyledContent>\n)\n"],"names":["StyledContent","styled","Content","StyledArrow","Arrow","PopoverContent","children","side","sideOffset","closePopoverText","showCloseButton","size","remainingProps","React","ActionIcon","Close","Icon","CloseIcon"],"mappings":"uRASA,MAAMA,EAAgBC,EAAOC,EAAS,CACpC,KAAM,CACJ,WACA,aACA,YACA,eACA,MACA,QACA,WACA,OACA,wBACA,sBACA,wBACA,0BACA,iDACA,kDACA,mDACA,kDACA,2DACA,6DACF,EACA,SAAU,CACR,KAAM,CACJ,GAAI,CAAC,UAAU,EACf,GAAI,CAAC,WAAW,EAChB,GAAI,CAAC,WAAW,CAClB,CACF,CACF,CAAC,EAEKC,EAAcF,EAAOG,EAAO,CAChC,KAAM,CAAC,aAAc,MAAO,0BAA0B,CACxD,CAAC,EAQYC,EAAiB,CAAC,CAC7B,SAAAC,EACA,KAAAC,EAAO,MACP,WAAAC,EAAa,EACb,iBAAAC,EAAmB,gBACnB,gBAAAC,EAAkB,GAClB,KAAAC,EAAO,KACP,GAAGC,CACL,IACEC,EAAA,cAACb,EAAA,CACC,KAAMW,EACN,KAAMJ,EACN,WAAYC,EACX,GAAGI,CAEHF,EAAAA,GACCG,EAAA,cAACC,EAAA,CACC,GAAIC,EACJ,MAAON,EACP,KAAK,KACL,WAAY,GACZ,MAAM,UACN,UAAU,4BAEVI,EAAAA,EAAA,cAACG,EAAA,CAAK,GAAIC,CAAAA,CAAW,CACvB,EAEDX,EACDO,EAAA,cAACV,EAAA,CAAY,MAAO,GAAI,OAAQ,EAAG,CACrC"}
|