import{B as k,a as E,k as y,l as v,m as S,n as g,o as f,p as C,q as L,r as T}from"./Button-Blfe6wqi.js";import{a}from"./iframe-B0O0VXUn.js";import{S as p}from"./Icons-CKFxJP5Z.js";import"./preload-helper-PPVm8Dsz.js";const j={title:"Componenti/Button e Link/Buttons/Secondario",parameters:{docs:{description:{component:E},mdxPage:k,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=L(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:()=>T()},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=S(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=y(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=v(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:()=>g()},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=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||""}},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=C(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||""}};r.parameters={...r.parameters,docs:{...r.parameters?.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 || "";
  }
}`,...r.parameters?.docs?.source}}};c.parameters={...c.parameters,docs:{...c.parameters?.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();
  }
}`,...c.parameters?.docs?.source}}};s.parameters={...s.parameters,docs:{...s.parameters?.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 || "";
  }
}`,...s.parameters?.docs?.source}}};l.parameters={...l.parameters,docs:{...l.parameters?.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 || "";
  }
}`,...l.parameters?.docs?.source}}};d.parameters={...d.parameters,docs:{...d.parameters?.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 || "";
  }
}`,...d.parameters?.docs?.source}}};u.parameters={...u.parameters,docs:{...u.parameters?.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();
  }
}`,...u.parameters?.docs?.source}}};m.parameters={...m.parameters,docs:{...m.parameters?.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 || "";
  }
}`,...m.parameters?.docs?.source}}};b.parameters={...b.parameters,docs:{...b.parameters?.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 || "";
  }
}`,...b.parameters?.docs?.source}}};const w=["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,w as __namedExportsOrder,j as default};
