@m3e/react 2.0.2 → 2.0.3

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 (202) hide show
  1. package/README.md +4 -0
  2. package/dist/all.js +13 -45
  3. package/dist/all.js.map +1 -1
  4. package/dist/all.min.js +2 -2
  5. package/dist/all.min.js.map +1 -1
  6. package/dist/app-bar.js +2 -34
  7. package/dist/app-bar.js.map +1 -1
  8. package/dist/app-bar.min.js +2 -2
  9. package/dist/app-bar.min.js.map +1 -1
  10. package/dist/autocomplete.js +2 -34
  11. package/dist/autocomplete.js.map +1 -1
  12. package/dist/autocomplete.min.js +2 -2
  13. package/dist/autocomplete.min.js.map +1 -1
  14. package/dist/avatar.js +2 -34
  15. package/dist/avatar.js.map +1 -1
  16. package/dist/avatar.min.js +2 -2
  17. package/dist/avatar.min.js.map +1 -1
  18. package/dist/badge.js +2 -34
  19. package/dist/badge.js.map +1 -1
  20. package/dist/badge.min.js +2 -2
  21. package/dist/badge.min.js.map +1 -1
  22. package/dist/bottom-sheet.js +1 -33
  23. package/dist/bottom-sheet.js.map +1 -1
  24. package/dist/bottom-sheet.min.js +2 -2
  25. package/dist/bottom-sheet.min.js.map +1 -1
  26. package/dist/button-group.js +2 -34
  27. package/dist/button-group.js.map +1 -1
  28. package/dist/button-group.min.js +2 -2
  29. package/dist/button-group.min.js.map +1 -1
  30. package/dist/button.js +2 -34
  31. package/dist/button.js.map +1 -1
  32. package/dist/button.min.js +2 -2
  33. package/dist/button.min.js.map +1 -1
  34. package/dist/card.js +2 -34
  35. package/dist/card.js.map +1 -1
  36. package/dist/card.min.js +2 -2
  37. package/dist/card.min.js.map +1 -1
  38. package/dist/checkbox.js +2 -34
  39. package/dist/checkbox.js.map +1 -1
  40. package/dist/checkbox.min.js +2 -2
  41. package/dist/checkbox.min.js.map +1 -1
  42. package/dist/chips.js +1 -33
  43. package/dist/chips.js.map +1 -1
  44. package/dist/chips.min.js +2 -2
  45. package/dist/chips.min.js.map +1 -1
  46. package/dist/core.js +1 -33
  47. package/dist/core.js.map +1 -1
  48. package/dist/core.min.js +2 -2
  49. package/dist/core.min.js.map +1 -1
  50. package/dist/dialog.js +2 -34
  51. package/dist/dialog.js.map +1 -1
  52. package/dist/dialog.min.js +2 -2
  53. package/dist/dialog.min.js.map +1 -1
  54. package/dist/divider.js +2 -34
  55. package/dist/divider.js.map +1 -1
  56. package/dist/divider.min.js +2 -2
  57. package/dist/divider.min.js.map +1 -1
  58. package/dist/drawer-container.js +2 -34
  59. package/dist/drawer-container.js.map +1 -1
  60. package/dist/drawer-container.min.js +2 -2
  61. package/dist/drawer-container.min.js.map +1 -1
  62. package/dist/expansion-panel.js +1 -33
  63. package/dist/expansion-panel.js.map +1 -1
  64. package/dist/expansion-panel.min.js +2 -2
  65. package/dist/expansion-panel.min.js.map +1 -1
  66. package/dist/fab-menu.js +1 -33
  67. package/dist/fab-menu.js.map +1 -1
  68. package/dist/fab-menu.min.js +2 -2
  69. package/dist/fab-menu.min.js.map +1 -1
  70. package/dist/fab.js +1 -33
  71. package/dist/fab.js.map +1 -1
  72. package/dist/fab.min.js +2 -2
  73. package/dist/fab.min.js.map +1 -1
  74. package/dist/form-field.js +1 -33
  75. package/dist/form-field.js.map +1 -1
  76. package/dist/form-field.min.js +2 -2
  77. package/dist/form-field.min.js.map +1 -1
  78. package/dist/heading.js +1 -33
  79. package/dist/heading.js.map +1 -1
  80. package/dist/heading.min.js +2 -2
  81. package/dist/heading.min.js.map +1 -1
  82. package/dist/icon-button.js +1 -33
  83. package/dist/icon-button.js.map +1 -1
  84. package/dist/icon-button.min.js +2 -2
  85. package/dist/icon-button.min.js.map +1 -1
  86. package/dist/icon.js +1 -33
  87. package/dist/icon.js.map +1 -1
  88. package/dist/icon.min.js +2 -2
  89. package/dist/icon.min.js.map +1 -1
  90. package/dist/index.js +0 -1
  91. package/dist/index.js.map +1 -1
  92. package/dist/list.js +1 -33
  93. package/dist/list.js.map +1 -1
  94. package/dist/list.min.js +2 -2
  95. package/dist/list.min.js.map +1 -1
  96. package/dist/loading-indicator.js +1 -33
  97. package/dist/loading-indicator.js.map +1 -1
  98. package/dist/loading-indicator.min.js +2 -2
  99. package/dist/loading-indicator.min.js.map +1 -1
  100. package/dist/menu.js +1 -33
  101. package/dist/menu.js.map +1 -1
  102. package/dist/menu.min.js +2 -2
  103. package/dist/menu.min.js.map +1 -1
  104. package/dist/nav-bar.js +1 -33
  105. package/dist/nav-bar.js.map +1 -1
  106. package/dist/nav-bar.min.js +2 -2
  107. package/dist/nav-bar.min.js.map +1 -1
  108. package/dist/nav-menu.js +1 -33
  109. package/dist/nav-menu.js.map +1 -1
  110. package/dist/nav-menu.min.js +2 -2
  111. package/dist/nav-menu.min.js.map +1 -1
  112. package/dist/nav-rail.js +1 -33
  113. package/dist/nav-rail.js.map +1 -1
  114. package/dist/nav-rail.min.js +2 -2
  115. package/dist/nav-rail.min.js.map +1 -1
  116. package/dist/option.js +1 -33
  117. package/dist/option.js.map +1 -1
  118. package/dist/option.min.js +2 -2
  119. package/dist/option.min.js.map +1 -1
  120. package/dist/paginator.js +0 -1
  121. package/dist/paginator.js.map +1 -1
  122. package/dist/paginator.min.js +2 -2
  123. package/dist/paginator.min.js.map +1 -1
  124. package/dist/progress-indicator.js +1 -33
  125. package/dist/progress-indicator.js.map +1 -1
  126. package/dist/progress-indicator.min.js +2 -2
  127. package/dist/progress-indicator.min.js.map +1 -1
  128. package/dist/radio-group.js +1 -33
  129. package/dist/radio-group.js.map +1 -1
  130. package/dist/radio-group.min.js +2 -2
  131. package/dist/radio-group.min.js.map +1 -1
  132. package/dist/segmented-button.js +1 -33
  133. package/dist/segmented-button.js.map +1 -1
  134. package/dist/segmented-button.min.js +2 -2
  135. package/dist/segmented-button.min.js.map +1 -1
  136. package/dist/select.js +1 -33
  137. package/dist/select.js.map +1 -1
  138. package/dist/select.min.js +2 -2
  139. package/dist/select.min.js.map +1 -1
  140. package/dist/shape.js +1 -33
  141. package/dist/shape.js.map +1 -1
  142. package/dist/shape.min.js +2 -2
  143. package/dist/shape.min.js.map +1 -1
  144. package/dist/slide-group.js +1 -33
  145. package/dist/slide-group.js.map +1 -1
  146. package/dist/slide-group.min.js +2 -2
  147. package/dist/slide-group.min.js.map +1 -1
  148. package/dist/slider.js +1 -33
  149. package/dist/slider.js.map +1 -1
  150. package/dist/slider.min.js +2 -2
  151. package/dist/slider.min.js.map +1 -1
  152. package/dist/snackbar.js +0 -1
  153. package/dist/snackbar.js.map +1 -1
  154. package/dist/snackbar.min.js +2 -2
  155. package/dist/split-button.js +1 -33
  156. package/dist/split-button.js.map +1 -1
  157. package/dist/split-button.min.js +2 -2
  158. package/dist/split-button.min.js.map +1 -1
  159. package/dist/src/app-bar/AppBar.d.ts +1 -1
  160. package/dist/src/autocomplete/Autocomplete.d.ts +1 -1
  161. package/dist/src/avatar/Avatar.d.ts +1 -1
  162. package/dist/src/badge/Badge.d.ts +1 -1
  163. package/dist/src/button/Button.d.ts +1 -1
  164. package/dist/src/button-group/ButtonGroup.d.ts +1 -1
  165. package/dist/src/card/Card.d.ts +1 -1
  166. package/dist/src/checkbox/Checkbox.d.ts +1 -1
  167. package/dist/src/dialog/Dialog.d.ts +1 -1
  168. package/dist/src/divider/Divider.d.ts +1 -1
  169. package/dist/src/drawer-container/DrawerContainer.d.ts +1 -1
  170. package/dist/stepper.js +1 -33
  171. package/dist/stepper.js.map +1 -1
  172. package/dist/stepper.min.js +2 -2
  173. package/dist/stepper.min.js.map +1 -1
  174. package/dist/switch.js +1 -33
  175. package/dist/switch.js.map +1 -1
  176. package/dist/switch.min.js +2 -2
  177. package/dist/switch.min.js.map +1 -1
  178. package/dist/tabs.js +1 -33
  179. package/dist/tabs.js.map +1 -1
  180. package/dist/tabs.min.js +2 -2
  181. package/dist/tabs.min.js.map +1 -1
  182. package/dist/textarea-autosize.js +1 -33
  183. package/dist/textarea-autosize.js.map +1 -1
  184. package/dist/textarea-autosize.min.js +2 -2
  185. package/dist/textarea-autosize.min.js.map +1 -1
  186. package/dist/theme.js +1 -33
  187. package/dist/theme.js.map +1 -1
  188. package/dist/theme.min.js +2 -2
  189. package/dist/theme.min.js.map +1 -1
  190. package/dist/toc.js +1 -33
  191. package/dist/toc.js.map +1 -1
  192. package/dist/toc.min.js +2 -2
  193. package/dist/toc.min.js.map +1 -1
  194. package/dist/toolbar.js +1 -33
  195. package/dist/toolbar.js.map +1 -1
  196. package/dist/toolbar.min.js +2 -2
  197. package/dist/toolbar.min.js.map +1 -1
  198. package/dist/tooltip.js +1 -33
  199. package/dist/tooltip.js.map +1 -1
  200. package/dist/tooltip.min.js +2 -2
  201. package/dist/tooltip.min.js.map +1 -1
  202. package/package.json +2 -2
