@m3e/react 2.0.0 → 2.0.1

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 (303) hide show
  1. package/README.md +1 -7
  2. package/dist/all.js +338 -91
  3. package/dist/all.js.map +1 -1
  4. package/dist/all.min.js +1 -1
  5. package/dist/all.min.js.map +1 -1
  6. package/dist/app-bar.js +33 -2
  7. package/dist/app-bar.js.map +1 -1
  8. package/dist/app-bar.min.js +1 -1
  9. package/dist/app-bar.min.js.map +1 -1
  10. package/dist/autocomplete.js +33 -2
  11. package/dist/autocomplete.js.map +1 -1
  12. package/dist/autocomplete.min.js +1 -1
  13. package/dist/autocomplete.min.js.map +1 -1
  14. package/dist/avatar.js +33 -2
  15. package/dist/avatar.js.map +1 -1
  16. package/dist/avatar.min.js +1 -1
  17. package/dist/avatar.min.js.map +1 -1
  18. package/dist/badge.js +33 -2
  19. package/dist/badge.js.map +1 -1
  20. package/dist/badge.min.js +1 -1
  21. package/dist/badge.min.js.map +1 -1
  22. package/dist/bottom-sheet.js +35 -4
  23. package/dist/bottom-sheet.js.map +1 -1
  24. package/dist/bottom-sheet.min.js +1 -1
  25. package/dist/bottom-sheet.min.js.map +1 -1
  26. package/dist/button-group.js +33 -2
  27. package/dist/button-group.js.map +1 -1
  28. package/dist/button-group.min.js +1 -1
  29. package/dist/button-group.min.js.map +1 -1
  30. package/dist/button.js +33 -2
  31. package/dist/button.js.map +1 -1
  32. package/dist/button.min.js +1 -1
  33. package/dist/button.min.js.map +1 -1
  34. package/dist/card.js +33 -2
  35. package/dist/card.js.map +1 -1
  36. package/dist/card.min.js +1 -1
  37. package/dist/card.min.js.map +1 -1
  38. package/dist/checkbox.js +33 -2
  39. package/dist/checkbox.js.map +1 -1
  40. package/dist/checkbox.min.js +1 -1
  41. package/dist/checkbox.min.js.map +1 -1
  42. package/dist/chips.js +40 -9
  43. package/dist/chips.js.map +1 -1
  44. package/dist/chips.min.js +1 -1
  45. package/dist/chips.min.js.map +1 -1
  46. package/dist/core.js +259 -0
  47. package/dist/core.js.map +1 -0
  48. package/dist/core.min.js +7 -0
  49. package/dist/core.min.js.map +1 -0
  50. package/dist/dialog.js +35 -4
  51. package/dist/dialog.js.map +1 -1
  52. package/dist/dialog.min.js +1 -1
  53. package/dist/dialog.min.js.map +1 -1
  54. package/dist/divider.js +33 -2
  55. package/dist/divider.js.map +1 -1
  56. package/dist/divider.min.js +1 -1
  57. package/dist/divider.min.js.map +1 -1
  58. package/dist/drawer-container.js +34 -3
  59. package/dist/drawer-container.js.map +1 -1
  60. package/dist/drawer-container.min.js +1 -1
  61. package/dist/drawer-container.min.js.map +1 -1
  62. package/dist/expansion-panel.js +34 -3
  63. package/dist/expansion-panel.js.map +1 -1
  64. package/dist/expansion-panel.min.js +1 -1
  65. package/dist/expansion-panel.min.js.map +1 -1
  66. package/dist/fab-menu.js +35 -4
  67. package/dist/fab-menu.js.map +1 -1
  68. package/dist/fab-menu.min.js +1 -1
  69. package/dist/fab-menu.min.js.map +1 -1
  70. package/dist/fab.js +33 -2
  71. package/dist/fab.js.map +1 -1
  72. package/dist/fab.min.js +1 -1
  73. package/dist/fab.min.js.map +1 -1
  74. package/dist/form-field.js +33 -2
  75. package/dist/form-field.js.map +1 -1
  76. package/dist/form-field.min.js +1 -1
  77. package/dist/form-field.min.js.map +1 -1
  78. package/dist/heading.js +33 -2
  79. package/dist/heading.js.map +1 -1
  80. package/dist/heading.min.js +1 -1
  81. package/dist/heading.min.js.map +1 -1
  82. package/dist/icon-button.js +33 -2
  83. package/dist/icon-button.js.map +1 -1
  84. package/dist/icon-button.min.js +1 -1
  85. package/dist/icon-button.min.js.map +1 -1
  86. package/dist/icon.js +33 -2
  87. package/dist/icon.js.map +1 -1
  88. package/dist/icon.min.js +1 -1
  89. package/dist/icon.min.js.map +1 -1
  90. package/dist/list.js +39 -8
  91. package/dist/list.js.map +1 -1
  92. package/dist/list.min.js +1 -1
  93. package/dist/list.min.js.map +1 -1
  94. package/dist/loading-indicator.js +33 -2
  95. package/dist/loading-indicator.js.map +1 -1
  96. package/dist/loading-indicator.min.js +1 -1
  97. package/dist/loading-indicator.min.js.map +1 -1
  98. package/dist/menu.js +38 -7
  99. package/dist/menu.js.map +1 -1
  100. package/dist/menu.min.js +1 -1
  101. package/dist/menu.min.js.map +1 -1
  102. package/dist/nav-bar.js +34 -3
  103. package/dist/nav-bar.js.map +1 -1
  104. package/dist/nav-bar.min.js +1 -1
  105. package/dist/nav-bar.min.js.map +1 -1
  106. package/dist/nav-menu.js +35 -4
  107. package/dist/nav-menu.js.map +1 -1
  108. package/dist/nav-menu.min.js +1 -1
  109. package/dist/nav-menu.min.js.map +1 -1
  110. package/dist/nav-rail.js +34 -3
  111. package/dist/nav-rail.js.map +1 -1
  112. package/dist/nav-rail.min.js +1 -1
  113. package/dist/nav-rail.min.js.map +1 -1
  114. package/dist/option.js +34 -3
  115. package/dist/option.js.map +1 -1
  116. package/dist/option.min.js +1 -1
  117. package/dist/option.min.js.map +1 -1
  118. package/dist/paginator.js +1 -1
  119. package/dist/paginator.js.map +1 -1
  120. package/dist/paginator.min.js.map +1 -1
  121. package/dist/progress-indicator.js +34 -3
  122. package/dist/progress-indicator.js.map +1 -1
  123. package/dist/progress-indicator.min.js +1 -1
  124. package/dist/progress-indicator.min.js.map +1 -1
  125. package/dist/radio-group.js +34 -3
  126. package/dist/radio-group.js.map +1 -1
  127. package/dist/radio-group.min.js +1 -1
  128. package/dist/radio-group.min.js.map +1 -1
  129. package/dist/segmented-button.js +34 -3
  130. package/dist/segmented-button.js.map +1 -1
  131. package/dist/segmented-button.min.js +1 -1
  132. package/dist/segmented-button.min.js.map +1 -1
  133. package/dist/select.js +33 -2
  134. package/dist/select.js.map +1 -1
  135. package/dist/select.min.js +1 -1
  136. package/dist/select.min.js.map +1 -1
  137. package/dist/shape.js +33 -2
  138. package/dist/shape.js.map +1 -1
  139. package/dist/shape.min.js +1 -1
  140. package/dist/shape.min.js.map +1 -1
  141. package/dist/slide-group.js +33 -2
  142. package/dist/slide-group.js.map +1 -1
  143. package/dist/slide-group.min.js +1 -1
  144. package/dist/slide-group.min.js.map +1 -1
  145. package/dist/slider.js +34 -3
  146. package/dist/slider.js.map +1 -1
  147. package/dist/slider.min.js +1 -1
  148. package/dist/slider.min.js.map +1 -1
  149. package/dist/split-button.js +33 -2
  150. package/dist/split-button.js.map +1 -1
  151. package/dist/split-button.min.js +1 -1
  152. package/dist/split-button.min.js.map +1 -1
  153. package/dist/src/all.d.ts +1 -0
  154. package/dist/src/all.d.ts.map +1 -1
  155. package/dist/src/app-bar/AppBar.d.ts +1 -1
  156. package/dist/src/autocomplete/Autocomplete.d.ts +1 -1
  157. package/dist/src/avatar/Avatar.d.ts +1 -1
  158. package/dist/src/badge/Badge.d.ts +1 -1
  159. package/dist/src/bottom-sheet/BottomSheet.d.ts +1 -1
  160. package/dist/src/bottom-sheet/BottomSheetAction.d.ts +1 -1
  161. package/dist/src/bottom-sheet/BottomSheetTrigger.d.ts +1 -1
  162. package/dist/src/button/Button.d.ts +1 -1
  163. package/dist/src/button-group/ButtonGroup.d.ts +1 -1
  164. package/dist/src/card/Card.d.ts +1 -1
  165. package/dist/src/checkbox/Checkbox.d.ts +1 -1
  166. package/dist/src/chips/AssistChip.d.ts +1 -1
  167. package/dist/src/chips/Chip.d.ts +1 -1
  168. package/dist/src/chips/ChipSet.d.ts +1 -1
  169. package/dist/src/chips/FilterChip.d.ts +1 -1
  170. package/dist/src/chips/FilterChipSet.d.ts +1 -1
  171. package/dist/src/chips/InputChip.d.ts +1 -1
  172. package/dist/src/chips/InputChipSet.d.ts +1 -1
  173. package/dist/src/chips/SuggestionChip.d.ts +1 -1
  174. package/dist/src/core/Collapsible.d.ts +22 -0
  175. package/dist/src/core/Collapsible.d.ts.map +1 -0
  176. package/dist/src/core/Elevation.d.ts +17 -0
  177. package/dist/src/core/Elevation.d.ts.map +1 -0
  178. package/dist/src/core/FocusRing.d.ts +17 -0
  179. package/dist/src/core/FocusRing.d.ts.map +1 -0
  180. package/dist/src/core/PseudoCheckbox.d.ts +17 -0
  181. package/dist/src/core/PseudoCheckbox.d.ts.map +1 -0
  182. package/dist/src/core/PseudoRadio.d.ts +17 -0
  183. package/dist/src/core/PseudoRadio.d.ts.map +1 -0
  184. package/dist/src/core/Ripple.d.ts +17 -0
  185. package/dist/src/core/Ripple.d.ts.map +1 -0
  186. package/dist/src/core/ScrollContainer.d.ts +17 -0
  187. package/dist/src/core/ScrollContainer.d.ts.map +1 -0
  188. package/dist/src/core/Slide.d.ts +17 -0
  189. package/dist/src/core/Slide.d.ts.map +1 -0
  190. package/dist/src/core/StateLayer.d.ts +17 -0
  191. package/dist/src/core/StateLayer.d.ts.map +1 -0
  192. package/dist/src/core/TextHighlight.d.ts +17 -0
  193. package/dist/src/core/TextHighlight.d.ts.map +1 -0
  194. package/dist/src/core/TextOverflow.d.ts +17 -0
  195. package/dist/src/core/TextOverflow.d.ts.map +1 -0
  196. package/dist/src/core/index.d.ts +12 -0
  197. package/dist/src/core/index.d.ts.map +1 -0
  198. package/dist/src/dialog/Dialog.d.ts +1 -1
  199. package/dist/src/dialog/DialogAction.d.ts +1 -1
  200. package/dist/src/dialog/DialogTrigger.d.ts +1 -1
  201. package/dist/src/divider/Divider.d.ts +1 -1
  202. package/dist/src/drawer-container/DrawerContainer.d.ts +1 -1
  203. package/dist/src/drawer-container/DrawerToggle.d.ts +1 -1
  204. package/dist/src/expansion-panel/Accordion.d.ts +1 -1
  205. package/dist/src/expansion-panel/ExpansionPanel.d.ts +1 -1
  206. package/dist/src/fab/Fab.d.ts +1 -1
  207. package/dist/src/fab-menu/FabMenu.d.ts +1 -1
  208. package/dist/src/fab-menu/FabMenuItem.d.ts +1 -1
  209. package/dist/src/fab-menu/FabMenuTrigger.d.ts +1 -1
  210. package/dist/src/form-field/FormField.d.ts +1 -1
  211. package/dist/src/heading/Heading.d.ts +1 -1
  212. package/dist/src/icon/Icon.d.ts +1 -1
  213. package/dist/src/icon-button/IconButton.d.ts +1 -1
  214. package/dist/src/list/ActionList.d.ts +1 -1
  215. package/dist/src/list/ExpandableListItem.d.ts +1 -1
  216. package/dist/src/list/List.d.ts +1 -1
  217. package/dist/src/list/ListAction.d.ts +1 -1
  218. package/dist/src/list/ListItem.d.ts +1 -1
  219. package/dist/src/list/ListOption.d.ts +1 -1
  220. package/dist/src/list/SelectionList.d.ts +1 -1
  221. package/dist/src/loading-indicator/LoadingIndicator.d.ts +1 -1
  222. package/dist/src/menu/Menu.d.ts +1 -1
  223. package/dist/src/menu/MenuItem.d.ts +1 -1
  224. package/dist/src/menu/MenuItemCheckbox.d.ts +1 -1
  225. package/dist/src/menu/MenuItemGroup.d.ts +1 -1
  226. package/dist/src/menu/MenuItemRadio.d.ts +1 -1
  227. package/dist/src/menu/MenuTrigger.d.ts +1 -1
  228. package/dist/src/nav-bar/NavBar.d.ts +1 -1
  229. package/dist/src/nav-bar/NavItem.d.ts +1 -1
  230. package/dist/src/nav-menu/NavMenu.d.ts +1 -1
  231. package/dist/src/nav-menu/NavMenuItem.d.ts +1 -1
  232. package/dist/src/nav-menu/NavMenuItemGroup.d.ts +1 -1
  233. package/dist/src/nav-rail/NavRail.d.ts +1 -1
  234. package/dist/src/nav-rail/NavRailToggle.d.ts +1 -1
  235. package/dist/src/option/OptGroup.d.ts +1 -1
  236. package/dist/src/option/Option.d.ts +1 -1
  237. package/dist/src/paginator/Paginator.d.ts +1 -1
  238. package/dist/src/progress-indicator/CircularProgressIndicator.d.ts +1 -1
  239. package/dist/src/progress-indicator/LinearProgressIndicator.d.ts +1 -1
  240. package/dist/src/radio-group/Radio.d.ts +1 -1
  241. package/dist/src/radio-group/RadioGroup.d.ts +1 -1
  242. package/dist/src/segmented-button/ButtonSegment.d.ts +1 -1
  243. package/dist/src/segmented-button/SegmentedButton.d.ts +1 -1
  244. package/dist/src/select/Select.d.ts +1 -1
  245. package/dist/src/shape/Shape.d.ts +1 -1
  246. package/dist/src/slide-group/SlideGroup.d.ts +1 -1
  247. package/dist/src/slider/Slider.d.ts +1 -1
  248. package/dist/src/slider/SliderThumb.d.ts +1 -1
  249. package/dist/src/split-button/SplitButton.d.ts +1 -1
  250. package/dist/src/stepper/Step.d.ts +1 -1
  251. package/dist/src/stepper/StepPanel.d.ts +1 -1
  252. package/dist/src/stepper/Stepper.d.ts +1 -1
  253. package/dist/src/stepper/StepperNext.d.ts +1 -1
  254. package/dist/src/stepper/StepperPrevious.d.ts +1 -1
  255. package/dist/src/stepper/StepperReset.d.ts +1 -1
  256. package/dist/src/switch/Switch.d.ts +1 -1
  257. package/dist/src/tabs/Tab.d.ts +1 -1
  258. package/dist/src/tabs/TabPanel.d.ts +1 -1
  259. package/dist/src/tabs/Tabs.d.ts +1 -1
  260. package/dist/src/textarea-autosize/TextareaAutosize.d.ts +1 -1
  261. package/dist/src/theme/Theme.d.ts +1 -1
  262. package/dist/src/toc/Toc.d.ts +1 -1
  263. package/dist/src/toolbar/Toolbar.d.ts +1 -1
  264. package/dist/src/tooltip/RichTooltip.d.ts +1 -1
  265. package/dist/src/tooltip/RichTooltipAction.d.ts +1 -1
  266. package/dist/src/tooltip/Tooltip.d.ts +1 -1
  267. package/dist/src/utils/createComponent.d.ts +29 -0
  268. package/dist/src/utils/createComponent.d.ts.map +1 -0
  269. package/dist/src/utils/index.d.ts +2 -0
  270. package/dist/src/utils/index.d.ts.map +1 -0
  271. package/dist/stepper.js +38 -7
  272. package/dist/stepper.js.map +1 -1
  273. package/dist/stepper.min.js +1 -1
  274. package/dist/stepper.min.js.map +1 -1
  275. package/dist/switch.js +33 -2
  276. package/dist/switch.js.map +1 -1
  277. package/dist/switch.min.js +1 -1
  278. package/dist/switch.min.js.map +1 -1
  279. package/dist/tabs.js +35 -4
  280. package/dist/tabs.js.map +1 -1
  281. package/dist/tabs.min.js +1 -1
  282. package/dist/tabs.min.js.map +1 -1
  283. package/dist/textarea-autosize.js +33 -2
  284. package/dist/textarea-autosize.js.map +1 -1
  285. package/dist/textarea-autosize.min.js +1 -1
  286. package/dist/textarea-autosize.min.js.map +1 -1
  287. package/dist/theme.js +33 -2
  288. package/dist/theme.js.map +1 -1
  289. package/dist/theme.min.js +1 -1
  290. package/dist/theme.min.js.map +1 -1
  291. package/dist/toc.js +33 -2
  292. package/dist/toc.js.map +1 -1
  293. package/dist/toc.min.js +1 -1
  294. package/dist/toc.min.js.map +1 -1
  295. package/dist/toolbar.js +33 -2
  296. package/dist/toolbar.js.map +1 -1
  297. package/dist/toolbar.min.js +1 -1
  298. package/dist/toolbar.min.js.map +1 -1
  299. package/dist/tooltip.js +35 -4
  300. package/dist/tooltip.js.map +1 -1
  301. package/dist/tooltip.min.js +1 -1
  302. package/dist/tooltip.min.js.map +1 -1
  303. package/package.json +6 -2
