gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit413b11e1413b11e1Record corrected LY7 nesting, exact CSS and Chrome proofmre413b11e1/components/demo/notes-demo.hl

2.5 KB

  1. // components/demo/notes-demo.hl — `/shells/list-first[/:id]`: SHELL 2 as a mock Notes app, signed in. On the phone `/`
  2. // shows only the list (its welcome text is never seen there); a note's route shows only the note, with a link back.
  3. // Desktop: list and note side by side; `/` shows the welcome text beside the list.
  4. parent '../main.hl'
  5. import AppHeader from '../../theme/shell/app-header.hl'
  6. import UserMenu from '../../theme/shell/user-menu.hl'
  7. import ListFirst from '../../theme/shell/list-first.hl'
  8. import { notes } from '../../lib/mock.hl'
  9. id = null
  10. String view = id == null ? 'list' : 'detail'
  11. Hybrid rows = listRows(id)
  12. Hybrid note = noteOf(id)
  13. Boolean hasNote = id != null
  14. Boolean welcome = id == null
  15. Boolean emptyNote = note.paragraphs.length == 0
  16. __title = 'List-first demo · WorldAPI layouts'
  17. // the list with the opened note marked
  18. listRows(at) {
  19. out = []
  20. for (n of notes) { out.push({ href = '/shells/list-first/' + n.id title = n.title updated = n.updated cls = n.id == at ? 'selected' : '' aria = n.id == at ? 'page' : 'false' }) }
  21. return out
  22. }
  23. noteOf(at) {
  24. for (n of notes) { if (n.id == at) { return n } }
  25. return { id = '' title = '' updated = '' paragraphs = [] }
  26. }
  27. Style {
  28. // The note fields retain their shared demo-root selectors.
  29. notesDemo {
  30. noteTitle {
  31. display = 'block'
  32. fontWeight = '600'
  33. color = 'var(--color-text-strong)'
  34. }
  35. noteUpdated {
  36. display = 'block'
  37. fontSize = '.85rem'
  38. color = 'var(--color-text-muted)'
  39. }
  40. noteFilter {
  41. display = 'block'
  42. padding = '.25rem .75rem .75rem'
  43. }
  44. }
  45. }
  46. View {
  47. notesDemo {
  48. AppHeader { brand = "Notes (demo)" brandHref = "/shells/list-first"
  49. UserMenu { name = "Signed in as az5b2 (mock)"
  50. a { href = "/shells" "Settings" }
  51. a { href = "/shells" "Logout" }
  52. }
  53. }
  54. ListFirst { view = view
  55. aside { 'aria-label' = "Notes"
  56. noteFilter { input { type = "search" placeholder = "Filter notes" 'aria-label' = "Filter notes" } }
  57. ul { for (r of rows) { li { a { href = r.href class = r.cls 'aria-current' = r.aria noteTitle { r.title } noteUpdated { r.updated } } } } }
  58. }
  59. main {
  60. if (welcome) {
  61. h1 { "Notes" }
  62. p { class = "muted" "Pick a note on the left. (A phone never shows this text: it opens on the list.)" }
  63. p { class = "links" a { href = "/shells" "‹ Shells" } }
  64. }
  65. if (hasNote) {
  66. a { class = "back" href = "/shells/list-first" "All notes" }
  67. h1 { note.title }
  68. p { class = "muted" "Updated " note.updated }
  69. article { for (t of note.paragraphs) { p { t } } }
  70. if (emptyNote) { p { class = "empty" "This note is empty." } }
  71. }
  72. }
  73. }
  74. }
  75. }

Branches

Latest commits

  • 413b11e1Record corrected LY7 nesting, exact CSS and Chrome proofmre
  • b810453etracker-demo: nest child and compound selectors in Stylemre
  • 0b5b1d61notes-demo: nest child and compound selectors in Stylemre
  • ab22bdc2mail-demo: nest child and compound selectors in Stylemre
  • fe2d8de9home: nest child and compound selectors in Stylemre
  • e631791buser-menu: nest child and compound selectors in Stylemre
  • 69604944three-pane: nest child and compound selectors in Stylemre
  • 3e389b83main-menu: nest child and compound selectors in Stylemre
  • 05413975list-first: nest child and compound selectors in Stylemre
  • c545b642content-first: nest child and compound selectors in Stylemre
  • eae2be7aapp-sidebar: nest child selectors and document caller-slot gapmre
  • 69c9f784Record LY7 slot nesting blocker and minimal repromre
  • b1d4f379app-header: nest child and compound selectors in Stylemre
  • 6385ff8eRecord LY7 style formatting proof and review statusmre
  • 0100f51etracker-demo: format Style with nested rules and bare mediamre
  • 5f82554enotes-demo: format Style with nested rules and bare mediamre
  • 3dc27d78mail-demo: format Style with nested rules and bare mediamre
  • cf9648afhome: format Style with nested rules and bare mediamre
  • 846a6242user-menu: format Style with nested rules and bare mediamre
  • 4d58708cthree-pane: format Style with nested rules and bare mediamre