"use strict";(globalThis.webpackChunk_elliemae_pui_app_sdk=globalThis.webpackChunk_elliemae_pui_app_sdk||[]).push([[5410],{"./lib/view/fields/check-box/index.tsx":(y,t,e)=>{e.d(t,{o:()=>u});var m=e("./node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/jsx.js"),l=e.n(m),s=e("./node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/objectWithoutProperties.js"),n=e.n(s),a=e("./node_modules/.pnpm/@elliemae+ds-form-checkbox@3.54.6_@elliemae+pui-theme@2.13.0/node_modules/@elliemae/ds-form-checkbox/dist/esm/index.js"),o=e("./node_modules/.pnpm/react-hook-form@7.63.0_react@18.3.1/node_modules/react-hook-form/dist/index.esm.mjs"),f=e("./node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js"),d=["name","defaultValue","rules"],i=["value"],u=function(r){var p=r.name,c=r.defaultValue,_=r.rules,B=_===void 0?{}:_,E=n()(r,d);return l()(o.xI,{name:p,rules:B,defaultValue:c,render:function(h){var x=h.field,C=x.value,S=n()(x,i);return(0,f.jsx)(a.$W,Object.assign({},E,S,{checked:Boolean(C)}))}})};u.displayName="CheckBox"},"./lib/view/fields/check-box/set-value.stories.tsx":(y,t,e)=>{e.r(t),e.d(t,{SetValue:()=>k,__namedExportsOrder:()=>V,default:()=>D});var m=e("./node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/objectWithoutProperties.js"),l=e.n(m),s=e("./node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/jsx.js"),n=e.n(s),a=e("./node_modules/.pnpm/styled-components@5.3.11_react-dom@18.3.1_react@18.3.1/node_modules/styled-components/dist/styled-components.browser.esm.js"),o=e("./node_modules/.pnpm/react-hook-form@7.63.0_react@18.3.1/node_modules/react-hook-form/dist/index.esm.mjs"),f=e("./node_modules/.pnpm/@elliemae+ds-grid@3.54.6_@elliemae+pui-theme@2.13.0/node_modules/@elliemae/ds-grid/dist/esm/Grid.js"),d=e("./node_modules/.pnpm/@elliemae+ds-legacy-button-v2@1.0.16_@elliemae+pui-theme@2.13.0/node_modules/@elliemae/ds-legacy-button-v2/dist/esm/DSButtonV2.js"),i=e("./lib/view/form/index.tsx"),u=e("./lib/view/fields/check-box/index.tsx"),r=e("./lib/view/fields/connect-form.tsx"),p=e("./node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js"),c,_=["name"],B=`
    
    // @ts-nocheck
    // @ts-ignore
    var __STORY__ = "import styled from 'styled-components';\\nimport { Story, Meta } from '@storybook/react';\\nimport { useFormContext, get, FieldError } from 'react-hook-form';\\nimport { Grid } from '@elliemae/ds-grid';\\nimport { DSButtonV2 } from '@elliemae/ds-button';\\nimport { Form } from '../../form/index.js';\\nimport { CheckBox, CheckBoxProps } from './index.js';\\nimport { ConnectForm } from '../connect-form.js';\\n\\nconst cbName = 'acknowledge';\\nconst StyledDSButton = styled(DSButtonV2)\`\\n  margin-top: 10px;\\n\`;\\n\\nconst ToggleValue = () => {\\n  const { setValue, watch } = useFormContext();\\n  const currentValue = watch(cbName) as boolean;\\n  return (\\n    <StyledDSButton\\n      onClick={() => setValue(cbName, !currentValue, { shouldDirty: true })}\\n    >\\n      Toggle\\n    </StyledDSButton>\\n  );\\n};\\n\\nconst Template: Story<CheckBoxProps> = ({ name, ...rest }) => (\\n  <Grid p=\\"m\\">\\n    <Form>\\n      <div>\\n        <ConnectForm>\\n          {({ formState: { errors } }) => {\\n            const errField = get(errors, name) as FieldError;\\n            const hasError = !!errField;\\n            return <CheckBox name={name} {...rest} hasError={hasError} />;\\n          }}\\n        </ConnectForm>\\n      </div>\\n      <ToggleValue />\\n    </Form>\\n  </Grid>\\n);\\n\\nexport default {\\n  title: 'Components/Form/Controls/CheckBox',\\n} as Meta;\\n\\nexport const SetValue = Template.bind({});\\n\\nSetValue.args = {\\n  id: cbName,\\n  name: cbName,\\n  label: 'Acknowledge Electronic delivery of documents',\\n  rules: { required: { value: true, message: 'Please acknowledge' } },\\n};\\n";
    // @ts-ignore
    var __LOCATIONS_MAP__ = {"SetValue":{"startLoc":{"col":39,"line":27},"endLoc":{"col":1,"line":42},"startBody":{"col":39,"line":27},"endBody":{"col":1,"line":42}}};
    
import styled from 'styled-components';
import { Story, Meta } from '@storybook/react';
import { useFormContext, get, FieldError } from 'react-hook-form';
import { Grid } from '@elliemae/ds-grid';
import { DSButtonV2 } from '@elliemae/ds-button';
import { Form } from '../../form/index.js';
import { CheckBox, CheckBoxProps } from './index.js';
import { ConnectForm } from '../connect-form.js';

const cbName = 'acknowledge';
const StyledDSButton = styled(DSButtonV2)\`
  margin-top: 10px;
\`;

const ToggleValue = () => {
  const { setValue, watch } = useFormContext();
  const currentValue = watch(cbName) as boolean;
  return (
    <StyledDSButton
      onClick={() => setValue(cbName, !currentValue, { shouldDirty: true })}
    >
      Toggle
    </StyledDSButton>
  );
};

const Template: Story<CheckBoxProps> = ({ name, ...rest }) => (
  <Grid p="m">
    <Form>
      <div>
        <ConnectForm>
          {({ formState: { errors } }) => {
            const errField = get(errors, name) as FieldError;
            const hasError = !!errField;
            return <CheckBox name={name} {...rest} hasError={hasError} />;
          }}
        </ConnectForm>
      </div>
      <ToggleValue />
    </Form>
  </Grid>
);

export default {parameters: {"storySource":{"source":"import styled from 'styled-components';\\nimport { Story, Meta } from '@storybook/react';\\nimport { useFormContext, get, FieldError } from 'react-hook-form';\\nimport { Grid } from '@elliemae/ds-grid';\\nimport { DSButtonV2 } from '@elliemae/ds-button';\\nimport { Form } from '../../form/index.js';\\nimport { CheckBox, CheckBoxProps } from './index.js';\\nimport { ConnectForm } from '../connect-form.js';\\n\\nconst cbName = 'acknowledge';\\nconst StyledDSButton = styled(DSButtonV2)\`\\n  margin-top: 10px;\\n\`;\\n\\nconst ToggleValue = () => {\\n  const { setValue, watch } = useFormContext();\\n  const currentValue = watch(cbName) as boolean;\\n  return (\\n    <StyledDSButton\\n      onClick={() => setValue(cbName, !currentValue, { shouldDirty: true })}\\n    >\\n      Toggle\\n    </StyledDSButton>\\n  );\\n};\\n\\nconst Template: Story<CheckBoxProps> = ({ name, ...rest }) => (\\n  <Grid p=\\"m\\">\\n    <Form>\\n      <div>\\n        <ConnectForm>\\n          {({ formState: { errors } }) => {\\n            const errField = get(errors, name) as FieldError;\\n            const hasError = !!errField;\\n            return <CheckBox name={name} {...rest} hasError={hasError} />;\\n          }}\\n        </ConnectForm>\\n      </div>\\n      <ToggleValue />\\n    </Form>\\n  </Grid>\\n);\\n\\nexport default {\\n  title: 'Components/Form/Controls/CheckBox',\\n} as Meta;\\n\\nexport const SetValue = Template.bind({});\\n\\nSetValue.args = {\\n  id: cbName,\\n  name: cbName,\\n  label: 'Acknowledge Electronic delivery of documents',\\n  rules: { required: { value: true, message: 'Please acknowledge' } },\\n};\\n","locationsMap":{"set-value":{"startLoc":{"col":39,"line":27},"endLoc":{"col":1,"line":42},"startBody":{"col":39,"line":27},"endBody":{"col":1,"line":42}}}},},
  title: 'Components/Form/Controls/CheckBox',
} as Meta;

export const SetValue = Template.bind({});

SetValue.args = {
  id: cbName,
  name: cbName,
  label: 'Acknowledge Electronic delivery of documents',
  rules: { required: { value: true, message: 'Please acknowledge' } },
};
`,E={SetValue:{startLoc:{col:39,line:35},endLoc:{col:1,line:50},startBody:{col:39,line:35},endBody:{col:1,line:50}}},B=`import styled from 'styled-components';
import { Story, Meta } from '@storybook/react';
import { useFormContext, get, FieldError } from 'react-hook-form';
import { Grid } from '@elliemae/ds-grid';
import { DSButtonV2 } from '@elliemae/ds-button';
import { Form } from '../../form/index.js';
import { CheckBox, CheckBoxProps } from './index.js';
import { ConnectForm } from '../connect-form.js';

const cbName = 'acknowledge';
const StyledDSButton = styled(DSButtonV2)\`
  margin-top: 10px;
\`;

const ToggleValue = () => {
  const { setValue, watch } = useFormContext();
  const currentValue = watch(cbName) as boolean;
  return (
    <StyledDSButton
      onClick={() => setValue(cbName, !currentValue, { shouldDirty: true })}
    >
      Toggle
    </StyledDSButton>
  );
};

const Template: Story<CheckBoxProps> = ({ name, ...rest }) => (
  <Grid p="m">
    <Form>
      <div>
        <ConnectForm>
          {({ formState: { errors } }) => {
            const errField = get(errors, name) as FieldError;
            const hasError = !!errField;
            return <CheckBox name={name} {...rest} hasError={hasError} />;
          }}
        </ConnectForm>
      </div>
      <ToggleValue />
    </Form>
  </Grid>
);

export default {
  title: 'Components/Form/Controls/CheckBox',
} as Meta;

export const SetValue = Template.bind({});

SetValue.args = {
  id: cbName,
  name: cbName,
  label: 'Acknowledge Electronic delivery of documents',
  rules: { required: { value: true, message: 'Please acknowledge' } },
};
`,E={SetValue:{startLoc:{col:39,line:27},endLoc:{col:1,line:42},startBody:{col:39,line:27},endBody:{col:1,line:42}}},h="acknowledge",x=(0,a.Ay)(d.e).withConfig({componentId:"sc-1lqqv9c-0"})(["margin-top:10px;"]),C=function(){var g=(0,o.xW)(),b=g.setValue,v=g.watch,F=v(h);return n()(x,{onClick:function(){return b(h,!F,{shouldDirty:!0})}},void 0,"Toggle")};C.displayName="ToggleValue";var S=function(g){var b=g.name,v=l()(g,_);return n()(f.Ay,{p:"m"},void 0,n()(i.l,{},void 0,n()("div",{},void 0,n()(r.$,{},void 0,function(F){var P=F.formState.errors,T=(0,o.Jt)(P,b),j=!!T;return(0,p.jsx)(u.o,Object.assign({name:b},v,{hasError:j}))})),c||(c=n()(C,{}))))};S.displayName="Template";const D={parameters:{storySource:{source:`
    
    // @ts-nocheck
    // @ts-ignore
    var __STORY__ = "import styled from 'styled-components';\\nimport { Story, Meta } from '@storybook/react';\\nimport { useFormContext, get, FieldError } from 'react-hook-form';\\nimport { Grid } from '@elliemae/ds-grid';\\nimport { DSButtonV2 } from '@elliemae/ds-button';\\nimport { Form } from '../../form/index.js';\\nimport { CheckBox, CheckBoxProps } from './index.js';\\nimport { ConnectForm } from '../connect-form.js';\\n\\nconst cbName = 'acknowledge';\\nconst StyledDSButton = styled(DSButtonV2)\`\\n  margin-top: 10px;\\n\`;\\n\\nconst ToggleValue = () => {\\n  const { setValue, watch } = useFormContext();\\n  const currentValue = watch(cbName) as boolean;\\n  return (\\n    <StyledDSButton\\n      onClick={() => setValue(cbName, !currentValue, { shouldDirty: true })}\\n    >\\n      Toggle\\n    </StyledDSButton>\\n  );\\n};\\n\\nconst Template: Story<CheckBoxProps> = ({ name, ...rest }) => (\\n  <Grid p=\\"m\\">\\n    <Form>\\n      <div>\\n        <ConnectForm>\\n          {({ formState: { errors } }) => {\\n            const errField = get(errors, name) as FieldError;\\n            const hasError = !!errField;\\n            return <CheckBox name={name} {...rest} hasError={hasError} />;\\n          }}\\n        </ConnectForm>\\n      </div>\\n      <ToggleValue />\\n    </Form>\\n  </Grid>\\n);\\n\\nexport default {\\n  title: 'Components/Form/Controls/CheckBox',\\n} as Meta;\\n\\nexport const SetValue = Template.bind({});\\n\\nSetValue.args = {\\n  id: cbName,\\n  name: cbName,\\n  label: 'Acknowledge Electronic delivery of documents',\\n  rules: { required: { value: true, message: 'Please acknowledge' } },\\n};\\n";
    // @ts-ignore
    var __LOCATIONS_MAP__ = {"SetValue":{"startLoc":{"col":39,"line":27},"endLoc":{"col":1,"line":42},"startBody":{"col":39,"line":27},"endBody":{"col":1,"line":42}}};
    
import styled from 'styled-components';
import { Story, Meta } from '@storybook/react';
import { useFormContext, get, FieldError } from 'react-hook-form';
import { Grid } from '@elliemae/ds-grid';
import { DSButtonV2 } from '@elliemae/ds-button';
import { Form } from '../../form/index.js';
import { CheckBox, CheckBoxProps } from './index.js';
import { ConnectForm } from '../connect-form.js';

const cbName = 'acknowledge';
const StyledDSButton = styled(DSButtonV2)\`
  margin-top: 10px;
\`;

const ToggleValue = () => {
  const { setValue, watch } = useFormContext();
  const currentValue = watch(cbName) as boolean;
  return (
    <StyledDSButton
      onClick={() => setValue(cbName, !currentValue, { shouldDirty: true })}
    >
      Toggle
    </StyledDSButton>
  );
};

const Template: Story<CheckBoxProps> = ({ name, ...rest }) => (
  <Grid p="m">
    <Form>
      <div>
        <ConnectForm>
          {({ formState: { errors } }) => {
            const errField = get(errors, name) as FieldError;
            const hasError = !!errField;
            return <CheckBox name={name} {...rest} hasError={hasError} />;
          }}
        </ConnectForm>
      </div>
      <ToggleValue />
    </Form>
  </Grid>
);

export default {parameters: {"storySource":{"source":"import styled from 'styled-components';\\nimport { Story, Meta } from '@storybook/react';\\nimport { useFormContext, get, FieldError } from 'react-hook-form';\\nimport { Grid } from '@elliemae/ds-grid';\\nimport { DSButtonV2 } from '@elliemae/ds-button';\\nimport { Form } from '../../form/index.js';\\nimport { CheckBox, CheckBoxProps } from './index.js';\\nimport { ConnectForm } from '../connect-form.js';\\n\\nconst cbName = 'acknowledge';\\nconst StyledDSButton = styled(DSButtonV2)\`\\n  margin-top: 10px;\\n\`;\\n\\nconst ToggleValue = () => {\\n  const { setValue, watch } = useFormContext();\\n  const currentValue = watch(cbName) as boolean;\\n  return (\\n    <StyledDSButton\\n      onClick={() => setValue(cbName, !currentValue, { shouldDirty: true })}\\n    >\\n      Toggle\\n    </StyledDSButton>\\n  );\\n};\\n\\nconst Template: Story<CheckBoxProps> = ({ name, ...rest }) => (\\n  <Grid p=\\"m\\">\\n    <Form>\\n      <div>\\n        <ConnectForm>\\n          {({ formState: { errors } }) => {\\n            const errField = get(errors, name) as FieldError;\\n            const hasError = !!errField;\\n            return <CheckBox name={name} {...rest} hasError={hasError} />;\\n          }}\\n        </ConnectForm>\\n      </div>\\n      <ToggleValue />\\n    </Form>\\n  </Grid>\\n);\\n\\nexport default {\\n  title: 'Components/Form/Controls/CheckBox',\\n} as Meta;\\n\\nexport const SetValue = Template.bind({});\\n\\nSetValue.args = {\\n  id: cbName,\\n  name: cbName,\\n  label: 'Acknowledge Electronic delivery of documents',\\n  rules: { required: { value: true, message: 'Please acknowledge' } },\\n};\\n","locationsMap":{"set-value":{"startLoc":{"col":39,"line":27},"endLoc":{"col":1,"line":42},"startBody":{"col":39,"line":27},"endBody":{"col":1,"line":42}}}},},
  title: 'Components/Form/Controls/CheckBox',
} as Meta;

export const SetValue = Template.bind({});

SetValue.args = {
  id: cbName,
  name: cbName,
  label: 'Acknowledge Electronic delivery of documents',
  rules: { required: { value: true, message: 'Please acknowledge' } },
};
`,locationsMap:{"set-value":{startLoc:{col:39,line:35},endLoc:{col:1,line:50},startBody:{col:39,line:35},endBody:{col:1,line:50}}}},storySource:{source:`import styled from 'styled-components';
import { Story, Meta } from '@storybook/react';
import { useFormContext, get, FieldError } from 'react-hook-form';
import { Grid } from '@elliemae/ds-grid';
import { DSButtonV2 } from '@elliemae/ds-button';
import { Form } from '../../form/index.js';
import { CheckBox, CheckBoxProps } from './index.js';
import { ConnectForm } from '../connect-form.js';

const cbName = 'acknowledge';
const StyledDSButton = styled(DSButtonV2)\`
  margin-top: 10px;
\`;

const ToggleValue = () => {
  const { setValue, watch } = useFormContext();
  const currentValue = watch(cbName) as boolean;
  return (
    <StyledDSButton
      onClick={() => setValue(cbName, !currentValue, { shouldDirty: true })}
    >
      Toggle
    </StyledDSButton>
  );
};

const Template: Story<CheckBoxProps> = ({ name, ...rest }) => (
  <Grid p="m">
    <Form>
      <div>
        <ConnectForm>
          {({ formState: { errors } }) => {
            const errField = get(errors, name) as FieldError;
            const hasError = !!errField;
            return <CheckBox name={name} {...rest} hasError={hasError} />;
          }}
        </ConnectForm>
      </div>
      <ToggleValue />
    </Form>
  </Grid>
);

export default {
  title: 'Components/Form/Controls/CheckBox',
} as Meta;

export const SetValue = Template.bind({});

SetValue.args = {
  id: cbName,
  name: cbName,
  label: 'Acknowledge Electronic delivery of documents',
  rules: { required: { value: true, message: 'Please acknowledge' } },
};
`,locationsMap:{"set-value":{startLoc:{col:39,line:27},endLoc:{col:1,line:42},startBody:{col:39,line:27},endBody:{col:1,line:42}}}}},title:"Components/Form/Controls/CheckBox"};var k=S.bind({});k.args={id:h,name:h,label:"Acknowledge Electronic delivery of documents",rules:{required:{value:!0,message:"Please acknowledge"}}};var V=["SetValue"]},"./lib/view/fields/connect-form.tsx":(y,t,e)=>{e.d(t,{$:()=>l});var m=e("./node_modules/.pnpm/react-hook-form@7.63.0_react@18.3.1/node_modules/react-hook-form/dist/index.esm.mjs"),l=function(s){var n=s.children,a=(0,m.xW)();return n(Object.assign({},a))}},"./lib/view/form/index.tsx":(y,t,e)=>{e.d(t,{l:()=>a});var m=e("./node_modules/.pnpm/styled-components@5.3.11_react-dom@18.3.1_react@18.3.1/node_modules/styled-components/dist/styled-components.browser.esm.js"),l=e("./node_modules/.pnpm/react-hook-form@7.63.0_react@18.3.1/node_modules/react-hook-form/dist/index.esm.mjs"),s=e("./node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js"),n=m.Ay.form.withConfig({componentId:"sc-1pyjvv3-0"})(["width:100%;"]),a=function(o){var f=o.classname,d=o.reactHookFormProps,i=d===void 0?{mode:"onBlur"}:d,u=o.children,r=o.onSubmit,p=(0,l.mN)(i),c={};r&&(c.onSubmit=p.handleSubmit(r));var _=Object.assign(p,{formProps:i});return(0,s.jsx)(l.Op,Object.assign({},_,{children:(0,s.jsx)(n,Object.assign({className:f},c,{children:u}))}))};a.displayName="Form"}}]);
