@lo-tek/interfaces 0.41.0 → 0.43.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.
Files changed (63) hide show
  1. package/CHANGELOG.md +107 -0
  2. package/agent/astro.md +1 -1
  3. package/agent/bundles.md +1 -1
  4. package/agent/datastar.md +57 -50
  5. package/agent/html.md +53 -53
  6. package/agent/kotlin.md +4 -4
  7. package/agent/react.md +1 -1
  8. package/agent/templates.md +50 -50
  9. package/dist/components/frame/dialog/lt-dialog.d.ts +11 -3
  10. package/dist/components/frame/dialog/lt-dialog.d.ts.map +1 -1
  11. package/dist/components/frame/dialog/lt-dialog.js +59 -46
  12. package/dist/components/frame/dialog/lt-dialog.js.map +1 -1
  13. package/dist/components/frame/error-summary/lt-error-summary.d.ts +9 -6
  14. package/dist/components/frame/error-summary/lt-error-summary.d.ts.map +1 -1
  15. package/dist/components/frame/error-summary/lt-error-summary.js +38 -57
  16. package/dist/components/frame/error-summary/lt-error-summary.js.map +1 -1
  17. package/dist/components/frame/field/lt-field.d.ts +17 -26
  18. package/dist/components/frame/field/lt-field.d.ts.map +1 -1
  19. package/dist/components/frame/field/lt-field.js +81 -143
  20. package/dist/components/frame/field/lt-field.js.map +1 -1
  21. package/dist/components/frame/popover/lt-popover.d.ts +1 -1
  22. package/dist/components/frame/popover/lt-popover.d.ts.map +1 -1
  23. package/dist/components/frame/popover/lt-popover.js +31 -33
  24. package/dist/components/frame/popover/lt-popover.js.map +1 -1
  25. package/dist/components/frame/session-timeout/lt-session-timeout.d.ts +14 -2
  26. package/dist/components/frame/session-timeout/lt-session-timeout.d.ts.map +1 -1
  27. package/dist/components/frame/session-timeout/lt-session-timeout.js +73 -46
  28. package/dist/components/frame/session-timeout/lt-session-timeout.js.map +1 -1
  29. package/dist/components/frame/suggestion/lt-suggestion.d.ts +5 -7
  30. package/dist/components/frame/suggestion/lt-suggestion.d.ts.map +1 -1
  31. package/dist/components/frame/suggestion/lt-suggestion.js +57 -72
  32. package/dist/components/frame/suggestion/lt-suggestion.js.map +1 -1
  33. package/dist/components/frame/tabs/lt-tabs.d.ts +14 -5
  34. package/dist/components/frame/tabs/lt-tabs.d.ts.map +1 -1
  35. package/dist/components/frame/tabs/lt-tabs.js +86 -106
  36. package/dist/components/frame/tabs/lt-tabs.js.map +1 -1
  37. package/dist/components/frame/term/lt-term.d.ts +5 -1
  38. package/dist/components/frame/term/lt-term.d.ts.map +1 -1
  39. package/dist/components/frame/term/lt-term.js +23 -21
  40. package/dist/components/frame/term/lt-term.js.map +1 -1
  41. package/dist/components/host-element.d.ts +137 -2
  42. package/dist/components/host-element.d.ts.map +1 -1
  43. package/dist/components/host-element.js +187 -4
  44. package/dist/components/host-element.js.map +1 -1
  45. package/dist/lotek.css +1 -1
  46. package/dist/react.d.ts +51 -437
  47. package/dist/react.d.ts.map +1 -1
  48. package/dist/react.js +48 -208
  49. package/dist/react.js.map +1 -1
  50. package/live-templates-kotlin.xml +4 -6
  51. package/manifest/manifest.json +1 -1
  52. package/package.json +7 -3
  53. package/src/components/frame/dialog/lt-dialog.ts +56 -50
  54. package/src/components/frame/error-summary/lt-error-summary.ts +33 -46
  55. package/src/components/frame/field/lt-field.ts +99 -207
  56. package/src/components/frame/popover/lt-popover.ts +37 -35
  57. package/src/components/frame/session-timeout/lt-session-timeout.ts +88 -46
  58. package/src/components/frame/suggestion/lt-suggestion.ts +59 -73
  59. package/src/components/frame/tabs/lt-tabs.ts +96 -122
  60. package/src/components/frame/term/lt-term.ts +27 -21
  61. package/src/components/host-element.ts +306 -3
  62. package/src/react.ts +125 -240
  63. package/web-types.json +1 -1
