@kurocado-studio/formkit-ui-react-renderer 1.0.0-develop.3 → 1.0.0-develop.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/exports.js CHANGED
@@ -1,2 +1,2 @@
1
- var c=(t=>(t.TEXT="TEXT",t))(c||{}),f=(o=>(o.TEXT="text",o.EMAIL="email",o.PASSWORD="password",o))(f||{}),T=(n=>(n.TEXT="text",n.NUMERIC="numeric",n.DECIMAL="decimal",n.EMAIL="email",n.TEL="tel",n.URL="url",n.SEARCH="search",n))(T||{}),l=(i=>(i.NONE="none",i.SENTENCES="sentences",i.WORDS="words",i.CHARACTERS="characters",i))(l||{});export*from"@kurocado-studio/web-forms-react";import{useAriaTextField as R}from"@kurocado-studio/web-forms-react";import a from"react";function u(e){let{labelProps:t,inputProps:r,descriptionProps:o,errorMessageProps:i}=R(e);return a.createElement(a.Fragment,null,a.createElement("label",{...t}),a.createElement("input",{...r}),a.createElement("p",{className:"block w-full",...o}),a.createElement("span",{className:"block w-full text-red-700",...i}))}import{HtmlForm as q}from"@kurocado-studio/web-forms-react";import g from"react";function H(e){return g.createElement(q,{...e})}import{useAriaTextArea as h}from"@kurocado-studio/web-forms-react";import s from"react";function G(e){let{labelProps:t,textAreaProps:r,descriptionProps:o,errorMessageProps:i}=h(e);return s.createElement(s.Fragment,null,s.createElement("label",{...t}),s.createElement("textarea",{...r}),s.createElement("p",{className:"block w-full",...o}),s.createElement("span",{className:"block w-full text-red-700",...i}))}import{get as x}from"lodash-es";import y from"react";function N(e){let{question:t,variant:r,variants:o,description:i}=e.question,K=x(o,[r,"id"],"unknown"),A=x(o,[r,"required"],!1);return y.createElement(u,{required:A,name:K,label:t,description:i})}import{get as P}from"lodash-es";import U from"react";var O={TEXT:N};import{get as C}from"lodash-es";import b from"react";function Q({node:e}){return b.createElement("div",{style:{color:"gray",fontStyle:"italic"}},"Unsupported node type: ",e.variant)}function E({questionNode:e,componentMap:t}){let r=C(t,[e.variant],Q);return b.createElement(r,{node:e,question:e})}function de(e){return function({questionNode:r}){let o={TEXT:P(e,["TEXT"],O.TEXT)};return U.createElement(E,{questionNode:r,componentMap:o})}}import{InputFieldTypeEnum as D,VariantEnum as S}from"@kurocado-studio/formkit-ui-models";var m={id:"391a5218-2a40-4652-895b-683e2e25dd96",question:"What\u2019s the name of your form or project?",description:"Who is this description for?",hidden:!1,required:!1,variant:S.TEXT,variants:{TEXT:{id:"10ae5f58-6de4-4aef-999e-d7b9df78056b",name:"unknown",type:D.TEXT,required:!1}},name:"4c9107e4-2a29-4460-ab77-648974e2634f"},d={id:"c2bb388c-e187-440b-b4d7-092c0be49c6f",question:"Who is this form for?",description:"Who is this description for?",hidden:!1,required:!1,variant:S.TEXT,variants:{TEXT:{id:"01e3f9d0-d4c7-43f4-aa48-2987edcdafea",name:"unknown",type:D.TEXT,required:!1}},name:"e28e40c9-6821-43d7-a018-c81cf3a29dd6"},p={id:"821efcf2-cc16-4fa3-9ae9-b467738e2c4a",title:"Section 1",description:"This is a section",order:0,createdAt:"2025-11-11T16:05:23.351Z",updatedAt:"2025-11-11T16:05:23.351Z",questions:[m,d]},v={...p,questions:{[m.id]:m,[d.id]:d}},_={id:"2305e7ed-b583-4ef7-9a4c-2bc094b34894",title:"Welcome to FormKit",description:"This short demo introduces how FormKit lets you design and (soon) embed forms dynamically. You can edit any title, description, or question \u2014 just click and edit!",createdAt:"2025-11-11T16:05:23.351Z",updatedAt:"2025-11-11T16:05:23.351Z",sections:[p]},fe={[_.id]:{..._,sections:{[p.id]:v}}};var le="05bc858a-f333-4dab-9e24-fb41b1b7468e",ue="2305e7ed-b583-4ef7-9a4c-2bc094b34894",xe="2305e7ed-b583-4ef7-9a4c-2bc094b34894",Ne="5139da7c-5fc2-4140-8041-6caff89990b5",Oe="821efcf2-cc16-4fa3-9ae9-b467738e2c4a",be="821efcf2-cc16-4fa3-9ae9-b467738e2c4a",F=new Date().toISOString(),M=new Date().toISOString(),Ee={createdAt:F,description:"",id:"",sections:[],updatedAt:M,title:""},_e={createdAt:F,description:"No description provided",id:"",order:0,questions:[],title:"",updatedAt:M},De={hidden:!1,id:"",question:"No name provided",description:"No description provided",required:!1,variant:"TEXT",variants:{}};export{N as BaseFormKitInputTextFieldNode,Ee as EMPTY_FORM_NODE,De as EMPTY_QUESTION_NODE,_e as EMPTY_SECTION_NODE,H as FormKitForm,G as FormKitInputTextArea,u as FormKitInputTextField,l as InputFieldAutocapitalizeEnum,T as InputFieldInputModeEnum,f as InputFieldTypeEnum,ue as KUROCADO_STUDIO_DEMO_FORM_ID,xe as KUROCADO_STUDIO_DEMO_LONG_FORM_ID,be as KUROCADO_STUDIO_DEMO_LONG_SECTION_ID,Oe as KUROCADO_STUDIO_DEMO_SECTION_ID,Ne as KUROCADO_STUDIO_LOGIN_FORM_ID,le as KUROCADO_STUDIO_ORGANIZATION_ID_FORMKIT,c as VariantEnum,O as formKitBaseNodeVariantMap,de as formRendererComposer,_ as sampledForm,fe as sampledFormsNodeTree,m as sampledQuestion1,d as sampledQuestion2,p as sampledSection,v as sampledSectionNodeTree};
1
+ var c=(r=>(r.TEXT="TEXT",r))(c||{}),f=(o=>(o.TEXT="text",o.EMAIL="email",o.PASSWORD="password",o))(f||{}),T=(n=>(n.TEXT="text",n.NUMERIC="numeric",n.DECIMAL="decimal",n.EMAIL="email",n.TEL="tel",n.URL="url",n.SEARCH="search",n))(T||{}),u=(i=>(i.NONE="none",i.SENTENCES="sentences",i.WORDS="words",i.CHARACTERS="characters",i))(u||{});export*from"@kurocado-studio/web-forms-react";import{useAriaTextField as g}from"@kurocado-studio/web-forms-react";import a from"react";function l(e){let{labelProps:r,inputProps:t,descriptionProps:o,errorMessageProps:i}=g(e);return a.createElement(a.Fragment,null,a.createElement("label",{...r}),a.createElement("input",{...t}),a.createElement("p",{className:"block w-full",...o}),a.createElement("span",{className:"block w-full text-red-700",...i}))}import{HtmlForm as h}from"@kurocado-studio/web-forms-react";import D from"react";function H(e){return D.createElement(h,{...e})}import{useAriaTextArea as y}from"@kurocado-studio/web-forms-react";import s from"react";function Z(e){let{labelProps:r,textAreaProps:t,descriptionProps:o,errorMessageProps:i}=y(e);return s.createElement(s.Fragment,null,s.createElement("label",{...r}),s.createElement("textarea",{...t}),s.createElement("p",{className:"block w-full",...o}),s.createElement("span",{className:"block w-full text-red-700",...i}))}import{get as x}from"lodash-es";import Q from"react";function N(e){let{question:r,variant:t,variants:o,description:i}=e.question,q=x(o,[t,"id"],"unknown"),R=x(o,[t,"required"],!1);return Q.createElement(l,{required:R,name:q,label:r,description:i})}import{get as A}from"lodash-es";import V from"react";var E={TEXT:N};import{get as P}from"lodash-es";import F from"react";function v({node:e}){return F.createElement("div",{style:{color:"gray",fontStyle:"italic"}},"Unsupported node type: ",e.variant)}function b({questionNode:e,componentMap:r}){let t=P(r,[e.variant],v);return F.createElement(t,{node:e,question:e})}function de(e){return function({questionNode:t}){let o={TEXT:A(e,["TEXT"],E.TEXT)};return V.createElement(b,{questionNode:t,componentMap:o})}}import{InputFieldTypeEnum as O,VariantEnum as K}from"@kurocado-studio/formkit-ui-models";var m={id:"391a5218-2a40-4652-895b-683e2e25dd96",question:"What\u2019s the name of your form or project?",description:"Who is this description for?",hidden:!1,required:!1,variant:K.TEXT,variants:{TEXT:{id:"10ae5f58-6de4-4aef-999e-d7b9df78056b",name:"unknown",type:O.TEXT,required:!1}},name:"4c9107e4-2a29-4460-ab77-648974e2634f"},d={id:"c2bb388c-e187-440b-b4d7-092c0be49c6f",question:"Who is this form for?",description:"Who is this description for?",hidden:!1,required:!1,variant:K.TEXT,variants:{TEXT:{id:"01e3f9d0-d4c7-43f4-aa48-2987edcdafea",name:"unknown",type:O.TEXT,required:!1}},name:"e28e40c9-6821-43d7-a018-c81cf3a29dd6"},p={id:"821efcf2-cc16-4fa3-9ae9-b467738e2c4a",title:"Section 1",description:"This is a section",order:0,createdAt:"2025-11-11T16:05:23.351Z",updatedAt:"2025-11-11T16:05:23.351Z",questions:[m,d]},X={...p,questions:{[m.id]:m,[d.id]:d}},M={id:"2305e7ed-b583-4ef7-9a4c-2bc094b34894",title:"Welcome to FormKit",description:"This short demo introduces how FormKit lets you design and (soon) embed forms dynamically. You can edit any title, description, or question \u2014 just click and edit!",createdAt:"2025-11-11T16:05:23.351Z",updatedAt:"2025-11-11T16:05:23.351Z",sections:[p]},fe={[M.id]:{...M,sections:{[p.id]:X}}};var ue="2305e7ed-b583-4ef7-9a4c-2bc094b34894",le="2305e7ed-b583-4ef7-9a4c-2bc094b34894",xe="5139da7c-5fc2-4140-8041-6caff89990b5",Ne="821efcf2-cc16-4fa3-9ae9-b467738e2c4a",Ee="821efcf2-cc16-4fa3-9ae9-b467738e2c4a",S=new Date().toISOString(),_=new Date().toISOString(),Fe={createdAt:S,description:"",id:"",sections:[],updatedAt:_,title:""},be={createdAt:S,description:"No description provided",id:"",order:0,questions:[],title:"",updatedAt:_},Me={hidden:!1,id:"",question:"No name provided",description:"No description provided",required:!1,variant:"TEXT",variants:{}};export{N as BaseFormKitInputTextFieldNode,Fe as EMPTY_FORM_NODE,Me as EMPTY_QUESTION_NODE,be as EMPTY_SECTION_NODE,ue as FORMKIT_DEMO_FORM_ID,le as FORMKIT_DEMO_LONG_FORM_ID,Ee as FORMKIT_DEMO_LONG_SECTION_ID,Ne as FORMKIT_DEMO_SECTION_ID,xe as FORMKIT_LOGIN_FORM_ID,H as FormKitForm,Z as FormKitInputTextArea,l as FormKitInputTextField,u as InputFieldAutocapitalizeEnum,T as InputFieldInputModeEnum,f as InputFieldTypeEnum,c as VariantEnum,E as formKitBaseNodeVariantMap,de as formRendererComposer,M as sampledForm,fe as sampledFormsNodeTree,m as sampledQuestion1,d as sampledQuestion2,p as sampledSection,X as sampledSectionNodeTree};
2
2
  //# sourceMappingURL=exports.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/enums/index.ts","../src/exports.ts","../src/components/controls/FormKitInputTextField.tsx","../src/components/controls/FormKitForm.tsx","../src/components/controls/FormKitInputTextArea.tsx","../src/components/nodes/BaseFormKitInputTextFieldNode.tsx","../src/components/FormRendererComposer.tsx","../src/config/formKitBaseNodeVariantMap.ts","../src/components/QuestionNodeRenderer.tsx","../src/utils/mocks.ts","../src/constants.ts"],"sourcesContent":["export enum VariantEnum {\n TEXT = 'TEXT',\n}\nexport enum InputFieldTypeEnum {\n TEXT = 'text',\n EMAIL = 'email',\n PASSWORD = 'password',\n}\n\nexport enum InputFieldInputModeEnum {\n TEXT = 'text',\n NUMERIC = 'numeric',\n DECIMAL = 'decimal',\n EMAIL = 'email',\n TEL = 'tel',\n URL = 'url',\n SEARCH = 'search',\n}\n\nexport enum InputFieldAutocapitalizeEnum {\n NONE = 'none',\n SENTENCES = 'sentences',\n WORDS = 'words',\n CHARACTERS = 'characters',\n}\n","export type Theme = Record<string, Record<string, unknown>>;\n\nexport {\n VariantEnum,\n InputFieldTypeEnum,\n InputFieldInputModeEnum,\n InputFieldAutocapitalizeEnum,\n} from './enums';\n\nexport * from '@kurocado-studio/web-forms-react';\nexport * from './components/controls';\nexport * from './components/nodes';\nexport * from './components/FormRendererComposer';\nexport * from './config/formKitBaseNodeVariantMap';\nexport * from './utils/mocks';\nexport * from './constants';\nexport * from './types';\n","import { useAriaTextField } from '@kurocado-studio/web-forms-react';\nimport React from 'react';\n\nexport function FormKitInputTextField(\n properties: {\n name: string;\n label?: string;\n description?: string;\n } & Partial<HTMLElementTagNameMap['input']>,\n): React.ReactNode {\n const { labelProps, inputProps, descriptionProps, errorMessageProps } =\n useAriaTextField(properties);\n\n return (\n <>\n <label {...labelProps} />\n <input {...inputProps} />\n <p className='block w-full' {...descriptionProps} />\n <span className='block w-full text-red-700' {...errorMessageProps} />\n </>\n );\n}\n","import {\n HtmlForm,\n type HtmlFormProperties,\n} from '@kurocado-studio/web-forms-react';\nimport React from 'react';\n\nexport function FormKitForm<T extends Record<string, unknown>>(\n properties: HtmlFormProperties<T>,\n): React.ReactNode {\n return <HtmlForm<T> {...properties} />;\n}\n","import { useAriaTextArea } from '@kurocado-studio/web-forms-react';\nimport React from 'react';\n\nexport function FormKitInputTextArea(\n properties: { name: string } & Partial<HTMLElementTagNameMap['textarea']>,\n): React.ReactNode {\n const { labelProps, textAreaProps, descriptionProps, errorMessageProps } =\n useAriaTextArea(properties);\n\n return (\n <>\n <label {...labelProps} />\n <textarea {...textAreaProps} />\n <p className='block w-full' {...descriptionProps} />\n <span className='block w-full text-red-700' {...errorMessageProps} />\n </>\n );\n}\n","import type { Question } from '@kurocado-studio/formkit-ui-models';\nimport { get } from 'lodash-es';\nimport React from 'react';\n\nimport { FormKitInputTextField } from '../controls';\n\nexport function BaseFormKitInputTextFieldNode(properties: {\n question: Question;\n}): React.ReactNode {\n const { question, variant, variants, description } = properties.question;\n const name = get(variants, [variant, 'id'], 'unknown');\n const required = get(variants, [variant, 'required'], false);\n\n return (\n <FormKitInputTextField\n required={required}\n name={name}\n label={question}\n description={description}\n />\n );\n}\n","import { get } from 'lodash-es';\nimport React from 'react';\n\nimport { formKitBaseNodeVariantMap } from '../config/formKitBaseNodeVariantMap';\nimport { VariantEnum } from '../enums';\nimport { FormKitNodeVariantMap, Question } from '../types';\nimport { QuestionNodeRenderer } from './QuestionNodeRenderer';\n\nexport function formRendererComposer(defaultMap: FormKitNodeVariantMap) {\n return function FormRenderer({\n questionNode,\n }: {\n questionNode: Question;\n componentMap?: FormKitNodeVariantMap;\n }) {\n const nodeVariantMap: FormKitNodeVariantMap = {\n [VariantEnum.TEXT]: get(\n defaultMap,\n [VariantEnum.TEXT],\n formKitBaseNodeVariantMap.TEXT,\n ),\n };\n\n return (\n <QuestionNodeRenderer\n questionNode={questionNode}\n componentMap={nodeVariantMap}\n />\n );\n };\n}\n","import { BaseFormKitInputTextFieldNode } from '../components/nodes';\nimport { VariantEnum } from '../enums';\nimport { FormKitNodeVariantMap } from '../types';\n\nexport const formKitBaseNodeVariantMap: FormKitNodeVariantMap = {\n [VariantEnum.TEXT]: BaseFormKitInputTextFieldNode,\n};\n","import { get } from 'lodash-es';\nimport React from 'react';\n\nimport { FormKitNodeVariantMap, Question } from '../types';\n\nfunction DefaultFallback({ node }: { node: Question }) {\n return (\n <div style={{ color: 'gray', fontStyle: 'italic' }}>\n Unsupported node type: {node.variant}\n </div>\n );\n}\n\nexport function QuestionNodeRenderer({\n questionNode,\n componentMap,\n}: {\n questionNode: Question;\n componentMap: FormKitNodeVariantMap;\n}) {\n const Component = get(componentMap, [questionNode.variant], DefaultFallback);\n return <Component node={questionNode} question={questionNode} />;\n}\n","import {\n type Form,\n type FormsNodeTree,\n InputFieldTypeEnum,\n type Question,\n type Section,\n type SectionNodeTree,\n VariantEnum,\n} from '@kurocado-studio/formkit-ui-models';\n\nexport const sampledQuestion1: Question = {\n id: '391a5218-2a40-4652-895b-683e2e25dd96',\n question: 'What’s the name of your form or project?',\n description: 'Who is this description for?',\n hidden: false,\n required: false,\n variant: VariantEnum.TEXT,\n variants: {\n TEXT: {\n id: '10ae5f58-6de4-4aef-999e-d7b9df78056b',\n name: 'unknown',\n type: InputFieldTypeEnum.TEXT,\n required: false,\n },\n },\n name: '4c9107e4-2a29-4460-ab77-648974e2634f',\n};\n\nexport const sampledQuestion2: Question = {\n id: 'c2bb388c-e187-440b-b4d7-092c0be49c6f',\n question: 'Who is this form for?',\n description: 'Who is this description for?',\n hidden: false,\n required: false,\n variant: VariantEnum.TEXT,\n variants: {\n TEXT: {\n id: '01e3f9d0-d4c7-43f4-aa48-2987edcdafea',\n name: 'unknown',\n type: InputFieldTypeEnum.TEXT,\n required: false,\n },\n },\n name: 'e28e40c9-6821-43d7-a018-c81cf3a29dd6',\n};\n\nexport const sampledSection: Section = {\n id: '821efcf2-cc16-4fa3-9ae9-b467738e2c4a',\n title: 'Section 1',\n description: 'This is a section',\n order: 0,\n createdAt: '2025-11-11T16:05:23.351Z',\n updatedAt: '2025-11-11T16:05:23.351Z',\n questions: [sampledQuestion1, sampledQuestion2],\n};\n\nexport const sampledSectionNodeTree: SectionNodeTree = {\n ...sampledSection,\n questions: {\n [sampledQuestion1.id]: sampledQuestion1,\n [sampledQuestion2.id]: sampledQuestion2,\n },\n};\n\nexport const sampledForm: Form = {\n id: '2305e7ed-b583-4ef7-9a4c-2bc094b34894',\n title: 'Welcome to FormKit',\n description:\n 'This short demo introduces how FormKit lets you design and (soon) embed forms dynamically. You can edit any title, description, or question — just click and edit!',\n createdAt: '2025-11-11T16:05:23.351Z',\n updatedAt: '2025-11-11T16:05:23.351Z',\n sections: [sampledSection],\n};\n\nexport const sampledFormsNodeTree: FormsNodeTree = {\n [sampledForm.id]: {\n ...sampledForm,\n sections: {\n [sampledSection.id]: sampledSectionNodeTree,\n },\n },\n};\n","import { VariantEnum } from './enums';\nimport { Form, Question, Section } from './types';\n\nexport const KUROCADO_STUDIO_ORGANIZATION_ID_FORMKIT =\n '05bc858a-f333-4dab-9e24-fb41b1b7468e';\n\nexport const KUROCADO_STUDIO_DEMO_FORM_ID =\n '2305e7ed-b583-4ef7-9a4c-2bc094b34894';\n\nexport const KUROCADO_STUDIO_DEMO_LONG_FORM_ID =\n '2305e7ed-b583-4ef7-9a4c-2bc094b34894';\n\nexport const KUROCADO_STUDIO_LOGIN_FORM_ID =\n '5139da7c-5fc2-4140-8041-6caff89990b5';\n\nexport const KUROCADO_STUDIO_DEMO_SECTION_ID =\n '821efcf2-cc16-4fa3-9ae9-b467738e2c4a';\n\nexport const KUROCADO_STUDIO_DEMO_LONG_SECTION_ID =\n '821efcf2-cc16-4fa3-9ae9-b467738e2c4a';\n\nconst createdAt = new Date().toISOString();\nconst updatedAt = new Date().toISOString();\n\nexport const EMPTY_FORM_NODE: Form = {\n createdAt,\n description: '',\n id: '',\n sections: [],\n updatedAt,\n title: '',\n};\n\nexport const EMPTY_SECTION_NODE: Section = {\n createdAt,\n description: 'No description provided',\n id: '',\n order: 0,\n questions: [],\n title: '',\n updatedAt,\n};\n\nexport const EMPTY_QUESTION_NODE: Question = {\n hidden: false,\n id: '',\n question: 'No name provided',\n description: 'No description provided',\n required: false,\n variant: VariantEnum.TEXT,\n variants: {},\n};\n"],"mappings":"AAAO,IAAKA,OACVA,EAAA,KAAO,OADGA,OAAA,IAGAC,OACVA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,SAAW,WAHDA,OAAA,IAMAC,OACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,QAAU,UACVA,EAAA,MAAQ,QACRA,EAAA,IAAM,MACNA,EAAA,IAAM,MACNA,EAAA,OAAS,SAPCA,OAAA,IAUAC,OACVA,EAAA,KAAO,OACPA,EAAA,UAAY,YACZA,EAAA,MAAQ,QACRA,EAAA,WAAa,aAJHA,OAAA,ICVZ,WAAc,mCCTd,OAAS,oBAAAC,MAAwB,mCACjC,OAAOC,MAAW,QAEX,SAASC,EACdC,EAKiB,CACjB,GAAM,CAAE,WAAAC,EAAY,WAAAC,EAAY,iBAAAC,EAAkB,kBAAAC,CAAkB,EAClEP,EAAiBG,CAAU,EAE7B,OACEF,EAAA,cAAAA,EAAA,cACEA,EAAA,cAAC,SAAO,GAAGG,EAAY,EACvBH,EAAA,cAAC,SAAO,GAAGI,EAAY,EACvBJ,EAAA,cAAC,KAAE,UAAU,eAAgB,GAAGK,EAAkB,EAClDL,EAAA,cAAC,QAAK,UAAU,4BAA6B,GAAGM,EAAmB,CACrE,CAEJ,CCrBA,OACE,YAAAC,MAEK,mCACP,OAAOC,MAAW,QAEX,SAASC,EACdC,EACiB,CACjB,OAAOF,EAAA,cAACD,EAAA,CAAa,GAAGG,EAAY,CACtC,CCVA,OAAS,mBAAAC,MAAuB,mCAChC,OAAOC,MAAW,QAEX,SAASC,EACdC,EACiB,CACjB,GAAM,CAAE,WAAAC,EAAY,cAAAC,EAAe,iBAAAC,EAAkB,kBAAAC,CAAkB,EACrEP,EAAgBG,CAAU,EAE5B,OACEF,EAAA,cAAAA,EAAA,cACEA,EAAA,cAAC,SAAO,GAAGG,EAAY,EACvBH,EAAA,cAAC,YAAU,GA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C,CACF,EAEaG,GAAgC,CAC3C,OAAQ,GACR,GAAI,GACJ,SAAU,mBACV,YAAa,0BACb,SAAU,GACV,eACA,SAAU,CAAC,CACb","names":["VariantEnum","InputFieldTypeEnum","InputFieldInputModeEnum","InputFieldAutocapitalizeEnum","useAriaTextField","React","FormKitInputTextField","properties","labelProps","inputProps","descriptionProps","errorMessageProps","HtmlForm","React","FormKitForm","properties","useAriaTextArea","React","FormKitInputTextArea","properties","labelProps","textAreaProps","descriptionProps","errorMessageProps","get","React","BaseFormKitInputTextFieldNode","properties","question","variant","variants","description","name","get","required","React","FormKitInputTextField","get","React","formKitBaseNodeVariantMap","BaseFormKitInputTextFieldNode","get","React","DefaultFallback","node","QuestionNodeRenderer","questionNode","componentMap","Component","formRendererComposer","defaultMap","questionNode","nodeVariantMap","get","formKitBaseNodeVariantMap","React","QuestionNodeRenderer","InputFieldTypeEnum","VariantEnum","sampledQuestion1","sampledQuestion2","sampledSection","sampledSectionNodeTree","sampledForm","sampledFormsNodeTree","KUROCADO_STUDIO_ORGANIZATION_ID_FORMKIT","KUROCADO_STUDIO_DEMO_FORM_ID","KUROCADO_STUDIO_DEMO_LONG_FORM_ID","KUROCADO_STUDIO_LOGIN_FORM_ID","KUROCADO_STUDIO_DEMO_SECTION_ID","KUROCADO_STUDIO_DEMO_LONG_SECTION_ID","createdAt","updatedAt","EMPTY_FORM_NODE","EMPTY_SECTION_NODE","EMPTY_QUESTION_NODE"]}
