@atom-learning/components 3.5.1 → 3.5.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 +3 -2
- package/dist/components/action-icon/ActionIcon.js +1 -1
- package/dist/components/action-icon/ActionIcon.js.map +1 -1
- package/dist/components/alert-dialog/alert-context/AlertDialogIcon.js +1 -1
- package/dist/components/alert-dialog/alert-context/AlertDialogIcon.js.map +1 -1
- package/dist/components/badge/BadgeIcon.js +1 -1
- package/dist/components/badge/BadgeIcon.js.map +1 -1
- package/dist/components/banner/banner-slim/BannerSlimDismiss.js +1 -1
- package/dist/components/banner/banner-slim/BannerSlimDismiss.js.map +1 -1
- package/dist/components/chip/Chip.d.ts +0 -646
- package/dist/components/chip/Chip.js +1 -1
- package/dist/components/chip/Chip.js.map +1 -1
- package/dist/components/icon/Icon.js +1 -1
- package/dist/components/icon/Icon.js.map +1 -1
- package/dist/components/inline-message/InlineMessage.js +1 -1
- package/dist/components/inline-message/InlineMessage.js.map +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordionTrigger.js +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordionTrigger.js.map +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVerticalIcon.js +1 -1
- package/dist/components/navigation-menu-vertical/NavigationMenuVerticalIcon.js.map +1 -1
- package/dist/components/toggle-group/ToggleGroupButton.js +1 -1
- package/dist/components/toggle-group/ToggleGroupButton.js.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.js","sources":["../../../src/components/chip/Chip.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Box } from '~/components/box'\nimport { Flex } from '~/components/flex'\nimport { Icon } from '~/components/icon'\nimport { getTextVariant } from '~/components/text'\nimport { styled } from '~/stitches'\nimport { overrideStitchesVariantValue } from '~/utilities/override-stitches-variant-value/overrideStitchesVariantValue'\n\nconst overflowElipsis = {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap'\n}\nexport const StyledChipContent = styled('span', {\n display: 'inline-flex',\n alignItems: 'center',\n px: '$1',\n flexGrow: 1,\n ...overflowElipsis,\n '& > *:not(:last-child)': {\n mr: '$1'\n }\n})\n\nconst toIconSize = { sm: 'sm', md: 'sm', lg: 'md' }\
|
|
1
|
+
{"version":3,"file":"Chip.js","sources":["../../../src/components/chip/Chip.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Box } from '~/components/box'\nimport { Flex } from '~/components/flex'\nimport { Icon } from '~/components/icon'\nimport { getTextVariant } from '~/components/text'\nimport { styled } from '~/stitches'\nimport { overrideStitchesVariantValue } from '~/utilities/override-stitches-variant-value/overrideStitchesVariantValue'\n\nconst overflowElipsis = {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap'\n}\nexport const StyledChipContent = styled('span', {\n display: 'inline-flex',\n alignItems: 'center',\n px: '$1',\n flexGrow: 1,\n ...overflowElipsis,\n '& > *:not(:last-child)': {\n mr: '$1'\n }\n})\n\nconst toIconSize = { sm: 'sm', md: 'sm', lg: 'md' }\n\nexport const ChipIcon: typeof Icon = ({ ...props }) => {\n const rootContext = React.useContext(ChipRootContext)\n const { size } = rootContext\n const iconSize = React.useMemo(\n () => overrideStitchesVariantValue(size, (s) => toIconSize[s]),\n [size]\n )\n return <Icon {...props} size={iconSize} />\n}\n\nconst ChipContent = ({ children, ...rest }) => {\n const childrenArray = React.Children.toArray(children)\n const isSingleChild = childrenArray.length <= 1\n return (\n <StyledChipContent {...rest}>\n {\n childrenArray.map((child, index) => {\n if (!isSingleChild && typeof child === 'string')\n return (\n <Box as=\"span\" css={overflowElipsis} key={child}>\n {child}\n </Box>\n )\n if (React.isValidElement(child) && child.type === Icon) {\n return <ChipIcon key={`icon-${index}`} {...child.props} />\n }\n return child\n }) as React.ReactElement[]\n }\n </StyledChipContent>\n )\n}\n\nexport const StyledRoot = styled(Flex, {\n px: '$2',\n border: '1px solid',\n borderRadius: '$0',\n alignItems: 'center',\n fontFamily: '$body',\n maxWidth: '100%',\n borderColor: '$primary',\n color: '$primaryMid',\n bg: '$primaryLight',\n '&[data-disabled]': {\n opacity: '0.3',\n pointerEvents: 'none'\n },\n variants: {\n size: {\n sm: {\n height: '$2',\n ...getTextVariant({ size: 'sm' })\n },\n md: {\n height: '$3',\n ...getTextVariant({ size: 'sm' })\n },\n lg: {\n height: '$4',\n ...getTextVariant({ size: 'md' })\n }\n }\n }\n})\n\nexport type TChipRootContext = React.ComponentProps<typeof StyledRoot>\nexport type TChipRootProviderProps = TChipRootContext\n\nexport const ChipRootContext = React.createContext<TChipRootContext>({})\n\nexport const ChipRootProvider: React.FC<TChipRootProviderProps> = ({\n size,\n children\n}) => {\n const value = React.useMemo<TChipRootContext>(() => ({ size }), [size])\n return (\n <ChipRootContext.Provider value={value}>\n {children}\n </ChipRootContext.Provider>\n )\n}\n\nexport type TChipRootProps = TChipRootProviderProps\n\nconst ChipRoot: React.ForwardRefExoticComponent<TChipRootProps> =\n React.forwardRef(({ size = 'md', ...rest }, ref) => {\n return (\n <ChipRootProvider size={size}>\n <StyledRoot ref={ref} size={size} {...rest} />\n </ChipRootProvider>\n )\n })\n\ntype TChipType = typeof ChipRoot & {\n Content: typeof ChipContent\n Icon: typeof ChipIcon\n}\n\nexport const Chip = ChipRoot as TChipType\nChip.Content = ChipContent\nChip.Icon = ChipIcon\nChip.displayName = 'Chip'\n"],"names":["overflowElipsis","StyledChipContent","styled","toIconSize","ChipIcon","props","rootContext","React","ChipRootContext","size","iconSize","overrideStitchesVariantValue","s","Icon","ChipContent","children","rest","childrenArray","isSingleChild","child","index","Box","StyledRoot","Flex","getTextVariant","ChipRootProvider","value","ChipRoot","ref","Chip"],"mappings":"qWASA,MAAMA,EAAkB,CACtB,SAAU,SACV,aAAc,WACd,WAAY,QACd,E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,KACR,GAAGA,EAAe,CAAE,KAAM,IAAK,CAAC,CAClC,EACA,GAAI,CACF,OAAQ,KACR,GAAGA,EAAe,CAAE,KAAM,IAAK,CAAC,CAClC,CACF,CACF,CACF,CAAC,EAKYhB,EAAkBD,EAAM,cAAgC,CAAE,CAAA,EAE1DkB,EAAqD,CAAC,CACjE,KAAAhB,EACA,SAAAM,CACF,IAAM,CACJ,MAAMW,EAAQnB,EAAM,QAA0B,KAAO,CAAE,KAAAE,CAAK,GAAI,CAACA,CAAI,CAAC,EACtE,OACEF,EAAA,cAACC,EAAgB,SAAhB,CAAyB,MAAOkB,GAC9BX,CACH,CAEJ,EAIMY,EACJpB,EAAM,WAAW,CAAC,CAAE,KAAAE,EAAO,QAASO,CAAK,EAAGY,IAExCrB,EAAA,cAACkB,GAAiB,KAAMhB,CAAAA,EACtBF,EAAA,cAACe,EAAA,CAAW,IAAKM,EAAK,KAAMnB,EAAO,GAAGO,CAAM,CAAA,CAC9C,CAEH,EAOUa,EAAOF,EACpBE,EAAK,QAAUf,EACfe,EAAK,KAAOzB,EACZyB,EAAK,YAAc"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react";import{styled as n}from"../../stitches.js";const i=n("svg",{display:"inline-block",fill:"none",stroke:"currentcolor",strokeLinecap:"round",strokeLinejoin:"round",verticalAlign:"middle",variants:{size:{sm:{size:"$1",strokeWidth:"1.5"},md:{size:"$2",strokeWidth:"1.75"},lg:{size:"$3",strokeWidth:"2"}}}}),d=e.forwardRef(({is:r,size:o="md",...s},t)=>e.createElement(i,{size:o,"aria-hidden":"true",...s,as:r,ref:t}));export{d as Icon,i as StyledIcon};
|
|
1
|
+
import*as e from"react";import{styled as n}from"../../stitches.js";const i=n("svg",{display:"inline-block",fill:"none",flexShrink:0,stroke:"currentcolor",strokeLinecap:"round",strokeLinejoin:"round",verticalAlign:"middle",variants:{size:{sm:{size:"$1",strokeWidth:"1.5"},md:{size:"$2",strokeWidth:"1.75"},lg:{size:"$3",strokeWidth:"2"}}}}),d=e.forwardRef(({is:r,size:o="md",...s},t)=>e.createElement(i,{size:o,"aria-hidden":"true",...s,as:r,ref:t}));export{d as Icon,i as StyledIcon};
|
|
2
2
|
//# sourceMappingURL=Icon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","sources":["../../../src/components/icon/Icon.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\nimport { Override } from '~/utilities/types'\n\nexport const StyledIcon = styled('svg', {\n display: 'inline-block',\n fill: 'none',\n stroke: 'currentcolor',\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n verticalAlign: 'middle',\n variants: {\n size: {\n sm: { size: '$1', strokeWidth: '1.5' },\n md: { size: '$2', strokeWidth: '1.75' },\n lg: { size: '$3', strokeWidth: '2' }\n }\n }\n})\n\ntype IconProps = Override<\n React.ComponentProps<typeof StyledIcon>,\n {\n is: React.FC<React.SVGProps<SVGSVGElement>>\n as?: never\n }\n>\n\nexport const Icon: React.FC<IconProps> = React.forwardRef(\n ({ is: SVG, size = 'md', ...remainingProps }, ref) => (\n <StyledIcon\n size={size}\n aria-hidden=\"true\"\n {...remainingProps}\n as={SVG}\n ref={ref}\n />\n )\n)\n"],"names":["StyledIcon","styled","Icon","React","SVG","size","remainingProps","ref"],"mappings":"mEAKa,MAAAA,EAAaC,EAAO,MAAO,CACtC,QAAS,eACT,KAAM,OACN,OAAQ,eACR,cAAe,QACf,eAAgB,QAChB,cAAe,SACf,SAAU,CACR,KAAM,CACJ,GAAI,CAAE,KAAM,KAAM,YAAa,KAAM,EACrC,GAAI,CAAE,KAAM,KAAM,YAAa,MAAO,EACtC,GAAI,CAAE,KAAM,KAAM,YAAa,GAAI,CACrC,CACF,CACF,CAAC,EAUYC,EAA4BC,EAAM,WAC7C,CAAC,CAAE,GAAIC,EAAK,KAAAC,EAAO,QAASC,CAAe,EAAGC,IAC5CJ,EAAA,cAACH,EACC,CAAA,KAAMK,EACN,cAAY,OACX,GAAGC,EACJ,GAAIF,EACJ,IAAKG,EACP,CAEJ"}
|
|
1
|
+
{"version":3,"file":"Icon.js","sources":["../../../src/components/icon/Icon.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\nimport { Override } from '~/utilities/types'\n\nexport const StyledIcon = styled('svg', {\n display: 'inline-block',\n fill: 'none',\n flexShrink: 0,\n stroke: 'currentcolor',\n strokeLinecap: 'round',\n strokeLinejoin: 'round',\n verticalAlign: 'middle',\n variants: {\n size: {\n sm: { size: '$1', strokeWidth: '1.5' },\n md: { size: '$2', strokeWidth: '1.75' },\n lg: { size: '$3', strokeWidth: '2' }\n }\n }\n})\n\ntype IconProps = Override<\n React.ComponentProps<typeof StyledIcon>,\n {\n is: React.FC<React.SVGProps<SVGSVGElement>>\n as?: never\n }\n>\n\nexport const Icon: React.FC<IconProps> = React.forwardRef(\n ({ is: SVG, size = 'md', ...remainingProps }, ref) => (\n <StyledIcon\n size={size}\n aria-hidden=\"true\"\n {...remainingProps}\n as={SVG}\n ref={ref}\n />\n )\n)\n"],"names":["StyledIcon","styled","Icon","React","SVG","size","remainingProps","ref"],"mappings":"mEAKa,MAAAA,EAAaC,EAAO,MAAO,CACtC,QAAS,eACT,KAAM,OACN,WAAY,EACZ,OAAQ,eACR,cAAe,QACf,eAAgB,QAChB,cAAe,SACf,SAAU,CACR,KAAM,CACJ,GAAI,CAAE,KAAM,KAAM,YAAa,KAAM,EACrC,GAAI,CAAE,KAAM,KAAM,YAAa,MAAO,EACtC,GAAI,CAAE,KAAM,KAAM,YAAa,GAAI,CACrC,CACF,CACF,CAAC,EAUYC,EAA4BC,EAAM,WAC7C,CAAC,CAAE,GAAIC,EAAK,KAAAC,EAAO,QAASC,CAAe,EAAGC,IAC5CJ,EAAA,cAACH,EACC,CAAA,KAAMK,EACN,cAAY,OACX,GAAGC,EACJ,GAAIF,EACJ,IAAKG,EACP,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as e from"react";import{Flex as a}from"../flex/Flex.js";import{Icon as c}from"../icon/Icon.js";import{Text as
|
|
1
|
+
import*as e from"react";import{Flex as a}from"../flex/Flex.js";import{Icon as c}from"../icon/Icon.js";import{Text as i}from"../text/Text.js";import{styled as E}from"../../stitches.js";import{INLINE_MESSAGE_THEMES as p,INLINE_MESSAGE_ICONS as f}from"./InlineMessage.config.js";const l=E(a,{variants:{theme:p}}),I=({css:r,showIcon:t=!0,theme:s="error",size:m="sm",children:o,...n})=>e.createElement(l,{theme:s,css:r,...n},t&&e.createElement(c,{css:{mr:"$2"},size:"sm",is:f[s]}),e.createElement(i,{as:"span",size:m,css:{transform:"translateY($space$0)"}},o));export{I as InlineMessage};
|
|
2
2
|
//# sourceMappingURL=InlineMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineMessage.js","sources":["../../../src/components/inline-message/InlineMessage.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Flex } from '~/components/flex'\nimport { Icon } from '~/components/icon'\nimport { Text } from '~/components/text'\nimport { styled } from '~/stitches'\n\nimport {\n INLINE_MESSAGE_ICONS,\n INLINE_MESSAGE_THEMES\n} from './InlineMessage.config'\nimport { InlineMessageTheme } from './InlineMessage.types'\n\nconst InlineMessageContainer = styled(Flex, {\n variants: {\n theme: INLINE_MESSAGE_THEMES\n }\n})\n\
|
|
1
|
+
{"version":3,"file":"InlineMessage.js","sources":["../../../src/components/inline-message/InlineMessage.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Flex } from '~/components/flex'\nimport { Icon } from '~/components/icon'\nimport { Text } from '~/components/text'\nimport { styled } from '~/stitches'\n\nimport {\n INLINE_MESSAGE_ICONS,\n INLINE_MESSAGE_THEMES\n} from './InlineMessage.config'\nimport { InlineMessageTheme } from './InlineMessage.types'\n\nconst InlineMessageContainer = styled(Flex, {\n variants: {\n theme: INLINE_MESSAGE_THEMES\n }\n})\n\ntype TInlineMessageProps = React.ComponentProps<\n typeof InlineMessageContainer\n> & {\n showIcon?: boolean\n size?: 'xs' | 'sm' | 'md'\n}\n\nexport const InlineMessage: React.FC<TInlineMessageProps> = ({\n css,\n showIcon = true,\n theme = 'error',\n size = 'sm',\n children,\n ...rest\n}) => (\n <InlineMessageContainer theme={theme} css={css} {...rest}>\n {showIcon && (\n <Icon\n css={{ mr: '$2' }}\n size=\"sm\"\n is={INLINE_MESSAGE_ICONS[theme as InlineMessageTheme]}\n />\n )}\n <Text as=\"span\" size={size} css={{ transform: 'translateY($space$0)' }}>\n {children}\n </Text>\n </InlineMessageContainer>\n)\n"],"names":["InlineMessageContainer","styled","Flex","INLINE_MESSAGE_THEMES","InlineMessage","css","showIcon","theme","size","children","rest","React","Icon","INLINE_MESSAGE_ICONS","Text"],"mappings":"oRAaA,MAAMA,EAAyBC,EAAOC,EAAM,CAC1C,SAAU,CACR,MAAOC,CACT,CACF,CAAC,EASYC,EAA+C,CAAC,CAC3D,IAAAC,EACA,SAAAC,EAAW,GACX,MAAAC,EAAQ,QACR,KAAAC,EAAO,KACP,SAAAC,KACGC,CACL,IACEC,EAAA,cAACX,EAAA,CAAuB,MAAOO,EAAO,IAAKF,EAAM,GAAGK,CAAAA,EACjDJ,GACCK,EAAA,cAACC,EAAA,CACC,IAAK,CAAE,GAAI,IAAK,EAChB,KAAK,KACL,GAAIC,EAAqBN,EAC3B,CAAA,EAEFI,EAAA,cAACG,EAAA,CAAK,GAAG,OAAO,KAAMN,EAAM,IAAK,CAAE,UAAW,sBAAuB,CAClEC,EAAAA,CACH,CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ChevronDown as i}from"@atom-learning/icons";import{Trigger as a}from"@radix-ui/react-collapsible";import{Link as m}from"@radix-ui/react-navigation-menu";import e from"react";import{Flex as
|
|
1
|
+
import{ChevronDown as i}from"@atom-learning/icons";import{Trigger as a}from"@radix-ui/react-collapsible";import{Link as m}from"@radix-ui/react-navigation-menu";import e from"react";import{Flex as s}from"../flex/Flex.js";import{Icon as c}from"../icon/Icon.js";import{styled as t}from"../../stitches.js";import{navigationMenuVerticalItemStyles as l}from"./NavigationMenuVertical.styles.js";import{NavigationMenuVerticalAccordionContext as f}from"./NavigationMenuVerticalAccordion.js";import{NavigationMenuVerticalItemContent as p}from"./NavigationMenuVerticalItemContent.js";const g=t(a,l),u=t(c,{transition:"transform 300ms",'[data-state="open"] > &':{transform:"rotate(180deg)"}}),d=({children:r,...o})=>{const{setTriggerRef:n}=e.useContext(f);return e.createElement(m,{asChild:!0},e.createElement(g,{size:"lg",...o,asChild:!0},e.createElement(s,{as:"button",type:"button",align:"center",justify:"space-between",gap:3,ref:n},e.createElement(p,null,r),e.createElement(u,{size:"sm",is:i}))))};export{d as NavigationMenuVerticalAccordionTrigger};
|
|
2
2
|
//# sourceMappingURL=NavigationMenuVerticalAccordionTrigger.js.map
|
package/dist/components/navigation-menu-vertical/NavigationMenuVerticalAccordionTrigger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuVerticalAccordionTrigger.js","sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalAccordionTrigger.tsx"],"sourcesContent":["import { ChevronDown } from '@atom-learning/icons'\nimport { Trigger } from '@radix-ui/react-collapsible'\nimport { Link } from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { Flex } from '~/components/flex'\nimport { Icon } from '~/components/icon'\nimport { styled } from '~/stitches'\n\nimport { navigationMenuVerticalItemStyles } from './NavigationMenuVertical.styles'\nimport { NavigationMenuVerticalAccordionContext } from './NavigationMenuVerticalAccordion'\nimport { NavigationMenuVerticalItemContent } from './NavigationMenuVerticalItemContent'\n\nconst StyledNavigationMenuVerticalAccordionTrigger = styled(\n Trigger,\n navigationMenuVerticalItemStyles\n)\n\nconst StyledIcon = styled(Icon, {\n
|
|
1
|
+
{"version":3,"file":"NavigationMenuVerticalAccordionTrigger.js","sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalAccordionTrigger.tsx"],"sourcesContent":["import { ChevronDown } from '@atom-learning/icons'\nimport { Trigger } from '@radix-ui/react-collapsible'\nimport { Link } from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { Flex } from '~/components/flex'\nimport { Icon } from '~/components/icon'\nimport { styled } from '~/stitches'\n\nimport { navigationMenuVerticalItemStyles } from './NavigationMenuVertical.styles'\nimport { NavigationMenuVerticalAccordionContext } from './NavigationMenuVerticalAccordion'\nimport { NavigationMenuVerticalItemContent } from './NavigationMenuVerticalItemContent'\n\nconst StyledNavigationMenuVerticalAccordionTrigger = styled(\n Trigger,\n navigationMenuVerticalItemStyles\n)\n\nconst StyledIcon = styled(Icon, {\n transition: 'transform 300ms',\n '[data-state=\"open\"] > &': {\n transform: 'rotate(180deg)'\n }\n})\n\ntype TNavigationMenuAccordionTriggerProps = React.ComponentProps<\n typeof StyledNavigationMenuVerticalAccordionTrigger\n>\n\nexport const NavigationMenuVerticalAccordionTrigger = ({\n children,\n ...rest\n}: TNavigationMenuAccordionTriggerProps) => {\n const { setTriggerRef } = React.useContext(\n NavigationMenuVerticalAccordionContext\n )\n\n return (\n <Link asChild>\n <StyledNavigationMenuVerticalAccordionTrigger size=\"lg\" {...rest} asChild>\n <Flex\n as=\"button\"\n type=\"button\"\n align=\"center\"\n justify=\"space-between\"\n gap={3}\n ref={setTriggerRef}\n >\n <NavigationMenuVerticalItemContent>\n {children}\n </NavigationMenuVerticalItemContent>\n <StyledIcon size=\"sm\" is={ChevronDown} />\n </Flex>\n </StyledNavigationMenuVerticalAccordionTrigger>\n </Link>\n )\n}\n"],"names":["StyledNavigationMenuVerticalAccordionTrigger","styled","Trigger","navigationMenuVerticalItemStyles","StyledIcon","Icon","NavigationMenuVerticalAccordionTrigger","children","rest","setTriggerRef","React","NavigationMenuVerticalAccordionContext","Link","Flex","NavigationMenuVerticalItemContent","ChevronDown"],"mappings":"6jBAaA,MAAMA,EAA+CC,EACnDC,EACAC,CACF,EAEMC,EAAaH,EAAOI,EAAM,CAC9B,WAAY,kBACZ,0BAA2B,CACzB,UAAW,gBACb,CACF,CAAC,EAMYC,EAAyC,CAAC,CACrD,SAAAC,KACGC,CACL,IAA4C,CAC1C,KAAM,CAAE,cAAAC,CAAc,EAAIC,EAAM,WAC9BC,CACF,EAEA,OACED,EAAA,cAACE,EAAA,CAAK,QAAO,EAAA,EACXF,EAAA,cAACV,EAAA,CAA6C,KAAK,KAAM,GAAGQ,EAAM,QAAO,EAAA,EACvEE,EAAA,cAACG,EAAA,CACC,GAAG,SACH,KAAK,SACL,MAAM,SACN,QAAQ,gBACR,IAAK,EACL,IAAKJ,CAAAA,EAELC,EAAA,cAACI,EAAA,KACEP,CACH,EACAG,EAAA,cAACN,EAAA,CAAW,KAAK,KAAK,GAAIW,CAAAA,CAAa,CACzC,CACF,CACF,CAEJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as o from"react";import{Icon as e}from"../icon/Icon.js";import{styled as r}from"../../stitches.js";const i=r(e,{alignSelf:"start"}),m=t=>o.createElement(i,{size:"md",...t});export{m as NavigationMenuVerticalIcon};
|
|
2
2
|
//# sourceMappingURL=NavigationMenuVerticalIcon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationMenuVerticalIcon.js","sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalIcon.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Icon } from '~/components/icon'\nimport { styled } from '~/stitches'\n\nconst StyledNavigationMenuVerticalIcon = styled(Icon, {\n
|
|
1
|
+
{"version":3,"file":"NavigationMenuVerticalIcon.js","sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalIcon.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Icon } from '~/components/icon'\nimport { styled } from '~/stitches'\n\nconst StyledNavigationMenuVerticalIcon = styled(Icon, {\n alignSelf: 'start'\n})\nexport const NavigationMenuVerticalIcon = (\n props: React.ComponentProps<typeof StyledNavigationMenuVerticalIcon>\n): JSX.Element => <StyledNavigationMenuVerticalIcon size=\"md\" {...props} />\n"],"names":["StyledNavigationMenuVerticalIcon","styled","Icon","NavigationMenuVerticalIcon","props","React"],"mappings":"0GAKA,MAAMA,EAAmCC,EAAOC,EAAM,CACpD,UAAW,OACb,CAAC,EACYC,EACXC,GACgBC,EAAA,cAACL,EAAA,CAAiC,KAAK,KAAM,GAAGI,CAAO,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as n from"react";import{styled as
|
|
1
|
+
import*as n from"react";import{styled as g}from"../../stitches.js";import{Icon as r}from"../icon/Icon.js";import{StyledItem as f}from"./ToggleGroupItem.js";const t={sm:"32px",md:"40px",lg:"48px"},u={sm:"$4",md:"$5",lg:"$5"},h={sm:"$2",md:"$3",lg:"$3"},m=i=>({fontSize:`$${i}`,px:u[i],minHeight:t[i],"& > *:not(:last-child)":{mr:h[i]}}),d=g(f,{flexGrow:1,display:"flex",alignItems:"center",justifyContent:"center",fontWeight:600,lineHeight:1,py:"$1",variants:{size:{sm:m("sm"),md:m("md"),lg:m("lg")},isIconOnly:{true:{}}},compoundVariants:[{isIconOnly:!0,size:"sm",css:{minWidth:t.sm,p:0}},{isIconOnly:!0,size:"md",css:{minWidth:t.md,p:0}},{isIconOnly:!0,size:"lg",css:{minWidth:t.lg,p:0}}]}),$=n.forwardRef(({size:i="md",children:p,...c},a)=>{var l;const s=n.Children.toArray(p),o=s.length<=1,y=o&&n.isValidElement(s[0])&&((l=s[0])==null?void 0:l.type)===r;return n.createElement(d,{ref:a,size:i,isIconOnly:y,...c},s.map(e=>!o&&(typeof e=="string"||typeof e=="number")?n.createElement("span",{key:e},e):n.isValidElement(e)&&(e==null?void 0:e.type)===r?n.cloneElement(e,{...e.props,size:i}):e))});export{d as StyledButton,$ as ToggleGroupButton};
|
|
2
2
|
//# sourceMappingURL=ToggleGroupButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ToggleGroupButton.js","sources":["../../../src/components/toggle-group/ToggleGroupButton.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\n\nimport { Icon, StyledIcon } from '../icon'\nimport { StyledItem } from './ToggleGroupItem'\n\nconst minHeight = {\n sm: '32px',\n md: '40px',\n lg: '48px'\n}\n\nconst px = {\n sm: '$4',\n md: '$5',\n lg: '$5'\n}\n\nconst spacingBetweenElements = {\n sm: '$2',\n md: '$3',\n lg: '$3'\n}\n\nconst getSizeVariant = (size) => ({\n fontSize: `$${size}`,\n px: px[size],\n minHeight: minHeight[size],\n '& > *:not(:last-child)': {\n mr: spacingBetweenElements[size]\n }\n})\n\nexport const StyledButton = styled(StyledItem, {\n flexGrow: 1,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n fontWeight: 600,\n lineHeight: 1,\n py: '$1',\n
|
|
1
|
+
{"version":3,"file":"ToggleGroupButton.js","sources":["../../../src/components/toggle-group/ToggleGroupButton.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\n\nimport { Icon, StyledIcon } from '../icon'\nimport { StyledItem } from './ToggleGroupItem'\n\nconst minHeight = {\n sm: '32px',\n md: '40px',\n lg: '48px'\n}\n\nconst px = {\n sm: '$4',\n md: '$5',\n lg: '$5'\n}\n\nconst spacingBetweenElements = {\n sm: '$2',\n md: '$3',\n lg: '$3'\n}\n\nconst getSizeVariant = (size) => ({\n fontSize: `$${size}`,\n px: px[size],\n minHeight: minHeight[size],\n '& > *:not(:last-child)': {\n mr: spacingBetweenElements[size]\n }\n})\n\nexport const StyledButton = styled(StyledItem, {\n flexGrow: 1,\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n fontWeight: 600,\n lineHeight: 1,\n py: '$1',\n variants: {\n size: {\n sm: getSizeVariant('sm'),\n md: getSizeVariant('md'),\n lg: getSizeVariant('lg')\n },\n isIconOnly: {\n true: {}\n }\n },\n compoundVariants: [\n {\n isIconOnly: true,\n size: 'sm',\n css: {\n minWidth: minHeight.sm,\n p: 0\n }\n },\n {\n isIconOnly: true,\n size: 'md',\n css: {\n minWidth: minHeight.md,\n p: 0\n }\n },\n {\n isIconOnly: true,\n size: 'lg',\n css: {\n minWidth: minHeight.lg,\n p: 0\n }\n }\n ]\n})\n\nexport const ToggleGroupButton: React.ForwardRefExoticComponent<\n React.ComponentProps<typeof StyledButton>\n> = React.forwardRef(({ size = 'md', children, ...rest }, ref) => {\n const childrenArray = React.Children.toArray(children)\n const isSingleChild = childrenArray.length <= 1\n const isIconOnly =\n isSingleChild &&\n React.isValidElement(childrenArray[0]) &&\n childrenArray[0]?.type === Icon\n\n return (\n <StyledButton ref={ref} size={size} isIconOnly={isIconOnly} {...rest}>\n {\n childrenArray.map((child) => {\n if (\n !isSingleChild &&\n (typeof child === 'string' || typeof child === 'number')\n )\n return <span key={child}>{child}</span>\n if (React.isValidElement(child)) {\n if (child?.type === Icon)\n return React.cloneElement(child, { ...child.props, size })\n }\n return child\n }) as React.ReactElement[]\n }\n </StyledButton>\n )\n})\n"],"names":["minHeight","px","spacingBetweenElements","getSizeVariant","size","StyledButton","styled","StyledItem","ToggleGroupButton","React","children","rest","ref","_a","childrenArray","isSingleChild","isIconOnly","Icon","child"],"mappings":"4JAOA,MAAMA,EAAY,CAChB,GAAI,OACJ,GAAI,OACJ,GAAI,MACN,EAEMC,EAAK,CACT,GAAI,KACJ,GAAI,KACJ,GAAI,IACN,EAEMC,EAAyB,CAC7B,GAAI,KACJ,GAAI,KACJ,GAAI,IACN,EAEMC,EAAkBC,IAAU,CAChC,SAAU,IAAIA,IACd,GAAIH,EAAGG,GACP,UAAWJ,EAAUI,GACrB,yBAA0B,CACxB,GAAIF,EAAuBE,EAC7B,CACF,GAEaC,EAAeC,EAAOC,EAAY,CAC7C,SAAU,EACV,QAAS,OACT,WAAY,SACZ,eAAgB,SAChB,WAAY,IACZ,WAAY,EACZ,GAAI,KACJ,SAAU,CACR,KAAM,CACJ,GAAI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