@m3e/react 2.0.2 → 2.0.4
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 +2 -0
- package/dist/all.js +13 -45
- package/dist/all.js.map +1 -1
- package/dist/all.min.js +2 -2
- package/dist/all.min.js.map +1 -1
- package/dist/app-bar.js +2 -34
- package/dist/app-bar.js.map +1 -1
- package/dist/app-bar.min.js +2 -2
- package/dist/app-bar.min.js.map +1 -1
- package/dist/autocomplete.js +2 -34
- package/dist/autocomplete.js.map +1 -1
- package/dist/autocomplete.min.js +2 -2
- package/dist/autocomplete.min.js.map +1 -1
- package/dist/avatar.js +2 -34
- package/dist/avatar.js.map +1 -1
- package/dist/avatar.min.js +2 -2
- package/dist/avatar.min.js.map +1 -1
- package/dist/badge.js +2 -34
- package/dist/badge.js.map +1 -1
- package/dist/badge.min.js +2 -2
- package/dist/badge.min.js.map +1 -1
- package/dist/bottom-sheet.js +1 -33
- package/dist/bottom-sheet.js.map +1 -1
- package/dist/bottom-sheet.min.js +2 -2
- package/dist/bottom-sheet.min.js.map +1 -1
- package/dist/button-group.js +2 -34
- package/dist/button-group.js.map +1 -1
- package/dist/button-group.min.js +2 -2
- package/dist/button-group.min.js.map +1 -1
- package/dist/button.js +2 -34
- package/dist/button.js.map +1 -1
- package/dist/button.min.js +2 -2
- package/dist/button.min.js.map +1 -1
- package/dist/card.js +2 -34
- package/dist/card.js.map +1 -1
- package/dist/card.min.js +2 -2
- package/dist/card.min.js.map +1 -1
- package/dist/checkbox.js +2 -34
- package/dist/checkbox.js.map +1 -1
- package/dist/checkbox.min.js +2 -2
- package/dist/checkbox.min.js.map +1 -1
- package/dist/chips.js +1 -33
- package/dist/chips.js.map +1 -1
- package/dist/chips.min.js +2 -2
- package/dist/chips.min.js.map +1 -1
- package/dist/core.js +1 -33
- package/dist/core.js.map +1 -1
- package/dist/core.min.js +2 -2
- package/dist/core.min.js.map +1 -1
- package/dist/dialog.js +2 -34
- package/dist/dialog.js.map +1 -1
- package/dist/dialog.min.js +2 -2
- package/dist/dialog.min.js.map +1 -1
- package/dist/divider.js +2 -34
- package/dist/divider.js.map +1 -1
- package/dist/divider.min.js +2 -2
- package/dist/divider.min.js.map +1 -1
- package/dist/drawer-container.js +2 -34
- package/dist/drawer-container.js.map +1 -1
- package/dist/drawer-container.min.js +2 -2
- package/dist/drawer-container.min.js.map +1 -1
- package/dist/expansion-panel.js +1 -33
- package/dist/expansion-panel.js.map +1 -1
- package/dist/expansion-panel.min.js +2 -2
- package/dist/expansion-panel.min.js.map +1 -1
- package/dist/fab-menu.js +1 -33
- package/dist/fab-menu.js.map +1 -1
- package/dist/fab-menu.min.js +2 -2
- package/dist/fab-menu.min.js.map +1 -1
- package/dist/fab.js +1 -33
- package/dist/fab.js.map +1 -1
- package/dist/fab.min.js +2 -2
- package/dist/fab.min.js.map +1 -1
- package/dist/form-field.js +1 -33
- package/dist/form-field.js.map +1 -1
- package/dist/form-field.min.js +2 -2
- package/dist/form-field.min.js.map +1 -1
- package/dist/heading.js +1 -33
- package/dist/heading.js.map +1 -1
- package/dist/heading.min.js +2 -2
- package/dist/heading.min.js.map +1 -1
- package/dist/icon-button.js +1 -33
- package/dist/icon-button.js.map +1 -1
- package/dist/icon-button.min.js +2 -2
- package/dist/icon-button.min.js.map +1 -1
- package/dist/icon.js +1 -33
- package/dist/icon.js.map +1 -1
- package/dist/icon.min.js +2 -2
- package/dist/icon.min.js.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/list.js +1 -33
- package/dist/list.js.map +1 -1
- package/dist/list.min.js +2 -2
- package/dist/list.min.js.map +1 -1
- package/dist/loading-indicator.js +1 -33
- package/dist/loading-indicator.js.map +1 -1
- package/dist/loading-indicator.min.js +2 -2
- package/dist/loading-indicator.min.js.map +1 -1
- package/dist/menu.js +1 -33
- package/dist/menu.js.map +1 -1
- package/dist/menu.min.js +2 -2
- package/dist/menu.min.js.map +1 -1
- package/dist/nav-bar.js +1 -33
- package/dist/nav-bar.js.map +1 -1
- package/dist/nav-bar.min.js +2 -2
- package/dist/nav-bar.min.js.map +1 -1
- package/dist/nav-menu.js +1 -33
- package/dist/nav-menu.js.map +1 -1
- package/dist/nav-menu.min.js +2 -2
- package/dist/nav-menu.min.js.map +1 -1
- package/dist/nav-rail.js +1 -33
- package/dist/nav-rail.js.map +1 -1
- package/dist/nav-rail.min.js +2 -2
- package/dist/nav-rail.min.js.map +1 -1
- package/dist/option.js +1 -33
- package/dist/option.js.map +1 -1
- package/dist/option.min.js +2 -2
- package/dist/option.min.js.map +1 -1
- package/dist/paginator.js +0 -1
- package/dist/paginator.js.map +1 -1
- package/dist/paginator.min.js +2 -2
- package/dist/paginator.min.js.map +1 -1
- package/dist/progress-indicator.js +1 -33
- package/dist/progress-indicator.js.map +1 -1
- package/dist/progress-indicator.min.js +2 -2
- package/dist/progress-indicator.min.js.map +1 -1
- package/dist/radio-group.js +1 -33
- package/dist/radio-group.js.map +1 -1
- package/dist/radio-group.min.js +2 -2
- package/dist/radio-group.min.js.map +1 -1
- package/dist/segmented-button.js +1 -33
- package/dist/segmented-button.js.map +1 -1
- package/dist/segmented-button.min.js +2 -2
- package/dist/segmented-button.min.js.map +1 -1
- package/dist/select.js +1 -33
- package/dist/select.js.map +1 -1
- package/dist/select.min.js +2 -2
- package/dist/select.min.js.map +1 -1
- package/dist/shape.js +1 -33
- package/dist/shape.js.map +1 -1
- package/dist/shape.min.js +2 -2
- package/dist/shape.min.js.map +1 -1
- package/dist/slide-group.js +1 -33
- package/dist/slide-group.js.map +1 -1
- package/dist/slide-group.min.js +2 -2
- package/dist/slide-group.min.js.map +1 -1
- package/dist/slider.js +1 -33
- package/dist/slider.js.map +1 -1
- package/dist/slider.min.js +2 -2
- package/dist/slider.min.js.map +1 -1
- package/dist/snackbar.js +0 -1
- package/dist/snackbar.js.map +1 -1
- package/dist/snackbar.min.js +2 -2
- package/dist/split-button.js +1 -33
- package/dist/split-button.js.map +1 -1
- package/dist/split-button.min.js +2 -2
- package/dist/split-button.min.js.map +1 -1
- package/dist/src/app-bar/AppBar.d.ts +1 -1
- package/dist/src/autocomplete/Autocomplete.d.ts +1 -1
- package/dist/src/avatar/Avatar.d.ts +1 -1
- package/dist/src/badge/Badge.d.ts +1 -1
- package/dist/src/button/Button.d.ts +1 -1
- package/dist/src/button-group/ButtonGroup.d.ts +1 -1
- package/dist/src/card/Card.d.ts +1 -1
- package/dist/src/checkbox/Checkbox.d.ts +1 -1
- package/dist/src/dialog/Dialog.d.ts +1 -1
- package/dist/src/divider/Divider.d.ts +1 -1
- package/dist/src/drawer-container/DrawerContainer.d.ts +1 -1
- package/dist/stepper.js +1 -33
- package/dist/stepper.js.map +1 -1
- package/dist/stepper.min.js +2 -2
- package/dist/stepper.min.js.map +1 -1
- package/dist/switch.js +1 -33
- package/dist/switch.js.map +1 -1
- package/dist/switch.min.js +2 -2
- package/dist/switch.min.js.map +1 -1
- package/dist/tabs.js +1 -33
- package/dist/tabs.js.map +1 -1
- package/dist/tabs.min.js +2 -2
- package/dist/tabs.min.js.map +1 -1
- package/dist/textarea-autosize.js +1 -33
- package/dist/textarea-autosize.js.map +1 -1
- package/dist/textarea-autosize.min.js +2 -2
- package/dist/textarea-autosize.min.js.map +1 -1
- package/dist/theme.js +1 -33
- package/dist/theme.js.map +1 -1
- package/dist/theme.min.js +2 -2
- package/dist/theme.min.js.map +1 -1
- package/dist/toc.js +1 -33
- package/dist/toc.js.map +1 -1
- package/dist/toc.min.js +2 -2
- package/dist/toc.min.js.map +1 -1
- package/dist/toolbar.js +1 -33
- package/dist/toolbar.js.map +1 -1
- package/dist/toolbar.min.js +2 -2
- package/dist/toolbar.min.js.map +1 -1
- package/dist/tooltip.js +1 -33
- package/dist/tooltip.js.map +1 -1
- package/dist/tooltip.min.js +2 -2
- package/dist/tooltip.min.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
The `@m3e/react` package provides idiomatic, typed React bindings for M3E Web Components, exposing their properties, attributes, and native DOM events through a familiar React interface with full ref forwarding and client‑only compatibility.
|
|
4
4
|
|
|
5
|
+
> **Note:** The React bindings are client‑only. In Next.js, you **must** use them inside a `"use client"` boundary.
|
|
6
|
+
|
|
5
7
|
## 🧪 Example
|
|
6
8
|
|
|
7
9
|
The following example demonstrates how to use the `M3eButton` React binding from `@m3e/react/button`.
|
package/dist/all.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use client";
|
|
2
1
|
/**
|
|
3
2
|
* @license MIT
|
|
4
3
|
* Copyright (c) 2025 matraic
|
|
@@ -6,7 +5,7 @@
|
|
|
6
5
|
*/
|
|
7
6
|
|
|
8
7
|
import React from 'react';
|
|
9
|
-
import { createComponent
|
|
8
|
+
import { createComponent } from '@lit/react';
|
|
10
9
|
import { M3eAppBarElement } from '@m3e/web/app-bar';
|
|
11
10
|
import { M3eAutocompleteElement } from '@m3e/web/autocomplete';
|
|
12
11
|
import { M3eAvatarElement } from '@m3e/web/avatar';
|
|
@@ -54,37 +53,6 @@ import { M3eTocElement } from '@m3e/web/toc';
|
|
|
54
53
|
import { M3eToolbarElement } from '@m3e/web/toolbar';
|
|
55
54
|
import { M3eRichTooltipElement, M3eRichTooltipActionElement, M3eTooltipElement } from '@m3e/web/tooltip';
|
|
56
55
|
|
|
57
|
-
/**
|
|
58
|
-
* Creates an SSR-safe React component for a custom element. Properties are distinguished
|
|
59
|
-
* from attributes automatically, and events can be configured so they are added
|
|
60
|
-
* to the custom element as event listeners.
|
|
61
|
-
*
|
|
62
|
-
* @param options An options bag containing the parameters needed to generate a
|
|
63
|
-
* wrapped web component.
|
|
64
|
-
*
|
|
65
|
-
* @param options.react The React module, typically imported from the `react`
|
|
66
|
-
* npm package.
|
|
67
|
-
* @param options.tagName The custom element tag name registered via
|
|
68
|
-
* `customElements.define`.
|
|
69
|
-
* @param options.elementClass The custom element class registered via
|
|
70
|
-
* `customElements.define`.
|
|
71
|
-
* @param options.events An object listing events to which the component can
|
|
72
|
-
* listen. The object keys are the event property names passed in via React
|
|
73
|
-
* props and the object values are the names of the corresponding events
|
|
74
|
-
* generated by the custom element. For example, given `{onactivate:
|
|
75
|
-
* 'activate'}` an event function may be passed via the component's `onactivate`
|
|
76
|
-
* prop and will be called when the custom element fires its `activate` event.
|
|
77
|
-
* @param options.displayName A React component display name, used in debugging
|
|
78
|
-
* messages. Default value is inferred from the name of custom element class
|
|
79
|
-
* registered via `customElements.define`.
|
|
80
|
-
*/
|
|
81
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
82
|
-
function createComponent({ react, tagName, elementClass, events, displayName, }) {
|
|
83
|
-
return typeof window !== "undefined"
|
|
84
|
-
? createComponent$1({ react, tagName, elementClass, events, displayName })
|
|
85
|
-
: null;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
56
|
/**
|
|
89
57
|
* React binding for the `m3e-app-bar` Web Component from `@m3e/web/app-bar`.
|
|
90
58
|
*
|
|
@@ -95,7 +63,7 @@ function createComponent({ react, tagName, elementClass, events, displayName, })
|
|
|
95
63
|
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
96
64
|
* underlying `<m3e-app-bar>` instance for imperative access.
|
|
97
65
|
*
|
|
98
|
-
* See the `m3e-app-bar` documentation
|
|
66
|
+
* See the `m3e-app-bar` documentation for full details on behavior,
|
|
99
67
|
* styling, accessibility, and supported events.
|
|
100
68
|
*/
|
|
101
69
|
const M3eAppBar = createComponent({
|
|
@@ -114,7 +82,7 @@ const M3eAppBar = createComponent({
|
|
|
114
82
|
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
115
83
|
* underlying `<m3e-autocomplete>` instance for imperative access.
|
|
116
84
|
*
|
|
117
|
-
* See the `m3e-autocomplete` documentation
|
|
85
|
+
* See the `m3e-autocomplete` documentation for full details on behavior,
|
|
118
86
|
* styling, accessibility, and supported events.
|
|
119
87
|
*/
|
|
120
88
|
const M3eAutocomplete = createComponent({
|
|
@@ -136,7 +104,7 @@ const M3eAutocomplete = createComponent({
|
|
|
136
104
|
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
137
105
|
* underlying `<m3e-avatar>` instance for imperative access.
|
|
138
106
|
*
|
|
139
|
-
* See the `m3e-avatar` documentation
|
|
107
|
+
* See the `m3e-avatar` documentation for full details on behavior,
|
|
140
108
|
* styling, accessibility, and supported events.
|
|
141
109
|
*/
|
|
142
110
|
const M3eAvatar = createComponent({
|
|
@@ -155,7 +123,7 @@ const M3eAvatar = createComponent({
|
|
|
155
123
|
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
156
124
|
* underlying `<m3e-badge>` instance for imperative access.
|
|
157
125
|
*
|
|
158
|
-
* See the `m3e-badge` documentation
|
|
126
|
+
* See the `m3e-badge` documentation for full details on behavior,
|
|
159
127
|
* styling, accessibility, and supported events.
|
|
160
128
|
*/
|
|
161
129
|
const M3eBadge = createComponent({
|
|
@@ -238,7 +206,7 @@ const M3eBottomSheetTrigger = createComponent({
|
|
|
238
206
|
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
239
207
|
* underlying `<m3e-button>` instance for imperative access.
|
|
240
208
|
*
|
|
241
|
-
* See the `m3e-button` documentation
|
|
209
|
+
* See the `m3e-button` documentation for full details on behavior,
|
|
242
210
|
* styling, accessibility, and supported events.
|
|
243
211
|
*/
|
|
244
212
|
const M3eButton = createComponent({
|
|
@@ -262,7 +230,7 @@ const M3eButton = createComponent({
|
|
|
262
230
|
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
263
231
|
* underlying `<m3e-button-group>` instance for imperative access.
|
|
264
232
|
*
|
|
265
|
-
* See the `m3e-button-group` documentation
|
|
233
|
+
* See the `m3e-button-group` documentation for full details on behavior,
|
|
266
234
|
* styling, accessibility, and supported events.
|
|
267
235
|
*/
|
|
268
236
|
const M3eButtonGroup = createComponent({
|
|
@@ -281,7 +249,7 @@ const M3eButtonGroup = createComponent({
|
|
|
281
249
|
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
282
250
|
* underlying `<m3e-card>` instance for imperative access.
|
|
283
251
|
*
|
|
284
|
-
* See the `m3e-card` documentation
|
|
252
|
+
* See the `m3e-card` documentation for full details on behavior,
|
|
285
253
|
* styling, accessibility, and supported events.
|
|
286
254
|
*/
|
|
287
255
|
const M3eCard = createComponent({
|
|
@@ -303,7 +271,7 @@ const M3eCard = createComponent({
|
|
|
303
271
|
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
304
272
|
* underlying `<m3e-checkbox>` instance for imperative access.
|
|
305
273
|
*
|
|
306
|
-
* See the `m3e-checkbox` documentation
|
|
274
|
+
* See the `m3e-checkbox` documentation for full details on behavior,
|
|
307
275
|
* styling, accessibility, and supported events.
|
|
308
276
|
*/
|
|
309
277
|
const M3eCheckbox = createComponent({
|
|
@@ -717,7 +685,7 @@ const M3eTextOverflow = createComponent({
|
|
|
717
685
|
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
718
686
|
* underlying `<m3e-dialog>` instance for imperative access.
|
|
719
687
|
*
|
|
720
|
-
* See the `m3e-dialog` documentation
|
|
688
|
+
* See the `m3e-dialog` documentation for full details on behavior,
|
|
721
689
|
* styling, accessibility, and supported events.
|
|
722
690
|
*/
|
|
723
691
|
const M3eDialog = createComponent({
|
|
@@ -781,7 +749,7 @@ const M3eDialogTrigger = createComponent({
|
|
|
781
749
|
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
782
750
|
* underlying `<m3e-divider>` instance for imperative access.
|
|
783
751
|
*
|
|
784
|
-
* See the `m3e-divider` documentation
|
|
752
|
+
* See the `m3e-divider` documentation for full details on behavior,
|
|
785
753
|
* styling, accessibility, and supported events.
|
|
786
754
|
*/
|
|
787
755
|
const M3eDivider = createComponent({
|
|
@@ -800,7 +768,7 @@ const M3eDivider = createComponent({
|
|
|
800
768
|
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
801
769
|
* underlying `<m3e-drawer-container>` instance for imperative access.
|
|
802
770
|
*
|
|
803
|
-
* See the `m3e-drawer-container` documentation
|
|
771
|
+
* See the `m3e-drawer-container` documentation for full details on behavior,
|
|
804
772
|
* styling, accessibility, and supported events.
|
|
805
773
|
*/
|
|
806
774
|
const M3eDrawerContainer = createComponent({
|
|
@@ -1541,7 +1509,7 @@ const M3eOptGroup = createComponent({
|
|
|
1541
1509
|
* See the `m3e-paginator` documentation for full details on behavior, styling,
|
|
1542
1510
|
* accessibility, and supported events.
|
|
1543
1511
|
*/
|
|
1544
|
-
const M3ePaginator = createComponent
|
|
1512
|
+
const M3ePaginator = createComponent({
|
|
1545
1513
|
tagName: "m3e-paginator",
|
|
1546
1514
|
elementClass: M3ePaginatorElement,
|
|
1547
1515
|
react: React,
|