@typed/ui 1.0.0-beta.6 → 1.0.0-beta.8

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.
Files changed (130) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -1
  3. package/dist/Alert.d.ts +35 -41
  4. package/dist/Alert.d.ts.map +1 -1
  5. package/dist/Alert.js +23 -20
  6. package/dist/Button.d.ts +34 -78
  7. package/dist/Button.d.ts.map +1 -1
  8. package/dist/Button.js +16 -12
  9. package/dist/Carousel.d.ts +35 -236
  10. package/dist/Carousel.d.ts.map +1 -1
  11. package/dist/Carousel.js +13 -136
  12. package/dist/Checkbox.d.ts +55 -90
  13. package/dist/Checkbox.d.ts.map +1 -1
  14. package/dist/Checkbox.js +44 -38
  15. package/dist/Collection.d.ts +15 -15
  16. package/dist/Collection.js +7 -7
  17. package/dist/Combobox.d.ts +38 -187
  18. package/dist/Combobox.d.ts.map +1 -1
  19. package/dist/Combobox.js +9 -80
  20. package/dist/Component.d.ts +30 -24
  21. package/dist/Component.d.ts.map +1 -1
  22. package/dist/Component.js +23 -12
  23. package/dist/Composite.d.ts +50 -50
  24. package/dist/Composite.js +20 -20
  25. package/dist/Dialog.d.ts +34 -34
  26. package/dist/Dialog.d.ts.map +1 -1
  27. package/dist/Dialog.js +16 -14
  28. package/dist/Disclosure.d.ts +15 -15
  29. package/dist/Disclosure.js +6 -6
  30. package/dist/Dom/Events.d.ts +4 -4
  31. package/dist/Dom/Events.js +4 -4
  32. package/dist/Dom/Props.d.ts +9 -9
  33. package/dist/Dom/Props.js +4 -4
  34. package/dist/Dom/Refs.d.ts +2 -2
  35. package/dist/Dom/Refs.js +1 -1
  36. package/dist/Dom/Render.d.ts +2 -2
  37. package/dist/Dom/Render.js +2 -2
  38. package/dist/Dom/Types.d.ts +33 -33
  39. package/dist/Dom/index.d.ts +5 -5
  40. package/dist/Dom/index.d.ts.map +1 -1
  41. package/dist/Dom/index.js +4 -4
  42. package/dist/Dom.d.ts +1 -1
  43. package/dist/Dom.js +1 -1
  44. package/dist/Focusable.d.ts +5 -5
  45. package/dist/Focusable.js +1 -1
  46. package/dist/Form.d.ts +565 -533
  47. package/dist/Form.d.ts.map +1 -1
  48. package/dist/Form.js +350 -195
  49. package/dist/Grid.d.ts +39 -220
  50. package/dist/Grid.d.ts.map +1 -1
  51. package/dist/Grid.js +12 -107
  52. package/dist/Group.d.ts +50 -69
  53. package/dist/Group.d.ts.map +1 -1
  54. package/dist/Group.js +33 -25
  55. package/dist/Heading.d.ts +41 -40
  56. package/dist/Heading.d.ts.map +1 -1
  57. package/dist/Heading.js +26 -16
  58. package/dist/Hovercard.d.ts +18 -18
  59. package/dist/Hovercard.js +6 -6
  60. package/dist/HttpRouter.d.ts +3 -3
  61. package/dist/HttpRouter.js +5 -5
  62. package/dist/Link.d.ts +17 -21
  63. package/dist/Link.d.ts.map +1 -1
  64. package/dist/Link.js +11 -0
  65. package/dist/Listbox.d.ts +31 -163
  66. package/dist/Listbox.d.ts.map +1 -1
  67. package/dist/Listbox.js +9 -80
  68. package/dist/Menu.d.ts +67 -376
  69. package/dist/Menu.d.ts.map +1 -1
  70. package/dist/Menu.js +17 -179
  71. package/dist/Menubar.d.ts +24 -142
  72. package/dist/Menubar.d.ts.map +1 -1
  73. package/dist/Menubar.js +8 -66
  74. package/dist/Meter.d.ts +72 -132
  75. package/dist/Meter.d.ts.map +1 -1
  76. package/dist/Meter.js +35 -42
  77. package/dist/NativeDetails.d.ts +1 -1
  78. package/dist/NativeDetails.js +1 -1
  79. package/dist/NativeDialog.d.ts +7 -5
  80. package/dist/NativeDialog.d.ts.map +1 -1
  81. package/dist/NativeDialog.js +42 -4
  82. package/dist/NativePopover.d.ts +6 -4
  83. package/dist/NativePopover.d.ts.map +1 -1
  84. package/dist/NativePopover.js +43 -5
  85. package/dist/Popover.d.ts +18 -19
  86. package/dist/Popover.d.ts.map +1 -1
  87. package/dist/Popover.js +7 -8
  88. package/dist/RadioGroup.d.ts +86 -188
  89. package/dist/RadioGroup.d.ts.map +1 -1
  90. package/dist/RadioGroup.js +55 -105
  91. package/dist/Role.d.ts +4 -4
  92. package/dist/Role.js +1 -1
  93. package/dist/Select.d.ts +109 -220
  94. package/dist/Select.d.ts.map +1 -1
  95. package/dist/Select.js +67 -117
  96. package/dist/Separator.d.ts +30 -26
  97. package/dist/Separator.d.ts.map +1 -1
  98. package/dist/Separator.js +16 -10
  99. package/dist/Slider.d.ts +64 -111
  100. package/dist/Slider.d.ts.map +1 -1
  101. package/dist/Slider.js +47 -42
  102. package/dist/SpinButton.d.ts +64 -111
  103. package/dist/SpinButton.d.ts.map +1 -1
  104. package/dist/SpinButton.js +47 -42
  105. package/dist/Storybook.d.ts +2 -2
  106. package/dist/Storybook.js +1 -1
  107. package/dist/Switch.d.ts +52 -91
  108. package/dist/Switch.d.ts.map +1 -1
  109. package/dist/Switch.js +30 -36
  110. package/dist/Tabs.d.ts +44 -224
  111. package/dist/Tabs.d.ts.map +1 -1
  112. package/dist/Tabs.js +10 -94
  113. package/dist/Toolbar.d.ts +24 -142
  114. package/dist/Toolbar.d.ts.map +1 -1
  115. package/dist/Toolbar.js +8 -66
  116. package/dist/Tooltip.d.ts +20 -20
  117. package/dist/Tooltip.js +6 -6
  118. package/dist/Tree.d.ts +43 -229
  119. package/dist/Tree.d.ts.map +1 -1
  120. package/dist/Tree.js +12 -113
  121. package/dist/TreeGrid.d.ts +45 -264
  122. package/dist/TreeGrid.d.ts.map +1 -1
  123. package/dist/TreeGrid.js +13 -125
  124. package/dist/VisuallyHidden.d.ts +41 -27
  125. package/dist/VisuallyHidden.d.ts.map +1 -1
  126. package/dist/VisuallyHidden.js +27 -10
  127. package/dist/WindowSplitter.d.ts +68 -108
  128. package/dist/WindowSplitter.d.ts.map +1 -1
  129. package/dist/WindowSplitter.js +106 -23
  130. package/package.json +13 -12
