"use strict";(globalThis.webpackChunk_elliemae_pui_app_sdk=globalThis.webpackChunk_elliemae_pui_app_sdk||[]).push([[2382],{"./lib/view/fields/check-box/index.stories.tsx":(B,a,e)=>{e.r(a),e.d(a,{Basic:()=>E,__namedExportsOrder:()=>k,default:()=>x});var d=e("./node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/jsx.js"),o=e.n(d),n=e("./node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/objectWithoutProperties.js"),m=e.n(n),s=e("./node_modules/.pnpm/react-hook-form@7.63.0_react@18.3.1/node_modules/react-hook-form/dist/index.esm.mjs"),r=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"),f=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"),_=e("./lib/view/form/index.tsx"),l=e("./lib/view/fields/check-box/index.tsx"),i=e("./lib/view/fields/connect-form.tsx"),t=e("./lib/view/fields/watch-value.tsx"),c=e("./node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js"),u,p=["name"],h=`
    
    // @ts-nocheck
    // @ts-ignore
    var __STORY__ = "import { Story, Meta } from '@storybook/react';\\nimport { FieldError, get } 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';\\nimport { WatchValue } from '../watch-value.js';\\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      <DSButtonV2>Submit</DSButtonV2>\\n      <WatchValue name={name} {...rest} />\\n    </Form>\\n  </Grid>\\n);\\n\\nexport default {\\n  title: 'Components/Form/Controls/CheckBox',\\n  component: CheckBox,\\n} as Meta;\\n\\nexport const Basic = Template.bind({});\\n\\nBasic.args = {\\n  id: 'ackwnowledge',\\n  name: 'acknowledge',\\n  label: 'Acknowledge Electronic delivery of documents',\\n  rules: { required: { value: true, message: 'Please acknowledge' } },\\n  defaultValue: false,\\n};\\n";
    // @ts-ignore
    var __LOCATIONS_MAP__ = {"Basic":{"startLoc":{"col":39,"line":10},"endLoc":{"col":1,"line":26},"startBody":{"col":39,"line":10},"endBody":{"col":1,"line":26}}};
    
import { Story, Meta } from '@storybook/react';
import { FieldError, get } 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';
import { WatchValue } from '../watch-value.js';

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>
      <DSButtonV2>Submit</DSButtonV2>
      <WatchValue name={name} {...rest} />
    </Form>
  </Grid>
);

export default {parameters: {"storySource":{"source":"import { Story, Meta } from '@storybook/react';\\nimport { FieldError, get } 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';\\nimport { WatchValue } from '../watch-value.js';\\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      <DSButtonV2>Submit</DSButtonV2>\\n      <WatchValue name={name} {...rest} />\\n    </Form>\\n  </Grid>\\n);\\n\\nexport default {\\n  title: 'Components/Form/Controls/CheckBox',\\n  component: CheckBox,\\n} as Meta;\\n\\nexport const Basic = Template.bind({});\\n\\nBasic.args = {\\n  id: 'ackwnowledge',\\n  name: 'acknowledge',\\n  label: 'Acknowledge Electronic delivery of documents',\\n  rules: { required: { value: true, message: 'Please acknowledge' } },\\n  defaultValue: false,\\n};\\n","locationsMap":{"basic":{"startLoc":{"col":39,"line":10},"endLoc":{"col":1,"line":26},"startBody":{"col":39,"line":10},"endBody":{"col":1,"line":26}}}},},
  title: 'Components/Form/Controls/CheckBox',
  component: CheckBox,
} as Meta;

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

Basic.args = {
  id: 'ackwnowledge',
  name: 'acknowledge',
  label: 'Acknowledge Electronic delivery of documents',
  rules: { required: { value: true, message: 'Please acknowledge' } },
  defaultValue: false,
};
`,C={Basic:{startLoc:{col:39,line:18},endLoc:{col:1,line:34},startBody:{col:39,line:18},endBody:{col:1,line:34}}},h=`import { Story, Meta } from '@storybook/react';
import { FieldError, get } 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';
import { WatchValue } from '../watch-value.js';

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>
      <DSButtonV2>Submit</DSButtonV2>
      <WatchValue name={name} {...rest} />
    </Form>
  </Grid>
);

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

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

Basic.args = {
  id: 'ackwnowledge',
  name: 'acknowledge',
  label: 'Acknowledge Electronic delivery of documents',
  rules: { required: { value: true, message: 'Please acknowledge' } },
  defaultValue: false,
};
`,C={Basic:{startLoc:{col:39,line:10},endLoc:{col:1,line:26},startBody:{col:39,line:10},endBody:{col:1,line:26}}},v=function(b){var g=b.name,F=m()(b,p);return o()(r.Ay,{p:"m"},void 0,o()(_.l,{},void 0,o()("div",{},void 0,o()(i.$,{},void 0,function(P){var j=P.formState.errors,D=(0,s.Jt)(j,g),M=!!D;return(0,c.jsx)(l.o,Object.assign({name:g},F,{hasError:M}))})),u||(u=o()(f.e,{},void 0,"Submit")),(0,c.jsx)(t.n,Object.assign({name:g},F))))};v.displayName="Template";const x={parameters:{storySource:{source:`
    
    // @ts-nocheck
    // @ts-ignore
    var __STORY__ = "import { Story, Meta } from '@storybook/react';\\nimport { FieldError, get } 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';\\nimport { WatchValue } from '../watch-value.js';\\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      <DSButtonV2>Submit</DSButtonV2>\\n      <WatchValue name={name} {...rest} />\\n    </Form>\\n  </Grid>\\n);\\n\\nexport default {\\n  title: 'Components/Form/Controls/CheckBox',\\n  component: CheckBox,\\n} as Meta;\\n\\nexport const Basic = Template.bind({});\\n\\nBasic.args = {\\n  id: 'ackwnowledge',\\n  name: 'acknowledge',\\n  label: 'Acknowledge Electronic delivery of documents',\\n  rules: { required: { value: true, message: 'Please acknowledge' } },\\n  defaultValue: false,\\n};\\n";
    // @ts-ignore
    var __LOCATIONS_MAP__ = {"Basic":{"startLoc":{"col":39,"line":10},"endLoc":{"col":1,"line":26},"startBody":{"col":39,"line":10},"endBody":{"col":1,"line":26}}};
    
import { Story, Meta } from '@storybook/react';
import { FieldError, get } 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';
import { WatchValue } from '../watch-value.js';

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>
      <DSButtonV2>Submit</DSButtonV2>
      <WatchValue name={name} {...rest} />
    </Form>
  </Grid>
);

export default {parameters: {"storySource":{"source":"import { Story, Meta } from '@storybook/react';\\nimport { FieldError, get } 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';\\nimport { WatchValue } from '../watch-value.js';\\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      <DSButtonV2>Submit</DSButtonV2>\\n      <WatchValue name={name} {...rest} />\\n    </Form>\\n  </Grid>\\n);\\n\\nexport default {\\n  title: 'Components/Form/Controls/CheckBox',\\n  component: CheckBox,\\n} as Meta;\\n\\nexport const Basic = Template.bind({});\\n\\nBasic.args = {\\n  id: 'ackwnowledge',\\n  name: 'acknowledge',\\n  label: 'Acknowledge Electronic delivery of documents',\\n  rules: { required: { value: true, message: 'Please acknowledge' } },\\n  defaultValue: false,\\n};\\n","locationsMap":{"basic":{"startLoc":{"col":39,"line":10},"endLoc":{"col":1,"line":26},"startBody":{"col":39,"line":10},"endBody":{"col":1,"line":26}}}},},
  title: 'Components/Form/Controls/CheckBox',
  component: CheckBox,
} as Meta;

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

Basic.args = {
  id: 'ackwnowledge',
  name: 'acknowledge',
  label: 'Acknowledge Electronic delivery of documents',
  rules: { required: { value: true, message: 'Please acknowledge' } },
  defaultValue: false,
};
`,locationsMap:{basic:{startLoc:{col:39,line:18},endLoc:{col:1,line:34},startBody:{col:39,line:18},endBody:{col:1,line:34}}}},storySource:{source:`import { Story, Meta } from '@storybook/react';
import { FieldError, get } 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';
import { WatchValue } from '../watch-value.js';

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>
      <DSButtonV2>Submit</DSButtonV2>
      <WatchValue name={name} {...rest} />
    </Form>
  </Grid>
);

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

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

Basic.args = {
  id: 'ackwnowledge',
  name: 'acknowledge',
  label: 'Acknowledge Electronic delivery of documents',
  rules: { required: { value: true, message: 'Please acknowledge' } },
  defaultValue: false,
};
`,locationsMap:{basic:{startLoc:{col:39,line:10},endLoc:{col:1,line:26},startBody:{col:39,line:10},endBody:{col:1,line:26}}}}},title:"Components/Form/Controls/CheckBox",component:l.o};var E=v.bind({});E.args={id:"ackwnowledge",name:"acknowledge",label:"Acknowledge Electronic delivery of documents",rules:{required:{value:!0,message:"Please acknowledge"}},defaultValue:!1};var k=["Basic"]},"./lib/view/fields/check-box/index.tsx":(B,a,e)=>{e.d(a,{o:()=>i});var d=e("./node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/jsx.js"),o=e.n(d),n=e("./node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/objectWithoutProperties.js"),m=e.n(n),s=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"),r=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"),_=["name","defaultValue","rules"],l=["value"],i=function(t){var c=t.name,u=t.defaultValue,p=t.rules,h=p===void 0?{}:p,C=m()(t,_);return o()(r.xI,{name:c,rules:h,defaultValue:u,render:function(v){var x=v.field,E=x.value,k=m()(x,l);return(0,f.jsx)(s.$W,Object.assign({},C,k,{checked:Boolean(E)}))}})};i.displayName="CheckBox"},"./lib/view/fields/connect-form.tsx":(B,a,e)=>{e.d(a,{$:()=>o});var d=e("./node_modules/.pnpm/react-hook-form@7.63.0_react@18.3.1/node_modules/react-hook-form/dist/index.esm.mjs"),o=function(n){var m=n.children,s=(0,d.xW)();return m(Object.assign({},s))}},"./lib/view/fields/watch-value.tsx":(B,a,e)=>{e.d(a,{n:()=>l});var d=e("./node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/jsx.js"),o=e.n(d),n=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"),m=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"),s=e("./node_modules/.pnpm/react-hook-form@7.63.0_react@18.3.1/node_modules/react-hook-form/dist/index.esm.mjs"),r,f=n.Ay.section.withConfig({componentId:"sc-1va6d9p-0"})(["margin-top:10px;border-top:2px blue dotted;width:100%;"]),_=n.Ay.div.withConfig({componentId:"sc-1va6d9p-1"})(["display:flex;flex-direction:column;padding-left:10px;align-items:flex-start;"]),l=function(i){var t=i.name,c=i.label,u=(0,s.xW)(),p=u.watch,h=p(t,!1)||"";return o()(m.Ay,{},void 0,o()(f,{},void 0,r||(r=o()("h4",{},void 0,"Form Data:")),o()(_,{},void 0,o()("div",{},void 0,c," : ",o()("strong",{},void 0,JSON.stringify(h))))))};l.displayName="WatchValue"},"./lib/view/form/index.tsx":(B,a,e)=>{e.d(a,{l:()=>s});var d=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"),n=e("./node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js"),m=d.Ay.form.withConfig({componentId:"sc-1pyjvv3-0"})(["width:100%;"]),s=function(r){var f=r.classname,_=r.reactHookFormProps,l=_===void 0?{mode:"onBlur"}:_,i=r.children,t=r.onSubmit,c=(0,o.mN)(l),u={};t&&(u.onSubmit=c.handleSubmit(t));var p=Object.assign(c,{formProps:l});return(0,n.jsx)(o.Op,Object.assign({},p,{children:(0,n.jsx)(m,Object.assign({className:f},u,{children:i}))}))};s.displayName="Form"}}]);