@@ -1 +1 @@
1
- {"version":3,"file":"paginator.min.js","sources":["../../src/paginator/Paginator.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent, EventName } from \"@lit/react\";\r\n\r\nimport { M3ePaginatorElement, PageEventDetail } from \"@m3e/web/paginator\";\r\nexport type { M3ePaginatorElement, PageEventDetail } from \"@m3e/web/paginator\";\r\n\r\n/**\r\n * React binding for the `m3e-paginator` Web Component from `@m3e/paginator`.\r\n *\r\n * This component renders the underlying `<m3e-paginator>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-paginator>` instance for imperative access.\r\n *\r\n * See the `m3e-paginator` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3ePaginator = createComponent({\r\n tagName: \"m3e-paginator\",\r\n elementClass: M3ePaginatorElement,\r\n react: React,\r\n events: {\r\n onPage: \"page\" as EventName<CustomEvent<PageEventDetail>>,\r\n },\r\n});\r\n"],"names":["M3ePaginator","createComponent","tagName","elementClass","M3ePaginatorElement","react","React","events","onPage"],"mappings":";;;;;8HAmBO,MAAMA,EAAeC,EAAgB,CAC1CC,QAAS,gBACTC,aAAcC,EACdC,MAAOC,EACPC,OAAQ,CACNC,OAAQ"}
1
+ {"version":3,"file":"paginator.min.js","sources":["../../src/paginator/Paginator.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent, EventName } from \"@lit/react\";\r\n\r\nimport { M3ePaginatorElement, PageEventDetail } from \"@m3e/web/paginator\";\r\nexport type { M3ePaginatorElement, PageEventDetail } from \"@m3e/web/paginator\";\r\n\r\n/**\r\n * React binding for the `m3e-paginator` Web Component from `@m3e/web/paginator`.\r\n *\r\n * This component renders the underlying `<m3e-paginator>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-paginator>` instance for imperative access.\r\n *\r\n * See the `m3e-paginator` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3ePaginator = createComponent({\r\n tagName: \"m3e-paginator\",\r\n elementClass: M3ePaginatorElement,\r\n react: React,\r\n events: {\r\n onPage: \"page\" as EventName<CustomEvent<PageEventDetail>>,\r\n },\r\n});\r\n"],"names":["M3ePaginator","createComponent","tagName","elementClass","M3ePaginatorElement","react","React","events","onPage"],"mappings":";;;;;8HAmBO,MAAMA,EAAeC,EAAgB,CAC1CC,QAAS,gBACTC,aAAcC,EACdC,MAAOC,EACPC,OAAQ,CACNC,OAAQ"}
@@ -6,11 +6,42 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import { createComponent } from '@lit/react';
9
+ import { createComponent as createComponent$1 } from '@lit/react';
10
10
  import { M3eCircularProgressIndicatorElement, M3eLinearProgressIndicatorElement } from '@m3e/web/progress-indicator';
11
11
 
