import{B as k,a as v,c as y,b as C,d as f,e as g,f as L,g as T,h as D,i as B,j as S}from"./Button-DbHVHUuv.js";import{S as E}from"./Icons-DmoOYz6o.js";import{a}from"./iframe-BaLO-W8Q.js";import"./preload-helper-PPVm8Dsz.js";const h={title:"Componenti/Button e Link/Buttons/Primario",parameters:{docs:{description:{component:v},mdxPage:k,showAccessibility:!0}}},r={name:"Primario",decorators:[(t,e)=>a(t,e,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"}}},isCompleta:{control:"boolean",description:"Mostra lo stile del button Completa",table:{defaultValue:{summary:"False"}}},iconaSinistra:{control:{type:"select"},options:[...Object.keys(E),"none"],description:"Icona prima del button",table:{defaultValue:{summary:"-"}}},iconaDestra:{control:{type:"select"},options:[...Object.keys(E),"none"],description:"Icona dopo il button",table:{defaultValue:{summary:"-"}}}},args:{disabilitato:!1,isCompleta:!1,iconaSinistra:"",iconaDestra:"",buttonLabel:"Conferma",align:"pull-left"},render:t=>{const e=y(t),i=document.createElement("div");i.innerHTML=e;const n=i.querySelector("button");n&&n.addEventListener("click",t.onClick);const o=document.createElement("main");return o.id="contenutoPrincipale",n&&o.appendChild(n),o||""}},c={name:"Primario disabilitato",decorators:[(t,e)=>a(t,e,1,["https://cdn.inailcloud.it/assets/inail/u.1.0/static-webkit/js/custom-webkit.js"],!1),t=>`<main id="contenutoPrincipale">${t()}</main>`],render:()=>f()},l={name:"Icona",decorators:[(t,e)=>a(t,e,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 e=T(t),i=document.createElement("div");i.innerHTML=e;const n=i.querySelector("button");n&&n.addEventListener("click",t.onClick);const o=document.createElement("main");return o.id="contenutoPrincipale",n&&o.appendChild(n),o||""}},s={name:"Icona allineata a Sinistra",decorators:[(t,e)=>a(t,e,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 e=g(t),i=document.createElement("div");i.innerHTML=e;const n=i.querySelector("button");n&&n.addEventListener("click",t.onClick);const o=document.createElement("main");return o.id="contenutoPrincipale",n&&o.appendChild(n),o||""}},u={name:"Icona allineata a Destra",decorators:[(t,e)=>a(t,e,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 e=L(t),i=document.createElement("div");i.innerHTML=e;const n=i.querySelector("button");n&&n.addEventListener("click",t.onClick);const o=document.createElement("main");return o.id="contenutoPrincipale",n&&o.appendChild(n),o||""}},m={name:"Icona Disabilitato",decorators:[(t,e)=>a(t,e,1,["https://cdn.inailcloud.it/assets/inail/u.1.0/static-webkit/js/custom-webkit.js"],!1),t=>`<main id="contenutoPrincipale">${t()}</main>`],render:()=>D()},d={name:"Allineato a Sinistra",decorators:[(t,e)=>a(t,e,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 e=B(t),i=document.createElement("div");i.innerHTML=e;const n=i.querySelector("button");n&&n.addEventListener("click",t.onClick);const o=document.createElement("main");return o.id="contenutoPrincipale",n&&o.appendChild(n),o||""}},b={name:"Allineato a Destra",decorators:[(t,e)=>a(t,e,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 e=S(t),i=document.createElement("div");i.innerHTML=e;const n=i.querySelector("button");n&&n.addEventListener("click",t.onClick);const o=document.createElement("main");return o.id="contenutoPrincipale",n&&o.appendChild(n),o||""}},p={name:"Completa",decorators:[(t,e)=>a(t,e,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 e=C(t),i=document.createElement("div");i.innerHTML=e;const n=i.querySelector("button");n&&n.addEventListener("click",t.onClick);const o=document.createElement("main");return o.id="contenutoPrincipale",n&&o.appendChild(n),o||""}};r.parameters={...r.parameters,docs:{...r.parameters?.docs,source:{originalSource:`{
  name: "Primario",
  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"
        }
      }
    },
    isCompleta: {
      control: "boolean",
      description: "Mostra lo stile del button Completa",
      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,
    isCompleta: false,
    iconaSinistra: "",
    iconaDestra: "",
    buttonLabel: 'Conferma',
    align: 'pull-left'
  },
  render: args => {
    //---------Forzare eventi----------------//
    const buttonHTML = createButton(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: "Primario 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 createButtonDisabled();
  }
}`,...c.parameters?.docs?.source}}};l.parameters={...l.parameters,docs:{...l.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 = createButtonIcon(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}}};s.parameters={...s.parameters,docs:{...s.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 = createButtonIconLeft(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}}};u.parameters={...u.parameters,docs:{...u.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 = createButtonIconRight(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 || "";
  }
}`,...u.parameters?.docs?.source}}};m.parameters={...m.parameters,docs:{...m.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 createButtonIconDisabled();
  }
}`,...m.parameters?.docs?.source}}};d.parameters={...d.parameters,docs:{...d.parameters?.docs,source:{originalSource:`{
  name: "Allineato 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 = createButtonLeft(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}}};b.parameters={...b.parameters,docs:{...b.parameters?.docs,source:{originalSource:`{
  name: "Allineato 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 = createButtonRight(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}}};p.parameters={...p.parameters,docs:{...p.parameters?.docs,source:{originalSource:`{
  name: "Completa",
  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 = createButtonCompleta(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 || "";
  }
}`,...p.parameters?.docs?.source}}};const M=["Button","ButtonDisabilitato","ButtonIcona","ButtonIconLeft","ButtonIconRight","ButtonIconaDisabilitato","ButtonLeft","ButtonRight","ButtonCompleta"];export{r as Button,p as ButtonCompleta,c as ButtonDisabilitato,s as ButtonIconLeft,u as ButtonIconRight,l as ButtonIcona,m as ButtonIconaDisabilitato,d as ButtonLeft,b as ButtonRight,M as __namedExportsOrder,h as default};
