import{B as _,a as G,c as J,b as K,d as N,e as Q,f as U,g as W,h as X,i as Y,j as Z}from"./Button-BDing-W9.js";import{S as k}from"./Icons-DMOXgaJA.js";import{a}from"./Utilities-CQhZFhp5.js";import"./index-9DVgQ-cF.js";import"./iframe-CUPRdDjv.js";import"./index-C__6K5js.js";import"./index-DrFu-skq.js";const ct={title:"Componenti/Button e Link/Buttons/Primario",parameters:{docs:{description:{component:G},mdxPage:_,showAccessibility:!0}}},r={name:"Primario",decorators:[(t,n)=>a(t,n,1,["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(k),"none"],description:"Icona prima del button",table:{defaultValue:{summary:"-"}}},iconaDestra:{control:{type:"select"},options:[...Object.keys(k),"none"],description:"Icona dopo il button",table:{defaultValue:{summary:"-"}}}},args:{disabilitato:!1,isCompleta:!1,iconaSinistra:"",iconaDestra:"",buttonLabel:"Conferma",align:"pull-left"},render:t=>{const n=J(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:"Primario disabilitato",decorators:[(t,n)=>a(t,n,1,["static-webkit/js/custom-webkit.js"],!1),t=>`<main id="contenutoPrincipale">${t()}</main>`],render:()=>K()},l={name:"Icona",decorators:[(t,n)=>a(t,n,1,["static-webkit/js/custom-webkit.js"],!1)],argTypes:{onClick:{action:"onClick",description:"Evento al click del button.",table:{disable:!0}}},render:t=>{const n=N(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||""}},s={name:"Icona allineata a Sinistra",decorators:[(t,n)=>a(t,n,1,["static-webkit/js/custom-webkit.js"],!1)],argTypes:{onClick:{action:"onClick",description:"Evento al click del button.",table:{disable:!0}}},render:t=>{const n=Q(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||""}},m={name:"Icona allineata a Destra",decorators:[(t,n)=>a(t,n,1,["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||""}},u={name:"Icona Disabilitato",decorators:[(t,n)=>a(t,n,1,["static-webkit/js/custom-webkit.js"],!1),t=>`<main id="contenutoPrincipale">${t()}</main>`],render:()=>W()},d={name:"Allineato a Sinistra",decorators:[(t,n)=>a(t,n,1,["static-webkit/js/custom-webkit.js"],!1)],argTypes:{onClick:{action:"onClick",description:"Evento al click del button.",table:{disable:!0}}},render:t=>{const n=X(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 a Destra",decorators:[(t,n)=>a(t,n,1,["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||""}},p={name:"Completa",decorators:[(t,n)=>a(t,n,1,["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||""}};var y,E,v;r.parameters={...r.parameters,docs:{...(y=r.parameters)==null?void 0:y.docs,source:{originalSource:`{
  name: "Primario",
  decorators: [(story, context) => addDecorator(story, context, 1, ["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 || "";
  }
}`,...(v=(E=r.parameters)==null?void 0:E.docs)==null?void 0:v.source}}};var C,f,g;c.parameters={...c.parameters,docs:{...(C=c.parameters)==null?void 0:C.docs,source:{originalSource:`{
  name: "Primario disabilitato",
  decorators: [(story: any, context: any) => addDecorator(story, context, 1, ["static-webkit/js/custom-webkit.js"], false), (Story: any) => {
    const storyHtml = Story();
    return \`<main id="contenutoPrincipale">\${storyHtml}</main>\`;
  }],
  render: () => {
    return createButtonDisabled();
  }
}`,...(g=(f=c.parameters)==null?void 0:f.docs)==null?void 0:g.source}}};var D,L,T;l.parameters={...l.parameters,docs:{...(D=l.parameters)==null?void 0:D.docs,source:{originalSource:`{
  name: "Icona",
  decorators: [(story: any, context: any) => addDecorator(story, context, 1, ["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 || "";
  }
}`,...(T=(L=l.parameters)==null?void 0:L.docs)==null?void 0:T.source}}};var S,H,j;s.parameters={...s.parameters,docs:{...(S=s.parameters)==null?void 0:S.docs,source:{originalSource:`{
  name: "Icona allineata a Sinistra",
  decorators: [(story: any, context: any) => addDecorator(story, context, 1, ["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 || "";
  }
}`,...(j=(H=s.parameters)==null?void 0:H.docs)==null?void 0:j.source}}};var B,w,M;m.parameters={...m.parameters,docs:{...(B=m.parameters)==null?void 0:B.docs,source:{originalSource:`{
  name: "Icona allineata a Destra",
  decorators: [(story: any, context: any) => addDecorator(story, context, 1, ["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 || "";
  }
}`,...(M=(w=m.parameters)==null?void 0:w.docs)==null?void 0:M.source}}};var I,h,P;u.parameters={...u.parameters,docs:{...(I=u.parameters)==null?void 0:I.docs,source:{originalSource:`{
  name: "Icona Disabilitato",
  decorators: [(story: any, context: any) => addDecorator(story, context, 1, ["static-webkit/js/custom-webkit.js"], false), (Story: any) => {
    const storyHtml = Story();
    return \`<main id="contenutoPrincipale">\${storyHtml}</main>\`;
  }],
  render: () => {
    return createButtonIconDisabled();
  }
}`,...(P=(h=u.parameters)==null?void 0:h.docs)==null?void 0:P.source}}};var x,R,q;d.parameters={...d.parameters,docs:{...(x=d.parameters)==null?void 0:x.docs,source:{originalSource:`{
  name: "Allineato a Sinistra",
  decorators: [(story: any, context: any) => addDecorator(story, context, 1, ["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 || "";
  }
}`,...(q=(R=d.parameters)==null?void 0:R.docs)==null?void 0:q.source}}};var F,V,z;b.parameters={...b.parameters,docs:{...(F=b.parameters)==null?void 0:F.docs,source:{originalSource:`{
  name: "Allineato a Destra",
  decorators: [(story: any, context: any) => addDecorator(story, context, 1, ["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 || "";
  }
}`,...(z=(V=b.parameters)==null?void 0:V.docs)==null?void 0:z.source}}};var A,O,$;p.parameters={...p.parameters,docs:{...(A=p.parameters)==null?void 0:A.docs,source:{originalSource:`{
  name: "Completa",
  decorators: [(story: any, context: any) => addDecorator(story, context, 1, ["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 || "";
  }
}`,...($=(O=p.parameters)==null?void 0:O.docs)==null?void 0:$.source}}};const lt=["Button","ButtonDisabilitato","ButtonIcona","ButtonIconLeft","ButtonIconRight","ButtonIconaDisabilitato","ButtonLeft","ButtonRight","ButtonCompleta"];export{r as Button,p as ButtonCompleta,c as ButtonDisabilitato,s as ButtonIconLeft,m as ButtonIconRight,l as ButtonIcona,u as ButtonIconaDisabilitato,d as ButtonLeft,b as ButtonRight,lt as __namedExportsOrder,ct as default};
