@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
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Attributes } from "../attributes/attributes.js";
|
|
2
|
+
import { Html, HtmlBuilder } from "foldkit/html";
|
|
3
|
+
/** Configuration for rendering a card with `view`. */
|
|
4
|
+
export type ViewConfig<Message> = Readonly<{
|
|
5
|
+
/** Pixel caps in the inverted title bar. */
|
|
6
|
+
title: string;
|
|
7
|
+
/** Attributes for the title, such as a Dialog's `title` group, which names the dialog. */
|
|
8
|
+
titleAttributes?: Attributes<Message>;
|
|
9
|
+
meta?: string;
|
|
10
|
+
body: ReadonlyArray<Html | string>;
|
|
11
|
+
/** Attributes for the close glyph, such as a Dialog's `closeButton` group, which closes it.
|
|
12
|
+
* The glyph prints when they are given. */
|
|
13
|
+
closeAttributes?: Attributes<Message>;
|
|
14
|
+
/** 440px instead of 680px: confirms, settings, sign-in. */
|
|
15
|
+
isNarrow?: boolean;
|
|
16
|
+
/** The action bar: a 2px ink rule, then these pushed right. Give the default `isDefault`. */
|
|
17
|
+
actions?: ReadonlyArray<Html | string>;
|
|
18
|
+
/** In the action bar before the push: a flash word, a quiet button. */
|
|
19
|
+
lead?: ReadonlyArray<Html | string>;
|
|
20
|
+
/** Attributes for the action bar, such as a Dialog's `actionBar` group, which moves focus
|
|
21
|
+
* between the actions with h, l and the side arrows. */
|
|
22
|
+
actionBarAttributes?: Attributes<Message>;
|
|
23
|
+
}>;
|
|
24
|
+
/** The raised surface: paper in a 2px ink box on the 8px print shadow, under a title bar. */
|
|
25
|
+
export declare const view: <Message>(config: ViewConfig<Message>, h: HtmlBuilder<Message>) => Html;
|
|
26
|
+
/** Configuration for rendering a form card with `formView`: a card's, but for its body, its
|
|
27
|
+
* close attributes and its actions, which the form fills. `lead` stays the card's: what
|
|
28
|
+
* goes before the push, such as a form's own delete. */
|
|
29
|
+
export type FormViewConfig<Message> = Omit<ViewConfig<Message>, "body" | "closeAttributes" | "actions"> & Readonly<{
|
|
30
|
+
/** Unique in the document: the submit button's id is `submitId(id)`. */
|
|
31
|
+
id: string;
|
|
32
|
+
/** The form's content, fields and all, in one Fields group that `isBusy` holds. A link in
|
|
33
|
+
* it (an ErrorSummary's) stays live. */
|
|
34
|
+
body: ReadonlyArray<Html | string>;
|
|
35
|
+
/** Above the fields, outside the group `isBusy` holds: what the page says about the form
|
|
36
|
+
* while it is open (a lost connection with its retry), whose controls stay live while it
|
|
37
|
+
* sends. */
|
|
38
|
+
notices?: ReadonlyArray<Html | string>;
|
|
39
|
+
/** The submit button's words. It prints primary, the card's default. */
|
|
40
|
+
submit: string;
|
|
41
|
+
/** The cancel button's words, before the submit. It closes through `closeAttributes`. */
|
|
42
|
+
cancel?: string;
|
|
43
|
+
/** Attributes for the close glyph and the cancel button, such as a Dialog's `closeButton`
|
|
44
|
+
* group, which closes it. The glyph prints when they are given. */
|
|
45
|
+
closeAttributes?: Attributes<Message>;
|
|
46
|
+
/** The form's work is running (it sends): the submit button is busy, the close glyph and
|
|
47
|
+
* cancel are held without `closeAttributes`, and the body is natively disabled, so
|
|
48
|
+
* nothing changes under the send and nothing sends twice. In a Dialog, pass the same state
|
|
49
|
+
* as `isCloseHeld` to its update, so Escape and the veil are held too. Enter in a field
|
|
50
|
+
* can submit before the fields are held, so the update still ignores `onSubmit` while
|
|
51
|
+
* busy. */
|
|
52
|
+
isBusy?: boolean;
|
|
53
|
+
/** The form cannot be sent yet (nothing to send): the submit button is held as a Button
|
|
54
|
+
* is, and the fields and cancel stay live. Enter in a field can still submit, so the
|
|
55
|
+
* update ignores `onSubmit` while it cannot be sent. */
|
|
56
|
+
isSubmitDisabled?: boolean;
|
|
57
|
+
/** Sent when the form submits, by its button or by Enter in a field. */
|
|
58
|
+
onSubmit: Message;
|
|
59
|
+
}>;
|
|
60
|
+
/** The id of a form card's submit button. A send disables the fields, so focus in one falls
|
|
61
|
+
* to the page: the form's update moves it here as it sends, with
|
|
62
|
+
* `Focus.Focus({ id: Card.submitId(id) })`. */
|
|
63
|
+
export declare const submitId: (id: string) => string;
|
|
64
|
+
/** A card that is a form, named by its title, so a form landmark: its notices, its body in
|
|
65
|
+
* one Fields group, then cancel and the primary submit button in the action bar. */
|
|
66
|
+
export declare const formView: <Message>(config: FormViewConfig<Message>, h: HtmlBuilder<Message>) => Html;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { view as view$1 } from "../button/button.js";
|
|
3
|
+
import { view as view$2 } from "../icon-button/icon-button.js";
|
|
4
|
+
import { slotView } from "../slot/slot.js";
|
|
5
|
+
import { view as view$3 } from "../fields/fields.js";
|
|
6
|
+
import { Array } from "effect";
|
|
7
|
+
// src/card/card.ts
|
|
8
|
+
const childrenView = (config, h) => {
|
|
9
|
+
const { title, titleAttributes = [], meta, body, closeAttributes, isCloseHeld = false, actions = [], lead = [], actionBarAttributes = [] } = config;
|
|
10
|
+
const titleBar = h.header([h.Class("card-tb")], [
|
|
11
|
+
h.h2(titleAttributes, [title]),
|
|
12
|
+
...meta === void 0 ? [] : [h.span([h.Class("meta")], [meta])],
|
|
13
|
+
...closeAttributes === void 0 ? [] : [view$2({
|
|
14
|
+
glyph: "cross",
|
|
15
|
+
label: "Close",
|
|
16
|
+
isDisabled: isCloseHeld,
|
|
17
|
+
attributes: isCloseHeld ? [] : closeAttributes
|
|
18
|
+
}, h)]
|
|
19
|
+
]);
|
|
20
|
+
const actionBar = Array.match([...lead, ...slotView("span", "card-acts", actions, h)], {
|
|
21
|
+
onEmpty: () => __foldkitBrandViewResult(([]), "@gjermundgaraba/pixel-paper/card/card.js#onEmpty"),
|
|
22
|
+
onNonEmpty: (bar) => __foldkitBrandViewResult(([h.div([...actionBarAttributes, h.Class("card-actions")], bar)]), "@gjermundgaraba/pixel-paper/card/card.js#onNonEmpty")
|
|
23
|
+
});
|
|
24
|
+
return __foldkitBrandViewResult(([
|
|
25
|
+
titleBar,
|
|
26
|
+
h.div([h.Class("card-body")], body),
|
|
27
|
+
...actionBar
|
|
28
|
+
]), "@gjermundgaraba/pixel-paper/card/card.js#childrenView");
|
|
29
|
+
};
|
|
30
|
+
const className = (isNarrow) => __foldkitBrandViewResult((isNarrow === true ? "card narrow" : "card"), "@gjermundgaraba/pixel-paper/card/card.js#className");
|
|
31
|
+
/** The raised surface: paper in a 2px ink box on the 8px print shadow, under a title bar. */
|
|
32
|
+
const view = (config, h) => __foldkitBrandViewResult((h.div([h.Class(className(config.isNarrow))], childrenView(config, h))), "@gjermundgaraba/pixel-paper/card/card.js#view");
|
|
33
|
+
/** The id of a form card's submit button. A send disables the fields, so focus in one falls
|
|
34
|
+
* to the page: the form's update moves it here as it sends, with
|
|
35
|
+
* `Focus.Focus({ id: Card.submitId(id) })`. */
|
|
36
|
+
const submitId = (id) => __foldkitBrandViewResult((`${id}-submit`), "@gjermundgaraba/pixel-paper/card/card.js#submitId");
|
|
37
|
+
/** A card that is a form, named by its title, so a form landmark: its notices, its body in
|
|
38
|
+
* one Fields group, then cancel and the primary submit button in the action bar. */
|
|
39
|
+
const formView = (config, h) => {
|
|
40
|
+
const { id, title, submit, cancel, closeAttributes, notices = [], isBusy = false, isSubmitDisabled = false, onSubmit } = config;
|
|
41
|
+
const cancelButton = cancel === void 0 ? [] : [view$1({
|
|
42
|
+
label: cancel,
|
|
43
|
+
isDisabled: isBusy,
|
|
44
|
+
attributes: isBusy ? [] : closeAttributes ?? []
|
|
45
|
+
}, h)];
|
|
46
|
+
const submitButton = view$1({
|
|
47
|
+
label: submit,
|
|
48
|
+
variant: "Primary",
|
|
49
|
+
isDefault: true,
|
|
50
|
+
isBusy,
|
|
51
|
+
isDisabled: isSubmitDisabled,
|
|
52
|
+
type: "submit",
|
|
53
|
+
attributes: [h.Id(submitId(id))]
|
|
54
|
+
}, h);
|
|
55
|
+
return __foldkitBrandViewResult((h.form([
|
|
56
|
+
h.Class(className(config.isNarrow)),
|
|
57
|
+
h.AriaLabel(title),
|
|
58
|
+
h.Novalidate(true),
|
|
59
|
+
h.OnSubmit(onSubmit)
|
|
60
|
+
], childrenView({
|
|
61
|
+
...config,
|
|
62
|
+
body: [...notices, view$3({
|
|
63
|
+
body: config.body,
|
|
64
|
+
isBusy
|
|
65
|
+
}, h)],
|
|
66
|
+
isCloseHeld: isBusy,
|
|
67
|
+
actions: [...cancelButton, submitButton]
|
|
68
|
+
}, h))), "@gjermundgaraba/pixel-paper/card/card.js#formView");
|
|
69
|
+
};
|
|
70
|
+
export { formView, submitId, view };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FormViewConfig, ViewConfig, formView, submitId, view } from "./card.js";
|
|
2
|
+
declare namespace index_d_exports {
|
|
3
|
+
export { FormViewConfig, ViewConfig, formView, submitId, view };
|
|
4
|
+
}
|
|
5
|
+
export { type FormViewConfig, type ViewConfig, formView, index_d_exports, submitId, view };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { formView, submitId, view } from "./card.js";
|
|
4
|
+
// src/card/index.ts
|
|
5
|
+
var card_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
formView: () => __foldkitBrandViewResult((formView), "@gjermundgaraba/pixel-paper/card/index.js#formView"),
|
|
7
|
+
submitId: () => __foldkitBrandViewResult((submitId), "@gjermundgaraba/pixel-paper/card/index.js#submitId"),
|
|
8
|
+
view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/card/index.js#view")
|
|
9
|
+
});
|
|
10
|
+
export { card_exports, formView, submitId, view };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import { Html, HtmlBuilder } from "foldkit/html";
|
|
3
|
+
/** `Go`: active (green). `Warn`: a warning the row carries (amber). `Blocked`: a red outline.
|
|
4
|
+
* `Done`: tinted. Colour only ever means active, warning or urgent. */
|
|
5
|
+
export declare const Tone: Schema.Literals<readonly ["Plain", "Go", "Warn", "Blocked", "Done"]>;
|
|
6
|
+
export type Tone = typeof Tone.Type;
|
|
7
|
+
/** Configuration for rendering a chip with `view`. */
|
|
8
|
+
export type ViewConfig = Readonly<{
|
|
9
|
+
/** The state word. */
|
|
10
|
+
label: string;
|
|
11
|
+
tone?: Tone;
|
|
12
|
+
/** Working on it (polling, building, starting): the word gains the blinking block cursor,
|
|
13
|
+
* and the chip says so (`aria-busy`). */
|
|
14
|
+
isBusy?: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
/** A state word in a 2px box. Its words are its meaning; the colour only repeats them. */
|
|
17
|
+
export declare const view: <Message>(config: ViewConfig, h: HtmlBuilder<Message>) => Html;
|
|
18
|
+
/** Configuration for rendering a dot with `dotView`. */
|
|
19
|
+
export type DotConfig = Readonly<{
|
|
20
|
+
/** The state word: the dot's accessible name and its tip. */
|
|
21
|
+
label: string;
|
|
22
|
+
tone?: Tone;
|
|
23
|
+
}>;
|
|
24
|
+
/** A chip as a 10px cell in its tone, where a word would take the room a title needs (a task
|
|
25
|
+
* row's status, before its title). It is an image (`role="img"`) named by the word, which its
|
|
26
|
+
* tip shows, so the state never rests on its colour. */
|
|
27
|
+
export declare const dotView: <Message>(config: DotConfig, h: HtmlBuilder<Message>) => Html;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
Schema.Literals([
|
|
4
|
+
"Plain",
|
|
5
|
+
"Go",
|
|
6
|
+
"Warn",
|
|
7
|
+
"Blocked",
|
|
8
|
+
"Done"
|
|
9
|
+
]);
|
|
10
|
+
const TONE_CLASS = {
|
|
11
|
+
Plain: "",
|
|
12
|
+
Go: " go",
|
|
13
|
+
Warn: " warn",
|
|
14
|
+
Blocked: " blocked",
|
|
15
|
+
Done: " done"
|
|
16
|
+
};
|
|
17
|
+
/** A state word in a 2px box. Its words are its meaning; the colour only repeats them. */
|
|
18
|
+
const view = (config, h) => {
|
|
19
|
+
const { label, tone = "Plain", isBusy = false } = config;
|
|
20
|
+
return __foldkitBrandViewResult((h.span([...isBusy ? [h.AriaBusy(true)] : [], h.Class(`chip${TONE_CLASS[tone]}`)], [label, ...isBusy ? [h.span([h.Class("cursor"), h.AriaHidden(true)])] : []])), "@gjermundgaraba/pixel-paper/chip/chip.js#view");
|
|
21
|
+
};
|
|
22
|
+
/** A chip as a 10px cell in its tone, where a word would take the room a title needs (a task
|
|
23
|
+
* row's status, before its title). It is an image (`role="img"`) named by the word, which its
|
|
24
|
+
* tip shows, so the state never rests on its colour. */
|
|
25
|
+
const dotView = (config, h) => {
|
|
26
|
+
const { label, tone = "Plain" } = config;
|
|
27
|
+
return __foldkitBrandViewResult((h.span([
|
|
28
|
+
h.Role("img"),
|
|
29
|
+
h.AriaLabel(label),
|
|
30
|
+
h.DataAttribute("tip", label),
|
|
31
|
+
h.Class(`chip-dot${TONE_CLASS[tone]}`)
|
|
32
|
+
])), "@gjermundgaraba/pixel-paper/chip/chip.js#dotView");
|
|
33
|
+
};
|
|
34
|
+
export { dotView, view };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { dotView, view } from "./chip.js";
|
|
4
|
+
// src/chip/index.ts
|
|
5
|
+
var chip_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
dotView: () => __foldkitBrandViewResult((dotView), "@gjermundgaraba/pixel-paper/chip/index.js#dotView"),
|
|
7
|
+
view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/chip/index.js#view")
|
|
8
|
+
});
|
|
9
|
+
export { chip_exports, dotView, view };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Html, HtmlBuilder } from "foldkit/html";
|
|
2
|
+
/** Configuration for rendering a checkbox choice with `view`. */
|
|
3
|
+
export type ViewConfig<Message> = Readonly<{
|
|
4
|
+
/** Unique in the document: the name's and the note's ids are made from it. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** The choice's name, in pixel caps. A click on it toggles the box. */
|
|
7
|
+
label: string;
|
|
8
|
+
/** A sans sentence under the name; it describes the box. */
|
|
9
|
+
note?: string;
|
|
10
|
+
isChecked: boolean;
|
|
11
|
+
onToggle: (isChecked: boolean) => Message;
|
|
12
|
+
}>;
|
|
13
|
+
/** A checkbox with a pixel-caps name and an optional note, built on `@foldkit/ui`'s
|
|
14
|
+
* Checkbox: a `role="checkbox"` box (`aria-checked`) named by its name, described by its note
|
|
15
|
+
* (`aria-describedby`). Space and a click on the box or the name toggle it. */
|
|
16
|
+
export declare const view: <Message>(config: ViewConfig<Message>, h: HtmlBuilder<Message>) => Html;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { Checkbox } from "@foldkit/ui";
|
|
3
|
+
// src/choice/choice.ts
|
|
4
|
+
/** A checkbox with a pixel-caps name and an optional note, built on `@foldkit/ui`'s
|
|
5
|
+
* Checkbox: a `role="checkbox"` box (`aria-checked`) named by its name, described by its note
|
|
6
|
+
* (`aria-describedby`). Space and a click on the box or the name toggle it. */
|
|
7
|
+
const view = (config, h) => {
|
|
8
|
+
const { id, label, note, isChecked, onToggle } = config;
|
|
9
|
+
return __foldkitBrandViewResult((Checkbox.view({
|
|
10
|
+
id,
|
|
11
|
+
isChecked,
|
|
12
|
+
onToggle,
|
|
13
|
+
hasDescription: note !== void 0,
|
|
14
|
+
toView: (groups) => __foldkitBrandViewResult((h.div([h.Class("choice")], [h.button([...groups.checkbox, h.Class("choice-box")]), h.span([], [h.span([...groups.label, h.Class("choice-name")], [label]), ...note === void 0 ? [] : [h.span([...groups.description, h.Class("choice-note")], [note])]])])), "@gjermundgaraba/pixel-paper/choice/choice.js#toView")
|
|
15
|
+
}, h)), "@gjermundgaraba/pixel-paper/choice/choice.js#view");
|
|
16
|
+
};
|
|
17
|
+
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 "./choice.js";
|
|
4
|
+
// src/choice/index.ts
|
|
5
|
+
var choice_exports = /* @__PURE__ */ __exportAll({ view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/choice/index.js#view") });
|
|
6
|
+
export { choice_exports, view };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Html, HtmlBuilder } from "foldkit/html";
|
|
2
|
+
/** Configuration for rendering a code editor with `view`. */
|
|
3
|
+
export type ViewConfig<Message> = Readonly<{
|
|
4
|
+
/** Unique in the document: the `<textarea>`'s id. */
|
|
5
|
+
id: string;
|
|
6
|
+
/** The code. The caller keeps it, and sets it again for a reset or a loaded file. */
|
|
7
|
+
value: string;
|
|
8
|
+
/** Every keystroke's whole code; the caller stores it as `value`. */
|
|
9
|
+
onInput: (value: string) => Message;
|
|
10
|
+
/** Names the editor for screen readers: a file name, `"Request body"`. */
|
|
11
|
+
label: string;
|
|
12
|
+
}>;
|
|
13
|
+
/** Code to edit, built on `@foldkit/ui`'s Textarea: the code surface as a textarea, 220px tall
|
|
14
|
+
* at least and growing to 60vh, with spelling, capitals and autocomplete off. */
|
|
15
|
+
export declare const view: <Message>(config: ViewConfig<Message>, h: HtmlBuilder<Message>) => Html;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { Textarea } from "@foldkit/ui";
|
|
3
|
+
// src/code-editor/code-editor.ts
|
|
4
|
+
/** Code to edit, built on `@foldkit/ui`'s Textarea: the code surface as a textarea, 220px tall
|
|
5
|
+
* at least and growing to 60vh, with spelling, capitals and autocomplete off. */
|
|
6
|
+
const view = (config, h) => {
|
|
7
|
+
const { id, value, onInput, label } = config;
|
|
8
|
+
return __foldkitBrandViewResult((Textarea.view({
|
|
9
|
+
id,
|
|
10
|
+
value,
|
|
11
|
+
onInput,
|
|
12
|
+
toView: (groups) => __foldkitBrandViewResult((h.textarea([
|
|
13
|
+
...groups.textarea,
|
|
14
|
+
h.Spellcheck(false),
|
|
15
|
+
h.Autocapitalize("off"),
|
|
16
|
+
h.Autocomplete("off"),
|
|
17
|
+
h.AriaLabel(label),
|
|
18
|
+
h.Class("code-surface")
|
|
19
|
+
])), "@gjermundgaraba/pixel-paper/code-editor/code-editor.js#toView")
|
|
20
|
+
}, h)), "@gjermundgaraba/pixel-paper/code-editor/code-editor.js#view");
|
|
21
|
+
};
|
|
22
|
+
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 "./code-editor.js";
|
|
4
|
+
// src/code-editor/index.ts
|
|
5
|
+
var code_editor_exports = /* @__PURE__ */ __exportAll({ view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/code-editor/index.js#view") });
|
|
6
|
+
export { code_editor_exports, view };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Html, HtmlBuilder } from "foldkit/html";
|
|
2
|
+
/** Configuration for rendering a code surface with `view`. */
|
|
3
|
+
export type ViewConfig = Readonly<{
|
|
4
|
+
/** Names the block for screen readers: a file name, `"Response body"`. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** The code: a string, or a highlighter's spans (`tok-*` classes take the content inks). */
|
|
7
|
+
body: ReadonlyArray<Html | string>;
|
|
8
|
+
}>;
|
|
9
|
+
/** Code to read: a head-tinted block in the system monospace. It wraps rather than scrolls,
|
|
10
|
+
* and takes focus, so a keyboard reader can reach it and a screen reader names it: a `<pre>`
|
|
11
|
+
* may not be named, so it is a `role="group"`, which may. */
|
|
12
|
+
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/code-surface/code-surface.ts
|
|
3
|
+
/** Code to read: a head-tinted block in the system monospace. It wraps rather than scrolls,
|
|
4
|
+
* and takes focus, so a keyboard reader can reach it and a screen reader names it: a `<pre>`
|
|
5
|
+
* may not be named, so it is a `role="group"`, which may. */
|
|
6
|
+
const view = (config, h) => __foldkitBrandViewResult((h.pre([
|
|
7
|
+
h.Tabindex(0),
|
|
8
|
+
h.Role("group"),
|
|
9
|
+
h.AriaLabel(config.label),
|
|
10
|
+
h.Class("code-surface")
|
|
11
|
+
], config.body)), "@gjermundgaraba/pixel-paper/code-surface/code-surface.js#view");
|
|
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 "./code-surface.js";
|
|
4
|
+
// src/code-surface/index.ts
|
|
5
|
+
var code_surface_exports = /* @__PURE__ */ __exportAll({ view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/code-surface/index.js#view") });
|
|
6
|
+
export { code_surface_exports, view };
|