@gjermundgaraba/pixel-paper 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +50 -2
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/announcer/announcer.d.ts +35 -0
- package/dist/announcer/announcer.js +121 -0
- package/dist/announcer/index.d.ts +5 -0
- package/dist/announcer/index.js +11 -0
- package/dist/attributes/attributes.d.ts +4 -0
- package/dist/banner/banner.d.ts +20 -0
- package/dist/banner/banner.js +18 -0
- package/dist/banner/index.d.ts +5 -0
- package/dist/banner/index.js +6 -0
- package/dist/bench/bench.d.ts +16 -0
- package/dist/bench/bench.js +12 -0
- package/dist/bench/index.d.ts +5 -0
- package/dist/bench/index.js +6 -0
- package/dist/board/board.d.ts +1151 -0
- package/dist/board/board.js +449 -0
- package/dist/board/index.d.ts +6 -0
- package/dist/board/index.js +21 -0
- package/dist/button/button.d.ts +54 -0
- package/dist/button/button.js +50 -0
- package/dist/button/index.d.ts +5 -0
- package/dist/button/index.js +9 -0
- package/dist/card/card.d.ts +66 -0
- package/dist/card/card.js +70 -0
- package/dist/card/index.d.ts +5 -0
- package/dist/card/index.js +10 -0
- package/dist/chip/chip.d.ts +27 -0
- package/dist/chip/chip.js +34 -0
- package/dist/chip/index.d.ts +5 -0
- package/dist/chip/index.js +9 -0
- package/dist/choice/choice.d.ts +16 -0
- package/dist/choice/choice.js +17 -0
- package/dist/choice/index.d.ts +5 -0
- package/dist/choice/index.js +6 -0
- package/dist/code-editor/code-editor.d.ts +15 -0
- package/dist/code-editor/code-editor.js +22 -0
- package/dist/code-editor/index.d.ts +5 -0
- package/dist/code-editor/index.js +6 -0
- package/dist/code-surface/code-surface.d.ts +12 -0
- package/dist/code-surface/code-surface.js +12 -0
- package/dist/code-surface/index.d.ts +5 -0
- package/dist/code-surface/index.js +6 -0
- package/dist/command-palette/command-palette.d.ts +579 -0
- package/dist/command-palette/command-palette.js +600 -0
- package/dist/command-palette/index.d.ts +9 -0
- package/dist/command-palette/index.js +32 -0
- package/dist/command-palette/keys.d.ts +13 -0
- package/dist/command-palette/keys.js +71 -0
- package/dist/command-palette/match.d.ts +43 -0
- package/dist/command-palette/match.js +45 -0
- package/dist/command-palette/message.d.ts +94 -0
- package/dist/command-palette/message.js +46 -0
- package/dist/confirm-dialog/confirm-dialog.d.ts +287 -0
- package/dist/confirm-dialog/confirm-dialog.js +115 -0
- package/dist/confirm-dialog/index.d.ts +5 -0
- package/dist/confirm-dialog/index.js +17 -0
- package/dist/copy-button/copy-button.d.ts +99 -0
- package/dist/copy-button/copy-button.js +96 -0
- package/dist/copy-button/index.d.ts +5 -0
- package/dist/copy-button/index.js +13 -0
- package/dist/crumbs/crumbs.d.ts +15 -0
- package/dist/crumbs/crumbs.js +11 -0
- package/dist/crumbs/index.d.ts +5 -0
- package/dist/crumbs/index.js +6 -0
- package/dist/deck/deck.d.ts +9 -0
- package/dist/deck/deck.js +9 -0
- package/dist/deck/index.d.ts +5 -0
- package/dist/deck/index.js +6 -0
- package/dist/dialog/dialog.d.ts +278 -0
- package/dist/dialog/dialog.js +145 -0
- package/dist/dialog/fold.d.ts +58 -0
- package/dist/dialog/fold.js +63 -0
- package/dist/dialog/index.d.ts +6 -0
- package/dist/dialog/index.js +21 -0
- package/dist/disclosure/disclosure.d.ts +24 -0
- package/dist/disclosure/disclosure.js +25 -0
- package/dist/disclosure/index.d.ts +5 -0
- package/dist/disclosure/index.js +6 -0
- package/dist/dom/html-element.js +8 -0
- package/dist/drag/drag.d.ts +15 -0
- package/dist/drag/drag.js +123 -0
- package/dist/drop-zone/drop-zone.d.ts +119 -0
- package/dist/drop-zone/drop-zone.js +64 -0
- package/dist/drop-zone/index.d.ts +5 -0
- package/dist/drop-zone/index.js +14 -0
- package/dist/empty-state/empty-state.d.ts +18 -0
- package/dist/empty-state/empty-state.js +16 -0
- package/dist/empty-state/index.d.ts +5 -0
- package/dist/empty-state/index.js +6 -0
- package/dist/error-summary/error-summary.d.ts +34 -0
- package/dist/error-summary/error-summary.js +33 -0
- package/dist/error-summary/index.d.ts +5 -0
- package/dist/error-summary/index.js +6 -0
- package/dist/field/field.d.ts +35 -0
- package/dist/field/field.js +34 -0
- package/dist/field/index.d.ts +5 -0
- package/dist/field/index.js +6 -0
- package/dist/field-grid/field-grid.d.ts +8 -0
- package/dist/field-grid/field-grid.js +8 -0
- package/dist/field-grid/index.d.ts +5 -0
- package/dist/field-grid/index.js +6 -0
- package/dist/fields/fields.js +9 -0
- package/dist/fieldset/fieldset.d.ts +13 -0
- package/dist/fieldset/fieldset.js +13 -0
- package/dist/fieldset/index.d.ts +5 -0
- package/dist/fieldset/index.js +6 -0
- package/dist/filter-chip/filter-chip.d.ts +21 -0
- package/dist/filter-chip/filter-chip.js +28 -0
- package/dist/filter-chip/index.d.ts +5 -0
- package/dist/filter-chip/index.js +6 -0
- package/dist/filter-strip/filter-strip.d.ts +12 -0
- package/dist/filter-strip/filter-strip.js +13 -0
- package/dist/filter-strip/index.d.ts +5 -0
- package/dist/filter-strip/index.js +6 -0
- package/dist/flash-word/flash-word.d.ts +31 -0
- package/dist/flash-word/flash-word.js +31 -0
- package/dist/flash-word/index.d.ts +5 -0
- package/dist/flash-word/index.js +9 -0
- package/dist/focus/focus.d.ts +15 -0
- package/dist/focus/focus.js +17 -0
- package/dist/focus/index.d.ts +5 -0
- package/dist/focus/index.js +9 -0
- package/dist/format/format.js +52 -0
- package/dist/format/index.d.ts +5 -0
- package/dist/format/index.js +6 -0
- package/dist/glyph/glyph.d.ts +9 -0
- package/dist/glyph/glyph.js +25 -0
- package/dist/glyph/glyphs.d.ts +381 -0
- package/dist/glyph/glyphs.js +2603 -0
- package/dist/glyph/index.d.ts +5 -0
- package/dist/glyph/index.js +6 -0
- package/dist/group/group.d.ts +8 -0
- package/dist/group/group.js +9 -0
- package/dist/group/index.d.ts +5 -0
- package/dist/group/index.js +6 -0
- package/dist/history/history.d.ts +34 -0
- package/dist/history/history.js +15 -0
- package/dist/history/index.d.ts +5 -0
- package/dist/history/index.js +6 -0
- package/dist/icon-button/icon-button.d.ts +23 -0
- package/dist/icon-button/icon-button.js +23 -0
- package/dist/icon-button/index.d.ts +5 -0
- package/dist/icon-button/index.js +6 -0
- package/dist/identity/identity.d.ts +15 -0
- package/dist/identity/identity.js +15 -0
- package/dist/identity/index.d.ts +5 -0
- package/dist/identity/index.js +6 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.js +85 -0
- package/dist/inline-input/index.d.ts +5 -0
- package/dist/inline-input/index.js +20 -0
- package/dist/inline-input/inline-input.d.ts +196 -0
- package/dist/inline-input/inline-input.js +212 -0
- package/dist/key-help/index.d.ts +5 -0
- package/dist/key-help/index.js +18 -0
- package/dist/key-help/key-help.d.ts +255 -0
- package/dist/key-help/key-help.js +137 -0
- package/dist/key-hint/index.d.ts +6 -0
- package/dist/key-hint/index.js +12 -0
- package/dist/key-hint/key-hint.d.ts +13 -0
- package/dist/key-hint/key-hint.js +7 -0
- package/dist/key-hint/key-label.d.ts +18 -0
- package/dist/key-hint/key-label.js +77 -0
- package/dist/keymap/keymap.d.ts +11 -0
- package/dist/keymap/keymap.js +9 -0
- package/dist/keys/keys.js +4 -0
- package/dist/line-diff/diff.d.ts +2 -0
- package/dist/line-diff/diff.js +73 -0
- package/dist/line-diff/index.d.ts +6 -0
- package/dist/line-diff/index.js +10 -0
- package/dist/line-diff/line-diff.d.ts +21 -0
- package/dist/line-diff/line-diff.js +75 -0
- package/dist/line-diff/patch.d.ts +15 -0
- package/dist/line-diff/patch.js +120 -0
- package/dist/link-button/index.d.ts +5 -0
- package/dist/link-button/index.js +6 -0
- package/dist/link-button/link-button.d.ts +11 -0
- package/dist/link-button/link-button.js +10 -0
- package/dist/link-state/index.d.ts +5 -0
- package/dist/link-state/index.js +6 -0
- package/dist/link-state/link-state.d.ts +15 -0
- package/dist/link-state/link-state.js +17 -0
- package/dist/live-region/index.d.ts +5 -0
- package/dist/live-region/index.js +9 -0
- package/dist/live-region/live-region.d.ts +39 -0
- package/dist/live-region/live-region.js +33 -0
- package/dist/loading/index.d.ts +5 -0
- package/dist/loading/index.js +6 -0
- package/dist/loading/loading.d.ts +19 -0
- package/dist/loading/loading.js +16 -0
- package/dist/locale/locale.d.ts +3 -0
- package/dist/locale/locale.js +5 -0
- package/dist/mark/index.d.ts +5 -0
- package/dist/mark/index.js +6 -0
- package/dist/mark/mark.d.ts +15 -0
- package/dist/mark/mark.js +30 -0
- package/dist/menu/index.d.ts +7 -0
- package/dist/menu/index.js +25 -0
- package/dist/menu/item.d.ts +236 -0
- package/dist/menu/item.js +19 -0
- package/dist/menu/menu.d.ts +206 -0
- package/dist/menu/menu.js +208 -0
- package/dist/menu/slip.js +163 -0
- package/dist/meter/index.d.ts +5 -0
- package/dist/meter/index.js +6 -0
- package/dist/meter/meter.d.ts +38 -0
- package/dist/meter/meter.js +69 -0
- package/dist/monogram/monogram.js +33 -0
- package/dist/nav-strip/index.d.ts +5 -0
- package/dist/nav-strip/index.js +6 -0
- package/dist/nav-strip/nav-strip.d.ts +19 -0
- package/dist/nav-strip/nav-strip.js +21 -0
- package/dist/notice/index.d.ts +5 -0
- package/dist/notice/index.js +6 -0
- package/dist/notice/notice.d.ts +23 -0
- package/dist/notice/notice.js +35 -0
- package/dist/outcome/index.d.ts +5 -0
- package/dist/outcome/index.js +6 -0
- package/dist/outcome/outcome.d.ts +19 -0
- package/dist/outcome/outcome.js +14 -0
- package/dist/page-head/index.d.ts +5 -0
- package/dist/page-head/index.js +6 -0
- package/dist/page-head/page-head.d.ts +13 -0
- package/dist/page-head/page-head.js +10 -0
- package/dist/panel/index.d.ts +5 -0
- package/dist/panel/index.js +6 -0
- package/dist/panel/panel.d.ts +35 -0
- package/dist/panel/panel.js +25 -0
- package/dist/password-field/index.d.ts +5 -0
- package/dist/password-field/index.js +6 -0
- package/dist/password-field/password-field.d.ts +33 -0
- package/dist/password-field/password-field.js +39 -0
- package/dist/places/index.d.ts +5 -0
- package/dist/places/index.js +6 -0
- package/dist/places/places.d.ts +32 -0
- package/dist/places/places.js +22 -0
- package/dist/props-list/index.d.ts +5 -0
- package/dist/props-list/index.js +6 -0
- package/dist/props-list/props-list.d.ts +18 -0
- package/dist/props-list/props-list.js +12 -0
- package/dist/prose/index.d.ts +5 -0
- package/dist/prose/index.js +6 -0
- package/dist/prose/prose.d.ts +14 -0
- package/dist/prose/prose.js +6 -0
- package/dist/query-chip/index.d.ts +5 -0
- package/dist/query-chip/index.js +6 -0
- package/dist/query-chip/query-chip.d.ts +18 -0
- package/dist/query-chip/query-chip.js +17 -0
- package/dist/radio-choices/index.d.ts +5 -0
- package/dist/radio-choices/index.js +12 -0
- package/dist/radio-choices/radio-choices.d.ts +105 -0
- package/dist/radio-choices/radio-choices.js +56 -0
- package/dist/rail/index.d.ts +5 -0
- package/dist/rail/index.js +22 -0
- package/dist/rail/rail.d.ts +403 -0
- package/dist/rail/rail.js +355 -0
- package/dist/reel/index.d.ts +6 -0
- package/dist/reel/index.js +26 -0
- package/dist/reel/layout.d.ts +58 -0
- package/dist/reel/layout.js +378 -0
- package/dist/reel/reel.d.ts +1070 -0
- package/dist/reel/reel.js +1019 -0
- package/dist/remote/index.d.ts +5 -0
- package/dist/remote/index.js +6 -0
- package/dist/remote/remote.d.ts +28 -0
- package/dist/remote/remote.js +41 -0
- package/dist/rows/index.d.ts +5 -0
- package/dist/rows/index.js +12 -0
- package/dist/rows/rows.d.ts +116 -0
- package/dist/rows/rows.js +67 -0
- package/dist/scheme/index.d.ts +6 -0
- package/dist/scheme/index.js +10 -0
- package/dist/scheme/scheme-switch.d.ts +98 -0
- package/dist/scheme/scheme-switch.js +118 -0
- package/dist/scheme/scheme.d.ts +5 -0
- package/dist/scheme/scheme.js +16 -0
- package/dist/scheme/script.d.ts +8 -0
- package/dist/scheme/script.js +10 -0
- package/dist/secret/index.d.ts +5 -0
- package/dist/secret/index.js +6 -0
- package/dist/secret/secret.d.ts +13 -0
- package/dist/secret/secret.js +9 -0
- package/dist/segmented/index.d.ts +5 -0
- package/dist/segmented/index.js +6 -0
- package/dist/segmented/segmented.d.ts +17 -0
- package/dist/segmented/segmented.js +17 -0
- package/dist/select-field/index.d.ts +5 -0
- package/dist/select-field/index.js +6 -0
- package/dist/select-field/select-field.d.ts +38 -0
- package/dist/select-field/select-field.js +29 -0
- package/dist/sheet/index.d.ts +5 -0
- package/dist/sheet/index.js +6 -0
- package/dist/sheet/sheet.d.ts +16 -0
- package/dist/sheet/sheet.js +15 -0
- package/dist/skip-link/index.d.ts +5 -0
- package/dist/skip-link/index.js +9 -0
- package/dist/skip-link/skip-link.d.ts +23 -0
- package/dist/skip-link/skip-link.js +36 -0
- package/dist/slot/slot.js +8 -0
- package/dist/sortable/index.d.ts +5 -0
- package/dist/sortable/index.js +16 -0
- package/dist/sortable/sortable.d.ts +1125 -0
- package/dist/sortable/sortable.js +431 -0
- package/dist/stack/index.d.ts +5 -0
- package/dist/stack/index.js +6 -0
- package/dist/stack/stack.d.ts +15 -0
- package/dist/stack/stack.js +12 -0
- package/dist/stage/index.d.ts +5 -0
- package/dist/stage/index.js +6 -0
- package/dist/stage/stage.d.ts +14 -0
- package/dist/stage/stage.js +11 -0
- package/dist/stat/index.d.ts +5 -0
- package/dist/stat/index.js +6 -0
- package/dist/stat/stat.d.ts +18 -0
- package/dist/stat/stat.js +13 -0
- package/dist/status-bar/index.d.ts +6 -0
- package/dist/status-bar/index.js +11 -0
- package/dist/status-bar/status-bar.d.ts +28 -0
- package/dist/status-bar/status-bar.js +19 -0
- package/dist/subscription/prefix-keys.js +12 -0
- package/dist/table/index.d.ts +5 -0
- package/dist/table/index.js +6 -0
- package/dist/table/table.d.ts +26 -0
- package/dist/table/table.js +18 -0
- package/dist/tabs/index.d.ts +5 -0
- package/dist/tabs/index.js +14 -0
- package/dist/tabs/tabs.d.ts +125 -0
- package/dist/tabs/tabs.js +57 -0
- package/dist/tag/index.d.ts +5 -0
- package/dist/tag/index.js +6 -0
- package/dist/tag/tag.d.ts +16 -0
- package/dist/tag/tag.js +25 -0
- package/dist/text-button/index.d.ts +5 -0
- package/dist/text-button/index.js +6 -0
- package/dist/text-button/text-button.d.ts +8 -0
- package/dist/text-button/text-button.js +12 -0
- package/dist/textarea-field/index.d.ts +5 -0
- package/dist/textarea-field/index.js +6 -0
- package/dist/textarea-field/textarea-field.d.ts +28 -0
- package/dist/textarea-field/textarea-field.js +30 -0
- package/dist/time/index.d.ts +5 -0
- package/dist/time/index.js +9 -0
- package/dist/time/time.d.ts +38 -0
- package/dist/time/time.js +63 -0
- package/dist/tips/index.d.ts +5 -0
- package/dist/tips/index.js +14 -0
- package/dist/tips/tips.d.ts +339 -0
- package/dist/tips/tips.js +308 -0
- package/dist/toast/index.d.ts +5 -0
- package/dist/toast/index.js +17 -0
- package/dist/toast/stack.d.ts +7 -0
- package/dist/toast/stack.js +23 -0
- package/dist/toast/toast.d.ts +559 -0
- package/dist/toast/toast.js +269 -0
- package/dist/toc/index.d.ts +5 -0
- package/dist/toc/index.js +9 -0
- package/dist/toc/toc.d.ts +42 -0
- package/dist/toc/toc.js +35 -0
- package/dist/top-bar/bar-height.d.ts +26 -0
- package/dist/top-bar/bar-height.js +43 -0
- package/dist/top-bar/index.d.ts +6 -0
- package/dist/top-bar/index.js +12 -0
- package/dist/top-bar/top-bar.d.ts +19 -0
- package/dist/top-bar/top-bar.js +18 -0
- package/dist/wall/index.d.ts +5 -0
- package/dist/wall/index.js +9 -0
- package/dist/wall/wall.d.ts +16 -0
- package/dist/wall/wall.js +15 -0
- package/dist/window/index.d.ts +5 -0
- package/dist/window/index.js +6 -0
- package/dist/window/window.d.ts +28 -0
- package/dist/window/window.js +29 -0
- package/dist/wordmark/index.d.ts +5 -0
- package/dist/wordmark/index.js +6 -0
- package/dist/wordmark/wordmark.d.ts +10 -0
- package/dist/wordmark/wordmark.js +10 -0
- package/dist/wrap/index.d.ts +5 -0
- package/dist/wrap/index.js +6 -0
- package/dist/wrap/wrap.d.ts +12 -0
- package/dist/wrap/wrap.js +9 -0
- package/fonts/DepartureMono-Regular.woff2 +0 -0
- package/fonts/LICENSE.txt +2 -0
- package/package.json +57 -3
- package/src/pixel-paper.css +4611 -0
- package/src/tokens.css +151 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Gjermund Garaba
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,51 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @gjermundgaraba/pixel-paper
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Printed paper panels for [Foldkit](https://foldkit.dev) applications: Departure Mono, 2px ink borders, solid offset shadows, 12×12 pixel glyphs, paper and plum palettes. For dense working interfaces: queues, boards, consoles, editors.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @gjermundgaraba/pixel-paper foldkit @foldkit/ui effect @effect/platform-browser
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Foldkit pins `effect` and `@effect/platform-browser` exactly as peers. An app on a later patch keeps one Effect instance by allowing it:
|
|
12
|
+
|
|
13
|
+
```yaml
|
|
14
|
+
# pnpm-workspace.yaml
|
|
15
|
+
peerDependencyRules:
|
|
16
|
+
allowedVersions:
|
|
17
|
+
effect: <the app's version>
|
|
18
|
+
"@effect/platform-browser": <the app's version>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Set up
|
|
22
|
+
|
|
23
|
+
The views ship branded for Foldkit's view identity, so the app's build needs only `foldkit()`. Import the stylesheet once, from the client entry:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import "@gjermundgaraba/pixel-paper/pixel-paper.css";
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The stylesheet follows the reader's colour scheme. `Scheme.SchemeSwitch` lets them pin one, and `schemeScript` applies it before first paint; write it into the head:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { schemeScript } from "@gjermundgaraba/pixel-paper/scheme";
|
|
33
|
+
|
|
34
|
+
export default defineConfig({
|
|
35
|
+
plugins: [
|
|
36
|
+
foldkit(),
|
|
37
|
+
{
|
|
38
|
+
name: "scheme-script",
|
|
39
|
+
transformIndexHtml: () => [
|
|
40
|
+
{ tag: "script", children: schemeScript, injectTo: "head-prepend" },
|
|
41
|
+
],
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Provide `Clipboard.layer` as the application's resources where a component copies.
|
|
48
|
+
|
|
49
|
+
## Licence
|
|
50
|
+
|
|
51
|
+
MIT. Departure Mono, in `fonts/`, carries its own licence beside it.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
// \0rolldown/runtime.js
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __exportAll = (all, no_symbols) => {
|
|
5
|
+
let target = {};
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: true
|
|
9
|
+
});
|
|
10
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
11
|
+
return __foldkitBrandViewResult((target), "@gjermundgaraba/pixel-paper/_virtual/_rolldown/runtime.js#__exportAll");
|
|
12
|
+
};
|
|
13
|
+
export { __exportAll };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
import * as Command from "foldkit/command";
|
|
3
|
+
import { Html, HtmlBuilder } from "foldkit/html";
|
|
4
|
+
/** The attribute that marks the page's live region, which a test finds it by: Loading's line
|
|
5
|
+
* is a `role="status"` too, so counting that role counts more than the one region. */
|
|
6
|
+
export declare const ANNOUNCER_ATTRIBUTE = "data-pixel-paper-announcer";
|
|
7
|
+
/**
|
|
8
|
+
* The page's one polite live region, empty until something is said. Render exactly one,
|
|
9
|
+
* placed by the rule every pixel-paper application follows, because an open Dialog makes
|
|
10
|
+
* everything outside it inert and hidden from screen readers: inside the topmost open Dialog,
|
|
11
|
+
* otherwise at the end of the body. `LiveRegion.view` renders it with the toast stack, and
|
|
12
|
+
* `LiveRegion.place` puts them where the rule says.
|
|
13
|
+
*/
|
|
14
|
+
export declare const view: <Message>(h: HtmlBuilder<Message>) => Html;
|
|
15
|
+
/**
|
|
16
|
+
* Says `text` to screen readers through the page's live region (see `view`). Words said in
|
|
17
|
+
* the same moment are read together, and the region clears first, so the same words twice
|
|
18
|
+
* are read twice. Without a region on the page it does nothing. Reports `CompletedAnnounce`.
|
|
19
|
+
*/
|
|
20
|
+
export declare const Announce: Command.CommandDefinitionWithArgs<"Announce", {
|
|
21
|
+
text: Schema.String;
|
|
22
|
+
}, Effect.Effect<{
|
|
23
|
+
readonly _tag: "CompletedAnnounce";
|
|
24
|
+
}, never, never>>;
|
|
25
|
+
/**
|
|
26
|
+
* Inverts the element `selector` finds for one beat (`--motion-flash`): the signal that a
|
|
27
|
+
* change was committed. A second flash mid-beat restarts it. With `prefers-reduced-motion`
|
|
28
|
+
* it holds a still 2px ink ring for the beat instead. Return it beside `Announce`, which says
|
|
29
|
+
* what the flash shows. Reports `CompletedFlash`.
|
|
30
|
+
*/
|
|
31
|
+
export declare const Flash: Command.CommandDefinitionWithArgs<"Flash", {
|
|
32
|
+
selector: Schema.String;
|
|
33
|
+
}, Effect.Effect<{
|
|
34
|
+
readonly _tag: "CompletedFlash";
|
|
35
|
+
}, never, never>>;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { Array, Duration, Effect, Option, Schema, pipe } from "effect";
|
|
3
|
+
import * as Command from "foldkit/command";
|
|
4
|
+
import { defineMessageUnion } from "foldkit/message";
|
|
5
|
+
import * as Render from "foldkit/render";
|
|
6
|
+
// src/announcer/announcer.ts
|
|
7
|
+
/** What `Announce` and `Flash` report. An application that runs them puts
|
|
8
|
+
* `CompletedAnnounce: {}` and `CompletedFlash: {}` in its own Message union, which these tags
|
|
9
|
+
* match, and its update changes nothing for them. */
|
|
10
|
+
const Message = defineMessageUnion({
|
|
11
|
+
CompletedAnnounce: {},
|
|
12
|
+
CompletedFlash: {}
|
|
13
|
+
});
|
|
14
|
+
/** The attribute that marks the page's live region, which a test finds it by: Loading's line
|
|
15
|
+
* is a `role="status"` too, so counting that role counts more than the one region. */
|
|
16
|
+
const ANNOUNCER_ATTRIBUTE = "data-pixel-paper-announcer";
|
|
17
|
+
const ANNOUNCER_SELECTOR = `[${ANNOUNCER_ATTRIBUTE}]`;
|
|
18
|
+
/**
|
|
19
|
+
* The page's one polite live region, empty until something is said. Render exactly one,
|
|
20
|
+
* placed by the rule every pixel-paper application follows, because an open Dialog makes
|
|
21
|
+
* everything outside it inert and hidden from screen readers: inside the topmost open Dialog,
|
|
22
|
+
* otherwise at the end of the body. `LiveRegion.view` renders it with the toast stack, and
|
|
23
|
+
* `LiveRegion.place` puts them where the rule says.
|
|
24
|
+
*/
|
|
25
|
+
const view = (h) => __foldkitBrandViewResult((h.div([
|
|
26
|
+
h.Class("sr-only"),
|
|
27
|
+
h.Role("status"),
|
|
28
|
+
h.AriaLive("polite"),
|
|
29
|
+
h.Attribute(ANNOUNCER_ATTRIBUTE, "")
|
|
30
|
+
])), "@gjermundgaraba/pixel-paper/announcer/announcer.js#view");
|
|
31
|
+
const GATHER = Duration.millis(30);
|
|
32
|
+
const PENDING_ATTRIBUTE = "data-pixel-paper-announcing";
|
|
33
|
+
const topmostRegion = () => {
|
|
34
|
+
const regions = Array.fromIterable(document.querySelectorAll(ANNOUNCER_SELECTOR));
|
|
35
|
+
return __foldkitBrandViewResult((Option.orElse(Array.findLast(regions, (region) => __foldkitBrandViewResult((region.closest("dialog[open]") !== null), "@gjermundgaraba/pixel-paper/announcer/announcer.js#anonymous")), () => __foldkitBrandViewResult((Array.last(regions)), "@gjermundgaraba/pixel-paper/announcer/announcer.js#anonymous~2"))), "@gjermundgaraba/pixel-paper/announcer/announcer.js#topmostRegion");
|
|
36
|
+
};
|
|
37
|
+
const gather = (region, text) => {
|
|
38
|
+
const maybePending = Option.fromNullishOr(region.getAttribute(PENDING_ATTRIBUTE));
|
|
39
|
+
region.setAttribute(PENDING_ATTRIBUTE, Option.match(maybePending, {
|
|
40
|
+
onNone: () => __foldkitBrandViewResult((text), "@gjermundgaraba/pixel-paper/announcer/announcer.js#onNone"),
|
|
41
|
+
onSome: (said) => __foldkitBrandViewResult((`${said} ${text}`), "@gjermundgaraba/pixel-paper/announcer/announcer.js#onSome")
|
|
42
|
+
}));
|
|
43
|
+
return __foldkitBrandViewResult((Option.isNone(maybePending)), "@gjermundgaraba/pixel-paper/announcer/announcer.js#gather");
|
|
44
|
+
};
|
|
45
|
+
const speak = (region) => {
|
|
46
|
+
region.textContent = region.getAttribute(PENDING_ATTRIBUTE) ?? "";
|
|
47
|
+
region.removeAttribute(PENDING_ATTRIBUTE);
|
|
48
|
+
};
|
|
49
|
+
const sayIn = (region, text) => __foldkitBrandViewResult((Effect.gen(function* () {
|
|
50
|
+
if (!(yield* Effect.sync(() => __foldkitBrandViewResult((gather(region, text)), "@gjermundgaraba/pixel-paper/announcer/announcer.js#anonymous~4")))) return;
|
|
51
|
+
yield* Effect.sync(() => {
|
|
52
|
+
region.textContent = "";
|
|
53
|
+
});
|
|
54
|
+
yield* Effect.sleep(GATHER);
|
|
55
|
+
yield* Effect.sync(() => {
|
|
56
|
+
speak(region);
|
|
57
|
+
});
|
|
58
|
+
})), "@gjermundgaraba/pixel-paper/announcer/announcer.js#sayIn");
|
|
59
|
+
const announce = (text) => __foldkitBrandViewResult((Effect.gen(function* () {
|
|
60
|
+
yield* Render.afterCommit;
|
|
61
|
+
const maybeRegion = yield* Effect.sync(topmostRegion);
|
|
62
|
+
yield* Option.match(maybeRegion, {
|
|
63
|
+
onNone: () => __foldkitBrandViewResult((Effect.void), "@gjermundgaraba/pixel-paper/announcer/announcer.js#onNone~2"),
|
|
64
|
+
onSome: (region) => __foldkitBrandViewResult((sayIn(region, text)), "@gjermundgaraba/pixel-paper/announcer/announcer.js#onSome~2")
|
|
65
|
+
});
|
|
66
|
+
})), "@gjermundgaraba/pixel-paper/announcer/announcer.js#announce");
|
|
67
|
+
const FLASH_ID = "pixel-paper-flash";
|
|
68
|
+
const TIME = /^(?<amount>(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(?<unit>m?s)?$/iu;
|
|
69
|
+
const beatOf = (element) => {
|
|
70
|
+
const time = getComputedStyle(element).getPropertyValue("--motion-flash").trim();
|
|
71
|
+
const groups = TIME.exec(time)?.groups;
|
|
72
|
+
return __foldkitBrandViewResult((pipe(Option.fromNullishOr(groups?.["amount"]), Option.map((amount) => __foldkitBrandViewResult((groups?.["unit"]?.toLowerCase() === "ms" ? Number(amount) : Number(amount) * 1e3), "@gjermundgaraba/pixel-paper/announcer/announcer.js#anonymous~8")), Option.filter(Number.isFinite))), "@gjermundgaraba/pixel-paper/announcer/announcer.js#beatOf");
|
|
73
|
+
};
|
|
74
|
+
const prefersReducedMotion = () => __foldkitBrandViewResult((window.matchMedia("(prefers-reduced-motion: reduce)").matches), "@gjermundgaraba/pixel-paper/announcer/announcer.js#prefersReducedMotion");
|
|
75
|
+
const runFlash = (element, beat) => {
|
|
76
|
+
for (const animation of Array.filter(element.getAnimations(), (running) => __foldkitBrandViewResult((running.id === FLASH_ID), "@gjermundgaraba/pixel-paper/announcer/announcer.js#anonymous~9"))) animation.cancel();
|
|
77
|
+
if (prefersReducedMotion()) {
|
|
78
|
+
const ring = "var(--line) solid var(--ink)";
|
|
79
|
+
element.animate({
|
|
80
|
+
outline: [ring, ring],
|
|
81
|
+
outlineOffset: ["-2px", "-2px"]
|
|
82
|
+
}, {
|
|
83
|
+
duration: beat,
|
|
84
|
+
id: FLASH_ID
|
|
85
|
+
});
|
|
86
|
+
} else element.animate({ filter: ["invert(1)", "invert(1)"] }, {
|
|
87
|
+
duration: beat / 2,
|
|
88
|
+
delay: beat / 4,
|
|
89
|
+
id: FLASH_ID
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
const flash = (selector) => __foldkitBrandViewResult((Effect.sync(() => {
|
|
93
|
+
const maybeElement = Option.fromNullishOr(document.querySelector(selector));
|
|
94
|
+
const maybeFlash = Option.flatMap(maybeElement, (element) => __foldkitBrandViewResult((Option.map(beatOf(element), (beat) => (__foldkitBrandViewResult(({
|
|
95
|
+
element,
|
|
96
|
+
beat
|
|
97
|
+
}), "@gjermundgaraba/pixel-paper/announcer/announcer.js#anonymous~12")))), "@gjermundgaraba/pixel-paper/announcer/announcer.js#anonymous~11"));
|
|
98
|
+
if (Option.isSome(maybeFlash)) runFlash(maybeFlash.value.element, maybeFlash.value.beat);
|
|
99
|
+
})), "@gjermundgaraba/pixel-paper/announcer/announcer.js#flash");
|
|
100
|
+
/**
|
|
101
|
+
* Says `text` to screen readers through the page's live region (see `view`). Words said in
|
|
102
|
+
* the same moment are read together, and the region clears first, so the same words twice
|
|
103
|
+
* are read twice. Without a region on the page it does nothing. Reports `CompletedAnnounce`.
|
|
104
|
+
*/
|
|
105
|
+
const Announce = Command.define("Announce", {
|
|
106
|
+
args: { text: Schema.String },
|
|
107
|
+
messages: [Message.CompletedAnnounce],
|
|
108
|
+
execute: ({ text }) => __foldkitBrandViewResult((announce(text).pipe(Effect.as(Message.CompletedAnnounce()))), "@gjermundgaraba/pixel-paper/announcer/announcer.js#execute")
|
|
109
|
+
});
|
|
110
|
+
/**
|
|
111
|
+
* Inverts the element `selector` finds for one beat (`--motion-flash`): the signal that a
|
|
112
|
+
* change was committed. A second flash mid-beat restarts it. With `prefers-reduced-motion`
|
|
113
|
+
* it holds a still 2px ink ring for the beat instead. Return it beside `Announce`, which says
|
|
114
|
+
* what the flash shows. Reports `CompletedFlash`.
|
|
115
|
+
*/
|
|
116
|
+
const Flash = Command.define("Flash", {
|
|
117
|
+
args: { selector: Schema.String },
|
|
118
|
+
messages: [Message.CompletedFlash],
|
|
119
|
+
execute: ({ selector }) => __foldkitBrandViewResult((flash(selector).pipe(Effect.as(Message.CompletedFlash()))), "@gjermundgaraba/pixel-paper/announcer/announcer.js#execute~2")
|
|
120
|
+
});
|
|
121
|
+
export { ANNOUNCER_ATTRIBUTE, Announce, Flash, Message, announce, flash, view };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { ANNOUNCER_ATTRIBUTE, Announce, Flash, view } from "./announcer.js";
|
|
4
|
+
// src/announcer/index.ts
|
|
5
|
+
var announcer_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
ANNOUNCER_ATTRIBUTE: () => __foldkitBrandViewResult((ANNOUNCER_ATTRIBUTE), "@gjermundgaraba/pixel-paper/announcer/index.js#ANNOUNCER_ATTRIBUTE"),
|
|
7
|
+
Announce: () => __foldkitBrandViewResult((Announce), "@gjermundgaraba/pixel-paper/announcer/index.js#Announce"),
|
|
8
|
+
Flash: () => __foldkitBrandViewResult((Flash), "@gjermundgaraba/pixel-paper/announcer/index.js#Flash"),
|
|
9
|
+
view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/announcer/index.js#view")
|
|
10
|
+
});
|
|
11
|
+
export { ANNOUNCER_ATTRIBUTE, Announce, Flash, announcer_exports, view };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Attribute, ChildAttribute } from "foldkit/html";
|
|
2
|
+
/** Attributes passed through to an element. Never a class: a later class replaces an earlier
|
|
3
|
+
* one, so a passthrough class would wipe the system's own. */
|
|
4
|
+
export type Attributes<Message> = ReadonlyArray<Attribute<Message> | ChildAttribute>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Tone } from "../notice/notice.js";
|
|
2
|
+
import { Html, HtmlBuilder } from "foldkit/html";
|
|
3
|
+
/** Configuration for rendering a banner with `view`. */
|
|
4
|
+
export type ViewConfig = Readonly<{
|
|
5
|
+
/** One sentence: the state, and what happens to the reader's work. */
|
|
6
|
+
body: ReadonlyArray<Html | string>;
|
|
7
|
+
/** `Error` (the default): red, a state that stops work (offline). `Warn`: amber, a state
|
|
8
|
+
* that is passing (reconnecting). `Ok`: ink, the state just ended (back online), shown
|
|
9
|
+
* briefly and then taken away. `Quiet`: tinted, news. */
|
|
10
|
+
tone?: Tone;
|
|
11
|
+
/** A control at the right: reconnect, reload. */
|
|
12
|
+
actions?: ReadonlyArray<Html | string>;
|
|
13
|
+
}>;
|
|
14
|
+
/** A printed slip fixed at the bottom centre, above the status bar: a state the whole
|
|
15
|
+
* interface is in (offline, reconnecting, read-only), for as long as it lasts. One at a
|
|
16
|
+
* time. It is not a live region, since it arrives already holding its sentence, which would
|
|
17
|
+
* go unheard: the application says the state once, when it begins, through the page's live
|
|
18
|
+
* region (the `Announcer.Announce` Command). An outcome that comes and goes is a
|
|
19
|
+
* toast; a word beside the control that did it is a FlashWord. */
|
|
20
|
+
export declare const view: <Message>(config: ViewConfig, h: HtmlBuilder<Message>) => Html;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { toneGlyphView } from "../notice/notice.js";
|
|
3
|
+
// src/banner/banner.ts
|
|
4
|
+
/** A printed slip fixed at the bottom centre, above the status bar: a state the whole
|
|
5
|
+
* interface is in (offline, reconnecting, read-only), for as long as it lasts. One at a
|
|
6
|
+
* time. It is not a live region, since it arrives already holding its sentence, which would
|
|
7
|
+
* go unheard: the application says the state once, when it begins, through the page's live
|
|
8
|
+
* region (the `Announcer.Announce` Command). An outcome that comes and goes is a
|
|
9
|
+
* toast; a word beside the control that did it is a FlashWord. */
|
|
10
|
+
const view = (config, h) => {
|
|
11
|
+
const { body, tone = "Error", actions = [] } = config;
|
|
12
|
+
return __foldkitBrandViewResult((h.div([h.Class("banner")], [
|
|
13
|
+
toneGlyphView({ tone }, h),
|
|
14
|
+
h.span([], body),
|
|
15
|
+
...actions
|
|
16
|
+
])), "@gjermundgaraba/pixel-paper/banner/banner.js#view");
|
|
17
|
+
};
|
|
18
|
+
export { view };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { view } from "./banner.js";
|
|
4
|
+
// src/banner/index.ts
|
|
5
|
+
var banner_exports = /* @__PURE__ */ __exportAll({ view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/banner/index.js#view") });
|
|
6
|
+
export { banner_exports, view };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Html, HtmlBuilder } from "foldkit/html";
|
|
2
|
+
/** Configuration for rendering a bench with `view`. */
|
|
3
|
+
export type ViewConfig = Readonly<{
|
|
4
|
+
/** Above the work, at its own height while the work keeps its floor, past which it scrolls:
|
|
5
|
+
* a PageHead, notices, and a Rail's open button first. */
|
|
6
|
+
head: ReadonlyArray<Html | string>;
|
|
7
|
+
/** The work, taking the rest of the window's height and never less than
|
|
8
|
+
* `--bench-work-min`: a Reel, which fills it, and the page's dialogs. */
|
|
9
|
+
body: ReadonlyArray<Html | string>;
|
|
10
|
+
}>;
|
|
11
|
+
/** A page whose work is the window: its head at its own height, then the work in all the
|
|
12
|
+
* height left, from under the top bar to the window's bottom and edge to edge (beside a Rail,
|
|
13
|
+
* from the rail's edge). The main landmark (`<main id="main">`). The page does not scroll:
|
|
14
|
+
* the work scrolls itself where it must (a reel's columns, sideways), and on a short window
|
|
15
|
+
* the head scrolls in what the work's floor leaves it. */
|
|
16
|
+
export declare const view: <Message>(config: ViewConfig, h: HtmlBuilder<Message>) => Html;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
// src/bench/bench.ts
|
|
3
|
+
/** A page whose work is the window: its head at its own height, then the work in all the
|
|
4
|
+
* height left, from under the top bar to the window's bottom and edge to edge (beside a Rail,
|
|
5
|
+
* from the rail's edge). The main landmark (`<main id="main">`). The page does not scroll:
|
|
6
|
+
* the work scrolls itself where it must (a reel's columns, sideways), and on a short window
|
|
7
|
+
* the head scrolls in what the work's floor leaves it. */
|
|
8
|
+
const view = (config, h) => {
|
|
9
|
+
const { head, body } = config;
|
|
10
|
+
return __foldkitBrandViewResult((h.main([h.Id("main"), h.Class("bench")], [h.div([h.Class("bench-head")], head), h.div([h.Class("bench-work")], body)])), "@gjermundgaraba/pixel-paper/bench/bench.js#view");
|
|
11
|
+
};
|
|
12
|
+
export { view };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { view } from "./bench.js";
|
|
4
|
+
// src/bench/index.ts
|
|
5
|
+
var bench_exports = /* @__PURE__ */ __exportAll({ view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/bench/index.js#view") });
|
|
6
|
+
export { bench_exports, view };
|