@sdxc/ui 2026.11.11 → 2026.11.17
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.
- package/README.md +114 -61
- package/dist/app/app-shell-toggle.d.ts +2 -0
- package/dist/app/app-shell-toggle.js +5 -2
- package/dist/app/app-shell.d.ts +25 -1
- package/dist/app/app-shell.js +73 -38
- package/dist/app/auto-refresh.d.ts +2 -0
- package/dist/app/auto-refresh.js +3 -3
- package/dist/app/behaviors/refresh-schedule.d.ts +8 -3
- package/dist/app/behaviors/refresh-schedule.js +4 -3
- package/dist/app/board.d.ts +123 -0
- package/dist/app/board.js +224 -0
- package/dist/app/chart.d.ts +2 -2
- package/dist/app/chart.js +7 -3
- package/dist/app/check-runs.d.ts +116 -0
- package/dist/app/check-runs.js +201 -0
- package/dist/app/code-view.d.ts +172 -0
- package/dist/app/code-view.js +414 -0
- package/dist/app/command-palette.d.ts +38 -3
- package/dist/app/command-palette.js +53 -5
- package/dist/app/contribution-graph.d.ts +106 -0
- package/dist/app/contribution-graph.js +289 -0
- package/dist/app/detail-sheet.d.ts +7 -0
- package/dist/app/detail-sheet.js +7 -7
- package/dist/app/diff.d.ts +200 -0
- package/dist/app/diff.js +702 -0
- package/dist/app/filter-bar.d.ts +20 -0
- package/dist/app/filter-bar.js +35 -15
- package/dist/app/filter-menu.d.ts +144 -0
- package/dist/app/filter-menu.js +480 -0
- package/dist/app/gantt.d.ts +108 -0
- package/dist/app/gantt.js +420 -0
- package/dist/app/index.d.ts +20 -0
- package/dist/app/index.js +20 -0
- package/dist/app/log-viewer.d.ts +120 -0
- package/dist/app/log-viewer.js +384 -0
- package/dist/app/merge-box.d.ts +97 -0
- package/dist/app/merge-box.js +227 -0
- package/dist/app/mixins/app-shell-controls.d.ts +4 -1
- package/dist/app/mixins/app-shell-controls.js +64 -4
- package/dist/app/mixins/auto-refresh.d.ts +5 -2
- package/dist/app/mixins/auto-refresh.js +9 -3
- package/dist/app/mixins/close-popover-on-submit.d.ts +16 -0
- package/dist/app/mixins/close-popover-on-submit.js +32 -0
- package/dist/app/mixins/code-view-selection.d.ts +60 -0
- package/dist/app/mixins/code-view-selection.js +276 -0
- package/dist/app/mixins/command-palette.d.ts +15 -4
- package/dist/app/mixins/command-palette.js +94 -6
- package/dist/app/mixins/contribution-graph-keys.d.ts +19 -0
- package/dist/app/mixins/contribution-graph-keys.js +155 -0
- package/dist/app/mixins/diff-interactions.d.ts +72 -0
- package/dist/app/mixins/diff-interactions.js +269 -0
- package/dist/app/mixins/filter-menu-keys.d.ts +41 -0
- package/dist/app/mixins/filter-menu-keys.js +91 -0
- package/dist/app/mixins/gantt-today.d.ts +17 -0
- package/dist/app/mixins/gantt-today.js +50 -0
- package/dist/app/mixins/log-viewer.d.ts +29 -0
- package/dist/app/mixins/log-viewer.js +347 -0
- package/dist/app/mixins/optimistic-toggle-sync.d.ts +5 -0
- package/dist/app/mixins/optimistic-toggle-sync.js +25 -1
- package/dist/app/mixins/save-bar-sync.d.ts +7 -1
- package/dist/app/mixins/save-bar-sync.js +23 -4
- package/dist/app/mixins/save-status-sync.js +23 -1
- package/dist/app/mixins/split-view.js +1 -1
- package/dist/app/mixins/submit-on-close.d.ts +17 -0
- package/dist/app/mixins/submit-on-close.js +52 -0
- package/dist/app/mixins/tree-filter.d.ts +44 -0
- package/dist/app/mixins/tree-filter.js +111 -0
- package/dist/app/mixins/tree-navigation.d.ts +50 -0
- package/dist/app/mixins/tree-navigation.js +216 -0
- package/dist/app/optimistic-toggle.d.ts +8 -0
- package/dist/app/optimistic-toggle.js +3 -2
- package/dist/app/page-header.d.ts +18 -3
- package/dist/app/page-header.js +105 -50
- package/dist/app/profile-picker.d.ts +47 -0
- package/dist/app/profile-picker.js +104 -0
- package/dist/app/review-thread.d.ts +115 -0
- package/dist/app/review-thread.js +116 -0
- package/dist/app/save-bar.d.ts +5 -0
- package/dist/app/save-bar.js +1 -1
- package/dist/app/save-status.js +1 -1
- package/dist/app/settings-layout.d.ts +5 -0
- package/dist/app/settings-layout.js +5 -5
- package/dist/app/skeleton.d.ts +9 -0
- package/dist/app/skeleton.js +28 -0
- package/dist/app/split-view.d.ts +4 -0
- package/dist/app/split-view.js +3 -3
- package/dist/app/styles/code-tokens.d.ts +24 -0
- package/dist/app/styles/code-tokens.js +47 -0
- package/dist/app/tab-bar.d.ts +59 -0
- package/dist/app/tab-bar.js +111 -0
- package/dist/app/tree.d.ts +111 -14
- package/dist/app/tree.js +202 -15
- package/dist/app/utils/ansi.d.ts +55 -0
- package/dist/app/utils/ansi.js +157 -0
- package/dist/app/utils/diff-rows.d.ts +82 -0
- package/dist/app/utils/diff-rows.js +209 -0
- package/dist/app/utils/fuzzy-path.d.ts +58 -0
- package/dist/app/utils/fuzzy-path.js +202 -0
- package/dist/app/utils/line-range.d.ts +48 -0
- package/dist/app/utils/line-range.js +61 -0
- package/dist/app/utils/log-lines.d.ts +107 -0
- package/dist/app/utils/log-lines.js +170 -0
- package/dist/app/utils/tree-filter.d.ts +19 -0
- package/dist/app/utils/tree-filter.js +26 -0
- package/dist/app/view-options.d.ts +2 -0
- package/dist/app/view-options.js +2 -2
- package/dist/chat/activity.d.ts +72 -0
- package/dist/chat/activity.js +184 -0
- package/dist/chat/composer-submit.d.ts +38 -0
- package/dist/chat/composer-submit.js +44 -0
- package/dist/chat/composer.d.ts +47 -0
- package/dist/chat/composer.js +100 -0
- package/dist/chat/index.d.ts +6 -0
- package/dist/chat/index.js +6 -0
- package/dist/chat/mixins/composer-send.d.ts +32 -0
- package/dist/chat/mixins/composer-send.js +121 -0
- package/dist/chat/mixins/reveal-stream.d.ts +68 -0
- package/dist/chat/mixins/reveal-stream.js +184 -0
- package/dist/chat/mixins/stream-target.d.ts +18 -0
- package/dist/chat/mixins/stream-target.js +38 -0
- package/dist/components/button.js +7 -1
- package/dist/components/character-count.d.ts +44 -0
- package/dist/components/character-count.js +68 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/label-chip.d.ts +42 -0
- package/dist/components/label-chip.js +86 -0
- package/dist/components/property-list.d.ts +9 -2
- package/dist/components/property-list.js +37 -10
- package/dist/components/textarea.js +6 -1
- package/dist/components/timeline.d.ts +62 -5
- package/dist/components/timeline.js +124 -5
- package/dist/docs/code-block.js +8 -31
- package/dist/docs/file-tree.js +3 -48
- package/dist/landing/case-study.d.ts +79 -0
- package/dist/landing/case-study.js +162 -0
- package/dist/landing/contributor-wall.d.ts +72 -0
- package/dist/landing/contributor-wall.js +129 -0
- package/dist/landing/countdown.d.ts +88 -0
- package/dist/landing/countdown.js +91 -0
- package/dist/landing/episode-player.d.ts +87 -0
- package/dist/landing/episode-player.js +113 -0
- package/dist/landing/faq-band.d.ts +3 -2
- package/dist/landing/faq-band.js +4 -3
- package/dist/landing/index.d.ts +7 -0
- package/dist/landing/index.js +7 -0
- package/dist/landing/landing-header.js +15 -4
- package/dist/landing/mixins/countdown-tick.d.ts +29 -0
- package/dist/landing/mixins/countdown-tick.js +65 -0
- package/dist/landing/mixins/usage-estimate-live.d.ts +32 -0
- package/dist/landing/mixins/usage-estimate-live.js +120 -0
- package/dist/landing/phone-frame.d.ts +2 -1
- package/dist/landing/price-list.d.ts +68 -0
- package/dist/landing/price-list.js +125 -0
- package/dist/landing/scroll-scene.d.ts +59 -0
- package/dist/landing/scroll-scene.js +70 -0
- package/dist/landing/sponsor-wall.d.ts +30 -6
- package/dist/landing/sponsor-wall.js +70 -14
- package/dist/landing/typed-terminal.d.ts +24 -6
- package/dist/landing/typed-terminal.js +22 -14
- package/dist/landing/usage-estimate.d.ts +127 -0
- package/dist/landing/usage-estimate.js +164 -0
- package/dist/landing/utils/countdown.d.ts +33 -0
- package/dist/landing/utils/countdown.js +42 -0
- package/dist/landing/utils/pause-toggle.d.ts +2 -1
- package/dist/mixins/character-count.d.ts +62 -0
- package/dist/mixins/character-count.js +139 -0
- package/dist/mixins/index.d.ts +6 -2
- package/dist/mixins/index.js +6 -2
- package/dist/mixins/invoker-fields.d.ts +18 -0
- package/dist/mixins/invoker-fields.js +60 -0
- package/dist/mixins/media-sync.d.ts +58 -0
- package/dist/mixins/media-sync.js +102 -0
- package/dist/mixins/menu-keys.d.ts +11 -0
- package/dist/mixins/menu-keys.js +79 -70
- package/dist/mixins/sortable.d.ts +96 -0
- package/dist/mixins/sortable.js +433 -0
- package/dist/utils/code-lines.d.ts +26 -0
- package/dist/utils/code-lines.js +29 -0
- package/dist/utils/file-icon.d.ts +31 -0
- package/dist/utils/file-icon.js +60 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/write-cookie.d.ts +15 -15
- package/dist/utils/write-cookie.js +10 -16
- package/dist/video/episode-list.d.ts +48 -0
- package/dist/video/episode-list.js +161 -0
- package/dist/video/index.d.ts +15 -0
- package/dist/video/index.js +15 -0
- package/dist/video/mixins/video-player-sync.d.ts +27 -0
- package/dist/video/mixins/video-player-sync.js +413 -0
- package/dist/video/mixins/video-shelf-steps.d.ts +20 -0
- package/dist/video/mixins/video-shelf-steps.js +79 -0
- package/dist/video/title-hero.d.ts +51 -0
- package/dist/video/title-hero.js +170 -0
- package/dist/video/utils/timeline.d.ts +55 -0
- package/dist/video/utils/timeline.js +90 -0
- package/dist/video/video-card.d.ts +51 -0
- package/dist/video/video-card.js +135 -0
- package/dist/video/video-player.d.ts +261 -0
- package/dist/video/video-player.js +927 -0
- package/dist/video/video-shelf.d.ts +58 -0
- package/dist/video/video-shelf.js +155 -0
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -118,23 +118,24 @@ A page that sticks to baseline behavior ships no library JavaScript at all.
|
|
|
118
118
|
|
|
119
119
|
## API
|
|
120
120
|
|
|
121
|
-
| Import | Contains
|
|
122
|
-
| ---------------------- |
|
|
123
|
-
| `@sdxc/ui` | The general components, usable on any page, and their parts.
|
|
124
|
-
| `@sdxc/ui/<name>` | One general component, by its file name: `@sdxc/ui/youtube-embed`.
|
|
125
|
-
| `@sdxc/ui/landing` | Landing bands, composition craft and animated visuals.
|
|
126
|
-
| `@sdxc/ui/docs` | The docs shell, navigation and content blocks.
|
|
127
|
-
| `@sdxc/ui/chat` | The message log, turns, bubbles, markers and attachments.
|
|
128
|
-
| `@sdxc/ui/color` | Colour fields, pickers, sliders, swatches, area and wheel.
|
|
129
|
-
| `@sdxc/ui/app` | Dashboard and workspace components: charts, tables, lists, toasts.
|
|
130
|
-
| `@sdxc/ui
|
|
131
|
-
| `@sdxc/ui
|
|
132
|
-
| `@sdxc/ui/
|
|
133
|
-
| `@sdxc/ui/
|
|
134
|
-
| `@sdxc/ui/
|
|
135
|
-
| `@sdxc/ui/
|
|
136
|
-
| `@sdxc/ui/
|
|
137
|
-
| `@sdxc/ui/
|
|
121
|
+
| Import | Contains |
|
|
122
|
+
| ---------------------- | --------------------------------------------------------------------------------- |
|
|
123
|
+
| `@sdxc/ui` | The general components, usable on any page, and their parts. |
|
|
124
|
+
| `@sdxc/ui/<name>` | One general component, by its file name: `@sdxc/ui/youtube-embed`. |
|
|
125
|
+
| `@sdxc/ui/landing` | Landing bands, composition craft and animated visuals. |
|
|
126
|
+
| `@sdxc/ui/docs` | The docs shell, navigation and content blocks. |
|
|
127
|
+
| `@sdxc/ui/chat` | The message log, turns, bubbles, markers and attachments. |
|
|
128
|
+
| `@sdxc/ui/color` | Colour fields, pickers, sliders, swatches, area and wheel. |
|
|
129
|
+
| `@sdxc/ui/app` | Dashboard and workspace components: charts, tables, lists, toasts. |
|
|
130
|
+
| `@sdxc/ui/video` | A video player, plus the cards, shelves and episode lists a library browses with. |
|
|
131
|
+
| `@sdxc/ui/<ns>/<name>` | One namespace component, by its file name: `@sdxc/ui/docs/steps`. |
|
|
132
|
+
| `@sdxc/ui/mixins` | Opt-in DOM behaviors applied through `mix`. |
|
|
133
|
+
| `@sdxc/ui/behaviors` | Headless state classes built on `TypedEventTarget`. |
|
|
134
|
+
| `@sdxc/ui/animations` | CSS-only motion factories and the `durations`/`easings` tokens. |
|
|
135
|
+
| `@sdxc/ui/styles` | Style recipes composed inside a `mix` array. |
|
|
136
|
+
| `@sdxc/ui/utils` | Framework-free color, chart, geometry, key and DOM helpers; types. |
|
|
137
|
+
| `@sdxc/ui/reset.css` | The base reset in `@layer base`. |
|
|
138
|
+
| `@sdxc/ui/theme.css` | The `--ui-*` semantic variables and the `--ui-chart-1`…`8` palette. |
|
|
138
139
|
|
|
139
140
|
A namespace builds on the general components and never on another namespace, and exports the
|
|
140
141
|
mixins, behaviors and styles only its components use; the shared helper subpaths hold the rest.
|
|
@@ -174,6 +175,8 @@ Every export carries JSDoc, so the editor shows each full signature.
|
|
|
174
175
|
and `<progress>` (indeterminate when `value` is unset).
|
|
175
176
|
- `Select`, `ComboBox`, `SearchField` — a native `<select>` with customizable-select styling, a
|
|
176
177
|
text input with a `<datalist>`, and a `<search>` landmark.
|
|
178
|
+
- `CharacterCount` — island: a ring and the characters left for a limited field; load
|
|
179
|
+
`@sdxc/ui/character-count`, and check `countCharacters()` on the server.
|
|
177
180
|
|
|
178
181
|
### Components: overlays and menus
|
|
179
182
|
|
|
@@ -207,6 +210,7 @@ Every export carries JSDoc, so the editor shows each full signature.
|
|
|
207
210
|
- `Alert` — an inline status panel.
|
|
208
211
|
- `Badge`, `TagGroup` — a status pill, and a labeled set of removable pills.
|
|
209
212
|
- `Spinner` — a busy indicator.
|
|
213
|
+
- `LabelChip` — a label pill in any colour whose text stays readable in both schemes.
|
|
210
214
|
|
|
211
215
|
### Components: layout and content
|
|
212
216
|
|
|
@@ -254,8 +258,16 @@ Landing bands, composition craft and animated visuals. Every piece imports from
|
|
|
254
258
|
- `SequenceDiagram` — animated exchange: `actors` on lifelines and `messages` travelling between them in order.
|
|
255
259
|
- `FanOutDiagram` — animated one-to-many: a `source` reaching every one of its `targets` (`direction="in"` for many-to-one).
|
|
256
260
|
- `EventTicker` — animated activity log: `rows` arriving newest first, a status that can flip with `flipTo`.
|
|
257
|
-
- `TypedTerminal` — animated terminal: input `lines` typing themselves out, then their output.
|
|
261
|
+
- `TypedTerminal` — animated terminal: input `lines` typing themselves out, then their output. `variant="code"` plays on the light code card.
|
|
258
262
|
- `DrawnChart` — animated figure: a `metric` counting up over a `bars` or `line` `series` that draws in.
|
|
263
|
+
- `ScrollScene`, `sceneMotion()` — a pinned stage that plays its parts' keyframes as the reader scrolls, in CSS.
|
|
264
|
+
- `CaseStudy` — one client project as a full-bleed scene with the result it earned.
|
|
265
|
+
- `ContributorWall` — contributors as square tiles, ending on a tile counting the rest.
|
|
266
|
+
- `SponsorWall` — sponsor tiers in ruled grids, then backers; `SponsorWall.Person` takes `showName`.
|
|
267
|
+
- `PriceList` — a menu or price list with dotted leaders, in as many columns as fit.
|
|
268
|
+
- `Countdown`, `countdownParts` — time left until a moment, server-rendered; `live` ticks it (island `@sdxc/ui/landing/countdown`).
|
|
269
|
+
- `EpisodePlayer` — native `<audio>` with chapter and transcript time links (island `@sdxc/ui/landing/episode-player`).
|
|
270
|
+
- `UsageEstimate`, `UsageEstimate.Bill` — a GET-form pricing calculator; `live` re-prices a bill frame as the reader types (island `@sdxc/ui/landing/usage-estimate`).
|
|
259
271
|
|
|
260
272
|
**Composition craft**
|
|
261
273
|
|
|
@@ -316,11 +328,17 @@ one the page uses in the browser entry.
|
|
|
316
328
|
turns, and an attached-file card.
|
|
317
329
|
- `ScrollFollowModel({ pinned? })` — whether the log follows the live edge, visible messages, and
|
|
318
330
|
pending scroll requests.
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
331
|
+
- `Activity` — what an assistant did before replying: a "Thinking" disclosure with `.Summary`,
|
|
332
|
+
`.Note`, `.Steps` and `.Step` (an icon, a running state, output it opens onto).
|
|
333
|
+
- `Composer` — the message form, with `.Input` (grows to twelve lines), `.Toolbar` and `.Hint`;
|
|
334
|
+
`ComposerSubmit` is its send button, Enter to send, and Stop while a reply streams.
|
|
335
|
+
- `revealStream(root)` — replays a server-rendered reply word by word; `streamTarget()` styles it.
|
|
336
|
+
|
|
337
|
+
| Helper | Host | Adds |
|
|
338
|
+
| ----------------------- | ------------------------------------------ | ----------------------------------------------------- |
|
|
339
|
+
| `messageFollow(model)` | `MessageScroller.Viewport` | Follows new turns through a `ScrollFollowModel`. |
|
|
340
|
+
| `attachmentTrigger()` | `Attachment.Trigger` | The whole card as one activation target. |
|
|
341
|
+
| `composerSend(options)` | an element around a composer's send button | Enter to send, clearing, the reply's replay and Stop. |
|
|
324
342
|
|
|
325
343
|
### Color (`@sdxc/ui/color`)
|
|
326
344
|
|
|
@@ -348,12 +366,27 @@ Dashboard and workspace components.
|
|
|
348
366
|
`linearScale`, `bandScale`, `ticks`, `linePath`, `areaPath`, `arcPath`, `pieAngles` and
|
|
349
367
|
`computeMarkerIndices`; `chartPalette()` and `legendToggle()` style its series.
|
|
350
368
|
- `Table` — a table whose `.Column` takes a sort `href` and whose `.LoadMore` row is a link.
|
|
351
|
-
- `GridList`, `Tree` — an interactive row list, and nested `<details>`.
|
|
369
|
+
- `GridList`, `Tree` — an interactive row list, and nested `<details>`. `Tree.Leaf` file rows, `Tree.Filter` (with `Tree.NoMatches`) and `Tree.Navigation` make it a file browser.
|
|
352
370
|
- `DropIndicator` — the bar marking where a dragged row will land.
|
|
353
371
|
- `Toast` — a notification stacked by `Toast.Region`, queued by a `Toaster`.
|
|
354
|
-
- `Skeleton`, `Empty` — a loading block, and an empty-state panel.
|
|
372
|
+
- `Skeleton`, `Empty` — a loading block, and an empty-state panel; `Skeleton.Text` bars real
|
|
373
|
+
content laid out unseen, so a placeholder wraps like its text.
|
|
374
|
+
- `TabBar` — a phone's bottom tab bar that reserves its height and hides where the sidebar shows.
|
|
375
|
+
- `Board` — kanban columns of cards, built on the `sortable()` mixin: a drag or Shift+Arrow moves a
|
|
376
|
+
card and posts the card's own move form, which its menu also submits without script.
|
|
377
|
+
- `Gantt` — a Gantt chart: grouped projects as bars on a month and week axis, with progress, today's line and a
|
|
378
|
+
hatched tail for a late projection.
|
|
355
379
|
- `Toolbar`, `Menubar`, `ContextMenu` — a row of controls, a row of menu triggers, and a
|
|
356
380
|
pointer-positioned menu.
|
|
381
|
+
- `PageHeader` — a screen's title row and tabs; tabs that overflow fold into a More menu.
|
|
382
|
+
- `ProfilePicker` — a shared account's "who is using this?" grid; each `.Profile` is a submit button.
|
|
383
|
+
- `CommandPalette` — a ⌘K command list; `CommandPalette.Finder` is a fuzzy file finder page.
|
|
384
|
+
- `FilterMenu` — a filterable popover of links, radios or checkboxes, posted as a form on close.
|
|
385
|
+
- `CheckRuns`, `MergeBox` — a commit's checks summarised by state, and a merge box that says why it is blocked.
|
|
386
|
+
- `ContributionGraph` — a year of daily counts as a grid of cells.
|
|
387
|
+
- `CodeView` — a whole file with line links from `?L=`, a line menu and blame (island `@sdxc/ui/app/code-view`).
|
|
388
|
+
- `Diff`, `ReviewThread` — a change unified or split with comment links, and a resolvable thread anchored to its lines (island `@sdxc/ui/app/diff`).
|
|
389
|
+
- `LogViewer` — a CI job's log by step, with search and timestamps.
|
|
357
390
|
- `Resizable` — split panes.
|
|
358
391
|
- `ShortcutList` — a `<dl>` pairing actions with key caps.
|
|
359
392
|
- `FileTrigger`, `DropZone` — a button opening the file picker, and a drop target, both over a
|
|
@@ -377,6 +410,23 @@ Dashboard and workspace components.
|
|
|
377
410
|
| `resizeHandle(axis, session)` | `Resizable.Handle` | Pointer resizing through a `ResizeSession`. |
|
|
378
411
|
| `treeKeys(model)` | `Tree` | The ARIA tree pattern over a `SelectionModel`. |
|
|
379
412
|
|
|
413
|
+
### Video (`@sdxc/ui/video`)
|
|
414
|
+
|
|
415
|
+
- `VideoPlayer` — a native `<video>` whose chapters and transcript are written once as data and
|
|
416
|
+
feed its WebVTT tracks, `.Scrubber`, `.Chapters` and `.Transcript`; every time is a `#t=` link
|
|
417
|
+
into the first `.Source`. `.Controls` holds `.Progress`, `.Play`, `.Time`, `.CaptionsToggle`,
|
|
418
|
+
`.Settings`, `.Theater` and `.Fullscreen`, rendered `hidden` behind the native controls until the
|
|
419
|
+
`VideoPlayerSync` island swaps them. `.Settings` takes `.CaptionsMenu`, `.SpeedMenu`,
|
|
420
|
+
`.QualityMenu`, and the page's own `.SettingsToggle` checkboxes and `.SettingsMenu` radio groups,
|
|
421
|
+
which the page reads by `name` from `change` events.
|
|
422
|
+
- `VideoCard` — a title as one link: 16:9 or 2:3 art, a badge, a watched bar, its name and meta.
|
|
423
|
+
- `VideoShelf` — a titled row of `.Item`s that scrolls sideways; `VideoShelfSync` reveals paging
|
|
424
|
+
buttons at its edges.
|
|
425
|
+
- `EpisodeList` — a season as an `<ol>` of `.Item` links with a still, number, runtime, synopsis
|
|
426
|
+
and watched bar.
|
|
427
|
+
- `TitleHero` — a title's art edge to edge under the top bar, faded into the page, with
|
|
428
|
+
`.Eyebrow`, `.Title`, `.Facts`, `.Rating`, `.Summary` and `.Actions`.
|
|
429
|
+
|
|
380
430
|
### Component helpers
|
|
381
431
|
|
|
382
432
|
- `readFormContext(handle): Form.Context | undefined` and
|
|
@@ -391,41 +441,43 @@ Dashboard and workspace components.
|
|
|
391
441
|
|
|
392
442
|
Each mixin module documents why it needs JavaScript and what still works without it.
|
|
393
443
|
|
|
394
|
-
| Mixin | Host
|
|
395
|
-
| ------------------------------- |
|
|
396
|
-
| `activeDescendantKeys()` | a combobox input
|
|
397
|
-
| `ariaChecked()` | checkbox, switch or radio
|
|
398
|
-
| `calendarKeys(model)` | `Calendar.Grid`
|
|
399
|
-
| `carouselControls()` | `Carousel.Viewport`
|
|
400
|
-
| `channelSync()` | a `ColorSlider` group
|
|
401
|
-
| `clearField()` | `SearchField` clear button
|
|
402
|
-
| `comboboxFilter()` | `ComboBox.Input`
|
|
403
|
-
| `commandFilter(model)` | `Command`
|
|
404
|
-
| `commandKeys(model)` | `Command`
|
|
405
|
-
| `copyToClipboard()` | a button
|
|
406
|
-
| `dialogDismiss()` | an element in a `<dialog>`
|
|
407
|
-
| `dismiss(options?)` | an alert or toast
|
|
408
|
-
| `dualRange()` | a two-thumb `Slider`
|
|
409
|
-
| `frameRefresh(options)` | any host in a frame
|
|
410
|
-
| `frameSubmit(options?)` | a `<form>` in a frame
|
|
411
|
-
| `headingLevelFallback(options)` | an island's `HeadingScope`
|
|
412
|
-
| `hotkey(combo)` | a `<dialog>`/`[popover]`
|
|
413
|
-
| `imageFallback()` | an `Avatar`/`Logo` image
|
|
414
|
-
| `
|
|
415
|
-
| `
|
|
416
|
-
| `
|
|
417
|
-
| `
|
|
418
|
-
| `
|
|
419
|
-
| `
|
|
420
|
-
| `
|
|
421
|
-
| `
|
|
422
|
-
| `
|
|
423
|
-
| `
|
|
424
|
-
| `
|
|
425
|
-
| `
|
|
426
|
-
| `
|
|
427
|
-
| `
|
|
428
|
-
| `
|
|
444
|
+
| Mixin | Host | Adds |
|
|
445
|
+
| ------------------------------- | ------------------------------- | ----------------------------------------------------------------------------------- |
|
|
446
|
+
| `activeDescendantKeys()` | a combobox input | Arrows over its `aria-controls` options; Enter follows the chosen link. |
|
|
447
|
+
| `ariaChecked()` | checkbox, switch or radio | `aria-checked` kept in step with the live control. |
|
|
448
|
+
| `calendarKeys(model)` | `Calendar.Grid` | Arrow/Page/Home/End navigation over a `CalendarModel`. |
|
|
449
|
+
| `carouselControls()` | `Carousel.Viewport` | `--ui-prev`, `--ui-next` and `--ui-goto` commands. |
|
|
450
|
+
| `channelSync()` | a `ColorSlider` group | Sibling channel gradients that follow each other. |
|
|
451
|
+
| `clearField()` | `SearchField` clear button | Empties its `commandfor` input. |
|
|
452
|
+
| `comboboxFilter()` | `ComboBox.Input` | As-you-type narrowing. |
|
|
453
|
+
| `commandFilter(model)` | `Command` | Items hidden by a `FilterModel` query. |
|
|
454
|
+
| `commandKeys(model)` | `Command` | Arrow keys over matches; Enter activates the active item's link/button. |
|
|
455
|
+
| `copyToClipboard()` | a button | Copies the text of its `commandfor` target, minus `data-copy-exclude`. |
|
|
456
|
+
| `dialogDismiss()` | an element in a `<dialog>` | Closes the dialog on a backdrop press or a followed link. |
|
|
457
|
+
| `dismiss(options?)` | an alert or toast | Auto-dismiss countdown paused on hover, plus a `--ui-dismiss` command. |
|
|
458
|
+
| `dualRange()` | a two-thumb `Slider` | Thumbs that cannot cross. |
|
|
459
|
+
| `frameRefresh(options)` | any host in a frame | Its frame reloaded on a schedule or an event, resting while hidden. |
|
|
460
|
+
| `frameSubmit(options?)` | a `<form>` in a frame | The form posted through its frame, answered in place in one request. |
|
|
461
|
+
| `headingLevelFallback(options)` | an island's `HeadingScope` | Reports the page's heading depth to `onLevel` once on attach. |
|
|
462
|
+
| `hotkey(combo)` | a `<dialog>`/`[popover]` | A document-wide shortcut toggling its host. |
|
|
463
|
+
| `imageFallback()` | an `Avatar`/`Logo` image | Shows the fallback when the image fails, cached images included. |
|
|
464
|
+
| `invokerFields()` | an element in a target | Presets the target's fields from the opening button's `name`/`value`. |
|
|
465
|
+
| `keymap(bindings)` | any host | Page-wide shortcuts that stand down in fields and foreign dialogs. |
|
|
466
|
+
| `liveFrame(options)` | a text input in a frame | The frame reloaded from `src(value)` once typing pauses. |
|
|
467
|
+
| `listboxKeys()` | `ListBox` | Arrow, Home/End and typeahead navigation. |
|
|
468
|
+
| `longPress(options?)` | any element | Fires after a pointer holds still for `duration`. |
|
|
469
|
+
| `menuKeys(options?)` | `Menu` | The ARIA menu pattern: roving focus, arrows, typeahead. |
|
|
470
|
+
| `mirrorSelectedOption()` | a `<selectedcontent>` | Keeps the customizable select's trigger showing the chosen option. |
|
|
471
|
+
| `otpSlots()` | an `OtpField` group | Focus moving across slots, and pasted codes split. |
|
|
472
|
+
| `persist(key)` | `Sidebar` | The collapsed state saved to a cookie, plus a `--ui-toggle` command. |
|
|
473
|
+
| `pressToggle()` | `ToggleButton` | Flips `aria-pressed` on click. |
|
|
474
|
+
| `rangePreview(model)` | `RangeCalendar.Grid` | Hover and focus preview of the pending range. |
|
|
475
|
+
| `sortable(options?)` | an element in `[data-sortable]` | Drag and Shift+Arrow moves within and between lists, posting each item's move form. |
|
|
476
|
+
| `stepper(options?)` | `NumberField.Group` | Press-and-hold repeat on the step buttons. |
|
|
477
|
+
| `tabKeys(options?)` | `Tabs.List` | Arrow, Home/End tab activation. |
|
|
478
|
+
| `themeToggle(options?)` | any host | `--ui-theme-light`/`-dark`/`-system` commands saved to a cookie. |
|
|
479
|
+
| `validate(schema)` | a form control | A `remix/data-schema` check through `setCustomValidity()`. |
|
|
480
|
+
| `viewTransition()` | a `SharedElement` island | A View Transition across a same-document reload. |
|
|
429
481
|
|
|
430
482
|
Helpers for writing your own:
|
|
431
483
|
|
|
@@ -494,8 +546,9 @@ handled there — no separate landing animation system.
|
|
|
494
546
|
`"?"`); `mod` is Command on Apple keyboards and Control elsewhere.
|
|
495
547
|
- **Fields** — `resolveFieldWiring(id, options)`, `findPairedRangeInputs`.
|
|
496
548
|
- **DOM** — `asCommandEvent`, `dispatchChange`, `isNewPrimaryPress`, `isPrintableKey`, `focusItem`,
|
|
497
|
-
`queryItems`, `setRovingTabindex`, `labelFor`, `hasAccessibleText`, `glyphEdges`, `mergeStyle`, `prefersReducedMotion`, `writeCookie(name, value, maxAgeSeconds?)`,
|
|
549
|
+
`queryItems`, `setRovingTabindex`, `labelFor`, `hasAccessibleText`, `glyphEdges`, `mergeStyle`, `prefersReducedMotion`, `writeCookie(name, value, { maxAgeSeconds?, path? })`,
|
|
498
550
|
`DISABLED_SELECTOR`, `DEFAULT_ICON_ARIA_HIDDEN`, `ONE_YEAR_SECONDS`.
|
|
551
|
+
- **Code** — `codeLines(runs)` splits a highlighter's runs into lines, and `fileIcon(path)` picks a file's icon.
|
|
499
552
|
- **Accessibility checks** — `warnIfNoAccessibleName(props, children, message)` and
|
|
500
553
|
`warnIfNoAccessibleLabel(props, message)`, development-only warnings.
|
|
501
554
|
|
|
@@ -18,6 +18,8 @@ export declare namespace AppShellToggle {
|
|
|
18
18
|
label: string;
|
|
19
19
|
/** The cookie the state is written to. */
|
|
20
20
|
cookieName: string;
|
|
21
|
+
/** The path the cookie is sent under. @default "/" */
|
|
22
|
+
cookiePath?: string;
|
|
21
23
|
/** The sidebar's id, which the sheet opens and closes by. */
|
|
22
24
|
sidebarId: string;
|
|
23
25
|
/** The width under which the sidebar is a sheet and the toggle hides. @default "48rem" */
|
|
@@ -19,7 +19,7 @@ const DEFAULT_SHEET_BELOW = "48rem";
|
|
|
19
19
|
*/
|
|
20
20
|
export const AppShellToggle = clientEntry("@sdxc/ui/app/app-shell-toggle#AppShellToggle", function AppShellToggle(handle) {
|
|
21
21
|
return () => {
|
|
22
|
-
let { collapsed, label, cookieName, sidebarId, sheetBelow = DEFAULT_SHEET_BELOW, } = handle.props;
|
|
22
|
+
let { collapsed, label, cookieName, cookiePath, sidebarId, sheetBelow = DEFAULT_SHEET_BELOW, } = handle.props;
|
|
23
23
|
let { docked, sheet } = appShellQueries(sheetBelow);
|
|
24
24
|
return (_jsxs("label", { "data-slot": "app-shell-toggle", mix: [
|
|
25
25
|
relative(),
|
|
@@ -38,6 +38,9 @@ export const AppShellToggle = clientEntry("@sdxc/ui/app/app-shell-toggle#AppShel
|
|
|
38
38
|
hover([bg("neutral.bg-tint-hover"), fg("neutral.emphasis")]),
|
|
39
39
|
when("&:has(input:focus-visible)", outline({ color: "brand.ring", offset: 2 })),
|
|
40
40
|
when("& > svg", [is("1rem"), bs("1rem")]),
|
|
41
|
-
], children: [_jsx(PanelLeftIcon, { "aria-hidden": "true" }), _jsx("input", { type: "checkbox", "data-app-shell-collapse": true, defaultChecked: collapsed, "aria-label": label, "aria-keyshortcuts": "Meta+B Control+B", mix: [
|
|
41
|
+
], children: [_jsx(PanelLeftIcon, { "aria-hidden": "true" }), _jsx("input", { type: "checkbox", "data-app-shell-collapse": true, defaultChecked: collapsed, "aria-label": label, "aria-keyshortcuts": "Meta+B Control+B", mix: [
|
|
42
|
+
visuallyHidden(),
|
|
43
|
+
appShellControls({ cookieName, cookiePath, sidebarId, sheetBelow }),
|
|
44
|
+
] })] }));
|
|
42
45
|
};
|
|
43
46
|
});
|
package/dist/app/app-shell.d.ts
CHANGED
|
@@ -46,7 +46,12 @@ export declare namespace AppShell {
|
|
|
46
46
|
/** A notice above the whole frame, such as a sandbox banner; it pushes the frame down. */
|
|
47
47
|
banner?: RemixNode;
|
|
48
48
|
/** The screen, rendered inside `<main>`. */
|
|
49
|
-
children
|
|
49
|
+
children?: RemixNode;
|
|
50
|
+
/**
|
|
51
|
+
* Stands in for the top bar and `<main>`, such as a named frame whose content is an
|
|
52
|
+
* {@link AppShell.Pane}, so a link aimed at it reloads the screen and its top bar alone.
|
|
53
|
+
*/
|
|
54
|
+
pane?: RemixNode;
|
|
50
55
|
/** Opens the rail over the content while the pointer rests on it. @default true */
|
|
51
56
|
peek?: boolean;
|
|
52
57
|
/** @default "fill" */
|
|
@@ -56,14 +61,32 @@ export declare namespace AppShell {
|
|
|
56
61
|
* @default "app-shell"
|
|
57
62
|
*/
|
|
58
63
|
id?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Holds the screen to the height under the top bar while the sidebar is docked, so a
|
|
66
|
+
* screen that scrolls inside itself, such as a board, keeps its scrollbars on screen.
|
|
67
|
+
*/
|
|
68
|
+
fill?: boolean;
|
|
59
69
|
/** The collapse cookie's name, for an app with two shells. @default APP_SHELL_COOKIE */
|
|
60
70
|
cookieName?: string;
|
|
71
|
+
/** The path the collapse cookie is sent under, such as one app's own prefix. @default "/" */
|
|
72
|
+
cookiePath?: string;
|
|
61
73
|
/**
|
|
62
74
|
* The width under which the sidebar is a sheet, for a screen whose own panes need the
|
|
63
75
|
* room, such as a three-pane split view at 1024px. @default "48rem"
|
|
64
76
|
*/
|
|
65
77
|
sheetBelow?: SheetBelow;
|
|
66
78
|
}
|
|
79
|
+
/** Props accepted by {@link AppShell.Pane}: the shell props its top bar and `<main>` read. */
|
|
80
|
+
interface PaneProps extends Pick<Props, "collapsed" | "topbar" | "id" | "fill" | "cookieName" | "cookiePath" | "sheetBelow"> {
|
|
81
|
+
labels: Pick<Labels, "menu" | "collapse">;
|
|
82
|
+
/**
|
|
83
|
+
* The document title for the screen. A navigation that reloads only the pane leaves the
|
|
84
|
+
* page's `<title>` behind, so the shell's controls apply this one once it lands.
|
|
85
|
+
*/
|
|
86
|
+
title?: string;
|
|
87
|
+
/** The screen, rendered inside `<main>`. */
|
|
88
|
+
children: RemixNode;
|
|
89
|
+
}
|
|
67
90
|
/** Props accepted by {@link AppShell.Group}. */
|
|
68
91
|
interface GroupProps extends Omit<TagProps<"div">, "title"> {
|
|
69
92
|
/** A plain sentence-case title; it turns into a hairline in the rail. */
|
|
@@ -124,6 +147,7 @@ export declare namespace AppShell {
|
|
|
124
147
|
*/
|
|
125
148
|
export declare function AppShell(handle: Handle<AppShell.Props>): () => import("remix/component").RemixElement;
|
|
126
149
|
export declare namespace AppShell {
|
|
150
|
+
var Pane: (handle: Handle<AppShell.PaneProps>) => () => import("remix/component").RemixElement;
|
|
127
151
|
var Group: (handle: Handle<AppShell.GroupProps>) => () => import("remix/component").RemixElement;
|
|
128
152
|
var Item: (handle: Handle<AppShell.ItemProps>) => () => import("remix/component").RemixElement;
|
|
129
153
|
var Back: (handle: Handle<AppShell.BackProps>) => () => import("remix/component").RemixElement;
|
package/dist/app/app-shell.js
CHANGED
|
@@ -5,6 +5,7 @@ import { bg, fg, outline } from "@sdxc/u/color";
|
|
|
5
5
|
import { rounded } from "@sdxc/u/effects";
|
|
6
6
|
import { mergeMix, raw } from "@sdxc/u/general";
|
|
7
7
|
import { hidden } from "@sdxc/u/layout";
|
|
8
|
+
import { noScrollbar } from "@sdxc/u/overflow";
|
|
8
9
|
import { media, supports } from "@sdxc/u/responsive";
|
|
9
10
|
import { focusVisible, hover, when } from "@sdxc/u/state";
|
|
10
11
|
import { tabularNums, text, truncate, weight } from "@sdxc/u/typography";
|
|
@@ -61,7 +62,7 @@ const EASE = "200ms cubic-bezier(0.2, 0, 0, 1)";
|
|
|
61
62
|
*/
|
|
62
63
|
export function AppShell(handle) {
|
|
63
64
|
return () => {
|
|
64
|
-
let { labels, collapsed = false, workspace, nav, footer, topbar, banner, children, peek = DEFAULT_PEEK, indicator = DEFAULT_INDICATOR, id = DEFAULT_ID, cookieName = APP_SHELL_COOKIE, sheetBelow = DEFAULT_SHEET_BELOW, } = handle.props;
|
|
65
|
+
let { labels, collapsed = false, workspace, nav, footer, topbar, banner, children, pane, peek = DEFAULT_PEEK, indicator = DEFAULT_INDICATOR, id = DEFAULT_ID, cookieName = APP_SHELL_COOKIE, cookiePath, sheetBelow = DEFAULT_SHEET_BELOW, fill = false, } = handle.props;
|
|
65
66
|
let { docked, sheet } = appShellQueries(sheetBelow);
|
|
66
67
|
let sidebarId = `${id}-sidebar`;
|
|
67
68
|
let mainId = `${id}-main`;
|
|
@@ -195,13 +196,19 @@ export function AppShell(handle) {
|
|
|
195
196
|
scrollbarWidth: "thin",
|
|
196
197
|
padding: "0.5rem",
|
|
197
198
|
}),
|
|
199
|
+
/**
|
|
200
|
+
* Classic scrollbars steal inline space from the 52px rail and shift the
|
|
201
|
+
* current row's fill off the icon; the rail stays scrollable by wheel and
|
|
202
|
+
* keyboard with the bar hidden, the way overlay scrollbars already behave.
|
|
203
|
+
*/
|
|
204
|
+
when(`${RAIL_SIDEBAR} &`, noScrollbar()),
|
|
198
205
|
], children: nav }), footer ? (_jsx("div", { "data-slot": "app-shell-sidebar-footer", mix: [
|
|
199
206
|
raw({
|
|
200
207
|
flexShrink: "0",
|
|
201
208
|
padding: "0.5rem",
|
|
202
209
|
paddingBlockEnd: "max(0.5rem, env(safe-area-inset-bottom, 0px))",
|
|
203
210
|
}),
|
|
204
|
-
], children: footer })) : null] }),
|
|
211
|
+
], children: footer })) : null] }), _jsx("div", { "data-slot": "app-shell-content", mix: [
|
|
205
212
|
raw({
|
|
206
213
|
minInlineSize: "0",
|
|
207
214
|
flex: "1 0 auto",
|
|
@@ -229,44 +236,72 @@ export function AppShell(handle) {
|
|
|
229
236
|
zIndex: "1",
|
|
230
237
|
}),
|
|
231
238
|
]),
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
position: "sticky",
|
|
235
|
-
insetBlockStart: "0",
|
|
236
|
-
zIndex: "3",
|
|
237
|
-
display: "flex",
|
|
238
|
-
alignItems: "center",
|
|
239
|
-
gap: "0.5rem",
|
|
240
|
-
blockSize: "var(--ui-app-header-height, 3.5rem)",
|
|
241
|
-
boxSizing: "border-box",
|
|
242
|
-
paddingInline: "0.75rem",
|
|
243
|
-
borderBlockEnd: "1px solid var(--ui-neutral-border)",
|
|
244
|
-
}),
|
|
245
|
-
bg(),
|
|
246
|
-
media(docked, raw({ paddingInline: "1rem" })),
|
|
247
|
-
], children: [_jsx("span", { "data-slot": "app-shell-menu", mix: [
|
|
248
|
-
media(sheet, raw({ display: "inline-flex" })),
|
|
249
|
-
media(docked, raw({ display: "none" })),
|
|
250
|
-
], children: _jsx(Button, { type: "button", variant: "ghost", color: "neutral", size: "sm", popovertarget: sidebarId, "aria-label": labels.menu, children: _jsx(MenuIcon, { size: 16, "aria-hidden": "true" }) }) }), _jsx(AppShellToggle, { collapsed: collapsed, label: labels.collapse, cookieName: cookieName, sidebarId: sidebarId, sheetBelow: sheetBelow }), _jsx("div", { "data-slot": "app-shell-topbar-content", mix: [
|
|
251
|
-
raw({
|
|
252
|
-
display: "flex",
|
|
253
|
-
alignItems: "center",
|
|
254
|
-
gap: "0.5rem",
|
|
255
|
-
flex: "1 1 auto",
|
|
256
|
-
minInlineSize: "0",
|
|
257
|
-
}),
|
|
258
|
-
], children: topbar })] }), _jsx("main", { id: mainId, tabIndex: -1, "data-slot": "app-shell-main", mix: [
|
|
259
|
-
raw({
|
|
260
|
-
"--ui-app-gutter": "var(--ui-app-content-padding, 1rem)",
|
|
261
|
-
display: "block",
|
|
262
|
-
minInlineSize: "0",
|
|
263
|
-
padding: "var(--ui-app-gutter)",
|
|
264
|
-
outline: "none",
|
|
265
|
-
}),
|
|
266
|
-
media(docked, raw({ "--ui-app-gutter": "var(--ui-app-content-padding, 1.5rem)" })),
|
|
267
|
-
], children: children })] })] })] }));
|
|
239
|
+
fill ? media(docked, raw({ display: "flex", flexDirection: "column" })) : [],
|
|
240
|
+
], children: pane ?? (_jsx(AppShell.Pane, { labels: labels, collapsed: collapsed, topbar: topbar, id: id, cookieName: cookieName, cookiePath: cookiePath, sheetBelow: sheetBelow, fill: fill, children: children })) })] })] }));
|
|
268
241
|
};
|
|
269
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* Renders the shell's top bar and `<main>`, the part of the shell a screen changes. `AppShell`
|
|
245
|
+
* draws one itself; render it on its own as the content of a frame passed as `pane`, so a
|
|
246
|
+
* navigation reloads the top bar and the screen together while the sidebar stays put.
|
|
247
|
+
*
|
|
248
|
+
* @param handle Runtime handle carrying the pane's props.
|
|
249
|
+
* @returns The render function producing the top bar and the screen.
|
|
250
|
+
* @example
|
|
251
|
+
* <AppShell.Pane labels={labels} id="tern" topbar={<ModelPicker />}><Chat /></AppShell.Pane>
|
|
252
|
+
*/
|
|
253
|
+
AppShell.Pane = function AppShellPane(handle) {
|
|
254
|
+
return () => {
|
|
255
|
+
let { labels, collapsed = false, topbar, title, children, id = DEFAULT_ID, cookieName = APP_SHELL_COOKIE, cookiePath, sheetBelow = DEFAULT_SHEET_BELOW, fill = false, } = handle.props;
|
|
256
|
+
let { docked, sheet } = appShellQueries(sheetBelow);
|
|
257
|
+
let sidebarId = `${id}-sidebar`;
|
|
258
|
+
let mainId = `${id}-main`;
|
|
259
|
+
return (_jsxs(_Fragment, { children: [_jsxs("header", { "data-slot": "app-shell-topbar", mix: [
|
|
260
|
+
raw({
|
|
261
|
+
position: "sticky",
|
|
262
|
+
insetBlockStart: "0",
|
|
263
|
+
zIndex: "3",
|
|
264
|
+
display: "flex",
|
|
265
|
+
alignItems: "center",
|
|
266
|
+
gap: "0.5rem",
|
|
267
|
+
blockSize: "var(--ui-app-header-height, 3.5rem)",
|
|
268
|
+
boxSizing: "border-box",
|
|
269
|
+
paddingInline: "0.75rem",
|
|
270
|
+
borderBlockEnd: "1px solid var(--ui-neutral-border)",
|
|
271
|
+
}),
|
|
272
|
+
bg(),
|
|
273
|
+
media(docked, raw({ paddingInline: "1rem" })),
|
|
274
|
+
], children: [_jsx("span", { "data-slot": "app-shell-menu", mix: [
|
|
275
|
+
media(sheet, raw({ display: "inline-flex" })),
|
|
276
|
+
media(docked, raw({ display: "none" })),
|
|
277
|
+
], children: _jsx(Button, { type: "button", variant: "ghost", color: "neutral", size: "sm", popovertarget: sidebarId, "aria-label": labels.menu, children: _jsx(MenuIcon, { size: 16, "aria-hidden": "true" }) }) }), _jsx(AppShellToggle, { collapsed: collapsed, label: labels.collapse, cookieName: cookieName, cookiePath: cookiePath, sidebarId: sidebarId, sheetBelow: sheetBelow }), _jsx("div", { "data-slot": "app-shell-topbar-content", mix: [
|
|
278
|
+
raw({
|
|
279
|
+
display: "flex",
|
|
280
|
+
alignItems: "center",
|
|
281
|
+
gap: "0.5rem",
|
|
282
|
+
flex: "1 1 auto",
|
|
283
|
+
minInlineSize: "0",
|
|
284
|
+
}),
|
|
285
|
+
], children: topbar })] }), _jsx("main", { id: mainId, "data-title": title, tabIndex: -1, "data-slot": "app-shell-main", mix: [
|
|
286
|
+
raw({
|
|
287
|
+
"--ui-app-gutter": "var(--ui-app-content-padding, 1rem)",
|
|
288
|
+
display: "block",
|
|
289
|
+
minInlineSize: "0",
|
|
290
|
+
padding: "var(--ui-app-gutter)",
|
|
291
|
+
outline: "none",
|
|
292
|
+
}),
|
|
293
|
+
media(docked, raw({ "--ui-app-gutter": "var(--ui-app-content-padding, 1.5rem)" })),
|
|
294
|
+
fill
|
|
295
|
+
? media(docked, raw({
|
|
296
|
+
display: "flex",
|
|
297
|
+
flexDirection: "column",
|
|
298
|
+
flex: "1 1 0",
|
|
299
|
+
minBlockSize: "0",
|
|
300
|
+
}))
|
|
301
|
+
: [],
|
|
302
|
+
], children: children })] }));
|
|
303
|
+
};
|
|
304
|
+
};
|
|
270
305
|
/**
|
|
271
306
|
* Renders a titled group of rows. The title is a plain label, and in the rail it becomes a
|
|
272
307
|
* hairline so groups stay apart while every icon keeps its place.
|
package/dist/app/auto-refresh.js
CHANGED
|
@@ -51,7 +51,7 @@ export function AutoRefresh(handle) {
|
|
|
51
51
|
let linkFor = hrefFor ??
|
|
52
52
|
((seconds) => setParamHref(url, name, seconds === defaultValue ? null : String(seconds), []));
|
|
53
53
|
let time = refreshedAt ?? new Date();
|
|
54
|
-
let status = (_jsx(AutoRefreshStatus, { every: current * 1000, frame: frame, label: labels.updated, refreshedAt: time.toISOString(), text: new Intl.DateTimeFormat(locale, { timeStyle: "medium", timeZone }).format(time), locale: locale }));
|
|
54
|
+
let status = (_jsx(AutoRefreshStatus, { every: current * 1000, frame: frame, label: labels.updated, refreshedAt: time.toISOString(), text: new Intl.DateTimeFormat(locale, { timeStyle: "medium", timeZone }).format(time), locale: locale, timeZone: timeZone }));
|
|
55
55
|
if (show === "status") {
|
|
56
56
|
return (_jsx("div", { ...rest, "data-slot": "auto-refresh", "data-interval": current, mix: mergeMix([minIs(0), truncate()], mix), children: status }));
|
|
57
57
|
}
|
|
@@ -103,9 +103,9 @@ export const AutoRefreshStatus = clientEntry("@sdxc/ui/app/auto-refresh#AutoRefr
|
|
|
103
103
|
await handle.frames.get(name)?.reload();
|
|
104
104
|
};
|
|
105
105
|
return () => {
|
|
106
|
-
let { every, label, refreshedAt, text: written, locale } = handle.props;
|
|
106
|
+
let { every, label, refreshedAt, text: written, locale, timeZone } = handle.props;
|
|
107
107
|
let [before, after] = aroundTime(label);
|
|
108
|
-
return (_jsxs("span", { "data-slot": "auto-refresh-status", mix: [fg("neutral.muted"), nowrap(), tabularNums()], children: [before, _jsx("time", { dateTime: refreshedAt, mix: [autoRefresh({ every, reload, locale })], children: written }), after] }));
|
|
108
|
+
return (_jsxs("span", { "data-slot": "auto-refresh-status", mix: [fg("neutral.muted"), nowrap(), tabularNums()], children: [before, _jsx("time", { dateTime: refreshedAt, mix: [autoRefresh({ every, reload, locale, timeZone })], children: written }), after] }));
|
|
109
109
|
};
|
|
110
110
|
});
|
|
111
111
|
/**
|
|
@@ -15,7 +15,11 @@ export declare namespace RefreshSchedule {
|
|
|
15
15
|
every: number;
|
|
16
16
|
/** Reloads what the schedule keeps current; a rejection leaves the schedule running. */
|
|
17
17
|
reload: () => Promise<unknown>;
|
|
18
|
-
/**
|
|
18
|
+
/**
|
|
19
|
+
* When the content on screen was last fetched, which the schedule reports until its first
|
|
20
|
+
* reload; the first interval counts from construction, so a cached page reloads on schedule.
|
|
21
|
+
* Defaults to construction time.
|
|
22
|
+
*/
|
|
19
23
|
refreshedAt?: Date;
|
|
20
24
|
}
|
|
21
25
|
/** Events dispatched by {@link RefreshSchedule}. */
|
|
@@ -25,8 +29,9 @@ export declare namespace RefreshSchedule {
|
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
/**
|
|
28
|
-
* Reloads on an interval measured from the last finished reload
|
|
29
|
-
* stacks a second one behind it, and a resume after a long
|
|
32
|
+
* Reloads on an interval measured from the last finished reload (the first from when it was
|
|
33
|
+
* created), so a slow reload never stacks a second one behind it, and a resume after a long
|
|
34
|
+
* pause catches up with one reload.
|
|
30
35
|
*
|
|
31
36
|
* @example let schedule = new RefreshSchedule({ every: 30_000, reload: () => frame.reload() }); schedule.start();
|
|
32
37
|
*/
|
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { TypedEventTarget } from "remix/component";
|
|
10
10
|
/**
|
|
11
|
-
* Reloads on an interval measured from the last finished reload
|
|
12
|
-
* stacks a second one behind it, and a resume after a long
|
|
11
|
+
* Reloads on an interval measured from the last finished reload (the first from when it was
|
|
12
|
+
* created), so a slow reload never stacks a second one behind it, and a resume after a long
|
|
13
|
+
* pause catches up with one reload.
|
|
13
14
|
*
|
|
14
15
|
* @example let schedule = new RefreshSchedule({ every: 30_000, reload: () => frame.reload() }); schedule.start();
|
|
15
16
|
*/
|
|
@@ -32,7 +33,7 @@ export class RefreshSchedule extends TypedEventTarget {
|
|
|
32
33
|
this.every = init.every;
|
|
33
34
|
this.#reload = init.reload;
|
|
34
35
|
this.#refreshedAt = init.refreshedAt ?? new Date();
|
|
35
|
-
this.#attemptedAt =
|
|
36
|
+
this.#attemptedAt = Date.now();
|
|
36
37
|
}
|
|
37
38
|
/** When the last reload finished, or the initial content was fetched. */
|
|
38
39
|
get refreshedAt() {
|