import{j as w}from"./jsx-runtime-CnH95YSl.js";import{w as A,e as i}from"./index-BJMTVygn.js";import{i as s}from"./iconUtils-BII10A1q.js";import{O as E}from"./OdysseyStorybookThemeDecorator-BuDiOG2V.js";import{l as c,M as I}from"./Link-BDoLypER.js";import{a4 as _}from"./OdysseyThemeProvider-Bh0Bu-2o.js";const M={component:I,decorators:[E],argTypes:{children:{control:"text",description:"<b>Required.</b>",table:{type:{summary:"ReactNode"}},type:{required:!0}},href:{control:"text",description:"<b>Required.</b>",table:{type:{summary:"string"}},type:{required:!0}},icon:{control:{type:"select"},options:Object.keys(s),mapping:s,description:"An optional icon to display at the start of the Link",table:{type:{summary:"<Icon />"}}},rel:{control:"text",table:{type:{summary:"string"}}},target:{control:"text",description:"If set to `_blank`, the Link will display an external icon.",table:{type:{summary:"string"}},type:{required:!0}},variant:{control:{type:"radio"},options:c,table:{type:{summary:c.join(" | ")},defaultValue:{summary:"default"}}},onClick:{action:!0,description:"Callback fired when the link is clicked",table:{type:{summary:"(() => void)"},defaultValue:""}}}},e={args:{href:"#anchor",variant:"default",children:"Anchor link"}},r={args:{href:"#anchor",variant:"monochrome",children:"Monochrome link"}},t={args:{href:"#anchor",children:"Info link",icon:w.jsx(_,{})}},n={args:{href:"https://www.okta.com",children:"Visit okta.com",rel:"noopener",target:"_blank",ariaLabel:"External Link"},play:async({canvasElement:v,step:L})=>{await L("Link Aria-Label",({args:a})=>{const o=A(v).getByRole("link",{name:"External Link"});i(o).toHaveAttribute("href",a.href),i(o).toHaveAttribute("rel",a.rel),i(o).toHaveAttribute("target",a.target)})}};var l,m,p;e.parameters={...e.parameters,docs:{...(l=e.parameters)==null?void 0:l.docs,source:{originalSource:`{
  args: {
    href: "#anchor",
    variant: "default",
    children: "Anchor link"
  }
}`,...(p=(m=e.parameters)==null?void 0:m.docs)==null?void 0:p.source}}};var d,u,h;r.parameters={...r.parameters,docs:{...(d=r.parameters)==null?void 0:d.docs,source:{originalSource:`{
  args: {
    href: "#anchor",
    variant: "monochrome",
    children: "Monochrome link"
  }
}`,...(h=(u=r.parameters)==null?void 0:u.docs)==null?void 0:h.source}}};var k,f,y;t.parameters={...t.parameters,docs:{...(k=t.parameters)==null?void 0:k.docs,source:{originalSource:`{
  args: {
    href: "#anchor",
    children: "Info link",
    icon: <InformationCircleFilledIcon />
  }
}`,...(y=(f=t.parameters)==null?void 0:f.docs)==null?void 0:y.source}}};var b,g,x;n.parameters={...n.parameters,docs:{...(b=n.parameters)==null?void 0:b.docs,source:{originalSource:`{
  args: {
    href: "https://www.okta.com",
    children: "Visit okta.com",
    rel: "noopener",
    target: "_blank",
    ariaLabel: "External Link"
  },
  play: async ({
    canvasElement,
    step
  }) => {
    await step("Link Aria-Label", ({
      args
    }) => {
      const canvas = within(canvasElement);
      const link = canvas.getByRole("link", {
        name: "External Link"
      });
      expect(link).toHaveAttribute("href", args.href);
      expect(link).toHaveAttribute("rel", args.rel);
      expect(link).toHaveAttribute("target", args.target);
    });
  }
}`,...(x=(g=n.parameters)==null?void 0:g.docs)==null?void 0:x.source}}};const S=["Default","Monochrome","WithIcon","External"],z=Object.freeze(Object.defineProperty({__proto__:null,Default:e,External:n,Monochrome:r,WithIcon:t,__namedExportsOrder:S,default:M},Symbol.toStringTag,{value:"Module"}));export{z as L};
