import{B as q,a as A,k as F,l as K,m as U,n as W,o as z,p as O,q as G,r as J}from"./Button-j4GWgWxO.js";import{a}from"./Utilities-CQhZFhp5.js";import{S as p}from"./Icons-8HmsRLt1.js";import"./index-nedq-V-O.js";import"./iframe-DonKbGPa.js";import"./index-C__6K5js.js";import"./index-DrFu-skq.js";const et={title:"Componenti/Button e Link/Buttons/Secondario",parameters:{docs:{description:{component:A},mdxPage:q,showAccessibility:!0}}},r={name:"Secondario",decorators:[(t,n)=>a(t,n,1,["https://cdn.inailcloud.it/assets/inail/u.1.0/static-webkit/js/custom-webkit.js"],!1)],argTypes:{align:{control:"radio",options:["pull-left","pull-right"],description:"Specifica l'allineamento"},onClick:{action:"onClick",description:"Evento al click del button.",table:{disable:!0}},disabilitato:{control:"boolean",description:"Disabilita il button",table:{defaultValue:{summary:"False"}}},iconaSinistra:{control:{type:"select"},options:[...Object.keys(p),"none"],description:"Icona prima del button",table:{defaultValue:{summary:"-"}}},iconaDestra:{control:{type:"select"},options:[...Object.keys(p),"none"],description:"Icona dopo il button",table:{defaultValue:{summary:"-"}}}},args:{disabilitato:!1,iconaSinistra:"",iconaDestra:"",buttonLabel:"Indietro",align:"pull-left"},render:t=>{const n=G(t),i=document.createElement("div");i.innerHTML=n;const e=i.querySelector("button");e&&e.addEventListener("click",t.onClick);const o=document.createElement("main");return o.id="contenutoPrincipale",e&&o.appendChild(e),o||""}},c={name:"Secondario disabilitato",decorators:[(t,n)=>a(t,n,1,["https://cdn.inailcloud.it/assets/inail/u.1.0/static-webkit/js/custom-webkit.js"],!1),t=>`<main id="contenutoPrincipale">${t()}</main>`],render:()=>J()},s={name:"Icona",decorators:[(t,n)=>a(t,n,1,["https://cdn.inailcloud.it/assets/inail/u.1.0/static-webkit/js/custom-webkit.js"],!1)],argTypes:{onClick:{action:"onClick",description:"Evento al click del button.",table:{disable:!0}}},render:t=>{const n=U(t),i=document.createElement("div");i.innerHTML=n;const e=i.querySelector("button");e&&e.addEventListener("click",t.onClick);const o=document.createElement("main");return o.id="contenutoPrincipale",e&&o.appendChild(e),o||""}},l={name:"Icona allineata a Sinistra",decorators:[(t,n)=>a(t,n,1,["https://cdn.inailcloud.it/assets/inail/u.1.0/static-webkit/js/custom-webkit.js"],!1)],argTypes:{onClick:{action:"onClick",description:"Evento al click del button.",table:{disable:!0}}},render:t=>{const n=F(t),i=document.createElement("div");i.innerHTML=n;const e=i.querySelector("button");e&&e.addEventListener("click",t.onClick);const o=document.createElement("main");return o.id="contenutoPrincipale",e&&o.appendChild(e),o||""}},d={name:"Icona allineata a Destra",decorators:[(t,n)=>a(t,n,1,["https://cdn.inailcloud.it/assets/inail/u.1.0/static-webkit/js/custom-webkit.js"],!1)],argTypes:{onClick:{action:"onClick",description:"Evento al click del button.",table:{disable:!0}}},render:t=>{const n=K(t),i=document.createElement("div");i.innerHTML=n;const e=i.querySelector("button");e&&e.addEventListener("click",t.onClick);const o=document.createElement("main");return o.id="contenutoPrincipale",e&&o.appendChild(e),o||""}},u={name:"Icona Disabilitato",decorators:[(t,n)=>a(t,n,1,["https://cdn.inailcloud.it/assets/inail/u.1.0/static-webkit/js/custom-webkit.js"],!1),t=>`<main id="contenutoPrincipale">${t()}</main>`],render:()=>W()},m={name:"Allineato Sinistra",decorators:[(t,n)=>a(t,n,1,["https://cdn.inailcloud.it/assets/inail/u.1.0/static-webkit/js/custom-webkit.js"],!1)],argTypes:{onClick:{action:"onClick",description:"Evento al click del button.",table:{disable:!0}}},render:t=>{const n=z(t),i=document.createElement("div");i.innerHTML=n;const e=i.querySelector("button");e&&e.addEventListener("click",t.onClick);const o=document.createElement("main");return o.id="contenutoPrincipale",e&&o.appendChild(e),o||""}},b={name:"Allineato Destra",decorators:[(t,n)=>a(t,n,1,["https://cdn.inailcloud.it/assets/inail/u.1.0/static-webkit/js/custom-webkit.js"],!1)],argTypes:{onClick:{action:"onClick",description:"Evento al click del button.",table:{disable:!0}}},render:t=>{const n=O(t),i=document.createElement("div");i.innerHTML=n;const e=i.querySelector("button");e&&e.addEventListener("click",t.onClick);const o=document.createElement("main");return o.id="contenutoPrincipale",e&&o.appendChild(e),o||""}};var k,E,y;r.parameters={...r.parameters,docs:{...(k=r.parameters)==null?void 0:k.docs,source:{originalSource:`{
  name: "Secondario",
  decorators: [(story, context) => addDecorator(story, context, 1, [\`\${process.env["VITE_WEBKIT_BASE_URL"]}static-webkit/js/custom-webkit.js\`], false)],
  argTypes: {
    align: {
      control: 'radio',
      options: ['pull-left', 'pull-right'],
      description: 'Specifica l\\'allineamento'
    },
    onClick: {
      action: "onClick",
      description: "Evento al click del button.",
      table: {
        disable: true
      }
    },
    disabilitato: {
      control: "boolean",
      description: "Disabilita il button",
      table: {
        defaultValue: {
          summary: "False"
        }
      }
    },
    iconaSinistra: {
      control: {
        type: "select"
      },
      options: [...Object.keys(ShowIcons), "none"],
      description: "Icona prima del button",
      table: {
        defaultValue: {
          summary: "-"
        }
      }
    },
    iconaDestra: {
      control: {
        type: "select"
      },
      options: [...Object.keys(ShowIcons), "none"],
      description: "Icona dopo il button",
      table: {
        defaultValue: {
          summary: "-"
        }
      }
    }
  },
  args: {
    disabilitato: false,
    iconaSinistra: "",
    iconaDestra: "",
    buttonLabel: 'Indietro',
    align: 'pull-left'
  },
  render: args => {
    //---------Forzare eventi----------------//
    const buttonHTML = createButtonSecondario(args);
    const tempDiv = document.createElement("div");
    tempDiv.innerHTML = buttonHTML;

    // Cerca il bottone dentro il div temporaneo
    const button = tempDiv.querySelector("button");

    // Se il bottone esiste, aggiungi l'evento click
    if (button) {
      button.addEventListener("click", args.onClick);
    }

    // Crea il main e appende il bottone all'interno
    const mainElement = document.createElement("main");
    mainElement.id = "contenutoPrincipale";
    if (button) {
      mainElement.appendChild(button);
    }

    // Ritorna il main element con il bottone all'interno
    return mainElement || "";
  }
}`,...(y=(E=r.parameters)==null?void 0:E.docs)==null?void 0:y.source}}};var v,S,g;c.parameters={...c.parameters,docs:{...(v=c.parameters)==null?void 0:v.docs,source:{originalSource:`{
  name: "Secondario disabilitato",
  decorators: [(story: any, context: any) => addDecorator(story, context, 1, [\`\${process.env["VITE_WEBKIT_BASE_URL"]}static-webkit/js/custom-webkit.js\`], false), (Story: any) => {
    const storyHtml = Story();
    return \`<main id="contenutoPrincipale">\${storyHtml}</main>\`;
  }],
  render: () => {
    return createButtonSecondarioDisabilitato();
  }
}`,...(g=(S=c.parameters)==null?void 0:S.docs)==null?void 0:g.source}}};var f,C,L;s.parameters={...s.parameters,docs:{...(f=s.parameters)==null?void 0:f.docs,source:{originalSource:`{
  name: "Icona",
  decorators: [(story: any, context: any) => addDecorator(story, context, 1, [\`\${process.env["VITE_WEBKIT_BASE_URL"]}static-webkit/js/custom-webkit.js\`], false)],
  argTypes: {
    onClick: {
      action: "onClick",
      description: "Evento al click del button.",
      table: {
        disable: true
      }
    }
  },
  render: args => {
    //---------Forzare eventi----------------//
    const buttonHTML = createButtonSecondarioIcon(args);
    const tempDiv = document.createElement("div");
    tempDiv.innerHTML = buttonHTML;

    // Cerca il bottone dentro il div temporaneo
    const button = tempDiv.querySelector("button");

    // Se il bottone esiste, aggiungi l'evento click
    if (button) {
      button.addEventListener("click", args.onClick);
    }

    // Crea il main e appende il bottone all'interno
    const mainElement = document.createElement("main");
    mainElement.id = "contenutoPrincipale";
    if (button) {
      mainElement.appendChild(button);
    }

    // Ritorna il main element con il bottone all'interno
    return mainElement || "";
  }
}`,...(L=(C=s.parameters)==null?void 0:C.docs)==null?void 0:L.source}}};var T,D,B;l.parameters={...l.parameters,docs:{...(T=l.parameters)==null?void 0:T.docs,source:{originalSource:`{
  name: "Icona allineata a Sinistra",
  decorators: [(story: any, context: any) => addDecorator(story, context, 1, [\`\${process.env["VITE_WEBKIT_BASE_URL"]}static-webkit/js/custom-webkit.js\`], false)],
  argTypes: {
    onClick: {
      action: "onClick",
      description: "Evento al click del button.",
      table: {
        disable: true
      }
    }
  },
  render: args => {
    //---------Forzare eventi----------------//
    const buttonHTML = createButtonIconLeftSecondary(args);
    const tempDiv = document.createElement("div");
    tempDiv.innerHTML = buttonHTML;

    // Cerca il bottone dentro il div temporaneo
    const button = tempDiv.querySelector("button");

    // Se il bottone esiste, aggiungi l'evento click
    if (button) {
      button.addEventListener("click", args.onClick);
    }

    // Crea il main e appende il bottone all'interno
    const mainElement = document.createElement("main");
    mainElement.id = "contenutoPrincipale";
    if (button) {
      mainElement.appendChild(button);
    }

    // Ritorna il main element con il bottone all'interno
    return mainElement || "";
  }
}`,...(B=(D=l.parameters)==null?void 0:D.docs)==null?void 0:B.source}}};var I,H,j;d.parameters={...d.parameters,docs:{...(I=d.parameters)==null?void 0:I.docs,source:{originalSource:`{
  name: "Icona allineata a Destra",
  decorators: [(story: any, context: any) => addDecorator(story, context, 1, [\`\${process.env["VITE_WEBKIT_BASE_URL"]}static-webkit/js/custom-webkit.js\`], false)],
  argTypes: {
    onClick: {
      action: "onClick",
      description: "Evento al click del button.",
      table: {
        disable: true
      }
    }
  },
  render: args => {
    //---------Forzare eventi----------------//
    const buttonHTML = createButtonIconRightSecondary(args);
    const tempDiv = document.createElement("div");
    tempDiv.innerHTML = buttonHTML;

    // Cerca il bottone dentro il div temporaneo
    const button = tempDiv.querySelector("button");

    // Se il bottone esiste, aggiungi l'evento click
    if (button) {
      button.addEventListener("click", args.onClick);
    }

    // Crea il main e appende il bottone all'interno
    const mainElement = document.createElement("main");
    mainElement.id = "contenutoPrincipale";
    if (button) {
      mainElement.appendChild(button);
    }

    // Ritorna il main element con il bottone all'interno
    return mainElement || "";
  }
}`,...(j=(H=d.parameters)==null?void 0:H.docs)==null?void 0:j.source}}};var w,h,M;u.parameters={...u.parameters,docs:{...(w=u.parameters)==null?void 0:w.docs,source:{originalSource:`{
  name: "Icona Disabilitato",
  decorators: [(story: any, context: any) => addDecorator(story, context, 1, [\`\${process.env["VITE_WEBKIT_BASE_URL"]}static-webkit/js/custom-webkit.js\`], false), (Story: any) => {
    const storyHtml = Story();
    return \`<main id="contenutoPrincipale">\${storyHtml}</main>\`;
  }],
  render: () => {
    return createButtonSecondarioIconDisabled();
  }
}`,...(M=(h=u.parameters)==null?void 0:h.docs)==null?void 0:M.source}}};var _,R,$;m.parameters={...m.parameters,docs:{...(_=m.parameters)==null?void 0:_.docs,source:{originalSource:`{
  name: "Allineato Sinistra",
  decorators: [(story: any, context: any) => addDecorator(story, context, 1, [\`\${process.env["VITE_WEBKIT_BASE_URL"]}static-webkit/js/custom-webkit.js\`], false)],
  argTypes: {
    onClick: {
      action: "onClick",
      description: "Evento al click del button.",
      table: {
        disable: true
      }
    }
  },
  render: args => {
    //---------Forzare eventi----------------//
    const buttonHTML = createButtonLeftSecondary(args);
    const tempDiv = document.createElement("div");
    tempDiv.innerHTML = buttonHTML;

    // Cerca il bottone dentro il div temporaneo
    const button = tempDiv.querySelector("button");

    // Se il bottone esiste, aggiungi l'evento click
    if (button) {
      button.addEventListener("click", args.onClick);
    }

    // Crea il main e appende il bottone all'interno
    const mainElement = document.createElement("main");
    mainElement.id = "contenutoPrincipale";
    if (button) {
      mainElement.appendChild(button);
    }

    // Ritorna il main element con il bottone all'interno
    return mainElement || "";
  }
}`,...($=(R=m.parameters)==null?void 0:R.docs)==null?void 0:$.source}}};var x,P,V;b.parameters={...b.parameters,docs:{...(x=b.parameters)==null?void 0:x.docs,source:{originalSource:`{
  name: "Allineato Destra",
  decorators: [(story: any, context: any) => addDecorator(story, context, 1, [\`\${process.env["VITE_WEBKIT_BASE_URL"]}static-webkit/js/custom-webkit.js\`], false)],
  argTypes: {
    onClick: {
      action: "onClick",
      description: "Evento al click del button.",
      table: {
        disable: true
      }
    }
  },
  render: args => {
    //---------Forzare eventi----------------//
    const buttonHTML = createButtonRightSecondary(args);
    const tempDiv = document.createElement("div");
    tempDiv.innerHTML = buttonHTML;

    // Cerca il bottone dentro il div temporaneo
    const button = tempDiv.querySelector("button");

    // Se il bottone esiste, aggiungi l'evento click
    if (button) {
      button.addEventListener("click", args.onClick);
    }

    // Crea il main e appende il bottone all'interno
    const mainElement = document.createElement("main");
    mainElement.id = "contenutoPrincipale";
    if (button) {
      mainElement.appendChild(button);
    }

    // Ritorna il main element con il bottone all'interno
    return mainElement || "";
  }
}`,...(V=(P=b.parameters)==null?void 0:P.docs)==null?void 0:V.source}}};const ot=["ButtonSecondario","ButtonSecondarioDisabilitato","ButtonIcona","ButtonIconLeftSecondario","ButtonIconRightSecondario","ButtonIconaDisabilitato","ButtonLeftSecondario","ButtonRightSecondario"];export{l as ButtonIconLeftSecondario,d as ButtonIconRightSecondario,s as ButtonIcona,u as ButtonIconaDisabilitato,m as ButtonLeftSecondario,b as ButtonRightSecondario,r as ButtonSecondario,c as ButtonSecondarioDisabilitato,ot as __namedExportsOrder,et as default};
