plggmatic 0.0.1 → 0.2.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/README.md +150 -84
- package/dist/Catalog/index.d.ts +17 -0
- package/dist/Catalog/index.d.ts.map +1 -0
- package/dist/Catalog/model/tool.d.ts +101 -0
- package/dist/Catalog/model/tool.d.ts.map +1 -0
- package/dist/Catalog/usecase/adapter.d.ts +81 -0
- package/dist/Catalog/usecase/adapter.d.ts.map +1 -0
- package/dist/Catalog/usecase/catalog.d.ts +43 -0
- package/dist/Catalog/usecase/catalog.d.ts.map +1 -0
- package/dist/Catalog/usecase/runFlow.d.ts +77 -0
- package/dist/Catalog/usecase/runFlow.d.ts.map +1 -0
- package/dist/Component/index.d.ts +28 -0
- package/dist/Component/index.d.ts.map +1 -0
- package/dist/Component/model/interaction.d.ts +41 -0
- package/dist/Component/model/interaction.d.ts.map +1 -0
- package/dist/Component/model/navItem.d.ts +16 -0
- package/dist/Component/model/navItem.d.ts.map +1 -0
- package/dist/Component/usecase/breadcrumb.d.ts +26 -0
- package/dist/Component/usecase/breadcrumb.d.ts.map +1 -0
- package/dist/Component/usecase/button.d.ts +27 -0
- package/dist/Component/usecase/button.d.ts.map +1 -0
- package/dist/Component/usecase/checkbox.d.ts +20 -0
- package/dist/Component/usecase/checkbox.d.ts.map +1 -0
- package/dist/Component/usecase/colHead.d.ts +28 -0
- package/dist/Component/usecase/colHead.d.ts.map +1 -0
- package/dist/Component/usecase/confirmDialog.d.ts +25 -0
- package/dist/Component/usecase/confirmDialog.d.ts.map +1 -0
- package/dist/Component/usecase/navTree.d.ts +21 -0
- package/dist/Component/usecase/navTree.d.ts.map +1 -0
- package/dist/Component/usecase/selectInput.d.ts +28 -0
- package/dist/Component/usecase/selectInput.d.ts.map +1 -0
- package/dist/Component/usecase/textArea.d.ts +22 -0
- package/dist/Component/usecase/textArea.d.ts.map +1 -0
- package/dist/Component/usecase/textInput.d.ts +23 -0
- package/dist/Component/usecase/textInput.d.ts.map +1 -0
- package/dist/Component/usecase/textLink.d.ts +26 -0
- package/dist/Component/usecase/textLink.d.ts.map +1 -0
- package/dist/Component/usecase/themeToggle.d.ts +70 -0
- package/dist/Component/usecase/themeToggle.d.ts.map +1 -0
- package/dist/Component/usecase/toast.d.ts +32 -0
- package/dist/Component/usecase/toast.d.ts.map +1 -0
- package/dist/Component/usecase/typography.d.ts +33 -0
- package/dist/Component/usecase/typography.d.ts.map +1 -0
- package/dist/Declare/model/Action.d.ts +91 -0
- package/dist/Declare/model/Action.d.ts.map +1 -0
- package/dist/Declare/model/Adapter.d.ts +107 -0
- package/dist/Declare/model/Adapter.d.ts.map +1 -0
- package/dist/Declare/model/Collection.d.ts +55 -0
- package/dist/Declare/model/Collection.d.ts.map +1 -0
- package/dist/Declare/model/Declaration.d.ts +27 -0
- package/dist/Declare/model/Declaration.d.ts.map +1 -0
- package/dist/Declare/model/Menu.d.ts +21 -0
- package/dist/Declare/model/Menu.d.ts.map +1 -0
- package/dist/Declare/model/Query.d.ts +56 -0
- package/dist/Declare/model/Query.d.ts.map +1 -0
- package/dist/Declare/model/Row.d.ts +129 -0
- package/dist/Declare/model/Row.d.ts.map +1 -0
- package/dist/Declare/model/Source.d.ts +83 -0
- package/dist/Declare/model/Source.d.ts.map +1 -0
- package/dist/Declare/usecase/apply.d.ts +23 -0
- package/dist/Declare/usecase/apply.d.ts.map +1 -0
- package/dist/Declare/usecase/project.d.ts +66 -0
- package/dist/Declare/usecase/project.d.ts.map +1 -0
- package/dist/Declare/usecase/reconcile.d.ts +63 -0
- package/dist/Declare/usecase/reconcile.d.ts.map +1 -0
- package/dist/Flow/model/forms.d.ts +45 -0
- package/dist/Flow/model/forms.d.ts.map +1 -0
- package/dist/Flow/model/run.d.ts +74 -0
- package/dist/Flow/model/run.d.ts.map +1 -0
- package/dist/Flow/model/script.d.ts +279 -0
- package/dist/Flow/model/script.d.ts.map +1 -0
- package/dist/Flow/usecase/interpret.d.ts +17 -0
- package/dist/Flow/usecase/interpret.d.ts.map +1 -0
- package/dist/Flow/usecase/read.d.ts +46 -0
- package/dist/Flow/usecase/read.d.ts.map +1 -0
- package/dist/Form/index.d.ts +14 -0
- package/dist/Form/index.d.ts.map +1 -0
- package/dist/Form/model/control.d.ts +9 -0
- package/dist/Form/model/control.d.ts.map +1 -0
- package/dist/Form/model/submission.d.ts +30 -0
- package/dist/Form/model/submission.d.ts.map +1 -0
- package/dist/Form/usecase/controlParts.d.ts +30 -0
- package/dist/Form/usecase/controlParts.d.ts.map +1 -0
- package/dist/Form/usecase/formView.d.ts +21 -0
- package/dist/Form/usecase/formView.d.ts.map +1 -0
- package/dist/Form/usecase/parseForm.d.ts +28 -0
- package/dist/Form/usecase/parseForm.d.ts.map +1 -0
- package/dist/Layout/index.d.ts +16 -0
- package/dist/Layout/index.d.ts.map +1 -0
- package/dist/Layout/model/pane.d.ts +15 -0
- package/dist/Layout/model/pane.d.ts.map +1 -0
- package/dist/Layout/usecase/combinators.d.ts +49 -0
- package/dist/Layout/usecase/combinators.d.ts.map +1 -0
- package/dist/Meta/model/identity.d.ts +16 -0
- package/dist/Meta/model/identity.d.ts.map +1 -0
- package/dist/Render/index.d.ts +17 -0
- package/dist/Render/index.d.ts.map +1 -0
- package/dist/Render/model/mode.d.ts +13 -0
- package/dist/Render/model/mode.d.ts.map +1 -0
- package/dist/Render/model/screen.d.ts +27 -0
- package/dist/Render/model/screen.d.ts.map +1 -0
- package/dist/Render/usecase/multiColumn.d.ts +52 -0
- package/dist/Render/usecase/multiColumn.d.ts.map +1 -0
- package/dist/Render/usecase/parts.d.ts +56 -0
- package/dist/Render/usecase/parts.d.ts.map +1 -0
- package/dist/Render/usecase/renderMode.d.ts +17 -0
- package/dist/Render/usecase/renderMode.d.ts.map +1 -0
- package/dist/Render/usecase/singleColumn.d.ts +20 -0
- package/dist/Render/usecase/singleColumn.d.ts.map +1 -0
- package/dist/Schedule/model/Model.d.ts +103 -0
- package/dist/Schedule/model/Model.d.ts.map +1 -0
- package/dist/Schedule/model/Msg.d.ts +131 -0
- package/dist/Schedule/model/Msg.d.ts.map +1 -0
- package/dist/Schedule/model/Scene.d.ts +190 -0
- package/dist/Schedule/model/Scene.d.ts.map +1 -0
- package/dist/Schedule/model/View.d.ts +54 -0
- package/dist/Schedule/model/View.d.ts.map +1 -0
- package/dist/Schedule/usecase/chain.d.ts +16 -0
- package/dist/Schedule/usecase/chain.d.ts.map +1 -0
- package/dist/Schedule/usecase/codec.d.ts +44 -0
- package/dist/Schedule/usecase/codec.d.ts.map +1 -0
- package/dist/Schedule/usecase/lower.d.ts +45 -0
- package/dist/Schedule/usecase/lower.d.ts.map +1 -0
- package/dist/Schedule/usecase/scene.d.ts +16 -0
- package/dist/Schedule/usecase/scene.d.ts.map +1 -0
- package/dist/Schedule/usecase/schedule.d.ts +72 -0
- package/dist/Schedule/usecase/schedule.d.ts.map +1 -0
- package/dist/Schedule/usecase/update.d.ts +39 -0
- package/dist/Schedule/usecase/update.d.ts.map +1 -0
- package/dist/Style/index.d.ts +30 -0
- package/dist/Style/index.d.ts.map +1 -0
- package/dist/Style/model/appearance.d.ts +23 -0
- package/dist/Style/model/appearance.d.ts.map +1 -0
- package/dist/Style/model/breakpoint.d.ts +43 -0
- package/dist/Style/model/breakpoint.d.ts.map +1 -0
- package/dist/Style/model/hexColor.d.ts +24 -0
- package/dist/Style/model/hexColor.d.ts.map +1 -0
- package/dist/Style/model/metric.d.ts +35 -0
- package/dist/Style/model/metric.d.ts.map +1 -0
- package/dist/Style/model/palette.d.ts +38 -0
- package/dist/Style/model/palette.d.ts.map +1 -0
- package/dist/Style/model/scheme.d.ts +26 -0
- package/dist/Style/model/scheme.d.ts.map +1 -0
- package/dist/Style/model/syntax.d.ts +54 -0
- package/dist/Style/model/syntax.d.ts.map +1 -0
- package/dist/Style/model/theme.d.ts +58 -0
- package/dist/Style/model/theme.d.ts.map +1 -0
- package/dist/Style/model/token.d.ts +142 -0
- package/dist/Style/model/token.d.ts.map +1 -0
- package/dist/Style/model/typography.d.ts +83 -0
- package/dist/Style/model/typography.d.ts.map +1 -0
- package/dist/Style/model/zIndex.d.ts +25 -0
- package/dist/Style/model/zIndex.d.ts.map +1 -0
- package/dist/Style/usecase/appearanceScript.d.ts +43 -0
- package/dist/Style/usecase/appearanceScript.d.ts.map +1 -0
- package/dist/Style/usecase/chromeCss.d.ts +41 -0
- package/dist/Style/usecase/chromeCss.d.ts.map +1 -0
- package/dist/Style/usecase/contrast.d.ts +3 -0
- package/dist/Style/usecase/contrast.d.ts.map +1 -0
- package/dist/Style/usecase/metricCss.d.ts +17 -0
- package/dist/Style/usecase/metricCss.d.ts.map +1 -0
- package/dist/Style/usecase/reducedMotion.d.ts +20 -0
- package/dist/Style/usecase/reducedMotion.d.ts.map +1 -0
- package/dist/Style/usecase/schemeCss.d.ts +25 -0
- package/dist/Style/usecase/schemeCss.d.ts.map +1 -0
- package/dist/Style/usecase/syntaxCss.d.ts +14 -0
- package/dist/Style/usecase/syntaxCss.d.ts.map +1 -0
- package/dist/Style/usecase/utilities.d.ts +98 -0
- package/dist/Style/usecase/utilities.d.ts.map +1 -0
- package/dist/brand.d.ts +29 -0
- package/dist/brand.d.ts.map +1 -0
- package/dist/index.d.ts +52 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +4369 -407
- package/dist/styleEntry.d.ts +29 -0
- package/dist/styleEntry.d.ts.map +1 -0
- package/dist/styleEntry.es.js +1036 -0
- package/package.json +17 -22
- package/dist/App/model/AppError.d.ts +0 -31
- package/dist/App/model/AppError.d.ts.map +0 -1
- package/dist/App/model/AppOptions.d.ts +0 -31
- package/dist/App/model/AppOptions.d.ts.map +0 -1
- package/dist/Build/usecase/build.d.ts +0 -48
- package/dist/Build/usecase/build.d.ts.map +0 -1
- package/dist/Cli/usecase/resolveOptions.d.ts +0 -27
- package/dist/Cli/usecase/resolveOptions.d.ts.map +0 -1
- package/dist/Cli/usecase/runApp.d.ts +0 -39
- package/dist/Cli/usecase/runApp.d.ts.map +0 -1
- package/dist/Config/usecase/fixtures/invalid.config.d.ts +0 -5
- package/dist/Config/usecase/fixtures/invalid.config.d.ts.map +0 -1
- package/dist/Config/usecase/fixtures/named-only.config.d.ts +0 -2
- package/dist/Config/usecase/fixtures/named-only.config.d.ts.map +0 -1
- package/dist/Config/usecase/fixtures/throws.config.d.ts +0 -2
- package/dist/Config/usecase/fixtures/throws.config.d.ts.map +0 -1
- package/dist/Config/usecase/fixtures/valid.config.d.ts +0 -5
- package/dist/Config/usecase/fixtures/valid.config.d.ts.map +0 -1
- package/dist/Config/usecase/loadConfig.d.ts +0 -15
- package/dist/Config/usecase/loadConfig.d.ts.map +0 -1
- package/dist/Routing/usecase/buildRouter.d.ts +0 -17
- package/dist/Routing/usecase/buildRouter.d.ts.map +0 -1
- package/dist/ssg.d.ts +0 -2
- package/dist/ssg.d.ts.map +0 -1
- package/dist/ssg.es.js +0 -54
- package/dist/style.d.ts +0 -2
- package/dist/style.d.ts.map +0 -1
- package/dist/style.es.js +0 -98
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type Variant } from "plgg-view/style";
|
|
2
|
+
/**
|
|
3
|
+
* The standardized interaction states every plggmatic
|
|
4
|
+
* component speaks — defined ONCE here and imported by
|
|
5
|
+
* all, so a button, a link, and a toggle give identical
|
|
6
|
+
* feedback for the same gesture (interaction-design
|
|
7
|
+
* standard). A closed union; a component that invents a
|
|
8
|
+
* new state must add it here, with a rule, not inline.
|
|
9
|
+
*/
|
|
10
|
+
export type InteractionState = "default" | "hover" | "focus" | "active" | "disabled";
|
|
11
|
+
/**
|
|
12
|
+
* THE recorded interaction rule of the framework, shared
|
|
13
|
+
* by every focusable component: a keyboard focus ring
|
|
14
|
+
* that is a real 2px outline offset from the control —
|
|
15
|
+
* a NON-COLOR affordance (geometry, not just a hue), so
|
|
16
|
+
* focus is legible independent of color vision
|
|
17
|
+
* (accessibility-first). Scoped to `:focus-visible` so
|
|
18
|
+
* it appears for keyboard/AT focus but not on mouse
|
|
19
|
+
* press. The ring color is the themed `primary` role, so
|
|
20
|
+
* it reschemes with the UI.
|
|
21
|
+
*/
|
|
22
|
+
export declare const focusRing: Variant;
|
|
23
|
+
/**
|
|
24
|
+
* Shared hover feedback: a slight dim. Kept as opacity
|
|
25
|
+
* (not a new hover color token) so every component dims
|
|
26
|
+
* consistently without expanding the palette before a
|
|
27
|
+
* component needs a dedicated hover role.
|
|
28
|
+
*
|
|
29
|
+
* Scope note (D9 + ticket 05): this opacity-dim rule is
|
|
30
|
+
* the COMPONENT hover feedback — a control dimming under
|
|
31
|
+
* the pointer. It is NOT the qmu inverted-pill THEME idiom
|
|
32
|
+
* (a link/leaf swapping to `primary-base` fill with a
|
|
33
|
+
* neutral-`surface` label), which is expressed through the
|
|
34
|
+
* existing color tokens and recorded in
|
|
35
|
+
* `Style/model/token.ts`'s hover decision, not here. Both
|
|
36
|
+
* rules stand; neither adds a hover color token.
|
|
37
|
+
*/
|
|
38
|
+
export declare const hoverDim: Variant;
|
|
39
|
+
/** Shared press feedback: a deeper dim on `:active`. */
|
|
40
|
+
export declare const pressDim: Variant;
|
|
41
|
+
//# sourceMappingURL=interaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interaction.d.ts","sourceRoot":"","sources":["../../../src/Component/model/interaction.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,KAAK,OAAO,EAEb,MAAM,iBAAiB,CAAC;AAEzB;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,OAAO,GACP,OAAO,GACP,QAAQ,GACR,UAAU,CAAC;AAEf;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,EAAE,OAMvB,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,QAAQ,EAAE,OAGtB,CAAC;AAEF,wDAAwD;AACxD,eAAO,MAAM,QAAQ,EAAE,OAGtB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type SoftStr, type Option } from "plgg";
|
|
2
|
+
/**
|
|
3
|
+
* One node of a {@link navTree}. `href` is an `Option`
|
|
4
|
+
* (not a nullable string): a `Some` renders a link, a
|
|
5
|
+
* `None` renders a plain section-header label — so a
|
|
6
|
+
* group heading and a leaf link are one recursive type,
|
|
7
|
+
* and "a heading with no link" is expressed in the type,
|
|
8
|
+
* not by an empty string. `children` recurses; a leaf
|
|
9
|
+
* has `[]`.
|
|
10
|
+
*/
|
|
11
|
+
export type NavItem = Readonly<{
|
|
12
|
+
label: SoftStr;
|
|
13
|
+
href: Option<SoftStr>;
|
|
14
|
+
children: ReadonlyArray<NavItem>;
|
|
15
|
+
}>;
|
|
16
|
+
//# sourceMappingURL=navItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navItem.d.ts","sourceRoot":"","sources":["../../../src/Component/model/navItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAEjD;;;;;;;;GAQG;AACH,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACtB,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CAClC,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type SoftStr, type Option } from "plgg";
|
|
2
|
+
import { type Html } from "plgg-view";
|
|
3
|
+
/**
|
|
4
|
+
* One entry of a {@link breadcrumb} trail: a label and an
|
|
5
|
+
* `Option` link target. A `Some` renders a link to the
|
|
6
|
+
* URL that truncates the flow there (navigation, not a
|
|
7
|
+
* mode switch — the workbench's "every crumb but the last
|
|
8
|
+
* links to the URL that truncates the stack"); a `None`
|
|
9
|
+
* renders plain text (a crumb with no shallower address).
|
|
10
|
+
*/
|
|
11
|
+
export type Crumb = Readonly<{
|
|
12
|
+
label: SoftStr;
|
|
13
|
+
to: Option<SoftStr>;
|
|
14
|
+
}>;
|
|
15
|
+
/**
|
|
16
|
+
* The breadcrumb trail — the framework version of the
|
|
17
|
+
* workbench's `breadcrumb`: one crumb per flow position,
|
|
18
|
+
* every crumb but the LAST a link to its truncating URL,
|
|
19
|
+
* the last emphasized plain text, `aria-hidden`
|
|
20
|
+
* separators, all inside a labelled region so assistive
|
|
21
|
+
* tech announces "Breadcrumb". Mirrors the same stack the
|
|
22
|
+
* multi-column renderer walks, so the trail and the
|
|
23
|
+
* columns can never disagree.
|
|
24
|
+
*/
|
|
25
|
+
export declare const breadcrumb: <Msg>(crumbs: ReadonlyArray<Crumb>) => Html<Msg, "div">;
|
|
26
|
+
//# sourceMappingURL=breadcrumb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/breadcrumb.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,MAAM,EAEZ,MAAM,MAAM,CAAC;AACd,OAAO,EACL,KAAK,IAAI,EAOV,MAAM,WAAW,CAAC;AAKnB;;;;;;;GAOG;AACH,MAAM,MAAM,KAAK,GAAG,QAAQ,CAAC;IAC3B,KAAK,EAAE,OAAO,CAAC;IACf,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;CACrB,CAAC,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,UAAU,GAAI,GAAG,EAC5B,QAAQ,aAAa,CAAC,KAAK,CAAC,KAC3B,IAAI,CAAC,GAAG,EAAE,KAAK,CAwDjB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type SoftStr } from "plgg";
|
|
2
|
+
import { type Html } from "plgg-view";
|
|
3
|
+
/**
|
|
4
|
+
* A button's props. `onPress` is the typed `Msg` the
|
|
5
|
+
* click produces (components are pure views — no
|
|
6
|
+
* internal state); `disabled` is a real boolean, not a
|
|
7
|
+
* styled look-alike.
|
|
8
|
+
*/
|
|
9
|
+
export type ButtonProps<Msg> = Readonly<{
|
|
10
|
+
label: SoftStr;
|
|
11
|
+
onPress: Msg;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* The action component. **Recorded rule**: an action is
|
|
16
|
+
* always a real `<button type="button">` (never a
|
|
17
|
+
* div-with-onclick), and `disabled` is conveyed by MORE
|
|
18
|
+
* than color — the native `disabled` attribute (which
|
|
19
|
+
* also drops it from the tab order) plus a
|
|
20
|
+
* `cursor:not-allowed` and reduced opacity, and the
|
|
21
|
+
* hover/press feedback is withheld. Enabled buttons
|
|
22
|
+
* carry the shared {@link focusRing}/{@link
|
|
23
|
+
* hoverDim}/{@link pressDim} state set. Styled only
|
|
24
|
+
* through token utilities.
|
|
25
|
+
*/
|
|
26
|
+
export declare const button: <Msg>(props: ButtonProps<Msg>) => Html<Msg, "button">;
|
|
27
|
+
//# sourceMappingURL=button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EACL,KAAK,IAAI,EAMV,MAAM,WAAW,CAAC;AAmBnB;;;;;GAKG;AACH,MAAM,MAAM,WAAW,CAAC,GAAG,IAAI,QAAQ,CAAC;IACtC,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,GAAG,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,MAAM,GAAI,GAAG,EACxB,OAAO,WAAW,CAAC,GAAG,CAAC,KACtB,IAAI,CAAC,GAAG,EAAE,QAAQ,CAwBlB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type SoftStr } from "plgg";
|
|
2
|
+
import { type Html } from "plgg-view";
|
|
3
|
+
/**
|
|
4
|
+
* A CONTROLLED checkbox. `checked` comes from props (the
|
|
5
|
+
* runtime reflects it onto the live `.checked` property);
|
|
6
|
+
* the recorded interaction rule — it dispatches on
|
|
7
|
+
* `onChange` IGNORING the event payload (the state is the
|
|
8
|
+
* model's `checked`, not the DOM's), the oracle's
|
|
9
|
+
* pattern. Labelled by id, `focusRing` on focus, disabled
|
|
10
|
+
* = native attribute + `pm-disabled`.
|
|
11
|
+
*/
|
|
12
|
+
export type CheckboxProps<Msg> = Readonly<{
|
|
13
|
+
name: SoftStr;
|
|
14
|
+
label: SoftStr;
|
|
15
|
+
checked: boolean;
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
onToggle: Msg;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const checkbox: <Msg>(props: CheckboxProps<Msg>) => Html<Msg, "div">;
|
|
20
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/checkbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EACL,KAAK,IAAI,EAaV,MAAM,WAAW,CAAC;AAKnB;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,CAAC,GAAG,IAAI,QAAQ,CAAC;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,GAAG,CAAC;CACf,CAAC,CAAC;AAEH,eAAO,MAAM,QAAQ,GAAI,GAAG,EAC1B,OAAO,aAAa,CAAC,GAAG,CAAC,KACxB,IAAI,CAAC,GAAG,EAAE,KAAK,CAsCf,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type SoftStr, type Option } from "plgg";
|
|
2
|
+
import { type Html } from "plgg-view";
|
|
3
|
+
/**
|
|
4
|
+
* A column's sticky header — the framework version of the
|
|
5
|
+
* pattern the workbench example hand-wrote (`.ex-colhead`):
|
|
6
|
+
* a title, which for a PUSHED column (a `close` URL is
|
|
7
|
+
* present) IS the reset affordance — clicking the title
|
|
8
|
+
* navigates to `close`, collapsing back to this column,
|
|
9
|
+
* because **leaving a column is the same gesture as
|
|
10
|
+
* entering one — a link** (there is no separate close/×
|
|
11
|
+
* button). A root column (no `close`) shows a plain,
|
|
12
|
+
* non-clickable title. The title link is `aria-label`led
|
|
13
|
+
* and rides `style_` (the sole class authority, so its
|
|
14
|
+
* atomic focus-ring classes are not clobbered by a separate
|
|
15
|
+
* `class` attribute); the class hooks are derived from
|
|
16
|
+
* `cssPrefix` (`pm-colhead`/`pm-colhead-title`), styled by
|
|
17
|
+
* the framework chrome CSS.
|
|
18
|
+
*/
|
|
19
|
+
export type ColHeadProps = Readonly<{
|
|
20
|
+
title: SoftStr;
|
|
21
|
+
close: Option<SoftStr>;
|
|
22
|
+
links: ReadonlyArray<Readonly<{
|
|
23
|
+
label: SoftStr;
|
|
24
|
+
href: SoftStr;
|
|
25
|
+
}>>;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const colHead: <Msg>(props: ColHeadProps) => Html<Msg, "div">;
|
|
28
|
+
//# sourceMappingURL=colHead.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colHead.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/colHead.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,MAAM,EAEZ,MAAM,MAAM,CAAC;AACd,OAAO,EACL,KAAK,IAAI,EAOV,MAAM,WAAW,CAAC;AAKnB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,KAAK,EAAE,aAAa,CAClB,QAAQ,CAAC;QACP,KAAK,EAAE,OAAO,CAAC;QACf,IAAI,EAAE,OAAO,CAAC;KACf,CAAC,CACH,CAAC;CACH,CAAC,CAAC;AAEH,eAAO,MAAM,OAAO,GAAI,GAAG,EACzB,OAAO,YAAY,KAClB,IAAI,CAAC,GAAG,EAAE,KAAK,CA4Cf,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type SoftStr } from "plgg";
|
|
2
|
+
import { type Html } from "plgg-view";
|
|
3
|
+
/**
|
|
4
|
+
* A modal confirmation for a destructive action — the
|
|
5
|
+
* framework rendering the workbench oracle lacked the
|
|
6
|
+
* a11y for. Backdrop and dialog are SIBLING keyed nodes
|
|
7
|
+
* so an inside-click never bubbles to the backdrop's
|
|
8
|
+
* cancel; the dialog carries `role="dialog"`,
|
|
9
|
+
* `aria-modal="true"`, and `aria-labelledby` wired to its
|
|
10
|
+
* title. A destructive confirm wears the `danger` role.
|
|
11
|
+
* Backdrop-click and Cancel both dispatch `onCancel`;
|
|
12
|
+
* confirm dispatches `onConfirm` — the component owns zero
|
|
13
|
+
* state (the scheduler owns the pending-confirmation).
|
|
14
|
+
*/
|
|
15
|
+
export type ConfirmDialogProps<Msg> = Readonly<{
|
|
16
|
+
title: SoftStr;
|
|
17
|
+
body: SoftStr;
|
|
18
|
+
confirmLabel: SoftStr;
|
|
19
|
+
cancelLabel: SoftStr;
|
|
20
|
+
destructive: boolean;
|
|
21
|
+
onConfirm: Msg;
|
|
22
|
+
onCancel: Msg;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const confirmDialog: <Msg>(props: ConfirmDialogProps<Msg>) => Html<Msg, "div">;
|
|
25
|
+
//# sourceMappingURL=confirmDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"confirmDialog.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/confirmDialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EACL,KAAK,IAAI,EAUV,MAAM,WAAW,CAAC;AAKnB;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,kBAAkB,CAAC,GAAG,IAAI,QAAQ,CAAC;IAC7C,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,GAAG,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;CACf,CAAC,CAAC;AAIH,eAAO,MAAM,aAAa,GAAI,GAAG,EAC/B,OAAO,kBAAkB,CAAC,GAAG,CAAC,KAC7B,IAAI,CAAC,GAAG,EAAE,KAAK,CA6Df,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type SoftStr } from "plgg";
|
|
2
|
+
import { type Html } from "plgg-view";
|
|
3
|
+
import { type NavItem } from "../model/navItem";
|
|
4
|
+
/**
|
|
5
|
+
* The navigation-tree component: a recursive,
|
|
6
|
+
* config-driven tree (the docs-site sidebar). **Recorded
|
|
7
|
+
* rule**: navTree emits LIST markup only — a `<ul>` of
|
|
8
|
+
* `<li>`, nested for children — and does NOT wrap itself
|
|
9
|
+
* in a `<nav>` landmark; the landmark is owned by the
|
|
10
|
+
* Layout `navigation` pane it sits inside, so the two
|
|
11
|
+
* never produce nested/duplicate nav landmarks (the
|
|
12
|
+
* higher-level pane policy wins, per this ticket's
|
|
13
|
+
* coordination note). The leaf whose `href` equals
|
|
14
|
+
* `activePath` is marked `aria-current="page"` at build
|
|
15
|
+
* time; a header node (`href` `None`) renders plain
|
|
16
|
+
* text. Zero client JavaScript — the whole tree is
|
|
17
|
+
* static SSR. Links carry the shared focus ring and
|
|
18
|
+
* hover feedback.
|
|
19
|
+
*/
|
|
20
|
+
export declare const navTree: (items: ReadonlyArray<NavItem>, activePath: SoftStr) => Html<never, "ul">;
|
|
21
|
+
//# sourceMappingURL=navTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navTree.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/navTree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAe,MAAM,MAAM,CAAC;AACjD,OAAO,EACL,KAAK,IAAI,EASV,MAAM,WAAW,CAAC;AAYnB,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,mCAAmC,CAAC;AAEjE;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,OAAO,GAClB,OAAO,aAAa,CAAC,OAAO,CAAC,EAC7B,YAAY,OAAO,KAClB,IAAI,CAAC,KAAK,EAAE,IAAI,CA4ClB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type SoftStr } from "plgg";
|
|
2
|
+
import { type Option } from "plgg";
|
|
3
|
+
import { type Html } from "plgg-view";
|
|
4
|
+
/** One choice in a {@link selectInput}. */
|
|
5
|
+
export type SelectOption = Readonly<{
|
|
6
|
+
value: SoftStr;
|
|
7
|
+
label: SoftStr;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* A CONTROLLED dropdown. The selected `value` comes from
|
|
11
|
+
* props (the matching `option` carries `selected`), it is
|
|
12
|
+
* labelled by id, and shows errors via `aria-invalid` +
|
|
13
|
+
* `aria-describedby`. `<select>` is deliberately outside
|
|
14
|
+
* the runtime's controlled-property sync (its selection
|
|
15
|
+
* is driven by the marked option), so this stays a pure
|
|
16
|
+
* view. `onChange` reports the newly-chosen value.
|
|
17
|
+
*/
|
|
18
|
+
export type SelectProps<Msg> = Readonly<{
|
|
19
|
+
name: SoftStr;
|
|
20
|
+
label: SoftStr;
|
|
21
|
+
value: SoftStr;
|
|
22
|
+
options: ReadonlyArray<SelectOption>;
|
|
23
|
+
error: Option<SoftStr>;
|
|
24
|
+
disabled: boolean;
|
|
25
|
+
onChange: (value: SoftStr) => Msg;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const selectInput: <Msg>(props: SelectProps<Msg>) => Html<Msg, "div">;
|
|
28
|
+
//# sourceMappingURL=selectInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectInput.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/selectInput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EACL,KAAK,IAAI,EAUV,MAAM,WAAW,CAAC;AAUnB,2CAA2C;AAC3C,MAAM,MAAM,YAAY,GAAG,QAAQ,CAAC;IAClC,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,MAAM,WAAW,CAAC,GAAG,IAAI,QAAQ,CAAC;IACtC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,aAAa,CAAC,YAAY,CAAC,CAAC;IACrC,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,GAAG,CAAC;CACnC,CAAC,CAAC;AAEH,eAAO,MAAM,WAAW,GAAI,GAAG,EAC7B,OAAO,WAAW,CAAC,GAAG,CAAC,KACtB,IAAI,CAAC,GAAG,EAAE,KAAK,CA4Bf,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type SoftStr, type Option } from "plgg";
|
|
2
|
+
import { type Html } from "plgg-view";
|
|
3
|
+
/**
|
|
4
|
+
* A CONTROLLED multi-line text control — `textInput`'s
|
|
5
|
+
* sibling for prose drafts. Same recorded rules: value
|
|
6
|
+
* from props, labelled by id, `aria-invalid`/
|
|
7
|
+
* `aria-describedby` error wiring, disabled = native +
|
|
8
|
+
* `pm-disabled` + withheld hover. The value rides both
|
|
9
|
+
* the `value` attribute (the runtime's controlled sync)
|
|
10
|
+
* and the text child (SSR's initial render).
|
|
11
|
+
*/
|
|
12
|
+
export type TextAreaProps<Msg> = Readonly<{
|
|
13
|
+
name: SoftStr;
|
|
14
|
+
label: SoftStr;
|
|
15
|
+
value: SoftStr;
|
|
16
|
+
placeholder: Option<SoftStr>;
|
|
17
|
+
error: Option<SoftStr>;
|
|
18
|
+
disabled: boolean;
|
|
19
|
+
onInput: (value: SoftStr) => Msg;
|
|
20
|
+
}>;
|
|
21
|
+
export declare const textArea: <Msg>(props: TextAreaProps<Msg>) => Html<Msg, "div">;
|
|
22
|
+
//# sourceMappingURL=textArea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textArea.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/textArea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,MAAM,EAEZ,MAAM,MAAM,CAAC;AACd,OAAO,EACL,KAAK,IAAI,EAWV,MAAM,WAAW,CAAC;AAanB;;;;;;;;GAQG;AACH,MAAM,MAAM,aAAa,CAAC,GAAG,IAAI,QAAQ,CAAC;IACxC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,GAAG,CAAC;CAClC,CAAC,CAAC;AAEH,eAAO,MAAM,QAAQ,GAAI,GAAG,EAC1B,OAAO,aAAa,CAAC,GAAG,CAAC,KACxB,IAAI,CAAC,GAAG,EAAE,KAAK,CAkCf,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type SoftStr, type Option } from "plgg";
|
|
2
|
+
import { type Html } from "plgg-view";
|
|
3
|
+
/**
|
|
4
|
+
* A CONTROLLED single-line text input. Its value comes
|
|
5
|
+
* from props (never internal state), it is associated
|
|
6
|
+
* with a real `<label>` by id, renders its error via
|
|
7
|
+
* `aria-invalid` + `aria-describedby`, and — the recorded
|
|
8
|
+
* interaction rule — a disabled input wears the native
|
|
9
|
+
* attribute AND more-than-colour (a `pm-disabled` class:
|
|
10
|
+
* dimmed + `not-allowed` cursor) AND withholds hover
|
|
11
|
+
* feedback. `focusRing` on focus.
|
|
12
|
+
*/
|
|
13
|
+
export type TextInputProps<Msg> = Readonly<{
|
|
14
|
+
name: SoftStr;
|
|
15
|
+
label: SoftStr;
|
|
16
|
+
value: SoftStr;
|
|
17
|
+
placeholder: Option<SoftStr>;
|
|
18
|
+
error: Option<SoftStr>;
|
|
19
|
+
disabled: boolean;
|
|
20
|
+
onInput: (value: SoftStr) => Msg;
|
|
21
|
+
}>;
|
|
22
|
+
export declare const textInput: <Msg>(props: TextInputProps<Msg>) => Html<Msg, "div">;
|
|
23
|
+
//# sourceMappingURL=textInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textInput.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/textInput.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,MAAM,EAEZ,MAAM,MAAM,CAAC;AACd,OAAO,EACL,KAAK,IAAI,EAWV,MAAM,WAAW,CAAC;AAanB;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,CAAC,GAAG,IAAI,QAAQ,CAAC;IACzC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,GAAG,CAAC;CAClC,CAAC,CAAC;AAEH,eAAO,MAAM,SAAS,GAAI,GAAG,EAC3B,OAAO,cAAc,CAAC,GAAG,CAAC,KACzB,IAAI,CAAC,GAAG,EAAE,KAAK,CAmCf,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type SoftStr } from "plgg";
|
|
2
|
+
import { type Html } from "plgg-view";
|
|
3
|
+
/**
|
|
4
|
+
* A text link's props. `external` marks a link that
|
|
5
|
+
* leaves the site, so it opens in a new tab AND is
|
|
6
|
+
* announced as such (no surprise navigation — a
|
|
7
|
+
* no-dark-patterns default).
|
|
8
|
+
*/
|
|
9
|
+
export type TextLinkProps = Readonly<{
|
|
10
|
+
label: SoftStr;
|
|
11
|
+
to: SoftStr;
|
|
12
|
+
external: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
/**
|
|
15
|
+
* The navigation component. **Recorded rule**:
|
|
16
|
+
* navigation is always a real `<a>` carrying an `href`
|
|
17
|
+
* (never a div-with-onclick), with a standing underline
|
|
18
|
+
* so a link is identifiable without relying on color
|
|
19
|
+
* alone; an `external` link opens in a new tab and
|
|
20
|
+
* announces it (`target=_blank` + `rel=noopener
|
|
21
|
+
* noreferrer` + a visible `↗` affordance and an extended
|
|
22
|
+
* accessible label), so the user is never surprised.
|
|
23
|
+
* Carries the shared focus ring and hover feedback.
|
|
24
|
+
*/
|
|
25
|
+
export declare const textLink: (props: TextLinkProps) => Html<never, "a">;
|
|
26
|
+
//# sourceMappingURL=textLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textLink.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/textLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EACL,KAAK,IAAI,EAKV,MAAM,WAAW,CAAC;AAWnB;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,QAAQ,CAAC;IACnC,KAAK,EAAE,OAAO,CAAC;IACf,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC,CAAC;AAEH;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,GACnB,OAAO,aAAa,KACnB,IAAI,CAAC,KAAK,EAAE,GAAG,CA4Bf,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type SoftStr } from "plgg";
|
|
2
|
+
import { type Html } from "plgg-view";
|
|
3
|
+
import { type Scheme } from "../../Style";
|
|
4
|
+
/**
|
|
5
|
+
* A theme toggle's props. `scheme` is the CURRENTLY
|
|
6
|
+
* active scheme (so the button shows where a click will
|
|
7
|
+
* take you); `toggle` is the `Msg` a click produces.
|
|
8
|
+
*/
|
|
9
|
+
export type ThemeToggleProps<Msg> = Readonly<{
|
|
10
|
+
scheme: Scheme;
|
|
11
|
+
toggle: Msg;
|
|
12
|
+
}>;
|
|
13
|
+
/**
|
|
14
|
+
* The appearance-switch component, exercising the token
|
|
15
|
+
* layer's scheme mechanism. **Recorded rule**: the
|
|
16
|
+
* framework ships the VIEW ONLY — the toggle renders the
|
|
17
|
+
* current scheme's icon (sun in light, moon in dark) and
|
|
18
|
+
* emits a `toggle` `Msg`; applying the `dark` class to
|
|
19
|
+
* `<html>` is the app's effect seam, wired through the
|
|
20
|
+
* framework-owned appearance contract —
|
|
21
|
+
* `applyScheme` / `appearanceStorageKey` (the preserved
|
|
22
|
+
* `vp-appearance` key) / `appearanceInitScript` in
|
|
23
|
+
* `Style/usecase/appearanceScript.ts` — so the component
|
|
24
|
+
* stays pure. The `aria-label` names the destination
|
|
25
|
+
* scheme, and the icon is a non-color cue (shape, not
|
|
26
|
+
* hue) for the current one. Carries the shared focus
|
|
27
|
+
* ring and hover feedback.
|
|
28
|
+
*/
|
|
29
|
+
export declare const themeToggle: <Msg>(props: ThemeToggleProps<Msg>) => Html<Msg, "button">;
|
|
30
|
+
/**
|
|
31
|
+
* The stable class hook the SSG toggle carries. A
|
|
32
|
+
* static-site host binds every rendered toggle by this
|
|
33
|
+
* class from its no-runtime body script, and the
|
|
34
|
+
* icon-switch CSS in {@link themeToggleCss} targets it —
|
|
35
|
+
* so the literal is never re-typed at the consumer.
|
|
36
|
+
*/
|
|
37
|
+
export declare const themeToggleClass: SoftStr;
|
|
38
|
+
/**
|
|
39
|
+
* The SSG-capable appearance toggle: a static
|
|
40
|
+
* `Html<never, "button">` that renders BOTH icons (the
|
|
41
|
+
* active one chosen by CSS on `html.dark`, NOT by a
|
|
42
|
+
* build-time scheme) and carries {@link themeToggleClass}
|
|
43
|
+
* so a host's no-runtime body script can wire the click.
|
|
44
|
+
*
|
|
45
|
+
* The runtime {@link themeToggle} is for TEA apps that
|
|
46
|
+
* re-render on a scheme `Msg`; a static-site host (no
|
|
47
|
+
* plgg-view runtime on the page, `renderToString` drops
|
|
48
|
+
* every handler) can neither dispatch a `Msg` nor know the
|
|
49
|
+
* visitor's scheme when the page is built, so it renders
|
|
50
|
+
* this instead and drives it through the framework-owned
|
|
51
|
+
* appearance contract (`appearanceStorageKey` /
|
|
52
|
+
* `applyScheme` / `appearanceInitScript`). Chrome and
|
|
53
|
+
* icon-switch live in {@link themeToggleCss}; escape-safe.
|
|
54
|
+
*/
|
|
55
|
+
export declare const staticThemeToggle: Html<never, "button">;
|
|
56
|
+
/**
|
|
57
|
+
* The SSG toggle's chrome + icon-switch as one escape-safe
|
|
58
|
+
* CSS body (no `<`, `>`, `&`; descendant selectors only, no
|
|
59
|
+
* child combinators) so it survives a host's SSR text
|
|
60
|
+
* escaper byte-for-byte. Token-driven — a circular,
|
|
61
|
+
* bordered control on the neutral `surface`, the sun shown
|
|
62
|
+
* in light and the crescent under `html.dark` (a shape
|
|
63
|
+
* cue, not a hue), with the shared 2px focus ring and the
|
|
64
|
+
* `primary` hover edge matching the runtime
|
|
65
|
+
* {@link themeToggle}. A host composes it into its document
|
|
66
|
+
* `<style>` AFTER the scheme variables (it references
|
|
67
|
+
* `var(--pm-*)`) and ahead of the collected atomic rules.
|
|
68
|
+
*/
|
|
69
|
+
export declare const themeToggleCss: SoftStr;
|
|
70
|
+
//# sourceMappingURL=themeToggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"themeToggle.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/themeToggle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EACL,KAAK,IAAI,EAQV,MAAM,WAAW,CAAC;AAYnB,OAAO,EACL,KAAK,MAAM,EAMZ,MAAM,iBAAiB,CAAC;AAuCzB;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,GAAG,IAAI,QAAQ,CAAC;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,GAAG,CAAC;CACb,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW,GAAI,GAAG,EAC7B,OAAO,gBAAgB,CAAC,GAAG,CAAC,KAC3B,IAAI,CAAC,GAAG,EAAE,QAAQ,CA2BlB,CAAC;AAEJ;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,EAAE,OACZ,CAAC;AAyBpB;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,EAAE,IAAI,CAClC,KAAK,EACL,QAAQ,CAWT,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,EAAE,OAoBV,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type SoftStr } from "plgg";
|
|
2
|
+
import { type Html } from "plgg-view";
|
|
3
|
+
/**
|
|
4
|
+
* A toast's tone — the semantic role set (D9). A closed
|
|
5
|
+
* union so a renderer/CSS map is exhaustive; each tone is
|
|
6
|
+
* styled through its role's `surface`/`text`/`border`
|
|
7
|
+
* variants (`--pm-<tone>-*`).
|
|
8
|
+
*/
|
|
9
|
+
export type Tone = "success" | "danger" | "warning" | "info";
|
|
10
|
+
export declare const tones: ReadonlyArray<Tone>;
|
|
11
|
+
/**
|
|
12
|
+
* A single feedback toast. Announced via `role="status"`
|
|
13
|
+
* with `aria-live` — `danger` escalates to `assertive`
|
|
14
|
+
* (an error interrupts), the rest stay `polite`.
|
|
15
|
+
* Dismissible via an `aria-label`led close that dispatches
|
|
16
|
+
* `onDismiss`; the component owns NO timer — auto-dismiss
|
|
17
|
+
* is the consumer's `cmdEffect`.
|
|
18
|
+
*/
|
|
19
|
+
export type ToastProps<Msg> = Readonly<{
|
|
20
|
+
id: SoftStr;
|
|
21
|
+
tone: Tone;
|
|
22
|
+
message: SoftStr;
|
|
23
|
+
onDismiss: Msg;
|
|
24
|
+
}>;
|
|
25
|
+
export declare const toast: <Msg>(props: ToastProps<Msg>) => Html<Msg, "div">;
|
|
26
|
+
/**
|
|
27
|
+
* The keyed toaster stack — a live region holding the
|
|
28
|
+
* current toasts (keyed by id so enter/exit motion plays
|
|
29
|
+
* on the right node under the reduced-motion block).
|
|
30
|
+
*/
|
|
31
|
+
export declare const toaster: <Msg>(toasts: ReadonlyArray<ToastProps<Msg>>) => Html<Msg, "div">;
|
|
32
|
+
//# sourceMappingURL=toast.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/toast.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EACL,KAAK,IAAI,EAQV,MAAM,WAAW,CAAC;AAKnB;;;;;GAKG;AACH,MAAM,MAAM,IAAI,GACd,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAE5C,eAAO,MAAM,KAAK,EAAE,aAAa,CAAC,IAAI,CAKrC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,UAAU,CAAC,GAAG,IAAI,QAAQ,CAAC;IACrC,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,GAAG,CAAC;CAChB,CAAC,CAAC;AAEH,eAAO,MAAM,KAAK,GAAI,GAAG,EACvB,OAAO,UAAU,CAAC,GAAG,CAAC,KACrB,IAAI,CAAC,GAAG,EAAE,KAAK,CA8Bf,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAI,GAAG,EACzB,QAAQ,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,KACrC,IAAI,CAAC,GAAG,EAAE,KAAK,CAOf,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type SoftStr } from "plgg";
|
|
2
|
+
import { type Html, type Flow } from "plgg-view";
|
|
3
|
+
/**
|
|
4
|
+
* A heading level. A closed union so a level maps to a
|
|
5
|
+
* real `h1`–`h4` element (and its font token) — an
|
|
6
|
+
* invalid level cannot be requested.
|
|
7
|
+
*/
|
|
8
|
+
export type HeadingLevel = 1 | 2 | 3 | 4;
|
|
9
|
+
/**
|
|
10
|
+
* The heading component. **Recorded rule**: the heading
|
|
11
|
+
* `level` is a semantic prop that maps 1:1 to a real
|
|
12
|
+
* `h1`–`h4` element, and its size / leading / weight are
|
|
13
|
+
* drawn from the prose {@link typeStyle} scale by that
|
|
14
|
+
* same level — so the document outline and the type scale
|
|
15
|
+
* never drift apart (no "looks like an h2 but is a div").
|
|
16
|
+
* The shipped scale is the guide's: level 1 renders
|
|
17
|
+
* `1.875rem` at weight 400, not the old generic
|
|
18
|
+
* `2xl`/`600`. Themed `text` ink.
|
|
19
|
+
*/
|
|
20
|
+
export declare const heading: (level: HeadingLevel, content: SoftStr) => Html<never>;
|
|
21
|
+
/**
|
|
22
|
+
* The prose component. **Recorded rule**: prose is a
|
|
23
|
+
* typographic container that establishes the reading
|
|
24
|
+
* baseline once — themed body ink, the `body` type role
|
|
25
|
+
* (`1rem` at line-height `1.75`), and the capped readable
|
|
26
|
+
* `measure` (the `48rem` shell metric, via its custom
|
|
27
|
+
* property) — for arbitrary flow content; per-element
|
|
28
|
+
* prose rules (link underline weight, code badges, list
|
|
29
|
+
* rhythm) are added one at a time as real documents demand
|
|
30
|
+
* them, not pre-built here (emergent design system).
|
|
31
|
+
*/
|
|
32
|
+
export declare const prose: <Msg>(body: ReadonlyArray<Flow<Msg>>) => Html<Msg, "div">;
|
|
33
|
+
//# sourceMappingURL=typography.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../../src/Component/usecase/typography.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAC;AACpC,OAAO,EACL,KAAK,IAAI,EACT,KAAK,IAAI,EASV,MAAM,WAAW,CAAC;AASnB;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAmCzC;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO,GAClB,OAAO,YAAY,EACnB,SAAS,OAAO,KACf,IAAI,CAAC,KAAK,CASV,CAAC;AAEJ;;;;;;;;;;GAUG;AACH,eAAO,MAAM,KAAK,GAAI,GAAG,EACvB,MAAM,aAAa,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAC7B,IAAI,CAAC,GAAG,EAAE,KAAK,CAUf,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { type SoftStr, type Box, type Icon, type Option } from "plgg";
|
|
2
|
+
import { type Cmd } from "plgg-view/client";
|
|
3
|
+
import { type SchedulerMsg } from "../../Schedule/model/Msg";
|
|
4
|
+
import { type Actor } from "./Adapter";
|
|
5
|
+
/**
|
|
6
|
+
* The mutation an {@link Action} performs, as a closed
|
|
7
|
+
* union so a renderer can style create/update/delete
|
|
8
|
+
* distinctly and the scheduler can reason about intent
|
|
9
|
+
* without a free string.
|
|
10
|
+
*/
|
|
11
|
+
export type Verb = "create" | "update" | "delete";
|
|
12
|
+
/**
|
|
13
|
+
* Confirmation semantics as DATA — destructive intent is
|
|
14
|
+
* explicit, and confirm/cancel is scheduler state, not
|
|
15
|
+
* renderer folklore. `Immediate` runs the action at once;
|
|
16
|
+
* `Confirm` parks a pending-confirmation in the model
|
|
17
|
+
* (with the prompt and whether it is destructive) until a
|
|
18
|
+
* `ConfirmAction`/`CancelAction` message resolves it.
|
|
19
|
+
*/
|
|
20
|
+
export type Confirm = Icon<"Immediate"> | Box<"Confirm", Readonly<{
|
|
21
|
+
prompt: SoftStr;
|
|
22
|
+
destructive: boolean;
|
|
23
|
+
}>>;
|
|
24
|
+
/** No confirmation — run the action immediately. */
|
|
25
|
+
export declare const immediate: () => Confirm;
|
|
26
|
+
/** Park a confirmation before running the action. */
|
|
27
|
+
export declare const confirm: (prompt: SoftStr, destructive?: boolean) => Confirm;
|
|
28
|
+
/** Matchers for folding a {@link Confirm}. */
|
|
29
|
+
export declare const immediate$: () => {
|
|
30
|
+
__tag: "Immediate";
|
|
31
|
+
type: "tag";
|
|
32
|
+
body: undefined;
|
|
33
|
+
};
|
|
34
|
+
export declare const confirm$: () => {
|
|
35
|
+
__tag: "Confirm";
|
|
36
|
+
type: "tag";
|
|
37
|
+
body: undefined;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* An action's authorization policy: a total predicate over
|
|
41
|
+
* the host-supplied {@link Actor} and the subject (the
|
|
42
|
+
* target row id, `None` for a create). The ENGINE evaluates
|
|
43
|
+
* it BEFORE dispatching — an unauthorized action never runs
|
|
44
|
+
* and the Scene hides its button (point-7 authorization).
|
|
45
|
+
* A pure decision as data; the adapter MAY re-enforce at
|
|
46
|
+
* the data layer (defense in depth, not required).
|
|
47
|
+
*/
|
|
48
|
+
export type Authorize = (actor: Actor, subject: Option<SoftStr>) => boolean;
|
|
49
|
+
/**
|
|
50
|
+
* A create/update/delete verb on a collection, mapped to
|
|
51
|
+
* a `Cmd` factory. `run` receives the acting row's id
|
|
52
|
+
* (`None` for a create, which has no target yet) and
|
|
53
|
+
* returns a `Cmd` — pure data the plgg-view runtime
|
|
54
|
+
* executes; the scheduler only returns it, never runs it.
|
|
55
|
+
* Fold the mutation's `Result` to a `Loaded`/`Failed`
|
|
56
|
+
* message inside the `cmdEffect` thunk so the effect
|
|
57
|
+
* always resolves to a message. `authorize` is the optional
|
|
58
|
+
* legality gate (`None` = always permitted): the engine
|
|
59
|
+
* checks it against the actor before dispatching `run`.
|
|
60
|
+
*/
|
|
61
|
+
export type Action = Readonly<{
|
|
62
|
+
id: SoftStr;
|
|
63
|
+
label: SoftStr;
|
|
64
|
+
verb: Verb;
|
|
65
|
+
confirm: Confirm;
|
|
66
|
+
run: (target: Option<SoftStr>) => Cmd<SchedulerMsg>;
|
|
67
|
+
authorize: Option<Authorize>;
|
|
68
|
+
}>;
|
|
69
|
+
/** Constructs an {@link Action}. */
|
|
70
|
+
export declare const action: (a: {
|
|
71
|
+
id: SoftStr;
|
|
72
|
+
label: SoftStr;
|
|
73
|
+
verb: Verb;
|
|
74
|
+
confirm: Confirm;
|
|
75
|
+
run: (target: Option<SoftStr>) => Cmd<SchedulerMsg>;
|
|
76
|
+
authorize?: Authorize;
|
|
77
|
+
}) => Action;
|
|
78
|
+
/**
|
|
79
|
+
* Whether the actor may run `action` on `subject` — the
|
|
80
|
+
* engine's legality gate, total. An action with no declared
|
|
81
|
+
* `authorize` is always permitted (absence of a policy is
|
|
82
|
+
* not a denial in v1; deny-by-default arrives with the
|
|
83
|
+
* manifest's static authorize checks). A declared policy
|
|
84
|
+
* REQUIRES an actor: a policy with no supplied actor
|
|
85
|
+
* (`None`) is denied — the engine cannot prove
|
|
86
|
+
* authorization without one.
|
|
87
|
+
*/
|
|
88
|
+
export declare const permits: (action: Action, actor: Option<Actor>, subject: Option<SoftStr>) => boolean;
|
|
89
|
+
/** Whether an action's confirmation is destructive. */
|
|
90
|
+
export declare const isDestructive: (c: Confirm) => boolean;
|
|
91
|
+
//# sourceMappingURL=Action.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../../src/Declare/model/Action.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,GAAG,EACR,KAAK,IAAI,EACT,KAAK,MAAM,EAOZ,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,iCAAiC,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAElD;;;;;;;GAOG;AACH,MAAM,MAAM,OAAO,GACf,IAAI,CAAC,WAAW,CAAC,GACjB,GAAG,CACD,SAAS,EACT,QAAQ,CAAC;IACP,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC,CACH,CAAC;AAEN,oDAAoD;AACpD,eAAO,MAAM,SAAS,QAAO,OACV,CAAC;AAEpB,qDAAqD;AACrD,eAAO,MAAM,OAAO,GAClB,QAAQ,OAAO,EACf,cAAa,OAAe,KAC3B,OACsC,CAAC;AAE1C,8CAA8C;AAC9C,eAAO,MAAM,UAAU;;;;CACC,CAAC;AACzB,eAAO,MAAM,QAAQ;;;;CACC,CAAC;AAEvB;;;;;;;;GAQG;AACH,MAAM,MAAM,SAAS,GAAG,CACtB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,KACrB,OAAO,CAAC;AAEb;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,MAAM,GAAG,QAAQ,CAAC;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,CACH,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,KACpB,GAAG,CAAC,YAAY,CAAC,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;CAC9B,CAAC,CAAC;AAEH,oCAAoC;AACpC,eAAO,MAAM,MAAM,GAAI,GAAG;IACxB,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,CACH,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,KACpB,GAAG,CAAC,YAAY,CAAC,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB,KAAG,MAOF,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO,GAClB,QAAQ,MAAM,EACd,OAAO,MAAM,CAAC,KAAK,CAAC,EACpB,SAAS,MAAM,CAAC,OAAO,CAAC,KACvB,OAQkB,CAAC;AAEtB,uDAAuD;AACvD,eAAO,MAAM,aAAa,GACxB,GAAG,OAAO,KACT,OAQA,CAAC"}
|