12
12
  /**
13
- * React binding for the `m3e-circular-progress-indicator` Web Component from `@m3e/progress-indicator`.
13
+ * Creates an SSR-safe React component for a custom element. Properties are distinguished
14
+ * from attributes automatically, and events can be configured so they are added
15
+ * to the custom element as event listeners.
16
+ *
17
+ * @param options An options bag containing the parameters needed to generate a
18
+ * wrapped web component.
19
+ *
20
+ * @param options.react The React module, typically imported from the `react`
21
+ * npm package.
22
+ * @param options.tagName The custom element tag name registered via
23
+ * `customElements.define`.
24
+ * @param options.elementClass The custom element class registered via
25
+ * `customElements.define`.
26
+ * @param options.events An object listing events to which the component can
27
+ * listen. The object keys are the event property names passed in via React
28
+ * props and the object values are the names of the corresponding events
29
+ * generated by the custom element. For example, given `{onactivate:
30
+ * 'activate'}` an event function may be passed via the component's `onactivate`
31
+ * prop and will be called when the custom element fires its `activate` event.
32
+ * @param options.displayName A React component display name, used in debugging
33
+ * messages. Default value is inferred from the name of custom element class
34
+ * registered via `customElements.define`.
35
+ */
36
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
37
+ function createComponent({ react, tagName, elementClass, events, displayName, }) {
38
+ return typeof window !== "undefined"
39
+ ? createComponent$1({ react, tagName, elementClass, events, displayName })
40
+ : null;
41
+ }
42
+
43
+ /**
44
+ * React binding for the `m3e-circular-progress-indicator` Web Component from `@m3e/web/progress-indicator`.
14
45
  *
15
46
  * This component renders the underlying `<m3e-circular-progress-indicator>` element and exposes its
16
47
  * properties, attributes, and events through an idiomatic React interface.
@@ -29,7 +60,7 @@ const M3eCircularProgressIndicator = createComponent({
29
60
  });
30
61
 
31
62
  /**
32
- * React binding for the `m3e-linear-progress-indicator` Web Component from `@m3e/progress-indicator`.
63
+ * React binding for the `m3e-linear-progress-indicator` Web Component from `@m3e/web/progress-indicator`.
33
64
  *
34
65
  * This component renders the underlying `<m3e-linear-progress-indicator>` element and exposes its
35
66
  * properties, attributes, and events through an idiomatic React interface.
@@ -1 +1 @@
1
- {"version":3,"file":"progress-indicator.js","sources":["../../src/progress-indicator/CircularProgressIndicator.ts","../../src/progress-indicator/LinearProgressIndicator.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"@lit/react\";\r\n\r\nimport { M3eCircularProgressIndicatorElement } from \"@m3e/web/progress-indicator\";\r\nexport type { M3eCircularProgressIndicatorElement } from \"@m3e/web/progress-indicator\";\r\n\r\n/**\r\n * React binding for the `m3e-circular-progress-indicator` Web Component from `@m3e/progress-indicator`.\r\n *\r\n * This component renders the underlying `<m3e-circular-progress-indicator>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-circular-progress-indicator>` instance for imperative access.\r\n *\r\n * See the `m3e-circular-progress-indicator` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eCircularProgressIndicator = createComponent({\r\n tagName: \"m3e-circular-progress-indicator\",\r\n elementClass: M3eCircularProgressIndicatorElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"@lit/react\";\r\n\r\nimport { M3eLinearProgressIndicatorElement } from \"@m3e/web/progress-indicator\";\r\nexport type {\r\n ProgressIndicatorVariant,\r\n LinearProgressMode,\r\n M3eLinearProgressIndicatorElement,\r\n} from \"@m3e/web/progress-indicator\";\r\n\r\n/**\r\n * React binding for the `m3e-linear-progress-indicator` Web Component from `@m3e/progress-indicator`.\r\n *\r\n * This component renders the underlying `<m3e-linear-progress-indicator>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-linear-progress-indicator>` instance for imperative access.\r\n *\r\n * See the `m3e-linear-progress-indicator` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eLinearProgressIndicator = createComponent({\r\n tagName: \"m3e-linear-progress-indicator\",\r\n elementClass: M3eLinearProgressIndicatorElement,\r\n react: React,\r\n});\r\n"],"names":[],"mappings":";;;;;;;;;;;AAMA;;;;;;;;;;;;AAYG;AACI,MAAM,4BAA4B,GAAG,eAAe,CAAC;AAC1D,IAAA,OAAO,EAAE,iCAAiC;AAC1C,IAAA,YAAY,EAAE,mCAAmC;AACjD,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;ACbD;;;;;;;;;;;;AAYG;AACI,MAAM,0BAA0B,GAAG,eAAe,CAAC;AACxD,IAAA,OAAO,EAAE,+BAA+B;AACxC,IAAA,YAAY,EAAE,iCAAiC;AAC/C,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;;;"}
1
+ {"version":3,"file":"progress-indicator.js","sources":["../../src/utils/createComponent.ts","../../src/progress-indicator/CircularProgressIndicator.ts","../../src/progress-indicator/LinearProgressIndicator.ts"],"sourcesContent":["import { createComponent as createReactComponent, EventName, Options, ReactWebComponent } from \"@lit/react\";\r\n\r\ntype EventNames = Record<string, EventName | string>;\r\n\r\n/**\r\n * Creates an SSR-safe React component for a custom element. Properties are distinguished\r\n * from attributes automatically, and events can be configured so they are added\r\n * to the custom element as event listeners.\r\n *\r\n * @param options An options bag containing the parameters needed to generate a\r\n * wrapped web component.\r\n *\r\n * @param options.react The React module, typically imported from the `react`\r\n * npm package.\r\n * @param options.tagName The custom element tag name registered via\r\n * `customElements.define`.\r\n * @param options.elementClass The custom element class registered via\r\n * `customElements.define`.\r\n * @param options.events An object listing events to which the component can\r\n * listen. The object keys are the event property names passed in via React\r\n * props and the object values are the names of the corresponding events\r\n * generated by the custom element. For example, given `{onactivate:\r\n * 'activate'}` an event function may be passed via the component's `onactivate`\r\n * prop and will be called when the custom element fires its `activate` event.\r\n * @param options.displayName A React component display name, used in debugging\r\n * messages. Default value is inferred from the name of custom element class\r\n * registered via `customElements.define`.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\r\nexport function createComponent<I extends HTMLElement, E extends EventNames = {}>({\r\n react,\r\n tagName,\r\n elementClass,\r\n events,\r\n displayName,\r\n}: Options<I, E>): ReactWebComponent<I, E> {\r\n return typeof window !== \"undefined\"\r\n ? createReactComponent<I, E>({ react, tagName, elementClass, events, displayName })\r\n : <ReactWebComponent<I, E>>(<unknown>null);\r\n}\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eCircularProgressIndicatorElement } from \"@m3e/web/progress-indicator\";\r\nexport type { M3eCircularProgressIndicatorElement } from \"@m3e/web/progress-indicator\";\r\n\r\n/**\r\n * React binding for the `m3e-circular-progress-indicator` Web Component from `@m3e/web/progress-indicator`.\r\n *\r\n * This component renders the underlying `<m3e-circular-progress-indicator>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-circular-progress-indicator>` instance for imperative access.\r\n *\r\n * See the `m3e-circular-progress-indicator` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eCircularProgressIndicator = createComponent({\r\n tagName: \"m3e-circular-progress-indicator\",\r\n elementClass: M3eCircularProgressIndicatorElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eLinearProgressIndicatorElement } from \"@m3e/web/progress-indicator\";\r\nexport type {\r\n ProgressIndicatorVariant,\r\n LinearProgressMode,\r\n M3eLinearProgressIndicatorElement,\r\n} from \"@m3e/web/progress-indicator\";\r\n\r\n/**\r\n * React binding for the `m3e-linear-progress-indicator` Web Component from `@m3e/web/progress-indicator`.\r\n *\r\n * This component renders the underlying `<m3e-linear-progress-indicator>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-linear-progress-indicator>` instance for imperative access.\r\n *\r\n * See the `m3e-linear-progress-indicator` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eLinearProgressIndicator = createComponent({\r\n tagName: \"m3e-linear-progress-indicator\",\r\n elementClass: M3eLinearProgressIndicatorElement,\r\n react: React,\r\n});\r\n"],"names":["createReactComponent"],"mappings":";;;;;;;;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACH;AACM,SAAU,eAAe,CAAmD,EAChF,KAAK,EACL,OAAO,EACP,YAAY,EACZ,MAAM,EACN,WAAW,GACG,EAAA;IACd,OAAO,OAAO,MAAM,KAAK;AACvB,UAAEA,iBAAoB,CAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE;UAC7C,IAAK;AAC9C;;ACjCA;;;;;;;;;;;;AAYG;AACI,MAAM,4BAA4B,GAAG,eAAe,CAAC;AAC1D,IAAA,OAAO,EAAE,iCAAiC;AAC1C,IAAA,YAAY,EAAE,mCAAmC;AACjD,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;ACbD;;;;;;;;;;;;AAYG;AACI,MAAM,0BAA0B,GAAG,eAAe,CAAC;AACxD,IAAA,OAAO,EAAE,+BAA+B;AACxC,IAAA,YAAY,EAAE,iCAAiC;AAC/C,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;;;"}
@@ -3,5 +3,5 @@
3
3
  * @license MIT
4
4
  * Copyright (c) 2025 matraic
5
5
  * See LICENSE file in the project root for full license text.
6
- */import e from"react";import{createComponent as r}from"@lit/react";import{M3eCircularProgressIndicatorElement as t,M3eLinearProgressIndicatorElement as a}from"@m3e/web/progress-indicator";const o=r({tagName:"m3e-circular-progress-indicator",elementClass:t,react:e}),i=r({tagName:"m3e-linear-progress-indicator",elementClass:a,react:e});export{o as M3eCircularProgressIndicator,i as M3eLinearProgressIndicator};
6
+ */import e from"react";import{createComponent as t}from"@lit/react";import{M3eCircularProgressIndicatorElement as a,M3eLinearProgressIndicatorElement as r}from"@m3e/web/progress-indicator";function n({react:e,tagName:a,elementClass:r,events:n,displayName:s}){return"undefined"!=typeof window?t({react:e,tagName:a,elementClass:r,events:n,displayName:s}):null}const s=n({tagName:"m3e-circular-progress-indicator",elementClass:a,react:e}),m=n({tagName:"m3e-linear-progress-indicator",elementClass:r,react:e});export{s as M3eCircularProgressIndicator,m as M3eLinearProgressIndicator};
7
7
  //# sourceMappingURL=progress-indicator.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"progress-indicator.min.js","sources":["../../src/progress-indicator/CircularProgressIndicator.ts","../../src/progress-indicator/LinearProgressIndicator.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"@lit/react\";\r\n\r\nimport { M3eCircularProgressIndicatorElement } from \"@m3e/web/progress-indicator\";\r\nexport type { M3eCircularProgressIndicatorElement } from \"@m3e/web/progress-indicator\";\r\n\r\n/**\r\n * React binding for the `m3e-circular-progress-indicator` Web Component from `@m3e/progress-indicator`.\r\n *\r\n * This component renders the underlying `<m3e-circular-progress-indicator>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-circular-progress-indicator>` instance for imperative access.\r\n *\r\n * See the `m3e-circular-progress-indicator` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eCircularProgressIndicator = createComponent({\r\n tagName: \"m3e-circular-progress-indicator\",\r\n elementClass: M3eCircularProgressIndicatorElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"@lit/react\";\r\n\r\nimport { M3eLinearProgressIndicatorElement } from \"@m3e/web/progress-indicator\";\r\nexport type {\r\n ProgressIndicatorVariant,\r\n LinearProgressMode,\r\n M3eLinearProgressIndicatorElement,\r\n} from \"@m3e/web/progress-indicator\";\r\n\r\n/**\r\n * React binding for the `m3e-linear-progress-indicator` Web Component from `@m3e/progress-indicator`.\r\n *\r\n * This component renders the underlying `<m3e-linear-progress-indicator>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-linear-progress-indicator>` instance for imperative access.\r\n *\r\n * See the `m3e-linear-progress-indicator` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eLinearProgressIndicator = createComponent({\r\n tagName: \"m3e-linear-progress-indicator\",\r\n elementClass: M3eLinearProgressIndicatorElement,\r\n react: React,\r\n});\r\n"],"names":["M3eCircularProgressIndicator","createComponent","tagName","elementClass","M3eCircularProgressIndicatorElement","react","React","M3eLinearProgressIndicator","M3eLinearProgressIndicatorElement"],"mappings":";;;;;8LAmBO,MAAMA,EAA+BC,EAAgB,CAC1DC,QAAS,kCACTC,aAAcC,EACdC,MAAOC,ICCIC,EAA6BN,EAAgB,CACxDC,QAAS,gCACTC,aAAcK,EACdH,MAAOC"}
1
+ {"version":3,"file":"progress-indicator.min.js","sources":["../../src/utils/createComponent.ts","../../src/progress-indicator/CircularProgressIndicator.ts","../../src/progress-indicator/LinearProgressIndicator.ts"],"sourcesContent":["import { createComponent as createReactComponent, EventName, Options, ReactWebComponent } from \"@lit/react\";\r\n\r\ntype EventNames = Record<string, EventName | string>;\r\n\r\n/**\r\n * Creates an SSR-safe React component for a custom element. Properties are distinguished\r\n * from attributes automatically, and events can be configured so they are added\r\n * to the custom element as event listeners.\r\n *\r\n * @param options An options bag containing the parameters needed to generate a\r\n * wrapped web component.\r\n *\r\n * @param options.react The React module, typically imported from the `react`\r\n * npm package.\r\n * @param options.tagName The custom element tag name registered via\r\n * `customElements.define`.\r\n * @param options.elementClass The custom element class registered via\r\n * `customElements.define`.\r\n * @param options.events An object listing events to which the component can\r\n * listen. The object keys are the event property names passed in via React\r\n * props and the object values are the names of the corresponding events\r\n * generated by the custom element. For example, given `{onactivate:\r\n * 'activate'}` an event function may be passed via the component's `onactivate`\r\n * prop and will be called when the custom element fires its `activate` event.\r\n * @param options.displayName A React component display name, used in debugging\r\n * messages. Default value is inferred from the name of custom element class\r\n * registered via `customElements.define`.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\r\nexport function createComponent<I extends HTMLElement, E extends EventNames = {}>({\r\n react,\r\n tagName,\r\n elementClass,\r\n events,\r\n displayName,\r\n}: Options<I, E>): ReactWebComponent<I, E> {\r\n return typeof window !== \"undefined\"\r\n ? createReactComponent<I, E>({ react, tagName, elementClass, events, displayName })\r\n : <ReactWebComponent<I, E>>(<unknown>null);\r\n}\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eCircularProgressIndicatorElement } from \"@m3e/web/progress-indicator\";\r\nexport type { M3eCircularProgressIndicatorElement } from \"@m3e/web/progress-indicator\";\r\n\r\n/**\r\n * React binding for the `m3e-circular-progress-indicator` Web Component from `@m3e/web/progress-indicator`.\r\n *\r\n * This component renders the underlying `<m3e-circular-progress-indicator>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-circular-progress-indicator>` instance for imperative access.\r\n *\r\n * See the `m3e-circular-progress-indicator` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eCircularProgressIndicator = createComponent({\r\n tagName: \"m3e-circular-progress-indicator\",\r\n elementClass: M3eCircularProgressIndicatorElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eLinearProgressIndicatorElement } from \"@m3e/web/progress-indicator\";\r\nexport type {\r\n ProgressIndicatorVariant,\r\n LinearProgressMode,\r\n M3eLinearProgressIndicatorElement,\r\n} from \"@m3e/web/progress-indicator\";\r\n\r\n/**\r\n * React binding for the `m3e-linear-progress-indicator` Web Component from `@m3e/web/progress-indicator`.\r\n *\r\n * This component renders the underlying `<m3e-linear-progress-indicator>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-linear-progress-indicator>` instance for imperative access.\r\n *\r\n * See the `m3e-linear-progress-indicator` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eLinearProgressIndicator = createComponent({\r\n tagName: \"m3e-linear-progress-indicator\",\r\n elementClass: M3eLinearProgressIndicatorElement,\r\n react: React,\r\n});\r\n"],"names":["createComponent","react","tagName","elementClass","events","displayName","window","createReactComponent","M3eCircularProgressIndicator","M3eCircularProgressIndicatorElement","React","M3eLinearProgressIndicator","M3eLinearProgressIndicatorElement"],"mappings":";;;;;8LA6BM,SAAUA,GAAkEC,MAChFA,EAAKC,QACLA,EAAOC,aACPA,EAAYC,OACZA,EAAMC,YACNA,IAEA,MAAyB,oBAAXC,OACVC,EAA2B,CAAEN,QAAOC,UAASC,eAAcC,SAAQC,gBAChC,IACzC,CCpBO,MAAMG,EAA+BR,EAAgB,CAC1DE,QAAS,kCACTC,aAAcM,EACdR,MAAOS,ICCIC,EAA6BX,EAAgB,CACxDE,QAAS,gCACTC,aAAcS,EACdX,MAAOS"}
@@ -6,11 +6,42 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import { createComponent } from '@lit/react';
9
+ import { createComponent as createComponent$1 } from '@lit/react';
10
10
  import { M3eRadioElement, M3eRadioGroupElement } from '@m3e/web/radio-group';
11
11
 
