@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,17 @@
|
|
|
1
|
+
import { Html, HtmlBuilder } from "foldkit/html";
|
|
2
|
+
/** One segment: its value and its words. */
|
|
3
|
+
export type Segment<Value extends string> = Readonly<{
|
|
4
|
+
value: Value;
|
|
5
|
+
label: string;
|
|
6
|
+
}>;
|
|
7
|
+
/** Configuration for rendering a segmented choice with `view`. */
|
|
8
|
+
export type ViewConfig<Value extends string, Message> = Readonly<{
|
|
9
|
+
/** Names the group for screen readers. */
|
|
10
|
+
label: string;
|
|
11
|
+
options: ReadonlyArray<Segment<Value>>;
|
|
12
|
+
value: Value;
|
|
13
|
+
onSelect: (value: Value) => Message;
|
|
14
|
+
}>;
|
|
15
|
+
/** A choice of one: the pressed segment inverts and is `aria-pressed="true"`, the others
|
|
16
|
+
* `"false"`, in a `role="group"` named by the label, printed as the nav strip. */
|
|
17
|
+
export declare const view: <Value extends string, Message>(config: ViewConfig<Value, Message>, h: HtmlBuilder<Message>) => Html;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { pressedAttribute } from "../button/button.js";
|
|
3
|
+
import { Array } from "effect";
|
|
4
|
+
import { Button } from "@foldkit/ui";
|
|
5
|
+
// src/segmented/segmented.ts
|
|
6
|
+
const segmentView = (config, option, h) => __foldkitBrandViewResult((Button.view({
|
|
7
|
+
onClick: config.onSelect(option.value),
|
|
8
|
+
toView: (groups) => __foldkitBrandViewResult((h.keyed("button")(option.value, [...groups.button, pressedAttribute(option.value === config.value, h)], [option.label])), "@gjermundgaraba/pixel-paper/segmented/segmented.js#toView")
|
|
9
|
+
}, h)), "@gjermundgaraba/pixel-paper/segmented/segmented.js#segmentView");
|
|
10
|
+
/** A choice of one: the pressed segment inverts and is `aria-pressed="true"`, the others
|
|
11
|
+
* `"false"`, in a `role="group"` named by the label, printed as the nav strip. */
|
|
12
|
+
const view = (config, h) => __foldkitBrandViewResult((h.div([
|
|
13
|
+
h.Role("group"),
|
|
14
|
+
h.AriaLabel(config.label),
|
|
15
|
+
h.Class("nav")
|
|
16
|
+
], Array.map(config.options, (option) => __foldkitBrandViewResult((segmentView(config, option, h)), "@gjermundgaraba/pixel-paper/segmented/segmented.js#anonymous")))), "@gjermundgaraba/pixel-paper/segmented/segmented.js#view");
|
|
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 "./select-field.js";
|
|
4
|
+
// src/select-field/index.ts
|
|
5
|
+
var select_field_exports = /* @__PURE__ */ __exportAll({ view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/select-field/index.js#view") });
|
|
6
|
+
export { select_field_exports, view };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Html, HtmlBuilder } from "foldkit/html";
|
|
2
|
+
/** One choice in a `SelectField`. */
|
|
3
|
+
export type SelectOption = Readonly<{
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
/** Listed but not choosable, such as a place that is gone. */
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
/** Choices listed under a heading (`optgroup`). */
|
|
10
|
+
export type SelectGroup = Readonly<{
|
|
11
|
+
/** Tells groups apart when two share a label. */
|
|
12
|
+
key: string;
|
|
13
|
+
label: string;
|
|
14
|
+
options: readonly SelectOption[];
|
|
15
|
+
}>;
|
|
16
|
+
/** Configuration for rendering a select field with `view`. */
|
|
17
|
+
export type ViewConfig<Message> = Readonly<{
|
|
18
|
+
id: string;
|
|
19
|
+
label: string;
|
|
20
|
+
/** The chosen option's value. */
|
|
21
|
+
value: string;
|
|
22
|
+
onChange: (value: string) => Message;
|
|
23
|
+
/** The choices, in order; a group lists its own under its heading. */
|
|
24
|
+
options: ReadonlyArray<SelectOption | SelectGroup>;
|
|
25
|
+
/** A sans sentence under the control. */
|
|
26
|
+
help?: string;
|
|
27
|
+
/** Why the value was refused: a red sentence under the control, which the control is
|
|
28
|
+
* described by, with red on its box and its label (`aria-invalid`). Say it again in an
|
|
29
|
+
* ErrorSummary above the form. */
|
|
30
|
+
error?: string | undefined;
|
|
31
|
+
/** The form is not sent without it: screen readers hear "required" (`aria-required`). */
|
|
32
|
+
isRequired?: boolean;
|
|
33
|
+
}>;
|
|
34
|
+
/** A labelled select with its help line, built on `@foldkit/ui`'s `Select`: the label names
|
|
35
|
+
* the select, the help line describes it (`aria-describedby`), an `error` sets
|
|
36
|
+
* `aria-invalid` and describes it before the help, and `isRequired` sets `aria-required`.
|
|
37
|
+
* The stylesheet draws the box, the caret and the picker. */
|
|
38
|
+
export declare const view: <Message>(config: ViewConfig<Message>, h: HtmlBuilder<Message>) => Html;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { controlAttributes, errorView, helpView } from "../field/field.js";
|
|
3
|
+
import { Array } from "effect";
|
|
4
|
+
import { Select } from "@foldkit/ui";
|
|
5
|
+
// src/select-field/select-field.ts
|
|
6
|
+
const isGroup = (entry) => __foldkitBrandViewResult(("options" in entry), "@gjermundgaraba/pixel-paper/select-field/select-field.js#isGroup");
|
|
7
|
+
const optionView = (h) => __foldkitBrandViewResult((({ value, label, isDisabled = false }) => __foldkitBrandViewResult((h.keyed("option")(value, [h.Value(value), h.Disabled(isDisabled)], [label])), "@gjermundgaraba/pixel-paper/select-field/select-field.js#anonymous")), "@gjermundgaraba/pixel-paper/select-field/select-field.js#optionView");
|
|
8
|
+
const entryView = (h) => __foldkitBrandViewResult(((entry) => __foldkitBrandViewResult((isGroup(entry) ? h.keyed("optgroup")(entry.key, [h.Attribute("label", entry.label)], Array.map(entry.options, optionView(h))) : optionView(h)(entry)), "@gjermundgaraba/pixel-paper/select-field/select-field.js#anonymous~2")), "@gjermundgaraba/pixel-paper/select-field/select-field.js#entryView");
|
|
9
|
+
/** A labelled select with its help line, built on `@foldkit/ui`'s `Select`: the label names
|
|
10
|
+
* the select, the help line describes it (`aria-describedby`), an `error` sets
|
|
11
|
+
* `aria-invalid` and describes it before the help, and `isRequired` sets `aria-required`.
|
|
12
|
+
* The stylesheet draws the box, the caret and the picker. */
|
|
13
|
+
const view = (config, h) => {
|
|
14
|
+
const { id, label, value, onChange, options, help, error, isRequired = false } = config;
|
|
15
|
+
return __foldkitBrandViewResult((Select.view({
|
|
16
|
+
id,
|
|
17
|
+
value,
|
|
18
|
+
onChange,
|
|
19
|
+
isInvalid: error !== void 0,
|
|
20
|
+
hasDescription: help !== void 0,
|
|
21
|
+
toView: (groups) => __foldkitBrandViewResult((h.div([h.Class("field")], [
|
|
22
|
+
h.label(groups.label, [label]),
|
|
23
|
+
h.select([...groups.select, ...controlAttributes(id, error, help, isRequired, h)], Array.map(options, entryView(h))),
|
|
24
|
+
...errorView(id, error, h),
|
|
25
|
+
...helpView(help, groups.description, h)
|
|
26
|
+
])), "@gjermundgaraba/pixel-paper/select-field/select-field.js#toView")
|
|
27
|
+
}, h)), "@gjermundgaraba/pixel-paper/select-field/select-field.js#view");
|
|
28
|
+
};
|
|
29
|
+
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 "./sheet.js";
|
|
4
|
+
// src/sheet/index.ts
|
|
5
|
+
var sheet_exports = /* @__PURE__ */ __exportAll({ view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/sheet/index.js#view") });
|
|
6
|
+
export { sheet_exports, view };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Html, HtmlBuilder } from "foldkit/html";
|
|
2
|
+
/** Configuration for rendering a sheet with `view`. */
|
|
3
|
+
export type ViewConfig = Readonly<{
|
|
4
|
+
/** The page's `h1`, in sans at the reading scale. */
|
|
5
|
+
title: string;
|
|
6
|
+
/** Pixel face, muted, over a 1px rule: who changed it and when. */
|
|
7
|
+
byline?: ReadonlyArray<Html | string>;
|
|
8
|
+
/** Buttons at the title's right: edit, history. */
|
|
9
|
+
actions?: ReadonlyArray<Html | string>;
|
|
10
|
+
/** A Prose, and anything under it. */
|
|
11
|
+
body: ReadonlyArray<Html | string>;
|
|
12
|
+
}>;
|
|
13
|
+
/** An authored page, an `<article>` under its `h1` on its own sheet of paper, framed as a
|
|
14
|
+
* panel is: the one place the system slows to reading pace. It stands in a panel's place,
|
|
15
|
+
* never inside one, so its `h1` opens the page instead of following a panel's `h2`. */
|
|
16
|
+
export declare const view: <Message>(config: ViewConfig, h: HtmlBuilder<Message>) => Html;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { slotView } from "../slot/slot.js";
|
|
3
|
+
// src/sheet/sheet.ts
|
|
4
|
+
/** An authored page, an `<article>` under its `h1` on its own sheet of paper, framed as a
|
|
5
|
+
* panel is: the one place the system slows to reading pace. It stands in a panel's place,
|
|
6
|
+
* never inside one, so its `h1` opens the page instead of following a panel's `h2`. */
|
|
7
|
+
const view = (config, h) => {
|
|
8
|
+
const { title, byline = [], actions = [], body } = config;
|
|
9
|
+
return __foldkitBrandViewResult((h.article([h.Class("sheet")], [
|
|
10
|
+
h.div([h.Class("sheet-head")], [h.h1([h.Class("sheet-title")], [title]), ...slotView("div", "sheet-acts", actions, h)]),
|
|
11
|
+
...slotView("p", "byline", byline, h),
|
|
12
|
+
...body
|
|
13
|
+
])), "@gjermundgaraba/pixel-paper/sheet/sheet.js#view");
|
|
14
|
+
};
|
|
15
|
+
export { view };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { ScrollToFragment, view } from "./skip-link.js";
|
|
4
|
+
// src/skip-link/index.ts
|
|
5
|
+
var skip_link_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
ScrollToFragment: () => __foldkitBrandViewResult((ScrollToFragment), "@gjermundgaraba/pixel-paper/skip-link/index.js#ScrollToFragment"),
|
|
7
|
+
view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/skip-link/index.js#view")
|
|
8
|
+
});
|
|
9
|
+
export { ScrollToFragment, skip_link_exports, view };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
import * as Command from "foldkit/command";
|
|
3
|
+
import { Html, HtmlBuilder } from "foldkit/html";
|
|
4
|
+
/**
|
|
5
|
+
* The first thing in the page: a link to the main landmark (`#main`, as Deck, Stage and Wall render it), hidden until it holds the
|
|
6
|
+
* keyboard. A Foldkit application routes every link click through its own update, so its
|
|
7
|
+
* fragment handler must move focus to the target as the browser would: return
|
|
8
|
+
* `ScrollToFragment` for a changed URL.
|
|
9
|
+
*/
|
|
10
|
+
export declare const view: <Message>(h: HtmlBuilder<Message>) => Html;
|
|
11
|
+
/**
|
|
12
|
+
* What a followed link does without an application in the way, for the application's URL
|
|
13
|
+
* handler to return when the URL changes: with a fragment, scrolls to the element it names and
|
|
14
|
+
* moves focus to it, making it focusable (`tabindex="-1"`) when it is not, so the next Tab
|
|
15
|
+
* continues from there (nothing when no element has that id); without one, scrolls to the
|
|
16
|
+
* top, since Foldkit reports a link followed and a step through history as the same change, so
|
|
17
|
+
* a new page opens at its top either way. Reports `CompletedScrollToFragment`.
|
|
18
|
+
*/
|
|
19
|
+
export declare const ScrollToFragment: Command.CommandDefinitionWithArgs<"ScrollToFragment", {
|
|
20
|
+
maybeFragment: Schema.Option<Schema.String>;
|
|
21
|
+
}, Effect.Effect<{
|
|
22
|
+
readonly _tag: "CompletedScrollToFragment";
|
|
23
|
+
}, never, never>>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { Effect, Option, Schema } from "effect";
|
|
3
|
+
import * as Command from "foldkit/command";
|
|
4
|
+
import { defineMessageUnion } from "foldkit/message";
|
|
5
|
+
import * as Dom from "foldkit/dom";
|
|
6
|
+
// src/skip-link/skip-link.ts
|
|
7
|
+
/** What `ScrollToFragment` reports. An application that runs it puts
|
|
8
|
+
* `CompletedScrollToFragment: {}` in its own Message union, which this tag matches. */
|
|
9
|
+
const Message = defineMessageUnion({ CompletedScrollToFragment: {} });
|
|
10
|
+
/**
|
|
11
|
+
* The first thing in the page: a link to the main landmark (`#main`, as Deck, Stage and Wall render it), hidden until it holds the
|
|
12
|
+
* keyboard. A Foldkit application routes every link click through its own update, so its
|
|
13
|
+
* fragment handler must move focus to the target as the browser would: return
|
|
14
|
+
* `ScrollToFragment` for a changed URL.
|
|
15
|
+
*/
|
|
16
|
+
const view = (h) => __foldkitBrandViewResult((h.a([h.Href("#main"), h.Class("skip")], ["Skip to content"])), "@gjermundgaraba/pixel-paper/skip-link/skip-link.js#view");
|
|
17
|
+
const focusFragment = (fragment) => __foldkitBrandViewResult((Effect.suspend(() => __foldkitBrandViewResult((Dom.focus(`#${CSS.escape(fragment)}`, { makeFocusable: true })), "@gjermundgaraba/pixel-paper/skip-link/skip-link.js#anonymous")).pipe(Effect.ignore)), "@gjermundgaraba/pixel-paper/skip-link/skip-link.js#focusFragment");
|
|
18
|
+
/**
|
|
19
|
+
* What a followed link does without an application in the way, for the application's URL
|
|
20
|
+
* handler to return when the URL changes: with a fragment, scrolls to the element it names and
|
|
21
|
+
* moves focus to it, making it focusable (`tabindex="-1"`) when it is not, so the next Tab
|
|
22
|
+
* continues from there (nothing when no element has that id); without one, scrolls to the
|
|
23
|
+
* top, since Foldkit reports a link followed and a step through history as the same change, so
|
|
24
|
+
* a new page opens at its top either way. Reports `CompletedScrollToFragment`.
|
|
25
|
+
*/
|
|
26
|
+
const ScrollToFragment = Command.define("ScrollToFragment", {
|
|
27
|
+
args: { maybeFragment: Schema.Option(Schema.String) },
|
|
28
|
+
messages: [Message.CompletedScrollToFragment],
|
|
29
|
+
execute: ({ maybeFragment }) => __foldkitBrandViewResult((Option.match(maybeFragment, {
|
|
30
|
+
onNone: () => __foldkitBrandViewResult((Effect.sync(() => {
|
|
31
|
+
window.scrollTo(0, 0);
|
|
32
|
+
})), "@gjermundgaraba/pixel-paper/skip-link/skip-link.js#onNone"),
|
|
33
|
+
onSome: (fragment) => __foldkitBrandViewResult((Dom.scrollIntoView(`#${CSS.escape(fragment)}`).pipe(Effect.ignore, Effect.andThen(focusFragment(fragment)))), "@gjermundgaraba/pixel-paper/skip-link/skip-link.js#onSome")
|
|
34
|
+
}).pipe(Effect.as(Message.CompletedScrollToFragment()))), "@gjermundgaraba/pixel-paper/skip-link/skip-link.js#execute")
|
|
35
|
+
});
|
|
36
|
+
export { Message, ScrollToFragment, focusFragment, view };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { Array } from "effect";
|
|
3
|
+
// src/slot/slot.ts
|
|
4
|
+
const slotView = (tag, slotClass, slot, h, attributes = []) => __foldkitBrandViewResult((Array.match(slot, {
|
|
5
|
+
onEmpty: () => __foldkitBrandViewResult(([]), "@gjermundgaraba/pixel-paper/slot/slot.js#onEmpty"),
|
|
6
|
+
onNonEmpty: (content) => __foldkitBrandViewResult(([h[tag]([...attributes, h.Class(slotClass)], content)]), "@gjermundgaraba/pixel-paper/slot/slot.js#onNonEmpty")
|
|
7
|
+
})), "@gjermundgaraba/pixel-paper/slot/slot.js#slotView");
|
|
8
|
+
export { slotView };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { AnnounceReorder, InitConfig, Item, ItemRender, Message, Model, OutMessage, ViewInputs, init, subscriptions, update, view } from "./sortable.js";
|
|
2
|
+
declare namespace index_d_exports {
|
|
3
|
+
export { AnnounceReorder, InitConfig, Item, ItemRender, Message, Model, OutMessage, ViewInputs, init, subscriptions, update, view };
|
|
4
|
+
}
|
|
5
|
+
export { AnnounceReorder, type InitConfig, Item, type ItemRender, Message, Model, OutMessage, type ViewInputs, index_d_exports, init, subscriptions, update, view };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
3
|
+
import { AnnounceReorder, Item, Message, Model, OutMessage, init, subscriptions, update, view } from "./sortable.js";
|
|
4
|
+
// src/sortable/index.ts
|
|
5
|
+
var sortable_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
AnnounceReorder: () => __foldkitBrandViewResult((AnnounceReorder), "@gjermundgaraba/pixel-paper/sortable/index.js#AnnounceReorder"),
|
|
7
|
+
Item: () => __foldkitBrandViewResult((Item), "@gjermundgaraba/pixel-paper/sortable/index.js#Item"),
|
|
8
|
+
Message: () => __foldkitBrandViewResult((Message), "@gjermundgaraba/pixel-paper/sortable/index.js#Message"),
|
|
9
|
+
Model: () => __foldkitBrandViewResult((Model), "@gjermundgaraba/pixel-paper/sortable/index.js#Model"),
|
|
10
|
+
OutMessage: () => __foldkitBrandViewResult((OutMessage), "@gjermundgaraba/pixel-paper/sortable/index.js#OutMessage"),
|
|
11
|
+
init: () => __foldkitBrandViewResult((init), "@gjermundgaraba/pixel-paper/sortable/index.js#init"),
|
|
12
|
+
subscriptions: () => __foldkitBrandViewResult((subscriptions), "@gjermundgaraba/pixel-paper/sortable/index.js#subscriptions"),
|
|
13
|
+
update: () => __foldkitBrandViewResult((update), "@gjermundgaraba/pixel-paper/sortable/index.js#update"),
|
|
14
|
+
view: () => __foldkitBrandViewResult((view), "@gjermundgaraba/pixel-paper/sortable/index.js#view")
|
|
15
|
+
});
|
|
16
|
+
export { AnnounceReorder, Item, Message, Model, OutMessage, init, sortable_exports, subscriptions, update, view };
|