@atom-learning/components 3.27.0-beta.5 → 3.27.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.
Files changed (85) hide show
  1. package/CHANGELOG.md +207 -0
  2. package/dist/components/accordion/AccordionTrigger.d.ts +1 -1
  3. package/dist/components/accordion/AccordionTrigger.js +1 -1
  4. package/dist/components/accordion/AccordionTrigger.js.map +1 -1
  5. package/dist/components/action-icon/ActionIcon.js +1 -1
  6. package/dist/components/action-icon/ActionIcon.js.map +1 -1
  7. package/dist/components/banner/banner-regular/BannerRegular.d.ts +0 -1
  8. package/dist/components/banner/banner-regular/BannerRegularActions.js +1 -1
  9. package/dist/components/banner/banner-slim/BannerSlim.d.ts +0 -1
  10. package/dist/components/button/Button.js +1 -1
  11. package/dist/components/button/Button.js.map +1 -1
  12. package/dist/components/calendar/Day.js +1 -1
  13. package/dist/components/calendar/Day.js.map +1 -1
  14. package/dist/components/create-password-field/CreatePasswordField.js +1 -1
  15. package/dist/components/data-table/DataTable.d.ts +44 -9
  16. package/dist/components/data-table/DataTableTable.js +1 -1
  17. package/dist/components/data-table/DataTableTable.js.map +1 -1
  18. package/dist/components/dropdown-menu/DropdownMenu.d.ts +1 -2
  19. package/dist/components/dropdown-menu/DropdownMenuLinkItem.d.ts +1 -2
  20. package/dist/components/dropdown-menu/DropdownMenuLinkItem.js +1 -1
  21. package/dist/components/dropdown-menu/DropdownMenuLinkItem.js.map +1 -1
  22. package/dist/components/empty-state/EmptyState.context.d.ts +8 -0
  23. package/dist/components/empty-state/EmptyState.context.js +2 -0
  24. package/dist/components/empty-state/EmptyState.context.js.map +1 -0
  25. package/dist/components/empty-state/EmptyState.d.ts +374 -738
  26. package/dist/components/empty-state/EmptyState.js +1 -1
  27. package/dist/components/empty-state/EmptyState.js.map +1 -1
  28. package/dist/components/empty-state/EmptyStateBody.d.ts +9 -4
  29. package/dist/components/empty-state/EmptyStateBody.js +1 -1
  30. package/dist/components/empty-state/EmptyStateBody.js.map +1 -1
  31. package/dist/components/empty-state/EmptyStateImage.d.ts +1 -2
  32. package/dist/components/empty-state/EmptyStateImage.js +1 -1
  33. package/dist/components/empty-state/EmptyStateImage.js.map +1 -1
  34. package/dist/components/empty-state/EmptyStateTitle.d.ts +7 -1
  35. package/dist/components/empty-state/EmptyStateTitle.js +1 -1
  36. package/dist/components/empty-state/EmptyStateTitle.js.map +1 -1
  37. package/dist/components/form/Form.js +1 -1
  38. package/dist/components/index.d.ts +1 -1
  39. package/dist/components/input/Input.d.ts +1503 -5
  40. package/dist/components/input/Input.js +1 -1
  41. package/dist/components/input/Input.js.map +1 -1
  42. package/dist/components/input/index.d.ts +1 -1
  43. package/dist/components/link/Link.js +1 -1
  44. package/dist/components/link/Link.js.map +1 -1
  45. package/dist/components/navigation/NavigationMenuLink.js +1 -1
  46. package/dist/components/navigation/NavigationMenuLink.js.map +1 -1
  47. package/dist/components/navigation-menu-vertical/NavigationMenuVertical.d.ts +1 -1
  48. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalLink.d.ts +2 -2
  49. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalLink.js +1 -1
  50. package/dist/components/navigation-menu-vertical/NavigationMenuVerticalLink.js.map +1 -1
  51. package/dist/components/side-bar/SideBar.d.ts +360 -364
  52. package/dist/components/side-bar/SideBarComponents.d.ts +8 -10
  53. package/dist/components/side-bar/SideBarComponents.js +1 -1
  54. package/dist/components/side-bar/SideBarComponents.js.map +1 -1
  55. package/dist/components/stepper/Stepper.js +1 -1
  56. package/dist/components/table/Table.d.ts +6 -2
  57. package/dist/components/table/Table.js +1 -1
  58. package/dist/components/table/Table.js.map +1 -1
  59. package/dist/components/table/TableStickyColumnsContainer.d.ts +3 -1
  60. package/dist/components/table/TableStickyColumnsContainer.js +1 -1
  61. package/dist/components/table/TableStickyColumnsContainer.js.map +1 -1
  62. package/dist/components/table/useStickyColumnsCss.d.ts +6 -1
  63. package/dist/components/table/useStickyColumnsCss.js +1 -1
  64. package/dist/components/table/useStickyColumnsCss.js.map +1 -1
  65. package/dist/components/tile-interactive/TileInteractive.d.ts +3 -1
  66. package/dist/components/tile-interactive/TileInteractive.js +1 -1
  67. package/dist/components/tile-interactive/TileInteractive.js.map +1 -1
  68. package/dist/components/tile-toggle-group/TileToggleGroupItem.d.ts +2 -0
  69. package/dist/components/top-bar/TopBar.d.ts +360 -364
  70. package/dist/components/top-bar/TopBarBrand.d.ts +1 -2
  71. package/dist/components/top-bar/TopBarBrand.js +1 -1
  72. package/dist/components/top-bar/TopBarBrand.js.map +1 -1
  73. package/dist/docgen.json +1 -1
  74. package/dist/index.cjs.js +1 -1
  75. package/dist/index.cjs.js.map +1 -1
  76. package/dist/index.d.ts +0 -1
  77. package/dist/index.js +1 -1
  78. package/dist/types/navigatorActions.types.d.ts +0 -1
  79. package/dist/utilities/uri/index.d.ts +0 -2
  80. package/dist/utilities/uri/index.js +1 -1
  81. package/dist/utilities/uri/index.js.map +1 -1
  82. package/package.json +1 -1
  83. package/dist/context/router/index.d.ts +0 -11
  84. package/dist/context/router/index.js +0 -2
  85. package/dist/context/router/index.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import*as e from"react";import{styled as a}from"../../stitches.js";import"../../utilities/css-wrapper/CSSWrapper.js";import"../../utilities/no-overflow-wrapper/NoOverflowWrapper.js";import"color2k";import"../../utilities/style/keyframe-animations.js";import{disabledStyle as d}from"../../utilities/style/disabledStyle.js";const n=a("input",{appearance:"none",border:"1px solid $tonal400",borderRadius:"$0",boxShadow:"none",boxSizing:"border-box",color:"$tonal600",cursor:"text",display:"block",fontFamily:"$body",px:"$3",transition:"all 100ms ease-out",width:"100%","&:focus":{borderColor:"$primary800",outline:"none"},"&[disabled]":d,"&::placeholder":{color:"$tonal300",opacity:1},variants:{size:{sm:{height:"$3",fontSize:"$sm",lineHeight:1.7},md:{height:"$4",fontSize:"$md",lineHeight:2},lg:{height:"$5",fontSize:"$md",lineHeight:2},xl:{height:"$6",fontSize:"$lg",lineHeight:2}},state:{error:{border:"1px solid $danger"}}}}),l=e.forwardRef(({type:t="text",size:o="md",...i},r)=>t==="number"?e.createElement(n,{type:"text",inputMode:"numeric",pattern:"[0-9]*",size:o,...i,ref:r}):e.createElement(n,{type:t,size:o,...i,ref:r}));l.displayName="Input";export{l as Input};