12
12
  /**
13
- * React binding for the `m3e-radio` Web Component from `@m3e/radio-group`.
13
+ * Creates an SSR-safe React component for a custom element. Properties are distinguished
14
+ * from attributes automatically, and events can be configured so they are added
15
+ * to the custom element as event listeners.
16
+ *
17
+ * @param options An options bag containing the parameters needed to generate a
18
+ * wrapped web component.
19
+ *
20
+ * @param options.react The React module, typically imported from the `react`
21
+ * npm package.
22
+ * @param options.tagName The custom element tag name registered via
23
+ * `customElements.define`.
24
+ * @param options.elementClass The custom element class registered via
25
+ * `customElements.define`.
26
+ * @param options.events An object listing events to which the component can
27
+ * listen. The object keys are the event property names passed in via React
28
+ * props and the object values are the names of the corresponding events
29
+ * generated by the custom element. For example, given `{onactivate:
30
+ * 'activate'}` an event function may be passed via the component's `onactivate`
31
+ * prop and will be called when the custom element fires its `activate` event.
32
+ * @param options.displayName A React component display name, used in debugging
33
+ * messages. Default value is inferred from the name of custom element class
34
+ * registered via `customElements.define`.
35
+ */
36
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
37
+ function createComponent({ react, tagName, elementClass, events, displayName, }) {
38
+ return typeof window !== "undefined"
39
+ ? createComponent$1({ react, tagName, elementClass, events, displayName })
40
+ : null;
41
+ }
42
+
43
+ /**
44
+ * React binding for the `m3e-radio` Web Component from `@m3e/web/radio-group`.
14
45
  *
15
46
  * This component renders the underlying `<m3e-radio>` element and exposes its
16
47
  * properties, attributes, and events through an idiomatic React interface.
@@ -34,7 +65,7 @@ const M3eRadio = createComponent({
34
65
  });
35
66
 
36
67
  /**
37
- * React binding for the `m3e-radio-group` Web Component from `@m3e/radio-group`.
68
+ * React binding for the `m3e-radio-group` Web Component from `@m3e/web/radio-group`.
38
69
  *
39
70
  * This component renders the underlying `<m3e-radio-group>` element and exposes its
40
71
  * properties, attributes, and events through an idiomatic React interface.
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.js","sources":["../../src/radio-group/Radio.ts","../../src/radio-group/RadioGroup.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"@lit/react\";\r\n\r\nimport { M3eRadioElement } from \"@m3e/web/radio-group\";\r\nexport type { M3eRadioElement } from \"@m3e/web/radio-group\";\r\n\r\n/**\r\n * React binding for the `m3e-radio` Web Component from `@m3e/radio-group`.\r\n *\r\n * This component renders the underlying `<m3e-radio>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-radio>` instance for imperative access.\r\n *\r\n * See the `m3e-radio` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eRadio = createComponent({\r\n tagName: \"m3e-radio\",\r\n elementClass: M3eRadioElement,\r\n react: React,\r\n events: {\r\n onInput: \"input\",\r\n onChange: \"change\",\r\n onClick: \"click\",\r\n },\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"@lit/react\";\r\n\r\nimport { M3eRadioGroupElement } from \"@m3e/web/radio-group\";\r\nexport type { M3eRadioGroupElement } from \"@m3e/web/radio-group\";\r\n\r\n/**\r\n * React binding for the `m3e-radio-group` Web Component from `@m3e/radio-group`.\r\n *\r\n * This component renders the underlying `<m3e-radio-group>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-radio-group>` instance for imperative access.\r\n *\r\n * See the `m3e-radio-group` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eRadioGroup = createComponent({\r\n tagName: \"m3e-radio-group\",\r\n elementClass: M3eRadioGroupElement,\r\n react: React,\r\n events: {\r\n onChange: \"change\",\r\n },\r\n});\r\n"],"names":[],"mappings":";;;;;;;;;;;AAMA;;;;;;;;;;;;AAYG;AACI,MAAM,QAAQ,GAAG,eAAe,CAAC;AACtC,IAAA,OAAO,EAAE,WAAW;AACpB,IAAA,YAAY,EAAE,eAAe;AAC7B,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,MAAM,EAAE;AACN,QAAA,OAAO,EAAE,OAAO;AAChB,QAAA,QAAQ,EAAE,QAAQ;AAClB,QAAA,OAAO,EAAE,OAAO;AACjB,KAAA;AACF,CAAA;;ACtBD;;;;;;;;;;;;AAYG;AACI,MAAM,aAAa,GAAG,eAAe,CAAC;AAC3C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,YAAY,EAAE,oBAAoB;AAClC,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,MAAM,EAAE;AACN,QAAA,QAAQ,EAAE,QAAQ;AACnB,KAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"radio-group.js","sources":["../../src/utils/createComponent.ts","../../src/radio-group/Radio.ts","../../src/radio-group/RadioGroup.ts"],"sourcesContent":["import { createComponent as createReactComponent, EventName, Options, ReactWebComponent } from \"@lit/react\";\r\n\r\ntype EventNames = Record<string, EventName | string>;\r\n\r\n/**\r\n * Creates an SSR-safe React component for a custom element. Properties are distinguished\r\n * from attributes automatically, and events can be configured so they are added\r\n * to the custom element as event listeners.\r\n *\r\n * @param options An options bag containing the parameters needed to generate a\r\n * wrapped web component.\r\n *\r\n * @param options.react The React module, typically imported from the `react`\r\n * npm package.\r\n * @param options.tagName The custom element tag name registered via\r\n * `customElements.define`.\r\n * @param options.elementClass The custom element class registered via\r\n * `customElements.define`.\r\n * @param options.events An object listing events to which the component can\r\n * listen. The object keys are the event property names passed in via React\r\n * props and the object values are the names of the corresponding events\r\n * generated by the custom element. For example, given `{onactivate:\r\n * 'activate'}` an event function may be passed via the component's `onactivate`\r\n * prop and will be called when the custom element fires its `activate` event.\r\n * @param options.displayName A React component display name, used in debugging\r\n * messages. Default value is inferred from the name of custom element class\r\n * registered via `customElements.define`.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\r\nexport function createComponent<I extends HTMLElement, E extends EventNames = {}>({\r\n react,\r\n tagName,\r\n elementClass,\r\n events,\r\n displayName,\r\n}: Options<I, E>): ReactWebComponent<I, E> {\r\n return typeof window !== \"undefined\"\r\n ? createReactComponent<I, E>({ react, tagName, elementClass, events, displayName })\r\n : <ReactWebComponent<I, E>>(<unknown>null);\r\n}\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eRadioElement } from \"@m3e/web/radio-group\";\r\nexport type { M3eRadioElement } from \"@m3e/web/radio-group\";\r\n\r\n/**\r\n * React binding for the `m3e-radio` Web Component from `@m3e/web/radio-group`.\r\n *\r\n * This component renders the underlying `<m3e-radio>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-radio>` instance for imperative access.\r\n *\r\n * See the `m3e-radio` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eRadio = createComponent({\r\n tagName: \"m3e-radio\",\r\n elementClass: M3eRadioElement,\r\n react: React,\r\n events: {\r\n onInput: \"input\",\r\n onChange: \"change\",\r\n onClick: \"click\",\r\n },\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eRadioGroupElement } from \"@m3e/web/radio-group\";\r\nexport type { M3eRadioGroupElement } from \"@m3e/web/radio-group\";\r\n\r\n/**\r\n * React binding for the `m3e-radio-group` Web Component from `@m3e/web/radio-group`.\r\n *\r\n * This component renders the underlying `<m3e-radio-group>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-radio-group>` instance for imperative access.\r\n *\r\n * See the `m3e-radio-group` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eRadioGroup = createComponent({\r\n tagName: \"m3e-radio-group\",\r\n elementClass: M3eRadioGroupElement,\r\n react: React,\r\n events: {\r\n onChange: \"change\",\r\n },\r\n});\r\n"],"names":["createReactComponent"],"mappings":";;;;;;;;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACH;AACM,SAAU,eAAe,CAAmD,EAChF,KAAK,EACL,OAAO,EACP,YAAY,EACZ,MAAM,EACN,WAAW,GACG,EAAA;IACd,OAAO,OAAO,MAAM,KAAK;AACvB,UAAEA,iBAAoB,CAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE;UAC7C,IAAK;AAC9C;;ACjCA;;;;;;;;;;;;AAYG;AACI,MAAM,QAAQ,GAAG,eAAe,CAAC;AACtC,IAAA,OAAO,EAAE,WAAW;AACpB,IAAA,YAAY,EAAE,eAAe;AAC7B,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,MAAM,EAAE;AACN,QAAA,OAAO,EAAE,OAAO;AAChB,QAAA,QAAQ,EAAE,QAAQ;AAClB,QAAA,OAAO,EAAE,OAAO;AACjB,KAAA;AACF,CAAA;;ACtBD;;;;;;;;;;;;AAYG;AACI,MAAM,aAAa,GAAG,eAAe,CAAC;AAC3C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,YAAY,EAAE,oBAAoB;AAClC,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,MAAM,EAAE;AACN,QAAA,QAAQ,EAAE,QAAQ;AACnB,KAAA;AACF,CAAA;;;;"}
@@ -3,5 +3,5 @@
3
3
  * @license MIT
4
4
  * Copyright (c) 2025 matraic
5
5
  * See LICENSE file in the project root for full license text.
6
- */import e from"react";import{createComponent as t}from"@lit/react";import{M3eRadioElement as a,M3eRadioGroupElement as o}from"@m3e/web/radio-group";const n=t({tagName:"m3e-radio",elementClass:a,react:e,events:{onInput:"input",onChange:"change",onClick:"click"}}),r=t({tagName:"m3e-radio-group",elementClass:o,react:e,events:{onChange:"change"}});export{n as M3eRadio,r as M3eRadioGroup};
6
+ */import e from"react";import{createComponent as t}from"@lit/react";import{M3eRadioElement as a,M3eRadioGroupElement as n}from"@m3e/web/radio-group";function o({react:e,tagName:a,elementClass:n,events:o,displayName:r}){return"undefined"!=typeof window?t({react:e,tagName:a,elementClass:n,events:o,displayName:r}):null}const r=o({tagName:"m3e-radio",elementClass:a,react:e,events:{onInput:"input",onChange:"change",onClick:"click"}}),m=o({tagName:"m3e-radio-group",elementClass:n,react:e,events:{onChange:"change"}});export{r as M3eRadio,m as M3eRadioGroup};
7
7
  //# sourceMappingURL=radio-group.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio-group.min.js","sources":["../../src/radio-group/Radio.ts","../../src/radio-group/RadioGroup.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"@lit/react\";\r\n\r\nimport { M3eRadioElement } from \"@m3e/web/radio-group\";\r\nexport type { M3eRadioElement } from \"@m3e/web/radio-group\";\r\n\r\n/**\r\n * React binding for the `m3e-radio` Web Component from `@m3e/radio-group`.\r\n *\r\n * This component renders the underlying `<m3e-radio>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-radio>` instance for imperative access.\r\n *\r\n * See the `m3e-radio` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eRadio = createComponent({\r\n tagName: \"m3e-radio\",\r\n elementClass: M3eRadioElement,\r\n react: React,\r\n events: {\r\n onInput: \"input\",\r\n onChange: \"change\",\r\n onClick: \"click\",\r\n },\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"@lit/react\";\r\n\r\nimport { M3eRadioGroupElement } from \"@m3e/web/radio-group\";\r\nexport type { M3eRadioGroupElement } from \"@m3e/web/radio-group\";\r\n\r\n/**\r\n * React binding for the `m3e-radio-group` Web Component from `@m3e/radio-group`.\r\n *\r\n * This component renders the underlying `<m3e-radio-group>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-radio-group>` instance for imperative access.\r\n *\r\n * See the `m3e-radio-group` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eRadioGroup = createComponent({\r\n tagName: \"m3e-radio-group\",\r\n elementClass: M3eRadioGroupElement,\r\n react: React,\r\n events: {\r\n onChange: \"change\",\r\n },\r\n});\r\n"],"names":["M3eRadio","createComponent","tagName","elementClass","M3eRadioElement","react","React","events","onInput","onChange","onClick","M3eRadioGroup","M3eRadioGroupElement"],"mappings":";;;;;sJAmBO,MAAMA,EAAWC,EAAgB,CACtCC,QAAS,YACTC,aAAcC,EACdC,MAAOC,EACPC,OAAQ,CACNC,QAAS,QACTC,SAAU,SACVC,QAAS,WCPAC,EAAgBV,EAAgB,CAC3CC,QAAS,kBACTC,aAAcS,EACdP,MAAOC,EACPC,OAAQ,CACNE,SAAU"}
