@kurocado-studio/formkit-ui-react-renderer 1.0.0-develop.1

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/README.md ADDED
@@ -0,0 +1 @@
1
+ Kurocado Studio Design System components
@@ -0,0 +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 A}from"@kurocado-studio/web-forms-react";import q from"react";function k(e){return q.createElement(A,{...e})}import{useAriaTextArea as g}from"@kurocado-studio/web-forms-react";import s from"react";function Z(e){let{labelProps:t,textAreaProps:r,descriptionProps:o,errorMessageProps:i}=g(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 h from"react";function N(e){let{question:t,variant:r,variants:o,description:i}=e.question,M=x(o,[r,"id"],"unknown"),K=x(o,[r,"required"],!1);return h.createElement(u,{required:K,name:M,label:t,description:i})}import{get as Q}from"lodash-es";var O={TEXT:N};import{get as y}from"lodash-es";function C({node:e}){return React.createElement("div",{style:{color:"gray",fontStyle:"italic"}},"Unsupported node type: ",e.variant)}function b({questionNode:e,componentMap:t}){let r=y(t,[e.variant],C);return React.createElement(r,{node:e,question:e})}function ne(e){return function({questionNode:r}){let o={TEXT:Q(e,["TEXT"],O.TEXT)};return React.createElement(b,{questionNode:r,componentMap:o})}}import{InputFieldTypeEnum as _,VariantEnum as D}from"@kurocado-studio/formkit-ui-models";var d={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:D.TEXT,variants:{TEXT:{id:"10ae5f58-6de4-4aef-999e-d7b9df78056b",name:"unknown",type:_.TEXT,required:!1}},name:"4c9107e4-2a29-4460-ab77-648974e2634f"},m={id:"c2bb388c-e187-440b-b4d7-092c0be49c6f",question:"Who is this form for?",description:"Who is this description for?",hidden:!1,required:!1,variant:D.TEXT,variants:{TEXT:{id:"01e3f9d0-d4c7-43f4-aa48-2987edcdafea",name:"unknown",type:_.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:[d,m]},P={...p,questions:{[d.id]:d,[m.id]:m}},E={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]},de={[E.id]:{...E,sections:{[p.id]:P}}};var pe="05bc858a-f333-4dab-9e24-fb41b1b7468e",ce="2305e7ed-b583-4ef7-9a4c-2bc094b34894",fe="2305e7ed-b583-4ef7-9a4c-2bc094b34894",Te="5139da7c-5fc2-4140-8041-6caff89990b5",le="821efcf2-cc16-4fa3-9ae9-b467738e2c4a",ue="821efcf2-cc16-4fa3-9ae9-b467738e2c4a",S=new Date().toISOString(),F=new Date().toISOString(),xe={createdAt:S,description:"",id:"",sections:[],updatedAt:F,title:""},Ne={createdAt:S,description:"No description provided",id:"",order:0,questions:[],title:"",updatedAt:F},Oe={hidden:!1,id:"",question:"No name provided",description:"No description provided",required:!1,variant:"TEXT",variants:{}};export{N as BaseFormKitInputTextFieldNode,xe as EMPTY_FORM_NODE,Oe as EMPTY_QUESTION_NODE,Ne as EMPTY_SECTION_NODE,k as FormKitForm,Z as FormKitInputTextArea,u as FormKitInputTextField,l as InputFieldAutocapitalizeEnum,T as InputFieldInputModeEnum,f as InputFieldTypeEnum,ce as KUROCADO_STUDIO_DEMO_FORM_ID,fe as KUROCADO_STUDIO_DEMO_LONG_FORM_ID,ue as KUROCADO_STUDIO_DEMO_LONG_SECTION_ID,le as KUROCADO_STUDIO_DEMO_SECTION_ID,Te as KUROCADO_STUDIO_LOGIN_FORM_ID,pe as KUROCADO_STUDIO_ORGANIZATION_ID_FORMKIT,c as VariantEnum,O as formKitBaseNodeVariantMap,ne as formRendererComposer,E as sampledForm,de as sampledFormsNodeTree,d as sampledQuestion1,m as sampledQuestion2,p as sampledSection,P as sampledSectionNodeTree};
2
+ //# sourceMappingURL=exports.js.map
@@ -0,0 +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';\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';\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,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O,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,GACX,uCAEWC,GACX,uCAEWC,GACX,uCAEWC,GACX,uCAEWC,GACX,uCAEWC,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","formKitBaseNodeVariantMap","BaseFormKitInputTextFieldNode","get","DefaultFallback","node","QuestionNodeRenderer","questionNode","componentMap","Component","formRendererComposer","defaultMap","questionNode","nodeVariantMap","get","formKitBaseNodeVariantMap","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"]}
@@ -0,0 +1,264 @@
1
+ import { HtmlFormProperties } from '@kurocado-studio/web-forms-react';
2
+ import * as React_2 from 'react';
3
+ import React__default from 'react';
4
+
5
+ export declare function BaseFormKitInputTextFieldNode(properties: {
6
+ question: Question_2;
7
+ }): React__default.ReactNode;
8
+
9
+ export declare const EMPTY_FORM_NODE: Form;
10
+
11
+ export declare const EMPTY_QUESTION_NODE: Question;
12
+
13
+ export declare const EMPTY_SECTION_NODE: Section;
14
+
15
+ export declare interface Form extends Record<string, unknown> {
16
+ id: string;
17
+ title: string;
18
+ description?: string;
19
+ createdAt: string;
20
+ updatedAt: string;
21
+ sections: Array<Section>;
22
+ }
23
+
24
+ declare interface Form_2 extends Record<string, unknown> {
25
+ id: string;
26
+ title: string;
27
+ description?: string;
28
+ createdAt: string;
29
+ updatedAt: string;
30
+ sections: Array<Section_2>;
31
+ }
32
+
33
+ export declare const formKitBaseNodeVariantMap: FormKitNodeVariantMap;
34
+
35
+ export declare function FormKitForm<T extends Record<string, unknown>>(properties: HtmlFormProperties<T>): React__default.ReactNode;
36
+
37
+ export declare function FormKitInputTextArea(properties: {
38
+ name: string;
39
+ } & Partial<HTMLElementTagNameMap['textarea']>): React__default.ReactNode;
40
+
41
+ export declare function FormKitInputTextField(properties: {
42
+ name: string;
43
+ label?: string;
44
+ description?: string;
45
+ } & Partial<HTMLElementTagNameMap['input']>): React__default.ReactNode;
46
+
47
+ export declare type FormKitNodeVariantMap = {
48
+ [VariantEnum.TEXT]: React__default.FC<{
49
+ question: Question;
50
+ }>;
51
+ };
52
+
53
+ export declare function formRendererComposer(defaultMap: FormKitNodeVariantMap): ({ questionNode, }: {
54
+ questionNode: Question;
55
+ componentMap?: FormKitNodeVariantMap | undefined;
56
+ }) => React_2.JSX.Element;
57
+
58
+ declare type FormsNodeTree = Record<string, Omit<Form_2, 'sections'> & {
59
+ sections: Record<string, SectionNodeTree>;
60
+ }>;
61
+
62
+ export declare enum InputFieldAutocapitalizeEnum {
63
+ NONE = "none",
64
+ SENTENCES = "sentences",
65
+ WORDS = "words",
66
+ CHARACTERS = "characters"
67
+ }
68
+
69
+ declare enum InputFieldAutocapitalizeEnum_2 {
70
+ NONE = "none",
71
+ SENTENCES = "sentences",
72
+ WORDS = "words",
73
+ CHARACTERS = "characters"
74
+ }
75
+
76
+ export declare enum InputFieldInputModeEnum {
77
+ TEXT = "text",
78
+ NUMERIC = "numeric",
79
+ DECIMAL = "decimal",
80
+ EMAIL = "email",
81
+ TEL = "tel",
82
+ URL = "url",
83
+ SEARCH = "search"
84
+ }
85
+
86
+ declare enum InputFieldInputModeEnum_2 {
87
+ TEXT = "text",
88
+ NUMERIC = "numeric",
89
+ DECIMAL = "decimal",
90
+ EMAIL = "email",
91
+ TEL = "tel",
92
+ URL = "url",
93
+ SEARCH = "search"
94
+ }
95
+
96
+ export declare enum InputFieldTypeEnum {
97
+ TEXT = "text",
98
+ EMAIL = "email",
99
+ PASSWORD = "password"
100
+ }
101
+
102
+ declare enum InputFieldTypeEnum_2 {
103
+ TEXT = "text",
104
+ EMAIL = "email",
105
+ PASSWORD = "password"
106
+ }
107
+
108
+ export declare const KUROCADO_STUDIO_DEMO_FORM_ID = "2305e7ed-b583-4ef7-9a4c-2bc094b34894";
109
+
110
+ export declare const KUROCADO_STUDIO_DEMO_LONG_FORM_ID = "2305e7ed-b583-4ef7-9a4c-2bc094b34894";
111
+
112
+ export declare const KUROCADO_STUDIO_DEMO_LONG_SECTION_ID = "821efcf2-cc16-4fa3-9ae9-b467738e2c4a";
113
+
114
+ export declare const KUROCADO_STUDIO_DEMO_SECTION_ID = "821efcf2-cc16-4fa3-9ae9-b467738e2c4a";
115
+
116
+ export declare const KUROCADO_STUDIO_LOGIN_FORM_ID = "5139da7c-5fc2-4140-8041-6caff89990b5";
117
+
118
+ export declare const KUROCADO_STUDIO_ORGANIZATION_ID_FORMKIT = "05bc858a-f333-4dab-9e24-fb41b1b7468e";
119
+
120
+ export declare interface Question extends Record<string, unknown> {
121
+ id: string;
122
+ question: string;
123
+ description: string;
124
+ hint?: string;
125
+ tooltip?: string;
126
+ name?: string;
127
+ hidden: boolean;
128
+ required: boolean;
129
+ variant: VariantEnum;
130
+ variants: VariantMap;
131
+ }
132
+
133
+ declare interface Question_2 extends Record<string, unknown> {
134
+ id: string;
135
+ question: string;
136
+ description: string;
137
+ hint?: string;
138
+ tooltip?: string;
139
+ name?: string;
140
+ hidden: boolean;
141
+ required: boolean;
142
+ variant: VariantEnum_2;
143
+ variants: VariantMap_2;
144
+ }
145
+
146
+ export declare interface QuestionCreatorDto {
147
+ hidden: boolean;
148
+ hint?: string;
149
+ name: string;
150
+ question: string;
151
+ description: string;
152
+ required: boolean;
153
+ tooltip?: string;
154
+ variant: VariantEnum;
155
+ }
156
+
157
+ export declare interface QuestionCreatorPayload<T extends VariantEnum = VariantEnum.TEXT> {
158
+ question: QuestionCreatorDto;
159
+ variant: VariantCreatorDto<T>;
160
+ }
161
+
162
+ export declare const sampledForm: Form_2;
163
+
164
+ export declare const sampledFormsNodeTree: FormsNodeTree;
165
+
166
+ export declare const sampledQuestion1: Question_2;
167
+
168
+ export declare const sampledQuestion2: Question_2;
169
+
170
+ export declare const sampledSection: Section_2;
171
+
172
+ export declare const sampledSectionNodeTree: SectionNodeTree;
173
+
174
+ export declare interface Section extends Record<string, unknown> {
175
+ id: string;
176
+ title: string;
177
+ description?: string;
178
+ order: number;
179
+ createdAt: string;
180
+ updatedAt: string;
181
+ questions: Array<Question>;
182
+ }
183
+
184
+ declare interface Section_2 extends Record<string, unknown> {
185
+ id: string;
186
+ title: string;
187
+ description?: string;
188
+ order: number;
189
+ createdAt: string;
190
+ updatedAt: string;
191
+ questions: Array<Question_2>;
192
+ }
193
+
194
+ declare interface SectionNodeTree extends Omit<Section_2, 'questions'> {
195
+ questions: {
196
+ [questionId: string]: Question_2;
197
+ };
198
+ }
199
+
200
+ export declare interface TextFieldQuestionNode extends Record<string, unknown> {
201
+ id: string;
202
+ name: string;
203
+ type: InputFieldTypeEnum;
204
+ value?: string;
205
+ defaultValue?: string;
206
+ required?: boolean;
207
+ disabled?: boolean;
208
+ readonly?: boolean;
209
+ placeholder?: string;
210
+ autocomplete?: string;
211
+ autocapitalize?: InputFieldAutocapitalizeEnum;
212
+ spellcheck?: boolean;
213
+ inputmode?: InputFieldInputModeEnum;
214
+ minLength?: number;
215
+ maxLength?: number;
216
+ pattern?: string;
217
+ }
218
+
219
+ declare interface TextFieldQuestionNode_2 extends Record<string, unknown> {
220
+ id: string;
221
+ name: string;
222
+ type: InputFieldTypeEnum_2;
223
+ value?: string;
224
+ defaultValue?: string;
225
+ required?: boolean;
226
+ disabled?: boolean;
227
+ readonly?: boolean;
228
+ placeholder?: string;
229
+ autocomplete?: string;
230
+ autocapitalize?: InputFieldAutocapitalizeEnum_2;
231
+ spellcheck?: boolean;
232
+ inputmode?: InputFieldInputModeEnum_2;
233
+ minLength?: number;
234
+ maxLength?: number;
235
+ pattern?: string;
236
+ }
237
+
238
+ export declare type Theme = Record<string, Record<string, unknown>>;
239
+
240
+ export declare interface VariantCreatorDto<T extends VariantEnum = VariantEnum.TEXT> {
241
+ variantPayload: Record<string, unknown>;
242
+ variantType: T;
243
+ }
244
+
245
+ export declare enum VariantEnum {
246
+ TEXT = "TEXT"
247
+ }
248
+
249
+ declare enum VariantEnum_2 {
250
+ TEXT = "TEXT"
251
+ }
252
+
253
+ export declare type VariantMap = {
254
+ [VariantEnum.TEXT]?: TextFieldQuestionNode;
255
+ };
256
+
257
+ declare type VariantMap_2 = {
258
+ [VariantEnum_2.TEXT]?: TextFieldQuestionNode_2;
259
+ };
260
+
261
+
262
+ export * from "@kurocado-studio/web-forms-react";
263
+
264
+ export { }
@@ -0,0 +1,11 @@
1
+ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
+ // It should be published with your NPM package. It should not be tracked by Git.
3
+ {
4
+ "tsdocVersion": "0.12",
5
+ "toolPackages": [
6
+ {
7
+ "packageName": "@microsoft/api-extractor",
8
+ "packageVersion": "7.54.0"
9
+ }
10
+ ]
11
+ }
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@kurocado-studio/formkit-ui-react-renderer",
3
+ "version": "1.0.0-develop.1",
4
+ "sideEffects": false,
5
+ "keywords": [],
6
+ "author": "@kurocado-studio",
7
+ "license": "MIT",
8
+ "main": "./dist/exports.js",
9
+ "module": "./dist/exports.js",
10
+ "types": "./dist/index.d.ts",
11
+ "type": "module",
12
+ "publishConfig": {
13
+ "access": "restricted"
14
+ },
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/exports.js"
19
+ }
20
+ },
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "scripts": {
25
+ "build:typings": "api-extractor run --local",
26
+ "build": "tsup && pnpm build:typings && rm -rf dist/exports.d.ts",
27
+ "prepublishOnly": "node ../../scripts/strip-workspaces.js .",
28
+ "clean": "rm -rf .turbo node_modules dist",
29
+ "dev": "rm -rf dist && tsup --watch --dts",
30
+ "lint": "eslint --max-warnings=0 . --no-warn-ignored",
31
+ "lint:fix": "eslint --max-warnings=0 . --fix --no-warn-ignored",
32
+ "prettier:check": "prettier --check . --ignore-path ../../.prettierignore",
33
+ "prettier:fix": "prettier --check . --write --ignore-path ../../.prettierignore",
34
+ "typecheck": "tsc --noEmit --pretty"
35
+ },
36
+ "dependencies": {
37
+ "@kurocado-studio/systemhaus-react": "1.1.0-develop.12",
38
+ "@kurocado-studio/web-forms-react": "1.1.0-develop.1",
39
+ "lodash-es": "^4.17.21",
40
+ "react": "19",
41
+ "uuid": "^13.0.0"
42
+ },
43
+ "devDependencies": {
44
+ "@internal/config": "workspace:*",
45
+ "@microsoft/api-extractor": "^7.52.11",
46
+ "@types/lodash-es": "^4.17.12",
47
+ "@types/node": "^22.15.19",
48
+ "@types/react": "^19.1.10",
49
+ "@types/react-dom": "^19.1.4",
50
+ "eslint": "^9.28.0",
51
+ "postcss": "^8.5.6",
52
+ "prettier": "3.5.3",
53
+ "semantic-release": "^24.2.3",
54
+ "semantic-release-monorepo": "^8.0.2",
55
+ "tsup": "^8.5.0",
56
+ "typescript": "5.1.6"
57
+ }
58
+ }