package/dist/react.d.ts CHANGED
@@ -1,13 +1,7 @@
1
- import { tableSort } from "./components/css/table/table.js";
2
- import { dialog } from "./components/frame/dialog/dialog.js";
3
- import { errorSummary } from "./components/frame/error-summary/error-summary.js";
4
- import { createFieldId, type FieldOptions } from "./components/frame/field/field-core.js";
5
- import { popover } from "./components/frame/popover/popover.js";
6
- import { sessionTimeout } from "./components/frame/session-timeout/session-timeout.js";
7
- import { suggestion } from "./components/frame/suggestion/suggestion.js";
8
- import { type TabsWithStateOptions } from "./components/frame/tabs/tabs.js";
1
+ import { createFieldId } from "./components/frame/field/field-core.js";
2
+ import { type TabsWithStateOptions, tabsWithState } from "./components/frame/tabs/tabs.js";
9
3
  import { termWithState } from "./components/frame/term/term.js";
10
- import { toast } from "./components/standalone/toast/toast.js";
4
+ import { type Lt } from "./lt.js";
11
5
  export type { LtEventMap } from "./components/events.js";
12
6
  /**
13
7
  * The same API as `lt`, but with `className` and `htmlFor`.
@@ -61,6 +55,44 @@ export type ReactSet = Record<string, string | number | boolean | undefined>;
61
55
  * are translated back first.
62
56
  */
63
57
  export declare function setAttributes(element: Element | null | undefined, ...sets: ReactSet[]): void;
58
+ /**
59
+ * A builder function's result with the React names: every attribute set in
60
+ * it, in an object or a list as deep as it goes. A set is an object whose
61
+ * values are all plain values; anything else is gone through.
62
+ */
63
+ export type ReactResult<R> = R extends readonly (infer Item)[] ? ReactResult<Item>[] : R extends object ? R[keyof R] extends string | number | boolean | null | undefined ? ReactAttributes<R> : {
64
+ [K in keyof R]: ReactResult<R[K]>;
65
+ } : R;
66
+ /**
67
+ * The type of a member of `lt` in `/react`. A guard, which answers
68
+ * `value is T`, is the same function: no builder function answers a
69
+ * boolean, and at run time `isGuard` tells it by its name. A builder function
70
+ * takes the same options, named `options` as in the editor, and gives the
71
+ * React result.
72
+ */
73
+ type ForReactFn<F> = F extends (...args: never[]) => boolean ? F : F extends (...args: never[]) => infer R ? Parameters<F> extends [] ? (() => ReactResult<R>) & {
74
+ [K in keyof F]: F[K];
75
+ } : ForReactOptions<F> : F;
76
+ type ForReactOptions<F> = F extends (options?: infer O) => infer R ? ((options?: O) => ReactResult<R>) & {
77
+ [K in keyof F]: F[K];
78
+ } : F extends (options: infer O) => infer R ? ((options: O) => ReactResult<R>) & {
79
+ [K in keyof F]: F[K];
80
+ } : F;
81
+ /**
82
+ * What stands by hand in `lt` below: the two that give the whole state, and
83
+ * `setAttributes`, which takes an element and builds nothing.
84
+ */
85
+ declare const BY_HAND: readonly ["tabs", "term", "setAttributes"];
86
+ type ByHand = (typeof BY_HAND)[number];
87
+ /**
88
+ * Every member of `lt` but those by hand, with the React names. Mapped over
89
+ * `keyof Lt`, and named on `lt` below, so the declaration file refers to it
90
+ * and the documentation on each member in `lt.ts` comes along to the
91
+ * consumer's editor.
92
+ */
93
+ type ForReact = {
94
+ [K in keyof Lt as K extends ByHand ? never : K]: ForReactFn<Lt[K]>;
95
+ };
64
96
  /**
65
97
  * Re-exported from the main entry point.
66
98
  *
@@ -71,443 +103,25 @@ export declare function setAttributes(element: Element | null | undefined, ...se
71
103
  * also in an app without a server.
72
104
  */
73
105
  export { createFieldId };