1
+ {"version":3,"file":"radio-group.min.js","sources":["../../src/utils/createComponent.ts","../../src/radio-group/Radio.ts","../../src/radio-group/RadioGroup.ts"],"sourcesContent":["import { createComponent as createReactComponent, EventName, Options, ReactWebComponent } from \"@lit/react\";\r\n\r\ntype EventNames = Record<string, EventName | string>;\r\n\r\n/**\r\n * Creates an SSR-safe React component for a custom element. Properties are distinguished\r\n * from attributes automatically, and events can be configured so they are added\r\n * to the custom element as event listeners.\r\n *\r\n * @param options An options bag containing the parameters needed to generate a\r\n * wrapped web component.\r\n *\r\n * @param options.react The React module, typically imported from the `react`\r\n * npm package.\r\n * @param options.tagName The custom element tag name registered via\r\n * `customElements.define`.\r\n * @param options.elementClass The custom element class registered via\r\n * `customElements.define`.\r\n * @param options.events An object listing events to which the component can\r\n * listen. The object keys are the event property names passed in via React\r\n * props and the object values are the names of the corresponding events\r\n * generated by the custom element. For example, given `{onactivate:\r\n * 'activate'}` an event function may be passed via the component's `onactivate`\r\n * prop and will be called when the custom element fires its `activate` event.\r\n * @param options.displayName A React component display name, used in debugging\r\n * messages. Default value is inferred from the name of custom element class\r\n * registered via `customElements.define`.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\r\nexport function createComponent<I extends HTMLElement, E extends EventNames = {}>({\r\n react,\r\n tagName,\r\n elementClass,\r\n events,\r\n displayName,\r\n}: Options<I, E>): ReactWebComponent<I, E> {\r\n return typeof window !== \"undefined\"\r\n ? createReactComponent<I, E>({ react, tagName, elementClass, events, displayName })\r\n : <ReactWebComponent<I, E>>(<unknown>null);\r\n}\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eRadioElement } from \"@m3e/web/radio-group\";\r\nexport type { M3eRadioElement } from \"@m3e/web/radio-group\";\r\n\r\n/**\r\n * React binding for the `m3e-radio` Web Component from `@m3e/web/radio-group`.\r\n *\r\n * This component renders the underlying `<m3e-radio>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-radio>` instance for imperative access.\r\n *\r\n * See the `m3e-radio` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eRadio = createComponent({\r\n tagName: \"m3e-radio\",\r\n elementClass: M3eRadioElement,\r\n react: React,\r\n events: {\r\n onInput: \"input\",\r\n onChange: \"change\",\r\n onClick: \"click\",\r\n },\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eRadioGroupElement } from \"@m3e/web/radio-group\";\r\nexport type { M3eRadioGroupElement } from \"@m3e/web/radio-group\";\r\n\r\n/**\r\n * React binding for the `m3e-radio-group` Web Component from `@m3e/web/radio-group`.\r\n *\r\n * This component renders the underlying `<m3e-radio-group>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-radio-group>` instance for imperative access.\r\n *\r\n * See the `m3e-radio-group` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eRadioGroup = createComponent({\r\n tagName: \"m3e-radio-group\",\r\n elementClass: M3eRadioGroupElement,\r\n react: React,\r\n events: {\r\n onChange: \"change\",\r\n },\r\n});\r\n"],"names":["createComponent","react","tagName","elementClass","events","displayName","window","createReactComponent","M3eRadio","M3eRadioElement","React","onInput","onChange","onClick","M3eRadioGroup","M3eRadioGroupElement"],"mappings":";;;;;sJA6BM,SAAUA,GAAkEC,MAChFA,EAAKC,QACLA,EAAOC,aACPA,EAAYC,OACZA,EAAMC,YACNA,IAEA,MAAyB,oBAAXC,OACVC,EAA2B,CAAEN,QAAOC,UAASC,eAAcC,SAAQC,gBAChC,IACzC,CCpBO,MAAMG,EAAWR,EAAgB,CACtCE,QAAS,YACTC,aAAcM,EACdR,MAAOS,EACPN,OAAQ,CACNO,QAAS,QACTC,SAAU,SACVC,QAAS,WCPAC,EAAgBd,EAAgB,CAC3CE,QAAS,kBACTC,aAAcY,EACdd,MAAOS,EACPN,OAAQ,CACNQ,SAAU"}
@@ -6,11 +6,42 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import { createComponent } from '@lit/react';
9
+ import { createComponent as createComponent$1 } from '@lit/react';
10
10
  import { M3eSegmentedButtonElement, M3eButtonSegmentElement } from '@m3e/web/segmented-button';
11
11
 
12
12
  /**
13
- * React binding for the `m3e-segmented-button` Web Component from `@m3e/segmented-button`.
13
+ * Creates an SSR-safe React component for a custom element. Properties are distinguished
14
+ * from attributes automatically, and events can be configured so they are added
15
+ * to the custom element as event listeners.
16
+ *
17
+ * @param options An options bag containing the parameters needed to generate a
18
+ * wrapped web component.
19
+ *
20
+ * @param options.react The React module, typically imported from the `react`
21
+ * npm package.
22
+ * @param options.tagName The custom element tag name registered via
23
+ * `customElements.define`.
24
+ * @param options.elementClass The custom element class registered via
25
+ * `customElements.define`.
26
+ * @param options.events An object listing events to which the component can
27
+ * listen. The object keys are the event property names passed in via React
28
+ * props and the object values are the names of the corresponding events
29
+ * generated by the custom element. For example, given `{onactivate:
30
+ * 'activate'}` an event function may be passed via the component's `onactivate`
31
+ * prop and will be called when the custom element fires its `activate` event.
32
+ * @param options.displayName A React component display name, used in debugging
33
+ * messages. Default value is inferred from the name of custom element class
34
+ * registered via `customElements.define`.
35
+ */
36
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
37
+ function createComponent({ react, tagName, elementClass, events, displayName, }) {
38
+ return typeof window !== "undefined"
39
+ ? createComponent$1({ react, tagName, elementClass, events, displayName })
40
+ : null;
41
+ }
42
+
43
+ /**
44
+ * React binding for the `m3e-segmented-button` Web Component from `@m3e/web/segmented-button`.
14
45
  *
15
46
  * This component renders the underlying `<m3e-segmented-button>` element and exposes its
16
47
  * properties, attributes, and events through an idiomatic React interface.
@@ -33,7 +64,7 @@ const M3eSegmentedButton = createComponent({
33
64
  });
34
65
 
35
66
  /**
36
- * React binding for the `m3e-button-segment` Web Component from `@m3e/segmented-button`.
67
+ * React binding for the `m3e-button-segment` Web Component from `@m3e/web/segmented-button`.
37
68
  *
38
69
  * This component renders the underlying `<m3e-button-segment>` element and exposes its
39
70
  * properties, attributes, and events through an idiomatic React interface.
@@ -1 +1 @@
1
- {"version":3,"file":"segmented-button.js","sources":["../../src/segmented-button/SegmentedButton.ts","../../src/segmented-button/ButtonSegment.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"@lit/react\";\r\n\r\nimport { M3eSegmentedButtonElement } from \"@m3e/web/segmented-button\";\r\nexport type { M3eSegmentedButtonElement } from \"@m3e/web/segmented-button\";\r\n\r\n/**\r\n * React binding for the `m3e-segmented-button` Web Component from `@m3e/segmented-button`.\r\n *\r\n * This component renders the underlying `<m3e-segmented-button>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-segmented-button>` instance for imperative access.\r\n *\r\n * See the `m3e-segmented-button` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eSegmentedButton = createComponent({\r\n tagName: \"m3e-segmented-button\",\r\n elementClass: M3eSegmentedButtonElement,\r\n react: React,\r\n events: {\r\n onInput: \"input\",\r\n onChange: \"change\",\r\n },\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"@lit/react\";\r\n\r\nimport { M3eButtonSegmentElement } from \"@m3e/web/segmented-button\";\r\nexport type { M3eButtonSegmentElement } from \"@m3e/web/segmented-button\";\r\n\r\n/**\r\n * React binding for the `m3e-button-segment` Web Component from `@m3e/segmented-button`.\r\n *\r\n * This component renders the underlying `<m3e-button-segment>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-button-segment>` instance for imperative access.\r\n *\r\n * See the `m3e-button-segment` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eButtonSegment = createComponent({\r\n tagName: \"m3e-button-segment\",\r\n elementClass: M3eButtonSegmentElement,\r\n react: React,\r\n events: {\r\n onInput: \"input\",\r\n onChange: \"change\",\r\n onClick: \"click\",\r\n },\r\n});\r\n"],"names":[],"mappings":";;;;;;;;;;;AAMA;;;;;;;;;;;;AAYG;AACI,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAChD,IAAA,OAAO,EAAE,sBAAsB;AAC/B,IAAA,YAAY,EAAE,yBAAyB;AACvC,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,MAAM,EAAE;AACN,QAAA,OAAO,EAAE,OAAO;AAChB,QAAA,QAAQ,EAAE,QAAQ;AACnB,KAAA;AACF,CAAA;;ACrBD;;;;;;;;;;;;AAYG;AACI,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAC9C,IAAA,OAAO,EAAE,oBAAoB;AAC7B,IAAA,YAAY,EAAE,uBAAuB;AACrC,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,MAAM,EAAE;AACN,QAAA,OAAO,EAAE,OAAO;AAChB,QAAA,QAAQ,EAAE,QAAQ;AAClB,QAAA,OAAO,EAAE,OAAO;AACjB,KAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"segmented-button.js","sources":["../../src/utils/createComponent.ts","../../src/segmented-button/SegmentedButton.ts","../../src/segmented-button/ButtonSegment.ts"],"sourcesContent":["import { createComponent as createReactComponent, EventName, Options, ReactWebComponent } from \"@lit/react\";\r\n\r\ntype EventNames = Record<string, EventName | string>;\r\n\r\n/**\r\n * Creates an SSR-safe React component for a custom element. Properties are distinguished\r\n * from attributes automatically, and events can be configured so they are added\r\n * to the custom element as event listeners.\r\n *\r\n * @param options An options bag containing the parameters needed to generate a\r\n * wrapped web component.\r\n *\r\n * @param options.react The React module, typically imported from the `react`\r\n * npm package.\r\n * @param options.tagName The custom element tag name registered via\r\n * `customElements.define`.\r\n * @param options.elementClass The custom element class registered via\r\n * `customElements.define`.\r\n * @param options.events An object listing events to which the component can\r\n * listen. The object keys are the event property names passed in via React\r\n * props and the object values are the names of the corresponding events\r\n * generated by the custom element. For example, given `{onactivate:\r\n * 'activate'}` an event function may be passed via the component's `onactivate`\r\n * prop and will be called when the custom element fires its `activate` event.\r\n * @param options.displayName A React component display name, used in debugging\r\n * messages. Default value is inferred from the name of custom element class\r\n * registered via `customElements.define`.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\r\nexport function createComponent<I extends HTMLElement, E extends EventNames = {}>({\r\n react,\r\n tagName,\r\n elementClass,\r\n events,\r\n displayName,\r\n}: Options<I, E>): ReactWebComponent<I, E> {\r\n return typeof window !== \"undefined\"\r\n ? createReactComponent<I, E>({ react, tagName, elementClass, events, displayName })\r\n : <ReactWebComponent<I, E>>(<unknown>null);\r\n}\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eSegmentedButtonElement } from \"@m3e/web/segmented-button\";\r\nexport type { M3eSegmentedButtonElement } from \"@m3e/web/segmented-button\";\r\n\r\n/**\r\n * React binding for the `m3e-segmented-button` Web Component from `@m3e/web/segmented-button`.\r\n *\r\n * This component renders the underlying `<m3e-segmented-button>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-segmented-button>` instance for imperative access.\r\n *\r\n * See the `m3e-segmented-button` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eSegmentedButton = createComponent({\r\n tagName: \"m3e-segmented-button\",\r\n elementClass: M3eSegmentedButtonElement,\r\n react: React,\r\n events: {\r\n onInput: \"input\",\r\n onChange: \"change\",\r\n },\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eButtonSegmentElement } from \"@m3e/web/segmented-button\";\r\nexport type { M3eButtonSegmentElement } from \"@m3e/web/segmented-button\";\r\n\r\n/**\r\n * React binding for the `m3e-button-segment` Web Component from `@m3e/web/segmented-button`.\r\n *\r\n * This component renders the underlying `<m3e-button-segment>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-button-segment>` instance for imperative access.\r\n *\r\n * See the `m3e-button-segment` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eButtonSegment = createComponent({\r\n tagName: \"m3e-button-segment\",\r\n elementClass: M3eButtonSegmentElement,\r\n react: React,\r\n events: {\r\n onInput: \"input\",\r\n onChange: \"change\",\r\n onClick: \"click\",\r\n },\r\n});\r\n"],"names":["createReactComponent"],"mappings":";;;;;;;;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACH;AACM,SAAU,eAAe,CAAmD,EAChF,KAAK,EACL,OAAO,EACP,YAAY,EACZ,MAAM,EACN,WAAW,GACG,EAAA;IACd,OAAO,OAAO,MAAM,KAAK;AACvB,UAAEA,iBAAoB,CAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE;UAC7C,IAAK;AAC9C;;ACjCA;;;;;;;;;;;;AAYG;AACI,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAChD,IAAA,OAAO,EAAE,sBAAsB;AAC/B,IAAA,YAAY,EAAE,yBAAyB;AACvC,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,MAAM,EAAE;AACN,QAAA,OAAO,EAAE,OAAO;AAChB,QAAA,QAAQ,EAAE,QAAQ;AACnB,KAAA;AACF,CAAA;;ACrBD;;;;;;;;;;;;AAYG;AACI,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAC9C,IAAA,OAAO,EAAE,oBAAoB;AAC7B,IAAA,YAAY,EAAE,uBAAuB;AACrC,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,MAAM,EAAE;AACN,QAAA,OAAO,EAAE,OAAO;AAChB,QAAA,QAAQ,EAAE,QAAQ;AAClB,QAAA,OAAO,EAAE,OAAO;AACjB,KAAA;AACF,CAAA;;;;"}
@@ -3,5 +3,5 @@
3
3
  * @license MIT
4
4
  * Copyright (c) 2025 matraic
5
5
  * See LICENSE file in the project root for full license text.
6
- */import e from"react";import{createComponent as t}from"@lit/react";import{M3eSegmentedButtonElement as n,M3eButtonSegmentElement as m}from"@m3e/web/segmented-button";const o=t({tagName:"m3e-segmented-button",elementClass:n,react:e,events:{onInput:"input",onChange:"change"}}),a=t({tagName:"m3e-button-segment",elementClass:m,react:e,events:{onInput:"input",onChange:"change",onClick:"click"}});export{a as M3eButtonSegment,o as M3eSegmentedButton};
6
+ */import e from"react";import{createComponent as t}from"@lit/react";import{M3eSegmentedButtonElement as n,M3eButtonSegmentElement as a}from"@m3e/web/segmented-button";function m({react:e,tagName:n,elementClass:a,events:m,displayName:o}){return"undefined"!=typeof window?t({react:e,tagName:n,elementClass:a,events:m,displayName:o}):null}const o=m({tagName:"m3e-segmented-button",elementClass:n,react:e,events:{onInput:"input",onChange:"change"}}),s=m({tagName:"m3e-button-segment",elementClass:a,react:e,events:{onInput:"input",onChange:"change",onClick:"click"}});export{s as M3eButtonSegment,o as M3eSegmentedButton};
7
7
  //# sourceMappingURL=segmented-button.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"segmented-button.min.js","sources":["../../src/segmented-button/SegmentedButton.ts","../../src/segmented-button/ButtonSegment.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"@lit/react\";\r\n\r\nimport { M3eSegmentedButtonElement } from \"@m3e/web/segmented-button\";\r\nexport type { M3eSegmentedButtonElement } from \"@m3e/web/segmented-button\";\r\n\r\n/**\r\n * React binding for the `m3e-segmented-button` Web Component from `@m3e/segmented-button`.\r\n *\r\n * This component renders the underlying `<m3e-segmented-button>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-segmented-button>` instance for imperative access.\r\n *\r\n * See the `m3e-segmented-button` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eSegmentedButton = createComponent({\r\n tagName: \"m3e-segmented-button\",\r\n elementClass: M3eSegmentedButtonElement,\r\n react: React,\r\n events: {\r\n onInput: \"input\",\r\n onChange: \"change\",\r\n },\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"@lit/react\";\r\n\r\nimport { M3eButtonSegmentElement } from \"@m3e/web/segmented-button\";\r\nexport type { M3eButtonSegmentElement } from \"@m3e/web/segmented-button\";\r\n\r\n/**\r\n * React binding for the `m3e-button-segment` Web Component from `@m3e/segmented-button`.\r\n *\r\n * This component renders the underlying `<m3e-button-segment>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-button-segment>` instance for imperative access.\r\n *\r\n * See the `m3e-button-segment` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eButtonSegment = createComponent({\r\n tagName: \"m3e-button-segment\",\r\n elementClass: M3eButtonSegmentElement,\r\n react: React,\r\n events: {\r\n onInput: \"input\",\r\n onChange: \"change\",\r\n onClick: \"click\",\r\n },\r\n});\r\n"],"names":["M3eSegmentedButton","createComponent","tagName","elementClass","M3eSegmentedButtonElement","react","React","events","onInput","onChange","M3eButtonSegment","M3eButtonSegmentElement","onClick"],"mappings":";;;;;wKAmBO,MAAMA,EAAqBC,EAAgB,CAChDC,QAAS,uBACTC,aAAcC,EACdC,MAAOC,EACPC,OAAQ,CACNC,QAAS,QACTC,SAAU,YCNDC,EAAmBT,EAAgB,CAC9CC,QAAS,qBACTC,aAAcQ,EACdN,MAAOC,EACPC,OAAQ,CACNC,QAAS,QACTC,SAAU,SACVG,QAAS"}
