@nysds/playground 0.1.0

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.
Files changed (68) hide show
  1. package/LICENSE +25 -0
  2. package/README.md +364 -0
  3. package/bin/cli.mjs +223 -0
  4. package/bin/cli.test.mjs +36 -0
  5. package/decks/customizing-components.json +97 -0
  6. package/dist/assets/index-LO1tomgR.css +6 -0
  7. package/dist/assets/index-bBtGCGL_.js +5190 -0
  8. package/dist/assets/internal/typescript.js +193739 -0
  9. package/dist/assets/nys-icon.library-Bi_7DKlD-YSs5zqZy-DXISxj9N.js +609 -0
  10. package/dist/assets/nys-icon.library-CwuPZJAc-TryaOS7Z.js +600 -0
  11. package/dist/assets/playground-typescript-worker-BcTrPYfY.js +87 -0
  12. package/dist/assets/playground-typescript-worker.js +87 -0
  13. package/dist/favicon.svg +10 -0
  14. package/dist/index.html +769 -0
  15. package/dist/nysds-logo.svg +21 -0
  16. package/dist/nysds-symbol.svg +7 -0
  17. package/index.html +768 -0
  18. package/package.json +59 -0
  19. package/presets/00-welcome.json +8 -0
  20. package/presets/01-button.json +7 -0
  21. package/presets/02-alert.json +7 -0
  22. package/presets/03-badge-and-avatar.json +7 -0
  23. package/presets/04-text-input.json +7 -0
  24. package/presets/05-select-radio-checkbox.json +7 -0
  25. package/presets/06-form-validation.json +7 -0
  26. package/presets/07-card.json +7 -0
  27. package/presets/08-accordion.json +7 -0
  28. package/presets/09-tabs.json +7 -0
  29. package/presets/10-modal.json +7 -0
  30. package/presets/11-stepper.json +7 -0
  31. package/presets/12-table-and-pagination.json +7 -0
  32. package/presets/13-tooltip-and-dropdown.json +7 -0
  33. package/presets/14-navigation.json +7 -0
  34. package/presets/15-page-structure.json +7 -0
  35. package/presets/16-themes.json +7 -0
  36. package/presets/17-utility-classes.json +7 -0
  37. package/presets/README.md +118 -0
  38. package/public/favicon.svg +10 -0
  39. package/public/nysds-logo.svg +21 -0
  40. package/public/nysds-symbol.svg +7 -0
  41. package/src/app.css +1087 -0
  42. package/src/debounce.ts +86 -0
  43. package/src/deck-model.ts +299 -0
  44. package/src/deck-store.ts +144 -0
  45. package/src/decks.test.ts +288 -0
  46. package/src/editor-panes.ts +190 -0
  47. package/src/editors.ts +92 -0
  48. package/src/home.ts +225 -0
  49. package/src/icon-names.ts +117 -0
  50. package/src/icons.test.ts +58 -0
  51. package/src/keys.ts +162 -0
  52. package/src/main.ts +1456 -0
  53. package/src/playground.config.ts +74 -0
  54. package/src/playground.ts +261 -0
  55. package/src/present.ts +398 -0
  56. package/src/preset-schema.ts +228 -0
  57. package/src/route.test.ts +56 -0
  58. package/src/routing.ts +60 -0
  59. package/src/settings.ts +211 -0
  60. package/src/starters.ts +86 -0
  61. package/src/state.test.ts +544 -0
  62. package/src/state.ts +237 -0
  63. package/src/theme.ts +82 -0
  64. package/src/version-catalog.ts +42 -0
  65. package/src/versions.ts +88 -0
  66. package/src/wrapper.ts +84 -0
  67. package/tsconfig.json +25 -0
  68. package/vite.config.ts +62 -0