1
+ import*as r from"react";import{styled as d}from"../../stitches.js";import"../../utilities/css-wrapper/CSSWrapper.js";import"../../utilities/no-overflow-wrapper/NoOverflowWrapper.js";import"color2k";import"../../utilities/style/keyframe-animations.js";import{overrideStitchesVariantValue as p}from"../../utilities/override-stitches-variant-value/overrideStitchesVariantValue.js";import{disabledStyle as b}from"../../utilities/style/disabledStyle.js";import{Flex as c}from"../flex/Flex.js";import{Text as g}from"../text/Text.js";const a=d(c,{background:"white",color:"$grey1000",border:"1px solid $grey800",borderRadius:"$0",transition:"background 100ms ease-out, borderColor 100ms ease-out",width:"100%","&:focus-within":{borderColor:"$blue800"},variants:{size:{sm:{height:"$3"},md:{height:"$4"},lg:{height:"$5"},xl:{height:"$6"}},disabled:{true:b},state:{error:{borderColor:"$danger"}}}}),h=d.withConfig({shouldForwardStitchesProp:e=>["as"].includes(e)})(g,{appearance:"none",border:"none",background:"none",backgroundImage:"none",backgroundColor:"transparent",boxShadow:"none",boxSizing:"border-box","&:focus":{outline:"none"},px:"$3",size:"100%"}),f={sm:"sm",md:"md",lg:"md",xl:"lg"},m=r.forwardRef(({type:e="text",css:s,size:o,...t},i)=>{const n=r.useMemo(()=>p(o,u=>f[u]),[o]);return r.createElement(h,{ref:i,as:"input",type:e==="number"?"text":e,inputMode:e==="number"?"numeric":void 0,pattern:e==="number"?"[0-9]*":void 0,size:n,...t})}),l=r.forwardRef(({size:e="md",state:s,disabled:o,css:t,...i},n)=>r.createElement(a,{size:e,disabled:o,state:s,css:t},r.createElement(m,{size:e,ref:n,disabled:o,...i})));l.displayName="Input";export{l as Input,a as InputBackground,m as InputText};
2
2
  //# sourceMappingURL=Input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Input.js","sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\nimport { disabledStyle } from '~/utilities'\nimport { Override } from '~/utilities/types'\n\nconst StyledInput = styled('input', {\n appearance: 'none',\n border: '1px solid $tonal400',\n borderRadius: '$0',\n boxShadow: 'none', // prevent default iOS default styling\n boxSizing: 'border-box',\n color: '$tonal600',\n cursor: 'text',\n display: 'block',\n fontFamily: '$body',\n px: '$3',\n transition: 'all 100ms ease-out',\n width: '100%',\n '&:focus': {\n borderColor: '$primary800',\n outline: 'none'\n },\n '&[disabled]': disabledStyle,\n '&::placeholder': {\n color: '$tonal300',\n opacity: 1\n },\n variants: {\n size: {\n sm: {\n height: '$3',\n fontSize: '$sm',\n lineHeight: 1.7\n },\n md: {\n height: '$4',\n fontSize: '$md',\n lineHeight: 2\n },\n lg: {\n height: '$5',\n fontSize: '$md',\n lineHeight: 2\n },\n xl: {\n height: '$6',\n fontSize: '$lg',\n lineHeight: 2\n }\n },\n state: {\n error: {\n border: '1px solid $danger'\n }\n }\n }\n})\n\n// override default 'type' property to prevent Input from being used to render\n// checkboxes, radios etc we have dedicated components for them\nexport type InputProps = Override<\n React.ComponentProps<typeof StyledInput>,\n {\n name: string\n as?: never\n type?: 'text' | 'number' | 'email' | 'password' | 'tel' | 'url' | 'search'\n }\n>\n\nexport const Input: React.ForwardRefExoticComponent<InputProps> =\n React.forwardRef(({ type = 'text', size = 'md', ...rest }, ref) => {\n if (type === 'number') {\n return (\n <StyledInput\n type=\"text\"\n inputMode=\"numeric\"\n pattern=\"[0-9]*\"\n size={size}\n {...rest}\n ref={ref}\n />\n )\n }\n\n return <StyledInput type={type} size={size} {...rest} ref={ref} />\n })\n\nInput.displayName = 'Input'\n"],"names":["StyledInput","styled","disabledStyle","Input","React","type","size","rest","ref"],"mappings":"kUAMA,MAAMA,EAAcC,EAAO,QAAS,CAClC,WAAY,OACZ,OAAQ,sBACR,aAAc,KACd,UAAW,OACX,UAAW,aACX,MAAO,YACP,OAAQ,OACR,QAAS,QACT,WAAY,QACZ,GAAI,KACJ,WAAY,qBACZ,MAAO,OACP,UAAW,CACT,YAAa,cACb,QAAS,MACX,EACA,cAAeC,EACf,iBAAkB,CAChB,MAAO,YACP,QAAS,CACX,EACA,SAAU,CACR,KAAM,CACJ,GAAI,CACF,OAAQ,KACR,SAAU,MACV,WAAY,GACd,EACA,GAAI,CACF,OAAQ,KACR,SAAU,MACV,WAAY,CACd,EACA,GAAI,CACF,OAAQ,KACR,SAAU,MACV,WAAY,CACd,EACA,GAAI,CACF,OAAQ,KACR,SAAU,MACV,WAAY,CACd,CACF,EACA,MAAO,CACL,MAAO,CACL,OAAQ,mBACV,CACF,CACF,CACF,CAAC,EAaYC,EACXC,EAAM,WAAW,CAAC,CAAE,KAAAC,EAAO,OAAQ,KAAAC,EAAO,QAASC,CAAK,EAAGC,IACrDH,IAAS,SAETD,EAAA,cAACJ,EAAA,CACC,KAAK,OACL,UAAU,UACV,QAAQ,SACR,KAAMM,EACL,GAAGC,EACJ,IAAKC,CAAAA,CACP,EAIGJ,EAAA,cAACJ,EAAA,CAAY,KAAMK,EAAM,KAAMC,EAAO,GAAGC,EAAM,IAAKC,CAAAA,CAAK,CACjE,EAEHL,EAAM,YAAc"}
