Skip to content

Commit 4af7424

Browse files
committed
Minor fixes for consistency with design system
1 parent de28f51 commit 4af7424

5 files changed

Lines changed: 54 additions & 140 deletions

File tree

BESPOKE-TEMPLATE.md

Lines changed: 38 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Every application should include these files in the following order:
2121
- components/tags/tags.css
2222
3. 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)
2525
5. app.js (application logic)
2626
6. server.js (server)
2727

@@ -79,10 +79,8 @@ Every application should include these files in the following order:
7979

8080
1. 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'`
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`
8684

8785
## Error Handling Requirements
8886

@@ -204,13 +202,7 @@ when the design system adds them.
204202
```html
205203
<!-- Vertical label -->
206204
<label>Field Name
207-
<input type="text" />
208-
</label>
209-
210-
<!-- Horizontal label -->
211-
<label class="row">
212-
<input type="checkbox" />
213-
Checkbox Label
205+
<input type="text" class="input" />
214206
</label>
215207
```
216208

@@ -220,49 +212,41 @@ when the design system adds them.
220212
<!-- Text input -->
221213
<input type="text" class="input" placeholder="Enter text" />
222214

223-
<!-- Select dropdown -->
215+
<!-- Select dropdown - native select styling is custom; design system has a Dropdown JS component for richer dropdowns -->
224216
<select class="input">
225217
<option>Option 1</option>
226218
<option>Option 2</option>
227219
</select>
228220

229-
<!-- Checkbox -->
230-
<input type="checkbox" />
231-
232-
<!-- Radio buttons -->
233-
<div class="radio-group">
234-
<label class="row">
235-
<input type="radio" name="option" value="a" />
236-
Option A
237-
</label>
238-
<label class="row">
239-
<input type="radio" name="option" value="b" />
240-
Option B
241-
</label>
242-
</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>
243227

244-
<!-- Horizontal radio group -->
245-
<div class="radio-group horizontal">
246-
<label class="row">
247-
<input type="radio" name="size" value="small" />
248-
Small
249-
</label>
250-
<label class="row">
251-
<input type="radio" name="size" value="large" />
252-
Large
253-
</label>
254-
</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>
255239

256240
<!-- Textarea -->
257-
<textarea placeholder="Enter your message here..."></textarea>
241+
<textarea class="input" placeholder="Enter your message here..."></textarea>
258242

259-
<!-- Toggle switch -->
243+
<!-- Toggle switch - custom component; no design system equivalent yet. Add body-xsmall for typography -->
260244
<label class="row">
261245
<div class="toggle">
262246
<input type="checkbox" class="toggle-input" />
263247
<span class="toggle-slider"></span>
264248
</div>
265-
<span class="toggle-label">Enable notifications</span>
249+
<span class="toggle-label body-xsmall">Enable notifications</span>
266250
</label>
267251
```
268252

