@typed/ui 1.0.0-beta.5 → 1.0.0-beta.7
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/dist/Alert.d.ts +35 -41
- package/dist/Alert.d.ts.map +1 -1
- package/dist/Alert.js +23 -20
- package/dist/Button.d.ts +34 -78
- package/dist/Button.d.ts.map +1 -1
- package/dist/Button.js +16 -12
- package/dist/Carousel.d.ts +35 -236
- package/dist/Carousel.d.ts.map +1 -1
- package/dist/Carousel.js +13 -136
- package/dist/Checkbox.d.ts +55 -90
- package/dist/Checkbox.d.ts.map +1 -1
- package/dist/Checkbox.js +44 -38
- package/dist/Collection.d.ts +15 -15
- package/dist/Collection.js +7 -7
- package/dist/Combobox.d.ts +38 -187
- package/dist/Combobox.d.ts.map +1 -1
- package/dist/Combobox.js +9 -80
- package/dist/Component.d.ts +30 -24
- package/dist/Component.d.ts.map +1 -1
- package/dist/Component.js +23 -12
- package/dist/Composite.d.ts +50 -50
- package/dist/Composite.js +20 -20
- package/dist/Dialog.d.ts +34 -34
- package/dist/Dialog.d.ts.map +1 -1
- package/dist/Dialog.js +16 -14
- package/dist/Disclosure.d.ts +15 -15
- package/dist/Disclosure.js +6 -6
- package/dist/Dom/Events.d.ts +4 -4
- package/dist/Dom/Events.js +4 -4
- package/dist/Dom/Props.d.ts +9 -9
- package/dist/Dom/Props.js +4 -4
- package/dist/Dom/Refs.d.ts +2 -2
- package/dist/Dom/Refs.js +1 -1
- package/dist/Dom/Render.d.ts +2 -2
- package/dist/Dom/Render.js +2 -2
- package/dist/Dom/Types.d.ts +33 -33
- package/dist/Dom/index.d.ts +5 -5
- package/dist/Dom/index.d.ts.map +1 -1
- package/dist/Dom/index.js +4 -4
- package/dist/Dom.d.ts +1 -1
- package/dist/Dom.js +1 -1
- package/dist/Focusable.d.ts +5 -5
- package/dist/Focusable.js +1 -1
- package/dist/Form.d.ts +565 -533
- package/dist/Form.d.ts.map +1 -1
- package/dist/Form.js +350 -195
- package/dist/Grid.d.ts +39 -220
- package/dist/Grid.d.ts.map +1 -1
- package/dist/Grid.js +12 -107
- package/dist/Group.d.ts +50 -69
- package/dist/Group.d.ts.map +1 -1
- package/dist/Group.js +33 -25
- package/dist/Heading.d.ts +41 -40
- package/dist/Heading.d.ts.map +1 -1
- package/dist/Heading.js +26 -16
- package/dist/Hovercard.d.ts +18 -18
- package/dist/Hovercard.js +6 -6
- package/dist/HttpRouter.d.ts +3 -3
- package/dist/HttpRouter.js +5 -5
- package/dist/Link.d.ts +17 -21
- package/dist/Link.d.ts.map +1 -1
- package/dist/Link.js +11 -0
- package/dist/Listbox.d.ts +31 -163
- package/dist/Listbox.d.ts.map +1 -1
- package/dist/Listbox.js +9 -80
- package/dist/Menu.d.ts +67 -376
- package/dist/Menu.d.ts.map +1 -1
- package/dist/Menu.js +17 -179
- package/dist/Menubar.d.ts +24 -142
- package/dist/Menubar.d.ts.map +1 -1
- package/dist/Menubar.js +8 -66
- package/dist/Meter.d.ts +72 -132
- package/dist/Meter.d.ts.map +1 -1
- package/dist/Meter.js +35 -42
- package/dist/NativeDetails.d.ts +1 -1
- package/dist/NativeDetails.js +1 -1
- package/dist/NativeDialog.d.ts +7 -5
- package/dist/NativeDialog.d.ts.map +1 -1
- package/dist/NativeDialog.js +42 -4
- package/dist/NativePopover.d.ts +6 -4
- package/dist/NativePopover.d.ts.map +1 -1
- package/dist/NativePopover.js +43 -5
- package/dist/Popover.d.ts +18 -19
- package/dist/Popover.d.ts.map +1 -1
- package/dist/Popover.js +7 -8
- package/dist/RadioGroup.d.ts +86 -188
- package/dist/RadioGroup.d.ts.map +1 -1
- package/dist/RadioGroup.js +55 -105
- package/dist/Role.d.ts +4 -4
- package/dist/Role.js +1 -1
- package/dist/Select.d.ts +109 -220
- package/dist/Select.d.ts.map +1 -1
- package/dist/Select.js +67 -117
- package/dist/Separator.d.ts +30 -26
- package/dist/Separator.d.ts.map +1 -1
- package/dist/Separator.js +16 -10
- package/dist/Slider.d.ts +64 -111
- package/dist/Slider.d.ts.map +1 -1
- package/dist/Slider.js +47 -42
- package/dist/SpinButton.d.ts +64 -111
- package/dist/SpinButton.d.ts.map +1 -1
- package/dist/SpinButton.js +47 -42
- package/dist/Storybook.d.ts +2 -2
- package/dist/Storybook.js +1 -1
- package/dist/Switch.d.ts +52 -91
- package/dist/Switch.d.ts.map +1 -1
- package/dist/Switch.js +30 -36
- package/dist/Tabs.d.ts +44 -224
- package/dist/Tabs.d.ts.map +1 -1
- package/dist/Tabs.js +10 -94
- package/dist/Toolbar.d.ts +24 -142
- package/dist/Toolbar.d.ts.map +1 -1
- package/dist/Toolbar.js +8 -66
- package/dist/Tooltip.d.ts +20 -20
- package/dist/Tooltip.js +6 -6
- package/dist/Tree.d.ts +43 -229
- package/dist/Tree.d.ts.map +1 -1
- package/dist/Tree.js +12 -113
- package/dist/TreeGrid.d.ts +45 -264
- package/dist/TreeGrid.d.ts.map +1 -1
- package/dist/TreeGrid.js +13 -125
- package/dist/VisuallyHidden.d.ts +41 -27
- package/dist/VisuallyHidden.d.ts.map +1 -1
- package/dist/VisuallyHidden.js +27 -10
- package/dist/WindowSplitter.d.ts +68 -108
- package/dist/WindowSplitter.d.ts.map +1 -1
- package/dist/WindowSplitter.js +106 -23
- package/package.json +9 -8
package/dist/Toolbar.js
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
* the state and pure operations without mounting UI, or supply custom hosts without replacing native
|
|
8
8
|
* events and browser-owned focus.
|
|
9
9
|
*
|
|
10
|
+
* Learn the interaction in the [Toolbar guide](/explore/ui-toolbar).
|
|
11
|
+
*
|
|
10
12
|
* @since 1.0.0
|
|
11
13
|
* @category modules
|
|
12
14
|
* @packageDocumentation
|
|
@@ -21,15 +23,6 @@ import * as Dom from "./Dom.js";
|
|
|
21
23
|
* Effect Schema used by makeState to encode, decode, and hydrate Toolbar state.
|
|
22
24
|
*
|
|
23
25
|
* @remarks
|
|
24
|
-
* ## Why
|
|
25
|
-
*
|
|
26
|
-
* A public schema makes hydration and serialized state use the same runtime validation as direct
|
|
27
|
-
* construction.
|
|
28
|
-
*
|
|
29
|
-
* ## Ownership and lifetime
|
|
30
|
-
*
|
|
31
|
-
* This declaration is data or schema metadata and acquires no resources.
|
|
32
|
-
*
|
|
33
26
|
* @example
|
|
34
27
|
* ```ts
|
|
35
28
|
* import * as Schema from "effect/Schema";
|
|
@@ -38,19 +31,13 @@ import * as Dom from "./Dom.js";
|
|
|
38
31
|
* const decodeState = Schema.decodeUnknownEffect(Toolbar.StateSchema);
|
|
39
32
|
* ```
|
|
40
33
|
* @since 1.0.0
|
|
41
|
-
* @category
|
|
34
|
+
* @category Command focus
|
|
42
35
|
*/
|
|
43
36
|
export const StateSchema = Composite.StateSchema;
|
|
44
37
|
/**
|
|
45
38
|
* Creates hydrated Toolbar state. Uses Composite defaults unless overridden.
|
|
46
39
|
*
|
|
47
40
|
* @remarks
|
|
48
|
-
* ## Why
|
|
49
|
-
*
|
|
50
|
-
* State and collection ownership can be composed and tested independently from any renderer.
|
|
51
|
-
*
|
|
52
|
-
* ## Ownership and lifetime
|
|
53
|
-
*
|
|
54
41
|
* The returned Effect creates the RefSubject when run. That state is renderer-independent;
|
|
55
42
|
* collection registrations belong to the separate Scope that runs register or ref, not to state
|
|
56
43
|
* creation.
|
|
@@ -69,7 +56,7 @@ export const StateSchema = Composite.StateSchema;
|
|
|
69
56
|
* );
|
|
70
57
|
* ```
|
|
71
58
|
* @since 1.0.0
|
|
72
|
-
* @category
|
|
59
|
+
* @category Command focus
|
|
73
60
|
*/
|
|
74
61
|
export function makeState(initial = {}) {
|
|
75
62
|
return Composite.makeState(initial);
|
|
@@ -78,12 +65,6 @@ export function makeState(initial = {}) {
|
|
|
78
65
|
* Creates a scoped Collection for Toolbar items.
|
|
79
66
|
*
|
|
80
67
|
* @remarks
|
|
81
|
-
* ## Why
|
|
82
|
-
*
|
|
83
|
-
* State and collection ownership can be composed and tested independently from any renderer.
|
|
84
|
-
*
|
|
85
|
-
* ## Ownership and lifetime
|
|
86
|
-
*
|
|
87
68
|
* The returned Effect allocates the RefSubject in the caller's Scope. Each later registration is
|
|
88
69
|
* owned by the Scope that runs register, independently of this construction Effect.
|
|
89
70
|
*
|
|
@@ -100,7 +81,7 @@ export function makeState(initial = {}) {
|
|
|
100
81
|
* );
|
|
101
82
|
* ```
|
|
102
83
|
* @since 1.0.0
|
|
103
|
-
* @category
|
|
84
|
+
* @category Command registration
|
|
104
85
|
*/
|
|
105
86
|
export const makeCollection = Collection.makeState;
|
|
106
87
|
function rootProps(options) {
|
|
@@ -146,25 +127,12 @@ function rootProps(options) {
|
|
|
146
127
|
* Renders the toolbar root and moves roving focus through registered items in DOM order.
|
|
147
128
|
*
|
|
148
129
|
* @remarks
|
|
149
|
-
* ## Why
|
|
150
|
-
*
|
|
151
|
-
* The component applies the family behavior while leaving callers free to supply a custom host
|
|
152
|
-
* through the shared DOM boundary.
|
|
153
|
-
*
|
|
154
|
-
* ## Ownership and lifetime
|
|
155
|
-
*
|
|
156
130
|
* The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
|
|
157
131
|
* collection registrations only when rendered. The rendering Scope removes those resources;
|
|
158
132
|
* unrelated nodes and attributes remain caller-owned.
|
|
159
133
|
*
|
|
160
|
-
* ## Example
|
|
161
|
-
*
|
|
162
|
-
* Import with `import { Root } from "@typed/ui/Toolbar";` Extend the [Toolbar.makeState runnable
|
|
163
|
-
* setup](/reference/%40typed%2Fui%2FToolbar%23makeState). Replace the linked program's final
|
|
164
|
-
* snapshot read with `Root({ state, label: "Formatting", content: "Buttons" })`; render that Fx
|
|
165
|
-
* before the same Scope closes.
|
|
166
134
|
* @since 1.0.0
|
|
167
|
-
* @category
|
|
135
|
+
* @category Toolbar surface
|
|
168
136
|
*/
|
|
169
137
|
export function Root(options, host) {
|
|
170
138
|
return Dom.renderHost()(options, host, rootProps(options), options.content, (props, content) => {
|
|
@@ -175,24 +143,11 @@ export function Root(options, host) {
|
|
|
175
143
|
* Consumer-facing alias of the canonical Toolbar component with identical behavior and lifetime.
|
|
176
144
|
*
|
|
177
145
|
* @remarks
|
|
178
|
-
* ## Why
|
|
179
|
-
*
|
|
180
|
-
* The component applies the family behavior while leaving callers free to supply a custom host
|
|
181
|
-
* through the shared DOM boundary.
|
|
182
|
-
*
|
|
183
|
-
* ## Ownership and lifetime
|
|
184
|
-
*
|
|
185
146
|
* The alias acquires nothing. Rendering it has exactly the canonical component's Scope and DOM
|
|
186
147
|
* ownership contract.
|
|
187
148
|
*
|
|
188
|
-
* ## Example
|
|
189
|
-
*
|
|
190
|
-
* Import with `import { Toolbar } from "@typed/ui/Toolbar";` Extend the [Toolbar.makeState runnable
|
|
191
|
-
* setup](/reference/%40typed%2Fui%2FToolbar%23makeState). Replace the linked program's final
|
|
192
|
-
* snapshot read with `Toolbar({ state, label: "Formatting", content: "Buttons" })`; render that Fx
|
|
193
|
-
* before the same Scope closes.
|
|
194
149
|
* @since 1.0.0
|
|
195
|
-
* @category
|
|
150
|
+
* @category Toolbar surface
|
|
196
151
|
*/
|
|
197
152
|
export const Toolbar = Root;
|
|
198
153
|
function itemProps(options) {
|
|
@@ -220,25 +175,12 @@ function itemProps(options) {
|
|
|
220
175
|
* Renders and optionally registers a toolbar button; focus activates it unless disabled.
|
|
221
176
|
*
|
|
222
177
|
* @remarks
|
|
223
|
-
* ## Why
|
|
224
|
-
*
|
|
225
|
-
* The component applies the family behavior while leaving callers free to supply a custom host
|
|
226
|
-
* through the shared DOM boundary.
|
|
227
|
-
*
|
|
228
|
-
* ## Ownership and lifetime
|
|
229
|
-
*
|
|
230
178
|
* The returned Fx installs DOM refs, native listeners, state subscriptions, and optional
|
|
231
179
|
* collection registrations only when rendered. The rendering Scope removes those resources;
|
|
232
180
|
* unrelated nodes and attributes remain caller-owned.
|
|
233
181
|
*
|
|
234
|
-
* ## Example
|
|
235
|
-
*
|
|
236
|
-
* Import with `import { Item } from "@typed/ui/Toolbar";` Extend the [Toolbar.makeState runnable
|
|
237
|
-
* setup](/reference/%40typed%2Fui%2FToolbar%23makeState). Replace the linked program's final
|
|
238
|
-
* snapshot read with `Item({ state, id: "bold", content: "Bold" })`; render that Fx before the same
|
|
239
|
-
* Scope closes.
|
|
240
182
|
* @since 1.0.0
|
|
241
|
-
* @category
|
|
183
|
+
* @category Toolbar commands
|
|
242
184
|
*/
|
|
243
185
|
export function Item(options, host) {
|
|
244
186
|
return Dom.renderHost()(options, host, itemProps(options), options.content, (props, content) => html `<div ...${props}>${content}</div>`);
|
package/dist/Tooltip.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import type { HostResult } from "./Dom/Types.js";
|
|
|
14
14
|
* ## Ownership and lifetime
|
|
15
15
|
* Plain state retains no resources; RefSubject observation is Scope-owned.
|
|
16
16
|
* @since 1.0.0
|
|
17
|
-
* @category state
|
|
17
|
+
* @category Open state
|
|
18
18
|
*/
|
|
19
19
|
export interface State {
|
|
20
20
|
/** Stable id used by `aria-describedby` and tooltip content.
|
|
@@ -24,7 +24,7 @@ export interface State {
|
|
|
24
24
|
* ## Ownership and lifetime
|
|
25
25
|
* Plain data acquires no resources.
|
|
26
26
|
* @since 1.0.0
|
|
27
|
-
* @category relationships
|
|
27
|
+
* @category Identity and relationships
|
|
28
28
|
*/
|
|
29
29
|
readonly id: string;
|
|
30
30
|
/** Whether tooltip content is open.
|
|
@@ -34,7 +34,7 @@ export interface State {
|
|
|
34
34
|
* ## Ownership and lifetime
|
|
35
35
|
* Plain data acquires no resources.
|
|
36
36
|
* @since 1.0.0
|
|
37
|
-
* @category state
|
|
37
|
+
* @category Open state
|
|
38
38
|
*/
|
|
39
39
|
readonly open: boolean;
|
|
40
40
|
}
|
|
@@ -45,7 +45,7 @@ export interface State {
|
|
|
45
45
|
* ## Ownership and lifetime
|
|
46
46
|
* Configuration is inert.
|
|
47
47
|
* @since 1.0.0
|
|
48
|
-
* @category state
|
|
48
|
+
* @category Open state
|
|
49
49
|
*/
|
|
50
50
|
export interface InitialState {
|
|
51
51
|
/** Stable tooltip id.
|
|
@@ -55,7 +55,7 @@ export interface InitialState {
|
|
|
55
55
|
* ## Ownership and lifetime
|
|
56
56
|
* Plain data retains no resources.
|
|
57
57
|
* @since 1.0.0
|
|
58
|
-
* @category relationships
|
|
58
|
+
* @category Identity and relationships
|
|
59
59
|
*/
|
|
60
60
|
readonly id: string;
|
|
61
61
|
/** Initial visibility, defaulting to false.
|
|
@@ -65,7 +65,7 @@ export interface InitialState {
|
|
|
65
65
|
* ## Ownership and lifetime
|
|
66
66
|
* Plain data retains no resources.
|
|
67
67
|
* @since 1.0.0
|
|
68
|
-
* @category state
|
|
68
|
+
* @category Open state
|
|
69
69
|
*/
|
|
70
70
|
readonly open?: boolean;
|
|
71
71
|
}
|
|
@@ -76,7 +76,7 @@ export interface InitialState {
|
|
|
76
76
|
* ## Ownership and lifetime
|
|
77
77
|
* The immutable schema acquires no resources.
|
|
78
78
|
* @since 1.0.0
|
|
79
|
-
* @category
|
|
79
|
+
* @category Open state
|
|
80
80
|
*/
|
|
81
81
|
export declare const StateSchema: Schema.Struct<{
|
|
82
82
|
readonly id: Schema.String;
|
|
@@ -98,7 +98,7 @@ export declare const StateSchema: Schema.Struct<{
|
|
|
98
98
|
* })
|
|
99
99
|
* ```
|
|
100
100
|
* @since 1.0.0
|
|
101
|
-
* @category
|
|
101
|
+
* @category Open state
|
|
102
102
|
*/
|
|
103
103
|
export declare function makeState(initial: InitialState): Effect.Effect<RefSubject.HydratedRefSubject<{
|
|
104
104
|
readonly id: string;
|
|
@@ -121,7 +121,7 @@ export declare function makeState(initial: InitialState): Effect.Effect<RefSubje
|
|
|
121
121
|
* })
|
|
122
122
|
* ```
|
|
123
123
|
* @since 1.0.0
|
|
124
|
-
* @category state
|
|
124
|
+
* @category Open state
|
|
125
125
|
*/
|
|
126
126
|
export declare function setOpen<E, R>(state: RefSubject.RefSubject<State, E, R>, open: boolean): Effect.Effect<State, E, R>;
|
|
127
127
|
/** Options for a tooltip anchor host.
|
|
@@ -133,7 +133,7 @@ export declare function setOpen<E, R>(state: RefSubject.RefSubject<State, E, R>,
|
|
|
133
133
|
* ## Ownership and lifetime
|
|
134
134
|
* Options are inert; rendering owns listeners/timers by Scope.
|
|
135
135
|
* @since 1.0.0
|
|
136
|
-
* @category
|
|
136
|
+
* @category Pointer and focus anchors
|
|
137
137
|
*/
|
|
138
138
|
export interface AnchorOptions extends Dom.HostOptions<HTMLSpanElement> {
|
|
139
139
|
/** Hydrated state shared with tooltip content.
|
|
@@ -143,7 +143,7 @@ export interface AnchorOptions extends Dom.HostOptions<HTMLSpanElement> {
|
|
|
143
143
|
* ## Ownership and lifetime
|
|
144
144
|
* The anchor borrows state; its original Scope owns it.
|
|
145
145
|
* @since 1.0.0
|
|
146
|
-
* @category
|
|
146
|
+
* @category State connection
|
|
147
147
|
*/
|
|
148
148
|
readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
|
|
149
149
|
/** Anchor content.
|
|
@@ -154,7 +154,7 @@ export interface AnchorOptions extends Dom.HostOptions<HTMLSpanElement> {
|
|
|
154
154
|
* ## Ownership and lifetime
|
|
155
155
|
* Dynamic content follows the anchor Scope.
|
|
156
156
|
* @since 1.0.0
|
|
157
|
-
* @category content
|
|
157
|
+
* @category Rendered content
|
|
158
158
|
*/
|
|
159
159
|
readonly content: Renderable.Any;
|
|
160
160
|
/** Delay in milliseconds before opening.
|
|
@@ -165,7 +165,7 @@ export interface AnchorOptions extends Dom.HostOptions<HTMLSpanElement> {
|
|
|
165
165
|
* Delayed Effects run inside the component interaction lifetime; newer
|
|
166
166
|
* schedules invalidate older versions.
|
|
167
167
|
* @since 1.0.0
|
|
168
|
-
* @category
|
|
168
|
+
* @category Interaction delays
|
|
169
169
|
*/
|
|
170
170
|
readonly showDelay?: number;
|
|
171
171
|
/** Delay in milliseconds before closing.
|
|
@@ -175,7 +175,7 @@ export interface AnchorOptions extends Dom.HostOptions<HTMLSpanElement> {
|
|
|
175
175
|
* ## Ownership and lifetime
|
|
176
176
|
* Newer schedules invalidate older delayed updates.
|
|
177
177
|
* @since 1.0.0
|
|
178
|
-
* @category
|
|
178
|
+
* @category Interaction delays
|
|
179
179
|
*/
|
|
180
180
|
readonly hideDelay?: number;
|
|
181
181
|
}
|
|
@@ -214,7 +214,7 @@ type AnchorInternalProps<Options extends AnchorOptions> = ReturnType<ReturnType<
|
|
|
214
214
|
* })
|
|
215
215
|
* ```
|
|
216
216
|
* @since 1.0.0
|
|
217
|
-
* @category
|
|
217
|
+
* @category Pointer and focus anchors
|
|
218
218
|
*/
|
|
219
219
|
export declare function Anchor<const Options extends AnchorOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, AnchorInternalProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;
|
|
220
220
|
/** Options for native tooltip popover content.
|
|
@@ -224,7 +224,7 @@ export declare function Anchor<const Options extends AnchorOptions, const Host e
|
|
|
224
224
|
* ## Ownership and lifetime
|
|
225
225
|
* Options are inert; rendering owns listeners/ref observation by Scope.
|
|
226
226
|
* @since 1.0.0
|
|
227
|
-
* @category
|
|
227
|
+
* @category Native content host
|
|
228
228
|
*/
|
|
229
229
|
export interface ContentOptions extends Dom.HostOptions<HTMLDivElement> {
|
|
230
230
|
/** Hydrated state supplying content id and visibility.
|
|
@@ -234,7 +234,7 @@ export interface ContentOptions extends Dom.HostOptions<HTMLDivElement> {
|
|
|
234
234
|
* ## Ownership and lifetime
|
|
235
235
|
* Content borrows state; its original Scope owns it.
|
|
236
236
|
* @since 1.0.0
|
|
237
|
-
* @category
|
|
237
|
+
* @category State connection
|
|
238
238
|
*/
|
|
239
239
|
readonly state: RefSubject.HydratedRefSubject<State, Schema.SchemaError>;
|
|
240
240
|
/** Non-interactive explanatory tooltip content.
|
|
@@ -244,7 +244,7 @@ export interface ContentOptions extends Dom.HostOptions<HTMLDivElement> {
|
|
|
244
244
|
* ## Ownership and lifetime
|
|
245
245
|
* Dynamic content follows the content Scope.
|
|
246
246
|
* @since 1.0.0
|
|
247
|
-
* @category content
|
|
247
|
+
* @category Rendered content
|
|
248
248
|
*/
|
|
249
249
|
readonly content: Renderable.Any;
|
|
250
250
|
}
|
|
@@ -279,7 +279,7 @@ type ContentInternalProps<Options extends ContentOptions> = ReturnType<ReturnTyp
|
|
|
279
279
|
* })
|
|
280
280
|
* ```
|
|
281
281
|
* @since 1.0.0
|
|
282
|
-
* @category
|
|
282
|
+
* @category Native content host
|
|
283
283
|
*/
|
|
284
284
|
export declare function Content<const Options extends ContentOptions, const Host extends HostResult = never>(options: Options, host?: Dom.HostOverride<Dom.RenderHostProps<Options, ContentInternalProps<Options>>, Options["content"], Host>): Fx<RenderEvent, Renderable.Error<Options | Host>, Renderable.Services<Options | Host> | Scope.Scope | RenderTemplate>;
|
|
285
285
|
/** Canonical widget alias for `Content`.
|
|
@@ -289,7 +289,7 @@ export declare function Content<const Options extends ContentOptions, const Host
|
|
|
289
289
|
* ## Ownership and lifetime
|
|
290
290
|
* It has exactly the same Scope and popover ownership as `Content`.
|
|
291
291
|
* @since 1.0.0
|
|
292
|
-
* @category
|
|
292
|
+
* @category Native content host
|
|
293
293
|
*/
|
|
294
294
|
export declare const Tooltip: typeof Content;
|
|
295
295
|
export {};
|
package/dist/Tooltip.js
CHANGED
|
@@ -11,7 +11,7 @@ import * as NativePopover from "./NativePopover.js";
|
|
|
11
11
|
* ## Ownership and lifetime
|
|
12
12
|
* The immutable schema acquires no resources.
|
|
13
13
|
* @since 1.0.0
|
|
14
|
-
* @category
|
|
14
|
+
* @category Open state
|
|
15
15
|
*/
|
|
16
16
|
export const StateSchema = Schema.Struct({ id: Schema.String, open: Schema.Boolean });
|
|
17
17
|
/** Creates hydrated tooltip state.
|
|
@@ -30,7 +30,7 @@ export const StateSchema = Schema.Struct({ id: Schema.String, open: Schema.Boole
|
|
|
30
30
|
* })
|
|
31
31
|
* ```
|
|
32
32
|
* @since 1.0.0
|
|
33
|
-
* @category
|
|
33
|
+
* @category Open state
|
|
34
34
|
*/
|
|
35
35
|
export function makeState(initial) {
|
|
36
36
|
return RefSubject.hydrate(StateSchema, { id: initial.id, open: initial.open ?? false });
|
|
@@ -52,7 +52,7 @@ export function makeState(initial) {
|
|
|
52
52
|
* })
|
|
53
53
|
* ```
|
|
54
54
|
* @since 1.0.0
|
|
55
|
-
* @category state
|
|
55
|
+
* @category Open state
|
|
56
56
|
*/
|
|
57
57
|
export function setOpen(state, open) {
|
|
58
58
|
return RefSubject.update(state, (current) => ({ ...current, open }));
|
|
@@ -106,7 +106,7 @@ function anchorInternalProps(options) {
|
|
|
106
106
|
* })
|
|
107
107
|
* ```
|
|
108
108
|
* @since 1.0.0
|
|
109
|
-
* @category
|
|
109
|
+
* @category Pointer and focus anchors
|
|
110
110
|
*/
|
|
111
111
|
export function Anchor(options, host) {
|
|
112
112
|
return Dom.renderHost()(options, host, anchorInternalProps(options), options.content, (props, content) => html `<span ...${props}>${content}</span>`);
|
|
@@ -153,7 +153,7 @@ function contentInternalProps(options) {
|
|
|
153
153
|
* })
|
|
154
154
|
* ```
|
|
155
155
|
* @since 1.0.0
|
|
156
|
-
* @category
|
|
156
|
+
* @category Native content host
|
|
157
157
|
*/
|
|
158
158
|
export function Content(options, host) {
|
|
159
159
|
return Dom.renderHost()(options, host, contentInternalProps(options), options.content, (props, content) => {
|
|
@@ -167,6 +167,6 @@ export function Content(options, host) {
|
|
|
167
167
|
* ## Ownership and lifetime
|
|
168
168
|
* It has exactly the same Scope and popover ownership as `Content`.
|
|
169
169
|
* @since 1.0.0
|
|
170
|
-
* @category
|
|
170
|
+
* @category Native content host
|
|
171
171
|
*/
|
|
172
172
|
export const Tooltip = Content;
|