1
+ {"version":3,"file":"Input.js","sources":["../../../src/components/input/Input.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\nimport { disabledStyle } from '~/utilities'\nimport { overrideStitchesVariantValue } from '~/utilities/override-stitches-variant-value/overrideStitchesVariantValue'\nimport { Override } from '~/utilities/types'\n\nimport { Flex } from '../flex'\nimport { Text } from '../text'\n\nexport const InputBackground = styled(Flex, {\n background: 'white',\n color: '$grey1000',\n border: '1px solid $grey800',\n borderRadius: '$0',\n transition: 'background 100ms ease-out, borderColor 100ms ease-out',\n width: '100%',\n '&:focus-within': {\n borderColor: '$blue800'\n },\n variants: {\n size: {\n sm: {\n height: '$3'\n },\n md: {\n height: '$4'\n },\n lg: {\n height: '$5'\n },\n xl: {\n height: '$6'\n }\n },\n disabled: {\n true: disabledStyle\n },\n state: {\n error: {\n borderColor: '$danger'\n }\n }\n }\n})\n\nconst StyledInputText = styled.withConfig({\n shouldForwardStitchesProp: (propName) => ['as'].includes(propName)\n})(Text as unknown as 'input', {\n // unsets\n appearance: 'none',\n border: 'none',\n background: 'none',\n backgroundImage: 'none',\n backgroundColor: 'transparent',\n boxShadow: 'none', // prevent default iOS default styling\n boxSizing: 'border-box',\n '&:focus': {\n outline: 'none'\n },\n //\n px: '$3',\n size: '100%'\n})\n\nexport type InputTextProps = Override<\n React.ComponentProps<typeof StyledInputText>,\n {\n size: React.ComponentProps<typeof Text>['size']\n // override default 'type' property to prevent Input from being used to render\n // checkboxes, radios etc — we have dedicated components for them\n type?: 'text' | 'number' | 'email' | 'password' | 'tel' | 'url' | 'search'\n as?: never\n }\n>\n\nconst toTextSize = {\n sm: 'sm',\n md: 'md',\n lg: 'md',\n xl: 'lg'\n}\n\nexport const InputText = React.forwardRef(\n (\n { type = 'text', css, size, ...rest }: InputTextProps,\n ref: React.ForwardedRef<HTMLInputElement>\n ) => {\n const textSize = React.useMemo(\n () => overrideStitchesVariantValue(size, (s) => toTextSize[s]),\n [size]\n )\n\n return (\n <StyledInputText\n ref={ref}\n as=\"input\"\n type={type === 'number' ? 'text' : type}\n inputMode={type === 'number' ? 'numeric' : undefined}\n pattern={type === 'number' ? '[0-9]*' : undefined}\n size={textSize}\n {...rest}\n />\n )\n }\n)\n\ntype InputBackgroundProps = React.ComponentProps<typeof InputBackground>\nexport type InputProps = Override<\n React.ComponentProps<typeof InputText>,\n {\n size?: InputBackgroundProps['size']\n state?: InputBackgroundProps['state']\n }\n>\n\nexport const Input = React.forwardRef(\n (\n { size = 'md', state, disabled, css, ...rest }: InputProps,\n ref: React.ForwardedRef<HTMLInputElement>\n ) => {\n return (\n <InputBackground size={size} disabled={disabled} state={state} css={css}>\n <InputText size={size} ref={ref} disabled={disabled} {...rest} />\n </InputBackground>\n )\n }\n)\n\nInput.displayName = 'Input'\n"],"names":["InputBackground","styled","Flex","disabledStyle","StyledInputText","propName","Text","toTextSize","InputText","React","type","css","size","rest","ref","textSize","overrideStitchesVariantValue","s","Input","state","disabled"],"mappings":"+gBAUO,MAAMA,EAAkBC,EAAOC,EAAM,CAC1C,WAAY,QACZ,MAAO,YACP,OAAQ,qBACR,aAAc,KACd,WAAY,wDACZ,MAAO,OACP,iBAAkB,CAChB,YAAa,UACf,EACA,SAAU,CACR,KAAM,CACJ,GAAI,CACF,OAAQ,IACV,EACA,GAAI,CACF,OAAQ,IACV,EACA,GAAI,CACF,OAAQ,IACV,EACA,GAAI,CACF,OAAQ,IACV,CACF,EACA,SAAU,CACR,KAAMC,CACR,EACA,MAAO,CACL,MAAO,CACL,YAAa,SACf,CACF,CACF,CACF,CAAC,EAEKC,EAAkBH,EAAO,WAAW,CACxC,0BAA4BI,GAAa,CAAC,IAAI,EAAE,SAASA,CAAQ,CACnE,CAAC,EAAEC,EAA4B,CAE7B,WAAY,OACZ,OAAQ,OACR,WAAY,OACZ,gBAAiB,OACjB,gBAAiB,cACjB,UAAW,OACX,UAAW,aACX,UAAW,CACT,QAAS,MACX,EAEA,GAAI,KACJ,KAAM,MACR,CAAC,EAaKC,EAAa,CACjB,GAAI,KACJ,GAAI,KACJ,GAAI,KACJ,GAAI,IACN,EAEaC,EAAYC,EAAM,WAC7B,CACE,CAAE,KAAAC,EAAO,OAAQ,IAAAC,EAAK,KAAAC,KAASC,CAAK,EACpCC,IACG,CACH,MAAMC,EAAWN,EAAM,QACrB,IAAMO,EAA6BJ,EAAOK,GAAMV,EAAWU,EAAE,EAC7D,CAACL,CAAI,CACP,EAEA,OACEH,EAAA,cAACL,EAAA,CACC,IAAKU,EACL,GAAG,QACH,KAAMJ,IAAS,SAAW,OAASA,EACnC,UAAWA,IAAS,SAAW,UAAY,OAC3C,QAASA,IAAS,SAAW,SAAW,OACxC,KAAMK,EACL,GAAGF,CACN,CAAA,CAEJ,CACF,EAWaK,EAAQT,EAAM,WACzB,CACE,CAAE,KAAAG,EAAO,KAAM,MAAAO,EAAO,SAAAC,EAAU,IAAAT,KAAQE,CAAK,EAC7CC,IAGEL,EAAA,cAACT,EAAgB,CAAA,KAAMY,EAAM,SAAUQ,EAAU,MAAOD,EAAO,IAAKR,CAClEF,EAAAA,EAAA,cAACD,EAAA,CAAU,KAAMI,EAAM,IAAKE,EAAK,SAAUM,EAAW,GAAGP,CAAAA,CAAM,CACjE,CAGN,EAEAK,EAAM,YAAc"}
@@ -1,2 +1,2 @@
1
1
  export type { InputProps } from './Input';
