@dodlhuat/basix 1.1.1 → 1.2.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 (274) hide show
  1. package/README.md +651 -482
  2. package/css/badge.scss +104 -0
  3. package/css/bottom-sheet.scss +192 -0
  4. package/css/breadcrumb.scss +158 -0
  5. package/css/context-menu.scss +182 -0
  6. package/css/editor.scss +628 -461
  7. package/css/form.scss +139 -0
  8. package/css/stepper.scss +212 -0
  9. package/css/style.css +1495 -70
  10. package/css/style.css.map +1 -1
  11. package/css/style.min.css +1 -1
  12. package/css/style.scss +7 -1
  13. package/css/typography.scss +194 -161
  14. package/js/bottom-sheet.js +173 -0
  15. package/js/bottom-sheet.ts +222 -0
  16. package/js/carousel.js +26 -13
  17. package/js/context-menu.js +212 -0
  18. package/js/context-menu.ts +252 -0
  19. package/js/editor.js +46 -32
  20. package/js/editor.ts +56 -37
  21. package/js/gallery.js +11 -10
  22. package/js/index.js +472 -374
  23. package/js/index.ts +116 -2
  24. package/js/push-menu.js +113 -113
  25. package/js/stepper.js +80 -0
  26. package/js/stepper.ts +104 -0
  27. package/js/timepicker.js +21 -8
  28. package/package.json +1 -1
  29. package/fonts/Outfit-VariableFont_wght.woff +0 -0
  30. package/fonts/material-icons.woff2 +0 -0
  31. package/icons/activity-outline.svg +0 -1
  32. package/icons/alert-circle-outline.svg +0 -1
  33. package/icons/alert-triangle-outline.svg +0 -1
  34. package/icons/archive-outline.svg +0 -1
  35. package/icons/arrow-back-outline.svg +0 -1
  36. package/icons/arrow-circle-down-outline.svg +0 -1
  37. package/icons/arrow-circle-left-outline.svg +0 -1
  38. package/icons/arrow-circle-right-outline.svg +0 -1
  39. package/icons/arrow-circle-up-outline.svg +0 -1
  40. package/icons/arrow-down-outline.svg +0 -1
  41. package/icons/arrow-downward-outline.svg +0 -1
  42. package/icons/arrow-forward-outline.svg +0 -1
  43. package/icons/arrow-ios-back-outline.svg +0 -1
  44. package/icons/arrow-ios-downward-outline.svg +0 -1
  45. package/icons/arrow-ios-forward-outline.svg +0 -1
  46. package/icons/arrow-ios-upward-outline.svg +0 -1
  47. package/icons/arrow-left-outline.svg +0 -1
  48. package/icons/arrow-right-outline.svg +0 -1
  49. package/icons/arrow-up-outline.svg +0 -1
  50. package/icons/arrow-upward-outline.svg +0 -1
  51. package/icons/arrowhead-down-outline.svg +0 -1
  52. package/icons/arrowhead-left-outline.svg +0 -1
  53. package/icons/arrowhead-right-outline.svg +0 -1
  54. package/icons/arrowhead-up-outline.svg +0 -1
  55. package/icons/at-outline.svg +0 -1
  56. package/icons/attach-2-outline.svg +0 -1
  57. package/icons/attach-outline.svg +0 -1
  58. package/icons/award-outline.svg +0 -1
  59. package/icons/backspace-outline.svg +0 -1
  60. package/icons/bar-chart-2-outline.svg +0 -1
  61. package/icons/bar-chart-outline.svg +0 -1
  62. package/icons/battery-outline.svg +0 -1
  63. package/icons/behance-outline.svg +0 -1
  64. package/icons/bell-off-outline.svg +0 -1
  65. package/icons/bell-outline.svg +0 -1
  66. package/icons/bluetooth-outline.svg +0 -1
  67. package/icons/book-open-outline.svg +0 -1
  68. package/icons/book-outline.svg +0 -1
  69. package/icons/bookmark-outline.svg +0 -1
  70. package/icons/briefcase-outline.svg +0 -1
  71. package/icons/browser-outline.svg +0 -1
  72. package/icons/brush-outline.svg +0 -1
  73. package/icons/bulb-outline.svg +0 -1
  74. package/icons/calendar-outline.svg +0 -1
  75. package/icons/camera-outline.svg +0 -1
  76. package/icons/car-outline.svg +0 -1
  77. package/icons/cast-outline.svg +0 -1
  78. package/icons/charging-outline.svg +0 -1
  79. package/icons/checkmark-circle-2-outline.svg +0 -1
  80. package/icons/checkmark-circle-outline.svg +0 -1
  81. package/icons/checkmark-outline.svg +0 -1
  82. package/icons/checkmark-square-2-outline.svg +0 -1
  83. package/icons/checkmark-square-outline.svg +0 -1
  84. package/icons/chevron-down-outline.svg +0 -1
  85. package/icons/chevron-left-outline.svg +0 -1
  86. package/icons/chevron-right-outline.svg +0 -1
  87. package/icons/chevron-up-outline.svg +0 -1
  88. package/icons/clipboard-outline.svg +0 -1
  89. package/icons/clock-outline.svg +0 -1
  90. package/icons/close-circle-outline.svg +0 -1
  91. package/icons/close-outline.svg +0 -1
  92. package/icons/close-square-outline.svg +0 -1
  93. package/icons/cloud-download-outline.svg +0 -1
  94. package/icons/cloud-upload-outline.svg +0 -1
  95. package/icons/code-download-outline.svg +0 -1
  96. package/icons/code-outline.svg +0 -1
  97. package/icons/collapse-outline.svg +0 -1
  98. package/icons/color-palette-outline.svg +0 -1
  99. package/icons/color-picker-outline.svg +0 -1
  100. package/icons/compass-outline.svg +0 -1
  101. package/icons/copy-outline.svg +0 -1
  102. package/icons/corner-down-left-outline.svg +0 -1
  103. package/icons/corner-down-right-outline.svg +0 -1
  104. package/icons/corner-left-down-outline.svg +0 -1
  105. package/icons/corner-left-up-outline.svg +0 -1
  106. package/icons/corner-right-down-outline.svg +0 -1
  107. package/icons/corner-right-up-outline.svg +0 -1
  108. package/icons/corner-up-left-outline.svg +0 -1
  109. package/icons/corner-up-right-outline.svg +0 -1
  110. package/icons/credit-card-outline.svg +0 -1
  111. package/icons/crop-outline.svg +0 -1
  112. package/icons/cube-outline.svg +0 -1
  113. package/icons/diagonal-arrow-left-down-outline.svg +0 -1
  114. package/icons/diagonal-arrow-left-up-outline.svg +0 -1
  115. package/icons/diagonal-arrow-right-down-outline.svg +0 -1
  116. package/icons/diagonal-arrow-right-up-outline.svg +0 -1
  117. package/icons/done-all-outline.svg +0 -1
  118. package/icons/download-outline.svg +0 -1
  119. package/icons/droplet-off-outline.svg +0 -1
  120. package/icons/droplet-outline.svg +0 -1
  121. package/icons/edit-2-outline.svg +0 -1
  122. package/icons/edit-outline.svg +0 -1
  123. package/icons/email-outline.svg +0 -1
  124. package/icons/expand-outline.svg +0 -1
  125. package/icons/external-link-outline.svg +0 -1
  126. package/icons/eye-off-2-outline.svg +0 -1
  127. package/icons/eye-off-outline.svg +0 -1
  128. package/icons/eye-outline.svg +0 -1
  129. package/icons/facebook-outline.svg +0 -1
  130. package/icons/file-add-outline.svg +0 -1
  131. package/icons/file-outline.svg +0 -1
  132. package/icons/file-remove-outline.svg +0 -1
  133. package/icons/file-text-outline.svg +0 -1
  134. package/icons/film-outline.svg +0 -1
  135. package/icons/flag-outline.svg +0 -1
  136. package/icons/flash-off-outline.svg +0 -1
  137. package/icons/flash-outline.svg +0 -1
  138. package/icons/flip-2-outline.svg +0 -1
  139. package/icons/flip-outline.svg +0 -1
  140. package/icons/folder-add-outline.svg +0 -1
  141. package/icons/folder-outline.svg +0 -1
  142. package/icons/folder-remove-outline.svg +0 -1
  143. package/icons/funnel-outline.svg +0 -1
  144. package/icons/gift-outline.svg +0 -1
  145. package/icons/github-outline.svg +0 -1
  146. package/icons/globe-2-outline.svg +0 -1
  147. package/icons/globe-outline.svg +0 -1
  148. package/icons/google-outline.svg +0 -1
  149. package/icons/grid-outline.svg +0 -1
  150. package/icons/hard-drive-outline.svg +0 -1
  151. package/icons/hash-outline.svg +0 -1
  152. package/icons/headphones-outline.svg +0 -1
  153. package/icons/heart-outline.svg +0 -1
  154. package/icons/home-outline.svg +0 -1
  155. package/icons/image-outline.svg +0 -1
  156. package/icons/inbox-outline.svg +0 -1
  157. package/icons/info-outline.svg +0 -1
  158. package/icons/keypad-outline.svg +0 -1
  159. package/icons/layers-outline.svg +0 -1
  160. package/icons/layout-outline.svg +0 -1
  161. package/icons/link-2-outline.svg +0 -1
  162. package/icons/link-outline.svg +0 -1
  163. package/icons/linkedin-outline.svg +0 -1
  164. package/icons/list-outline.svg +0 -1
  165. package/icons/loader-outline.svg +0 -1
  166. package/icons/lock-outline.svg +0 -1
  167. package/icons/log-in-outline.svg +0 -1
  168. package/icons/log-out-outline.svg +0 -1
  169. package/icons/map-outline.svg +0 -1
  170. package/icons/maximize-outline.svg +0 -1
  171. package/icons/menu-2-outline.svg +0 -1
  172. package/icons/menu-arrow-outline.svg +0 -1
  173. package/icons/menu-outline.svg +0 -1
  174. package/icons/message-circle-outline.svg +0 -1
  175. package/icons/message-square-outline.svg +0 -1
  176. package/icons/mic-off-outline.svg +0 -1
  177. package/icons/mic-outline.svg +0 -1
  178. package/icons/minimize-outline.svg +0 -1
  179. package/icons/minus-circle-outline.svg +0 -1
  180. package/icons/minus-outline.svg +0 -1
  181. package/icons/minus-square-outline.svg +0 -1
  182. package/icons/monitor-outline.svg +0 -1
  183. package/icons/moon-outline.svg +0 -1
  184. package/icons/more-horizontal-outline.svg +0 -1
  185. package/icons/more-vertical-outline.svg +0 -1
  186. package/icons/move-outline.svg +0 -1
  187. package/icons/music-outline.svg +0 -1
  188. package/icons/navigation-2-outline.svg +0 -1
  189. package/icons/navigation-outline.svg +0 -1
  190. package/icons/npm-outline.svg +0 -1
  191. package/icons/options-2-outline.svg +0 -1
  192. package/icons/options-outline.svg +0 -1
  193. package/icons/pantone-outline.svg +0 -1
  194. package/icons/paper-plane-outline.svg +0 -1
  195. package/icons/pause-circle-outline.svg +0 -1
  196. package/icons/people-outline.svg +0 -1
  197. package/icons/percent-outline.svg +0 -1
  198. package/icons/person-add-outline.svg +0 -1
  199. package/icons/person-delete-outline.svg +0 -1
  200. package/icons/person-done-outline.svg +0 -1
  201. package/icons/person-outline.svg +0 -1
  202. package/icons/person-remove-outline.svg +0 -1
  203. package/icons/phone-call-outline.svg +0 -1
  204. package/icons/phone-missed-outline.svg +0 -1
  205. package/icons/phone-off-outline.svg +0 -1
  206. package/icons/phone-outline.svg +0 -1
  207. package/icons/pie-chart-outline.svg +0 -1
  208. package/icons/pin-outline.svg +0 -1
  209. package/icons/play-circle-outline.svg +0 -1
  210. package/icons/plus-circle-outline.svg +0 -1
  211. package/icons/plus-outline.svg +0 -1
  212. package/icons/plus-square-outline.svg +0 -1
  213. package/icons/power-outline.svg +0 -1
  214. package/icons/pricetags-outline.svg +0 -1
  215. package/icons/printer-outline.svg +0 -1
  216. package/icons/question-mark-circle-outline.svg +0 -1
  217. package/icons/question-mark-outline.svg +0 -1
  218. package/icons/radio-button-off-outline.svg +0 -1
  219. package/icons/radio-button-on-outline.svg +0 -1
  220. package/icons/radio-outline.svg +0 -1
  221. package/icons/recording-outline.svg +0 -1
  222. package/icons/refresh-outline.svg +0 -1
  223. package/icons/repeat-outline.svg +0 -1
  224. package/icons/rewind-left-outline.svg +0 -1
  225. package/icons/rewind-right-outline.svg +0 -1
  226. package/icons/save-outline.svg +0 -1
  227. package/icons/scissors-outline.svg +0 -1
  228. package/icons/search-outline.svg +0 -1
  229. package/icons/settings-2-outline.svg +0 -1
  230. package/icons/settings-outline.svg +0 -1
  231. package/icons/shake-outline.svg +0 -1
  232. package/icons/share-outline.svg +0 -1
  233. package/icons/shield-off-outline.svg +0 -1
  234. package/icons/shield-outline.svg +0 -1
  235. package/icons/shopping-bag-outline.svg +0 -1
  236. package/icons/shopping-cart-outline.svg +0 -1
  237. package/icons/shuffle-2-outline.svg +0 -1
  238. package/icons/shuffle-outline.svg +0 -1
  239. package/icons/skip-back-outline.svg +0 -1
  240. package/icons/skip-forward-outline.svg +0 -1
  241. package/icons/slash-outline.svg +0 -1
  242. package/icons/smartphone-outline.svg +0 -1
  243. package/icons/smiling-face-outline.svg +0 -1
  244. package/icons/speaker-outline.svg +0 -1
  245. package/icons/square-outline.svg +0 -1
  246. package/icons/star-outline.svg +0 -1
  247. package/icons/stop-circle-outline.svg +0 -1
  248. package/icons/sun-outline.svg +0 -1
  249. package/icons/swap-outline.svg +0 -1
  250. package/icons/sync-outline.svg +0 -1
  251. package/icons/text-outline.svg +0 -1
  252. package/icons/thermometer-minus-outline.svg +0 -1
  253. package/icons/thermometer-outline.svg +0 -1
  254. package/icons/thermometer-plus-outline.svg +0 -1
  255. package/icons/toggle-left-outline.svg +0 -1
  256. package/icons/toggle-right-outline.svg +0 -1
  257. package/icons/trash-2-outline.svg +0 -1
  258. package/icons/trash-outline.svg +0 -1
  259. package/icons/trending-down-outline.svg +0 -1
  260. package/icons/trending-up-outline.svg +0 -1
  261. package/icons/tv-outline.svg +0 -1
  262. package/icons/twitter-outline.svg +0 -1
  263. package/icons/umbrella-outline.svg +0 -1
  264. package/icons/undo-outline.svg +0 -1
  265. package/icons/unlock-outline.svg +0 -1
  266. package/icons/upload-outline.svg +0 -1
  267. package/icons/video-off-outline.svg +0 -1
  268. package/icons/video-outline.svg +0 -1
  269. package/icons/volume-down-outline.svg +0 -1
  270. package/icons/volume-mute-outline.svg +0 -1
  271. package/icons/volume-off-outline.svg +0 -1
  272. package/icons/volume-up-outline.svg +0 -1
  273. package/icons/wifi-off-outline.svg +0 -1
  274. package/icons/wifi-outline.svg +0 -1