1
+ {"version":3,"sources":["../src/enums/index.ts","../src/exports.ts","../src/components/controls/FormKitInputTextField.tsx","../src/components/controls/FormKitForm.tsx","../src/components/controls/FormKitInputTextArea.tsx","../src/components/nodes/BaseFormKitInputTextFieldNode.tsx","../src/components/FormRendererComposer.tsx","../src/config/formKitBaseNodeVariantMap.ts","../src/components/QuestionNodeRenderer.tsx","../src/utils/mocks.ts","../src/constants.ts"],"sourcesContent":["export enum VariantEnum {\n TEXT = 'TEXT',\n}\nexport enum InputFieldTypeEnum {\n TEXT = 'text',\n EMAIL = 'email',\n PASSWORD = 'password',\n}\n\nexport enum InputFieldInputModeEnum {\n TEXT = 'text',\n NUMERIC = 'numeric',\n DECIMAL = 'decimal',\n EMAIL = 'email',\n TEL = 'tel',\n URL = 'url',\n SEARCH = 'search',\n}\n\nexport enum InputFieldAutocapitalizeEnum {\n NONE = 'none',\n SENTENCES = 'sentences',\n WORDS = 'words',\n CHARACTERS = 'characters',\n}\n","export type Theme = Record<string, Record<string, unknown>>;\n\nexport {\n VariantEnum,\n InputFieldTypeEnum,\n InputFieldInputModeEnum,\n InputFieldAutocapitalizeEnum,\n} from './enums';\n\nexport * from '@kurocado-studio/web-forms-react';\nexport * from './components/controls';\nexport * from './components/nodes';\nexport * from './components/FormRendererComposer';\nexport * from './config/formKitBaseNodeVariantMap';\nexport * from './utils/mocks';\nexport * from './constants';\nexport * from './types';\n","import { useAriaTextField } from '@kurocado-studio/web-forms-react';\nimport React from 'react';\n\nexport function FormKitInputTextField(\n properties: {\n name: string;\n label?: string;\n description?: string;\n } & Partial<HTMLElementTagNameMap['input']>,\n): React.ReactNode {\n const { labelProps, inputProps, descriptionProps, errorMessageProps } =\n useAriaTextField(properties);\n\n return (\n <>\n <label {...labelProps} />\n <input {...inputProps} />\n <p className='block w-full' {...descriptionProps} />\n <span className='block w-full text-red-700' {...errorMessageProps} />\n </>\n );\n}\n","import { HtmlForm } from '@kurocado-studio/web-forms-react';\nimport React from 'react';\n\nimport { FormKitFormProperties } from '../../types';\n\nexport function FormKitForm<T extends Record<string, unknown>>(\n properties: FormKitFormProperties<T>,\n): React.ReactNode {\n return <HtmlForm<T> {...properties} />;\n}\n","import { useAriaTextArea } from '@kurocado-studio/web-forms-react';\nimport React from 'react';\n\nexport function FormKitInputTextArea(\n properties: { name: string } & Partial<HTMLElementTagNameMap['textarea']>,\n): React.ReactNode {\n const { labelProps, textAreaProps, descriptionProps, errorMessageProps } =\n useAriaTextArea(properties);\n\n return (\n <>\n <label {...labelProps} />\n <textarea {...textAreaProps} />\n <p className='block w-full' {...descriptionProps} />\n <span className='block w-full text-red-700' {...errorMessageProps} />\n </>\n );\n}\n","import type { Question } from '@kurocado-studio/formkit-ui-models';\nimport { get } from 'lodash-es';\nimport React from 'react';\n\nimport { FormKitInputTextField } from '../controls';\n\nexport function BaseFormKitInputTextFieldNode(properties: {\n question: Question;\n}): React.ReactNode {\n const { question, variant, variants, description } = properties.question;\n const name = get(variants, [variant, 'id'], 'unknown');\n const required = get(variants, [variant, 'required'], false);\n\n return (\n <FormKitInputTextField\n required={required}\n name={name}\n label={question}\n description={description}\n />\n );\n}\n","import { get } from 'lodash-es';\nimport React from 'react';\n\nimport { formKitBaseNodeVariantMap } from '../config/formKitBaseNodeVariantMap';\nimport { VariantEnum } from '../enums';\nimport { FormKitNodeVariantMap, Question } from '../types';\nimport { QuestionNodeRenderer } from './QuestionNodeRenderer';\n\nexport function formRendererComposer(defaultMap: FormKitNodeVariantMap) {\n return function FormRenderer({\n questionNode,\n }: {\n questionNode: Question;\n componentMap?: FormKitNodeVariantMap;\n }) {\n const nodeVariantMap: FormKitNodeVariantMap = {\n [VariantEnum.TEXT]: get(\n defaultMap,\n [VariantEnum.TEXT],\n formKitBaseNodeVariantMap.TEXT,\n ),\n };\n\n return (\n <QuestionNodeRenderer\n questionNode={questionNode}\n componentMap={nodeVariantMap}\n />\n );\n };\n}\n","import { BaseFormKitInputTextFieldNode } from '../components/nodes';\nimport { VariantEnum } from '../enums';\nimport { FormKitNodeVariantMap } from '../types';\n\nexport const formKitBaseNodeVariantMap: FormKitNodeVariantMap = {\n [VariantEnum.TEXT]: BaseFormKitInputTextFieldNode,\n};\n","import { get } from 'lodash-es';\nimport React from 'react';\n\nimport { FormKitNodeVariantMap, Question } from '../types';\n\nfunction DefaultFallback({ node }: { node: Question }) {\n return (\n <div style={{ color: 'gray', fontStyle: 'italic' }}>\n Unsupported node type: {node.variant}\n </div>\n );\n}\n\nexport function QuestionNodeRenderer({\n questionNode,\n componentMap,\n}: {\n questionNode: Question;\n componentMap: FormKitNodeVariantMap;\n}) {\n const Component = get(componentMap, [questionNode.variant], DefaultFallback);\n return <Component node={questionNode} question={questionNode} />;\n}\n","import {\n type Form,\n type FormsNodeTree,\n InputFieldTypeEnum,\n type Question,\n type Section,\n type SectionNodeTree,\n VariantEnum,\n} from '@kurocado-studio/formkit-ui-models';\n\nexport const sampledQuestion1: Question = {\n id: '391a5218-2a40-4652-895b-683e2e25dd96',\n question: 'What’s the name of your form or project?',\n description: 'Who is this description for?',\n hidden: false,\n required: false,\n variant: VariantEnum.TEXT,\n variants: {\n TEXT: {\n id: '10ae5f58-6de4-4aef-999e-d7b9df78056b',\n name: 'unknown',\n type: InputFieldTypeEnum.TEXT,\n required: false,\n },\n },\n name: '4c9107e4-2a29-4460-ab77-648974e2634f',\n};\n\nexport const sampledQuestion2: Question = {\n id: 'c2bb388c-e187-440b-b4d7-092c0be49c6f',\n question: 'Who is this form for?',\n description: 'Who is this description for?',\n hidden: false,\n required: false,\n variant: VariantEnum.TEXT,\n variants: {\n TEXT: {\n id: '01e3f9d0-d4c7-43f4-aa48-2987edcdafea',\n name: 'unknown',\n type: InputFieldTypeEnum.TEXT,\n required: false,\n },\n },\n name: 'e28e40c9-6821-43d7-a018-c81cf3a29dd6',\n};\n\nexport const sampledSection: Section = {\n id: '821efcf2-cc16-4fa3-9ae9-b467738e2c4a',\n title: 'Section 1',\n description: 'This is a section',\n order: 0,\n createdAt: '2025-11-11T16:05:23.351Z',\n updatedAt: '2025-11-11T16:05:23.351Z',\n questions: [sampledQuestion1, sampledQuestion2],\n};\n\nexport const sampledSectionNodeTree: SectionNodeTree = {\n ...sampledSection,\n questions: {\n [sampledQuestion1.id]: sampledQuestion1,\n [sampledQuestion2.id]: sampledQuestion2,\n },\n};\n\nexport const sampledForm: Form = {\n id: '2305e7ed-b583-4ef7-9a4c-2bc094b34894',\n title: 'Welcome to FormKit',\n description:\n 'This short demo introduces how FormKit lets you design and (soon) embed forms dynamically. You can edit any title, description, or question — just click and edit!',\n createdAt: '2025-11-11T16:05:23.351Z',\n updatedAt: '2025-11-11T16:05:23.351Z',\n sections: [sampledSection],\n};\n\nexport const sampledFormsNodeTree: FormsNodeTree = {\n [sampledForm.id]: {\n ...sampledForm,\n sections: {\n [sampledSection.id]: sampledSectionNodeTree,\n },\n },\n};\n","import { VariantEnum } from './enums';\nimport { Form, Question, Section } from './types';\n\nexport const FORMKIT_DEMO_FORM_ID = '2305e7ed-b583-4ef7-9a4c-2bc094b34894';\nexport const FORMKIT_DEMO_LONG_FORM_ID = '2305e7ed-b583-4ef7-9a4c-2bc094b34894';\nexport const FORMKIT_LOGIN_FORM_ID = '5139da7c-5fc2-4140-8041-6caff89990b5';\nexport const FORMKIT_DEMO_SECTION_ID = '821efcf2-cc16-4fa3-9ae9-b467738e2c4a';\nexport const FORMKIT_DEMO_LONG_SECTION_ID =\n '821efcf2-cc16-4fa3-9ae9-b467738e2c4a';\n\nconst createdAt = new Date().toISOString();\nconst updatedAt = new Date().toISOString();\n\nexport const EMPTY_FORM_NODE: Form = {\n createdAt,\n description: '',\n id: '',\n sections: [],\n updatedAt,\n title: '',\n};\n\nexport const EMPTY_SECTION_NODE: Section = {\n createdAt,\n description: 'No description provided',\n id: '',\n order: 0,\n questions: [],\n title: '',\n updatedAt,\n};\n\nexport const EMPTY_QUESTION_NODE: Question = {\n hidden: false,\n id: '',\n question: 'No name provided',\n description: 'No description provided',\n required: false,\n variant: VariantEnum.TEXT,\n variants: {},\n};\n"],"mappings":"AAAO,IAAKA,OACVA,EAAA,KAAO,OADGA,OAAA,IAGAC,OACVA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,SAAW,WAHDA,OAAA,IAMAC,OACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,QAAU,UACVA,EAAA,MAAQ,QACRA,EAAA,IAAM,MACNA,EAAA,IAAM,MACNA,EAAA,OAAS,SAPCA,OAAA,IAUAC,OACVA,EAAA,KAAO,OACPA,EA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AAMD,EAAmB,KACzB,SAAU,EACZ,CACF,EACA,KAAM,sCACR,EAEaI,EAA0B,CACrC,GAAI,uCACJ,MAAO,YACP,YAAa,oBACb,MAAO,EACP,UAAW,2BACX,UAAW,2BACX,UAAW,CAACF,EAAkBC,CAAgB,CAChD,EAEaE,EAA0C,CACrD,GAAGD,EACH,UAAW,CACT,CAACF,EAAiB,EAAE,EAAGA,EACvB,CAACC,EAAiB,EAAE,EAAGA,CACzB,CACF,EAEaG,EAAoB,CAC/B,GAAI,uCACJ,MAAO,qBACP,YACE,0KACF,UAAW,2BACX,UAAW,2BACX,SAAU,CAACF,CAAc,CAC3B,EAEaG,GAAsC,CACjD,CAACD,EAAY,EAAE,EAAG,CAChB,GAAGA,EACH,SAAU,CACR,CAACF,EAAe,EAAE,EAAGC,CACvB,CACF,CACF,EC9EO,IAAMG,GAAuB,uCACvBC,GAA4B,uCAC5BC,GAAwB,uCACxBC,GAA0B,uCAC1BC,GACX,uCAEIC,EAAY,IAAI,KAAK,EAAE,YAAY,EACnCC,EAAY,IAAI,KAAK,EAAE,YAAY,EAE5BC,GAAwB,CACnC,UAAAF,EACA,YAAa,GACb,GAAI,GACJ,SAAU,CAAC,EACX,UAAAC,EACA,MAAO,EACT,EAEaE,GAA8B,CACzC,UAAAH,EACA,YAAa,0BACb,GAAI,GACJ,MAAO,EACP,UAAW,CAAC,EACZ,MAAO,GACP,UAAAC,CACF,EAEaG,GAAgC,CAC3C,OAAQ,GACR,GAAI,GACJ,SAAU,mBACV,YAAa,0BACb,SAAU,GACV,eACA,SAAU,CAAC,CACb","names":["VariantEnum","InputFieldTypeEnum","InputFieldInputModeEnum","InputFieldAutocapitalizeEnum","useAriaTextField","React","FormKitInputTextField","properties","labelProps","inputProps","descriptionProps","errorMessageProps","HtmlForm","React","FormKitForm","properties","useAriaTextArea","React","FormKitInputTextArea","properties","labelProps","textAreaProps","descriptionProps","errorMessageProps","get","React","BaseFormKitInputTextFieldNode","properties","question","variant","variants","description","name","get","required","React","FormKitInputTextField","get","React","formKitBaseNodeVariantMap","BaseFormKitInputTextFieldNode","get","React","DefaultFallback","node","QuestionNodeRenderer","questionNode","componentMap","Component","formRendererComposer","defaultMap","questionNode","nodeVariantMap","get","formKitBaseNodeVariantMap","React","QuestionNodeRenderer","InputFieldTypeEnum","VariantEnum","sampledQuestion1","sampledQuestion2","sampledSection","sampledSectionNodeTree","sampledForm","sampledFormsNodeTree","FORMKIT_DEMO_FORM_ID","FORMKIT_DEMO_LONG_FORM_ID","FORMKIT_LOGIN_FORM_ID","FORMKIT_DEMO_SECTION_ID","FORMKIT_DEMO_LONG_SECTION_ID","createdAt","updatedAt","EMPTY_FORM_NODE","EMPTY_SECTION_NODE","EMPTY_QUESTION_NODE"]}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { AxiosInstance } from 'axios';
2
+ import { AxiosState } from '@kurocado-studio/axios-react';
1
3
  import { HtmlFormProperties } from '@kurocado-studio/web-forms-react';
