@@ -21,7 +21,7 @@ Every application should include these files in the following order:
2121 - components/tags/tags.css
22223 . bespoke-template.css (template-specific layout, utilities, temporary
2323 components)
24- 4 . help- modal. js (help system)
24+ 4 . components/ modal/modal.css and modal. js (design system; used for help modal )
25255 . app.js (application logic)
26266 . server.js (server)
2727
@@ -79,15 +79,8 @@ Every application should include these files in the following order:
7979
80801 . HELP MODAL SETUP:
8181 a) Create help content using help-content-template.html as reference
82- b) Initialize HelpModal with:
83- - triggerSelector: ` '#btn-help' `
84- - content: your help content (string or loaded from file)
85- - theme: ` 'auto' `
86-
87- 2 . STATUS MANAGEMENT:
88- a) Use the provided setStatus() function for status updates
89- b) Update status for: loading, saving, errors, user actions
90- c) Keep status messages concise and informative
82+ b) Use the design system Modal: ` Modal.createHelpModal({ title: 'Help', content, triggerSelector: '#btn-help' }) `
83+ c) Include ` modal.css ` and import ` Modal ` from ` design-system/components/modal/modal.js `
9184
9285## Error Handling Requirements
9386
@@ -98,18 +91,6 @@ Every application should include these files in the following order:
98915 . HANDLE localStorage quota exceeded errors
99926 . VALIDATE data before saving operations
10093
101- ## Status Message Conventions
102-
103- Use these EXACT status messages for consistency:
104-
105- - "Ready" - Application loaded successfully
106- - "Loading..." - Data is being loaded
107- - "Saving..." - Data is being saved
108- - "Changes saved" - Auto-save completed successfully
109- - "Save failed (will retry)" - Server save failed, will retry
110- - "Failed to load data" - Data loading failed
111- - "Auto-save initialized" - Auto-save system started
112-
11394## File Naming Conventions
11495
115961 . CSS files: kebab-case (e.g., my-app.css, task-manager.css)
@@ -155,7 +136,6 @@ when the design system adds them.
155136<div class =" bespoke" >
156137 <header class =" header" >
157138 <h1 >My App</h1 >
158- <div class =" status" >Ready</div >
159139 <button class =" button button-text" >Help</button >
160140 </header >
161141
@@ -188,7 +168,6 @@ when the design system adds them.
188168``` html
189169<header class =" header" >
190170 <h1 >App Title</h1 >
191- <div class =" status" >Status message</div >
192171 <button class =" button button-text" >Help</button >
193172</header >
194173```
@@ -223,13 +202,7 @@ when the design system adds them.
223202``` html
224203<!-- Vertical label -->
225204<label >Field Name
226- <input type =" text" />
227- </label >
228-
229- <!-- Horizontal label -->
230- <label class =" row" >
231- <input type =" checkbox" />
232- Checkbox Label
205+ <input type =" text" class =" input" />
233206</label >
234207```
235208
@@ -239,49 +212,41 @@ when the design system adds them.
239212<!-- Text input -->
240213<input type =" text" class =" input" placeholder =" Enter text" />
241214
242- <!-- Select dropdown -->
215+ <!-- Select dropdown - native select styling is custom; design system has a Dropdown JS component for richer dropdowns - ->
243216<select class =" input" >
244217 <option >Option 1</option >
245218 <option >Option 2</option >
246219</select >
247220
248- <!-- Checkbox -->
249- <input type =" checkbox" />
250-
251- <!-- Radio buttons -->
252- <div class =" radio-group" >
253- <label class =" row" >
254- <input type =" radio" name =" option" value =" a" />
255- Option A
256- </label >
257- <label class =" row" >
258- <input type =" radio" name =" option" value =" b" />
259- Option B
260- </label >
261- </div >
221+ <!-- Checkbox (design system component) -->
222+ <label class =" input-checkbox" >
223+ <input type =" checkbox" />
224+ <span class =" input-checkbox-box" ><span class =" input-checkbox-checkmark" ></span ></span >
225+ <span class =" input-checkbox-label" >Checkbox Label</span >
226+ </label >
262227
263- <!-- Horizontal radio group -->
264- <div class =" radio-group horizontal " >
265- <label class = " row " >
266- < input type = " radio" name = " size " value = " small " / >
267- Small
268- </label >
269- <label class =" row " >
270- <input type =" radio" name =" size " value =" large " />
271- Large
272- </ label >
273- </div >
228+ <!-- Radio buttons (design system component) -->
229+ <label class =" input-radio " >
230+ <input type = " radio " name = " option " value = " a " / >
231+ < span class = " input- radio-circle " >< span class = " input-radio-dot " ></ span ></ span >
232+ < span class = " input-radio-label " >Option A</ span >
233+ </label >
234+ <label class =" input-radio " >
235+ <input type =" radio" name =" option " value =" b " />
236+ < span class = " input-radio-circle " >< span class = " input-radio-dot " ></ span ></ span >
237+ <span class = " input-radio- label" >Option B</ span >
238+ </label >
274239
275240<!-- Textarea -->
276- <textarea placeholder =" Enter your message here..." ></textarea >
241+ <textarea class = " input " placeholder =" Enter your message here..." ></textarea >
277242
278- <!-- Toggle switch -->
243+ <!-- Toggle switch - custom component; no design system equivalent yet. Add body-xsmall for typography - ->
279244<label class =" row" >
280245 <div class =" toggle" >
281246 <input type =" checkbox" class =" toggle-input" />
282247 <span class =" toggle-slider" ></span >
283248 </div >
284- <span class =" toggle-label" >Enable notifications</span >
249+ <span class =" toggle-label body-xsmall " >Enable notifications</span >
285250</label >
286251```
287252
@@ -300,83 +265,26 @@ when the design system adds them.
300265<a href =" #" class =" button button-text" >Link Button</a >
301266```
302267
303- ### Modal Components
268+ ### Modal (Help)
304269
305- #### Basic Modal
270+ Use the design system Modal component for help/documentation:
306271
307- ``` html
308- <div class =" modal" >
309- <div class =" modal-backdrop" ></div >
310- <div class =" modal-content" >
311- <div class =" modal-header" >
312- <h2 >Modal Title</h2 >
313- <button class =" modal-close" >× ; </button >
314- </div >
315- <div class =" modal-body" >
316- <p >Modal content goes here</p >
317- </div >
318- </div >
319- </div >
320- ```
321-
322- ## Customization
323-
324- ### CSS Custom Properties
325-
326- You can override any CSS custom property to customize the appearance:
327-
328- ``` css
329- .bespoke {
330- /* Override colors */
331- --bespoke-bg : #f0f0f0 ;
332- --bespoke-fg : #333333 ;
333- --bespoke-accent : #ff6b6b ;
272+ ``` javascript
273+ import Modal from ' ./design-system/components/modal/modal.js' ;
334274
335- /* Override spacing */
336- --bespoke-space-lg : 1.5 rem ;
337-
338- /* Override border radius */
339- --bespoke-radius-lg : 12 px ;
340- }
275+ const helpModal = Modal . createHelpModal ({
276+ title : ' Help ' ,
277+ content : document . querySelector ( ' #help-content ' ). content . cloneNode ( true ),
278+ triggerSelector : ' #btn-help '
279+ }) ;
280+ helpModal . open ();
341281```
342282
343- ### Available Custom Properties
344-
345- #### Colors
346-
347- - ` --bespoke-bg ` : Background color
348- - ` --bespoke-fg ` : Text color
349- - ` --bespoke-muted ` : Muted text color
350- - ` --bespoke-box ` : Container/surface background
351- - ` --bespoke-stroke ` : Border color
352- - ` --bespoke-danger ` : Error/danger color
353- - ` --bespoke-accent ` : Accent/primary color
354- - ` --bespoke-control-bg ` : Input/button background
355- - ` --bespoke-control-border ` : Input/button border
356- - ` --bespoke-control-focus ` : Focus ring color
357-
358- #### Spacing
283+ Include ` modal.css ` and ` modal.js ` in your app. See ` client/design-system/components/modal/README.md ` for full API.
359284
360- - ` --bespoke-space-xs ` : 0.25rem
361- - ` --bespoke-space-sm ` : 0.5rem
362- - ` --bespoke-space-md ` : 0.75rem
363- - ` --bespoke-space-lg ` : 1rem
364- - ` --bespoke-space-xl ` : 1.5rem
365- - ` --bespoke-space-2xl ` : 2rem
366-
367- #### Border Radius
368-
369- - ` --bespoke-radius-sm ` : 4px
370- - ` --bespoke-radius-md ` : 6px
371- - ` --bespoke-radius-lg ` : 8px
372- - ` --bespoke-radius-xl ` : 12px
373-
374- #### Shadows
285+ ## Customization
375286
376- - ` --bespoke-shadow-sm ` : Small shadow
377- - ` --bespoke-shadow-md ` : Medium shadow
378- - ` --bespoke-shadow-lg ` : Large shadow
379- - ` --bespoke-shadow-xl ` : Extra large shadow
287+ Customize via design system CSS variables (` --Colors-* ` , ` --UI-Spacing-* ` , ` --Fonts-* ` , ` --UI-Radius-* ` ). See design system files for available tokens.
380288
381289## Theme Support
382290
@@ -394,7 +302,6 @@ between light and dark themes. No additional configuration is needed.
394302 <header class =" header" >
395303 <h1 >DB Schema Designer</h1 >
396304 <button id =" btn-save" class =" button button-primary" >Save</button >
397- <div class =" status" >Ready</div >
398305 <button class =" button button-text" >Help</button >
399306 </header >
400307
0 commit comments