@lofid/react 0.0.0-stage → 1.1.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 CHANGED
@@ -1,3 +1,90 @@
1
- # Temporary Holding Version
1
+ # @lofid/react
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ React wrappers for every element in `@lofid/web`: all 51 `lof-*` custom elements,
4
+ companions included (`LofTabItem`, `LofMenuItem`, `LofResizablePanel`, …). They work with React 18
5
+ and 19, and they server-render.
6
+
7
+ The wrappers are **generated from the web package's source** (`scripts/generate.mjs`), so their
8
+ props, event handlers and event detail types can't drift from the components. `npm run build` fails
9
+ if `src/generated.ts` is stale.
10
+
11
+ ```bash
12
+ npm install @lofid/react @lofid/web
13
+ ```
14
+
15
+ ## Setup
16
+
17
+ Load the tokens once, then register the elements on the client.
18
+
19
+ ```tsx
20
+ // Vite / CRA entry
21
+ import "@lofid/web/vars.css";
22
+ import "@lofid/web"; // defines lof-* and lof-icon
23
+ ```
24
+
25
+ In Next.js (or any SSR setup), register the elements after hydration. The wrappers never import the
26
+ web package themselves, so they're safe in server-rendered trees:
27
+
28
+ ```tsx
29
+ "use client";
30
+ import { useEffect } from "react";
31
+ import { defineElements } from "@lofid/react";
32
+
33
+ export function LdsElements() {
34
+ useEffect(() => void defineElements(), []);
35
+ return null;
36
+ }
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ ```tsx
42
+ import { useState } from "react";
43
+ import { LofButton, LofSelect, LofTextfield, type LofSelectElement } from "@lofid/react";
44
+
45
+ export function Profile() {
46
+ const [name, setName] = useState("");
47
+ const [countries, setCountries] = useState<string[]>([]);
48
+
49
+ return (
50
+ <form>
51
+ <LofTextfield label="Name" size="small" value={name} onLofChange={(e) => setName(e.detail)} />
52
+ <LofSelect
53
+ label="Countries"
54
+ multiple
55
+ options={[{ label: "India", value: "in" }, { label: "Nepal", value: "np" }]}
56
+ selectedValues={countries}
57
+ onLofChange={(e) => setCountries(e.detail.value as string[])}
58
+ />
59
+ <LofButton variant="primary">Save</LofButton>
60
+ </form>
61
+ );
62
+ }
63
+ ```
64
+
65
+ - **Props** are the element's own properties, typed from its class: `variant`, `options`,
66
+ `selectedValues` and so on. Arrays, objects and functions are assigned as properties. Strings,
67
+ numbers and `true` booleans are also rendered as attributes, so server-rendered HTML carries them.
68
+ `false` works too, including for props that default to `true` (`fullWidth={false}`).
69
+ - **Events** are `on` + the event name in PascalCase: `lof-change` → `onLofChange`, `open-change` →
70
+ `onOpenChange`, `changed` → `onChanged`, `actionClick` → `onActionClick`. A handler only fires for
71
+ events its own element dispatches, never for one bubbling up from a nested `lof-*` element.
72
+ - **HTML attributes** (`className`, `style`, `id`, `slot`, `aria-*`, `data-*`, `onClick`, …) pass
73
+ through unchanged. `className` becomes `class` on React 18 as well.
74
+ - **Refs** point at the element. Each element type is exported as `<Name>Element`
75
+ (`LofSelectElement`, `LofModalElement`, …) for `useRef`.
76
+ - **Children** are slotted content, exactly as in HTML: `<LofButton>Save</LofButton>`.
77
+
78
+ Dropping a prop returns the element to its default. Controlled values (`value`, `checked`,
79
+ `selectedValues`, …) are re-applied on every render, so resetting state resets the element.
80
+
81
+ ## Development
82
+
83
+ ```bash
84
+ npm run generate -w @lofid/react # rewrite src/generated.ts from packages/web/src
85
+ npm run build -w @lofid/react # check generated.ts is current, then bundle
86
+ npm test -w @lofid/react # SSR tests + real-browser tests (Chrome or Edge)
87
+ ```
88
+
89
+ The browser tests use `playwright-core` with an installed Chrome or Edge; set `BROWSER_PATH` to use
90
+ another Chromium.
@@ -0,0 +1,456 @@
1
+ import { ForwardRefExoticComponent, HTMLAttributes, ReactNode, RefAttributes } from 'react';
2
+ import * as W from '@lofid/web';
3
+ export { LofAccordion as LofAccordionElement, LofAlert as LofAlertElement, LofAutocomplete as LofAutocompleteElement, LofAvatar as LofAvatarElement, LofAvatarGroup as LofAvatarGroupElement, LofBadge as LofBadgeElement, LofBreadcrumbs as LofBreadcrumbsElement, LofButton as LofButtonElement, LofCalendar as LofCalendarElement, LofCard as LofCardElement, LofCardMedia as LofCardMediaElement, LofCarousel as LofCarouselElement, LofCheckbox as LofCheckboxElement, LofChip as LofChipElement, LofContainer as LofContainerElement, LofDatePicker as LofDatePickerElement, LofDivider as LofDividerElement, LofDrawer as LofDrawerElement, LofDrawerFooter as LofDrawerFooterElement, LofEmptyState as LofEmptyStateElement, LofImageInput as LofImageInputElement, LofKbd as LofKbdElement, LofKbdGroup as LofKbdGroupElement, LofLayout as LofLayoutElement, LofLink as LofLinkElement, LofMenu as LofMenuElement, LofMenuItem as LofMenuItemElement, LofMenubar as LofMenubarElement, LofMenubarMenu as LofMenubarMenuElement, LofModal as LofModalElement, LofNav as LofNavElement, LofOtp as LofOtpElement, LofPageHeader as LofPageHeaderElement, LofPagination as LofPaginationElement, LofPopoverContent as LofPopoverContentElement, LofPopover as LofPopoverElement, LofProgress as LofProgressElement, LofRadio as LofRadioElement, LofRangePicker as LofRangePickerElement, LofRating as LofRatingElement, LofResizableGroup as LofResizableGroupElement, LofResizableHandle as LofResizableHandleElement, LofResizablePanel as LofResizablePanelElement, LofSegmentedButton as LofSegmentedButtonElement, LofSelect as LofSelectElement, LofSignaturePad as LofSignaturePadElement, LofSkeleton as LofSkeletonElement, LofSlider as LofSliderElement, LofSnackbar as LofSnackbarElement, LofSplitButton as LofSplitButtonElement, LofStat as LofStatElement, LofStepper as LofStepperElement, LofSwitch as LofSwitchElement, LofTab as LofTabElement, LofTabItem as LofTabItemElement, LofTable as LofTableElement, LofTextfield as LofTextfieldElement, LofTimePicker as LofTimePickerElement, LofToast as LofToastElement, LofTooltip as LofTooltipElement, LofTree as LofTreeElement, LofUploadActions as LofUploadActionsElement, LofUpload as LofUploadElement } from '@lofid/web';
4
+
5
+ /** Event handler props, e.g. `{ onLofChange: (e: CustomEvent<{ value: string }>) => void }`. */
6
+ type EventHandlers<Events> = {
7
+ [K in keyof Events]?: (event: Events[K]) => void;
8
+ };
9
+ /**
10
+ * Props of a wrapper: the element's public properties (typed from the element class),
11
+ * its event handlers, and ordinary HTML attributes (className, style, id, slot, aria-*, data-*).
12
+ */
13
+ type LofProps<E extends HTMLElement, P extends keyof E, Events> = {
14
+ [K in P]?: E[K];
15
+ } & EventHandlers<Events> & Omit<HTMLAttributes<E>, P | keyof Events> & {
16
+ children?: ReactNode;
17
+ };
18
+ type LofComponent<E extends HTMLElement, P extends keyof E, Events> = ForwardRefExoticComponent<LofProps<E, P, Events> & RefAttributes<E>>;
19
+ /**
20
+ * How a property also renders as an attribute: `"attr"` for strings and numbers,
21
+ * `"?attr"` for booleans (present only when `true`), `null` for property-only
22
+ * values such as arrays, objects and functions.
23
+ */
24
+ type AttributeSpec = string | null;
25
+ /**
26
+ * Builds a React component that renders `tag` and bridges what React 18 cannot:
27
+ *
28
+ * - **Properties.** Every key of `props` is assigned to the element as a JS
29
+ * property after each render, before paint. React 18 alone would set a string
30
+ * attribute, which breaks arrays, objects, `false` booleans and camelCase names
31
+ * whose attribute differs (`selectedValues` is `selected-values`). A property
32
+ * dropped from the props goes back to the element's default.
33
+ * - **Attributes.** Strings, numbers and `true` booleans are also rendered under
34
+ * their attribute name, so server-rendered HTML carries them and the element
35
+ * looks right the moment it is defined, before React hydrates.
36
+ * - **Events.** Each `onX` key of `events` listens for the custom event it names.
37
+ * Only events the element itself dispatches reach the handler: the events bubble,
38
+ * so a `<LofSelect>` inside a `<LofTab>` would otherwise call the tab's
39
+ * `onLofChange` with the select's detail.
40
+ *
41
+ * Nothing here imports the web package, so wrappers render on the server as plain
42
+ * tags. Register the elements once on the client (see `defineElements`).
43
+ */
44
+ declare function createComponent<E extends HTMLElement, P extends keyof E & string, Events extends Record<string, Event>>(tag: string, props: {
45
+ readonly [K in P]: AttributeSpec;
46
+ }, events: {
47
+ readonly [K in keyof Events]: string;
48
+ }): LofComponent<E, P, Events>;
49
+
50
+ /** React wrapper for `<lof-accordion>`. */
51
+ declare const LofAccordion: LofComponent<W.LofAccordion, "title" | "type" | "appearance" | "contentType" | "disabled" | "open" | "size", {
52
+ onOpenChange: CustomEvent<boolean>;
53
+ }>;
54
+ /** React wrapper for `<lof-alert>`. */
55
+ declare const LofAlert: LofComponent<W.LofAlert, "type" | "appearance" | "dismissed" | "dismissible" | "message1" | "message2" | "tone" | "urlHref" | "urlText", {
56
+ onDismiss: CustomEvent<undefined>;
57
+ }>;
58
+ /** React wrapper for `<lof-autocomplete>`. */
59
+ declare const LofAutocomplete: LofComponent<W.LofAutocomplete, "label" | "filter" | "error" | "disabled" | "size" | "clearable" | "debounceMs" | "displayField" | "errorMessage" | "fieldAriaLabel" | "fieldAriaLabelledby" | "floatingLabel" | "fullWidth" | "helperText" | "items" | "labelStyle" | "loading" | "loadingText" | "maxSuggestions" | "minSearchLength" | "multiple" | "name" | "noResultsText" | "placeholder" | "prefixIcon" | "readonly" | "required" | "searchFn" | "selectAllLabel" | "selectedValues" | "supportingField" | "value" | "valueField" | "variant", {
60
+ onChanged: CustomEvent<{
61
+ value: string;
62
+ item: W.AutocompleteItem;
63
+ } | {
64
+ value: string[];
65
+ item: null;
66
+ } | {
67
+ value: string;
68
+ item: null;
69
+ }>;
70
+ onLofChange: CustomEvent<string>;
71
+ onLofClear: CustomEvent<undefined>;
72
+ onLofSearchError: CustomEvent<{
73
+ query: string;
74
+ error: unknown;
75
+ }>;
76
+ }>;
77
+ /** React wrapper for `<lof-avatar>`. */
78
+ declare const LofAvatar: LofComponent<W.LofAvatar, "color" | "text" | "type" | "size" | "variant" | "alt" | "badge" | "badgeIcon" | "badgeLabel" | "bg" | "icon" | "ring" | "src", {}>;
79
+ /** React wrapper for `<lof-avatar-group>`. */
80
+ declare const LofAvatarGroup: LofComponent<W.LofAvatarGroup, "label" | "size" | "max" | "overflowLabel" | "total", {}>;
81
+ /** React wrapper for `<lof-badge>`. */
82
+ declare const LofBadge: LofComponent<W.LofBadge, "number" | "ariaLabel" | "color" | "size" | "variant" | "live" | "suffix" | "textColor", {}>;
83
+ /** React wrapper for `<lof-breadcrumbs>`. */
84
+ declare const LofBreadcrumbs: LofComponent<W.LofBreadcrumbs, "ariaLabel" | "items", {}>;
85
+ /** React wrapper for `<lof-button>`. */
86
+ declare const LofButton: LofComponent<W.LofButton, "ariaLabel" | "disabled" | "size" | "tone" | "loading" | "variant" | "badge" | "badgeDot" | "border" | "iconOnly", {}>;
87
+ /** React wrapper for `<lof-calendar>`. */
88
+ declare const LofCalendar: LofComponent<W.LofCalendar, "disabled" | "value" | "max" | "isDateDisabled" | "locale" | "min" | "weekStart", {
89
+ onLofChange: CustomEvent<{
90
+ value: string;
91
+ date: Date;
92
+ }>;
93
+ }>;
94
+ /** React wrapper for `<lof-card>`. */
95
+ declare const LofCard: LofComponent<W.LofCard, "description" | "type" | "flush" | "heading", {}>;
96
+ /** React wrapper for `<lof-card-media>`. */
97
+ declare const LofCardMedia: LofComponent<W.LofCardMedia, "title" | "imageAlt" | "imageSrc" | "subtitle", {}>;
98
+ /** React wrapper for `<lof-carousel>`. */
99
+ declare const LofCarousel: LofComponent<W.LofCarousel, "label" | "type" | "disabled" | "value" | "autoplay" | "gap" | "interval" | "loop" | "orientation" | "panels" | "pauseOnHover" | "showButtons" | "showDots", {
100
+ onLofChange: CustomEvent<{
101
+ value: number;
102
+ }>;
103
+ }>;
104
+ /** React wrapper for `<lof-checkbox>`. */
105
+ declare const LofCheckbox: LofComponent<W.LofCheckbox, "label" | "disabled" | "size" | "fieldAriaLabel" | "value" | "icon" | "alignment" | "checked" | "density" | "state" | "status" | "supportingtext" | "supportingText", {
106
+ onLofChange: CustomEvent<{
107
+ checked: boolean;
108
+ value: string;
109
+ }>;
110
+ }>;
111
+ /** React wrapper for `<lof-chip>`. */
112
+ declare const LofChip: LofComponent<W.LofChip, "label" | "size" | "tone" | "fieldAriaLabel" | "variant" | "border" | "avatar" | "draggableChip" | "leadingIcon" | "presentational" | "removable" | "removed" | "trailingIcon", {
113
+ onChipMove: CustomEvent<{
114
+ direction: number;
115
+ }>;
116
+ onRemoved: CustomEvent<undefined>;
117
+ }>;
118
+ /** React wrapper for `<lof-container>`. */
119
+ declare const LofContainer: LofComponent<W.LofContainer, "background" | "padding" | "shadow" | "surface", {}>;
120
+ /** React wrapper for `<lof-date-picker>`. */
121
+ declare const LofDatePicker: LofComponent<W.LofDatePicker, "label" | "error" | "disabled" | "open" | "size" | "clearable" | "errorMessage" | "fullWidth" | "helperText" | "name" | "placeholder" | "readonly" | "required" | "value" | "variant" | "max" | "isDateDisabled" | "locale" | "min" | "weekStart" | "closeOnSelect" | "displayFormat" | "formatDate" | "maxDate" | "minDate" | "showShortcuts", {
122
+ onLofBlur: CustomEvent<undefined>;
123
+ onLofChange: CustomEvent<{
124
+ value: string | null;
125
+ date: Date;
126
+ } | {
127
+ value: null;
128
+ date: null;
129
+ }>;
130
+ onLofOpenChange: CustomEvent<{
131
+ open: boolean;
132
+ }>;
133
+ }>;
134
+ /** React wrapper for `<lof-divider>`. */
135
+ declare const LofDivider: LofComponent<W.LofDivider, "orientation", {}>;
136
+ /** React wrapper for `<lof-drawer>`. */
137
+ declare const LofDrawer: LofComponent<W.LofDrawer, "draggable" | "title" | "description" | "open" | "dismissible" | "closeOnBackdrop" | "closeOnEscape" | "maxHeight" | "modal" | "showHandle" | "side" | "snapThreshold" | "width", {
138
+ onLofOpenChange: CustomEvent<{
139
+ open: boolean;
140
+ }>;
141
+ }>;
142
+ /** React wrapper for `<lof-drawer-footer>`. */
143
+ declare const LofDrawerFooter: LofComponent<W.LofDrawerFooter, never, {}>;
144
+ /** React wrapper for `<lof-empty-state>`. */
145
+ declare const LofEmptyState: LofComponent<W.LofEmptyState, "description" | "size" | "icon" | "heading" | "align" | "headingLevel", {}>;
146
+ /** React wrapper for `<lof-image-input>`. */
147
+ declare const LofImageInput: LofComponent<W.LofImageInput, "disabled" | "size" | "fieldAriaLabel" | "name" | "src" | "accept" | "maxSize" | "noRemove" | "shape", {
148
+ onLofChange: CustomEvent<W.ImageInputChangeDetail>;
149
+ onLofError: CustomEvent<{
150
+ reason: string;
151
+ file: File;
152
+ }>;
153
+ onLofRemove: CustomEvent<undefined>;
154
+ }>;
155
+ /** React wrapper for `<lof-kbd>`. */
156
+ declare const LofKbd: LofComponent<W.LofKbd, "size" | "variant" | "inset" | "keyName" | "pill" | "platform", {}>;
157
+ /** React wrapper for `<lof-kbd-group>`. */
158
+ declare const LofKbdGroup: LofComponent<W.LofKbdGroup, "size" | "items" | "variant" | "platform", {}>;
159
+ /** React wrapper for `<lof-layout>`. */
160
+ declare const LofLayout: LofComponent<W.LofLayout, "gap" | "columns" | "responsive", {}>;
161
+ /** React wrapper for `<lof-link>`. */
162
+ declare const LofLink: LofComponent<W.LofLink, "rel" | "disabled" | "size" | "tone" | "arrow" | "href" | "inherit" | "target" | "underline", {}>;
163
+ /** React wrapper for `<lof-menu>`. */
164
+ declare const LofMenu: LofComponent<W.LofMenu, "type" | "size" | "items" | "width", {
165
+ onLofCheck: CustomEvent<{
166
+ item: {
167
+ checked: boolean;
168
+ label: string;
169
+ active?: boolean;
170
+ disabled?: boolean;
171
+ submenu?: W.MenuItem[];
172
+ open?: boolean;
173
+ icon?: string;
174
+ };
175
+ checked: boolean;
176
+ }>;
177
+ onLofSelect: CustomEvent<{
178
+ item: W.MenuItem;
179
+ }>;
180
+ onLofSubmenuSelect: CustomEvent<{
181
+ parent: W.MenuItem;
182
+ sub: W.MenuItem | undefined;
183
+ }>;
184
+ }>;
185
+ /** React wrapper for `<lof-menu-item>`. */
186
+ declare const LofMenuItem: LofComponent<W.LofMenuItem, "label" | "disabled" | "value" | "icon", {}>;
187
+ /** React wrapper for `<lof-menubar>`. */
188
+ declare const LofMenubar: LofComponent<W.LofMenubar, "type" | "bindShortcuts", {
189
+ onLofMenubarChange: CustomEvent<W.MenubarChangeDetail>;
190
+ onLofMenubarSelect: CustomEvent<W.MenubarSelectDetail | {
191
+ label: string;
192
+ value: string | undefined;
193
+ shortcut: string | undefined;
194
+ }>;
195
+ }>;
196
+ /** React wrapper for `<lof-menubar-menu>`. */
197
+ declare const LofMenubarMenu: LofComponent<W.LofMenubarMenu, "label" | "disabled", {}>;
198
+ /** React wrapper for `<lof-modal>`. */
199
+ declare const LofModal: LofComponent<W.LofModal, "title" | "description" | "autoFocus" | "disabled" | "open" | "size" | "dismissible" | "loading" | "variant" | "subtitle" | "closeOnEscape" | "modal" | "side" | "breakpoint" | "closeOnBackdropClick" | "restoreFocus" | "scrollable" | "showCloseButton" | "zIndex", {
200
+ onLofOpenChange: CustomEvent<boolean>;
201
+ }>;
202
+ /** React wrapper for `<lof-nav>`. */
203
+ declare const LofNav: LofComponent<W.LofNav, "fieldAriaLabel" | "items" | "value" | "collapsed" | "indicator", {
204
+ onLofSelect: CustomEvent<W.NavSelectDetail>;
205
+ onLofToggle: CustomEvent<{
206
+ value: string;
207
+ open: boolean;
208
+ }>;
209
+ }>;
210
+ /** React wrapper for `<lof-otp>`. */
211
+ declare const LofOtp: LofComponent<W.LofOtp, "ariaLabel" | "inputMode" | "length" | "mask" | "pattern" | "type" | "invalid" | "disabled" | "size" | "name" | "placeholder" | "readonly" | "required" | "value" | "autocomplete" | "groupSize" | "inputmode" | "showSeparator", {
212
+ onLofChange: CustomEvent<{
213
+ value: string;
214
+ complete: boolean;
215
+ }>;
216
+ onLofComplete: CustomEvent<{
217
+ value: string;
218
+ }>;
219
+ }>;
220
+ /** React wrapper for `<lof-page-header>`. */
221
+ declare const LofPageHeader: LofComponent<W.LofPageHeader, "description" | "heading" | "headingLevel" | "divider" | "layout", {}>;
222
+ /** React wrapper for `<lof-pagination>`. */
223
+ declare const LofPagination: LofComponent<W.LofPagination, "ariaLabel" | "type" | "disabled" | "defaultPage" | "hrefTemplate" | "page" | "perPage" | "rowsPerPageLabel" | "rowsPerPageOptions" | "showLabel" | "showRowsPerPage" | "totalItems" | "totalPages", {
224
+ onLofChange: CustomEvent<{
225
+ page: number;
226
+ }>;
227
+ onLofPerPageChange: CustomEvent<{
228
+ perPage: number;
229
+ }>;
230
+ }>;
231
+ /** React wrapper for `<lof-popover>`. */
232
+ declare const LofPopover: LofComponent<W.LofPopover, "disabled" | "open" | "closeOnEscape" | "side" | "align" | "arrow" | "alignOffset" | "closeOnOutsideClick" | "defaultOpen" | "hasPopup" | "sideOffset" | "trapFocus", {
233
+ onLofOpenChange: CustomEvent<{
234
+ open: boolean;
235
+ }>;
236
+ }>;
237
+ /** React wrapper for `<lof-popover-content>`. */
238
+ declare const LofPopoverContent: LofComponent<W.LofPopoverContent, "ariaLabel" | "size", {}>;
239
+ /** React wrapper for `<lof-progress>`. */
240
+ declare const LofProgress: LofComponent<W.LofProgress, "label" | "value" | "mode", {}>;
241
+ /** React wrapper for `<lof-radio>`. */
242
+ declare const LofRadio: LofComponent<W.LofRadio, "error" | "disabled" | "size" | "errorMessage" | "fieldAriaLabel" | "name" | "value" | "orientation" | "alignment" | "density" | "options" | "selectedValue", {
243
+ onLofChange: CustomEvent<{
244
+ value: string;
245
+ checked: true;
246
+ }>;
247
+ }>;
248
+ /** React wrapper for `<lof-range-picker>`. */
249
+ declare const LofRangePicker: LofComponent<W.LofRangePicker, "disabled" | "open" | "size" | "clearable" | "fullWidth" | "placeholder" | "locale" | "weekStart" | "maxDate" | "minDate" | "maxHeight" | "width" | "mode" | "from" | "height" | "maxWidth" | "minHeight" | "minWidth" | "to" | "triggerVariant", {
250
+ onLofBlur: CustomEvent<undefined>;
251
+ onLofChange: CustomEvent<{
252
+ from: string;
253
+ to: string;
254
+ label: string;
255
+ }>;
256
+ onLofOpenChange: CustomEvent<{
257
+ open: true;
258
+ } | {
259
+ open: false;
260
+ }>;
261
+ }>;
262
+ /** React wrapper for `<lof-rating>`. */
263
+ declare const LofRating: LofComponent<W.LofRating, "disabled" | "size" | "fieldAriaLabel" | "name" | "readonly" | "value" | "max" | "showValue" | "step", {
264
+ onLofChange: CustomEvent<W.RatingChangeDetail>;
265
+ }>;
266
+ /** React wrapper for `<lof-resizable-group>`. */
267
+ declare const LofResizableGroup: LofComponent<W.LofResizableGroup, "direction", {
268
+ onLofResize: CustomEvent<{
269
+ direction: W.ResizableOrientation;
270
+ sizes: number[];
271
+ }>;
272
+ onLofResizeEnd: CustomEvent<{
273
+ direction: W.ResizableOrientation;
274
+ sizes: number[];
275
+ }>;
276
+ }>;
277
+ /** React wrapper for `<lof-resizable-handle>`. */
278
+ declare const LofResizableHandle: LofComponent<W.LofResizableHandle, "orientation", {}>;
279
+ /** React wrapper for `<lof-resizable-panel>`. */
280
+ declare const LofResizablePanel: LofComponent<W.LofResizablePanel, "maxSize" | "defaultSize" | "minSize" | "panelLabel", {}>;
281
+ /** React wrapper for `<lof-segmented-button>`. */
282
+ declare const LofSegmentedButton: LofComponent<W.LofSegmentedButton, "disabled" | "size" | "fieldAriaLabel" | "align" | "options" | "active", {
283
+ onChanged: CustomEvent<{
284
+ value: string;
285
+ }>;
286
+ onLofChange: CustomEvent<{
287
+ value: string;
288
+ }>;
289
+ }>;
290
+ /** React wrapper for `<lof-select>`. */
291
+ declare const LofSelect: LofComponent<W.LofSelect, "label" | "size" | "fieldAriaLabel" | "fieldAriaLabelledby" | "labelStyle" | "multiple" | "placeholder" | "selectAllLabel" | "selectedValues" | "border" | "state" | "supportingText" | "options" | "leftIcon" | "maxVisibleChips" | "noSearch" | "rightIcon" | "searchPlaceholder" | "selected" | "supportingIcon", {
292
+ onChanged: CustomEvent<{
293
+ value: string | string[];
294
+ }>;
295
+ onLofChange: CustomEvent<{
296
+ value: string | string[];
297
+ }>;
298
+ }>;
299
+ /** React wrapper for `<lof-signature-pad>`. */
300
+ declare const LofSignaturePad: LofComponent<W.LofSignaturePad, "label" | "error" | "disabled" | "errorMessage" | "fieldAriaLabel" | "helperText" | "name" | "placeholder" | "readonly" | "required" | "value" | "mode" | "disabledText" | "strokes" | "typedName", {
301
+ onLofBegin: CustomEvent<{}>;
302
+ onLofChange: CustomEvent<W.SignaturePadChangeDetail>;
303
+ onLofEnd: CustomEvent<{}>;
304
+ }>;
305
+ /** React wrapper for `<lof-skeleton>`. */
306
+ declare const LofSkeleton: LofComponent<W.LofSkeleton, "width" | "shape" | "height" | "animation" | "lines" | "loaded", {}>;
307
+ /** React wrapper for `<lof-slider>`. */
308
+ declare const LofSlider: LofComponent<W.LofSlider, "track" | "type" | "disabled" | "size" | "fieldAriaLabel" | "value" | "max" | "min" | "step" | "showBubble" | "showTickLabels" | "showTicks" | "valueEnd", {
309
+ onLofChange: CustomEvent<{
310
+ value: number;
311
+ valueEnd: number;
312
+ } | {
313
+ value: number;
314
+ }>;
315
+ }>;
316
+ /** React wrapper for `<lof-snackbar>`. */
317
+ declare const LofSnackbar: LofComponent<W.LofSnackbar, "type" | "tone" | "variant" | "lines" | "action" | "duration" | "iconClose" | "longerAction" | "message" | "show", {
318
+ onActionClick: CustomEvent<undefined>;
319
+ onClose: CustomEvent<undefined>;
320
+ }>;
321
+ /** React wrapper for `<lof-split-button>`. */
322
+ declare const LofSplitButton: LofComponent<W.LofSplitButton, "ariaLabel" | "label" | "disabled" | "open" | "size" | "tone" | "items" | "loading" | "variant" | "icon" | "iconOnly" | "menuLabel", {
323
+ onLofOpenChange: CustomEvent<{
324
+ open: boolean;
325
+ }>;
326
+ onLofSelect: CustomEvent<W.SplitButtonSelectDetail>;
327
+ }>;
328
+ /** React wrapper for `<lof-stat>`. */
329
+ declare const LofStat: LofComponent<W.LofStat, "label" | "change" | "appearance" | "size" | "value" | "changeLabel" | "trend", {}>;
330
+ /** React wrapper for `<lof-stepper>`. */
331
+ declare const LofStepper: LofComponent<W.LofStepper, "type" | "size" | "orientation" | "connector" | "labelPlacement" | "steps" | "textAlign", {
332
+ onLofStepChange: CustomEvent<{
333
+ index: number;
334
+ step: W.Step;
335
+ }>;
336
+ }>;
337
+ /** React wrapper for `<lof-switch>`. */
338
+ declare const LofSwitch: LofComponent<W.LofSwitch, "label" | "type" | "disabled" | "size" | "fieldAriaLabel" | "value" | "checked" | "labelPlacement", {
339
+ onLofChange: CustomEvent<{
340
+ checked: boolean;
341
+ value: string;
342
+ }>;
343
+ }>;
344
+ /** React wrapper for `<lof-tab>`. */
345
+ declare const LofTab: LofComponent<W.LofTab, "size" | "orientation" | "activeIndex" | "iconPlacement" | "tabs", {
346
+ onLofChange: CustomEvent<number>;
347
+ onLofTabChange: CustomEvent<number>;
348
+ }>;
349
+ /** React wrapper for `<lof-tab-item>`. */
350
+ declare const LofTabItem: LofComponent<W.LofTabItem, "label" | "disabled" | "value" | "badge" | "icon" | "badgeDot", {}>;
351
+ /** React wrapper for `<lof-table>`. */
352
+ declare const LofTable: LofComponent<W.LofTable, "appearance" | "fieldAriaLabel" | "loading" | "heading" | "density" | "columns" | "page" | "totalItems" | "selected" | "emptyText" | "grid" | "pageSize" | "pageSizeLabel" | "pageSizeOptions" | "pageSizeSuffix" | "rangeTemplate" | "rowKey" | "rows" | "selectable" | "serverSide" | "sortDirection" | "sortKey" | "stickyHeader", {
353
+ onLofPageChange: CustomEvent<W.TablePageDetail>;
354
+ onLofSelectionChange: CustomEvent<W.TableSelectionDetail>;
355
+ onLofSort: CustomEvent<W.TableSortDetail>;
356
+ }>;
357
+ /** React wrapper for `<lof-textfield>`. */
358
+ declare const LofTextfield: LofComponent<W.LofTextfield, "label" | "type" | "error" | "disabled" | "size" | "errorMessage" | "fieldAriaLabel" | "fieldAriaLabelledby" | "floatingLabel" | "fullWidth" | "helperText" | "labelStyle" | "name" | "placeholder" | "prefixIcon" | "readonly" | "required" | "value" | "variant" | "state" | "supportingText" | "leftIcon" | "rightIcon" | "rows" | "clickableRightIcon" | "helperIcon" | "maxLength" | "multiline" | "prefixIconAriaLabel" | "prefixStyle" | "prefixText" | "rightIconAriaLabel" | "suffixDivider" | "suffixText", {
359
+ onLofChange: CustomEvent<string>;
360
+ onLofRightIconClick: CustomEvent<undefined>;
361
+ }>;
362
+ /** React wrapper for `<lof-time-picker>`. */
363
+ declare const LofTimePicker: LofComponent<W.LofTimePicker, "label" | "error" | "invalid" | "disabled" | "open" | "size" | "clearable" | "errorMessage" | "fullWidth" | "helperText" | "name" | "placeholder" | "readonly" | "required" | "value" | "variant" | "format" | "maxTime" | "minTime" | "minuteStep" | "seconds", {
364
+ onLofBlur: CustomEvent<undefined>;
365
+ onLofChange: CustomEvent<{
366
+ value: string | null;
367
+ }>;
368
+ onLofFocus: CustomEvent<undefined>;
369
+ onLofOpenChange: CustomEvent<{
370
+ open: boolean;
371
+ }>;
372
+ }>;
373
+ /** React wrapper for `<lof-toast>`. */
374
+ declare const LofToast: LofComponent<W.LofToast, "type" | "size" | "dismissible" | "tone" | "duration" | "message" | "show" | "actionLabel" | "maxVisible" | "position", {
375
+ onAction: CustomEvent<undefined>;
376
+ onDismissed: CustomEvent<undefined>;
377
+ }>;
378
+ /** React wrapper for `<lof-tooltip>`. */
379
+ declare const LofTooltip: LofComponent<W.LofTooltip, "text" | "type" | "tone" | "position" | "showTail", {}>;
380
+ /** React wrapper for `<lof-tree>`. */
381
+ declare const LofTree: LofComponent<W.LofTree, "fieldAriaLabel" | "items" | "selectedValues" | "selected" | "expandedValues" | "selection" | "showGuides", {
382
+ onLofChange: CustomEvent<{
383
+ value: string[];
384
+ } | {
385
+ value: string;
386
+ }>;
387
+ onLofExpandedChange: CustomEvent<{
388
+ value: string;
389
+ expanded: boolean;
390
+ }>;
391
+ onLofLoadChildren: CustomEvent<{
392
+ value: string;
393
+ }>;
394
+ }>;
395
+ /** React wrapper for `<lof-upload>`. */
396
+ declare const LofUpload: LofComponent<W.LofUpload, "disabled" | "multiple" | "accept" | "maxSize" | "browseLabel" | "concurrency" | "delayThreshold" | "dropzoneTitle" | "files" | "hint" | "maxFiles" | "uploader", {
397
+ onLofCancel: CustomEvent<undefined>;
398
+ onLofChange: CustomEvent<{
399
+ files: W.UploadFile[];
400
+ }>;
401
+ onLofComplete: CustomEvent<{
402
+ succeeded: W.UploadFile[];
403
+ failed: W.UploadFile[];
404
+ }>;
405
+ onLofFileComplete: CustomEvent<{
406
+ id: string;
407
+ file: File;
408
+ }>;
409
+ onLofFileError: CustomEvent<{
410
+ id: string;
411
+ file: File;
412
+ error: string;
413
+ }>;
414
+ onLofFileReplaced: CustomEvent<W.FileReplacedDetail>;
415
+ onLofFilesAdded: CustomEvent<{
416
+ added: W.UploadFile[];
417
+ rejected: W.UploadRejection[];
418
+ }>;
419
+ onLofInvalid: CustomEvent<{
420
+ rejected: W.UploadRejection[];
421
+ }>;
422
+ onLofProgress: CustomEvent<{
423
+ id: string;
424
+ progress: number;
425
+ loaded: number;
426
+ total: number;
427
+ }>;
428
+ onLofRemove: CustomEvent<{
429
+ id: string;
430
+ file: File | undefined;
431
+ }>;
432
+ onLofRetry: CustomEvent<{
433
+ files: W.UploadFile[];
434
+ }>;
435
+ onLofState: CustomEvent<W.UploadState>;
436
+ onLofUpload: CustomEvent<{
437
+ files: W.UploadFile[];
438
+ }>;
439
+ onLofUploadComplete: CustomEvent<W.UploadCompleteDetail>;
440
+ }>;
441
+ /** React wrapper for `<lof-upload-actions>`. */
442
+ declare const LofUploadActions: LofComponent<W.LofUploadActions, "cancelLabel" | "for" | "noCancel", {
443
+ onLofCancel: CustomEvent<undefined>;
444
+ }>;
445
+
446
+ /** Every tag these wrappers render. */
447
+ declare const WRAPPED_TAGS: readonly ["lof-accordion", "lof-alert", "lof-autocomplete", "lof-avatar", "lof-avatar-group", "lof-badge", "lof-breadcrumbs", "lof-button", "lof-calendar", "lof-card", "lof-card-media", "lof-carousel", "lof-checkbox", "lof-chip", "lof-container", "lof-date-picker", "lof-divider", "lof-drawer", "lof-drawer-footer", "lof-empty-state", "lof-image-input", "lof-kbd", "lof-kbd-group", "lof-layout", "lof-link", "lof-menu", "lof-menu-item", "lof-menubar", "lof-menubar-menu", "lof-modal", "lof-nav", "lof-otp", "lof-page-header", "lof-pagination", "lof-popover", "lof-popover-content", "lof-progress", "lof-radio", "lof-range-picker", "lof-rating", "lof-resizable-group", "lof-resizable-handle", "lof-resizable-panel", "lof-segmented-button", "lof-select", "lof-signature-pad", "lof-skeleton", "lof-slider", "lof-snackbar", "lof-split-button", "lof-stat", "lof-stepper", "lof-switch", "lof-tab", "lof-tab-item", "lof-table", "lof-textfield", "lof-time-picker", "lof-toast", "lof-tooltip", "lof-tree", "lof-upload", "lof-upload-actions"];
448
+
449
+ /**
450
+ * Registers every lof-* element (and lof-icon) by loading @lofid/web.
451
+ * Safe to call from anywhere and any number of times; it does nothing on the
452
+ * server. Bundled SPAs can import "@lofid/web" at their entry instead.
453
+ */
454
+ declare function defineElements(): Promise<void>;
455
+
456
+ export { type AttributeSpec, type EventHandlers, LofAccordion, LofAlert, LofAutocomplete, LofAvatar, LofAvatarGroup, LofBadge, LofBreadcrumbs, LofButton, LofCalendar, LofCard, LofCardMedia, LofCarousel, LofCheckbox, LofChip, type LofComponent, LofContainer, LofDatePicker, LofDivider, LofDrawer, LofDrawerFooter, LofEmptyState, LofImageInput, LofKbd, LofKbdGroup, LofLayout, LofLink, LofMenu, LofMenuItem, LofMenubar, LofMenubarMenu, LofModal, LofNav, LofOtp, LofPageHeader, LofPagination, LofPopover, LofPopoverContent, LofProgress, type LofProps, LofRadio, LofRangePicker, LofRating, LofResizableGroup, LofResizableHandle, LofResizablePanel, LofSegmentedButton, LofSelect, LofSignaturePad, LofSkeleton, LofSlider, LofSnackbar, LofSplitButton, LofStat, LofStepper, LofSwitch, LofTab, LofTabItem, LofTable, LofTextfield, LofTimePicker, LofToast, LofTooltip, LofTree, LofUpload, LofUploadActions, WRAPPED_TAGS, createComponent, defineElements };