@nmnmcc/standard 0.0.0-stage → 0.4.0
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 +516 -2
- package/dist/Extend.d.ts +15 -0
- package/dist/Extend.d.ts.map +1 -0
- package/dist/Extend.js +1 -0
- package/dist/Node.d.ts +71 -0
- package/dist/Node.d.ts.map +1 -0
- package/dist/Palette-BIJ96BEh.js +84 -0
- package/dist/Palette.d.ts +8 -0
- package/dist/Palette.d.ts.map +1 -0
- package/dist/Palette.js +1 -0
- package/dist/Standard-BPpzr5SM.js +488 -0
- package/dist/Standard.d.ts +249 -0
- package/dist/Standard.d.ts.map +1 -0
- package/dist/Standard.js +1 -0
- package/dist/Ui-B9xQqqNT.js +468 -0
- package/dist/Ui.d.ts +500 -0
- package/dist/Ui.d.ts.map +1 -0
- package/dist/Ui.js +1 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/rolldown-runtime-BMBA7GOT.js +10 -0
- package/dist/standard/button/button.d.ts +21 -0
- package/dist/standard/button/button.d.ts.map +1 -0
- package/dist/standard/colour/colour.d.ts +93 -0
- package/dist/standard/colour/colour.d.ts.map +1 -0
- package/dist/standard/field/field.d.ts +91 -0
- package/dist/standard/field/field.d.ts.map +1 -0
- package/dist/standard/form/form.d.ts +16 -0
- package/dist/standard/form/form.d.ts.map +1 -0
- package/dist/standard/icon/icon.d.ts +31 -0
- package/dist/standard/icon/icon.d.ts.map +1 -0
- package/dist/standard/image/image.d.ts +21 -0
- package/dist/standard/image/image.d.ts.map +1 -0
- package/dist/standard/layout/layout.d.ts +73 -0
- package/dist/standard/layout/layout.d.ts.map +1 -0
- package/dist/standard/list/list.d.ts +26 -0
- package/dist/standard/list/list.d.ts.map +1 -0
- package/dist/standard/page/page.d.ts +20 -0
- package/dist/standard/page/page.d.ts.map +1 -0
- package/dist/standard/table/table.d.ts +18 -0
- package/dist/standard/table/table.d.ts.map +1 -0
- package/dist/standard/text/text.d.ts +39 -0
- package/dist/standard/text/text.d.ts.map +1 -0
- package/dist/standard/tokens/classes.d.ts +16 -0
- package/dist/standard/tokens/classes.d.ts.map +1 -0
- package/dist/standard/tokens/tokens.d.ts +162 -0
- package/dist/standard/tokens/tokens.d.ts.map +1 -0
- package/dist/standard.css +2 -0
- package/dist/ui/arrow/arrow.d.ts +18 -0
- package/dist/ui/arrow/arrow.d.ts.map +1 -0
- package/dist/ui/avatar/avatar.d.ts +15 -0
- package/dist/ui/avatar/avatar.d.ts.map +1 -0
- package/dist/ui/board/board.d.ts +34 -0
- package/dist/ui/board/board.d.ts.map +1 -0
- package/dist/ui/bullet/bullet.d.ts +15 -0
- package/dist/ui/bullet/bullet.d.ts.map +1 -0
- package/dist/ui/card/card.d.ts +24 -0
- package/dist/ui/card/card.d.ts.map +1 -0
- package/dist/ui/carousel/carousel.d.ts +17 -0
- package/dist/ui/carousel/carousel.d.ts.map +1 -0
- package/dist/ui/check/check.d.ts +20 -0
- package/dist/ui/check/check.d.ts.map +1 -0
- package/dist/ui/choice/choice.d.ts +19 -0
- package/dist/ui/choice/choice.d.ts.map +1 -0
- package/dist/ui/control/control.d.ts +57 -0
- package/dist/ui/control/control.d.ts.map +1 -0
- package/dist/ui/dialog/dialog.d.ts +30 -0
- package/dist/ui/dialog/dialog.d.ts.map +1 -0
- package/dist/ui/disclosure/disclosure.d.ts +20 -0
- package/dist/ui/disclosure/disclosure.d.ts.map +1 -0
- package/dist/ui/flap/flap.d.ts +18 -0
- package/dist/ui/flap/flap.d.ts.map +1 -0
- package/dist/ui/item/item.d.ts +21 -0
- package/dist/ui/item/item.d.ts.map +1 -0
- package/dist/ui/key/key.d.ts +12 -0
- package/dist/ui/key/key.d.ts.map +1 -0
- package/dist/ui/menu/menu.d.ts +26 -0
- package/dist/ui/menu/menu.d.ts.map +1 -0
- package/dist/ui/modal/modal.d.ts +22 -0
- package/dist/ui/modal/modal.d.ts.map +1 -0
- package/dist/ui/navigator/navigator.d.ts +137 -0
- package/dist/ui/navigator/navigator.d.ts.map +1 -0
- package/dist/ui/notice/notice.d.ts +34 -0
- package/dist/ui/notice/notice.d.ts.map +1 -0
- package/dist/ui/options/options.d.ts +19 -0
- package/dist/ui/options/options.d.ts.map +1 -0
- package/dist/ui/pager/pager.d.ts +29 -0
- package/dist/ui/pager/pager.d.ts.map +1 -0
- package/dist/ui/pagination/pagination.d.ts +14 -0
- package/dist/ui/pagination/pagination.d.ts.map +1 -0
- package/dist/ui/popover/popover.d.ts +20 -0
- package/dist/ui/popover/popover.d.ts.map +1 -0
- package/dist/ui/progress/progress.d.ts +17 -0
- package/dist/ui/progress/progress.d.ts.map +1 -0
- package/dist/ui/route/route.d.ts +27 -0
- package/dist/ui/route/route.d.ts.map +1 -0
- package/dist/ui/sheet/sheet.d.ts +35 -0
- package/dist/ui/sheet/sheet.d.ts.map +1 -0
- package/dist/ui/skeleton/skeleton.d.ts +15 -0
- package/dist/ui/skeleton/skeleton.d.ts.map +1 -0
- package/dist/ui/slider/slider.d.ts +23 -0
- package/dist/ui/slider/slider.d.ts.map +1 -0
- package/dist/ui/stepper/stepper.d.ts +32 -0
- package/dist/ui/stepper/stepper.d.ts.map +1 -0
- package/dist/ui/tabs/tabs.d.ts +22 -0
- package/dist/ui/tabs/tabs.d.ts.map +1 -0
- package/dist/ui/tag/tag.d.ts +17 -0
- package/dist/ui/tag/tag.d.ts.map +1 -0
- package/dist/ui/tile/tile.d.ts +38 -0
- package/dist/ui/tile/tile.d.ts.map +1 -0
- package/dist/ui/toasts/toasts.d.ts +17 -0
- package/dist/ui/toasts/toasts.d.ts.map +1 -0
- package/dist/ui/toggle/toggle.d.ts +17 -0
- package/dist/ui/toggle/toggle.d.ts.map +1 -0
- package/dist/ui/trail/trail.d.ts +22 -0
- package/dist/ui/trail/trail.d.ts.map +1 -0
- package/package.json +70 -3
- package/src/Extend.ts +14 -0
- package/src/Node.ts +44 -0
- package/src/Palette.ts +7 -0
- package/src/Standard.ts +109 -0
- package/src/Ui.ts +156 -0
- package/src/index.ts +27 -0
- package/src/standard/button/button.module.css +43 -0
- package/src/standard/button/button.module.d.css.ts +6 -0
- package/src/standard/button/button.ts +38 -0
- package/src/standard/colour/colour.ts +197 -0
- package/src/standard/field/field.module.css +222 -0
- package/src/standard/field/field.module.d.css.ts +13 -0
- package/src/standard/field/field.ts +266 -0
- package/src/standard/form/form.ts +25 -0
- package/src/standard/icon/icon.module.css +349 -0
- package/src/standard/icon/icon.module.d.css.ts +112 -0
- package/src/standard/icon/icon.ts +148 -0
- package/src/standard/image/image.module.css +42 -0
- package/src/standard/image/image.module.d.css.ts +12 -0
- package/src/standard/image/image.ts +39 -0
- package/src/standard/layout/layout.module.css +224 -0
- package/src/standard/layout/layout.module.d.css.ts +41 -0
- package/src/standard/layout/layout.ts +133 -0
- package/src/standard/list/list.module.css +71 -0
- package/src/standard/list/list.module.d.css.ts +10 -0
- package/src/standard/list/list.ts +53 -0
- package/src/standard/page/page.module.css +244 -0
- package/src/standard/page/page.module.d.css.ts +9 -0
- package/src/standard/page/page.ts +32 -0
- package/src/standard/table/table.module.css +40 -0
- package/src/standard/table/table.module.d.css.ts +6 -0
- package/src/standard/table/table.ts +36 -0
- package/src/standard/text/text.module.css +149 -0
- package/src/standard/text/text.module.d.css.ts +19 -0
- package/src/standard/text/text.ts +77 -0
- package/src/standard/tokens/classes.ts +31 -0
- package/src/standard/tokens/tokens.module.css +294 -0
- package/src/standard/tokens/tokens.module.d.css.ts +40 -0
- package/src/standard/tokens/tokens.ts +339 -0
- package/src/ui/arrow/arrow.module.css +38 -0
- package/src/ui/arrow/arrow.module.d.css.ts +13 -0
- package/src/ui/arrow/arrow.ts +35 -0
- package/src/ui/avatar/avatar.module.css +25 -0
- package/src/ui/avatar/avatar.module.d.css.ts +5 -0
- package/src/ui/avatar/avatar.ts +28 -0
- package/src/ui/board/board.module.css +94 -0
- package/src/ui/board/board.module.d.css.ts +10 -0
- package/src/ui/board/board.ts +84 -0
- package/src/ui/bullet/bullet.module.css +28 -0
- package/src/ui/bullet/bullet.module.d.css.ts +5 -0
- package/src/ui/bullet/bullet.ts +16 -0
- package/src/ui/card/card.module.css +80 -0
- package/src/ui/card/card.module.d.css.ts +6 -0
- package/src/ui/card/card.ts +42 -0
- package/src/ui/carousel/carousel.module.css +24 -0
- package/src/ui/carousel/carousel.module.d.css.ts +5 -0
- package/src/ui/carousel/carousel.ts +30 -0
- package/src/ui/check/check.module.css +53 -0
- package/src/ui/check/check.module.d.css.ts +8 -0
- package/src/ui/check/check.ts +46 -0
- package/src/ui/choice/choice.module.css +32 -0
- package/src/ui/choice/choice.module.d.css.ts +6 -0
- package/src/ui/choice/choice.ts +31 -0
- package/src/ui/control/control.module.css +127 -0
- package/src/ui/control/control.module.d.css.ts +12 -0
- package/src/ui/control/control.ts +97 -0
- package/src/ui/dialog/dialog.module.css +42 -0
- package/src/ui/dialog/dialog.module.d.css.ts +6 -0
- package/src/ui/dialog/dialog.ts +44 -0
- package/src/ui/disclosure/disclosure.module.css +57 -0
- package/src/ui/disclosure/disclosure.module.d.css.ts +7 -0
- package/src/ui/disclosure/disclosure.ts +32 -0
- package/src/ui/flap/flap.module.css +161 -0
- package/src/ui/flap/flap.module.d.css.ts +48 -0
- package/src/ui/flap/flap.ts +78 -0
- package/src/ui/item/item.module.css +39 -0
- package/src/ui/item/item.module.d.css.ts +7 -0
- package/src/ui/item/item.ts +33 -0
- package/src/ui/key/key.module.css +15 -0
- package/src/ui/key/key.module.d.css.ts +5 -0
- package/src/ui/key/key.ts +13 -0
- package/src/ui/menu/menu.module.css +11 -0
- package/src/ui/menu/menu.module.d.css.ts +5 -0
- package/src/ui/menu/menu.ts +48 -0
- package/src/ui/modal/modal.module.css +66 -0
- package/src/ui/modal/modal.module.d.css.ts +8 -0
- package/src/ui/modal/modal.ts +55 -0
- package/src/ui/navigator/navigator.module.css +658 -0
- package/src/ui/navigator/navigator.module.d.css.ts +39 -0
- package/src/ui/navigator/navigator.ts +337 -0
- package/src/ui/notice/notice.module.css +80 -0
- package/src/ui/notice/notice.module.d.css.ts +10 -0
- package/src/ui/notice/notice.ts +57 -0
- package/src/ui/options/options.module.css +30 -0
- package/src/ui/options/options.module.d.css.ts +6 -0
- package/src/ui/options/options.ts +31 -0
- package/src/ui/pager/pager.module.css +38 -0
- package/src/ui/pager/pager.module.d.css.ts +8 -0
- package/src/ui/pager/pager.ts +48 -0
- package/src/ui/pagination/pagination.module.css +38 -0
- package/src/ui/pagination/pagination.module.d.css.ts +7 -0
- package/src/ui/pagination/pagination.ts +52 -0
- package/src/ui/popover/popover.module.css +94 -0
- package/src/ui/popover/popover.module.d.css.ts +8 -0
- package/src/ui/popover/popover.ts +139 -0
- package/src/ui/progress/progress.module.css +69 -0
- package/src/ui/progress/progress.module.d.css.ts +6 -0
- package/src/ui/progress/progress.ts +26 -0
- package/src/ui/route/route.module.css +116 -0
- package/src/ui/route/route.module.d.css.ts +11 -0
- package/src/ui/route/route.ts +58 -0
- package/src/ui/sheet/sheet.module.css +194 -0
- package/src/ui/sheet/sheet.module.d.css.ts +7 -0
- package/src/ui/sheet/sheet.ts +47 -0
- package/src/ui/skeleton/skeleton.module.css +44 -0
- package/src/ui/skeleton/skeleton.module.d.css.ts +6 -0
- package/src/ui/skeleton/skeleton.ts +20 -0
- package/src/ui/slider/slider.module.css +56 -0
- package/src/ui/slider/slider.module.d.css.ts +6 -0
- package/src/ui/slider/slider.ts +48 -0
- package/src/ui/stepper/stepper.module.css +32 -0
- package/src/ui/stepper/stepper.module.d.css.ts +7 -0
- package/src/ui/stepper/stepper.ts +62 -0
- package/src/ui/tabs/tabs.module.css +38 -0
- package/src/ui/tabs/tabs.module.d.css.ts +6 -0
- package/src/ui/tabs/tabs.ts +24 -0
- package/src/ui/tag/tag.module.css +23 -0
- package/src/ui/tag/tag.module.d.css.ts +5 -0
- package/src/ui/tag/tag.ts +17 -0
- package/src/ui/tile/tile.module.css +137 -0
- package/src/ui/tile/tile.module.d.css.ts +13 -0
- package/src/ui/tile/tile.ts +69 -0
- package/src/ui/toasts/toasts.module.css +38 -0
- package/src/ui/toasts/toasts.module.d.css.ts +6 -0
- package/src/ui/toasts/toasts.ts +26 -0
- package/src/ui/toggle/toggle.module.css +46 -0
- package/src/ui/toggle/toggle.module.d.css.ts +6 -0
- package/src/ui/toggle/toggle.ts +29 -0
- package/src/ui/trail/trail.module.css +42 -0
- package/src/ui/trail/trail.module.d.css.ts +5 -0
- package/src/ui/trail/trail.ts +28 -0
package/dist/Ui.d.ts
ADDED
|
@@ -0,0 +1,500 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive components in the language of `Standard`.
|
|
3
|
+
*
|
|
4
|
+
* The module is organised around what a person does to a component, not
|
|
5
|
+
* around the screen: each builder is a thing to press, choose, switch,
|
|
6
|
+
* follow or dismiss, and it behaves the same under a mouse, a finger and a
|
|
7
|
+
* keyboard. What is on, selected or current is a block of colour, never a
|
|
8
|
+
* line under or beside a word. An app has a `navigator`: everywhere one can
|
|
9
|
+
* go, at the side of the page, along its top, or along its bottom.
|
|
10
|
+
*
|
|
11
|
+
* From the signage of public transport it takes how signs work, not how
|
|
12
|
+
* they look: one thing said per sign, at a size read at a glance; direction
|
|
13
|
+
* shown by position and by an arrow; colour telling things of one kind
|
|
14
|
+
* apart, and never colour alone. It doesn't take lines, stations or maps:
|
|
15
|
+
* an app isn't a network.
|
|
16
|
+
*
|
|
17
|
+
* `s` here is `Standard`'s `s` with these builders added.
|
|
18
|
+
*
|
|
19
|
+
* @since 0.1.0
|
|
20
|
+
*/
|
|
21
|
+
import type { Component } from "effect/ui";
|
|
22
|
+
import type { Html } from "effect/ui/html";
|
|
23
|
+
import { type Node } from "./Node.ts";
|
|
24
|
+
import * as Standard from "./Standard.ts";
|
|
25
|
+
export { Direction } from "./ui/arrow/arrow.ts";
|
|
26
|
+
export type { Action, Actions, Item } from "./ui/control/control.ts";
|
|
27
|
+
export { Hold, Place } from "./ui/navigator/navigator.ts";
|
|
28
|
+
export { Level } from "./ui/notice/notice.ts";
|
|
29
|
+
/**
|
|
30
|
+
* The language's builders and the components, bound to a view's `h`. Each
|
|
31
|
+
* component is in `src/ui`, in the file of its name, with its stylesheet
|
|
32
|
+
* beside it.
|
|
33
|
+
*
|
|
34
|
+
* @since 0.1.0
|
|
35
|
+
*/
|
|
36
|
+
export declare const builders: <Msg, Props>(h: Html.H<Msg> & {
|
|
37
|
+
readonly props: Props;
|
|
38
|
+
}) => {
|
|
39
|
+
icon: (name: Standard.Icon, label?: string) => Node<"inline", Msg, never>;
|
|
40
|
+
button: (options: {
|
|
41
|
+
readonly onClick?: Msg;
|
|
42
|
+
readonly kind?: "primary" | "secondary";
|
|
43
|
+
readonly type?: "button" | "submit";
|
|
44
|
+
readonly disabled?: boolean;
|
|
45
|
+
readonly icon?: Standard.Icon;
|
|
46
|
+
}, label: string) => Node<"block", Msg, never>;
|
|
47
|
+
field: (options: Omit<import("./standard/field/field.ts").Frame, "onBlur"> & {
|
|
48
|
+
readonly value: string;
|
|
49
|
+
readonly onInput: (value: string) => Msg;
|
|
50
|
+
readonly onBlur?: Msg;
|
|
51
|
+
readonly type?: "text" | "email" | "password" | "search" | "tel" | "url" | "number" | "date" | "time" | "datetime-local" | "month";
|
|
52
|
+
readonly placeholder?: string;
|
|
53
|
+
readonly icon?: Standard.Icon;
|
|
54
|
+
readonly prefix?: string;
|
|
55
|
+
readonly suffix?: string;
|
|
56
|
+
readonly action?: import("./standard/field/field.ts").Action<Msg>;
|
|
57
|
+
readonly inputMode?: "text" | "numeric" | "decimal" | "tel" | "email" | "url" | "search";
|
|
58
|
+
readonly autoComplete?: string;
|
|
59
|
+
readonly autoFocus?: boolean;
|
|
60
|
+
readonly maxLength?: number;
|
|
61
|
+
readonly min?: number | string;
|
|
62
|
+
readonly max?: number | string;
|
|
63
|
+
readonly step?: number | string;
|
|
64
|
+
readonly readOnly?: boolean;
|
|
65
|
+
readonly suggestions?: ReadonlyArray<string>;
|
|
66
|
+
}) => Node<"block", Msg, never>;
|
|
67
|
+
textarea: (options: Omit<import("./standard/field/field.ts").Frame, "onBlur"> & {
|
|
68
|
+
readonly value: string;
|
|
69
|
+
readonly onInput: (value: string) => Msg;
|
|
70
|
+
readonly onBlur?: Msg;
|
|
71
|
+
readonly placeholder?: string;
|
|
72
|
+
readonly rows?: number;
|
|
73
|
+
readonly maxLength?: number;
|
|
74
|
+
readonly readOnly?: boolean;
|
|
75
|
+
}) => Node<"block", Msg, never>;
|
|
76
|
+
select: <A extends string>(options: Omit<import("./standard/field/field.ts").Frame, "onBlur"> & {
|
|
77
|
+
readonly value: A;
|
|
78
|
+
readonly onChange: (value: string) => Msg;
|
|
79
|
+
readonly options: readonly {
|
|
80
|
+
readonly value: A;
|
|
81
|
+
readonly label: string;
|
|
82
|
+
readonly disabled?: boolean;
|
|
83
|
+
}[];
|
|
84
|
+
readonly placeholder?: string;
|
|
85
|
+
readonly icon?: Standard.Icon;
|
|
86
|
+
}) => Node<"block", Msg, never>;
|
|
87
|
+
form: <R = never>(options: {
|
|
88
|
+
readonly onSubmit: Msg;
|
|
89
|
+
readonly gap?: Standard.Space;
|
|
90
|
+
}, ...children: readonly Standard.Child<Standard.Kind, Msg, R>[]) => Node<"block", Msg, R>;
|
|
91
|
+
image: (options: {
|
|
92
|
+
readonly src: string;
|
|
93
|
+
readonly alt: string;
|
|
94
|
+
readonly ratio?: Standard.Ratio;
|
|
95
|
+
readonly caption?: string;
|
|
96
|
+
}) => Node<"block", Msg, never>;
|
|
97
|
+
section: <R = never>(options: {
|
|
98
|
+
readonly as?: Standard.Landmark;
|
|
99
|
+
readonly tone?: Standard.Tone;
|
|
100
|
+
readonly accent?: Standard.Colour;
|
|
101
|
+
readonly pad?: Standard.Space;
|
|
102
|
+
readonly gap?: Standard.Space;
|
|
103
|
+
readonly label?: string;
|
|
104
|
+
readonly select?: boolean;
|
|
105
|
+
}, ...children: readonly Standard.Child<Standard.Kind, Msg, R>[]) => Node<"block", Msg, R>;
|
|
106
|
+
grid: <R = never>(options: {
|
|
107
|
+
readonly gap?: Standard.Space;
|
|
108
|
+
readonly align?: Standard.Align;
|
|
109
|
+
}, ...children: readonly Standard.Child<Standard.Kind, Msg, R>[]) => Node<"block", Msg, R>;
|
|
110
|
+
col: <R = never>(options: {
|
|
111
|
+
readonly span: Standard.Span;
|
|
112
|
+
readonly start?: Standard.Span;
|
|
113
|
+
readonly gap?: Standard.Space;
|
|
114
|
+
readonly align?: Standard.Align;
|
|
115
|
+
readonly only?: Standard.Only;
|
|
116
|
+
readonly sticky?: boolean;
|
|
117
|
+
readonly fill?: boolean;
|
|
118
|
+
}, ...children: readonly Standard.Child<Standard.Kind, Msg, R>[]) => Node<"block", Msg, R>;
|
|
119
|
+
stack: <R = never>(options: {
|
|
120
|
+
readonly as?: Standard.Landmark;
|
|
121
|
+
readonly label?: string;
|
|
122
|
+
readonly gap?: Standard.Space;
|
|
123
|
+
readonly only?: Standard.Only;
|
|
124
|
+
readonly select?: boolean;
|
|
125
|
+
}, ...children: readonly Standard.Child<Standard.Kind, Msg, R>[]) => Node<"block", Msg, R>;
|
|
126
|
+
row: <R = never>(options: {
|
|
127
|
+
readonly gap?: Standard.Space;
|
|
128
|
+
readonly align?: Standard.Align;
|
|
129
|
+
}, ...children: readonly Standard.Child<Standard.Kind, Msg, R>[]) => Node<"block", Msg, R>;
|
|
130
|
+
rule: (options?: {
|
|
131
|
+
readonly weight?: "hair" | "bold";
|
|
132
|
+
readonly accent?: boolean;
|
|
133
|
+
}) => Node<"block", Msg, never>;
|
|
134
|
+
list: <R = never>(options: {
|
|
135
|
+
readonly marker?: "dash" | "number" | "none";
|
|
136
|
+
readonly ruled?: boolean;
|
|
137
|
+
}, ...items: readonly Standard.Child<Standard.Kind, Msg, R>[]) => Node<"block", Msg, R>;
|
|
138
|
+
facts: <R = never>(options: {
|
|
139
|
+
readonly beside?: boolean;
|
|
140
|
+
}, ...items: readonly (false | {
|
|
141
|
+
readonly name: string;
|
|
142
|
+
readonly value: Standard.Child<"inline", Msg, R>;
|
|
143
|
+
} | null | undefined)[]) => Node<"block", Msg, R>;
|
|
144
|
+
page: <R = never>(options: {
|
|
145
|
+
readonly accent?: Standard.Colour;
|
|
146
|
+
readonly scheme?: Standard.Scheme;
|
|
147
|
+
}, ...children: readonly Standard.Child<Standard.Kind, Msg, R>[]) => Node<"block", Msg, R>;
|
|
148
|
+
table: (options: {
|
|
149
|
+
readonly columns: ReadonlyArray<{
|
|
150
|
+
readonly title: string;
|
|
151
|
+
readonly numeric?: boolean;
|
|
152
|
+
}>;
|
|
153
|
+
readonly rows: ReadonlyArray<ReadonlyArray<string>>;
|
|
154
|
+
}) => Node<"block", Msg, never>;
|
|
155
|
+
text: <R = never>(role: Standard.Role, ...children: readonly Standard.Child<"inline", Msg, R>[]) => Node<"block", Msg, R>;
|
|
156
|
+
em: <R = never>(emphasis: Standard.Emphasis, ...children: readonly Standard.Child<"inline", Msg, R>[]) => Node<"inline", Msg, R>;
|
|
157
|
+
code: (text: string) => Node<"inline", Msg, never>;
|
|
158
|
+
listing: (options: {
|
|
159
|
+
readonly label?: string;
|
|
160
|
+
readonly select?: boolean;
|
|
161
|
+
}, text: string) => Node<"block", Msg, never>;
|
|
162
|
+
quote: <R = never>(options: {
|
|
163
|
+
readonly by?: string;
|
|
164
|
+
readonly from?: string;
|
|
165
|
+
}, ...children: readonly Standard.Child<"inline", Msg, R>[]) => Node<"block", Msg, R>;
|
|
166
|
+
link: <R = never>(options: {
|
|
167
|
+
readonly href: string;
|
|
168
|
+
readonly external?: boolean;
|
|
169
|
+
readonly current?: boolean;
|
|
170
|
+
}, ...children: readonly Standard.Child<"inline", Msg, R>[]) => Node<"inline", Msg, R>;
|
|
171
|
+
br: Node<"inline", Msg, never>;
|
|
172
|
+
props: Props;
|
|
173
|
+
child: <R = never>(place: (h: import("effect/ui/View").HelperBase<Msg, unknown>) => import("effect/ui/View").Child<Msg, R>) => Node<"block", Msg, R>;
|
|
174
|
+
arrow: (direction: import("./Ui.ts").Direction, label?: string) => Node<"inline", Msg, never>;
|
|
175
|
+
avatar: (options: {
|
|
176
|
+
readonly name: string;
|
|
177
|
+
readonly src?: string;
|
|
178
|
+
}) => Node<"inline", Msg, never>;
|
|
179
|
+
board: (options: {
|
|
180
|
+
readonly label: string;
|
|
181
|
+
readonly columns: ReadonlyArray<{
|
|
182
|
+
readonly title: string;
|
|
183
|
+
readonly numeric?: boolean;
|
|
184
|
+
readonly only?: Standard.Only;
|
|
185
|
+
}>;
|
|
186
|
+
readonly rows: readonly {
|
|
187
|
+
readonly cells: readonly Standard.Child<"inline", Msg>[];
|
|
188
|
+
readonly onSelect?: Msg;
|
|
189
|
+
}[];
|
|
190
|
+
readonly tone?: Standard.Tone;
|
|
191
|
+
readonly dense?: boolean;
|
|
192
|
+
}) => Node<"block", Msg, never>;
|
|
193
|
+
bullet: (options: {
|
|
194
|
+
readonly colour?: Standard.Colour;
|
|
195
|
+
}, label: string) => Node<"inline", Msg, never>;
|
|
196
|
+
card: <R = never>(options: {
|
|
197
|
+
readonly colour?: Standard.Colour;
|
|
198
|
+
readonly tone?: Standard.Tone;
|
|
199
|
+
readonly gap?: Standard.Space;
|
|
200
|
+
readonly actions?: import("./Ui.ts").Actions<Msg>;
|
|
201
|
+
}, ...children: readonly Standard.Child<Standard.Kind, Msg, R>[]) => Node<"block", Msg, R>;
|
|
202
|
+
carousel: <R = never>(options: {
|
|
203
|
+
readonly label: string;
|
|
204
|
+
}, ...items: readonly Standard.Child<"block", Msg, R>[]) => Node<"block", Msg, R>;
|
|
205
|
+
check: (options: {
|
|
206
|
+
readonly name: string;
|
|
207
|
+
readonly label: string;
|
|
208
|
+
readonly checked: boolean;
|
|
209
|
+
readonly onChange: (checked: boolean) => Msg;
|
|
210
|
+
readonly error?: string | null;
|
|
211
|
+
readonly disabled?: boolean;
|
|
212
|
+
}) => Node<"block", Msg, never>;
|
|
213
|
+
choice: <A extends string>(options: {
|
|
214
|
+
readonly name: string;
|
|
215
|
+
readonly label: string;
|
|
216
|
+
readonly value: A;
|
|
217
|
+
readonly onChange: (value: A) => Msg;
|
|
218
|
+
readonly items: readonly import("./Ui.ts").Item<A>[];
|
|
219
|
+
}) => Node<"block", Msg, never>;
|
|
220
|
+
dialog: <R = never>(options: {
|
|
221
|
+
readonly open: boolean;
|
|
222
|
+
readonly title: string;
|
|
223
|
+
readonly close: {
|
|
224
|
+
readonly label: string;
|
|
225
|
+
readonly onPress: Msg;
|
|
226
|
+
};
|
|
227
|
+
readonly alert?: boolean;
|
|
228
|
+
readonly actions?: import("./Ui.ts").Actions<Msg>;
|
|
229
|
+
}, ...children: readonly Standard.Child<Standard.Kind, Msg, R>[]) => Node<"block", Msg, R>;
|
|
230
|
+
disclosure: <R = never>(options: {
|
|
231
|
+
readonly title: string;
|
|
232
|
+
readonly name?: string;
|
|
233
|
+
readonly open?: boolean;
|
|
234
|
+
}, ...children: readonly Standard.Child<Standard.Kind, Msg, R>[]) => Node<"block", Msg, R>;
|
|
235
|
+
flap: (text: string) => Node<"inline", Msg, never>;
|
|
236
|
+
item: <R = never>(options: {
|
|
237
|
+
readonly actions?: import("./Ui.ts").Actions<Msg>;
|
|
238
|
+
}, ...children: readonly Standard.Child<Standard.Kind, Msg, R>[]) => Node<"block", Msg, R>;
|
|
239
|
+
key: (label: string) => Node<"inline", Msg, never>;
|
|
240
|
+
popover: <R = never>(options: {
|
|
241
|
+
readonly name: string;
|
|
242
|
+
readonly label: string;
|
|
243
|
+
}, ...children: readonly Standard.Child<Standard.Kind, Msg, R>[]) => Node<"block", Msg, R>;
|
|
244
|
+
menu: (options: {
|
|
245
|
+
readonly name: string;
|
|
246
|
+
readonly label: string;
|
|
247
|
+
readonly items: readonly {
|
|
248
|
+
readonly label: string;
|
|
249
|
+
readonly onPress: Msg;
|
|
250
|
+
readonly icon?: Standard.Icon;
|
|
251
|
+
readonly disabled?: boolean;
|
|
252
|
+
}[];
|
|
253
|
+
}) => Node<"block", Msg, never>;
|
|
254
|
+
navigator: <R = never>(options: {
|
|
255
|
+
readonly label: string;
|
|
256
|
+
readonly groups: ReadonlyArray<{
|
|
257
|
+
readonly label: string;
|
|
258
|
+
readonly icon: Standard.Icon;
|
|
259
|
+
readonly colour?: Standard.Colour;
|
|
260
|
+
readonly links: ReadonlyArray<{
|
|
261
|
+
readonly label: string;
|
|
262
|
+
readonly href: string;
|
|
263
|
+
readonly icon?: Standard.Icon;
|
|
264
|
+
readonly current?: boolean;
|
|
265
|
+
}>;
|
|
266
|
+
}>;
|
|
267
|
+
readonly shown: number;
|
|
268
|
+
readonly onShow: (index: number, as: import("./Ui.ts").Hold) => Msg;
|
|
269
|
+
readonly open?: boolean;
|
|
270
|
+
readonly toggle: {
|
|
271
|
+
readonly label: string;
|
|
272
|
+
readonly onToggle: (open: boolean, as: import("./Ui.ts").Hold) => Msg;
|
|
273
|
+
};
|
|
274
|
+
readonly brand?: {
|
|
275
|
+
readonly name: string;
|
|
276
|
+
readonly icon?: Standard.Icon;
|
|
277
|
+
readonly src?: string;
|
|
278
|
+
readonly colour?: Standard.Colour;
|
|
279
|
+
};
|
|
280
|
+
readonly back?: {
|
|
281
|
+
readonly label: string;
|
|
282
|
+
readonly onPress: Msg;
|
|
283
|
+
readonly disabled?: boolean;
|
|
284
|
+
readonly travel?: ReadonlyArray<Standard.Travel>;
|
|
285
|
+
};
|
|
286
|
+
readonly place?: import("./Ui.ts").Place;
|
|
287
|
+
readonly mode?: Exclude<import("./Ui.ts").Hold, "menu">;
|
|
288
|
+
readonly tone?: Standard.Tone;
|
|
289
|
+
}, ...children: readonly Standard.Child<Standard.Kind, Msg, R>[]) => Node<"block", Msg, R>;
|
|
290
|
+
notice: <R = never>(options: {
|
|
291
|
+
readonly title: string;
|
|
292
|
+
readonly level?: import("./Ui.ts").Level;
|
|
293
|
+
readonly icon?: Standard.Icon;
|
|
294
|
+
readonly dismiss?: {
|
|
295
|
+
readonly label: string;
|
|
296
|
+
readonly onPress: Msg;
|
|
297
|
+
};
|
|
298
|
+
readonly actions?: import("./Ui.ts").Actions<Msg>;
|
|
299
|
+
}, ...children: readonly Standard.Child<Standard.Kind, Msg, R>[]) => Node<"block", Msg, R>;
|
|
300
|
+
options: <A extends string>(options: {
|
|
301
|
+
readonly name: string;
|
|
302
|
+
readonly label: string;
|
|
303
|
+
readonly value: A;
|
|
304
|
+
readonly onChange: (value: A) => Msg;
|
|
305
|
+
readonly items: readonly import("./Ui.ts").Item<A>[];
|
|
306
|
+
}) => Node<"block", Msg, never>;
|
|
307
|
+
pager: (options: {
|
|
308
|
+
readonly label: string;
|
|
309
|
+
readonly previous?: {
|
|
310
|
+
readonly label: string;
|
|
311
|
+
readonly title: string;
|
|
312
|
+
readonly href: string;
|
|
313
|
+
};
|
|
314
|
+
readonly next?: {
|
|
315
|
+
readonly label: string;
|
|
316
|
+
readonly title: string;
|
|
317
|
+
readonly href: string;
|
|
318
|
+
};
|
|
319
|
+
readonly axis?: "horizontal" | "vertical";
|
|
320
|
+
}) => Node<"block", Msg, never>;
|
|
321
|
+
pagination: (options: {
|
|
322
|
+
readonly label: string;
|
|
323
|
+
readonly page: number;
|
|
324
|
+
readonly count: number;
|
|
325
|
+
readonly onChange: (page: number) => Msg;
|
|
326
|
+
readonly previous: string;
|
|
327
|
+
readonly next: string;
|
|
328
|
+
}) => Node<"block", Msg, never>;
|
|
329
|
+
progress: (options: {
|
|
330
|
+
readonly label: string;
|
|
331
|
+
readonly value?: number;
|
|
332
|
+
readonly colour?: Standard.Colour;
|
|
333
|
+
}) => Node<"block", Msg, never>;
|
|
334
|
+
route: (options: {
|
|
335
|
+
readonly label: string;
|
|
336
|
+
readonly stops: ReadonlyArray<{
|
|
337
|
+
readonly name: string;
|
|
338
|
+
readonly note?: string;
|
|
339
|
+
}>;
|
|
340
|
+
readonly at?: number;
|
|
341
|
+
readonly onSelect?: (index: number) => Msg;
|
|
342
|
+
readonly colour?: Standard.Colour;
|
|
343
|
+
readonly axis?: "vertical" | "horizontal";
|
|
344
|
+
}) => Node<"block", Msg, never>;
|
|
345
|
+
sheet: <R = never>(options: {
|
|
346
|
+
readonly open: boolean;
|
|
347
|
+
readonly title: string;
|
|
348
|
+
readonly close: {
|
|
349
|
+
readonly label: string;
|
|
350
|
+
readonly onPress: Msg;
|
|
351
|
+
};
|
|
352
|
+
readonly side?: "start" | "end";
|
|
353
|
+
readonly actions?: import("./Ui.ts").Actions<Msg>;
|
|
354
|
+
}, ...children: readonly Standard.Child<Standard.Kind, Msg, R>[]) => Node<"block", Msg, R>;
|
|
355
|
+
skeleton: (options: {
|
|
356
|
+
readonly label: string;
|
|
357
|
+
readonly lines?: 1 | 2 | 3 | 4;
|
|
358
|
+
}) => Node<"block", Msg, never>;
|
|
359
|
+
slider: (options: {
|
|
360
|
+
readonly name: string;
|
|
361
|
+
readonly label: string;
|
|
362
|
+
readonly value: number;
|
|
363
|
+
readonly min: number;
|
|
364
|
+
readonly max: number;
|
|
365
|
+
readonly step?: number;
|
|
366
|
+
readonly onInput: (value: number) => Msg;
|
|
367
|
+
readonly shown?: string;
|
|
368
|
+
readonly disabled?: boolean;
|
|
369
|
+
}) => Node<"block", Msg, never>;
|
|
370
|
+
stepper: (options: {
|
|
371
|
+
readonly label: string;
|
|
372
|
+
readonly value: number;
|
|
373
|
+
readonly min?: number;
|
|
374
|
+
readonly max?: number;
|
|
375
|
+
readonly step?: number;
|
|
376
|
+
readonly onChange: (value: number) => Msg;
|
|
377
|
+
readonly less: string;
|
|
378
|
+
readonly more: string;
|
|
379
|
+
readonly shown?: string;
|
|
380
|
+
readonly disabled?: boolean;
|
|
381
|
+
}) => Node<"block", Msg, never>;
|
|
382
|
+
tabs: <A extends string>(options: {
|
|
383
|
+
readonly name: string;
|
|
384
|
+
readonly label: string;
|
|
385
|
+
readonly value: A;
|
|
386
|
+
readonly onChange: (value: A) => Msg;
|
|
387
|
+
readonly items: readonly import("./Ui.ts").Item<A>[];
|
|
388
|
+
}) => Node<"block", Msg, never>;
|
|
389
|
+
tag: (options: {
|
|
390
|
+
readonly colour?: Standard.Colour;
|
|
391
|
+
readonly icon?: Standard.Icon;
|
|
392
|
+
}, label: string) => Node<"inline", Msg, never>;
|
|
393
|
+
tile: (options: {
|
|
394
|
+
readonly label: string;
|
|
395
|
+
readonly onPress?: Msg;
|
|
396
|
+
readonly href?: string;
|
|
397
|
+
readonly value?: string;
|
|
398
|
+
readonly note?: string;
|
|
399
|
+
readonly icon?: Standard.Icon;
|
|
400
|
+
readonly image?: {
|
|
401
|
+
readonly src: string;
|
|
402
|
+
readonly alt: string;
|
|
403
|
+
};
|
|
404
|
+
readonly colour?: Standard.Colour;
|
|
405
|
+
readonly tone?: Standard.Tone;
|
|
406
|
+
readonly disabled?: boolean;
|
|
407
|
+
readonly actions?: import("./Ui.ts").Actions<Msg>;
|
|
408
|
+
}) => Node<"block", Msg, never>;
|
|
409
|
+
toasts: <R = never>(options: {
|
|
410
|
+
readonly label: string;
|
|
411
|
+
}, ...children: readonly Standard.Child<"block", Msg, R>[]) => Node<"block", Msg, R>;
|
|
412
|
+
toggle: (options: {
|
|
413
|
+
readonly label: string;
|
|
414
|
+
readonly on: boolean;
|
|
415
|
+
readonly onChange: (on: boolean) => Msg;
|
|
416
|
+
readonly disabled?: boolean;
|
|
417
|
+
}) => Node<"block", Msg, never>;
|
|
418
|
+
trail: (options: {
|
|
419
|
+
readonly label: string;
|
|
420
|
+
readonly steps: ReadonlyArray<{
|
|
421
|
+
readonly label: string;
|
|
422
|
+
readonly href: string;
|
|
423
|
+
}>;
|
|
424
|
+
readonly here: string;
|
|
425
|
+
}) => Node<"block", Msg, never>;
|
|
426
|
+
};
|
|
427
|
+
/**
|
|
428
|
+
* `s` in a view: the language's builders and the components.
|
|
429
|
+
*
|
|
430
|
+
* @since 0.1.0
|
|
431
|
+
*/
|
|
432
|
+
export type S<Msg, Props = unknown> = ReturnType<typeof builders<Msg, Props>>;
|
|
433
|
+
/**
|
|
434
|
+
* A component whose view is built with `s`.
|
|
435
|
+
*
|
|
436
|
+
* **Example** (A switch)
|
|
437
|
+
*
|
|
438
|
+
* ```ts
|
|
439
|
+
* import { Ui } from "@nmnmcc/standard"
|
|
440
|
+
* import { Schema } from "effect"
|
|
441
|
+
* import { Component } from "effect/ui"
|
|
442
|
+
*
|
|
443
|
+
* const Logic = Component.define({
|
|
444
|
+
* name: "StepFree",
|
|
445
|
+
* model: Schema.Boolean,
|
|
446
|
+
* message: Schema.Literal("Switched")
|
|
447
|
+
* }).logic({
|
|
448
|
+
* init: () => false,
|
|
449
|
+
* update: ($) => !$.model
|
|
450
|
+
* })
|
|
451
|
+
*
|
|
452
|
+
* export const StepFree = Ui.component(Logic, (s, on) =>
|
|
453
|
+
* s.page({},
|
|
454
|
+
* s.section({ as: "main" },
|
|
455
|
+
* s.toggle({ label: "Step-free routes only", on, onChange: () => "Switched" })
|
|
456
|
+
* )
|
|
457
|
+
* )
|
|
458
|
+
* )
|
|
459
|
+
* ```
|
|
460
|
+
*
|
|
461
|
+
* @since 0.1.0
|
|
462
|
+
*/
|
|
463
|
+
export declare const component: <Name extends string, Props, Model, Msg, Events, R, L, Sl extends string, SR, Ch, RV>(logic: Component.Logic<Name, Props, Model, Msg, Events, R, L, Sl, SR, Ch>, view: (s: S<Msg, Props>, model: Model) => Node<"block", Msg, RV>) => Component.Component<Name, Props, Model, Msg, Events, R | Exclude<RV, import("effect/ui/Command").FrameworkService> | Exclude<Exclude<Model extends Component.InitStep<infer _Model, infer _Msg, infer _Events, infer R_1> ? R_1 : never, { readonly [K in keyof SR]: (SR[K] extends infer T_4 ? T_4 extends SR[K] ? T_4 extends {
|
|
464
|
+
readonly optional: true;
|
|
465
|
+
} ? true : false : never : never) extends true ? {
|
|
466
|
+
readonly "~effect/ui/Component/SendTarget": import("effect/Types").Invariant<Component.SharedOwner<SR[K]> extends infer T_5 ? T_5 extends Component.SharedOwner<SR[K]> ? T_5 extends Component.Headless<infer _P, infer _E, infer _Parts, infer _R, infer _Rcv, infer _Sh, infer _SV, infer _Rp, infer K_1, unknown, unknown, {}> ? [K_1] extends [never] ? T_5 : K_1 : T_5 : never : never>;
|
|
467
|
+
} : never; }[keyof SR]> extends infer T_4 ? T_4 extends Exclude<Model extends Component.InitStep<infer _Model, infer _Msg, infer _Events, infer R_1> ? R_1 : never, { readonly [K in keyof SR]: (SR[K] extends infer T_4 ? T_4 extends SR[K] ? T_4 extends {
|
|
468
|
+
readonly optional: true;
|
|
469
|
+
} ? true : false : never : never) extends true ? {
|
|
470
|
+
readonly "~effect/ui/Component/SendTarget": import("effect/Types").Invariant<Component.SharedOwner<SR[K]> extends infer T_5 ? T_5 extends Component.SharedOwner<SR[K]> ? T_5 extends Component.Headless<infer _P, infer _E, infer _Parts, infer _R, infer _Rcv, infer _Sh, infer _SV, infer _Rp, infer K_1, unknown, unknown, {}> ? [K_1] extends [never] ? T_5 : K_1 : T_5 : never : never>;
|
|
471
|
+
} : never; }[keyof SR]> ? T_4 extends {
|
|
472
|
+
readonly "~effect/ui/Component/SendTarget": import("effect/Types").Invariant<infer O>;
|
|
473
|
+
} ? Component.Shared.Of<O> : T_4 : never : never, import("effect/ui/Command").FrameworkService> | Exclude<Exclude<({} & { readonly [T_5 in Msg extends {
|
|
474
|
+
readonly _tag: infer T_1 extends string;
|
|
475
|
+
} ? T_1 : never]?: Model; })[Msg extends {
|
|
476
|
+
readonly _tag: infer T_1 extends string;
|
|
477
|
+
} ? T_1 : never] extends infer T_5 ? T_5 extends ({} & { readonly [T_5 in Msg extends {
|
|
478
|
+
readonly _tag: infer T_1 extends string;
|
|
479
|
+
} ? T_1 : never]?: Model; })[Msg extends {
|
|
480
|
+
readonly _tag: infer T_1 extends string;
|
|
481
|
+
} ? T_1 : never] ? T_5 extends Component.InitStep<infer _Model, infer _Msg, infer _Events, infer R_1> ? R_1 : never : never : never, { readonly [K in keyof SR]: (SR[K] extends infer T_4 ? T_4 extends SR[K] ? T_4 extends {
|
|
482
|
+
readonly optional: true;
|
|
483
|
+
} ? true : false : never : never) extends true ? {
|
|
484
|
+
readonly "~effect/ui/Component/SendTarget": import("effect/Types").Invariant<Component.SharedOwner<SR[K]> extends infer T_5 ? T_5 extends Component.SharedOwner<SR[K]> ? T_5 extends Component.Headless<infer _P, infer _E, infer _Parts, infer _R, infer _Rcv, infer _Sh, infer _SV, infer _Rp, infer K_1, unknown, unknown, {}> ? [K_1] extends [never] ? T_5 : K_1 : T_5 : never : never>;
|
|
485
|
+
} : never; }[keyof SR]> extends infer T_6 ? T_6 extends Exclude<({} & { readonly [T_5 in Msg extends {
|
|
486
|
+
readonly _tag: infer T_1 extends string;
|
|
487
|
+
} ? T_1 : never]?: Model; })[Msg extends {
|
|
488
|
+
readonly _tag: infer T_1 extends string;
|
|
489
|
+
} ? T_1 : never] extends infer T_5 ? T_5 extends ({} & { readonly [T_5 in Msg extends {
|
|
490
|
+
readonly _tag: infer T_1 extends string;
|
|
491
|
+
} ? T_1 : never]?: Model; })[Msg extends {
|
|
492
|
+
readonly _tag: infer T_1 extends string;
|
|
493
|
+
} ? T_1 : never] ? T_5 extends Component.InitStep<infer _Model, infer _Msg, infer _Events, infer R_1> ? R_1 : never : never : never, { readonly [K in keyof SR]: (SR[K] extends infer T_4 ? T_4 extends SR[K] ? T_4 extends {
|
|
494
|
+
readonly optional: true;
|
|
495
|
+
} ? true : false : never : never) extends true ? {
|
|
496
|
+
readonly "~effect/ui/Component/SendTarget": import("effect/Types").Invariant<Component.SharedOwner<SR[K]> extends infer T_5 ? T_5 extends Component.SharedOwner<SR[K]> ? T_5 extends Component.Headless<infer _P, infer _E, infer _Parts, infer _R, infer _Rcv, infer _Sh, infer _SV, infer _Rp, infer K_1, unknown, unknown, {}> ? [K_1] extends [never] ? T_5 : K_1 : T_5 : never : never>;
|
|
497
|
+
} : never; }[keyof SR]> ? T_6 extends {
|
|
498
|
+
readonly "~effect/ui/Component/SendTarget": import("effect/Types").Invariant<infer O>;
|
|
499
|
+
} ? Component.Shared.Of<O> : T_6 : never : never, import("effect/ui/Command").FrameworkService>, Html.Elements, L, Sl>;
|
|
500
|
+
//# sourceMappingURL=Ui.d.ts.map
|
package/dist/Ui.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ui.d.ts","sourceRoot":"","sources":["../src/Ui.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAuB,KAAK,IAAI,EAAE,MAAM,WAAW,CAAA;AAC1D,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAkCzC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAE7C;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,GAAI,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4C7E,CAAA;AAEF;;;;GAIG;AACH,MAAM,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,GAAG,OAAO,IAAI,UAAU,CAAC,OAAO,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,SAAS,GAAI,IAAI,SAAS,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,SACpG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,QACnE,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sHACR,CAAA"}
|
package/dist/Ui.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { s as Direction, a as Hold, i as Level, o as Place, n as builders, r as component } from "./Ui-B9xQqqNT.js";
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @since 0.4.0
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The language itself: grid, type, colour, text, forms, and the movement of
|
|
6
|
+
* a change of view.
|
|
7
|
+
*
|
|
8
|
+
* @since 0.1.0
|
|
9
|
+
*/
|
|
10
|
+
export * as Standard from "./Standard.ts";
|
|
11
|
+
/**
|
|
12
|
+
* Interactive components in the language: `Standard`'s `s`, with things to
|
|
13
|
+
* press, choose, switch, follow and dismiss added.
|
|
14
|
+
*
|
|
15
|
+
* @since 0.1.0
|
|
16
|
+
*/
|
|
17
|
+
export * as Ui from "./Ui.ts";
|
|
18
|
+
/**
|
|
19
|
+
* How the colours are made: the algorithm the palette comes from, and what
|
|
20
|
+
* it guarantees for every hue.
|
|
21
|
+
*
|
|
22
|
+
* @since 0.4.0
|
|
23
|
+
*/
|
|
24
|
+
export * as Palette from "./Palette.ts";
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AAEzC;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAA;AAE7B;;;;;GAKG;AACH,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// \0rolldown/runtime.js
|
|
2
|
+
var e = Object.defineProperty, t = (t, n) => {
|
|
3
|
+
let r = Object.setPrototypeOf({}, null);
|
|
4
|
+
for (var i in t) e(r, i, {
|
|
5
|
+
get: t[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n & 1 || e(r, Symbol.toStringTag, { value: "Module" }), n & 2 ? r : Object.preventExtensions(r);
|
|
9
|
+
};
|
|
10
|
+
export { t };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `button`: the simplest thing to press.
|
|
3
|
+
*
|
|
4
|
+
* @since 0.4.0
|
|
5
|
+
*/
|
|
6
|
+
import type { Html } from "effect/ui/html";
|
|
7
|
+
import { type Node } from "../../Node.ts";
|
|
8
|
+
import { type Icon } from "../icon/icon.ts";
|
|
9
|
+
/** The classes of a button, for an element that looks like one and does something else, such as opening a menu. */
|
|
10
|
+
export declare const look: (kind: "primary" | "secondary") => string;
|
|
11
|
+
export declare const button: <Msg>(h: Html.H<Msg>) => {
|
|
12
|
+
/** A button. With an `icon`, a pictogram before its label, never in place of it. */
|
|
13
|
+
button: (options: {
|
|
14
|
+
readonly onClick?: Msg;
|
|
15
|
+
readonly kind?: "primary" | "secondary";
|
|
16
|
+
readonly type?: "button" | "submit";
|
|
17
|
+
readonly disabled?: boolean;
|
|
18
|
+
readonly icon?: Icon;
|
|
19
|
+
}, label: string) => Node<"block", Msg>;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/standard/button/button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAQ,KAAK,IAAI,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,KAAK,IAAI,EAAW,MAAM,iBAAiB,CAAA;AAGpD,mHAAmH;AACnH,eAAO,MAAM,IAAI,SAAU,SAAS,GAAG,WAAW,KAAG,MACkC,CAAA;AAEvF,eAAO,MAAM,MAAM,GAAI,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;IACxC,oFAAoF;IACpF,MAAM,YACK;QACP,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,CAAA;QACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;QACvC,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;QACnC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;QAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAA;KACrB,SACM,MAAM,KACZ,IAAI,CAAC,OAAO,EAAE,GAAG,CAAC;CAYrB,CAAA"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the colours are made.
|
|
3
|
+
*
|
|
4
|
+
* A colour of the palette is not picked by eye: it is worked out from a hue,
|
|
5
|
+
* so that whatever the hue, a block of it is vivid and whatever is written
|
|
6
|
+
* on it or in it can be read. The stylesheet holds what this module gives
|
|
7
|
+
* for the hues of the palette, and the tests check that it does, and check
|
|
8
|
+
* the guarantees below for every hue there is.
|
|
9
|
+
*
|
|
10
|
+
* It works in OKLCH, where lightness, chroma and hue can each be changed
|
|
11
|
+
* without changing the others, and it measures readability by the contrast
|
|
12
|
+
* ratio of WCAG 2: 4.5 to 1, the ratio required for body text.
|
|
13
|
+
*
|
|
14
|
+
* @since 0.4.0
|
|
15
|
+
*/
|
|
16
|
+
/** A colour as lightness (0 to 1), chroma (0 to about 0.4) and hue (degrees). */
|
|
17
|
+
export interface Oklch {
|
|
18
|
+
readonly l: number;
|
|
19
|
+
readonly c: number;
|
|
20
|
+
readonly h: number;
|
|
21
|
+
}
|
|
22
|
+
/** The contrast every piece of text is given against what it is on. */
|
|
23
|
+
export declare const readable = 4.5;
|
|
24
|
+
/**
|
|
25
|
+
* The most chroma a colour is given. Past it the primaries of a screen
|
|
26
|
+
* glare: a flat colour should look printed, not lit.
|
|
27
|
+
*/
|
|
28
|
+
export declare const strongest = 0.22;
|
|
29
|
+
/** How much more chroma a block must gain by carrying ink before it gives up carrying paper. */
|
|
30
|
+
export declare const gain = 0.02;
|
|
31
|
+
/** How far a surface on a ground may be tinted towards the text, as a card or a pressed control is. Text is readable on that too. */
|
|
32
|
+
export declare const tinted = 0.12;
|
|
33
|
+
/**
|
|
34
|
+
* The two neutrals, black and white. In the light scheme they are what is
|
|
35
|
+
* printed and what it is printed on, ink and paper; in the dark scheme they
|
|
36
|
+
* swap places.
|
|
37
|
+
*/
|
|
38
|
+
export declare const black: Oklch;
|
|
39
|
+
export declare const white: Oklch;
|
|
40
|
+
/** The colour as it is written for a screen: `#rrggbb`. */
|
|
41
|
+
export declare const hex: (colour: Oklch) => string;
|
|
42
|
+
/** The contrast ratio of two colours, from 1 (the same) to 21 (black on white). */
|
|
43
|
+
export declare const contrast: (one: Oklch, other: Oklch) => number;
|
|
44
|
+
/** The colour a part of the way from one to another, in a straight line through the colour space. */
|
|
45
|
+
export declare const between: (from: Oklch, to: Oklch, part: number) => Oklch;
|
|
46
|
+
/** Text taken as far towards its ground as it can go and still be readable on it, tinted or not: for muted text. */
|
|
47
|
+
export declare const muted: (text: Oklch, ground: Oklch) => Oklch;
|
|
48
|
+
/** What the algorithm gives for a hue. */
|
|
49
|
+
export interface Swatch {
|
|
50
|
+
/** A block of the colour. */
|
|
51
|
+
readonly fill: Oklch;
|
|
52
|
+
/** What is written on the block: the black or the white. */
|
|
53
|
+
readonly on: Oklch;
|
|
54
|
+
/** Muted text, written on the block. */
|
|
55
|
+
readonly soft: Oklch;
|
|
56
|
+
/** The colour as text or a thin mark, on the white. */
|
|
57
|
+
readonly onWhite: Oklch;
|
|
58
|
+
/** The colour as text or a thin mark, on the black. */
|
|
59
|
+
readonly onBlack: Oklch;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The colours of a hue. `chroma` is the most it may have: leave it out for
|
|
63
|
+
* a colour, pass 0 for a grey.
|
|
64
|
+
*
|
|
65
|
+
* 1. The block. Of every lightness, at the most chroma a screen can show
|
|
66
|
+
* there, take the most vivid colour that paper can be read on, and the
|
|
67
|
+
* most vivid that ink can be read on. The more vivid of the two is the
|
|
68
|
+
* block, and what can be read on it is what it carries. Where the two
|
|
69
|
+
* are equally vivid, it carries paper. So a hue that is only itself
|
|
70
|
+
* when light, as yellow is, is light and carries black, and one that is
|
|
71
|
+
* itself when deep, as blue is, is deep and carries paper.
|
|
72
|
+
* 2. The colour as text. On paper, the most vivid colour of the hue that
|
|
73
|
+
* can be read there; on black, the same. Neither has to be the
|
|
74
|
+
* block's colour.
|
|
75
|
+
* 3. Muted text is the text's colour taken towards the ground, as far as
|
|
76
|
+
* it can go and still be read.
|
|
77
|
+
*
|
|
78
|
+
* So for any hue: the block has all the chroma its lightness allows,
|
|
79
|
+
* text on it reaches 4.5 to 1, and so does the colour as text on the white
|
|
80
|
+
* ground and on the black one.
|
|
81
|
+
*/
|
|
82
|
+
export declare const swatch: (h: number, chroma?: number) => Swatch;
|
|
83
|
+
/** The hues of the palette. Grey has none: it is given no chroma. */
|
|
84
|
+
export declare const hues: {
|
|
85
|
+
readonly red: 28;
|
|
86
|
+
readonly orange: 55;
|
|
87
|
+
readonly yellow: 98;
|
|
88
|
+
readonly green: 150;
|
|
89
|
+
readonly teal: 200;
|
|
90
|
+
readonly blue: 262;
|
|
91
|
+
readonly purple: 305;
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=colour.d.ts.map
|