package/js/index.js CHANGED
@@ -18,6 +18,10 @@ import { Dropdown } from "./dropdown.js";
18
18
  import { VirtualDropdown } from "./virtual-dropdown.js";
19
19
  import { TimeSpanPicker } from "./timepicker.js";
20
20
  import { RangeSlider } from "./range-slider.js";
21
+ import { BottomSheet } from "./bottom-sheet.js";
22
+ import { Editor } from "./editor.js";
23
+ import { Stepper } from "./stepper.js";
24
+ import { ContextMenu } from "./context-menu.js";
21
25
  // Generate sample table data
22
26
  const generateData = (count) => {
23
27
  const data = [];
@@ -189,9 +193,9 @@ utils.ready(() => {
189
193
  },
190
194
  });
191
195
  // Initialize code viewer with usage example
192
- const usageTabs = `new Tabs('.horizontal', {
193
- layout: 'horizontal',
194
- defaultTab: 0
196
+ const usageTabs = `new Tabs('.horizontal', {
197
+ layout: 'horizontal',
198
+ defaultTab: 0
195
199
  });`;
196
200
  new CodeViewer("#usage-tabs", usageTabs, "js");
197
201
  // Initialize file uploader
@@ -294,425 +298,519 @@ utils.ready(() => {
294
298
  console.log("Multi Select:", vals);
295
299
  },
296
300
  });
301
+ // Initialize bottom sheet
302
+ const bottomSheetTrigger = document.querySelector('.show-bottom-sheet');
303
+ if (bottomSheetTrigger) {
304
+ bottomSheetTrigger.addEventListener('click', () => {
305
+ const buttons = '<div class="buttons"><button class="button-light">Cancel</button>&nbsp;<button>Confirm</button></div>';
306
+ const sheet = new BottomSheet({
307
+ content: '<p>This is the bottom sheet content. It slides up from the bottom and can be dismissed by dragging down, tapping the backdrop, or pressing Escape.</p>',
308
+ header: 'Bottom Sheet',
309
+ footer: buttons,
310
+ closeable: true,
311
+ snapHeight: 'auto',
312
+ });
313
+ sheet.show();
314
+ });
315
+ }
316
+ // Initialize context menu demo
317
+ new ContextMenu('.context-menu-target', [
318
+ { group: 'File' },
319
+ { label: 'Open', icon: 'folder_open', shortcut: '⌘O', action: () => { } },
320
+ { label: 'Rename', icon: 'edit', shortcut: 'F2', action: () => { } },
321
+ { label: 'Duplicate', icon: 'library_add', action: () => { } },
322
+ 'separator',
323
+ {
324
+ label: 'Share',
325
+ icon: 'send',
326
+ submenu: [
327
+ { label: 'Copy link', icon: 'attachment', action: () => { } },
328
+ { label: 'Send by mail', icon: 'mail', action: () => { } },
329
+ ]
330
+ },
331
+ 'separator',
332
+ { label: 'Delete', icon: 'delete', shortcut: '⌫', destructive: true, action: () => { } },
333
+ ]);
334
+ // Initialize stepper demo
335
+ const stepperEl = document.querySelector('#stepper-demo');
336
+ if (stepperEl) {
337
+ const stepper = new Stepper(stepperEl, { defaultStep: 1 });
338
+ document.querySelector('#stepper-next')?.addEventListener('click', () => stepper.next());
339
+ document.querySelector('#stepper-prev')?.addEventListener('click', () => stepper.prev());
340
+ }
297
341
  // Initialize range sliders
298
342
  RangeSlider.initAll();
299
343
  Tooltip.initializeAll();
344
+ new Editor({ simple: true });
300
345
  const timeSpanPicker = new TimeSpanPicker('timespan-1', {
301
346
  onChange: (start, end) => {
302
347
  console.log(`Start: ${start}, Ende: ${end}`);
303
348
  }
304
349
  });
305
- new CodeViewer("#usage-text-input", `<label for="text-input-demo">Text Input</label>
350
+ new CodeViewer("#usage-text-input", `<label for="text-input-demo">Text Input</label>
306
351
  <input type="text" id="text-input-demo"/>`, "html");
