import { h } from "@stencil/core";
import { PortalRegistrationFormView, } from "../sqm-portal-registration-form/sqm-portal-registration-form-view";
import { NameFieldsView } from "../sqm-name-fields/sqm-name-fields-view";
export default {
  title: "Components/Microsite Google Register",
};
const defaultProps = {
  states: {
    error: "",
    loading: false,
    confirmPassword: false,
    hideInputs: false,
    loginPath: "/login",
    hidePasswords: true,
    registrationFormState: {
      initialData: {
        email: "testuser@example.com",
      },
    },
  },
  callbacks: {
    submit: () => console.log("Submit!"),
    inputFunction: () => { },
  },
  refs: {
    formRef: {},
  },
  content: {
    pageLabel: "Register",
    passwordField: null,
    formData: (h("div", null,
      " ",
      h(NameFieldsView, { states: {
          optional: false,
          registrationFormState: {
            validationErrors: undefined,
            disabled: true,
            initialData: {
              firstName: "Test",
              lastName: "User",
            },
          },
          content: {
            firstNameLabel: "First Name",
            lastNameLabel: "Last Name",
          },
        } }),
      h("sl-input", { style: { marginBottom: "var(--sl-spacing-x-large)" }, exportparts: "label: input-label, base: input-base", label: "Slotted Input", required: true }),
      h("sl-input", { exportparts: "label: input-label, base: input-base", label: "Slotted Input 2", required: true }))),
  },
};
const errorProps = {
  ...defaultProps,
  states: {
    error: "Something went wrong. Please try again.",
    loading: false,
    confirmPassword: false,
    hideInputs: false,
    loginPath: "/login",
    hidePasswords: true,
    registrationFormState: {
      initialData: {
        email: "testuser@example.com",
      },
    },
  },
};
const loadingProps = {
  ...defaultProps,
  states: {
    error: "",
    loading: true,
    hideInputs: false,
    loginPath: "/login",
    confirmPassword: false,
    hidePasswords: true,
    registrationFormState: {
      initialData: {
        email: "testuser@example.com",
      },
    },
  },
};
export const Default = () => (h("sqm-portal-google-registration-form", null));
export const RegisterWithError = () => (h(PortalRegistrationFormView, Object.assign({}, errorProps)));
export const RegisterLoading = () => (h(PortalRegistrationFormView, Object.assign({}, loadingProps)));
export const TermsAndConditions = () => (h(PortalRegistrationFormView, Object.assign({}, defaultProps, { content: {
    ...defaultProps.content,
    terms: (h("p", null,
      "By signing up you agree to the",
      " ",
      h("a", { href: "https://example.com", target: "_blank" }, "Terms and Conditions"))),
  } })));
