layouts
All repositories: gitoria
2.7 KB
# PaginationPage numbers with Previous and Next, like `Previous 1 … 44 45 46 … 89 Next`. The first and the last page are alwaysthere, the current page with one neighbour each side; "…" stands for the pages left out (a gap of one page shows thatpage instead). At the start it shows `1 2 3 4 … 89 Next`, at the end `Previous 1 … 86 87 88 89`. Previous is missing on thefirst page, Next on the last. The current page is filled with the accent colour (black without a theme).Live demo: https://components.hybriel.worldapi.org/pagination## Use it in an appCopy the folder `components/pagination/` (`pagination.hl`) (optionally `shared/tokens.hl` for the app's own accent; it carries its own `Style`), then compose it into apage and say how many pages there are:```import Pagination from './pagination.hl'View {Pagination { pages = 89 }}```- No script needed. One pagination per page (a composed component's members are the page's state, COMPONENTS.md §12).- `previousLabel` / `nextLabel` are the button texts (default `Previous` / `Next`).- Colours are the semantic tokens only, each with a black/white/grey fallback: the base look is black, white and greys (no frames; root README "Look"); an app that declares the WorldAPI tokens (layouts.worldapi.org's theme) restyles it (the current page: white on black).## Data out (ticket #16)Hand the pagination a function; every click calls it with the page the click goes to:```import Pagination from './pagination.hl'import { navigate } from 'hl:web'page = 1pages = 89goPage = (to) => { navigate('/list/page/' + to) } // or: load page `to` into this page's membersView {Pagination { pages = pages page = page onPage = goPage }}```- `onPage(to)` runs on every click that changes the page — pointer, keyboard (Enter / Space on a focused button) or a script's`click()` — for Previous, Next, a number, the first and the last page; not for "…" and not for the current page. `to` isresolved against the page shown when the button was clicked, then the pagination shows `to` itself.- Why a function and not `emit`: a child's `emit` does not reach its host; the host hands it a function that writes the host'smembers (hybriel#87). Do NOT listen for clicks around the pagination and read a button's text: on a real click the paginationhas already rebuilt its buttons when such a listener runs (tracker#38).- Each button carries its target page in `data-page` (`0` for "…").- Without `onPage` it only pages through itself.## Markup and states`<pagination>` holds a `<nav>` with `<ol id="pagination-items">`; each entry is an `<li>` with a `<button>`: class `page`(the current one also `current`), `step` (Previous / Next), `gap` (the "…", a click does nothing). Narrowscreens: the buttons wrap onto a second line.
Branches
Latest commits
- 740e2abeRe-sync the components copy to c2834dd: media player fixes (state after a queue pick, cover-less audio, accessibility labels)mre
- 7fe103bbMerge mp-player: the media player showcase pagemre
- 7db43c4eMedia route: serve the showcase's media from committed files (storage/ is not in git)mre
- f77b7d12Media player: re-sync components from 1c41293 (replay / forward 10 icons, play button surface on audio and video)mre
- 40a9e69cMP: report, LOG linemre
- 5b5dbf0fMedia player: the component from components.hybriel dd003e5 (sync-components), the showcase page /components/media-player with a queue, its media files served with ranges (lib/media.hl), theme rules (the seek bar, the queue's current item, the radii), the page in the overview listsmre
- 9197159fTake components e54f83a: table lines and one-row desktop toolbar in the theme, Table button gates, a table in the md-editor demomre
- e6322a44UX: report and LOG linemre
- 58c2da6fUX: nav marker without bars; chat composer is one box (files-upload pick mode, showcase); comments state footer + closer reactions row; modal footer rule only for its own footer; gates for all of itmre
- 956f107async components.hybriel 4922f9c: 44 px targets in month-view, date-picker, range-picker, pagination, modal, comments; names follow <html lang> (English default), UTC weekday fix; gate: 390 px target checks, 'edited' hit-area padding; comments showcase 'You are' is a labelled group (SY)mre
- 49940371sessions last 99 years (creator 2026-10-23: logins never expire; only sign out ends them)mre
- 6f7bd392gate: the phone toolbar is two even rows (E2)mre
- 3049c082sync components.hybriel 214c318: MdEditor on a phone, two even toolbar rows of 44 px targets, label 15 px, table head 16 px (E2)mre
- b9a3f85fLOG: MLmre
- 7979397creport ML-mobilemre
- 85d2ed25gate: wordingmre
- 98a311c0gate: 390 px checks for list rows, table word, edited tap target, code in titlesmre
- 769b99d7theme: table cells keep a word whole, code in a title stays text-sized, 'edited' is a 44 px tap target on the phonemre
- c36b7595list rows (notes, mail) stack their parts full width: the date no longer a one-letter column beside the titlemre
- 02aa74aasync components.hybriel 134b4e3: MdEditor builds an editor put into the page at once, redraws a surface put in anew (F5, hybriel#211)mre