2
- export { Input } from './Input';
2
+ export { Input, InputBackground, InputText } from './Input';
@@ -1,2 +1,2 @@
1
- import*as e from"react";import{useRouter as d}from"../../context/router/index.js";import{styled as f}from"../../stitches.js";import"../../utilities/css-wrapper/CSSWrapper.js";import"../../utilities/no-overflow-wrapper/NoOverflowWrapper.js";import"color2k";import"../../utilities/style/keyframe-animations.js";import{disabledStyle as l}from"../../utilities/style/disabledStyle.js";import{getExternalAnchorProps as c}from"../../utilities/uri/index.js";import{StyledHeading as y}from"../heading/Heading.js";import{StyledLi as u}from"../list/List.js";import"../markdown-content/components/MarkdownCode.js";import{StyledMarkdownEmphasis as b}from"../markdown-content/components/MarkdownEmphasis.js";import"../markdown-content/components/MarkdownInlineCode.js";import"../image/Image.js";import{StyledText as g,textVariants as h}from"../text/Text.js";import"../markdown-content/components/MarkdownStrong.js";import"../divider/Divider.js";const o=f("a",{bg:"unset",border:"unset",p:"unset",color:"$primary800",cursor:"pointer",fontFamily:"$body",textDecoration:"none","&:focus, &:hover":{color:"$primary900",textDecoration:"underline"},"&:active":{color:"$primary1000"},"&[disabled]":{...l,pointerEvents:"none"},[`${g} > &, ${y} > &, ${u} > &, ${b} > &`]:{fontSize:"100%",lineHeight:1,"&::before, &::after":{content:"none"}},variants:h,defaultVariants:{size:"md"}}),i=e.forwardRef(({as:n,disabled:a,href:r,target:t,...m},p)=>{const{RouterLink:s}=d({href:r,target:t});return e.createElement(o,{as:n||(r?s:"button"),noCapsize:r?void 0:!0,href:r,target:t,...a&&{disabled:!0},...m,...c(r),ref:p})});i.displayName="Link";export{i as Link,o as StyledLink};
1
+ import*as o from"react";import{styled as p}from"../../stitches.js";import"../../utilities/css-wrapper/CSSWrapper.js";import"../../utilities/no-overflow-wrapper/NoOverflowWrapper.js";import"color2k";import"../../utilities/style/keyframe-animations.js";import{disabledStyle as d}from"../../utilities/style/disabledStyle.js";import{getExternalAnchorProps as s}from"../../utilities/uri/index.js";import{StyledHeading as l}from"../heading/Heading.js";import{StyledLi as f}from"../list/List.js";import"../markdown-content/components/MarkdownCode.js";import{StyledMarkdownEmphasis as y}from"../markdown-content/components/MarkdownEmphasis.js";import"../markdown-content/components/MarkdownInlineCode.js";import"../image/Image.js";import{StyledText as c,textVariants as b}from"../text/Text.js";import"../markdown-content/components/MarkdownStrong.js";import"../divider/Divider.js";const t=p("a",{bg:"unset",border:"unset",p:"unset",color:"$primary800",cursor:"pointer",fontFamily:"$body",textDecoration:"none","&:focus, &:hover":{color:"$primary900",textDecoration:"underline"},"&:active":{color:"$primary1000"},"&[disabled]":{...d,pointerEvents:"none"},[`${c} > &, ${l} > &, ${f} > &, ${y} > &`]:{fontSize:"100%",lineHeight:1,"&::before, &::after":{content:"none"}},variants:b,defaultVariants:{size:"md"}}),e=o.forwardRef(({as:i,disabled:n,href:r,...m},a)=>o.createElement(t,{as:i||(r?void 0:"button"),noCapsize:r?void 0:!0,href:r,...n&&{disabled:!0},...m,...s(r),ref:a}));e.displayName="Link";export{e as Link,t as StyledLink};
2
2
  //# sourceMappingURL=Link.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","sources":["../../../src/components/link/Link.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { useRouter } from '~/context/router'\nimport { styled } from '~/stitches'\nimport { NavigatorActions } from '~/types'\nimport { disabledStyle, Override } from '~/utilities'\nimport { getExternalAnchorProps } from '~/utilities/uri'\n\nimport { StyledHeading } from '../heading/Heading'\nimport { StyledLi } from '../list/List'\nimport { StyledMarkdownEmphasis } from '../markdown-content/components'\nimport { StyledText, textVariants } from '../text/Text'\n\nexport const StyledLink = styled('a', {\n bg: 'unset',\n border: 'unset',\n p: 'unset',\n color: '$primary800',\n cursor: 'pointer',\n fontFamily: '$body',\n textDecoration: 'none',\n '&:focus, &:hover': {\n color: '$primary900',\n textDecoration: 'underline'\n },\n '&:active': {\n color: '$primary1000'\n },\n '&[disabled]': {\n ...disabledStyle,\n pointerEvents: 'none'\n },\n\n [`${StyledText} > &, ${StyledHeading} > &, ${StyledLi} > &, ${StyledMarkdownEmphasis} > &`]:\n {\n fontSize: '100%',\n lineHeight: 1,\n '&::before, &::after': {\n content: 'none'\n }\n },\n variants: textVariants,\n defaultVariants: {\n size: 'md'\n }\n})\n\ntype LinkProps = Override<\n React.ComponentProps<typeof StyledLink>,\n {\n as?: React.ComponentType | React.ElementType\n } & NavigatorActions & { disabled?: boolean }\n>\n\nexport const Link: React.ForwardRefExoticComponent<LinkProps> =\n React.forwardRef(({ as, disabled, href, target, ...rest }, ref) => {\n const { RouterLink } = useRouter({ href, target })\n\n return (\n <StyledLink\n as={as || (href ? RouterLink : 'button')}\n noCapsize={!href ? true : undefined}\n href={href}\n target={target}\n {...(disabled && { disabled: true })}\n {...rest}\n {...getExternalAnchorProps(href)}\n ref={ref}\n />\n )\n })\n\nLink.displayName = 'Link'\n"],"names":["StyledLink","styled","disabledStyle","StyledText","StyledHeading","StyledLi","StyledMarkdownEmphasis","textVariants","Link","React","as","disabled","href","target","rest","ref","RouterLink","useRouter","getExternalAnchorProps"],"mappings":"m6BAaO,MAAMA,EAAaC,EAAO,IAAK,CACpC,GAAI,QACJ,OAAQ,QACR,EAAG,QACH,MAAO,cACP,OAAQ,UACR,WAAY,QACZ,eAAgB,OAChB,mBAAoB,CAClB,MAAO,cACP,eAAgB,WAClB,EACA,WAAY,CACV,MAAO,cACT,EACA,cAAe,CACb,GAAGC,EACH,cAAe,MACjB,EAEA,CAAC,GAAGC,UAAmBC,UAAsBC,UAAiBC,SAC5D,CACE,SAAU,OACV,WAAY,EACZ,sBAAuB,CACrB,QAAS,MACX,CACF,EACF,SAAUC,EACV,gBAAiB,CACf,KAAM,IACR,CACF,CAAC,EASYC,EACXC,EAAM,WAAW,CAAC,CAAE,GAAAC,EAAI,SAAAC,EAAU,KAAAC,EAAM,OAAAC,KAAWC,CAAK,EAAGC,IAAQ,CACjE,KAAM,CAAE,WAAAC,CAAW,EAAIC,EAAU,CAAE,KAAAL,EAAM,OAAAC,CAAO,CAAC,EAEjD,OACEJ,EAAA,cAACT,EAAA,CACC,GAAIU,IAAOE,EAAOI,EAAa,UAC/B,UAAYJ,EAAc,OAAP,GACnB,KAAMA,EACN,OAAQC,EACP,GAAIF,GAAY,CAAE,SAAU,EAAK,EACjC,GAAGG,EACH,GAAGI,EAAuBN,CAAI,EAC/B,IAAKG,CAAAA,CACP,CAEJ,CAAC,EAEHP,EAAK,YAAc"}