@@ -1 +1 @@
1
- {"version":3,"file":"Heading.d.ts","sourceRoot":"","sources":["../src/Heading.ts"],"names":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ACrB,KAAK,CAAC,OAAO,SAAS,cAAc,EACpC,KAAK,CAAC,IAAI,SAAS,UAAU,GAAG,KAAK,EAErC,OAAO,EAAE,OAAO,EAChB,IAAI,CAAC,EAAE,GAAG,CAAC,YAAY,CACrB,GAAG,CAAC,eAAe,CAAC,OAAO,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC,EAC3D,OAAO,CAAC,SAAS,CAAC,EAClB,IAAI,CACL,GACA,EAAE,CACH,WAAW,EACX,UAAU,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,CAAC,EAChC,UAAU,CAAC,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,GAAG,cAAc,CACnE,CAQA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,gBAAU,CAAC;AAC7B;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,gBAAU,CAAC"}
package/dist/Heading.js CHANGED
@@ -4,22 +4,36 @@ function internalProps({ property, }) {
4
4
  return { role: "heading", "aria-level": property("level", 1) };
5
5
  }
6
6
  /**
7
- * Renders a host with `role="heading"` and a reactive `aria-level`.
7
+ * Renders a div with heading semantics and an explicit level.
8
+ *
8
9
  * @remarks
9
- * ## Why
10
- * The primitive lets a design system preserve document-outline semantics when
11
- * its visual host cannot be selected statically.
12
- * ## Ownership and lifetime
13
- * Running the returned Fx owns its dynamic attributes and content in an Effect
14
- * Scope. A custom host must preserve `role` and `aria-level`.
10
+ * level defaults to one and may be reactive; it does not choose font size, infer nesting, or
11
+ * validate the document outline. Use native h1–h6 markup when the level is fixed. A custom host
12
+ * must keep its native level and aria-level consistent.
13
+ *
15
14
  * @example
16
15
  * ```ts
17
- * import { Heading } from "@typed/ui/Heading"
16
+ * import { html } from "@typed/template";
17
+ * import { Heading } from "@typed/ui/Heading";
18
+ *
19
+ * export function AccountSection(level: 2 | 3) {
20
+ * return html`<section aria-labelledby="account-section-title">
21
+ * ${Heading({
22
+ * level,
23
+ * content: "Account security",
24
+ * props: { id: "account-section-title", class: "section-title" },
25
+ * })}
26
+ * <p>Review the devices and credentials that can access this account.</p>
27
+ * </section>`;
28
+ * }
18
29
  *
19
- * const title = Heading({ level: 3, content: "Details" })
30
+ * export const AccountPage = html`<main>
31
+ * <h1>Account settings</h1>
32
+ * ${AccountSection(2)}
33
+ * </main>`;
20
34
  * ```
21
35
  * @since 1.0.0
22
- * @category components
36
+ * @category Structure and naming
23
37
  */
24
38
  export function Heading(options, host) {
25
39
  return Dom.renderHost()(options, host, internalProps, options.content, (props, content) => html `<div ...${props}>${content}</div>`);
@@ -27,22 +41,18 @@ export function Heading(options, host) {
27
41
  /**
28
42
  * Alias for `Heading` retained for level-oriented imports.
29
43
  * @remarks
30
- * ## Why
31
44
  * The alias names the role the component plays in a contextual heading system.
32
- * ## Ownership and lifetime
33
45
  * It has exactly the same Scope and host ownership as `Heading`.
34
46
  * @since 1.0.0
35
- * @category aliases
47
+ * @category Aliases
36
48
  */
37
49
  export const Level = Heading;
38
50
  /**
39
51
  * Descriptive alias for `Heading`.
40
52
  * @remarks
41
- * ## Why
42
53
  * The name remains available without duplicating an implementation contract.
43
- * ## Ownership and lifetime
44
54
  * It has exactly the same Scope and host ownership as `Heading`.
45
55
  * @since 1.0.0
46
- * @category aliases
56
+ * @category Aliases
47
57
  */
48
58
  export const HeadingLevel = Heading;
@@ -14,7 +14,7 @@ import type { HostResult } from "./Dom/Types.js";
14
14
  * ## Ownership and lifetime
15
15
  * Plain data 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-controls` and 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 the hovercard 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 content 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 schemas
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 constructors
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 hovercard 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 handlers/delayed effects by Scope.
135
135
  * @since 1.0.0
136
- * @category models
136
+ * @category Pointer and focus anchors
137
137
  */
138
138
  export interface AnchorOptions extends Dom.HostOptions<HTMLSpanElement> {
139
139
  /** Hydrated state shared with hovercard 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 state
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
  /** Milliseconds before opening.
@@ -164,7 +164,7 @@ export interface AnchorOptions extends Dom.HostOptions<HTMLSpanElement> {
164
164
  * ## Ownership and lifetime
165
165
  * New schedules invalidate older delayed updates.
166
166
  * @since 1.0.0
167
- * @category timing
167
+ * @category Interaction delays
168
168
  */
169
169
  readonly showDelay?: number;
170
170
  /** Milliseconds before closing.
@@ -174,7 +174,7 @@ export interface AnchorOptions extends Dom.HostOptions<HTMLSpanElement> {
174
174
  * ## Ownership and lifetime
175
175
  * New schedules invalidate older delayed updates.
176
176
  * @since 1.0.0
177
- * @category timing
177
+ * @category Interaction delays
178
178
  */
179
179
  readonly hideDelay?: number;
180
180
  }
@@ -213,7 +213,7 @@ type AnchorInternalProps<Options extends AnchorOptions> = ReturnType<ReturnType<
213
213
  * })
214
214
  * ```
215
215
  * @since 1.0.0
216
- * @category components
216
+ * @category Pointer and focus anchors
217
217
  */
218
218
  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>;
219
219
  interface ContentOptionsBase extends Dom.HostOptions<HTMLDivElement> {
@@ -241,7 +241,7 @@ type AccessibleName = {
241
241
  * ## Ownership and lifetime
242
242
  * Options are inert; rendering owns content/listeners/native ref by Scope.
243
243
  * @since 1.0.0
244
- * @category models
244
+ * @category Native content host
245
245
  */
246
246
  export type ContentOptions = ContentOptionsBase & AccessibleName;
247
247
  declare function contentInternalProps<const Options extends ContentOptions>(options: Options): ({ property }: Dom.InternalPropsHelpers<Options>) => {
@@ -280,7 +280,7 @@ type ContentInternalProps<Options extends ContentOptions> = ReturnType<ReturnTyp
280
280
  * })
281
281
  * ```
282
282
  * @since 1.0.0
283
- * @category components
283
+ * @category Native content host
284
284
  */
285
285
  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>;
286
286
  /** Canonical widget alias for `Content`.
@@ -290,7 +290,7 @@ export declare function Content<const Options extends ContentOptions, const Host
290
290
  * ## Ownership and lifetime
291
291
  * It has exactly the same Scope and native popover ownership as `Content`.
292
292
  * @since 1.0.0
293
- * @category aliases
293
+ * @category Native content host
294
294
  */
295
295
  export declare const Hovercard: typeof Content;
296
296
  export {};
package/dist/Hovercard.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 schemas
14
+ * @category Open state
15
15
  */
16
16
  export const StateSchema = Schema.Struct({ id: Schema.String, open: Schema.Boolean });
17
17
  /** Creates hydrated hovercard 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 constructors
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 }));
@@ -112,7 +112,7 @@ function anchorInternalProps(options) {
112
112
  * })
113
113
  * ```
114
114
  * @since 1.0.0
115
- * @category components
115
+ * @category Pointer and focus anchors
116
116
  */
117
117
  export function Anchor(options, host) {
118
118
  return Dom.renderHost()(options, host, anchorInternalProps(options), options.content, (props, content) => html `<span ...${props}>${content}</span>`);
@@ -169,7 +169,7 @@ function contentInternalProps(options) {
169
169
  * })
170
170
  * ```
171
171
  * @since 1.0.0
172
- * @category components
172
+ * @category Native content host
173
173
  */
174
174
  export function Content(options, host) {
175
175
  return Dom.renderHost()(options, host, contentInternalProps(options), options.content, (i, content) => {
@@ -183,6 +183,6 @@ export function Content(options, host) {
183
183
  * ## Ownership and lifetime
184
184
  * It has exactly the same Scope and native popover ownership as `Content`.
185
185
  * @since 1.0.0
186
- * @category aliases
186
+ * @category Native content host
187
187
  */
188
188
  export const Hovercard = Content;
@@ -51,7 +51,7 @@ type SsrForHttpEffect<E, R> = Effect.Effect<void, never, SsrForHttpRequirement<E
51
51
  * ```
52
52
  *
53
53
  * @since 1.0.0
54
- * @category http
54
+ * @category Buffered server rendering
55
55
  */
56
56
  export declare const ssrForHttp: {
57
57
  <E, R>(input: Matcher<RenderEvent, E, R>): (router: HttpRouter) => SsrForHttpEffect<E, R>;
@@ -93,7 +93,7 @@ export declare const ssrForHttp: {
93
93
  * ```
94
94
  *
95
95
  * @since 1.0.0
96
- * @category http
96
+ * @category Streaming server rendering
97
97
  */
98
98
  export declare const streamingSsrForHttp: {
99
99
  <E, R>(input: Matcher<RenderEvent, E, R>): (router: HttpRouter) => SsrForHttpEffect<E, R>;
@@ -129,7 +129,7 @@ export declare const streamingSsrForHttp: {
129
129
  * ```
130
130
  *
131
131
  * @since 1.0.0
132
- * @category http
132
+ * @category HTTP error responses
133
133
  */
134
134
  export declare function handleHttpServerError(router: HttpRouter): Effect.Effect<void, never, HttpRouterRequest<"GlobalError", unknown>>;
135
135
  export {};
@@ -11,7 +11,7 @@ import * as HttpServerError from "effect/unstable/http/HttpServerError";
11
11
  import * as HttpServerRequest from "effect/unstable/http/HttpServerRequest";
12
12
  import * as HttpServerResponse from "effect/unstable/http/HttpServerResponse";
13
13
  import { compile, CurrentRoute, makeRouteExecutor, Join, Parse, } from "@typed/router";
14
- import { Ids } from "@typed/id";
14
+ import { Uuid7State } from "@typed/id/Uuid7";
15
15
  import { initialMemory } from "@typed/navigation";
16
16
  import { renderToHtml, renderToHtmlString } from "@typed/template";
17
17
  const htmlResponseHeaders = { "content-type": "text/html; charset=utf-8" };
@@ -95,7 +95,7 @@ function getMatcherPath(path) {
95
95
  * ```
96
96
  *
97
97
  * @since 1.0.0
98
- * @category http
98
+ * @category Buffered server rendering
99
99
  */
100
100
  export const ssrForHttp = makeSsrForHttp(bufferedResponse());
101
101
  /**
@@ -134,7 +134,7 @@ export const ssrForHttp = makeSsrForHttp(bufferedResponse());
134
134
  * ```
135
135
  *
136
136
  * @since 1.0.0
137
- * @category http
137
+ * @category Streaming server rendering
138
138
  */
139
139
  export const streamingSsrForHttp = makeSsrForHttp(streamingResponse());
140
140
  /**
@@ -167,7 +167,7 @@ export const streamingSsrForHttp = makeSsrForHttp(streamingResponse());
167
167
  * ```
168
168
  *
169
169
  * @since 1.0.0
170
- * @category http
170
+ * @category HTTP error responses
171
171
  */
172
172
  export function handleHttpServerError(router) {
173
173
  return router.addGlobalMiddleware(Effect.catch((error) => HttpServerError.isHttpServerError(error)
@@ -200,7 +200,7 @@ function toRoute(path, candidates, currentServices, createResponse) {
200
200
  const request = yield* HttpServerRequest.HttpServerRequest;
201
201
  const searchParams = yield* HttpServerRequest.ParsedSearchParams;
202
202
  const requestUrl = Option.getOrElse(HttpServerRequest.toURL(request), () => new URL(request.url, "http://localhost"));
203
- const provided = Layer.mergeAll(initialMemory({ url: requestUrl, origin: requestUrl.origin }).pipe(Layer.provide(Ids.Default)), Layer.succeed(CurrentRoute, yield* Effect.serviceOption(CurrentRoute).pipe(Effect.map(Option.match({
203
+ const provided = Layer.mergeAll(initialMemory({ url: requestUrl, origin: requestUrl.origin }).pipe(Layer.provide(Uuid7State.Default)), Layer.succeed(CurrentRoute, yield* Effect.serviceOption(CurrentRoute).pipe(Effect.map(Option.match({
204
204
  onNone: () => ({
205
205
  route: Parse(request.url),
206
206
  parent: undefined,
package/dist/Link.d.ts CHANGED
@@ -8,19 +8,11 @@ import type { HostResult } from "./Dom/Types.js";
8
8
  * Native anchor options plus Typed navigation behavior.
9
9
  *
10
10
  * @remarks
11
- * ## Why
12
- *
13
11
  * `href` and content remain renderable, while `replace` selects history policy.
14
12
  * Ordinary anchor options—including target, download, rel, and user click
15
13
  * handlers—stay available through the DOM host model.
16
- *
17
- * ## Ownership and lifetime
18
- *
19
- * Options are inert. Rendering owns subscriptions to renderable values and the
20
- * click listener for its Effect Scope; the `Navigation` service owns history.
21
- *
22
14
  * @since 1.0.0
23
- * @category models
15
+ * @category Component options
24
16
  */
25
17
  export type LinkOptions = Dom.HostOptions<HTMLAnchorElement> & Dom.ElementOptions<HTMLAnchorElement> & {
26
18
  readonly href: Renderable<string, any, any>;
@@ -39,15 +31,11 @@ type LinkServices<Options extends object> = Renderable.ServicesFromObject<Option
39
31
  * internal navigation decision.
40
32
  *
41
33
  * @remarks
42
- * ## Why
43
- *
44
34
  * `Link` keeps the anchor as the integration boundary: native opening, copying,
45
35
  * status previews, modifier keys, downloads, and external navigation continue
46
36
  * to work. Only an unmodified primary click to same-origin HTTP(S) is handed to
47
37
  * Typed's Effect-native `Navigation` service.
48
38
  *
49
- * ## Ownership and lifetime
50
- *
51
39
  * Calling `Link` starts no work. Running the returned Fx subscribes to dynamic
52
40
  * href/content and installs a real, non-passive DOM click listener in its
53
41
  * Effect Scope. Scope finalization removes only those resources. Navigation
@@ -57,17 +45,25 @@ type LinkServices<Options extends object> = Renderable.ServicesFromObject<Option
57
45
  *
58
46
  * @example
59
47
  * ```ts
60
- * import { Link } from "@typed/ui/Link"
48
+ * import { html } from "@typed/template";
49
+ * import { Link } from "@typed/ui/Link";
61
50
  *
62
- * const profile = Link({
63
- * href: "/account/profile",
64
- * content: "Profile",
65
- * replace: false
66
- * })
51
+ * export const AccountLinks = html`<nav aria-label="Account">
52
+ * ${Link({ href: "/account/profile", content: "Edit profile" })}
53
+ * ${Link({
54
+ * href: "/account/security",
55
+ * content: "Security settings",
56
+ * replace: false,
57
+ * })}
58
+ * ${Link({
59
+ * href: "https://www.w3.org/WAI/",
60
+ * content: "Accessibility resources (opens in a new tab)",
61
+ * props: { target: "_blank", rel: "noopener" },
62
+ * })}
63
+ * </nav>`;
67
64
  * ```
68
- *
69
65
  * @since 1.0.0
70
- * @category components
66
+ * @category Native controls
71
67
  */
72
68
  export declare function Link<const Options extends object>(options: Options, ..._: Options extends LinkOptions ? [] : ["Link options must satisfy LinkOptions"]): Fx.Fx<RenderEvent, LinkError<Options>, LinkServices<Options>>;
73
69
  export declare function Link<const Options extends object, const Host extends HostResult>(options: Options, host: Dom.HostOverride<Dom.HostProps<HTMLAnchorElement>, Renderable.Any, Host>, ..._: Options extends LinkOptions ? [] : ["Link options must satisfy LinkOptions"]): Fx.Fx<RenderEvent, LinkError<Options> | Fx.Error<Host>, LinkServices<Options> | Fx.Services<Host>>;
@@ -1 +1 @@
1
- {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../src/Link.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,KAAK,EAA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CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAC1C,CAAC"}
package/dist/Link.js CHANGED
@@ -1,3 +1,14 @@
1
+ /**
2
+ * Native anchors with selective same-origin Navigation interception.
3
+ * Modified clicks, external links, downloads, and non-self targets retain native behavior.
4
+ *
5
+ * Read the [Link guide](/explore/ui-link) for a complete example.
6
+ *
7
+ * [APG interaction reference](https://www.w3.org/WAI/ARIA/apg/patterns/link/).
8
+ * @since 1.0.0
9
+ * @category Overview
10
+ * @packageDocumentation
11
+ */
1
12
  import * as Effect from "effect/Effect";
2
13
  import * as Stream from "effect/Stream";
3
14
  import * as Fx from "@typed/fx/Fx";