307
- new CodeViewer("#usage-textarea", `<label for="textarea-demo">Text Area</label>
352
+ new CodeViewer("#usage-textarea", `<label for="textarea-demo">Text Area</label>
308
353
  <textarea id="textarea-demo"></textarea>`, "html");
309
- new CodeViewer("#usage-checkbox-demo", `<input class="styled-checkbox"
310
- id="checkbox-1"
311
- type="checkbox"
312
- value="1"
313
- />
354
+ new CodeViewer("#usage-checkbox-demo", `<input class="styled-checkbox"
355
+ id="checkbox-1"
356
+ type="checkbox"
357
+ value="1"
358
+ />
314
359
  <label for="checkbox-1">Checkbox</label>`, "html");
315
360
  });
316
- new CodeViewer("#usage-radiobutton-demo", `<label class="radio-button-container">Three
317
- <input type="radio" name="radio"/>
318
- <span class="checkmark"></span>
361
+ new CodeViewer("#usage-radiobutton-demo", `<label class="radio-button-container">Three
362
+ <input type="radio" name="radio"/>
363
+ <span class="checkmark"></span>
319
364
  </label>`, "html");
320
- new CodeViewer("#usage-switch-demo", `<div class="switch">
321
- <input type="checkbox" id="switch"/><label for="switch">Toggle</label>
365
+ new CodeViewer("#usage-switch-demo", `<div class="switch">
366
+ <input type="checkbox" id="switch"/><label for="switch">Toggle</label>
322
367
  </div>`, "html");
323
- new CodeViewer("#usage-slider-demo", `<div class="range-slider">
324
- <input type="range" min="1" max="100" value="50" />
368
+ new CodeViewer("#usage-slider-demo", `<div class="range-slider">
369
+ <input type="range" min="1" max="100" value="50" />
325
370
  </div>`, "html");
326
- new CodeViewer("#usage-pushmenu-control-demo", `<div class="open-menu">
327
- <div class="navigation-controls">
328
- <input type="checkbox" id="menu-navigation" class="navigation"/>
329
- <label for="menu-navigation">
330
- <span class="icon icon-menu"></span>
331
- </label>
332
- </div>
371
+ new CodeViewer("#usage-pushmenu-control-demo", `<div class="open-menu">
372
+ <div class="navigation-controls">
373
+ <input type="checkbox" id="menu-navigation" class="navigation"/>
374
+ <label for="menu-navigation">
375
+ <span class="icon icon-menu"></span>
376
+ </label>
377
+ </div>
333
378
  </div>`, "html");
334
- new CodeViewer("#usage-pushmenu-demo", `<nav class="push-menu">
335
- <ul>
336
- <li>
337
- <a onclick="window.Scroll.to('#grid')">Grid</a>
338
- </li>
339
- <li>
340
- <a onclick="window.Scroll.to('#typography')">Typography</a>
341
- </li>
342
- </ul>
379
+ new CodeViewer("#usage-pushmenu-demo", `<nav class="push-menu">
380
+ <ul>
381
+ <li>
382
+ <a onclick="window.Scroll.to('#grid')">Grid</a>
383
+ </li>
384
+ <li>
385
+ <a onclick="window.Scroll.to('#typography')">Typography</a>
386
+ </li>
387
+ </ul>
343
388
  </nav>`, "html");
344
389
  new CodeViewer("#usage-pushmenu-script-demo", `PushMenu.init();`, "js");
345
- new CodeViewer("#usage-flyout-script-demo", `const menu = new FlyoutMenu({
346
- direction: "right",
347
- triggerSelector: ".trigger-flyout-menu",
390
+ new CodeViewer("#usage-flyout-script-demo", `const menu = new FlyoutMenu({
391
+ direction: "right",
392
+ triggerSelector: ".trigger-flyout-menu",
348
393
  });`, "js");
349
- new CodeViewer("#usage-flyout-demo", `<div class="flyout-overlay" id="flyoutOverlay"></div>
350
- <div class="flyout-menu" id="flyoutMenu">
351
- <ul>
352
- <li><a href="#">Home</a></li>
353
- <li>
354
- About
355
- <ul>
356
- <li><a href="#">Our Story</a></li>
357
- <li><a href="#">Team</a></li>
358
- <li><a href="#">Careers</a></li>
359
- </ul>
360
- </li>
361
- <li>
362
- Services
363
- <ul>
364
- <li>
365
- Web Design
366
- <ul>
367
- <li><a href="#">eCommerce</a></li>
368
- <li><a href="#">Landing Pages</a></li>
369
- <li><a href="#">Portfolios</a></li>
370
- </ul>
371
- </li>
372
- <li><a href="#">Development</a></li>
373
- <li><a href="#">SEO</a></li>
374
- </ul>
375
- </li>
376
- <li><a href="#">Portfolio</a></li>
377
- <li><a href="#">Contact</a></li>
378
- </ul>
394
+ new CodeViewer("#usage-flyout-demo", `<div class="flyout-overlay" id="flyoutOverlay"></div>
395
+ <div class="flyout-menu" id="flyoutMenu">
396
+ <ul>
397
+ <li><a href="#">Home</a></li>
398
+ <li>
399
+ About
400
+ <ul>
401
+ <li><a href="#">Our Story</a></li>
402
+ <li><a href="#">Team</a></li>
403
+ <li><a href="#">Careers</a></li>
404
+ </ul>
405
+ </li>
406
+ <li>
407
+ Services
408
+ <ul>
409
+ <li>
410
+ Web Design
411
+ <ul>
412
+ <li><a href="#">eCommerce</a></li>
413
+ <li><a href="#">Landing Pages</a></li>
414
+ <li><a href="#">Portfolios</a></li>
415
+ </ul>
416
+ </li>
417
+ <li><a href="#">Development</a></li>
418
+ <li><a href="#">SEO</a></li>
419
+ </ul>
420
+ </li>
421
+ <li><a href="#">Portfolio</a></li>
422
+ <li><a href="#">Contact</a></li>
423
+ </ul>
379
424
  </div>`, "html");
380
- new CodeViewer("#usage-dropdown-menu-demo", `<div class="dropdown-container" id="myDropdown">
381
- <button class="dropdown-trigger">Select Option</button>
382
- <ul class="dropdown-menu">
383
- <li>
384
- <div class="dropdown-item">Profile</div>
385
- </li>
386
- <li>
387
- <div class="dropdown-item">Settings</div>
388
- <ul>
389
- <li>
390
- <div class="dropdown-item">Account</div>
391
- </li>
392
- <li>
393
- <div class="dropdown-item">Privacy</div>
394
- <ul>
395
- <li>
396
- <div class="dropdown-item">Public</div>
397
- </li>
398
- <li>
399
- <div class="dropdown-item">Private</div>
400
- </li>
401
- <li>
402
- <div class="dropdown-item">Friends Only</div>
403
- </li>
404
- </ul>
405
- </li>
406
- <li>
407
- <div class="dropdown-item">Notifications</div>
408
- </li>
409
- </ul>
410
- </li>
411
- <li>
412
- <div class="dropdown-item">Help</div>
413
- </li>
414
- <li>
415
- <div class="dropdown-item">Logout</div>
416
- </li>
417
- </ul>
425
+ new CodeViewer("#usage-dropdown-menu-demo", `<div class="dropdown-container" id="myDropdown">
426
+ <button class="dropdown-trigger">Select Option</button>
427
+ <ul class="dropdown-menu">
428
+ <li>
429
+ <div class="dropdown-item">Profile</div>
430
+ </li>
431
+ <li>
432
+ <div class="dropdown-item">Settings</div>
433
+ <ul>
434
+ <li>
435
+ <div class="dropdown-item">Account</div>
436
+ </li>
437
+ <li>
438
+ <div class="dropdown-item">Privacy</div>
439
+ <ul>
440
+ <li>
441
+ <div class="dropdown-item">Public</div>
442
+ </li>
443
+ <li>
444
+ <div class="dropdown-item">Private</div>
445
+ </li>
446
+ <li>
447
+ <div class="dropdown-item">Friends Only</div>
448
+ </li>
449
+ </ul>
450
+ </li>
451
+ <li>
452
+ <div class="dropdown-item">Notifications</div>
453
+ </li>
454
+ </ul>
455
+ </li>
456
+ <li>
457
+ <div class="dropdown-item">Help</div>
458
+ </li>
459
+ <li>
460
+ <div class="dropdown-item">Logout</div>
461
+ </li>
462
+ </ul>
418
463
  </div>`, "html");
419
- new CodeViewer("#usage-dropdown-menu-js-demo", `const dropdown = new Dropdown("#myDropdown");
420
- const dropdownElement = document.querySelector("#myDropdown");
421
- dropdownElement?.addEventListener("dropdown-select", ((
422
- event: CustomEvent<DropdownSelectDetail>,
423
- ) => {
424
- const { text, element } = event.detail;
425
- console.log("User selected:", text);
426
- console.log("Selected element:", element);
464
+ new CodeViewer("#usage-dropdown-menu-js-demo", `const dropdown = new Dropdown("#myDropdown");
465
+ const dropdownElement = document.querySelector("#myDropdown");
466
+ dropdownElement?.addEventListener("dropdown-select", ((
467
+ event: CustomEvent<DropdownSelectDetail>,
468
+ ) => {
469
+ const { text, element } = event.detail;
470
+ console.log("User selected:", text);
471
+ console.log("Selected element:", element);
427
472
  }) as EventListener);`, "js");
428
- new CodeViewer("#usage-modal-demo", `const modal = new Modal(
429
- "content",
430
- "<strong>header</strong>",
431
- "controls",
432
- true,
433
- "default",
434
- );
473
+ new CodeViewer("#usage-bottom-sheet-demo", `const sheet = new BottomSheet({
474
+ content: '<p>Sheet content here.</p>',
475
+ header: 'Title',
476
+ footer: '<div class="buttons"><button>Confirm</button></div>',
477
+ closeable: true,
478
+ snapHeight: 'auto',
479
+ });
480
+ sheet.show();`, "js");
481
+ new CodeViewer("#usage-modal-demo", `const modal = new Modal(
482
+ "content",
483
+ "<strong>header</strong>",
484
+ "controls",
485
+ true,
486
+ "default",
487
+ );
435
488
  modal.show();`, "js");
436
- new CodeViewer("#usage-toast-demo", `const toast = new Toast(
437
- "some content. maybe even more text in here!",
438
- "some header",
439
- "success",
440
- true,
441
- );
489
+ new CodeViewer("#usage-toast-demo", `const toast = new Toast(
490
+ "some content. maybe even more text in here!",
491
+ "some header",
492
+ "success",
493
+ true,
494
+ );
442
495
  toast.show(3000);`, "js");
443
- new CodeViewer("#usage-tooltip-demo", `<button class="tooltip-trigger" data-tooltip="This is a simple tooltip">
444
- Simple Tooltip
496
+ new CodeViewer("#usage-tooltip-demo", `<button class="tooltip-trigger" data-tooltip="This is a simple tooltip">
497
+ Simple Tooltip
445
498
  </button>`, "html");
446
499
  new CodeViewer("#usage-tooltip-js-demo", `Tooltip.initializeAll();`, "js");
447
500
  new CodeViewer("#usage-spinner-demo", `<div class="spinner"></div>`, "html");
448
501
  new CodeViewer("#usage-loading-demo", `<div class="loading"></div>`, "html");
449
- new CodeViewer("#usage-alerts-demo", `<div class="alert alert-default">
450
- <strong>Default:</strong> This is a default alert message.
502
+ new CodeViewer("#usage-alerts-demo", `<div class="alert alert-default">
503
+ <strong>Default:</strong> This is a default alert message.
451
504
  </div>`, "html");
452
- new CodeViewer("#usage-chips-demo", `<div class="chips">
453
- <div class="chip">Example Chip</div>
454
- <div class="chip clickable">Example Chip with hover</div>
455
- <div class="chip closeable">
456
- Example Chip with closure
457
- <button class="close">
458
- <span class="icon icon-close"></span>
459
- </button>
460
- </div>
505
+ new CodeViewer("#usage-chips-demo", `<div class="chips">
506
+ <div class="chip">Example Chip</div>
507
+ <div class="chip clickable">Example Chip with hover</div>
508
+ <div class="chip closeable">
509
+ Example Chip with closure
510
+ <button class="close">
511
+ <span class="icon icon-close"></span>
512
+ </button>
513
+ </div>
461
514
  </div>`, "html");
462
- new CodeViewer("#usage-accordion-demo", `<div class="accordion">
463
- <div class="accordion-item">
464
- <input
465
- type="radio"
466
- name="accordion"
467
- id="acc1"
468
- class="accordion-input"
469
- checked
470
- />
471
- <label for="acc1" class="accordion-label"> What is this? </label>
472
- <div class="accordion-content">
473
- <div class="accordion-body">
474
- <div>
475
- <p>
476
- This is a pure CSS accordion component. It uses the "Radio
477
- Button Hack" to manage state without a single line of
478
- JavaScript.
479
- </p>
480
- </div>
481
- </div>
482
- </div>
483
- </div>
484
- <div class="accordion-item">
485
- <input
486
- type="radio"
487
- name="accordion"
488
- id="acc2"
489
- class="accordion-input"
490
- />
491
- <label for="acc2" class="accordion-label"> How does it work? </label>
492
- <div class="accordion-content">
493
- <div class="accordion-body">
494
- <div>
495
- <p>It links label elements to hidden radio buttons.</p>
496
- </div>
497
- </div>
498
- </div>
499
- </div>
500
- <div class="accordion-item">
501
- <input
502
- type="radio"
503
- name="accordion"
504
- id="acc3"
505
- class="accordion-input"
506
- />
507
- <label for="acc3" class="accordion-label"> Is it accessible? </label>
508
- <div class="accordion-content">
509
- <div class="accordion-body">
510
- <div>
511
- <p>
512
- It's reasonably accessible as it uses semantic form elements.
513
- Users can tab through the headers (radio inputs) and select
514
- them with the keyboard. However, for full ARIA support, a
515
- small amount of JS is usually recommended to manage
516
- aria-expanded attributes.
517
- </p>
518
- </div>
519
- </div>
520
- </div>
521
- </div>
515
+ new CodeViewer("#usage-stepper-demo", `<div class="stepper">
516
+ <div class="stepper-step completed">
517
+ <div class="stepper-indicator">
518
+ <svg class="icon-svg"><use href="svg-icons/icons.svg#check"/></svg>
519
+ </div>
520
+ <div class="stepper-label">
521
+ <span class="stepper-title">Account</span>
522
+ </div>
523
+ </div>
524
+ <div class="stepper-connector completed"></div>
525
+ <div class="stepper-step active">
526
+ <div class="stepper-indicator">2</div>
527
+ <div class="stepper-label">
528
+ <span class="stepper-title">Profile</span>
529
+ </div>
530
+ </div>
531
+ <div class="stepper-connector"></div>
532
+ <div class="stepper-step">
533
+ <div class="stepper-indicator">3</div>
534
+ <div class="stepper-label">
535
+ <span class="stepper-title">Review</span>
536
+ </div>
537
+ </div>
538
+ </div>
539
+
540
+ const stepper = new Stepper('#my-stepper');
541
+ stepper.next();
542
+ stepper.prev();
543
+ stepper.goTo(2);
544
+ stepper.setError(1);`, "html");
545
+ new CodeViewer("#usage-accordion-demo", `<div class="accordion">
546
+ <div class="accordion-item">
547
+ <input
548
+ type="radio"
549
+ name="accordion"
550
+ id="acc1"
551
+ class="accordion-input"
552
+ checked
553
+ />
554
+ <label for="acc1" class="accordion-label"> What is this? </label>
555
+ <div class="accordion-content">
556
+ <div class="accordion-body">
557
+ <div>
558
+ <p>
559
+ This is a pure CSS accordion component. It uses the "Radio
560
+ Button Hack" to manage state without a single line of
561
+ JavaScript.
562
+ </p>
563
+ </div>
564
+ </div>
565
+ </div>
566
+ </div>
567
+ <div class="accordion-item">
568
+ <input
569
+ type="radio"
570
+ name="accordion"
571
+ id="acc2"
572
+ class="accordion-input"
573
+ />
574
+ <label for="acc2" class="accordion-label"> How does it work? </label>
575
+ <div class="accordion-content">
576
+ <div class="accordion-body">
577
+ <div>
578
+ <p>It links label elements to hidden radio buttons.</p>
579
+ </div>
580
+ </div>
581
+ </div>
582
+ </div>
583
+ <div class="accordion-item">
584
+ <input
585
+ type="radio"
586
+ name="accordion"
587
+ id="acc3"
588
+ class="accordion-input"
589
+ />
590
+ <label for="acc3" class="accordion-label"> Is it accessible? </label>
591
+ <div class="accordion-content">
592
+ <div class="accordion-body">
593
+ <div>
594
+ <p>
595
+ It's reasonably accessible as it uses semantic form elements.
596
+ Users can tab through the headers (radio inputs) and select
597
+ them with the keyboard. However, for full ARIA support, a
598
+ small amount of JS is usually recommended to manage
599
+ aria-expanded attributes.
600
+ </p>
601
+ </div>
602
+ </div>
603
+ </div>
604
+ </div>
522
605
  </div>`, "html");
523
- new CodeViewer("#usage-timeline-demo", `<div class="timeline">
524
- <div class="timeline-item active">
525
- <div class="timeline-content">
526
- <span class="timeline-date">October 12, 2023</span>
527
- <h3 class="timeline-title">Project Kickoff</h3>
528
- <p class="timeline-body">
529
- Initial meeting with shareholders to discuss the scope and
530
- requirements of the project. Team roles were assigned and the
531
- roadmap was drafted.
532
- </p>
533
- </div>
534
- </div>
535
- <div class="timeline-item">
536
- <div class="timeline-content">
537
- <span class="timeline-date">January 15, 2024</span>
538
- <h3 class="timeline-title">Beta Launch</h3>
539
- <p class="timeline-body">
540
- Opened the platform to a closed beta group of 500 users. Collected
541
- feedback regarding the onboarding flow and notification settings.
542
- </p>
543
- </div>
544
- </div>
606
+ new CodeViewer("#usage-timeline-demo", `<div class="timeline">
607
+ <div class="timeline-item active">
608
+ <div class="timeline-content">
609
+ <span class="timeline-date">October 12, 2023</span>
610
+ <h3 class="timeline-title">Project Kickoff</h3>
611
+ <p class="timeline-body">
612
+ Initial meeting with shareholders to discuss the scope and
613
+ requirements of the project. Team roles were assigned and the
614
+ roadmap was drafted.
615
+ </p>
616
+ </div>
617
+ </div>
618
+ <div class="timeline-item">
619
+ <div class="timeline-content">
620
+ <span class="timeline-date">January 15, 2024</span>
621
+ <h3 class="timeline-title">Beta Launch</h3>
622
+ <p class="timeline-body">
623
+ Opened the platform to a closed beta group of 500 users. Collected
624
+ feedback regarding the onboarding flow and notification settings.
625
+ </p>
626
+ </div>
627
+ </div>
545
628
  </div>`, "html");
546
- new CodeViewer("#usage-progress-bar-demo", `<div class="progress-bar">
547
- <div class="progress" style="height: 24px; width: 50%"></div>
629
+ new CodeViewer("#usage-progress-bar-demo", `<div class="progress-bar">
630
+ <div class="progress" style="height: 24px; width: 50%"></div>
548
631
  </div>`, "html");
549
632
  new CodeViewer("#usage-placeholder-demo", `<span class="placeholder w-6">`, "html");
550
- new CodeViewer("#usage-table-demo", `const columns: TableColumn[] = [
551
- { key: "id", label: "ID" },
552
- { key: "name", label: "Name" },
553
- ];
554
- const tableData: TableRow[] = [
555
- { id: 1, name: "John Doe" },
556
- { id: 2, name: "Jane Smith" },
557
- { id: 3, name: "Mike Johnson" },
558
- ];
559
- new Table("#demo-table-js", {
560
- data: tableData,
561
- columns: columns,
562
- pageSize: 10,
563
- });
564
-
565
- // Initialize basic table from html data
633
+ new CodeViewer("#usage-context-menu-demo", `new ContextMenu('.my-element', [
634
+ { group: 'File' },
635
+ { label: 'Open', icon: 'folder_open', shortcut: '⌘O', action: (t) => {} },
636
+ { label: 'Rename', icon: 'edit', shortcut: 'F2', action: (t) => {} },
637
+ 'separator',
638
+ {
639
+ label: 'Share', icon: 'send',
640
+ submenu: [
641
+ { label: 'Copy link', icon: 'attachment', action: (t) => {} },
642
+ { label: 'Send by mail', icon: 'mail', action: (t) => {} },
643
+ ]
644
+ },
645
+ 'separator',
646
+ { label: 'Delete', icon: 'delete', destructive: true, action: (t) => {} },
647
+ ]);`, "javascript");
648
+ new CodeViewer("#usage-table-demo", `const columns: TableColumn[] = [
649
+ { key: "id", label: "ID" },
650
+ { key: "name", label: "Name" },
651
+ ];
652
+ const tableData: TableRow[] = [
653
+ { id: 1, name: "John Doe" },
654
+ { id: 2, name: "Jane Smith" },
655
+ { id: 3, name: "Mike Johnson" },
656
+ ];
657
+ new Table("#demo-table-js", {
658
+ data: tableData,
659
+ columns: columns,
660
+ pageSize: 10,
661
+ });
662
+
663
+ // Initialize basic table from html data
566
664
  new Table("#demo-table", { pageSize: 5 });`, "js");
567
- new CodeViewer("#usage-datepicker-html-demo", `<label for="datepicker-range">Datepicker Range</label>
568
- <input
569
- type="text"
570
- id="datepicker-range"
571
- class="datepicker-input"
572
- placeholder="Select a date range"
573
- readonly
665
+ new CodeViewer("#usage-datepicker-html-demo", `<label for="datepicker-range">Datepicker Range</label>
666
+ <input
667
+ type="text"
668
+ id="datepicker-range"
669
+ class="datepicker-input"
670
+ placeholder="Select a date range"
671
+ readonly
574
672
  />`, "html");
575
- new CodeViewer("#usage-datepicker-js-demo", `new DatePicker("#datepicker-single", {
576
- mode: "single",
577
- onSelect: (date) => {
578
- console.log("Single selected:", date);
579
- },
673
+ new CodeViewer("#usage-datepicker-js-demo", `new DatePicker("#datepicker-single", {
674
+ mode: "single",
675
+ onSelect: (date) => {
676
+ console.log("Single selected:", date);
677
+ },
580
678
  });`, "js");
581
679
  new CodeViewer("#usage-tree-demo-html", `<ul id="tree-root" class="tree"></ul>`, "html");
582
- new CodeViewer("#usage-tree-demo-js", `const sampleData: TreeNode[] = [
583
- new TreeNode("Documents", "folder", [
584
- new TreeNode("Work", "folder", [
585
- new TreeNode("presentation.pptx", "file"),
586
- new TreeNode("report.docx", "file"),
587
- new TreeNode("budget.xlsx", "file"),
588
- ]),
589
- new TreeNode("Personal", "folder", [
590
- new TreeNode("resume.pdf", "file"),
591
- new TreeNode("vacation-photos", "folder", [
592
- new TreeNode("beach.jpg", "file"),
593
- new TreeNode("mountain.jpg", "file"),
594
- ]),
595
- ]),
596
- ]),
597
- ];
680
+ new CodeViewer("#usage-tree-demo-js", `const sampleData: TreeNode[] = [
681
+ new TreeNode("Documents", "folder", [
682
+ new TreeNode("Work", "folder", [
683
+ new TreeNode("presentation.pptx", "file"),
684
+ new TreeNode("report.docx", "file"),
685
+ new TreeNode("budget.xlsx", "file"),
686
+ ]),
687
+ new TreeNode("Personal", "folder", [
688
+ new TreeNode("resume.pdf", "file"),
689
+ new TreeNode("vacation-photos", "folder", [
690
+ new TreeNode("beach.jpg", "file"),
691
+ new TreeNode("mountain.jpg", "file"),
692
+ ]),
693
+ ]),
694
+ ]),
695
+ ];
598
696
  const tree = new TreeComponent("#tree-root", sampleData);`, "js");
599
- new CodeViewer("#usage-file-uploader-demo", `<div class="uploader-content">
600
- <div class="header">
601
- <h2>Upload Files</h2>
602
- <p>Select or drag files to upload</p>
603
- </div>
604
- <div id="drop-zone" class="drop-zone">
605
- <input type="file" id="file-input" multiple hidden/>
606
- <div class="drop-zone-content">
607
- <div class="icon-container">
608
- <svg
609
- xmlns="http://www.w3.org/2000/svg"
610
- width="24"
611
- height="24"
612
- viewBox="0 0 24 24"
613
- fill="none"
614
- stroke="currentColor"
615
- stroke-width="2"
616
- stroke-linecap="round"
617
- stroke-linejoin="round"
618
- class="upload-icon"
619
- >
620
- <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
621
- <polyline points="17 8 12 3 7 8"></polyline>
622
- <line x1="12" y1="3" x2="12" y2="15"></line>
623
- </svg>
624
- </div>
625
- <p class="primary-text">Click to upload or drag and drop</p>
626
- <p class="secondary-text">
627
- SVG, PNG, JPG or GIF (max. 800x400px)
628
- </p>
629
- </div>
630
- </div>
631
-
632
- <div id="file-list" class="file-list"></div>
633
-
634
- <div class="actions">
635
- <button id="upload-btn" disabled>Upload Files</button>
636
- </div>
697
+ new CodeViewer("#usage-file-uploader-demo", `<div class="uploader-content">
698
+ <div class="header">
699
+ <h2>Upload Files</h2>
700
+ <p>Select or drag files to upload</p>
701
+ </div>
702
+ <div id="drop-zone" class="drop-zone">
703
+ <input type="file" id="file-input" multiple hidden/>
704
+ <div class="drop-zone-content">
705
+ <div class="icon-container">
706
+ <svg
707
+ xmlns="http://www.w3.org/2000/svg"
708
+ width="24"
709
+ height="24"
710
+ viewBox="0 0 24 24"
711
+ fill="none"
712
+ stroke="currentColor"
713
+ stroke-width="2"
714
+ stroke-linecap="round"
715
+ stroke-linejoin="round"
716
+ class="upload-icon"
717
+ >
718
+ <path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path>
719
+ <polyline points="17 8 12 3 7 8"></polyline>
720
+ <line x1="12" y1="3" x2="12" y2="15"></line>
721
+ </svg>
722
+ </div>
723
+ <p class="primary-text">Click to upload or drag and drop</p>
724
+ <p class="secondary-text">
725
+ SVG, PNG, JPG or GIF (max. 800x400px)
726
+ </p>
727
+ </div>
728
+ </div>
729
+
730
+ <div id="file-list" class="file-list"></div>
731
+
732
+ <div class="actions">
733
+ <button id="upload-btn" disabled>Upload Files</button>
734
+ </div>
637
735
  </div>`, "html");
638
- new CodeViewer("#usage-file-uploader-demo-js", `const uploaderElement =
639
- document.querySelector<HTMLElement>(".uploader-content");
640
- if (uploaderElement) {
641
- new FileUploader(uploaderElement);
736
+ new CodeViewer("#usage-file-uploader-demo-js", `const uploaderElement =
737
+ document.querySelector<HTMLElement>(".uploader-content");
738
+ if (uploaderElement) {
739
+ new FileUploader(uploaderElement);
642
740
  }`, "js");
643
- new CodeViewer("#usage-virtual-dropdown-demo-html", `<div class="virtual-dropdown">
644
- <h2>1. Searchable Single Select (10,000 items)</h2>
645
- <p>
646
- This list uses virtual scrolling to handle 10k items efficiently.
647
- </p>
648
- <div id="dropdown-single"></div>
741
+ new CodeViewer("#usage-virtual-dropdown-demo-html", `<div class="virtual-dropdown">
742
+ <h2>1. Searchable Single Select (10,000 items)</h2>
743
+ <p>
744
+ This list uses virtual scrolling to handle 10k items efficiently.
745
+ </p>
746
+ <div id="dropdown-single"></div>
649
747
  </div>`, "html");
650
- new CodeViewer("#usage-virtual-dropdown-demo-js", `const singleDropdown = new VirtualDropdown({
651
- container: "#dropdown-single",
652
- options: bigData,
653
- searchable: true,
654
- placeholder: "Search 10k items...",
655
- renderLimit: 15,
656
- onSelect: (val) => {
657
- console.log("Single Select:", val);
658
- },
748
+ new CodeViewer("#usage-virtual-dropdown-demo-js", `const singleDropdown = new VirtualDropdown({
749
+ container: "#dropdown-single",
750
+ options: bigData,
751
+ searchable: true,
752
+ placeholder: "Search 10k items...",
753
+ renderLimit: 15,
754
+ onSelect: (val) => {
755
+ console.log("Single Select:", val);
756
+ },
659
757
  });`, "js");
660
758
  new CodeViewer("#usage-scrollbar-demo", `Scrollbar.initAll(".scroll-container");`, "js");
661
759
  new CodeViewer("#usage-theme-demo", `Theme.init();`, "js");
662
760
  new CodeViewer("#usage-scroll-demo", `window.Scroll.to('#grid')`, "js");
663
- new CodeViewer("#usage-chat-demo-html", `<div class="chat-container">
664
- <div class="message message-incoming">
665
- Hi there! How are you doing today?
666
- <span class="message-meta">10:42 AM</span>
667
- </div>
668
- <div class="message message-outgoing">
669
- I'm doing great, thanks! Just working on some new CSS
670
- components.<br/>And other stuff.
671
- <span class="message-meta">10:43 AM</span>
672
- </div>
673
- <div class="message message-outgoing">
674
- Trying to make a simple chat UI.
675
- <span class="message-meta">10:43 AM</span>
676
- </div>
677
- <div class="message message-incoming">
678
- That sounds cool!
679
- <span class="message-meta">10:45 AM</span>
680
- </div>
761
+ new CodeViewer("#usage-chat-demo-html", `<div class="chat-container">
762
+ <div class="message message-incoming">
763
+ Hi there! How are you doing today?
764
+ <span class="message-meta">10:42 AM</span>
765
+ </div>
766
+ <div class="message message-outgoing">
767
+ I'm doing great, thanks! Just working on some new CSS
768
+ components.<br/>And other stuff.
769
+ <span class="message-meta">10:43 AM</span>
770
+ </div>
771
+ <div class="message message-outgoing">
772
+ Trying to make a simple chat UI.
773
+ <span class="message-meta">10:43 AM</span>
774
+ </div>
775
+ <div class="message message-incoming">
776
+ That sounds cool!
777
+ <span class="message-meta">10:45 AM</span>
778
+ </div>
681
779
  </div>`, "html");
682
- new CodeViewer("#usage-carousel-demo-html", `<div class="carousel" id="carouselIdHere">
683
- <div>Slide 1</div>
684
- <div>Slide 2</div>
685
- <div>Slide 3</div>
686
- <div>Slide 4</div>
780
+ new CodeViewer("#usage-carousel-demo-html", `<div class="carousel" id="carouselIdHere">
781
+ <div>Slide 1</div>
782
+ <div>Slide 2</div>
783
+ <div>Slide 3</div>
784
+ <div>Slide 4</div>
687
785
  </div>`, "html");
688
- new CodeViewer("#usage-carousel-demo-js", `const carousel = new Carousel("#carouselIdHere", {
689
- loop: true,
786
+ new CodeViewer("#usage-carousel-demo-js", `const carousel = new Carousel("#carouselIdHere", {
787
+ loop: true,
690
788
  });`, "js");
691
- new CodeViewer("#usage-gallery-demo-html", `<div id="gallery" class="masonry-container"></div>
692
- <div class="loader hidden">
693
- <div class="spinner"></div>
789
+ new CodeViewer("#usage-gallery-demo-html", `<div id="gallery" class="masonry-container"></div>
790
+ <div class="loader hidden">
791
+ <div class="spinner"></div>
694
792
  </div>`, "html");
695
- new CodeViewer("#usage-gallery-demo-js", `const gallery = new MasonryGallery("gallery", {
696
- minColumnWidth: 300,
697
- fetchFunction: () => new Promise((resolve) => {
698
- setTimeout(() => {
699
- const images: ImageData[] = [];
700
-
701
- for (let i = 0; i < batchSize; i++) {
702
- const width = 400;
703
- const height = Math.floor(Math.random() * 301) + 300;
704
- const id = Math.floor(Math.random() * 1000);
705
- const imageIndex = indexNumber * batchSize + i;
706
-
707
- images.push({
708
- src: \`https://picsum.photos/$\{width}/$\{height}?random=$\{imageIndex}\`,
709
- title: \`Image $\{imageIndex + 1}\`,
710
- desc: \`A random caption for image $\{id}\`,
711
- });
712
- }
713
-
714
- indexNumber++;
715
- resolve(images);
716
- }, 800);
717
- }),
793
+ new CodeViewer("#usage-gallery-demo-js", `const gallery = new MasonryGallery("gallery", {
794
+ minColumnWidth: 300,
795
+ fetchFunction: () => new Promise((resolve) => {
796
+ setTimeout(() => {
797
+ const images: ImageData[] = [];
798
+
799
+ for (let i = 0; i < batchSize; i++) {
800
+ const width = 400;
801
+ const height = Math.floor(Math.random() * 301) + 300;
802
+ const id = Math.floor(Math.random() * 1000);
803
+ const imageIndex = indexNumber * batchSize + i;
804
+
805
+ images.push({
806
+ src: \`https://picsum.photos/$\{width}/$\{height}?random=$\{imageIndex}\`,
807
+ title: \`Image $\{imageIndex + 1}\`,
808
+ desc: \`A random caption for image $\{id}\`,
809
+ });
810
+ }
811
+
812
+ indexNumber++;
813
+ resolve(images);
814
+ }, 800);
815
+ }),
718
816
  });`, "js");