1
+ {"version":3,"file":"segmented-button.min.js","sources":["../../src/utils/createComponent.ts","../../src/segmented-button/SegmentedButton.ts","../../src/segmented-button/ButtonSegment.ts"],"sourcesContent":["import { createComponent as createReactComponent, EventName, Options, ReactWebComponent } from \"@lit/react\";\r\n\r\ntype EventNames = Record<string, EventName | string>;\r\n\r\n/**\r\n * Creates an SSR-safe React component for a custom element. Properties are distinguished\r\n * from attributes automatically, and events can be configured so they are added\r\n * to the custom element as event listeners.\r\n *\r\n * @param options An options bag containing the parameters needed to generate a\r\n * wrapped web component.\r\n *\r\n * @param options.react The React module, typically imported from the `react`\r\n * npm package.\r\n * @param options.tagName The custom element tag name registered via\r\n * `customElements.define`.\r\n * @param options.elementClass The custom element class registered via\r\n * `customElements.define`.\r\n * @param options.events An object listing events to which the component can\r\n * listen. The object keys are the event property names passed in via React\r\n * props and the object values are the names of the corresponding events\r\n * generated by the custom element. For example, given `{onactivate:\r\n * 'activate'}` an event function may be passed via the component's `onactivate`\r\n * prop and will be called when the custom element fires its `activate` event.\r\n * @param options.displayName A React component display name, used in debugging\r\n * messages. Default value is inferred from the name of custom element class\r\n * registered via `customElements.define`.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\r\nexport function createComponent<I extends HTMLElement, E extends EventNames = {}>({\r\n react,\r\n tagName,\r\n elementClass,\r\n events,\r\n displayName,\r\n}: Options<I, E>): ReactWebComponent<I, E> {\r\n return typeof window !== \"undefined\"\r\n ? createReactComponent<I, E>({ react, tagName, elementClass, events, displayName })\r\n : <ReactWebComponent<I, E>>(<unknown>null);\r\n}\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eSegmentedButtonElement } from \"@m3e/web/segmented-button\";\r\nexport type { M3eSegmentedButtonElement } from \"@m3e/web/segmented-button\";\r\n\r\n/**\r\n * React binding for the `m3e-segmented-button` Web Component from `@m3e/web/segmented-button`.\r\n *\r\n * This component renders the underlying `<m3e-segmented-button>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-segmented-button>` instance for imperative access.\r\n *\r\n * See the `m3e-segmented-button` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eSegmentedButton = createComponent({\r\n tagName: \"m3e-segmented-button\",\r\n elementClass: M3eSegmentedButtonElement,\r\n react: React,\r\n events: {\r\n onInput: \"input\",\r\n onChange: \"change\",\r\n },\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eButtonSegmentElement } from \"@m3e/web/segmented-button\";\r\nexport type { M3eButtonSegmentElement } from \"@m3e/web/segmented-button\";\r\n\r\n/**\r\n * React binding for the `m3e-button-segment` Web Component from `@m3e/web/segmented-button`.\r\n *\r\n * This component renders the underlying `<m3e-button-segment>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-button-segment>` instance for imperative access.\r\n *\r\n * See the `m3e-button-segment` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eButtonSegment = createComponent({\r\n tagName: \"m3e-button-segment\",\r\n elementClass: M3eButtonSegmentElement,\r\n react: React,\r\n events: {\r\n onInput: \"input\",\r\n onChange: \"change\",\r\n onClick: \"click\",\r\n },\r\n});\r\n"],"names":["createComponent","react","tagName","elementClass","events","displayName","window","createReactComponent","M3eSegmentedButton","M3eSegmentedButtonElement","React","onInput","onChange","M3eButtonSegment","M3eButtonSegmentElement","onClick"],"mappings":";;;;;wKA6BM,SAAUA,GAAkEC,MAChFA,EAAKC,QACLA,EAAOC,aACPA,EAAYC,OACZA,EAAMC,YACNA,IAEA,MAAyB,oBAAXC,OACVC,EAA2B,CAAEN,QAAOC,UAASC,eAAcC,SAAQC,gBAChC,IACzC,CCpBO,MAAMG,EAAqBR,EAAgB,CAChDE,QAAS,uBACTC,aAAcM,EACdR,MAAOS,EACPN,OAAQ,CACNO,QAAS,QACTC,SAAU,YCNDC,EAAmBb,EAAgB,CAC9CE,QAAS,qBACTC,aAAcW,EACdb,MAAOS,EACPN,OAAQ,CACNO,QAAS,QACTC,SAAU,SACVG,QAAS"}
package/dist/select.js CHANGED
@@ -6,11 +6,42 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import { createComponent } from '@lit/react';
9
+ import { createComponent as createComponent$1 } from '@lit/react';
10
10
  import { M3eSelectElement } from '@m3e/web/select';
11
11
 