74
- export declare const lt: {
75
- readonly accordion: ((options?: import("./index.js").AccordionOptions | undefined) => ReactAttributes<import("./index.js").AccordionAttributes>) & (({ variant }?: import("./index.js").AccordionOptions) => import("./index.js").AccordionAttributes) & {
76
- content: "lt-accordion__content";
77
- variants: readonly ["default", "plain"];
78
- isVariant: (value: string) => value is "default" | "plain";
79
- };
80
- readonly alert: ((options?: import("./index.js").AlertOptions | undefined) => ReactAttributes<import("./index.js").AlertAttributes>) & (({ color }?: import("./index.js").AlertOptions) => import("./index.js").AlertAttributes) & {
81
- title: "lt-alert__title";
82
- colors: readonly ["info", "success", "warning", "danger"];
83
- isColor: (value: string) => value is "warning" | "info" | "success" | "danger";
84
- };
85
- readonly avatar: ((options?: import("./index.js").AvatarOptions | undefined) => ReactAttributes<import("./index.js").AvatarAttributes>) & (({ size, variant, }?: import("./index.js").AvatarOptions) => import("./index.js").AvatarAttributes) & {
86
- stack: "lt-avatar-stack";
87
- sizes: readonly ["small", "medium", "large"];
88
- isSize: (value: string) => value is "small" | "medium" | "large";
89
- variants: readonly ["circle", "square"];
90
- isVariant: (value: string) => value is "circle" | "square";
91
- };
92
- readonly badge: ((options?: import("./index.js").BadgeOptions | undefined) => ReactAttributes<import("./index.js").BadgeAttributes>) & (({ color }?: import("./index.js").BadgeOptions) => import("./index.js").BadgeAttributes) & {
93
- colors: readonly ["info", "success", "warning", "danger", "neutral"];
94
- isColor: (value: string) => value is "warning" | "info" | "success" | "danger" | "neutral";
95
- };
96
- readonly breadcrumbs: ((options?: unknown) => ReactAttributes<import("./index.js").BreadcrumbsAttributes>) & (() => import("./index.js").BreadcrumbsAttributes);
97
- readonly button: ((options?: import("./index.js").ButtonOptions | undefined) => ReactAttributes<import("./index.js").ButtonAttributes>) & (({ variant }?: import("./index.js").ButtonOptions) => import("./index.js").ButtonAttributes) & {
98
- variants: readonly ["primary", "secondary", "ghost", "danger"];
99
- isVariant: (value: string) => value is "danger" | "primary" | "secondary" | "ghost";
100
- };
101
- readonly card: ((options?: import("./index.js").CardOptions | undefined) => ReactAttributes<import("./index.js").CardAttributes>) & (({ variant, interactive }?: import("./index.js").CardOptions) => import("./index.js").CardAttributes) & {
102
- title: "lt-card__title";
103
- variants: readonly ["outline", "filled"];
104
- isVariant: (value: string) => value is "outline" | "filled";
105
- };
106
- readonly checkbox: ((options?: import("./index.js").CheckboxOptions | undefined) => ReactAttributes<import("./index.js").CheckboxAttributes>) & (({ state }?: import("./index.js").CheckboxOptions) => import("./index.js").CheckboxAttributes) & {
107
- row: "lt-checkbox-row";
108
- states: readonly ["default", "invalid", "success"];
109
- isState: (value: string) => value is "default" | "invalid" | "success";
110
- };
111
- readonly divider: ((options?: import("./index.js").DividerOptions | undefined) => ReactAttributes<import("./index.js").DividerAttributes>) & (({ variant }?: import("./index.js").DividerOptions) => import("./index.js").DividerAttributes) & {
112
- variants: readonly ["default", "subtle", "strong"];
113
- isVariant: (value: string) => value is "default" | "subtle" | "strong";
114
- };
115
- readonly errorText: ((options?: import("./index.js").ErrorTextOptions | undefined) => ReactAttributes<import("./index.js").ErrorTextAttributes>) & (({ variant }?: import("./index.js").ErrorTextOptions) => import("./index.js").ErrorTextAttributes) & {
116
- variants: readonly ["error", "warning"];
117
- isVariant: (value: string) => value is "error" | "warning";
118
- };
119
- readonly fieldset: ((options?: import("./index.js").FieldsetOptions | undefined) => ReactAttributes<import("./index.js").FieldsetAttributes>) & (({ state, disabled }?: import("./index.js").FieldsetOptions) => import("./index.js").FieldsetAttributes) & {
120
- states: readonly ["default", "invalid", "success"];
121
- isState: (value: string) => value is "default" | "invalid" | "success";
122
- };
123
- readonly heading: ((options?: import("./index.js").HeadingOptions | undefined) => ReactAttributes<import("./index.js").HeadingAttributes>) & (({ size }?: import("./index.js").HeadingOptions) => import("./index.js").HeadingAttributes) & {
124
- sizes: readonly ["xs", "s", "m", "l", "xl", "mega"];
125
- isSize: (value: string) => value is "xs" | "s" | "m" | "l" | "xl" | "mega";
126
- };
127
- readonly fileUpload: ((options?: import("./index.js").FileUploadOptions | undefined) => ReactAttributes<import("./index.js").FileUploadAttributes>) & (({ state, multiple, accept, }?: import("./index.js").FileUploadOptions) => import("./index.js").FileUploadAttributes) & {
128
- list: "lt-file-upload-list";
129
- states: readonly ["default", "invalid", "success"];
130
- isState: (value: string) => value is "default" | "invalid" | "success";
131
- };
132
- readonly helpText: ((options?: import("./index.js").HelpTextOptions | undefined) => ReactAttributes<import("./index.js").HelpTextAttributes>) & (({ variant }?: import("./index.js").HelpTextOptions) => import("./index.js").HelpTextAttributes) & {
133
- variants: readonly ["muted", "strong", "success", "warning"];
134
- isVariant: (value: string) => value is "warning" | "success" | "strong" | "muted";
135
- };
136
- readonly icon: ((options?: import("./index.js").IconOptions | undefined) => ReactAttributes<import("./index.js").IconAttributes>) & (({ label }?: import("./index.js").IconOptions) => import("./index.js").IconAttributes);
137
- readonly input: ((options?: import("./index.js").InputOptions | undefined) => ReactAttributes<import("./index.js").InputAttributes>) & (({ type, state }?: import("./index.js").InputOptions) => import("./index.js").InputAttributes) & {
138
- types: readonly ["text", "password", "email", "number", "date", "datetime-local", "week", "month", "tel", "url", "search", "time"];
139
- isType: (value: string) => value is "number" | "date" | "search" | "url" | "text" | "password" | "email" | "datetime-local" | "week" | "month" | "tel" | "time";
140
- states: readonly ["default", "invalid", "success"];
141
- isState: (value: string) => value is "default" | "invalid" | "success";
142
- };
143
- readonly label: ((options?: import("./index.js").LabelOptions | undefined) => ReactAttributes<import("./index.js").LabelAttributes>) & (({ required, optional, disabled }?: import("./index.js").LabelOptions) => import("./index.js").LabelAttributes) & {
144
- markers: readonly ["symbol", "text"];
145
- isMarker: (value: string) => value is "symbol" | "text";
146
- };
147
- readonly legend: ((options?: import("./index.js").LegendOptions | undefined) => ReactAttributes<import("./index.js").LegendAttributes>) & (({ required, optional, disabled }?: import("./index.js").LegendOptions) => import("./index.js").LegendAttributes) & {
148
- markers: readonly ["symbol", "text"];
149
- isMarker: (value: string) => value is "symbol" | "text";
150
- };
151
- readonly link: ((options?: import("./index.js").LinkOptions | undefined) => ReactAttributes<import("./index.js").LinkAttributes>) & (({ disabled }?: import("./index.js").LinkOptions) => import("./index.js").LinkAttributes);
152
- readonly list: ((options?: import("./index.js").ListOptions | undefined) => ReactAttributes<import("./index.js").ListAttributes>) & (({ variant }?: import("./index.js").ListOptions) => import("./index.js").ListAttributes) & {
153
- variants: readonly ["default", "plain", "divided"];
154
- isVariant: (value: string) => value is "default" | "plain" | "divided";
155
- };
156
- readonly pagination: ((options?: unknown) => ReactAttributes<import("./index.js").PaginationAttributes>) & (() => import("./index.js").PaginationAttributes) & {
157
- gap: "lt-pagination__gap";
158
- };
159
- readonly paragraph: ((options?: import("./index.js").ParagraphOptions | undefined) => ReactAttributes<import("./index.js").ParagraphAttributes>) & (({ size, variant, }?: import("./index.js").ParagraphOptions) => import("./index.js").ParagraphAttributes) & {
160
- sizes: readonly ["small", "medium", "large"];
161
- isSize: (value: string) => value is "small" | "medium" | "large";
162
- variants: readonly ["default", "lead"];
163
- isVariant: (value: string) => value is "default" | "lead";
164
- };
165
- readonly radio: ((options?: import("./index.js").RadioOptions | undefined) => ReactAttributes<import("./index.js").RadioAttributes>) & (({ state }?: import("./index.js").RadioOptions) => import("./index.js").RadioAttributes) & {
166
- row: "lt-radio-row";
167
- states: readonly ["default", "invalid", "success"];
168
- isState: (value: string) => value is "default" | "invalid" | "success";
169
- };
170
- readonly search: ((options?: import("./index.js").SearchOptions | undefined) => ReactAttributes<import("./index.js").SearchAttributes>) & (({ state }?: import("./index.js").SearchOptions) => import("./index.js").SearchAttributes) & {
171
- row: "lt-search-row";
172
- states: readonly ["default", "invalid", "success"];
173
- isState: (value: string) => value is "default" | "invalid" | "success";
174
- };
175
- readonly select: ((options?: import("./index.js").SelectOptions | undefined) => ReactAttributes<import("./index.js").SelectAttributes>) & (({ state, picker, }?: import("./index.js").SelectOptions) => import("./index.js").SelectAttributes) & {
176
- states: readonly ["default", "invalid", "success"];
177
- isState: (value: string) => value is "default" | "invalid" | "success";
178
- pickers: readonly ["auto", "styled"];
179
- isPicker: (value: string) => value is "auto" | "styled";
180
- };
181
- readonly skeleton: ((options?: import("./index.js").SkeletonOptions | undefined) => ReactAttributes<import("./index.js").SkeletonAttributes>) & (({ variant }?: import("./index.js").SkeletonOptions) => import("./index.js").SkeletonAttributes) & {
182
- variants: readonly ["block", "text", "circle"];
183
- isVariant: (value: string) => value is "text" | "circle" | "block";
184
- };
185
- readonly skipLink: ((options?: unknown) => ReactAttributes<import("./index.js").SkipLinkAttributes>) & (() => import("./index.js").SkipLinkAttributes);
186
- readonly progress: ((options?: import("./index.js").ProgressOptions | undefined) => ReactAttributes<import("./index.js").ProgressAttributes>) & (({ value, max, color, label, valueText, }?: import("./index.js").ProgressOptions) => import("./index.js").ProgressAttributes) & {
187
- colors: readonly ["success", "warning", "danger"];
188
- isColor: (value: string) => value is "warning" | "success" | "danger";
189
- };
190
- readonly spinner: ((options?: import("./index.js").SpinnerOptions | undefined) => ReactAttributes<import("./index.js").SpinnerAttributes>) & (({ size, label }?: import("./index.js").SpinnerOptions) => import("./index.js").SpinnerAttributes) & {
191
- sizes: readonly ["small", "medium", "large"];
192
- isSize: (value: string) => value is "small" | "medium" | "large";
193
- };
194
- readonly srOnly: ((options?: unknown) => ReactAttributes<import("./index.js").SrOnlyAttributes>) & (() => import("./index.js").SrOnlyAttributes);
195
- readonly steps: ((options?: unknown) => ReactAttributes<import("./index.js").StepsAttributes>) & (() => import("./index.js").StepsAttributes);
196
- readonly switch: ((options?: import("./index.js").SwitchOptions | undefined) => ReactAttributes<import("./index.js").SwitchAttributes>) & (({ disabled }?: import("./index.js").SwitchOptions) => import("./index.js").SwitchAttributes) & {
197
- row: "lt-switch-row";
198
- };
199
- readonly toggleGroup: ((options?: unknown) => ReactAttributes<import("./index.js").ToggleGroupAttributes>) & (() => import("./index.js").ToggleGroupAttributes) & {
200
- option: "lt-toggle-group__option";
201
- };
202
- readonly tooltip: ((options?: unknown) => ReactAttributes<import("./index.js").TooltipAttributes>) & (() => import("./index.js").TooltipAttributes) & {
203
- bubble: "lt-tooltip__bubble";
204
- };
205
- readonly table: ((options?: import("./index.js").TableOptions | undefined) => ReactAttributes<import("./index.js").TableAttributes>) & (({ variant, hoverable }?: import("./index.js").TableOptions) => import("./index.js").TableAttributes) & {
206
- scroll: "lt-table-scroll";
207
- variants: readonly ["default", "striped"];
208
- isVariant: (value: string) => value is "default" | "striped";
209
- };
210
- readonly tableSort: ((options?: Parameters<typeof tableSort>[0]) => {
211
- header: {
212
- "aria-sort"?: import("./index.js").TableSortDirection;
213
- };
214
- button: ReactAttributes<{
215
- class: typeof import("./components/css/table/table.js").TABLE_SORT_CLASS;
216
- type: "button";
217
- }>;
218
- }) & {
219
- isDirection: (value: string) => value is "ascending" | "descending";
220
- };
221
- readonly tag: ((options?: import("./index.js").TagOptions | undefined) => ReactAttributes<import("./index.js").TagAttributes>) & (({ variant, selectable }?: import("./index.js").TagOptions) => import("./index.js").TagAttributes) & {
222
- variants: readonly ["outline", "filled"];
223
- isVariant: (value: string) => value is "outline" | "filled";
224
- };
225
- readonly textarea: ((options?: import("./index.js").TextareaOptions | undefined) => ReactAttributes<import("./index.js").TextareaAttributes>) & (({ state }?: import("./index.js").TextareaOptions) => import("./index.js").TextareaAttributes) & {
226
- states: readonly ["default", "invalid", "success"];
227
- isState: (value: string) => value is "default" | "invalid" | "success";
228
- };
229
- /**
230
- * Wires a whole field, with `className` and `htmlFor` on the label.
231
- *
232
- * `control`, `help` and `error` have no keys that need renaming, and are
233
- * therefore the same in both entry points.
234
- */
235
- readonly field: (options: FieldOptions) => {
236
- label: ReactAttributes<{
237
- class: "lt-label";
238
- for: string;
239
- "data-required"?: import("./index.js").RequiredMarker;
240
- "data-optional"?: "";
241
- "aria-disabled"?: "true";
242
- }>;
243
- control: {
244
- id: string;
245
- "aria-describedby"?: string;
246
- "aria-invalid"?: "true";
247
- "data-state"?: "invalid";
248
- disabled?: true;
249
- };
250
- help: {
251
- id: string;
252
- };
253
- error: {
254
- id: string;
255
- hidden?: true;
256
- };
257
- state: import("./index.js").FieldState;
258
- };
259
- /**
260
- * The compound builder functions return one attribute set per element,
261
- * and each set must be renamed on its own. `host` has `tabindex`, and the
262
- * panels in `lt.tabs()` have both `tabindex` and `class`.
263
- */
264
- readonly errorSummary: (options?: Parameters<typeof errorSummary>[0]) => {
265
- host: ReactAttributes<{
266
- class: typeof import("./index.js").ERROR_SUMMARY_CLASS;
267
- role: "alert";
268
- tabindex: "-1";
269
- id?: string;
270
- hidden?: true;
271
- "aria-labelledby"?: string;
272
- }>;
273
- title: ReactAttributes<{
274
- class: typeof import("./index.js").ERROR_SUMMARY_TITLE_CLASS;
275
- id?: string;
276
- }>;
277
- };
278
- readonly dialog: ((options: Parameters<typeof dialog>[0]) => {
279
- host: {
280
- open?: true;
281
- };
282
- dialog: ReactAttributes<{
283
- class: typeof import("./components/frame/dialog/dialog.js").DIALOG_CLASS;
284
- "aria-labelledby": string;
285
- open?: true;
286
- "data-color"?: Exclude<import("./components/frame/dialog/dialog.js").DialogColor, "neutral">;
287
- }>;
288
- header: ReactAttributes<{
289
- class: typeof import("./components/frame/dialog/dialog.js").DIALOG_HEADER_CLASS;
290
- }>;
291
- title: ReactAttributes<{
292
- class: typeof import("./components/frame/dialog/dialog.js").DIALOG_TITLE_CLASS;
293
- id: string;
294
- }>;
295
- subtitle: ReactAttributes<{
296
- class: typeof import("./components/frame/dialog/dialog.js").DIALOG_SUBTITLE_CLASS;
297
- }>;
298
- body: ReactAttributes<{
299
- class: typeof import("./components/frame/dialog/dialog.js").DIALOG_BODY_CLASS;
300
- }>;
301
- footer: ReactAttributes<{
302
- class: typeof import("./components/frame/dialog/dialog.js").DIALOG_FOOTER_CLASS;
303
- }>;
304
- }) & {
305
- dialog: "lt-dialog";
306
- header: "lt-dialog__header";
307
- title: "lt-dialog__title";
308
- subtitle: "lt-dialog__subtitle";
309
- body: "lt-dialog__body";
310
- footer: "lt-dialog__footer";
311
- colors: readonly ["neutral", "brand", "info", "success", "warning", "danger"];
312
- isColor: (value: string) => value is "warning" | "info" | "success" | "danger" | "neutral" | "brand";
313
- };
314
- readonly popover: ((options: Parameters<typeof popover>[0]) => {
315
- host: {
316
- open?: true;
317
- placement?: import("./index.js").PopoverPlacement;
318
- };
319
- trigger: ReactAttributes<{
320
- type: "button";
321
- "aria-expanded": "true" | "false";
322
- "aria-controls": string;
323
- }>;
324
- panel: ReactAttributes<{
325
- class: typeof import("./index.js").POPOVER_CLASS;
326
- id: string;
327
- popover: "manual";
328
- }>;
329
- }) & {
330
- isPlacement: typeof import("./index.js").isPopoverPlacement;
331
- };
106
+ /** The type of `lt` in `/react`. */
107
+ export type ReactLt = ForReact & {
332
108
  /**
333
109
  * The whole state, not just the links: React reports a mismatch for every
334
110
  * attribute the component writes on an element React has rendered. See
335
111
  * `tabsWithState`.
336
112
  */
337
- readonly tabs: (options: TabsWithStateOptions) => {
338
- list: ReactAttributes<{
339
- class: typeof import("./index.js").TABS_LIST_CLASS;
340
- role: "tablist";
341
- "aria-label": string;
342
- }>;
343
- item: ReactAttributes<{
344
- role: "presentation";
345
- }>;
346
- tabs: ReactAttributes<{
347
- id: string;
348
- href: string;
349
- role: "tab";
350
- "aria-selected": "true" | "false";
351
- "aria-controls": string;
352
- tabindex: "0" | "-1";
353
- }>[];
354
- panels: ReactAttributes<{
355
- id: string;
356
- class: typeof import("./index.js").TABS_PANEL_CLASS;
357
- role: "tabpanel";
358
- "aria-labelledby": string;
359
- tabindex?: "0";
360
- hidden?: true;
361
- }>[];
362
- };
113
+ readonly tabs: (options: TabsWithStateOptions) => ReactResult<ReturnType<typeof tabsWithState>>;
363
114
  /**
364
115
  * With `aria-expanded`, which `<lt-term>` writes: React reports a mismatch
365
116
  * for an attribute it did not render. See `termWithState`.
366
117
  */
367
- readonly term: (options: Parameters<typeof termWithState>[0]) => {
368
- word: ReactAttributes<{
369
- class: typeof import("./index.js").TERM_CLASS;
370
- href: string;
371
- "aria-details": string;
372
- } & {
373
- "aria-expanded": "false";
374
- }>;
375
- entry: ReactAttributes<{
376
- class: typeof import("./index.js").TERM_ENTRY_CLASS;
377
- id: string;
378
- }>;
379
- };
380
- readonly suggestion: (options: Parameters<typeof suggestion>[0]) => {
381
- label: ReactAttributes<{
382
- id: string;
383
- class: "lt-label";
384
- for: string;
385
- "data-required"?: import("./index.js").RequiredMarker;
386
- "data-optional"?: "";
387
- "aria-disabled"?: "true";
388
- }>;
389
- control: ReactAttributes<{
390
- class: "lt-input";
391
- type: "text";
392
- role: "combobox";
393
- autocomplete: "off";
394
- "aria-expanded": "true" | "false";
395
- "aria-controls": string;
396
- "aria-describedby": string;
397
- "aria-autocomplete": "list";
398
- "aria-activedescendant": string | undefined;
399
- id: string;
400
- "aria-invalid"?: "true";
401
- "data-state"?: "invalid";
402
- disabled?: true;
403
- }>;
404
- list: ReactAttributes<{
405
- class: "lt-suggestion__list";
406
- id: string;
407
- role: "listbox";
408
- "aria-labelledby": string;
409
- popover: "manual";
410
- hidden: true | undefined;
411
- "aria-busy": "true" | undefined;
412
- }>;
413
- options: ReactAttributes<{
414
- class: "lt-suggestion__option";
415
- id: string;
416
- role: "option";
417
- "aria-selected": "true" | "false";
418
- }>[];
419
- empty: ReactAttributes<{
420
- class: "lt-suggestion__empty";
421
- hidden: true | undefined;
422
- }>;
423
- status: ReactAttributes<{
424
- class: "lt-sr-only";
425
- id: string;
426
- role: "status";
427
- }>;
428
- value: ReactAttributes<{
429
- class: "lt-suggestion__value";
430
- type: "hidden";
431
- }>;
432
- help: {
433
- id: string;
434
- };
435
- error: {
436
- id: string;
437
- hidden?: true;
438
- };
439
- state: "default" | "invalid" | "success";
440
- };
441
- readonly toast: (options?: Parameters<typeof toast>[0]) => {
442
- host: ReactAttributes<{
443
- class: typeof import("./index.js").TOAST_CLASS;
444
- role: "status";
445
- "aria-live": "polite";
446
- "aria-atomic": "false";
447
- "aria-label": string;
448
- "close-label"?: string;
449
- "data-ignore-morph": "";
450
- }>;
451
- message: ReactAttributes<{
452
- class: typeof import("./index.js").TOAST_MESSAGE_CLASS;
453
- }>;
454
- close: ReactAttributes<{
455
- class: typeof import("./index.js").TOAST_CLOSE_CLASS;
456
- }>;
457
- };
458
- readonly sessionTimeout: ((options: Parameters<typeof sessionTimeout>[0]) => {
459
- host: ReactAttributes<{
460
- class: typeof import("./index.js").SESSION_TIMEOUT_CLASS;
461
- "warn-at"?: string;
462
- "expires-at"?: string;
463
- "activity-interval"?: string;
464
- "data-ignore-morph": "";
465
- }>;
466
- dialog: ReactAttributes<{
467
- class: typeof import("./index.js").SESSION_TIMEOUT_DIALOG_CLASS;
468
- role: "alertdialog";
469
- "aria-labelledby": string;
470
- }>;
471
- title: ReactAttributes<{
472
- class: typeof import("./index.js").SESSION_TIMEOUT_TITLE_CLASS;
473
- id: string;
474
- }>;
475
- text: ReactAttributes<{
476
- class: typeof import("./index.js").SESSION_TIMEOUT_TEXT_CLASS;
477
- }>;
478
- count: ReactAttributes<{
479
- class: typeof import("./index.js").SESSION_TIMEOUT_COUNT_CLASS;
480
- "aria-hidden": "true";
481
- }>;
482
- live: ReactAttributes<{
483
- class: "lt-sr-only";
484
- role: "status";
485
- }>;
486
- actions: ReactAttributes<{
487
- class: typeof import("./index.js").SESSION_TIMEOUT_ACTIONS_CLASS;
488
- method: "dialog";
489
- }>;
490
- extend: ReactAttributes<{
491
- class: "lt-button";
492
- value: typeof import("./index.js").SESSION_EXTEND;
493
- }>;
494
- logout: ReactAttributes<{
495
- class: "lt-button";
496
- "data-variant": "secondary";
497
- value: typeof import("./index.js").SESSION_LOGOUT;
498
- }>;
499
- }) & {
500
- dialog: "lt-session-timeout__dialog";
501
- title: "lt-session-timeout__title";
502
- text: "lt-session-timeout__text";
503
- count: "lt-session-timeout__count";
504
- actions: "lt-session-timeout__actions";
505
- };
506
- readonly connectionStatus: ((options?: import("./index.js").ConnectionStatusOptions | undefined) => ReactAttributes<import("./index.js").ConnectionStatusAttributes>) & (({ offlineText, onlineText, }?: import("./index.js").ConnectionStatusOptions) => import("./index.js").ConnectionStatusAttributes);
118
+ readonly term: (options: Parameters<typeof termWithState>[0]) => ReactResult<ReturnType<typeof termWithState>>;
119
+ /** Like `lt.setAttributes` in the main entry, for the sets from here. */
507
120
  readonly setAttributes: typeof setAttributes;
508
- readonly states: readonly ["default", "invalid", "success"];
509
- readonly isState: (value: string) => value is "default" | "invalid" | "success";
510
- readonly markers: readonly ["symbol", "text"];
511
- readonly isMarker: (value: string) => value is "symbol" | "text";
512
121
  };
122
+ /**
123
+ * Every builder function from the main entry, with the React names. A new
124
+ * component comes along by itself; only the exceptions stand here.
125
+ */
126
+ export declare const lt: ReactLt;
513
127
  //# sourceMappingURL=react.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAuCA,OAAO,EAAS,SAAS,EAAE,MAAM,iCAAiC,CAAA;AAKlE,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,mDAAmD,CAAA;AAChF,OAAO,EAEL,aAAa,EACb,KAAK,YAAY,EAClB,MAAM,wCAAwC,CAAA;AAC/C,OAAO,E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