package/README.md CHANGED
@@ -2,6 +2,10 @@
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
+ The React bindings are client-only and must be used inside a `"use client"` boundary in your application.
6
+
7
+ To support Next.js and SSR, `@m3e/web` works with Lit's server-ready modules, and consumers only need to wrap their `next.config.js` with `withLitSSR` from `@lit-labs/nextjs`. This lets Next.js load the correct server build instead of evaluating browser code during rendering, so all `@m3e/web` elements render on the server and hydrate on the client without any extra setup.
8
+
5
9
  ## 🧪 Example
6
10
 
7
11
  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 as createComponent$1 } from '@lit/react';
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 in `@m3e/app-bar` for full details on behavior,
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 in `@m3e/autocomplete` for full details on behavior,
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 in `@m3e/avatar` for full details on behavior,
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 in `@m3e/badge` for full details on behavior,
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 in `@m3e/button` for full details on behavior,
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 in `@m3e/button-group` for full details on behavior,
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 in `@m3e/card` for full details on behavior,
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 in `@m3e/checkbox` for full details on behavior,
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 in `@m3e/dialog` for full details on behavior,
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 in `@m3e/divider` for full details on behavior,
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 in `@m3e/drawer-container` for full details on behavior,
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$1({
1512
+ const M3ePaginator = createComponent({
1545
1513
  tagName: "m3e-paginator",
1546
1514
  elementClass: M3ePaginatorElement,
1547
1515
  react: React,