12
12
  /**
13
- * React binding for the `m3e-select` Web Component from `@m3e/select`.
13
+ * Creates an SSR-safe React component for a custom element. Properties are distinguished
14
+ * from attributes automatically, and events can be configured so they are added
15
+ * to the custom element as event listeners.
16
+ *
17
+ * @param options An options bag containing the parameters needed to generate a
18
+ * wrapped web component.
19
+ *
20
+ * @param options.react The React module, typically imported from the `react`
21
+ * npm package.
22
+ * @param options.tagName The custom element tag name registered via
23
+ * `customElements.define`.
24
+ * @param options.elementClass The custom element class registered via
25
+ * `customElements.define`.
26
+ * @param options.events An object listing events to which the component can
27
+ * listen. The object keys are the event property names passed in via React
28
+ * props and the object values are the names of the corresponding events
29
+ * generated by the custom element. For example, given `{onactivate:
30
+ * 'activate'}` an event function may be passed via the component's `onactivate`
31
+ * prop and will be called when the custom element fires its `activate` event.
32
+ * @param options.displayName A React component display name, used in debugging
33
+ * messages. Default value is inferred from the name of custom element class
34
+ * registered via `customElements.define`.
35
+ */
36
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
37
+ function createComponent({ react, tagName, elementClass, events, displayName, }) {
38
+ return typeof window !== "undefined"
39
+ ? createComponent$1({ react, tagName, elementClass, events, displayName })
40
+ : null;
41
+ }
42
+
43
+ /**
44
+ * React binding for the `m3e-select` Web Component from `@m3e/web/select`.
14
45
  *
15
46
  * This component renders the underlying `<m3e-select>` element and exposes its
16
47
  * properties, attributes, and events through an idiomatic React interface.
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sources":["../../src/select/Select.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"@lit/react\";\r\n\r\nimport { M3eSelectElement } from \"@m3e/web/select\";\r\nexport type { M3eSelectElement } from \"@m3e/web/select\";\r\n\r\n/**\r\n * React binding for the `m3e-select` Web Component from `@m3e/select`.\r\n *\r\n * This component renders the underlying `<m3e-select>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-select>` instance for imperative access.\r\n *\r\n * See the `m3e-select` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eSelect = createComponent({\r\n tagName: \"m3e-select\",\r\n elementClass: M3eSelectElement,\r\n react: React,\r\n events: {\r\n onInput: \"input\",\r\n onChange: \"change\",\r\n },\r\n});\r\n"],"names":[],"mappings":";;;;;;;;;;;AAMA;;;;;;;;;;;;AAYG;AACI,MAAM,SAAS,GAAG,eAAe,CAAC;AACvC,IAAA,OAAO,EAAE,YAAY;AACrB,IAAA,YAAY,EAAE,gBAAgB;AAC9B,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,MAAM,EAAE;AACN,QAAA,OAAO,EAAE,OAAO;AAChB,QAAA,QAAQ,EAAE,QAAQ;AACnB,KAAA;AACF,CAAA;;;;"}
1
+ {"version":3,"file":"select.js","sources":["../../src/utils/createComponent.ts","../../src/select/Select.ts"],"sourcesContent":["import { createComponent as createReactComponent, EventName, Options, ReactWebComponent } from \"@lit/react\";\r\n\r\ntype EventNames = Record<string, EventName | string>;\r\n\r\n/**\r\n * Creates an SSR-safe React component for a custom element. Properties are distinguished\r\n * from attributes automatically, and events can be configured so they are added\r\n * to the custom element as event listeners.\r\n *\r\n * @param options An options bag containing the parameters needed to generate a\r\n * wrapped web component.\r\n *\r\n * @param options.react The React module, typically imported from the `react`\r\n * npm package.\r\n * @param options.tagName The custom element tag name registered via\r\n * `customElements.define`.\r\n * @param options.elementClass The custom element class registered via\r\n * `customElements.define`.\r\n * @param options.events An object listing events to which the component can\r\n * listen. The object keys are the event property names passed in via React\r\n * props and the object values are the names of the corresponding events\r\n * generated by the custom element. For example, given `{onactivate:\r\n * 'activate'}` an event function may be passed via the component's `onactivate`\r\n * prop and will be called when the custom element fires its `activate` event.\r\n * @param options.displayName A React component display name, used in debugging\r\n * messages. Default value is inferred from the name of custom element class\r\n * registered via `customElements.define`.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\r\nexport function createComponent<I extends HTMLElement, E extends EventNames = {}>({\r\n react,\r\n tagName,\r\n elementClass,\r\n events,\r\n displayName,\r\n}: Options<I, E>): ReactWebComponent<I, E> {\r\n return typeof window !== \"undefined\"\r\n ? createReactComponent<I, E>({ react, tagName, elementClass, events, displayName })\r\n : <ReactWebComponent<I, E>>(<unknown>null);\r\n}\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eSelectElement } from \"@m3e/web/select\";\r\nexport type { M3eSelectElement } from \"@m3e/web/select\";\r\n\r\n/**\r\n * React binding for the `m3e-select` Web Component from `@m3e/web/select`.\r\n *\r\n * This component renders the underlying `<m3e-select>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-select>` instance for imperative access.\r\n *\r\n * See the `m3e-select` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eSelect = createComponent({\r\n tagName: \"m3e-select\",\r\n elementClass: M3eSelectElement,\r\n react: React,\r\n events: {\r\n onInput: \"input\",\r\n onChange: \"change\",\r\n },\r\n});\r\n"],"names":["createReactComponent"],"mappings":";;;;;;;;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACH;AACM,SAAU,eAAe,CAAmD,EAChF,KAAK,EACL,OAAO,EACP,YAAY,EACZ,MAAM,EACN,WAAW,GACG,EAAA;IACd,OAAO,OAAO,MAAM,KAAK;AACvB,UAAEA,iBAAoB,CAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE;UAC7C,IAAK;AAC9C;;ACjCA;;;;;;;;;;;;AAYG;AACI,MAAM,SAAS,GAAG,eAAe,CAAC;AACvC,IAAA,OAAO,EAAE,YAAY;AACrB,IAAA,YAAY,EAAE,gBAAgB;AAC9B,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,MAAM,EAAE;AACN,QAAA,OAAO,EAAE,OAAO;AAChB,QAAA,QAAQ,EAAE,QAAQ;AACnB,KAAA;AACF,CAAA;;;;"}
@@ -3,5 +3,5 @@
3
3
  * @license MIT
4
4
  * Copyright (c) 2025 matraic
5
5
  * See LICENSE file in the project root for full license text.
6
- */import e from"react";import{createComponent as t}from"@lit/react";import{M3eSelectElement as m}from"@m3e/web/select";const n=t({tagName:"m3e-select",elementClass:m,react:e,events:{onInput:"input",onChange:"change"}});export{n as M3eSelect};
6
+ */import e from"react";import{createComponent as t}from"@lit/react";import{M3eSelectElement as n}from"@m3e/web/select";const a=function({react:e,tagName:n,elementClass:a,events:m,displayName:s}){return"undefined"!=typeof window?t({react:e,tagName:n,elementClass:a,events:m,displayName:s}):null}({tagName:"m3e-select",elementClass:n,react:e,events:{onInput:"input",onChange:"change"}});export{a as M3eSelect};
7
7
  //# sourceMappingURL=select.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"select.min.js","sources":["../../src/select/Select.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"@lit/react\";\r\n\r\nimport { M3eSelectElement } from \"@m3e/web/select\";\r\nexport type { M3eSelectElement } from \"@m3e/web/select\";\r\n\r\n/**\r\n * React binding for the `m3e-select` Web Component from `@m3e/select`.\r\n *\r\n * This component renders the underlying `<m3e-select>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-select>` instance for imperative access.\r\n *\r\n * See the `m3e-select` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eSelect = createComponent({\r\n tagName: \"m3e-select\",\r\n elementClass: M3eSelectElement,\r\n react: React,\r\n events: {\r\n onInput: \"input\",\r\n onChange: \"change\",\r\n },\r\n});\r\n"],"names":["M3eSelect","createComponent","tagName","elementClass","M3eSelectElement","react","React","events","onInput","onChange"],"mappings":";;;;;wHAmBO,MAAMA,EAAYC,EAAgB,CACvCC,QAAS,aACTC,aAAcC,EACdC,MAAOC,EACPC,OAAQ,CACNC,QAAS,QACTC,SAAU"}
1
+ {"version":3,"file":"select.min.js","sources":["../../src/select/Select.ts","../../src/utils/createComponent.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eSelectElement } from \"@m3e/web/select\";\r\nexport type { M3eSelectElement } from \"@m3e/web/select\";\r\n\r\n/**\r\n * React binding for the `m3e-select` Web Component from `@m3e/web/select`.\r\n *\r\n * This component renders the underlying `<m3e-select>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-select>` instance for imperative access.\r\n *\r\n * See the `m3e-select` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eSelect = createComponent({\r\n tagName: \"m3e-select\",\r\n elementClass: M3eSelectElement,\r\n react: React,\r\n events: {\r\n onInput: \"input\",\r\n onChange: \"change\",\r\n },\r\n});\r\n","import { createComponent as createReactComponent, EventName, Options, ReactWebComponent } from \"@lit/react\";\r\n\r\ntype EventNames = Record<string, EventName | string>;\r\n\r\n/**\r\n * Creates an SSR-safe React component for a custom element. Properties are distinguished\r\n * from attributes automatically, and events can be configured so they are added\r\n * to the custom element as event listeners.\r\n *\r\n * @param options An options bag containing the parameters needed to generate a\r\n * wrapped web component.\r\n *\r\n * @param options.react The React module, typically imported from the `react`\r\n * npm package.\r\n * @param options.tagName The custom element tag name registered via\r\n * `customElements.define`.\r\n * @param options.elementClass The custom element class registered via\r\n * `customElements.define`.\r\n * @param options.events An object listing events to which the component can\r\n * listen. The object keys are the event property names passed in via React\r\n * props and the object values are the names of the corresponding events\r\n * generated by the custom element. For example, given `{onactivate:\r\n * 'activate'}` an event function may be passed via the component's `onactivate`\r\n * prop and will be called when the custom element fires its `activate` event.\r\n * @param options.displayName A React component display name, used in debugging\r\n * messages. Default value is inferred from the name of custom element class\r\n * registered via `customElements.define`.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\r\nexport function createComponent<I extends HTMLElement, E extends EventNames = {}>({\r\n react,\r\n tagName,\r\n elementClass,\r\n events,\r\n displayName,\r\n}: Options<I, E>): ReactWebComponent<I, E> {\r\n return typeof window !== \"undefined\"\r\n ? createReactComponent<I, E>({ react, tagName, elementClass, events, displayName })\r\n : <ReactWebComponent<I, E>>(<unknown>null);\r\n}\r\n"],"names":["M3eSelect","react","tagName","elementClass","events","displayName","window","createReactComponent","createComponent","M3eSelectElement","React","onInput","onChange"],"mappings":";;;;;wHAmBO,MAAMA,ECUP,UAA4EC,MAChFA,EAAKC,QACLA,EAAOC,aACPA,EAAYC,OACZA,EAAMC,YACNA,IAEA,MAAyB,oBAAXC,OACVC,EAA2B,CAAEN,QAAOC,UAASC,eAAcC,SAAQC,gBAChC,IACzC,CDpByBG,CAAgB,CACvCN,QAAS,aACTC,aAAcM,EACdR,MAAOS,EACPN,OAAQ,CACNO,QAAS,QACTC,SAAU"}
package/dist/shape.js CHANGED
@@ -6,11 +6,42 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import { createComponent } from '@lit/react';
9
+ import { createComponent as createComponent$1 } from '@lit/react';
10
10
  import { M3eShapeElement } from '@m3e/web/shape';
11
11
 
12
12
  /**
13
- * React binding for the `m3e-shape` Web Component from `@m3e/shape`.
13
+ * Creates an SSR-safe React component for a custom element. Properties are distinguished
14
+ * from attributes automatically, and events can be configured so they are added
15
+ * to the custom element as event listeners.
16
+ *
17
+ * @param options An options bag containing the parameters needed to generate a
18
+ * wrapped web component.
19
+ *
20
+ * @param options.react The React module, typically imported from the `react`
21
+ * npm package.
22
+ * @param options.tagName The custom element tag name registered via
23
+ * `customElements.define`.
24
+ * @param options.elementClass The custom element class registered via
25
+ * `customElements.define`.
26
+ * @param options.events An object listing events to which the component can
27
+ * listen. The object keys are the event property names passed in via React
28
+ * props and the object values are the names of the corresponding events
29
+ * generated by the custom element. For example, given `{onactivate:
30
+ * 'activate'}` an event function may be passed via the component's `onactivate`
31
+ * prop and will be called when the custom element fires its `activate` event.
32
+ * @param options.displayName A React component display name, used in debugging
33
+ * messages. Default value is inferred from the name of custom element class
34
+ * registered via `customElements.define`.
35
+ */
36
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
37
+ function createComponent({ react, tagName, elementClass, events, displayName, }) {
38
+ return typeof window !== "undefined"
39
+ ? createComponent$1({ react, tagName, elementClass, events, displayName })
40
+ : null;
41
+ }
42
+
43
+ /**
44
+ * React binding for the `m3e-shape` Web Component from `@m3e/web/shape`.
14
45
  *
15
46
  * This component renders the underlying `<m3e-shape>` element and exposes its
16
47
  * properties, attributes, and events through an idiomatic React interface.
package/dist/shape.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"shape.js","sources":["../../src/shape/Shape.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"@lit/react\";\r\n\r\nimport { M3eShapeElement } from \"@m3e/web/shape\";\r\nexport type { M3eShapeElement, ShapeName } from \"@m3e/web/shape\";\r\n\r\n/**\r\n * React binding for the `m3e-shape` Web Component from `@m3e/shape`.\r\n *\r\n * This component renders the underlying `<m3e-shape>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-shape>` instance for imperative access.\r\n *\r\n * See the `m3e-shape` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eShape = createComponent({\r\n tagName: \"m3e-shape\",\r\n elementClass: M3eShapeElement,\r\n react: React,\r\n});\r\n"],"names":[],"mappings":";;;;;;;;;;;AAMA;;;;;;;;;;;;AAYG;AACI,MAAM,QAAQ,GAAG,eAAe,CAAC;AACtC,IAAA,OAAO,EAAE,WAAW;AACpB,IAAA,YAAY,EAAE,eAAe;AAC7B,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;;;"}
1
+ {"version":3,"file":"shape.js","sources":["../../src/utils/createComponent.ts","../../src/shape/Shape.ts"],"sourcesContent":["import { createComponent as createReactComponent, EventName, Options, ReactWebComponent } from \"@lit/react\";\r\n\r\ntype EventNames = Record<string, EventName | string>;\r\n\r\n/**\r\n * Creates an SSR-safe React component for a custom element. Properties are distinguished\r\n * from attributes automatically, and events can be configured so they are added\r\n * to the custom element as event listeners.\r\n *\r\n * @param options An options bag containing the parameters needed to generate a\r\n * wrapped web component.\r\n *\r\n * @param options.react The React module, typically imported from the `react`\r\n * npm package.\r\n * @param options.tagName The custom element tag name registered via\r\n * `customElements.define`.\r\n * @param options.elementClass The custom element class registered via\r\n * `customElements.define`.\r\n * @param options.events An object listing events to which the component can\r\n * listen. The object keys are the event property names passed in via React\r\n * props and the object values are the names of the corresponding events\r\n * generated by the custom element. For example, given `{onactivate:\r\n * 'activate'}` an event function may be passed via the component's `onactivate`\r\n * prop and will be called when the custom element fires its `activate` event.\r\n * @param options.displayName A React component display name, used in debugging\r\n * messages. Default value is inferred from the name of custom element class\r\n * registered via `customElements.define`.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\r\nexport function createComponent<I extends HTMLElement, E extends EventNames = {}>({\r\n react,\r\n tagName,\r\n elementClass,\r\n events,\r\n displayName,\r\n}: Options<I, E>): ReactWebComponent<I, E> {\r\n return typeof window !== \"undefined\"\r\n ? createReactComponent<I, E>({ react, tagName, elementClass, events, displayName })\r\n : <ReactWebComponent<I, E>>(<unknown>null);\r\n}\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eShapeElement } from \"@m3e/web/shape\";\r\nexport type { M3eShapeElement, ShapeName } from \"@m3e/web/shape\";\r\n\r\n/**\r\n * React binding for the `m3e-shape` Web Component from `@m3e/web/shape`.\r\n *\r\n * This component renders the underlying `<m3e-shape>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-shape>` instance for imperative access.\r\n *\r\n * See the `m3e-shape` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eShape = createComponent({\r\n tagName: \"m3e-shape\",\r\n elementClass: M3eShapeElement,\r\n react: React,\r\n});\r\n"],"names":["createReactComponent"],"mappings":";;;;;;;;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACH;AACM,SAAU,eAAe,CAAmD,EAChF,KAAK,EACL,OAAO,EACP,YAAY,EACZ,MAAM,EACN,WAAW,GACG,EAAA;IACd,OAAO,OAAO,MAAM,KAAK;AACvB,UAAEA,iBAAoB,CAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE;UAC7C,IAAK;AAC9C;;ACjCA;;;;;;;;;;;;AAYG;AACI,MAAM,QAAQ,GAAG,eAAe,CAAC;AACtC,IAAA,OAAO,EAAE,WAAW;AACpB,IAAA,YAAY,EAAE,eAAe;AAC7B,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;;;"}
package/dist/shape.min.js CHANGED
@@ -3,5 +3,5 @@
3
3
  * @license MIT
4
4
  * Copyright (c) 2025 matraic
5
5
  * See LICENSE file in the project root for full license text.
6
- */import e from"react";import{createComponent as t}from"@lit/react";import{M3eShapeElement as m}from"@m3e/web/shape";const r=t({tagName:"m3e-shape",elementClass:m,react:e});export{r as M3eShape};
6
+ */import e from"react";import{createComponent as t}from"@lit/react";import{M3eShapeElement as a}from"@m3e/web/shape";const m=function({react:e,tagName:a,elementClass:m,events:n,displayName:r}){return"undefined"!=typeof window?t({react:e,tagName:a,elementClass:m,events:n,displayName:r}):null}({tagName:"m3e-shape",elementClass:a,react:e});export{m as M3eShape};
7
7
  //# sourceMappingURL=shape.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shape.min.js","sources":["../../src/shape/Shape.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"@lit/react\";\r\n\r\nimport { M3eShapeElement } from \"@m3e/web/shape\";\r\nexport type { M3eShapeElement, ShapeName } from \"@m3e/web/shape\";\r\n\r\n/**\r\n * React binding for the `m3e-shape` Web Component from `@m3e/shape`.\r\n *\r\n * This component renders the underlying `<m3e-shape>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-shape>` instance for imperative access.\r\n *\r\n * See the `m3e-shape` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eShape = createComponent({\r\n tagName: \"m3e-shape\",\r\n elementClass: M3eShapeElement,\r\n react: React,\r\n});\r\n"],"names":["M3eShape","createComponent","tagName","elementClass","M3eShapeElement","react","React"],"mappings":";;;;;sHAmBO,MAAMA,EAAWC,EAAgB,CACtCC,QAAS,YACTC,aAAcC,EACdC,MAAOC"}