2
4
  import { default as React_2 } from 'react';
3
5
 
@@ -29,9 +31,32 @@ declare interface Form_2 extends Record<string, unknown> {
29
31
  sections: Array<Section_2>;
30
32
  }
31
33
 
34
+ export declare const FORMKIT_DEMO_FORM_ID = "2305e7ed-b583-4ef7-9a4c-2bc094b34894";
35
+
36
+ export declare const FORMKIT_DEMO_LONG_FORM_ID = "2305e7ed-b583-4ef7-9a4c-2bc094b34894";
37
+
38
+ export declare const FORMKIT_DEMO_LONG_SECTION_ID = "821efcf2-cc16-4fa3-9ae9-b467738e2c4a";
39
+
40
+ export declare const FORMKIT_DEMO_SECTION_ID = "821efcf2-cc16-4fa3-9ae9-b467738e2c4a";
41
+
42
+ export declare const FORMKIT_LOGIN_FORM_ID = "5139da7c-5fc2-4140-8041-6caff89990b5";
43
+
32
44
  export declare const formKitBaseNodeVariantMap: FormKitNodeVariantMap;
33
45
 
34
- export declare function FormKitForm<T extends Record<string, unknown>>(properties: HtmlFormProperties<T>): React_2.ReactNode;
46
+ export declare interface FormKitConsumerFormProperties<T extends Record<string, unknown> = Record<string, unknown>> extends Omit<FormKitFormProperties<T>, 'children'> {
47
+ organizationId: string;
48
+ formId: string;
49
+ children: (properties: FormKitConsumerFormRenderProperties) => React_2.ReactNode;
50
+ }
51
+
52
+ declare interface FormKitConsumerFormRenderProperties {
53
+ question: Question;
54
+ indexInCollection: number;
55
+ }
56
+
57
+ export declare function FormKitForm<T extends Record<string, unknown>>(properties: FormKitFormProperties<T>): React_2.ReactNode;
58
+
59
+ export declare type FormKitFormProperties<T extends Record<string, unknown> = Record<string, unknown>> = HtmlFormProperties<T>;
35
60
 
