"use strict";(globalThis.webpackChunk_elliemae_pui_app_sdk=globalThis.webpackChunk_elliemae_pui_app_sdk||[]).push([[5936],{"./lib/view/fields/toggle/index.stories.tsx":(h,i,e)=>{e.r(i),e.d(i,{Basic:()=>B,__namedExportsOrder:()=>D,default:()=>P});var p=e("./node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/jsx.js"),o=e.n(p),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"),m=e("./lib/view/form/index.tsx"),n=e("./node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/objectWithoutProperties.js"),d=e.n(n),c=e("./node_modules/.pnpm/@elliemae+ds-form-toggle@3.54.6_@elliemae+pui-theme@2.13.0/node_modules/@elliemae/ds-form-toggle/dist/esm/ControlledToggle.js"),a=e("./node_modules/.pnpm/react-hook-form@7.63.0_react@18.3.1/node_modules/react-hook-form/dist/index.esm.mjs"),t=e("./node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js"),g=["name","defaultValue","rules"],u=["value","onChange"],l=function(s){var C=s.name,x=s.defaultValue,F=x===void 0?!1:x,S=s.rules,M=S===void 0?{}:S,O=d()(s,g);return o()(a.xI,{name:C,rules:M,defaultValue:F,render:function(k){var b=k.field,_=b.value,w=b.onChange,E=d()(b,u);return(0,t.jsx)(c.m,Object.assign({},O,E,{checked:_,value:_.toString(),onChange:function(){return w(!_)}}))}})};l.displayName="Toggle";var v=e("./lib/view/fields/watch-value.tsx"),T,j=`
    
    // @ts-nocheck
    // @ts-ignore
    var __STORY__ = "import { Story, Meta } from '@storybook/react';\\nimport { Grid } from '@elliemae/ds-grid';\\nimport { DSButtonV2 } from '@elliemae/ds-button';\\nimport { Form } from '../../form/index.js';\\nimport { Toggle, ToggleProps } from './index.js';\\nimport { WatchValue } from '../watch-value.js';\\n\\nexport default {\\n  title: 'Components/Form/Controls/Toggle',\\n  component: Toggle,\\n} as Meta;\\n\\nconst Template: Story<ToggleProps & { label: string }> = (args) => (\\n  <Grid p=\\"m\\">\\n    <Form>\\n      <div>\\n        <Toggle {...args} />\\n      </div>\\n      <DSButtonV2>Submit</DSButtonV2>\\n      <WatchValue {...args} />\\n    </Form>\\n  </Grid>\\n);\\n\\nexport const Basic = Template.bind({});\\n\\nBasic.args = {\\n  id: 'acknowledge',\\n  name: 'acknowledge',\\n  defaultValue: false,\\n  label: 'Acknowledge Electronic delivery of documents',\\n};\\n";
    // @ts-ignore
    var __LOCATIONS_MAP__ = {"Basic":{"startLoc":{"col":57,"line":13},"endLoc":{"col":1,"line":23},"startBody":{"col":57,"line":13},"endBody":{"col":1,"line":23}}};
    
import { Story, Meta } from '@storybook/react';
import { Grid } from '@elliemae/ds-grid';
import { DSButtonV2 } from '@elliemae/ds-button';
import { Form } from '../../form/index.js';
import { Toggle, ToggleProps } from './index.js';
import { WatchValue } from '../watch-value.js';

export default {parameters: {"storySource":{"source":"import { Story, Meta } from '@storybook/react';\\nimport { Grid } from '@elliemae/ds-grid';\\nimport { DSButtonV2 } from '@elliemae/ds-button';\\nimport { Form } from '../../form/index.js';\\nimport { Toggle, ToggleProps } from './index.js';\\nimport { WatchValue } from '../watch-value.js';\\n\\nexport default {\\n  title: 'Components/Form/Controls/Toggle',\\n  component: Toggle,\\n} as Meta;\\n\\nconst Template: Story<ToggleProps & { label: string }> = (args) => (\\n  <Grid p=\\"m\\">\\n    <Form>\\n      <div>\\n        <Toggle {...args} />\\n      </div>\\n      <DSButtonV2>Submit</DSButtonV2>\\n      <WatchValue {...args} />\\n    </Form>\\n  </Grid>\\n);\\n\\nexport const Basic = Template.bind({});\\n\\nBasic.args = {\\n  id: 'acknowledge',\\n  name: 'acknowledge',\\n  defaultValue: false,\\n  label: 'Acknowledge Electronic delivery of documents',\\n};\\n","locationsMap":{"basic":{"startLoc":{"col":57,"line":13},"endLoc":{"col":1,"line":23},"startBody":{"col":57,"line":13},"endBody":{"col":1,"line":23}}}},},
  title: 'Components/Form/Controls/Toggle',
  component: Toggle,
} as Meta;

const Template: Story<ToggleProps & { label: string }> = (args) => (
  <Grid p="m">
    <Form>
      <div>
        <Toggle {...args} />
      </div>
      <DSButtonV2>Submit</DSButtonV2>
      <WatchValue {...args} />
    </Form>
  </Grid>
);

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

Basic.args = {
  id: 'acknowledge',
  name: 'acknowledge',
  defaultValue: false,
  label: 'Acknowledge Electronic delivery of documents',
};
`,V={Basic:{startLoc:{col:57,line:21},endLoc:{col:1,line:31},startBody:{col:57,line:21},endBody:{col:1,line:31}}},j=`import { Story, Meta } from '@storybook/react';
import { Grid } from '@elliemae/ds-grid';
import { DSButtonV2 } from '@elliemae/ds-button';
import { Form } from '../../form/index.js';
import { Toggle, ToggleProps } from './index.js';
import { WatchValue } from '../watch-value.js';

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

const Template: Story<ToggleProps & { label: string }> = (args) => (
  <Grid p="m">
    <Form>
      <div>
        <Toggle {...args} />
      </div>
      <DSButtonV2>Submit</DSButtonV2>
      <WatchValue {...args} />
    </Form>
  </Grid>
);

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

Basic.args = {
  id: 'acknowledge',
  name: 'acknowledge',
  defaultValue: false,
  label: 'Acknowledge Electronic delivery of documents',
};
`,V={Basic:{startLoc:{col:57,line:13},endLoc:{col:1,line:23},startBody:{col:57,line:13},endBody:{col:1,line:23}}};const P={parameters:{storySource:{source:`
    
    // @ts-nocheck
    // @ts-ignore
    var __STORY__ = "import { Story, Meta } from '@storybook/react';\\nimport { Grid } from '@elliemae/ds-grid';\\nimport { DSButtonV2 } from '@elliemae/ds-button';\\nimport { Form } from '../../form/index.js';\\nimport { Toggle, ToggleProps } from './index.js';\\nimport { WatchValue } from '../watch-value.js';\\n\\nexport default {\\n  title: 'Components/Form/Controls/Toggle',\\n  component: Toggle,\\n} as Meta;\\n\\nconst Template: Story<ToggleProps & { label: string }> = (args) => (\\n  <Grid p=\\"m\\">\\n    <Form>\\n      <div>\\n        <Toggle {...args} />\\n      </div>\\n      <DSButtonV2>Submit</DSButtonV2>\\n      <WatchValue {...args} />\\n    </Form>\\n  </Grid>\\n);\\n\\nexport const Basic = Template.bind({});\\n\\nBasic.args = {\\n  id: 'acknowledge',\\n  name: 'acknowledge',\\n  defaultValue: false,\\n  label: 'Acknowledge Electronic delivery of documents',\\n};\\n";
    // @ts-ignore
    var __LOCATIONS_MAP__ = {"Basic":{"startLoc":{"col":57,"line":13},"endLoc":{"col":1,"line":23},"startBody":{"col":57,"line":13},"endBody":{"col":1,"line":23}}};
    
import { Story, Meta } from '@storybook/react';
import { Grid } from '@elliemae/ds-grid';
import { DSButtonV2 } from '@elliemae/ds-button';
import { Form } from '../../form/index.js';
import { Toggle, ToggleProps } from './index.js';
import { WatchValue } from '../watch-value.js';

export default {parameters: {"storySource":{"source":"import { Story, Meta } from '@storybook/react';\\nimport { Grid } from '@elliemae/ds-grid';\\nimport { DSButtonV2 } from '@elliemae/ds-button';\\nimport { Form } from '../../form/index.js';\\nimport { Toggle, ToggleProps } from './index.js';\\nimport { WatchValue } from '../watch-value.js';\\n\\nexport default {\\n  title: 'Components/Form/Controls/Toggle',\\n  component: Toggle,\\n} as Meta;\\n\\nconst Template: Story<ToggleProps & { label: string }> = (args) => (\\n  <Grid p=\\"m\\">\\n    <Form>\\n      <div>\\n        <Toggle {...args} />\\n      </div>\\n      <DSButtonV2>Submit</DSButtonV2>\\n      <WatchValue {...args} />\\n    </Form>\\n  </Grid>\\n);\\n\\nexport const Basic = Template.bind({});\\n\\nBasic.args = {\\n  id: 'acknowledge',\\n  name: 'acknowledge',\\n  defaultValue: false,\\n  label: 'Acknowledge Electronic delivery of documents',\\n};\\n","locationsMap":{"basic":{"startLoc":{"col":57,"line":13},"endLoc":{"col":1,"line":23},"startBody":{"col":57,"line":13},"endBody":{"col":1,"line":23}}}},},
  title: 'Components/Form/Controls/Toggle',
  component: Toggle,
} as Meta;

const Template: Story<ToggleProps & { label: string }> = (args) => (
  <Grid p="m">
    <Form>
      <div>
        <Toggle {...args} />
      </div>
      <DSButtonV2>Submit</DSButtonV2>
      <WatchValue {...args} />
    </Form>
  </Grid>
);

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

Basic.args = {
  id: 'acknowledge',
  name: 'acknowledge',
  defaultValue: false,
  label: 'Acknowledge Electronic delivery of documents',
};
`,locationsMap:{basic:{startLoc:{col:57,line:21},endLoc:{col:1,line:31},startBody:{col:57,line:21},endBody:{col:1,line:31}}}},storySource:{source:`import { Story, Meta } from '@storybook/react';
import { Grid } from '@elliemae/ds-grid';
import { DSButtonV2 } from '@elliemae/ds-button';
import { Form } from '../../form/index.js';
import { Toggle, ToggleProps } from './index.js';
import { WatchValue } from '../watch-value.js';

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

const Template: Story<ToggleProps & { label: string }> = (args) => (
  <Grid p="m">
    <Form>
      <div>
        <Toggle {...args} />
      </div>
      <DSButtonV2>Submit</DSButtonV2>
      <WatchValue {...args} />
    </Form>
  </Grid>
);

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

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