UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

8 lines (7 loc) 8.91 kB
import{r as e,un as t}from"./ErrorBlock-CuwX01Wv.js";import{C as n,D as r,F as i,N as a,m as o,s}from"./web-BWdORzMO.js";import{o as c,t as l}from"./Layout-4UKP18vE.js";import{A as u,D as d,d as f,f as p,ft as m,i as h,k as g,lt as _,m as v,mt as y,pt as b,r as x,u as S}from"./Form-Cbz3dIAq.js";import{n as C,t as w}from"./Standard-D4PJGqo4.js";import"./Headers-CX-ZCzBz.js";var T=o(`<div style=padding:20px><h2>Dynamic Component Loading Test</h2><p>This route demonstrates runtime plugin loading for future component plugin support.`),E=o(`<div>Loading plugin...`),D=o(`<div>Failed to load plugin`);function O(){let[e]=a(async()=>(await m(()=>import(`${window.location.origin}/lucid/plugins/test-component.js`),[])).default);return(()=>{var t=T();return t.firstChild.nextSibling,s(t,r(n,{get fallback(){return E()},get children(){return(()=>{let t=e();return t?r(t,{message:`Props work correctly!`}):D()})()}}),null),t})()}var k=o(`<div class="flex gap-2 flex-wrap">`),A=o(`<div class=space-y-4>`),j=o(`<div class="flex flex-col gap-2">`),M=()=>{let[n,a]=i(`Sample text`),[o,m]=i(`example@email.com`),[T,E]=i(`password123`),[D,M]=i(`42`),[N,P]=i(`This is a sample textarea content. It supports multiple lines.`),[F,I]=i(!1),[L,R]=i(`option1`),z=[{value:`option1`,label:`Option 1`},{value:`option2`,label:`Option 2`},{value:`option3`,label:`Option 3`},{value:`option4`,label:`Option 4`}],[B,V]=i([{value:`option1`,label:`Option 1`},{value:`option2`,label:`Option 2`}]),H=[{value:`option1`,label:`Option 1`},{value:`option2`,label:`Option 2`},{value:`option3`,label:`Option 3`},{value:`option4`,label:`Option 4`},{value:`option5`,label:`Option 5`}],[U,W]=i(`#3b82f6`),G=[`#ef4444`,`#f97316`,`#eab308`,`#22c55e`,`#3b82f6`,`#8b5cf6`,`#ec4899`],[K,q]=i(!0),[J,Y]=i(`{ "name": "John Doe", "age": 30, "email": "john@example.com", "hobbies": ["reading", "coding", "gaming"] }`),[X,Z]=i(``),[Q,$]=i({option1:!0,option2:!1,option3:!0}),[ee,te]=i({type:`doc`,content:[{type:`paragraph`,content:[{type:`text`,text:`This is rich text content with formatting.`}]}]});return r(l,{get slots(){return{header:r(w,{copy:{title:`Components`,description:`A simple list of components for testing purposes`}})}},get children(){return r(c,{options:{padding:`24`},get children(){return[r(C.Root,{title:`Buttons`,description:`All of the available buttons`,get children(){return[r(C.Content,{title:`Medium Buttons`,get children(){var t=k();return s(t,r(e,{size:`medium`,theme:`primary`,type:`button`,loading:!1,children:`Primary`}),null),s(t,r(e,{size:`medium`,theme:`secondary`,type:`button`,loading:!1,children:`Secondary`}),null),s(t,r(e,{size:`medium`,theme:`border-outline`,type:`button`,loading:!1,children:`Border Outline`}),null),s(t,r(e,{size:`medium`,theme:`danger`,type:`button`,loading:!1,children:`Danger`}),null),s(t,r(e,{size:`medium`,theme:`basic`,type:`button`,loading:!1,children:`Basic`}),null),s(t,r(e,{size:`medium`,theme:`secondary-toggle`,type:`button`,loading:!1,children:`Secondary Toggle`}),null),s(t,r(e,{size:`medium`,theme:`danger-outline`,type:`button`,loading:!1,children:`Danger Outline`}),null),t}}),r(C.Content,{title:`Icon Buttons`,get children(){var n=k();return s(n,r(e,{type:`button`,theme:`primary`,size:`icon`,get children(){return r(t,{})}}),null),s(n,r(e,{type:`button`,theme:`secondary`,size:`icon`,get children(){return r(t,{})}}),null),s(n,r(e,{type:`button`,theme:`border-outline`,size:`icon`,get children(){return r(t,{})}}),null),s(n,r(e,{type:`button`,theme:`danger`,size:`icon`,get children(){return r(t,{})}}),null),s(n,r(e,{type:`button`,theme:`basic`,size:`icon`,get children(){return r(t,{})}}),null),s(n,r(e,{type:`button`,theme:`secondary-toggle`,size:`icon`,get children(){return r(t,{})}}),null),s(n,r(e,{type:`button`,theme:`danger-outline`,size:`icon`,get children(){return r(t,{})}}),null),n}})]}}),r(C.Root,{title:`Input Fields`,description:`Various input field types with basic and full themes`,get children(){return[r(C.Content,{title:`Text Input`,get children(){var e=A();return s(e,r(u,{id:`text-input-basic`,get value(){return n()},onChange:a,type:`text`,name:`text-input-basic`,copy:{label:`Basic Theme`,placeholder:`Enter some text...`}}),null),s(e,r(g,{id:`text-input-full`,get value(){return n()},onChange:a,type:`text`,name:`text-input-full`,copy:{label:`Full Theme`,placeholder:`Enter some text...`}}),null),e}}),r(C.Content,{title:`Email Input`,get children(){var e=A();return s(e,r(u,{id:`email-input-basic`,get value(){return o()},onChange:m,type:`email`,name:`email-input-basic`,copy:{label:`Basic Theme`,placeholder:`Enter email address...`}}),null),s(e,r(g,{id:`email-input-full`,get value(){return o()},onChange:m,type:`email`,name:`email-input-full`,copy:{label:`Full Theme`,placeholder:`Enter email address...`}}),null),e}}),r(C.Content,{title:`Password Input`,get children(){var e=A();return s(e,r(u,{id:`password-input-basic`,get value(){return T()},onChange:E,type:`password`,name:`password-input-basic`,copy:{label:`Basic Theme`,placeholder:`Enter password...`}}),null),s(e,r(g,{id:`password-input-full`,get value(){return T()},onChange:E,type:`password`,name:`password-input-full`,copy:{label:`Full Theme`,placeholder:`Enter password...`}}),null),e}}),r(C.Content,{title:`Number Input`,get children(){return r(u,{id:`number-input-basic`,get value(){return D()},onChange:M,type:`number`,name:`number-input-basic`,copy:{label:`Basic Theme`,placeholder:`Enter a number...`}})}})]}}),r(C.Root,{title:`Textarea`,description:`Multi-line text input`,get children(){return r(C.Content,{title:`Textarea`,get children(){return r(x,{id:`textarea`,get value(){return N()},onChange:P,name:`textarea`,copy:{label:`Textarea`,placeholder:`Enter multi-line text...`}})}})}}),r(C.Root,{title:`Switch`,description:`Toggle switch component`,get children(){return r(C.Content,{title:`Basic Switch`,get children(){return r(h,{id:`switch`,get value(){return F()},onChange:I,name:`switch`,copy:{label:`Enable Feature`,true:`On`,false:`Off`}})}})}}),r(C.Root,{title:`Select`,description:`Single selection dropdown`,get children(){return r(C.Content,{title:`Select`,get children(){var e=A();return s(e,r(f,{id:`select`,get value(){return L()},onChange:R,options:z,name:`select`,copy:{label:`Regular Size`}}),null),s(e,r(f,{id:`select-small`,get value(){return L()},onChange:R,options:z,name:`select-small`,copy:{label:`Small Size`},small:!0}),null),e}})}}),r(C.Root,{title:`Select Multiple`,description:`Multiple selection dropdown`,get children(){return r(C.Content,{title:`Select Multiple`,get children(){return r(S,{id:`select-multiple`,get values(){return B()},onChange:V,options:H,name:`select-multiple`,copy:{label:`Choose multiple options`}})}})}}),r(C.Root,{title:`Color Picker`,description:`Color input with presets`,get children(){return r(C.Content,{title:`Color Input`,get children(){return r(_,{id:`color`,get value(){return U()},onChange:W,name:`color`,copy:{label:`Choose a color`},presets:G})}})}}),r(C.Root,{title:`Checkbox`,description:`Single checkbox input`,get children(){return r(C.Content,{title:`Checkbox`,get children(){return r(y,{id:`checkbox`,get value(){return K()},onChange:q,name:`checkbox`,copy:{label:`Accept terms and conditions`}})}})}}),r(C.Root,{title:`JSON Textarea`,description:`Textarea with JSON validation`,get children(){return r(C.Content,{title:`JSON Textarea`,get children(){return r(d,{id:`json-textarea`,get value(){return J()},onChange:Y,name:`json-textarea`,copy:{label:`JSON Content`,placeholder:`Enter valid JSON...`}})}})}}),r(C.Root,{title:`Search`,description:`Search input with loading state`,get children(){return r(C.Content,{title:`Basic Search`,get children(){return r(p,{get value(){return X()},onChange:Z,isLoading:!1})}})}}),r(C.Root,{title:`Checkbox Buttons`,description:`Button-style checkboxes`,get children(){return r(C.Content,{title:`Checkbox Buttons`,get children(){var e=j();return s(e,r(b,{id:`checkbox-btn-1`,get value(){return Q().option1},onChange:e=>$(t=>({...t,option1:e})),name:`checkbox-btn-1`,copy:{label:`Primary Option (selected)`},theme:`primary`}),null),s(e,r(b,{id:`checkbox-btn-2`,get value(){return Q().option2},onChange:e=>$(t=>({...t,option2:e})),name:`checkbox-btn-2`,copy:{label:`Primary Option (not selected)`},theme:`primary`}),null),s(e,r(b,{id:`checkbox-btn-3`,get value(){return Q().option3},onChange:e=>$(t=>({...t,option3:e})),name:`checkbox-btn-3`,copy:{label:`Error Option`},theme:`error`}),null),e}})}}),r(C.Root,{title:`Rich Text Editor`,description:`Rich text editor with formatting toolbar`,get children(){return r(C.Content,{title:`Rich Text Editor`,get children(){return r(v,{id:`rich-text`,get value(){return ee()},onChange:te,copy:{label:`Content Editor`,placeholder:`Start writing...`}})}})}}),r(C.Root,{title:`Dynamic Plugin`,description:`A proof of concept for dynamic component plugin loading`,get children(){return r(O,{})}})]}})}})};export{M as default};