import{f as R,w as I,e as l,u as p}from"./index-BJMTVygn.js";import{a as V}from"./axeRun-B-LchFqf.js";import{O as D}from"./OdysseyStorybookThemeDecorator-BuDiOG2V.js";import{b as d,a as u,M}from"./Banner-K7AM0SJj.js";import"./axe-4JP0vCEZ.js";import"./_commonjsHelpers-gnU0ypJ3.js";import"./jsx-runtime-CnH95YSl.js";import"./index-NdkWRN8K.js";import"./OdysseyThemeProvider-Bh0Bu-2o.js";import"./index-BJTM6NaI.js";import"./OdysseyProvider-qIn9QVYS.js";import"./Link-BDoLypER.js";import"./Link-DNIf0luC.js";import"./useIsFocusVisible-DH0qxT5e.js";import"./Typography-ClQ35Rr-.js";import"./ExternalLink-D0l1c5Cz.js";import"./ScreenReaderText-CebALBsG.js";import"./Box-BcMTQ_R2.js";import"./createBox-Dxawkfow.js";import"./visuallyHidden-Dan1xhjv.js";import"./AlertTitle-q6ff_Zkl.js";import"./useSlot-CvpE2t6D.js";import"./resolveComponentProps-DXQ8X87i.js";import"./isHostComponent-DVu5iVWx.js";import"./createSvgIcon-ClUWwDzL.js";import"./Close-OXBt1nIe.js";import"./IconButton-5qShmnSr.js";import"./ButtonBase-BNqa2TMD.js";import"./assertThisInitialized-B9jnkVVz.js";import"./inheritsLoose-CJ6Ie9dp.js";import"./TransitionGroupContext-DAL84N7p.js";import"./Paper-D-_O-EjU.js";/*!
 * Copyright (c) 2021-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */const he={component:M,decorators:[D],tags:["autodocs"],argTypes:{linkRel:{control:"text",description:"The rel attribute defines the relationship between a linked resource and the current document.",table:{type:{summary:"string"}}},linkTarget:{control:"text",description:"The target property of the `HTMLAnchorElement` interface is a string that indicates where to display the linked resource.",table:{type:{summary:"string"}}},linkText:{control:"text",description:"If linkUrl is defined, this is the text of the link. If left blank, it defaults to 'Learn more'. Note that linkText does nothing if linkUrl is not defined",table:{type:{summary:"string"}}},linkUrl:{control:"text",description:"If defined, the alert will include a link to the URL",table:{type:{summary:"string"}}},onClose:{description:"The function that's fired when the user clicks the close button. If undefined, the close button will not be shown",table:{type:{summary:"func"}}},role:{options:u,control:{type:"radio"},description:"Sets the ARIA role of the alert ('status' for something that dynamically updates, 'alert' for errors, null for something unchanging)",table:{type:{summary:u.join(" | ")}}},severity:{options:d,control:{type:"radio"},description:"Determine the color and icon of the alert",table:{type:{summary:d.join(" | ")}},type:{required:!0,name:"other",value:"radio"}},text:{control:"text",description:"The text content of the alert",table:{type:{summary:"string"}},type:{required:!0,name:"string"}}},args:{severity:"info",text:"The mission to Sagittarius A is set for January 7.",onClose:void 0}},t={args:{severity:"info",text:"The mission to Sagittarius A is set for January 7."}},r={args:{role:"status",severity:"error",text:"An unidentified flying object compromised Hangar 18."}},n={args:{role:"status",severity:"warning",text:"Severe solar winds detected. Local system flights may be delayed."}},a={args:{linkText:"View report",linkUrl:"#anchor",role:"status",severity:"error",text:"An unidentified flying object compromised Hangar 18."},play:async({canvasElement:i,step:c})=>{await c("check for the link text",async()=>{const e=I(i).getByText("View report");await l(e==null?void 0:e.tagName).toBe("A"),await l(e==null?void 0:e.href).toBe(`${e==null?void 0:e.baseURI}#anchor`)})}},o={args:{linkTarget:"_blank",linkText:"View report",linkUrl:"#anchor",role:"status",severity:"error",text:"An unidentified flying object compromised Hangar 18."}},s={args:{onClose:R()},play:async({args:i,canvasElement:c,step:m})=>{await m("dismiss the banner on click",async()=>{const j=I(c).getByTitle("Close");await p.click(j),await p.tab(),await l(i.onClose).toHaveBeenCalled(),await V("Dismissible Banner")})}};var y,g,h;t.parameters={...t.parameters,docs:{...(y=t.parameters)==null?void 0:y.docs,source:{originalSource:`{
  args: {
    severity: "info",
    text: "The mission to Sagittarius A is set for January 7."
  }
}`,...(h=(g=t.parameters)==null?void 0:g.docs)==null?void 0:h.source}}};var f,b,k;r.parameters={...r.parameters,docs:{...(f=r.parameters)==null?void 0:f.docs,source:{originalSource:`{
  args: {
    role: "status",
    severity: "error",
    text: "An unidentified flying object compromised Hangar 18."
  }
}`,...(k=(b=r.parameters)==null?void 0:b.docs)==null?void 0:k.source}}};var x,w,v;n.parameters={...n.parameters,docs:{...(x=n.parameters)==null?void 0:x.docs,source:{originalSource:`{
  args: {
    role: "status",
    severity: "warning",
    text: "Severe solar winds detected. Local system flights may be delayed."
  }
}`,...(v=(w=n.parameters)==null?void 0:w.docs)==null?void 0:v.source}}};var T,A,S;a.parameters={...a.parameters,docs:{...(T=a.parameters)==null?void 0:T.docs,source:{originalSource:`{
  args: {
    linkText: "View report",
    linkUrl: "#anchor",
    role: "status",
    severity: "error",
    text: "An unidentified flying object compromised Hangar 18."
  },
  play: async ({
    canvasElement,
    step
  }: PlayType) => {
    await step("check for the link text", async () => {
      const canvas = within(canvasElement);
      const link = canvas.getByText<HTMLAnchorElement>("View report");
      await expect(link?.tagName).toBe("A");
      await expect(link?.href).toBe(\`\${link?.baseURI}#anchor\`);
    });
  }
}`,...(S=(A=a.parameters)==null?void 0:A.docs)==null?void 0:S.source}}};var B,E,C;o.parameters={...o.parameters,docs:{...(B=o.parameters)==null?void 0:B.docs,source:{originalSource:`{
  args: {
    linkTarget: "_blank",
    linkText: "View report",
    linkUrl: "#anchor",
    role: "status",
    severity: "error",
    text: "An unidentified flying object compromised Hangar 18."
  }
}`,...(C=(E=o.parameters)==null?void 0:E.docs)==null?void 0:C.source}}};var H,L,U;s.parameters={...s.parameters,docs:{...(H=s.parameters)==null?void 0:H.docs,source:{originalSource:`{
  args: {
    onClose: fn()
  },
  play: async ({
    args,
    canvasElement,
    step
  }: PlayType) => {
    await step("dismiss the banner on click", async () => {
      const canvas = within(canvasElement);
      const button = canvas.getByTitle("Close");
      await userEvent.click(button);
      await userEvent.tab();
      await expect(args.onClose).toHaveBeenCalled();
      await axeRun("Dismissible Banner");
    });
  }
}`,...(U=(L=s.parameters)==null?void 0:L.docs)==null?void 0:U.source}}};const fe=["Info","Error","Warning","Linked","LinkWithTarget","Dismissible"];export{s as Dismissible,r as Error,t as Info,o as LinkWithTarget,a as Linked,n as Warning,fe as __namedExportsOrder,he as default};