@@ -281,83 +265,26 @@ when the design system adds them.
281265
<a href="#" class="button button-text">Link Button</a>
282266
```
283267

284-
### Modal Components
268+
### Modal (Help)
285269

286-
#### Basic Modal
270+
Use the design system Modal component for help/documentation:
287271

288-
```html
289-
<div class="modal">
290-
<div class="modal-backdrop"></div>
291-
<div class="modal-content">
292-
<div class="modal-header">
293-
<h2>Modal Title</h2>
294-
<button class="modal-close">&times;</button>
295-
</div>
296-
<div class="modal-body">
297-
<p>Modal content goes here</p>
298-
</div>
299-
</div>
300-
</div>
301-
```
302-
303-
## Customization
304-
305-
### CSS Custom Properties
306-
307-
You can override any CSS custom property to customize the appearance:
308-
309-
```css
310-
.bespoke {
311-
/* Override colors */
312-
--bespoke-bg: #f0f0f0;
313-
--bespoke-fg: #333333;
314-
--bespoke-accent: #ff6b6b;
315-
316-
/* Override spacing */
317-
--bespoke-space-lg: 1.5rem;
272+
```javascript
273+
import Modal from './design-system/components/modal/modal.js';
318274

319-
/* Override border radius */
320-
--bespoke-radius-lg: 12px;
321-
}
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();
322281
```
323282

324-
### Available Custom Properties
283+
Include `modal.css` and `modal.js` in your app. See `client/design-system/components/modal/README.md` for full API.
325284

326-
#### Colors
327-
328-
- `--bespoke-bg`: Background color
329-
- `--bespoke-fg`: Text color
330-
- `--bespoke-muted`: Muted text color
331-
- `--bespoke-box`: Container/surface background
332-
- `--bespoke-stroke`: Border color
333-
- `--bespoke-danger`: Error/danger color
334-
- `--bespoke-accent`: Accent/primary color
335-
- `--bespoke-control-bg`: Input/button background
336-
- `--bespoke-control-border`: Input/button border
337-
- `--bespoke-control-focus`: Focus ring color
338-
339-
#### Spacing
340-
341-
- `--bespoke-space-xs`: 0.25rem
342-
- `--bespoke-space-sm`: 0.5rem
343-
- `--bespoke-space-md`: 0.75rem
344-
- `--bespoke-space-lg`: 1rem
345-
- `--bespoke-space-xl`: 1.5rem
346-
- `--bespoke-space-2xl`: 2rem
347-
348-
#### Border Radius
349-
350-
- `--bespoke-radius-sm`: 4px
351-
- `--bespoke-radius-md`: 6px
352-
- `--bespoke-radius-lg`: 8px
353-
- `--bespoke-radius-xl`: 12px
354-
355-
#### Shadows
285+
## Customization
356286

357-
- `--bespoke-shadow-sm`: Small shadow
358-
- `--bespoke-shadow-md`: Medium shadow
359-
- `--bespoke-shadow-lg`: Large shadow
360-
- `--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.
361288

362289
## Theme Support
363290

client/bespoke-template.css

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@
3030
}
3131

3232
.bespoke .header h1 {
33-
font-size: var(--Fonts-Body-Default-lg);
3433
margin: 0;
35-
font-weight: 600;
36-
font-family: var(--heading-family);
3734
color: var(--Colors-Text-Body-Strongest);
3835
}
3936

@@ -85,22 +82,22 @@
8582

8683
/* ===== TEMPORARY COMPONENTS (TODO: Replace when design system adds these) ===== */
8784

88-
/* Form Elements - TODO: Remove when design system adds form components */
89-
.bespoke label {
85+
/* Form Elements - Generic labels only; exclude .input-checkbox and .input-radio (design system components) */
86+
.bespoke label:not(.input-checkbox):not(.input-radio) {
9087
display: flex;
9188
flex-direction: column;
9289
gap: var(--UI-Spacing-spacing-xxs);
9390
margin: var(--UI-Spacing-spacing-ms) 0 var(--UI-Spacing-spacing-s) 0;
9491
}
9592

96-
.bespoke label.row {
93+
.bespoke label.row:not(.input-checkbox):not(.input-radio) {
9794
flex-direction: row;
9895
align-items: center;
9996
gap: var(--UI-Spacing-spacing-s);
10097
margin: var(--UI-Spacing-spacing-s) 0;
10198
}
10299

103-
/* Select styling - TODO: Remove when design system adds select component */
100+
/* Select styling - TODO: Replace when design system adds select component */
104101
.bespoke select {
105102
-webkit-appearance: none;
106103
-moz-appearance: none;
@@ -174,7 +171,6 @@
174171

175172
.bespoke .toggle-label {
176173
margin-left: var(--UI-Spacing-spacing-s);
177-
font-size: var(--Fonts-Body-Default-xs);
178174
color: var(--Colors-Text-Body-Default);
179175
cursor: pointer;
180176
}

client/example-app/example-app.css

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
}
1313

1414
.bespoke .sidebar-section h2 {
15-
font-size: var(--Fonts-Headlines-sm);
16-
font-weight: 600;
1715
color: var(--Colors-Text-Body-Strongest);
1816
margin: 0 0 var(--UI-Spacing-spacing-ml) 0;
1917
}
@@ -25,8 +23,6 @@
2523
}
2624

2725
.bespoke .control-group label {
28-
font-size: var(--Fonts-Body-Default-sm);
29-
font-weight: 500;
3026
color: var(--Colors-Text-Body-Strong);
3127
}
3228

@@ -60,21 +56,19 @@
6056
flex-direction: column;
6157
align-items: center;
6258
justify-content: center;
63-
padding: var(--UI-Spacing-spacing-2xl);
59+
padding: var(--UI-Spacing-spacing-xxxl);
6460
text-align: center;
6561
}
6662

6763
.bespoke .counter-display h2 {
68-
font-size: var(--Fonts-Headlines-sm);
69-
font-weight: 600;
7064
color: var(--Colors-Text-Body-Strong);
7165
margin: 0 0 var(--UI-Spacing-spacing-ml) 0;
7266
text-align: center;
7367
}
7468

7569
.bespoke .counter-value {
76-
font-size: 4rem;
77-
font-weight: 700;
70+
font-size: var(--Fonts-Headlines-xxl);
71+
font-weight: 500;
7872
font-family: var(--heading-family);
7973
color: var(--Colors-Text-Body-Strongest);
8074
line-height: 1;
@@ -96,15 +90,12 @@
9690
}
9791

9892
.bespoke .settings-display h3 {
99-
font-size: var(--Fonts-Headlines-xs);
100-
font-weight: 600;
10193
color: var(--Colors-Text-Body-Strong);
10294
margin: 0 0 var(--UI-Spacing-spacing-ml) 0;
10395
width: 100%;
10496
}
10597

10698
.bespoke .setting-item {
107-
font-size: var(--Fonts-Body-Default-sm);
10899
color: var(--Colors-Text-Body-Default);
109100
margin-bottom: var(--UI-Spacing-spacing-s);
110101
width: 100%;

client/example-app/index.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<body class="bespoke">
3030
<!-- Navigation Header -->
3131
<header class="header">
32-
<h1>Component Showcase</h1>
32+
<h1 class="heading-small">Component Showcase</h1>
3333
<div class="spacer"></div>
3434
<button id="btn-help" class="button button-text">Help</button>
3535
</header>
@@ -39,15 +39,15 @@ <h1>Component Showcase</h1>
3939
<!-- Sidebar with Input Controls -->
4040
<aside class="sidebar">
4141
<div class="sidebar-section">
42-
<h2>Controls</h2>
42+
<h2 class="heading-small">Controls</h2>
4343

4444
<div class="control-group">
45-
<label for="counter-label">Counter Label</label>
45+
<label for="counter-label" class="body-small">Counter Label</label>
4646
<input type="text" id="counter-label" class="input" placeholder="Enter label..." value="Counter">
4747
</div>
4848

4949
<div class="control-group">
50-
<label>Increment Amount</label>
50+
<label class="body-small">Increment Amount</label>
5151
<div id="increment-dropdown" style="width: 100%;"></div>
5252
</div>
5353

@@ -67,7 +67,7 @@ <h2>Controls</h2>
6767
<div class="display-container">
6868
<!-- Counter Display Box -->
6969
<div class="box card counter-display">
70-
<h2 id="display-label">Counter</h2>
70+
<h2 id="display-label" class="heading-small">Counter</h2>
7171
<div class="counter-value" id="counter-value">0</div>
7272
</div>
7373

@@ -80,11 +80,11 @@ <h2 id="display-label">Counter</h2>
8080

8181
<!-- Settings Display -->
8282
<div class="box card settings-display">
83-
<h3>Current Settings</h3>
84-
<div class="setting-item">
83+
<h3 class="heading-xxxsmall">Current Settings</h3>
84+
<div class="setting-item body-small">
8585
<strong>Label:</strong> <span id="display-label-value">Counter</span>
8686
</div>
87-
<div class="setting-item">
87+
<div class="setting-item body-small">
8888
<strong>Increment:</strong> <span id="display-increment-value">1</span>
8989
</div>
9090
</div>

client/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<body class="bespoke">
3030
<!-- Navigation Header -->
3131
<header class="header">
32-
<h1>APP NAME</h1>
32+
<h1 class="heading-small">APP NAME</h1>
3333
<!-- APP_SPECIFIC_HEADER_CONTENT -->
3434
<div class="spacer"></div>
3535
<button id="btn-help" class="button button-text">Help</button>

0 commit comments

Comments
 (0)