"use strict";(globalThis.webpackChunk_elliemae_pui_app_sdk=globalThis.webpackChunk_elliemae_pui_app_sdk||[]).push([[1764],{"./lib/view/fields/form-layout-block-item/index.tsx":(B,i,e)=>{e.d(i,{B:()=>p});var f=e("./node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/objectWithoutProperties.js"),t=e.n(f),s=e("./node_modules/.pnpm/@elliemae+ds-form-layout-blocks@3.54.6_@elliemae+pui-theme@2.13.0/node_modules/@elliemae/ds-form-layout-blocks/dist/esm/form-layout-block-item/DSFormLayoutBlockItem.js"),d=e("./node_modules/.pnpm/react-hook-form@7.63.0_react@18.3.1/node_modules/react-hook-form/dist/index.esm.mjs"),u=e("./node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js"),o=["inputID","label"],p=function(m){var n=m.inputID,r=m.label,_=t()(m,o),l=(0,d.lN)({name:n}),c=l.errors,a=(0,d.Jt)(c,n),x=!!a,b=a?.message;return(0,u.jsx)(s.U,Object.assign({inputID:n,label:r,hasError:x,validationMessage:b},_))};p.displayName="FormLayoutBlockItem"},"./lib/view/fields/input-text/index.stories.tsx":(B,i,e)=>{e.r(i),e.d(i,{Basic:()=>x,__namedExportsOrder:()=>b,default:()=>c});var f=e("./node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/jsx.js"),t=e.n(f),s=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"),u=e("./lib/view/form/index.tsx"),o=e("./lib/view/fields/input-text/index.tsx"),p=e("./lib/view/fields/form-layout-block-item/index.tsx"),m=e("./lib/view/fields/watch-value.tsx"),n=e("./node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js"),r,_=`
    
    // @ts-nocheck
    // @ts-ignore
    var __STORY__ = "import { Story, Meta } from '@storybook/react';\\nimport { Grid } from '@elliemae/ds-grid';\\n// import '@elliemae/ds-form-input-text';\\nimport { DSButtonV2 } from '@elliemae/ds-button';\\nimport { Form } from '../../form/index.js';\\nimport { InputText, InputTextProps } from './index.js';\\nimport { FormLayoutBlockItem } from '../form-layout-block-item/index.js';\\nimport { WatchValue } from '../watch-value.js';\\n\\nexport default {\\n  title: 'Components/Form/Controls/InputText',\\n  component: InputText,\\n} as Meta;\\n\\nconst Template: Story<InputTextProps & { labelText: string }> = (args) => (\\n  <Grid p=\\"m\\">\\n    <Form>\\n      <FormLayoutBlockItem inputID=\\"firstname\\" label=\\"First Name\\" required>\\n        <InputText {...args} />\\n      </FormLayoutBlockItem>\\n      <DSButtonV2>Submit</DSButtonV2>\\n      <WatchValue label=\\"First Name\\" {...args} />\\n    </Form>\\n  </Grid>\\n);\\n\\nexport const Basic = Template.bind({});\\n\\nBasic.args = {\\n  id: 'firstname',\\n  name: 'firstname',\\n  defaultValue: 'John',\\n  rules: {\\n    required: { value: true, message: 'Please enter firstname' },\\n  },\\n};\\n";
    // @ts-ignore
    var __LOCATIONS_MAP__ = {"Basic":{"startLoc":{"col":64,"line":15},"endLoc":{"col":1,"line":25},"startBody":{"col":64,"line":15},"endBody":{"col":1,"line":25}}};
    
import { Story, Meta } from '@storybook/react';
import { Grid } from '@elliemae/ds-grid';
// import '@elliemae/ds-form-input-text';
import { DSButtonV2 } from '@elliemae/ds-button';
import { Form } from '../../form/index.js';
import { InputText, InputTextProps } from './index.js';
import { FormLayoutBlockItem } from '../form-layout-block-item/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';\\n// import '@elliemae/ds-form-input-text';\\nimport { DSButtonV2 } from '@elliemae/ds-button';\\nimport { Form } from '../../form/index.js';\\nimport { InputText, InputTextProps } from './index.js';\\nimport { FormLayoutBlockItem } from '../form-layout-block-item/index.js';\\nimport { WatchValue } from '../watch-value.js';\\n\\nexport default {\\n  title: 'Components/Form/Controls/InputText',\\n  component: InputText,\\n} as Meta;\\n\\nconst Template: Story<InputTextProps & { labelText: string }> = (args) => (\\n  <Grid p=\\"m\\">\\n    <Form>\\n      <FormLayoutBlockItem inputID=\\"firstname\\" label=\\"First Name\\" required>\\n        <InputText {...args} />\\n      </FormLayoutBlockItem>\\n      <DSButtonV2>Submit</DSButtonV2>\\n      <WatchValue label=\\"First Name\\" {...args} />\\n    </Form>\\n  </Grid>\\n);\\n\\nexport const Basic = Template.bind({});\\n\\nBasic.args = {\\n  id: 'firstname',\\n  name: 'firstname',\\n  defaultValue: 'John',\\n  rules: {\\n    required: { value: true, message: 'Please enter firstname' },\\n  },\\n};\\n","locationsMap":{"basic":{"startLoc":{"col":64,"line":15},"endLoc":{"col":1,"line":25},"startBody":{"col":64,"line":15},"endBody":{"col":1,"line":25}}}},},
  title: 'Components/Form/Controls/InputText',
  component: InputText,
} as Meta;

const Template: Story<InputTextProps & { labelText: string }> = (args) => (
  <Grid p="m">
    <Form>
      <FormLayoutBlockItem inputID="firstname" label="First Name" required>
        <InputText {...args} />
      </FormLayoutBlockItem>
      <DSButtonV2>Submit</DSButtonV2>
      <WatchValue label="First Name" {...args} />
    </Form>
  </Grid>
);

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

Basic.args = {
  id: 'firstname',
  name: 'firstname',
  defaultValue: 'John',
  rules: {
    required: { value: true, message: 'Please enter firstname' },
  },
};
`,l={Basic:{startLoc:{col:64,line:23},endLoc:{col:1,line:33},startBody:{col:64,line:23},endBody:{col:1,line:33}}},_=`import { Story, Meta } from '@storybook/react';
import { Grid } from '@elliemae/ds-grid';
// import '@elliemae/ds-form-input-text';
import { DSButtonV2 } from '@elliemae/ds-button';
import { Form } from '../../form/index.js';
import { InputText, InputTextProps } from './index.js';
import { FormLayoutBlockItem } from '../form-layout-block-item/index.js';
import { WatchValue } from '../watch-value.js';

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

const Template: Story<InputTextProps & { labelText: string }> = (args) => (
  <Grid p="m">
    <Form>
      <FormLayoutBlockItem inputID="firstname" label="First Name" required>
        <InputText {...args} />
      </FormLayoutBlockItem>
      <DSButtonV2>Submit</DSButtonV2>
      <WatchValue label="First Name" {...args} />
    </Form>
  </Grid>
);

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

Basic.args = {
  id: 'firstname',
  name: 'firstname',
  defaultValue: 'John',
  rules: {
    required: { value: true, message: 'Please enter firstname' },
  },
};
`,l={Basic:{startLoc:{col:64,line:15},endLoc:{col:1,line:25},startBody:{col:64,line:15},endBody:{col:1,line:25}}};const c={parameters:{storySource:{source:`
    
    // @ts-nocheck
    // @ts-ignore
    var __STORY__ = "import { Story, Meta } from '@storybook/react';\\nimport { Grid } from '@elliemae/ds-grid';\\n// import '@elliemae/ds-form-input-text';\\nimport { DSButtonV2 } from '@elliemae/ds-button';\\nimport { Form } from '../../form/index.js';\\nimport { InputText, InputTextProps } from './index.js';\\nimport { FormLayoutBlockItem } from '../form-layout-block-item/index.js';\\nimport { WatchValue } from '../watch-value.js';\\n\\nexport default {\\n  title: 'Components/Form/Controls/InputText',\\n  component: InputText,\\n} as Meta;\\n\\nconst Template: Story<InputTextProps & { labelText: string }> = (args) => (\\n  <Grid p=\\"m\\">\\n    <Form>\\n      <FormLayoutBlockItem inputID=\\"firstname\\" label=\\"First Name\\" required>\\n        <InputText {...args} />\\n      </FormLayoutBlockItem>\\n      <DSButtonV2>Submit</DSButtonV2>\\n      <WatchValue label=\\"First Name\\" {...args} />\\n    </Form>\\n  </Grid>\\n);\\n\\nexport const Basic = Template.bind({});\\n\\nBasic.args = {\\n  id: 'firstname',\\n  name: 'firstname',\\n  defaultValue: 'John',\\n  rules: {\\n    required: { value: true, message: 'Please enter firstname' },\\n  },\\n};\\n";
    // @ts-ignore
    var __LOCATIONS_MAP__ = {"Basic":{"startLoc":{"col":64,"line":15},"endLoc":{"col":1,"line":25},"startBody":{"col":64,"line":15},"endBody":{"col":1,"line":25}}};
    
import { Story, Meta } from '@storybook/react';
import { Grid } from '@elliemae/ds-grid';
// import '@elliemae/ds-form-input-text';
import { DSButtonV2 } from '@elliemae/ds-button';
import { Form } from '../../form/index.js';
import { InputText, InputTextProps } from './index.js';
import { FormLayoutBlockItem } from '../form-layout-block-item/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';\\n// import '@elliemae/ds-form-input-text';\\nimport { DSButtonV2 } from '@elliemae/ds-button';\\nimport { Form } from '../../form/index.js';\\nimport { InputText, InputTextProps } from './index.js';\\nimport { FormLayoutBlockItem } from '../form-layout-block-item/index.js';\\nimport { WatchValue } from '../watch-value.js';\\n\\nexport default {\\n  title: 'Components/Form/Controls/InputText',\\n  component: InputText,\\n} as Meta;\\n\\nconst Template: Story<InputTextProps & { labelText: string }> = (args) => (\\n  <Grid p=\\"m\\">\\n    <Form>\\n      <FormLayoutBlockItem inputID=\\"firstname\\" label=\\"First Name\\" required>\\n        <InputText {...args} />\\n      </FormLayoutBlockItem>\\n      <DSButtonV2>Submit</DSButtonV2>\\n      <WatchValue label=\\"First Name\\" {...args} />\\n    </Form>\\n  </Grid>\\n);\\n\\nexport const Basic = Template.bind({});\\n\\nBasic.args = {\\n  id: 'firstname',\\n  name: 'firstname',\\n  defaultValue: 'John',\\n  rules: {\\n    required: { value: true, message: 'Please enter firstname' },\\n  },\\n};\\n","locationsMap":{"basic":{"startLoc":{"col":64,"line":15},"endLoc":{"col":1,"line":25},"startBody":{"col":64,"line":15},"endBody":{"col":1,"line":25}}}},},
  title: 'Components/Form/Controls/InputText',
  component: InputText,
} as Meta;

const Template: Story<InputTextProps & { labelText: string }> = (args) => (
  <Grid p="m">
    <Form>
      <FormLayoutBlockItem inputID="firstname" label="First Name" required>
        <InputText {...args} />
      </FormLayoutBlockItem>
      <DSButtonV2>Submit</DSButtonV2>
      <WatchValue label="First Name" {...args} />
    </Form>
  </Grid>
);

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

Basic.args = {
  id: 'firstname',
  name: 'firstname',
  defaultValue: 'John',
  rules: {
    required: { value: true, message: 'Please enter firstname' },
  },
};
`,locationsMap:{basic:{startLoc:{col:64,line:23},endLoc:{col:1,line:33},startBody:{col:64,line:23},endBody:{col:1,line:33}}}},storySource:{source:`import { Story, Meta } from '@storybook/react';
import { Grid } from '@elliemae/ds-grid';
// import '@elliemae/ds-form-input-text';
import { DSButtonV2 } from '@elliemae/ds-button';
import { Form } from '../../form/index.js';
import { InputText, InputTextProps } from './index.js';
import { FormLayoutBlockItem } from '../form-layout-block-item/index.js';
import { WatchValue } from '../watch-value.js';

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

const Template: Story<InputTextProps & { labelText: string }> = (args) => (
  <Grid p="m">
    <Form>
      <FormLayoutBlockItem inputID="firstname" label="First Name" required>
        <InputText {...args} />
      </FormLayoutBlockItem>
      <DSButtonV2>Submit</DSButtonV2>
      <WatchValue label="First Name" {...args} />
    </Form>
  </Grid>
);

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

Basic.args = {
  id: 'firstname',
  name: 'firstname',
  defaultValue: 'John',
  rules: {
    required: { value: true, message: 'Please enter firstname' },
  },
};
`,locationsMap:{basic:{startLoc:{col:64,line:15},endLoc:{col:1,line:25},startBody:{col:64,line:15},endBody:{col:1,line:25}}}}},title:"Components/Form/Controls/InputText",component:o.S};var a=function(I){return t()(s.Ay,{p:"m"},void 0,t()(u.l,{},void 0,t()(p.B,{inputID:"firstname",label:"First Name",required:!0},void 0,(0,n.jsx)(o.S,Object.assign({},I))),r||(r=t()(d.e,{},void 0,"Submit")),(0,n.jsx)(m.n,Object.assign({label:"First Name"},I))))};a.displayName="Template";var x=a.bind({});x.args={id:"firstname",name:"firstname",defaultValue:"John",rules:{required:{value:!0,message:"Please enter firstname"}}};var b=["Basic"]},"./lib/view/fields/input-text/index.tsx":(B,i,e)=>{e.d(i,{S:()=>n});var f=e("./node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/jsx.js"),t=e.n(f),s=e("./node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/objectWithoutProperties.js"),d=e.n(s),u=e("./node_modules/.pnpm/@elliemae+ds-form-input-text@3.54.6_@elliemae+pui-theme@2.13.0/node_modules/@elliemae/ds-form-input-text/dist/esm/DSInputText.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"),p=e("./node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js"),m=["name","defaultValue","rules"],n=function(r){var _=r.name,l=r.defaultValue,c=l===void 0?"":l,a=r.rules,x=a===void 0?{}:a,b=d()(r,m);return t()(o.xI,{name:_,defaultValue:c,rules:x,render:function(I){var v=I.field,T=I.fieldState.error;return(0,p.jsx)(u.B,Object.assign({hasError:!!T},v,b))}})};n.displayName="InputText"},"./lib/view/fields/watch-value.tsx":(B,i,e)=>{e.d(i,{n:()=>n});var f=e("./node_modules/.pnpm/@babel+runtime@7.28.4/node_modules/@babel/runtime/helpers/jsx.js"),t=e.n(f),s=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"),d=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"),u=e("./node_modules/.pnpm/react-hook-form@7.63.0_react@18.3.1/node_modules/react-hook-form/dist/index.esm.mjs"),o,p=s.Ay.section.withConfig({componentId:"sc-1va6d9p-0"})(["margin-top:10px;border-top:2px blue dotted;width:100%;"]),m=s.Ay.div.withConfig({componentId:"sc-1va6d9p-1"})(["display:flex;flex-direction:column;padding-left:10px;align-items:flex-start;"]),n=function(r){var _=r.name,l=r.label,c=(0,u.xW)(),a=c.watch,x=a(_,!1)||"";return t()(d.Ay,{},void 0,t()(p,{},void 0,o||(o=t()("h4",{},void 0,"Form Data:")),t()(m,{},void 0,t()("div",{},void 0,l," : ",t()("strong",{},void 0,JSON.stringify(x))))))};n.displayName="WatchValue"},"./lib/view/form/index.tsx":(B,i,e)=>{e.d(i,{l:()=>u});var f=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"),t=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"),d=f.Ay.form.withConfig({componentId:"sc-1pyjvv3-0"})(["width:100%;"]),u=function(o){var p=o.classname,m=o.reactHookFormProps,n=m===void 0?{mode:"onBlur"}:m,r=o.children,_=o.onSubmit,l=(0,t.mN)(n),c={};_&&(c.onSubmit=l.handleSubmit(_));var a=Object.assign(l,{formProps:n});return(0,s.jsx)(t.Op,Object.assign({},a,{children:(0,s.jsx)(d,Object.assign({className:p},c,{children:r}))}))};u.displayName="Form"}}]);