36
61
  export declare function FormKitInputTextArea(properties: {
37
62
  name: string;
@@ -58,6 +83,11 @@ declare type FormsNodeTree = Record<string, Omit<Form_2, 'sections'> & {
58
83
  sections: Record<string, SectionNodeTree>;
59
84
  }>;
60
85
 
86
+ export declare type GetFormByIdHandler = (payload: {
87
+ organizationId: string;
88
+ formId: string;
89
+ }) => Promise<Form>;
90
+
61
91
  export declare enum InputFieldAutocapitalizeEnum {
62
92
  NONE = "none",
63
93
  SENTENCES = "sentences",
@@ -104,18 +134,6 @@ declare enum InputFieldTypeEnum_2 {
104
134
  PASSWORD = "password"
105
135
  }
106
136
 
107
- export declare const KUROCADO_STUDIO_DEMO_FORM_ID = "2305e7ed-b583-4ef7-9a4c-2bc094b34894";
108
-
109
- export declare const KUROCADO_STUDIO_DEMO_LONG_FORM_ID = "2305e7ed-b583-4ef7-9a4c-2bc094b34894";
110
-
111
- export declare const KUROCADO_STUDIO_DEMO_LONG_SECTION_ID = "821efcf2-cc16-4fa3-9ae9-b467738e2c4a";
112
-
113
- export declare const KUROCADO_STUDIO_DEMO_SECTION_ID = "821efcf2-cc16-4fa3-9ae9-b467738e2c4a";
114
-
115
- export declare const KUROCADO_STUDIO_LOGIN_FORM_ID = "5139da7c-5fc2-4140-8041-6caff89990b5";
116
-
117
- export declare const KUROCADO_STUDIO_ORGANIZATION_ID_FORMKIT = "05bc858a-f333-4dab-9e24-fb41b1b7468e";
118
-
119
137
  export declare interface Question extends Record<string, unknown> {
120
138
  id: string;
121
139
  question: string;
@@ -236,6 +254,20 @@ declare interface TextFieldQuestionNode_2 extends Record<string, unknown> {
236
254
 
237
255
  export declare type Theme = Record<string, Record<string, unknown>>;
238
256
 
257
+ export declare type UseGetFormKitFormById = (payload?: {
258
+ axiosInstance?: AxiosInstance;
259
+ onSuccessCallBack?: (payload: {
260
+ form: Form;
261
+ }) => void;
262
+ onErrorCallBack?: (payload: {
263
+ error: unknown;
264
+ fallbackEmptyForm: Form;
265
+ }) => void;
266
+ }) => [
267
+ formKitFormByIdState: AxiosState<Form>,
268
+ handleGetFormById: GetFormByIdHandler
269
+ ];
270
+
239
271
  export declare interface VariantCreatorDto<T extends VariantEnum = VariantEnum.TEXT> {
240
272
  variantPayload: Record<string, unknown>;
241
273
  variantType: T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kurocado-studio/formkit-ui-react-renderer",
3
- "version": "1.0.0-develop.3",
3
+ "version": "1.0.0-develop.6",
4
4
  "sideEffects": false,
5
5
  "keywords": [],
6
6
  "author": "@kurocado-studio",
@@ -10,7 +10,7 @@
10
10
  "types": "./dist/index.d.ts",
11
11
  "type": "module",
12
12
  "publishConfig": {
13
- "access": "restricted"
13
+ "access": "public"
14
14
  },
15
15
  "exports": {
16
16
  ".": {
@@ -34,8 +34,10 @@
34
34
  "typecheck": "tsc --noEmit --pretty"
35
35
  },
36
36
  "dependencies": {
37
+ "@kurocado-studio/axios-react": "^1.0.2",
37
38
  "@kurocado-studio/systemhaus-react": "1.1.0-develop.12",
38
39
  "@kurocado-studio/web-forms-react": "1.1.0-develop.1",
40
+ "axios": "^1.13.2",
39
41
  "lodash-es": "^4.17.21",
40
42
  "react": "19",
41
43
  "uuid": "^13.0.0"