1
+ {"version":3,"file":"shape.min.js","sources":["../../src/shape/Shape.ts","../../src/utils/createComponent.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eShapeElement } from \"@m3e/web/shape\";\r\nexport type { M3eShapeElement, ShapeName } from \"@m3e/web/shape\";\r\n\r\n/**\r\n * React binding for the `m3e-shape` Web Component from `@m3e/web/shape`.\r\n *\r\n * This component renders the underlying `<m3e-shape>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-shape>` instance for imperative access.\r\n *\r\n * See the `m3e-shape` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eShape = createComponent({\r\n tagName: \"m3e-shape\",\r\n elementClass: M3eShapeElement,\r\n react: React,\r\n});\r\n","import { createComponent as createReactComponent, EventName, Options, ReactWebComponent } from \"@lit/react\";\r\n\r\ntype EventNames = Record<string, EventName | string>;\r\n\r\n/**\r\n * Creates an SSR-safe React component for a custom element. Properties are distinguished\r\n * from attributes automatically, and events can be configured so they are added\r\n * to the custom element as event listeners.\r\n *\r\n * @param options An options bag containing the parameters needed to generate a\r\n * wrapped web component.\r\n *\r\n * @param options.react The React module, typically imported from the `react`\r\n * npm package.\r\n * @param options.tagName The custom element tag name registered via\r\n * `customElements.define`.\r\n * @param options.elementClass The custom element class registered via\r\n * `customElements.define`.\r\n * @param options.events An object listing events to which the component can\r\n * listen. The object keys are the event property names passed in via React\r\n * props and the object values are the names of the corresponding events\r\n * generated by the custom element. For example, given `{onactivate:\r\n * 'activate'}` an event function may be passed via the component's `onactivate`\r\n * prop and will be called when the custom element fires its `activate` event.\r\n * @param options.displayName A React component display name, used in debugging\r\n * messages. Default value is inferred from the name of custom element class\r\n * registered via `customElements.define`.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\r\nexport function createComponent<I extends HTMLElement, E extends EventNames = {}>({\r\n react,\r\n tagName,\r\n elementClass,\r\n events,\r\n displayName,\r\n}: Options<I, E>): ReactWebComponent<I, E> {\r\n return typeof window !== \"undefined\"\r\n ? createReactComponent<I, E>({ react, tagName, elementClass, events, displayName })\r\n : <ReactWebComponent<I, E>>(<unknown>null);\r\n}\r\n"],"names":["M3eShape","react","tagName","elementClass","events","displayName","window","createReactComponent","createComponent","M3eShapeElement","React"],"mappings":";;;;;sHAmBO,MAAMA,ECUP,UAA4EC,MAChFA,EAAKC,QACLA,EAAOC,aACPA,EAAYC,OACZA,EAAMC,YACNA,IAEA,MAAyB,oBAAXC,OACVC,EAA2B,CAAEN,QAAOC,UAASC,eAAcC,SAAQC,gBAChC,IACzC,CDpBwBG,CAAgB,CACtCN,QAAS,YACTC,aAAcM,EACdR,MAAOS"}
@@ -6,11 +6,42 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import { createComponent } from '@lit/react';
9
+ import { createComponent as createComponent$1 } from '@lit/react';
10
10
  import { M3eSlideGroupElement } from '@m3e/web/slide-group';
11
11
 
12
12
  /**
13
- * React binding for the `m3e-slide-group` Web Component from `@m3e/slide-group`.
13
+ * Creates an SSR-safe React component for a custom element. Properties are distinguished
14
+ * from attributes automatically, and events can be configured so they are added
15
+ * to the custom element as event listeners.
16
+ *
17
+ * @param options An options bag containing the parameters needed to generate a
18
+ * wrapped web component.
19
+ *
20
+ * @param options.react The React module, typically imported from the `react`
21
+ * npm package.
22
+ * @param options.tagName The custom element tag name registered via
23
+ * `customElements.define`.
24
+ * @param options.elementClass The custom element class registered via
25
+ * `customElements.define`.
26
+ * @param options.events An object listing events to which the component can
27
+ * listen. The object keys are the event property names passed in via React
28
+ * props and the object values are the names of the corresponding events
29
+ * generated by the custom element. For example, given `{onactivate:
30
+ * 'activate'}` an event function may be passed via the component's `onactivate`
31
+ * prop and will be called when the custom element fires its `activate` event.
32
+ * @param options.displayName A React component display name, used in debugging
33
+ * messages. Default value is inferred from the name of custom element class
34
+ * registered via `customElements.define`.
35
+ */
36
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
37
+ function createComponent({ react, tagName, elementClass, events, displayName, }) {
38
+ return typeof window !== "undefined"
39
+ ? createComponent$1({ react, tagName, elementClass, events, displayName })
40
+ : null;
41
+ }
42
+
43
+ /**
44
+ * React binding for the `m3e-slide-group` Web Component from `@m3e/web/slide-group`.
14
45
  *
15
46
  * This component renders the underlying `<m3e-slide-group>` element and exposes its
16
47
  * properties, attributes, and events through an idiomatic React interface.
@@ -1 +1 @@
1
- {"version":3,"file":"slide-group.js","sources":["../../src/slide-group/SlideGroup.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"@lit/react\";\r\n\r\nimport { M3eSlideGroupElement } from \"@m3e/web/slide-group\";\r\nexport type { M3eSlideGroupElement } from \"@m3e/web/slide-group\";\r\n\r\n/**\r\n * React binding for the `m3e-slide-group` Web Component from `@m3e/slide-group`.\r\n *\r\n * This component renders the underlying `<m3e-slide-group>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-slide-group>` instance for imperative access.\r\n *\r\n * See the `m3e-slide-group` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eSlideGroup = createComponent({\r\n tagName: \"m3e-slide-group\",\r\n elementClass: M3eSlideGroupElement,\r\n react: React,\r\n});\r\n"],"names":[],"mappings":";;;;;;;;;;;AAMA;;;;;;;;;;;;AAYG;AACI,MAAM,aAAa,GAAG,eAAe,CAAC;AAC3C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,YAAY,EAAE,oBAAoB;AAClC,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;;;"}
1
+ {"version":3,"file":"slide-group.js","sources":["../../src/utils/createComponent.ts","../../src/slide-group/SlideGroup.ts"],"sourcesContent":["import { createComponent as createReactComponent, EventName, Options, ReactWebComponent } from \"@lit/react\";\r\n\r\ntype EventNames = Record<string, EventName | string>;\r\n\r\n/**\r\n * Creates an SSR-safe React component for a custom element. Properties are distinguished\r\n * from attributes automatically, and events can be configured so they are added\r\n * to the custom element as event listeners.\r\n *\r\n * @param options An options bag containing the parameters needed to generate a\r\n * wrapped web component.\r\n *\r\n * @param options.react The React module, typically imported from the `react`\r\n * npm package.\r\n * @param options.tagName The custom element tag name registered via\r\n * `customElements.define`.\r\n * @param options.elementClass The custom element class registered via\r\n * `customElements.define`.\r\n * @param options.events An object listing events to which the component can\r\n * listen. The object keys are the event property names passed in via React\r\n * props and the object values are the names of the corresponding events\r\n * generated by the custom element. For example, given `{onactivate:\r\n * 'activate'}` an event function may be passed via the component's `onactivate`\r\n * prop and will be called when the custom element fires its `activate` event.\r\n * @param options.displayName A React component display name, used in debugging\r\n * messages. Default value is inferred from the name of custom element class\r\n * registered via `customElements.define`.\r\n */\r\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type\r\nexport function createComponent<I extends HTMLElement, E extends EventNames = {}>({\r\n react,\r\n tagName,\r\n elementClass,\r\n events,\r\n displayName,\r\n}: Options<I, E>): ReactWebComponent<I, E> {\r\n return typeof window !== \"undefined\"\r\n ? createReactComponent<I, E>({ react, tagName, elementClass, events, displayName })\r\n : <ReactWebComponent<I, E>>(<unknown>null);\r\n}\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eSlideGroupElement } from \"@m3e/web/slide-group\";\r\nexport type { M3eSlideGroupElement } from \"@m3e/web/slide-group\";\r\n\r\n/**\r\n * React binding for the `m3e-slide-group` Web Component from `@m3e/web/slide-group`.\r\n *\r\n * This component renders the underlying `<m3e-slide-group>` element and exposes its\r\n * properties, attributes, and events through an idiomatic React interface.\r\n *\r\n * Props map directly to element properties, and event handlers receive the\r\n * native DOM events dispatched by the component. Refs are forwarded to the\r\n * underlying `<m3e-slide-group>` instance for imperative access.\r\n *\r\n * See the `m3e-slide-group` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eSlideGroup = createComponent({\r\n tagName: \"m3e-slide-group\",\r\n elementClass: M3eSlideGroupElement,\r\n react: React,\r\n});\r\n"],"names":["createReactComponent"],"mappings":";;;;;;;;;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACH;AACM,SAAU,eAAe,CAAmD,EAChF,KAAK,EACL,OAAO,EACP,YAAY,EACZ,MAAM,EACN,WAAW,GACG,EAAA;IACd,OAAO,OAAO,MAAM,KAAK;AACvB,UAAEA,iBAAoB,CAAO,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE;UAC7C,IAAK;AAC9C;;ACjCA;;;;;;;;;;;;AAYG;AACI,MAAM,aAAa,GAAG,eAAe,CAAC;AAC3C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,YAAY,EAAE,oBAAoB;AAClC,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;;;"}
@@ -3,5 +3,5 @@
3
3
  * @license MIT
4
4
  * Copyright (c) 2025 matraic
5
5
  * See LICENSE file in the project root for full license text.
6
- */import e from"react";import{createComponent as r}from"@lit/react";import{M3eSlideGroupElement as t}from"@m3e/web/slide-group";const m=r({tagName:"m3e-slide-group",elementClass:t,react:e});export{m as M3eSlideGroup};
6
+ */import e from"react";import{createComponent as t}from"@lit/react";import{M3eSlideGroupElement as a}from"@m3e/web/slide-group";const m=function({react:e,tagName:a,elementClass:m,events:r,displayName:n}){return"undefined"!=typeof window?t({react:e,tagName:a,elementClass:m,events:r,displayName:n}):null}({tagName:"m3e-slide-group",elementClass:a,react:e});export{m as M3eSlideGroup};
7
7
  //# sourceMappingURL=slide-group.min.js.map