1
+ {"version":3,"file":"Link.js","sources":["../../../src/components/link/Link.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { styled } from '~/stitches'\nimport { NavigatorActions } from '~/types'\nimport { disabledStyle, Override } from '~/utilities'\nimport { getExternalAnchorProps } from '~/utilities/uri'\n\nimport { StyledHeading } from '../heading/Heading'\nimport { StyledLi } from '../list/List'\nimport { StyledMarkdownEmphasis } from '../markdown-content/components'\nimport { StyledText, textVariants } from '../text/Text'\n\nexport const StyledLink = styled('a', {\n bg: 'unset',\n border: 'unset',\n p: 'unset',\n color: '$primary800',\n cursor: 'pointer',\n fontFamily: '$body',\n textDecoration: 'none',\n '&:focus, &:hover': {\n color: '$primary900',\n textDecoration: 'underline'\n },\n '&:active': {\n color: '$primary1000'\n },\n '&[disabled]': {\n ...disabledStyle,\n pointerEvents: 'none'\n },\n\n [`${StyledText} > &, ${StyledHeading} > &, ${StyledLi} > &, ${StyledMarkdownEmphasis} > &`]:\n {\n fontSize: '100%',\n lineHeight: 1,\n '&::before, &::after': {\n content: 'none'\n }\n },\n variants: textVariants,\n defaultVariants: {\n size: 'md'\n }\n})\n\ntype LinkProps = Override<\n React.ComponentProps<typeof StyledLink>,\n {\n as?: React.ComponentType | React.ElementType\n } & NavigatorActions & { disabled?: boolean }\n>\n\nexport const Link: React.ForwardRefExoticComponent<LinkProps> =\n React.forwardRef(({ as, disabled, href, ...rest }, ref) => (\n <StyledLink\n as={as || (!href ? 'button' : undefined)}\n noCapsize={!href ? true : undefined}\n href={href}\n {...(disabled && { disabled: true })}\n {...rest}\n {...getExternalAnchorProps(href)}\n ref={ref}\n />\n ))\n\nLink.displayName = 'Link'\n"],"names":["StyledLink","styled","disabledStyle","StyledText","StyledHeading","StyledLi","StyledMarkdownEmphasis","textVariants","Link","React","as","disabled","href","rest","ref","getExternalAnchorProps"],"mappings":"y2BAYa,MAAAA,EAAaC,EAAO,IAAK,CACpC,GAAI,QACJ,OAAQ,QACR,EAAG,QACH,MAAO,cACP,OAAQ,UACR,WAAY,QACZ,eAAgB,OAChB,mBAAoB,CAClB,MAAO,cACP,eAAgB,WAClB,EACA,WAAY,CACV,MAAO,cACT,EACA,cAAe,CACb,GAAGC,EACH,cAAe,MACjB,EAEA,CAAC,GAAGC,UAAmBC,UAAsBC,UAAiBC,SAC5D,CACE,SAAU,OACV,WAAY,EACZ,sBAAuB,CACrB,QAAS,MACX,CACF,EACF,SAAUC,EACV,gBAAiB,CACf,KAAM,IACR,CACF,CAAC,EASYC,EACXC,EAAM,WAAW,CAAC,CAAE,GAAAC,EAAI,SAAAC,EAAU,KAAAC,KAASC,CAAK,EAAGC,IACjDL,EAAA,cAACT,GACC,GAAIU,IAAQE,EAAkB,OAAX,UACnB,UAAYA,EAAc,OAAP,GACnB,KAAMA,EACL,GAAID,GAAY,CAAE,SAAU,EAAK,EACjC,GAAGE,EACH,GAAGE,EAAuBH,CAAI,EAC/B,IAAKE,CAAAA,CACP,CACD,EAEHN,EAAK,YAAc"}
@@ -1,2 +1,2 @@
1
- import*as i from"@radix-ui/react-navigation-menu";import e from"react";import{useRouter as f}from"../../context/router/index.js";import{styled as o}from"../../stitches.js";import{getExternalAnchorProps as p}from"../../utilities/uri/index.js";import{navigationMenuBaseItemStyles as l,navigationMenuDisabledItemStyles as v,navigationMenuActiveItemStyles as b}from"./NavigationMenu.styles.js";const k=o("button",{...l,...v}),S=o(i.Item),h=o(i.Link,l,{display:"block",textDecoration:"none",lineHeight:1,variants:{elementType:{dropdownItem:{"&[data-active]":{background:"$backgroundSelected",color:"$textSelected","&:hover":{background:"$backgroundSelectedHover",color:"$textSelectedHover"},"&:active":{background:"$backgroundSelectedPressed",color:"$textSelectedPressed"},"&:focus-visible":{boxShadow:"0 0 0 2px $colors$primary800",color:"$textSelectedFocus"}}},link:{"&[data-active]":{...b}}}}}),c=e.forwardRef(({children:r,href:t,target:a,disabled:d,css:n,variant:s="link",ref:x,...m},u)=>{const{RouterLink:g}=f({href:t,target:a});return e.createElement(S,null,d?e.createElement(k,{disabled:!0,css:n},r):e.createElement(h,{href:t,target:a,ref:u,elementType:s,css:n,...p(t),...m,asChild:!0},e.createElement(g,null,r)))});c.displayName="NavigationMenuLink";export{c as NavigationMenuLink};
1
+ import*as n from"@radix-ui/react-navigation-menu";import e from"react";import{styled as t}from"../../stitches.js";import{getExternalAnchorProps as u}from"../../utilities/uri/index.js";import{navigationMenuBaseItemStyles as i,navigationMenuDisabledItemStyles as v,navigationMenuActiveItemStyles as b}from"./NavigationMenu.styles.js";const p=t("button",{...i,...v}),f=t(n.Item),g=t(n.Link,i,{display:"block",textDecoration:"none",lineHeight:1,variants:{elementType:{dropdownItem:{"&[data-active]":{background:"$backgroundSelected",color:"$textSelected","&:hover":{background:"$backgroundSelectedHover",color:"$textSelectedHover"},"&:active":{background:"$backgroundSelectedPressed",color:"$textSelectedPressed"},"&:focus-visible":{boxShadow:"0 0 0 2px $colors$primary800",color:"$textSelectedFocus"}}},link:{"&[data-active]":{...b}}}}}),c=e.forwardRef(({children:o,href:r,disabled:l,css:a,variant:d="link",ref:k,...s},m)=>e.createElement(f,null,l?e.createElement(p,{disabled:!0,css:a},o):e.createElement(g,{href:r,ref:m,elementType:d,css:a,...u(r),...s},o)));c.displayName="NavigationMenuLink";export{c as NavigationMenuLink};
2
2
  //# sourceMappingURL=NavigationMenuLink.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationMenuLink.js","sources":["../../../src/components/navigation/NavigationMenuLink.tsx"],"sourcesContent":["import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { useRouter } from '~/context/router'\nimport { styled } from '~/stitches'\nimport { getExternalAnchorProps } from '~/utilities/uri'\n\nimport {\n navigationMenuActiveItemStyles,\n navigationMenuBaseItemStyles,\n navigationMenuDisabledItemStyles\n} from './NavigationMenu.styles'\n\nconst DisabledButton = styled('button', {\n ...navigationMenuBaseItemStyles,\n ...navigationMenuDisabledItemStyles\n})\n\nconst ListItem = styled(NavigationMenuPrimitive.Item)\n\nconst StyledLink = styled(\n NavigationMenuPrimitive.Link,\n navigationMenuBaseItemStyles,\n {\n display: 'block',\n textDecoration: 'none',\n lineHeight: 1,\n variants: {\n elementType: {\n dropdownItem: {\n '&[data-active]': {\n background: '$backgroundSelected',\n color: '$textSelected',\n '&:hover': {\n background: '$backgroundSelectedHover',\n color: '$textSelectedHover'\n },\n '&:active': {\n background: '$backgroundSelectedPressed',\n color: '$textSelectedPressed'\n },\n '&:focus-visible': {\n boxShadow: '0 0 0 2px $colors$primary800',\n color: '$textSelectedFocus'\n }\n }\n },\n link: {\n '&[data-active]': { ...navigationMenuActiveItemStyles }\n }\n }\n }\n }\n)\n\nexport const NavigationMenuLink: React.ForwardRefExoticComponent<\n Omit<React.ComponentProps<typeof StyledLink>, 'elementType'> & {\n disabled?: boolean\n variant?: React.ComponentProps<typeof StyledLink>['elementType']\n }\n> = React.forwardRef(\n (\n { children, href, target, disabled, css, variant = 'link', ref, ...props },\n forwardedRef\n ) => {\n const { RouterLink } = useRouter({ href, target })\n return (\n <ListItem>\n {disabled ? (\n <DisabledButton disabled css={css}>\n {children}\n </DisabledButton>\n ) : (\n <StyledLink\n href={href}\n target={target}\n ref={forwardedRef}\n elementType={variant}\n css={css}\n {...getExternalAnchorProps(href)}\n {...props}\n asChild\n >\n <RouterLink>{children}</RouterLink>\n </StyledLink>\n )}\n </ListItem>\n )\n }\n)\n\nNavigationMenuLink.displayName = 'NavigationMenuLink'\n"],"names":["DisabledButton","styled","navigationMenuBaseItemStyles","navigationMenuDisabledItemStyles","ListItem","NavigationMenuPrimitive","StyledLink","navigationMenuActiveItemStyles","NavigationMenuLink","React","children","href","target","disabled","css","variant","ref","props","forwardedRef","RouterLink","useRouter","getExternalAnchorProps"],"mappings":"sYAaA,MAAMA,EAAiBC,EAAO,SAAU,CACtC,GAAGC,EACH,GAAGC,CACL,CAAC,EAEKC,EAAWH,EAAOI,EAAwB,IAAI,EAE9CC,EAAaL,EACjBI,EAAwB,KACxBH,EACA,CACE,QAAS,QACT,eAAgB,OAChB,WAAY,EACZ,SAAU,CACR,YAAa,CACX,aAAc,CACZ,iBAAkB,CAChB,WAAY,sBACZ,MAAO,gBACP,UAAW,CACT,WAAY,2BACZ,MAAO,oBACT,EACA,WAAY,CACV,WAAY,6BACZ,MAAO,sBACT,EACA,kBAAmB,CACjB,UAAW,+BACX,MAAO,oBACT,CACF,CACF,EACA,KAAM,CACJ,iBAAkB,CAAE,GAAGK,CAA+B,CACxD,CACF,CACF,CACF,CACF,EAEaC,EAKTC,EAAM,WACR,CACE,CAAE,SAAAC,EAAU,KAAAC,EAAM,OAAAC,EAAQ,SAAAC,EAAU,IAAAC,EAAK,QAAAC,EAAU,OAAQ,IAAAC,KAAQC,CAAM,EACzEC,IACG,CACH,KAAM,CAAE,WAAAC,CAAW,EAAIC,EAAU,CAAE,KAAAT,EAAM,OAAAC,CAAO,CAAC,EACjD,OACEH,EAAA,cAACL,EAAA,KACES,EACCJ,EAAA,cAACT,EAAA,CAAe,SAAQ,GAAC,IAAKc,CAC3BJ,EAAAA,CACH,EAEAD,EAAA,cAACH,EAAA,CACC,KAAMK,EACN,OAAQC,EACR,IAAKM,EACL,YAAaH,EACb,IAAKD,EACJ,GAAGO,EAAuBV,CAAI,EAC9B,GAAGM,EACJ,QAAO,EAEPR,EAAAA,EAAA,cAACU,EAAA,KAAYT,CAAS,CACxB,CAEJ,CAEJ,CACF,EAEAF,EAAmB,YAAc"}