@@ -0,0 +1,769 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
6
+ <link rel="icon" href="./favicon.svg" type="image/svg+xml" />
7
+ <meta
8
+ name="description"
9
+ content="Edit HTML, CSS, and JavaScript against the New York State Design System and share the result with a link."
10
+ />
11
+ <title>NYSDS Playground</title>
12
+ <link
13
+ rel="preload"
14
+ href="./fonts/proximanova-regular.woff2"
15
+ as="font"
16
+ type="font/woff2"
17
+ crossorigin
18
+ />
19
+ <link rel="stylesheet" href="./fonts/nysds-fonts.css" />
20
+ <style>
21
+ /* Keep the shell out of sight until the components are defined, so
22
+ the page never shows unstyled text before the design system loads.
23
+ A splash with the logo covers the wait. The app removes both. */
24
+ #app:not(.app--ready) {
25
+ visibility: hidden;
26
+ }
27
+ #splash {
28
+ position: fixed;
29
+ inset: 0;
30
+ z-index: 1000;
31
+ display: grid;
32
+ place-items: center;
33
+ background: #f6f6f6;
34
+ }
35
+ #splash[hidden] {
36
+ display: none;
37
+ }
38
+ #splash img {
39
+ width: min(80vw, 400px);
40
+ height: auto;
41
+ animation: splash-pulse 1.4s ease-in-out infinite;
42
+ }
43
+ @keyframes splash-pulse {
44
+ 50% {
45
+ opacity: 0.5;
46
+ }
47
+ }
48
+ @media (prefers-reduced-motion: reduce) {
49
+ #splash img {
50
+ animation: none;
51
+ }
52
+ }
53
+ </style>
54
+ <script type="module" crossorigin src="./assets/index-bBtGCGL_.js"></script>
55
+ <link rel="stylesheet" crossorigin href="./assets/index-LO1tomgR.css">
56
+ </head>
57
+ <body>
58
+ <div id="splash" aria-hidden="true">
59
+ <img src="./nysds-logo.svg" alt="" width="1037" height="114" />
60
+ </div>
61
+ <noscript>
62
+ <p style="padding: 16px; font-family: sans-serif">
63
+ NYSDS Playground needs JavaScript to run.
64
+ </p>
65
+ </noscript>
66
+ <div id="app" class="app">
67
+ <main class="home" id="home" hidden>
68
+ <header class="home__header">
69
+ <h1 class="home__title">
70
+ <img class="home__logo" src="./nysds-logo.svg" alt="NYS Design System" width="1037" height="114" />
71
+ <span class="home__title-text">Playground</span>
72
+ </h1>
73
+ <nys-tooltip for="home-settings-button" text="Settings"></nys-tooltip>
74
+ <nys-button id="home-settings-button" size="sm" variant="ghost" circle label="Settings">
75
+ <svg
76
+ slot="circle-icon"
77
+ class="glyph"
78
+ viewBox="0 -960 960 960"
79
+ fill="currentColor"
80
+ aria-hidden="true"
81
+ >
82
+ <path
83
+ d="M370-80l-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm112-260q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Z"
84
+ />
85
+ </svg>
86
+ </nys-button>
87
+ </header>
88
+
89
+ <p class="home__lede">
90
+ Decks are saved in this browser only, not on a server. Edit one, present it, share a slide as a link, or export a deck as JSON to back it up or move it to another browser.
91
+ </p>
92
+
93
+ <div class="home__actions nys-display-flex nys-flex-wrap nys-flex-gap-200">
94
+ <nys-button id="new-deck-button" label="New deck" prefixIcon="add"></nys-button>
95
+ <nys-button
96
+ id="import-deck-button"
97
+ variant="outline"
98
+ label="Import deck"
99
+ prefixIcon="upload_file"
100
+ ></nys-button>
101
+ <nys-button
102
+ id="scratch-button"
103
+ variant="ghost"
104
+ label="Scratch pad"
105
+ prefixIcon="code"
106
+ ></nys-button>
107
+ </div>
108
+
109
+ <div class="home__decks nys-grid-row nys-grid-gap" id="deck-list"></div>
110
+
111
+ <div class="home__footer">
112
+ <nys-button
113
+ id="restore-starters-button"
114
+ size="sm"
115
+ variant="ghost"
116
+ label="Restore starter decks"
117
+ prefixIcon="refresh"
118
+ ></nys-button>
119
+ </div>
120
+
121
+ <input
122
+ class="home__file"
123
+ id="import-file"
124
+ type="file"
125
+ accept=".json,application/json"
126
+ hidden
127
+ />
128
+ </main>
129
+
130
+ <header class="toolbar" id="toolbar">
131
+ <a class="toolbar__home" id="toolbar-home" href="./" aria-label="NYSDS Playground home">
132
+ <svg
133
+ class="toolbar__mark"
134
+ viewBox="13 3 205 205"
135
+ fill="currentColor"
136
+ aria-hidden="true"
137
+ focusable="false"
138
+ >
139
+ <path
140
+ d="M89.6599 110.894L56.3349 77.5558V48.4713H172.629L217.285 93.4372C211.299 42.5111 168.016 3 115.5 3C58.8907 3 13 48.908 13 105.538C13 128.627 20.6323 149.93 33.5051 167.07"
141
+ />
142
+ <path
143
+ d="M172.629 48.3945V164.733H143.556V98.0323L54.072 187.55C71.191 200.39 92.4567 208 115.5 208C172.109 208 218 162.092 218 105.462C218 101.356 217.731 97.3158 217.262 93.3366L172.629 48.3945Z"
144
+ />
145
+ <path d="M56.3291 77.5552H122.979L89.6541 110.893L56.3291 77.5552Z" />
146
+ </svg>
147
+ </a>
148
+
149
+ <h1 class="toolbar__title scratch-only" id="deck-title-static">Scratch pad</h1>
150
+
151
+ <button
152
+ class="toolbar__title toolbar__rename deck-only edit-only"
153
+ id="deck-title"
154
+ type="button"
155
+ >
156
+ <span id="deck-title-text"></span>
157
+ <nys-icon class="toolbar__rename-icon" name="edit_square" size="sm"></nys-icon>
158
+ </button>
159
+
160
+ <input
161
+ class="toolbar__rename-input deck-only"
162
+ id="deck-title-field"
163
+ type="text"
164
+ aria-label="Deck title"
165
+ hidden
166
+ />
167
+
168
+ <nys-tooltip class="deck-only" for="deck-settings-button" text="Deck settings"></nys-tooltip>
169
+ <nys-button
170
+ class="deck-only"
171
+ id="deck-settings-button"
172
+ size="sm"
173
+ variant="ghost"
174
+ circle
175
+ icon="more_vert"
176
+ label="Deck settings"
177
+ ></nys-button>
178
+
179
+ <nys-button
180
+ class="scratch-only"
181
+ id="save-as-deck-button"
182
+ size="sm"
183
+ variant="outline"
184
+ label="Save as deck"
185
+ prefixIcon="add"
186
+ ></nys-button>
187
+
188
+ <p class="toolbar__saved" id="saved-indicator" role="status" aria-live="polite"></p>
189
+
190
+ <div class="toolbar__spacer"></div>
191
+
192
+ <nys-select
193
+ id="version-select"
194
+ class="toolbar__select"
195
+ ariaLabel="Design system version"
196
+ width="md"
197
+ ></nys-select>
198
+
199
+ <nys-tooltip for="share-button" text="Share"></nys-tooltip>
200
+ <nys-button
201
+ id="share-button"
202
+ size="sm"
203
+ variant="ghost"
204
+ circle
205
+ icon="link"
206
+ label="Share"
207
+ ></nys-button>
208
+
209
+ <nys-tooltip class="deck-only" for="export-button" text="Export deck"></nys-tooltip>
210
+ <nys-button
211
+ class="deck-only"
212
+ id="export-button"
213
+ size="sm"
214
+ variant="ghost"
215
+ circle
216
+ icon="download"
217
+ label="Export deck"
218
+ ></nys-button>
219
+
220
+
221
+
222
+ <nys-tooltip for="settings-button" text="Settings"></nys-tooltip>
223
+ <nys-button
224
+ id="settings-button"
225
+ size="sm"
226
+ variant="ghost"
227
+ circle
228
+ label="Settings"
229
+ >
230
+ <svg
231
+ slot="circle-icon"
232
+ class="glyph"
233
+ viewBox="0 -960 960 960"
234
+ fill="currentColor"
235
+ aria-hidden="true"
236
+ >
237
+ <path
238
+ d="M370-80l-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm112-260q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Z"
239
+ />
240
+ </svg>
241
+ </nys-button>
242
+
243
+ <nys-button id="present-button" size="sm" label="Present">
244
+ <svg
245
+ slot="prefix-icon"
246
+ class="glyph"
247
+ viewBox="0 -960 960 960"
248
+ fill="currentColor"
249
+ aria-hidden="true"
250
+ >
251
+ <path d="M320-200v-560l440 280-440 280Z" />
252
+ </svg>
253
+ </nys-button>
254
+ </header>
255
+
256
+ <main class="split" id="split">
257
+ <section class="split__pane split__pane--editors" id="editors" aria-label="Code editors">
258
+ <div class="editors__layout editors__layout--tabs" id="tabs-layout">
259
+ <playground-tab-bar
260
+ project="project"
261
+ editor="file-editor"
262
+ class="editors__tabs"
263
+ ></playground-tab-bar>
264
+ <playground-file-editor
265
+ id="file-editor"
266
+ project="project"
267
+ line-numbers
268
+ line-wrapping
269
+ class="editors__editor"
270
+ ></playground-file-editor>
271
+ </div>
272
+
273
+ <div class="editors__layout editors__layout--columns" id="columns-layout" hidden>
274
+ <section class="column" id="column-html" data-pane="html">
275
+ <header class="column__header">
276
+ <button
277
+ type="button"
278
+ class="column__label"
279
+ id="column-html-label"
280
+ aria-expanded="true"
281
+ aria-controls="column-html-editor"
282
+ >
283
+ HTML
284
+ </button>
285
+ <nys-button
286
+ class="column__collapse"
287
+ id="column-html-collapse"
288
+ circle
289
+ size="sm"
290
+ variant="ghost"
291
+ icon="chevron_left"
292
+ label="Collapse HTML"
293
+ ></nys-button>
294
+ </header>
295
+ <playground-file-editor
296
+ id="column-html-editor"
297
+ class="column__editor"
298
+ project="project"
299
+ filename="snippet.html"
300
+ line-numbers
301
+ line-wrapping
302
+ ></playground-file-editor>
303
+ </section>
304
+ <section class="column" id="column-css" data-pane="css">
305
+ <header class="column__header">
306
+ <button
307
+ type="button"
308
+ class="column__label"
309
+ id="column-css-label"
310
+ aria-expanded="true"
311
+ aria-controls="column-css-editor"
312
+ >
313
+ CSS
314
+ </button>
315
+ <nys-button
316
+ class="column__collapse"
317
+ id="column-css-collapse"
318
+ circle
319
+ size="sm"
320
+ variant="ghost"
321
+ icon="chevron_left"
322
+ label="Collapse CSS"
323
+ ></nys-button>
324
+ </header>
325
+ <playground-file-editor
326
+ id="column-css-editor"
327
+ class="column__editor"
328
+ project="project"
329
+ filename="styles.css"
330
+ line-numbers
331
+ line-wrapping
332
+ ></playground-file-editor>
333
+ </section>
334
+ <section class="column" id="column-js" data-pane="js">
335
+ <header class="column__header">
336
+ <button
337
+ type="button"
338
+ class="column__label"
339
+ id="column-js-label"
340
+ aria-expanded="true"
341
+ aria-controls="column-js-editor"
342
+ >
343
+ JS
344
+ </button>
345
+ <nys-button
346
+ class="column__collapse"
347
+ id="column-js-collapse"
348
+ circle
349
+ size="sm"
350
+ variant="ghost"
351
+ icon="chevron_left"
352
+ label="Collapse JS"
353
+ ></nys-button>
354
+ </header>
355
+ <playground-file-editor
356
+ id="column-js-editor"
357
+ class="column__editor"
358
+ project="project"
359
+ filename="script.js"
360
+ line-numbers
361
+ line-wrapping
362
+ ></playground-file-editor>
363
+ </section>
364
+ </div>
365
+ </section>
366
+
367
+ <div
368
+ class="split__divider"
369
+ id="divider"
370
+ role="separator"
371
+ aria-orientation="horizontal"
372
+ aria-label="Resize the code drawer"
373
+ tabindex="0"
374
+ ></div>
375
+
376
+ <section class="split__pane split__pane--preview" aria-label="Live preview">
377
+ <playground-preview
378
+ id="preview"
379
+ project="project"
380
+ html-file="index.html"
381
+ class="preview"
382
+ ></playground-preview>
383
+ <nys-button
384
+ class="preview__build"
385
+ id="build-button"
386
+ size="sm"
387
+ variant="outline"
388
+ label="Update preview"
389
+ prefixIcon="refresh"
390
+ hidden
391
+ ></nys-button>
392
+ </section>
393
+ </main>
394
+
395
+ <div class="notes" id="notes" role="dialog" aria-labelledby="notes-heading" hidden>
396
+ <h2 class="notes__heading" id="notes-heading">Presenter notes</h2>
397
+ <div class="notes__body" id="notes-body"></div>
398
+ <nys-button
399
+ id="notes-close"
400
+ size="sm"
401
+ variant="ghost"
402
+ label="Close notes"
403
+ prefixIcon="close"
404
+ ></nys-button>
405
+ </div>
406
+
407
+ <footer class="caption" id="caption" tabindex="-1">
408
+ <div class="caption__left">
409
+ <nys-button
410
+ inverted
411
+ id="prev-button"
412
+ size="sm"
413
+ variant="outline"
414
+ circle
415
+ icon="chevron_left"
416
+ label="Previous slide"
417
+ ></nys-button>
418
+ <div class="caption__headline">
419
+ <p class="caption__title">
420
+ <span class="present-only">
421
+ <span class="caption__group" id="caption-group"></span>
422
+ <span id="caption-title"></span>
423
+ </span>
424
+ <span class="caption__picker edit-only">
425
+ <select class="caption__select" id="slide-picker" aria-label="Go to slide"></select>
426
+ <nys-icon class="caption__picker-icon" name="chevron_down" size="sm"></nys-icon>
427
+ </span>
428
+ <span class="caption__count caption__count--inline" data-count></span>
429
+ </p>
430
+ <p class="caption__description" id="caption-description"></p>
431
+ </div>
432
+ </div>
433
+
434
+ <div class="caption__center">
435
+ <span class="caption__home" aria-hidden="true">
436
+ <svg
437
+ class="caption__mark"
438
+ viewBox="13 3 205 205"
439
+ fill="currentColor"
440
+ aria-hidden="true"
441
+ focusable="false"
442
+ >
443
+ <path
444
+ d="M89.6599 110.894L56.3349 77.5558V48.4713H172.629L217.285 93.4372C211.299 42.5111 168.016 3 115.5 3C58.8907 3 13 48.908 13 105.538C13 128.627 20.6323 149.93 33.5051 167.07"
445
+ />
446
+ <path
447
+ d="M172.629 48.3945V164.733H143.556V98.0323L54.072 187.55C71.191 200.39 92.4567 208 115.5 208C172.109 208 218 162.092 218 105.462C218 101.356 217.731 97.3158 217.262 93.3366L172.629 48.3945Z"
448
+ />
449
+ <path d="M56.3291 77.5552H122.979L89.6541 110.893L56.3291 77.5552Z" />
450
+ </svg>
451
+ </span>
452
+ </div>
453
+
454
+ <div class="caption__right">
455
+ <p class="caption__count" id="caption-count" data-count></p>
456
+ <div class="caption__actions">
457
+ <nys-button
458
+ class="edit-only deck-only"
459
+ inverted
460
+ id="add-slide-button"
461
+ size="sm"
462
+ variant="outline"
463
+ label="Add slide"
464
+ prefixIcon="add"
465
+ ></nys-button>
466
+ <nys-button
467
+ class="edit-only deck-only"
468
+ inverted
469
+ id="slide-settings-button"
470
+ size="sm"
471
+ variant="ghost"
472
+ label="Slide settings"
473
+ prefixIcon="edit_square"
474
+ ></nys-button>
475
+ <nys-button
476
+ class="edit-only deck-only"
477
+ inverted
478
+ id="move-slide-back-button"
479
+ size="sm"
480
+ variant="ghost"
481
+ circle
482
+ icon="arrow_back"
483
+ label="Move slide earlier"
484
+ ></nys-button>
485
+ <nys-button
486
+ class="edit-only deck-only"
487
+ inverted
488
+ id="move-slide-forward-button"
489
+ size="sm"
490
+ variant="ghost"
491
+ circle
492
+ icon="arrow_forward"
493
+ label="Move slide later"
494
+ ></nys-button>
495
+ <nys-button
496
+ class="edit-only deck-only"
497
+ inverted
498
+ id="duplicate-slide-button"
499
+ size="sm"
500
+ variant="ghost"
501
+ circle
502
+ icon="content_copy"
503
+ label="Duplicate slide"
504
+ ></nys-button>
505
+ <nys-button
506
+ class="edit-only deck-only"
507
+ inverted
508
+ id="delete-slide-button"
509
+ size="sm"
510
+ variant="ghost"
511
+ circle
512
+ icon="delete"
513
+ label="Delete slide"
514
+ ></nys-button>
515
+ <nys-tooltip class="present-only" for="exit-present-button" text="Edit slides" inverted></nys-tooltip>
516
+ <nys-button
517
+ class="present-only"
518
+ inverted
519
+ id="exit-present-button"
520
+ size="sm"
521
+ variant="ghost"
522
+ circle
523
+ icon="edit_square"
524
+ label="Edit slides"
525
+ ></nys-button>
526
+ <nys-tooltip class="caption__notes" for="notes-button" text="Presenter notes" inverted></nys-tooltip>
527
+ <nys-button
528
+ class="caption__notes"
529
+ inverted
530
+ id="notes-button"
531
+ size="sm"
532
+ variant="ghost"
533
+ circle
534
+ icon="info"
535
+ label="Presenter notes"
536
+ ></nys-button>
537
+ <nys-tooltip class="present-only" for="reset-slide-button" text="Reset slide" inverted></nys-tooltip>
538
+ <nys-button
539
+ class="present-only"
540
+ inverted
541
+ id="reset-slide-button"
542
+ size="sm"
543
+ variant="ghost"
544
+ circle
545
+ icon="refresh"
546
+ label="Reset slide"
547
+ ></nys-button>
548
+ <nys-tooltip class="present-only" for="present-settings-button" text="Settings" inverted></nys-tooltip>
549
+ <nys-button
550
+ class="present-only"
551
+ inverted
552
+ id="present-settings-button"
553
+ size="sm"
554
+ variant="ghost"
555
+ circle
556
+ icon="more_vert"
557
+ label="Settings"
558
+ ></nys-button>
559
+ </div>
560
+ <nys-button
561
+ inverted
562
+ id="next-button"
563
+ size="sm"
564
+ variant="outline"
565
+ circle
566
+ icon="chevron_right"
567
+ label="Next slide"
568
+ ></nys-button>
569
+ </div>
570
+ </footer>
571
+
572
+ <p class="present-hint" id="present-hint" hidden></p>
573
+
574
+ <nys-modal id="deck-modal" heading="Deck settings" width="md">
575
+ <div class="settings">
576
+ <nys-textinput
577
+ id="deck-title-input"
578
+ label="Deck title"
579
+ placeholder="A name for this deck"
580
+ ></nys-textinput>
581
+ <nys-textarea
582
+ id="deck-description-input"
583
+ label="Description"
584
+ rows="2"
585
+ description="One sentence. It shows on the home page and in the slide bar."
586
+ ></nys-textarea>
587
+ <div class="settings__code">
588
+ <div class="settings__legend" id="deck-base-css-label">Base CSS</div>
589
+ <p class="settings__hint" id="deck-base-css-hint">
590
+ CSS applied to every slide in this deck, without taking up room in the CSS tab.
591
+ </p>
592
+ <playground-code-editor
593
+ id="deck-base-css-input"
594
+ class="settings__editor"
595
+ type="css"
596
+ line-numbers
597
+ line-wrapping
598
+ aria-labelledby="deck-base-css-label"
599
+ aria-describedby="deck-base-css-hint"
600
+ ></playground-code-editor>
601
+ </div>
602
+ </div>
603
+ <div slot="actions">
604
+ <nys-button id="deck-modal-done" label="Done"></nys-button>
605
+ </div>
606
+ </nys-modal>
607
+
608
+ <nys-modal id="slide-modal" heading="Slide settings" width="md">
609
+ <div class="settings">
610
+ <nys-textinput id="slide-title-input" label="Title"></nys-textinput>
611
+ <nys-textinput
612
+ id="slide-group-input"
613
+ label="Group"
614
+ description="A section label, such as 1. Lock it down. Slides that share one are grouped."
615
+ ></nys-textinput>
616
+ <nys-textarea id="slide-description-input" label="Description" rows="2"></nys-textarea>
617
+ <nys-textarea
618
+ id="slide-notes-input"
619
+ label="Presenter notes"
620
+ rows="4"
621
+ description="Shown only to you, with the n key while presenting."
622
+ ></nys-textarea>
623
+ <fieldset class="settings__fieldset">
624
+ <legend class="settings__legend">Editors to open</legend>
625
+ <p class="settings__hint">
626
+ Applies to the side-by-side layout. Leave all three off to keep whatever is open.
627
+ </p>
628
+ <div class="nys-display-flex nys-flex-gap-300">
629
+ <nys-checkbox id="slide-editor-html" label="HTML" size="sm"></nys-checkbox>
630
+ <nys-checkbox id="slide-editor-css" label="CSS" size="sm"></nys-checkbox>
631
+ <nys-checkbox id="slide-editor-js" label="JS" size="sm"></nys-checkbox>
632
+ </div>
633
+ </fieldset>
634
+ <nys-select
635
+ id="slide-version-select"
636
+ label="Design system version"
637
+ width="md"
638
+ description="Pick latest to follow the newest release."
639
+ ></nys-select>
640
+ </div>
641
+ <div slot="actions">
642
+ <nys-button id="slide-modal-done" label="Done"></nys-button>
643
+ </div>
644
+ </nys-modal>
645
+
646
+ <nys-modal id="confirm-modal" heading="Are you sure?" width="sm">
647
+ <p id="confirm-message"></p>
648
+ <div slot="actions">
649
+ <nys-button id="confirm-cancel" variant="outline" label="Cancel"></nys-button>
650
+ <nys-button id="confirm-ok" label="Delete"></nys-button>
651
+ </div>
652
+ </nys-modal>
653
+
654
+ <nys-modal id="leave-modal" heading="Leave the scratch pad?" width="sm">
655
+ <p>Your edits aren't saved anywhere yet.</p>
656
+ <div slot="actions">
657
+ <nys-button id="leave-stay" variant="outline" label="Stay"></nys-button>
658
+ <nys-button id="leave-discard" variant="outline" label="Leave"></nys-button>
659
+ <nys-button id="leave-save" label="Save as deck"></nys-button>
660
+ </div>
661
+ </nys-modal>
662
+
663
+ <nys-modal id="share-modal" heading="Share" width="md">
664
+ <p class="share__lede">
665
+ A deck link points at a deck in this browser. A standalone link carries the code
666
+ itself, so it opens anywhere.
667
+ </p>
668
+ <div class="nys-display-flex nys-flex-column nys-flex-gap-200">
669
+ <nys-button
670
+ id="share-deck-link"
671
+ variant="outline"
672
+ label="Copy link to this slide (works in this browser)"
673
+ prefixIcon="link"
674
+ ></nys-button>
675
+ <nys-button
676
+ id="share-code-link"
677
+ label="Copy standalone link"
678
+ prefixIcon="link"
679
+ ></nys-button>
680
+ </div>
681
+ <div slot="actions">
682
+ <nys-button id="share-modal-done" label="Done"></nys-button>
683
+ </div>
684
+ </nys-modal>
685
+
686
+ <nys-modal id="settings-modal" heading="Settings" width="md">
687
+ <div class="settings">
688
+ <nys-toggle
689
+ id="theme-toggle"
690
+ class="settings__field"
691
+ size="sm"
692
+ label="Dark editor"
693
+ description="Changes the code editors only. The preview always shows the design system as it is."
694
+ name="editor-theme"
695
+ value="dark"
696
+ ></nys-toggle>
697
+
698
+ <nys-toggle
699
+ id="columns-toggle"
700
+ class="settings__field"
701
+ size="sm"
702
+ label="Side by side editors"
703
+ description="Shows HTML, CSS, and JavaScript in three columns. Turn it off for one tabbed editor."
704
+ name="editor-layout"
705
+ value="columns"
706
+ ></nys-toggle>
707
+
708
+ <nys-select
709
+ id="font-size-select"
710
+ class="settings__field"
711
+ width="md"
712
+ label="Editor font size"
713
+ >
714
+ <option value="small" label="Small (13px)"></option>
715
+ <option value="medium" label="Medium (15px)"></option>
716
+ <option value="large" label="Large (18px)"></option>
717
+ </nys-select>
718
+
719
+ <nys-select
720
+ id="update-mode-select"
721
+ class="settings__field"
722
+ width="lg"
723
+ label="Update preview"
724
+ description="How soon an edit reaches the preview. Cmd or Ctrl plus Enter updates it at once."
725
+ >
726
+ <option value="typing" label="While typing"></option>
727
+ <option value="pause" label="After a longer pause"></option>
728
+ <option value="manual" label="Manually"></option>
729
+ </nys-select>
730
+
731
+ <nys-toggle
732
+ id="prerelease-toggle"
733
+ class="settings__field"
734
+ size="sm"
735
+ label="Show prerelease versions"
736
+ name="prereleases"
737
+ value="on"
738
+ ></nys-toggle>
739
+
740
+ <nys-button
741
+ id="reset-settings-button"
742
+ class="settings__reset"
743
+ size="sm"
744
+ variant="outline"
745
+ label="Reset settings"
746
+ prefixIcon="refresh"
747
+ ></nys-button>
748
+ </div>
749
+ <div slot="actions">
750
+ <nys-button id="settings-done-button" label="Done"></nys-button>
751
+ </div>
752
+ </nys-modal>
753
+
754
+ <div class="deck-missing" id="deck-missing" hidden>
755
+ <nys-alert
756
+ type="warning"
757
+ heading="Deck not found"
758
+ text="That deck is not in this browser. Decks are stored per browser, so a deck link only opens where it was made."
759
+ ></nys-alert>
760
+ <nys-button id="deck-missing-home" label="Go home" prefixIcon="arrow_back"></nys-button>
761
+ </div>
762
+
763
+ <div class="toast" id="toast" role="status" aria-live="polite" hidden></div>
764
+ </div>
765
+
766
+ <playground-project id="project"></playground-project>
767
+
768
+ </body>
769
+ </html>