@yamada-ui/react
Version:
React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion
1 lines • 1.38 kB
Source Map (JSON)
{"version":3,"file":"link.cjs","names":["createComponent","linkStyle"],"sources":["../../../../src/components/link/link.tsx"],"sourcesContent":["\"use client\"\n\nimport type { HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { LinkStyle } from \"./link.style\"\nimport { createComponent } from \"../../core\"\nimport { linkStyle } from \"./link.style\"\n\nexport interface LinkProps extends HTMLStyledProps<\"a\">, ThemeProps<LinkStyle> {\n /**\n * If `true`, the link will open in new tab.\n *\n * @default false\n */\n external?: boolean\n}\n\nconst {\n PropsContext: LinkPropsContext,\n usePropsContext: useLinkPropsContext,\n withContext,\n} = createComponent<LinkProps, LinkStyle>(\"link\", linkStyle)\n\nexport { LinkPropsContext, useLinkPropsContext }\n\n/**\n * `Link` is a component for creating hyperlinks to different web pages, locations within the same page, or other URLs.\n *\n * @see https://yamada-ui.com/docs/components/link\n */\nexport const Link = withContext(\"a\")(undefined, ({ external, ...rest }) => ({\n rel: external ? \"noopener\" : undefined,\n target: external ? \"_blank\" : undefined,\n ...rest,\n}))\n"],"mappings":";;;;;;;AAgBA,MAAM,EACJ,cAAc,kBACd,iBAAiB,qBACjB,gBACEA,yCAAsC,QAAQC,6BAAU;;;;;;AAS5D,MAAa,OAAO,YAAY,IAAI,CAAC,SAAY,EAAE,SAAU,GAAG,YAAY;CAC1E,KAAK,WAAW,aAAa;CAC7B,QAAQ,WAAW,WAAW;CAC9B,GAAG;CACJ,EAAE"}