1
+ {"version":3,"file":"NavigationMenuLink.js","sources":["../../../src/components/navigation/NavigationMenuLink.tsx"],"sourcesContent":["import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { styled } from '~/stitches'\nimport { getExternalAnchorProps } from '~/utilities/uri'\n\nimport {\n navigationMenuActiveItemStyles,\n navigationMenuBaseItemStyles,\n navigationMenuDisabledItemStyles\n} from './NavigationMenu.styles'\n\nconst DisabledButton = styled('button', {\n ...navigationMenuBaseItemStyles,\n ...navigationMenuDisabledItemStyles\n})\n\nconst ListItem = styled(NavigationMenuPrimitive.Item)\n\nconst StyledLink = styled(\n NavigationMenuPrimitive.Link,\n navigationMenuBaseItemStyles,\n {\n display: 'block',\n textDecoration: 'none',\n lineHeight: 1,\n variants: {\n elementType: {\n dropdownItem: {\n '&[data-active]': {\n background: '$backgroundSelected',\n color: '$textSelected',\n '&:hover': {\n background: '$backgroundSelectedHover',\n color: '$textSelectedHover'\n },\n '&:active': {\n background: '$backgroundSelectedPressed',\n color: '$textSelectedPressed'\n },\n '&:focus-visible': {\n boxShadow: '0 0 0 2px $colors$primary800',\n color: '$textSelectedFocus'\n }\n }\n },\n link: {\n '&[data-active]': { ...navigationMenuActiveItemStyles }\n }\n }\n }\n }\n)\n\nexport const NavigationMenuLink: React.ForwardRefExoticComponent<\n Omit<React.ComponentProps<typeof StyledLink>, 'elementType'> & {\n disabled?: boolean\n variant?: React.ComponentProps<typeof StyledLink>['elementType']\n }\n> = React.forwardRef(\n (\n { children, href, disabled, css, variant = 'link', ref, ...props },\n forwardedRef\n ) => (\n <ListItem>\n {disabled ? (\n <DisabledButton disabled css={css}>\n {children}\n </DisabledButton>\n ) : (\n <StyledLink\n href={href}\n ref={forwardedRef}\n elementType={variant}\n css={css}\n {...getExternalAnchorProps(href)}\n {...props}\n >\n {children}\n </StyledLink>\n )}\n </ListItem>\n )\n)\n\nNavigationMenuLink.displayName = 'NavigationMenuLink'\n"],"names":["DisabledButton","styled","navigationMenuBaseItemStyles","navigationMenuDisabledItemStyles","ListItem","NavigationMenuPrimitive","StyledLink","navigationMenuActiveItemStyles","NavigationMenuLink","React","children","href","disabled","css","variant","ref","props","forwardedRef","getExternalAnchorProps"],"mappings":"4UAYA,MAAMA,EAAiBC,EAAO,SAAU,CACtC,GAAGC,EACH,GAAGC,CACL,CAAC,EAEKC,EAAWH,EAAOI,EAAwB,IAAI,EAE9CC,EAAaL,EACjBI,EAAwB,KACxBH,EACA,CACE,QAAS,QACT,eAAgB,OAChB,WAAY,EACZ,SAAU,CACR,YAAa,CACX,aAAc,CACZ,iBAAkB,CAChB,WAAY,sBACZ,MAAO,gBACP,UAAW,CACT,WAAY,2BACZ,MAAO,oBACT,EACA,WAAY,CACV,WAAY,6BACZ,MAAO,sBACT,EACA,kBAAmB,CACjB,UAAW,+BACX,MAAO,oBACT,CACF,CACF,EACA,KAAM,CACJ,iBAAkB,CAAE,GAAGK,CAA+B,CACxD,CACF,CACF,CACF,CACF,EAEaC,EAKTC,EAAM,WACR,CACE,CAAE,SAAAC,EAAU,KAAAC,EAAM,SAAAC,EAAU,IAAAC,EAAK,QAAAC,EAAU,OAAQ,IAAAC,KAAQC,CAAM,EACjEC,IAEAR,EAAA,cAACL,EAAA,KACEQ,EACCH,EAAA,cAACT,EAAA,CAAe,SAAQ,GAAC,IAAKa,GAC3BH,CACH,EAEAD,EAAA,cAACH,EAAA,CACC,KAAMK,EACN,IAAKM,EACL,YAAaH,EACb,IAAKD,EACJ,GAAGK,EAAuBP,CAAI,EAC9B,GAAGK,GAEHN,CACH,CAEJ,CAEJ,EAEAF,EAAmB,YAAc"}
@@ -368,7 +368,7 @@ declare const StyledRoot: import("@stitches/react/types/styled-component").Style
368
368
  }>>;
369
369
  declare type TNavigationVerticalProps = Omit<React.ComponentProps<typeof StyledRoot>, 'delayDuration' | 'skipDelayDuration' | 'defaultValue' | 'value' | 'onValueChange'>;
370
370
  export declare const NavigationMenuVertical: (({ children, ...rest }: TNavigationVerticalProps) => JSX.Element) & {
371
- Link: ({ as, href, target, children, ...rest }: Omit<import("@radix-ui/react-navigation-menu").NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>, "size" | "css"> & import("@stitches/react/types/styled-component").TransformProps<{
371
+ Link: ({ as, href, children, ...rest }: Omit<import("@radix-ui/react-navigation-menu").NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>, "size" | "css"> & import("@stitches/react/types/styled-component").TransformProps<{
372
372
  size?: "md" | "lg" | undefined;
373
373
  }, {
374
374
  sm: string;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  declare const StyledNavigationMenuVerticalLink: import("@stitches/react/types/styled-component").StyledComponent<React.ForwardRefExoticComponent<import("@radix-ui/react-navigation-menu").NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>, {
3
3
  size?: "md" | "lg" | undefined;
4
4
  }, {
@@ -371,5 +371,5 @@ declare const StyledNavigationMenuVerticalLink: import("@stitches/react/types/st
371
371
  declare type NavigationMenuVerticalItemProps = React.ComponentProps<typeof StyledNavigationMenuVerticalLink> & {
372
372
  as?: React.ComponentType | React.ElementType;
373
373
  };
374
- export declare const NavigationMenuVerticalLink: ({ as, href, target, children, ...rest }: NavigationMenuVerticalItemProps) => JSX.Element;
374
+ export declare const NavigationMenuVerticalLink: ({ as, href, children, ...rest }: NavigationMenuVerticalItemProps) => JSX.Element;
375
375
  export {};
@@ -1,2 +1,2 @@
1
- import{Link as c}from"@radix-ui/react-navigation-menu";import*as t from"react";import{useRouter as p}from"../../context/router/index.js";import{styled as u}from"../../stitches.js";import{getExternalAnchorProps as f}from"../../utilities/uri/index.js";import{navigationMenuVerticalItemStyles as s}from"./NavigationMenuVertical.styles.js";import{NavigationMenuVerticalItem as g}from"./NavigationMenuVerticalItem.js";import{NavigationMenuVerticalItemContent as h}from"./NavigationMenuVerticalItemContent.js";import{preventEvent as v}from"../../utilities/event/preventEvent.js";const E=u(c,s),V=({as:r,href:e,target:o,children:n,...i})=>{const{RouterLink:m}=p({href:e,target:o}),a=r||(e?m:"button"),l=r?{}:e?f(e):{type:"button"};return t.createElement(g,null,t.createElement(E,{size:"lg",href:e,target:o,...i,...l,onSelect:v,asChild:!0},t.createElement(a,null,t.createElement(h,null,n))))};export{V as NavigationMenuVerticalLink};
1
+ import{Link as a}from"@radix-ui/react-navigation-menu";import t from"react";import{styled as l}from"../../stitches.js";import{getExternalAnchorProps as c}from"../../utilities/uri/index.js";import{navigationMenuVerticalItemStyles as p}from"./NavigationMenuVertical.styles.js";import{NavigationMenuVerticalItem as f}from"./NavigationMenuVerticalItem.js";import{NavigationMenuVerticalItemContent as u}from"./NavigationMenuVerticalItemContent.js";import{preventEvent as s}from"../../utilities/event/preventEvent.js";const v=l(a,p),g=({as:r,href:e,children:n,...o})=>{const i=r||(e?"a":"button"),m=r?{}:e?c(e):{type:"button"};return t.createElement(f,null,t.createElement(v,{size:"lg",href:e,...o,...m,onSelect:s,asChild:!0},t.createElement(i,null,t.createElement(u,null,n))))};export{g as NavigationMenuVerticalLink};
2
2
  //# sourceMappingURL=NavigationMenuVerticalLink.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NavigationMenuVerticalLink.js","sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalLink.tsx"],"sourcesContent":["import { Link } from '@radix-ui/react-navigation-menu'\nimport * as React from 'react'\n\nimport { useRouter } from '~/context/router'\nimport { styled } from '~/stitches'\nimport { preventEvent } from '~/utilities/event'\nimport { getExternalAnchorProps } from '~/utilities/uri'\n\nimport { navigationMenuVerticalItemStyles } from './NavigationMenuVertical.styles'\nimport { NavigationMenuVerticalItem } from './NavigationMenuVerticalItem'\nimport { NavigationMenuVerticalItemContent } from './NavigationMenuVerticalItemContent'\n\nconst StyledNavigationMenuVerticalLink = styled(\n Link,\n navigationMenuVerticalItemStyles\n)\n\ntype NavigationMenuVerticalItemProps = React.ComponentProps<\n typeof StyledNavigationMenuVerticalLink\n> & {\n as?: React.ComponentType | React.ElementType\n}\n\nexport const NavigationMenuVerticalLink = ({\n as,\n href,\n target,\n children,\n ...rest\n}: NavigationMenuVerticalItemProps) => {\n const { RouterLink } = useRouter({ href, target })\n\n const Component = as || (href ? RouterLink : 'button')\n const componentProps = as\n ? {}\n : href\n ? getExternalAnchorProps(href)\n : { type: 'button' }\n\n return (\n <NavigationMenuVerticalItem>\n <StyledNavigationMenuVerticalLink\n size=\"lg\"\n href={href}\n target={target}\n {...rest}\n {...componentProps}\n onSelect={preventEvent}\n asChild // ?: Can't use `as` for this as we lose `data-active` etc. attributes when we try to. Using `asChild` and `Component` as a workaround.\n >\n <Component>\n <NavigationMenuVerticalItemContent>\n {children}\n </NavigationMenuVerticalItemContent>\n </Component>\n </StyledNavigationMenuVerticalLink>\n </NavigationMenuVerticalItem>\n )\n}\n"],"names":["StyledNavigationMenuVerticalLink","styled","Link","navigationMenuVerticalItemStyles","NavigationMenuVerticalLink","as","href","target","children","rest","RouterLink","useRouter","Component","componentProps","getExternalAnchorProps","React","NavigationMenuVerticalItem","preventEvent","NavigationMenuVerticalItemContent"],"mappings":"6jBAYA,MAAMA,EAAmCC,EACvCC,EACAC,CACF,EAQaC,EAA6B,CAAC,CACzC,GAAAC,EACA,KAAAC,EACA,OAAAC,EACA,SAAAC,KACGC,CACL,IAAuC,CACrC,KAAM,CAAE,WAAAC,CAAW,EAAIC,EAAU,CAAE,KAAAL,EAAM,OAAAC,CAAO,CAAC,EAE3CK,EAAYP,IAAOC,EAAOI,EAAa,UACvCG,EAAiBR,EACnB,CAAA,EACAC,EACAQ,EAAuBR,CAAI,EAC3B,CAAE,KAAM,QAAS,EAErB,OACES,EAAA,cAACC,EAAA,KACCD,EAAA,cAACf,EAAA,CACC,KAAK,KACL,KAAMM,EACN,OAAQC,EACP,GAAGE,EACH,GAAGI,EACJ,SAAUI,EACV,QAAO,EAAA,EAEPF,EAAA,cAACH,EAAA,KACCG,EAAA,cAACG,EAAA,KACEV,CACH,CACF,CACF,CACF,CAEJ"}
1
+ {"version":3,"file":"NavigationMenuVerticalLink.js","sources":["../../../src/components/navigation-menu-vertical/NavigationMenuVerticalLink.tsx"],"sourcesContent":["import { Link } from '@radix-ui/react-navigation-menu'\nimport React from 'react'\n\nimport { styled } from '~/stitches'\nimport { preventEvent } from '~/utilities/event'\nimport { getExternalAnchorProps } from '~/utilities/uri'\n\nimport { navigationMenuVerticalItemStyles } from './NavigationMenuVertical.styles'\nimport { NavigationMenuVerticalItem } from './NavigationMenuVerticalItem'\nimport { NavigationMenuVerticalItemContent } from './NavigationMenuVerticalItemContent'\n\nconst StyledNavigationMenuVerticalLink = styled(\n Link,\n navigationMenuVerticalItemStyles\n)\n\ntype NavigationMenuVerticalItemProps = React.ComponentProps<\n typeof StyledNavigationMenuVerticalLink\n> & {\n as?: React.ComponentType | React.ElementType\n}\n\nexport const NavigationMenuVerticalLink = ({\n as,\n href,\n children,\n ...rest\n}: NavigationMenuVerticalItemProps) => {\n const Component = as || (href ? 'a' : 'button')\n const componentProps = as\n ? {}\n : href\n ? getExternalAnchorProps(href)\n : { type: 'button' }\n\n return (\n <NavigationMenuVerticalItem>\n <StyledNavigationMenuVerticalLink\n size=\"lg\"\n href={href}\n {...rest}\n {...componentProps}\n onSelect={preventEvent}\n asChild // ?: Can't use `as` for this as we lose `data-active` etc. attributes when we try to. Using `asChild` and `Component` as a workaround.\n >\n <Component>\n <NavigationMenuVerticalItemContent>\n {children}\n </NavigationMenuVerticalItemContent>\n </Component>\n </StyledNavigationMenuVerticalLink>\n </NavigationMenuVerticalItem>\n )\n}\n"],"names":["StyledNavigationMenuVerticalLink","styled","Link","navigationMenuVerticalItemStyles","NavigationMenuVerticalLink","as","href","children","rest","Component","componentProps","getExternalAnchorProps","React","NavigationMenuVerticalItem","preventEvent","NavigationMenuVerticalItemContent"],"mappings":"ggBAWA,MAAMA,EAAmCC,EACvCC,EACAC,CACF,EAQaC,EAA6B,CAAC,CACzC,GAAAC,EACA,KAAAC,EACA,SAAAC,KACGC,CACL,IAAuC,CACrC,MAAMC,EAAYJ,IAAOC,EAAO,IAAM,UAChCI,EAAiBL,EACnB,CAAC,EACDC,EACAK,EAAuBL,CAAI,EAC3B,CAAE,KAAM,QAAS,EAErB,OACEM,EAAA,cAACC,EAAA,KACCD,EAAA,cAACZ,EAAA,CACC,KAAK,KACL,KAAMM,EACL,GAAGE,EACH,GAAGE,EACJ,SAAUI,EACV,QAAO,EAEPF,EAAAA,EAAA,cAACH,EAAA,KACCG,EAAA,cAACG,EAAA,KACER,CACH,CACF,CACF,CACF,CAEJ"}