@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.
- package/README.md +1 -7
- package/dist/all.js +338 -91
- package/dist/all.js.map +1 -1
- package/dist/all.min.js +1 -1
- package/dist/all.min.js.map +1 -1
- package/dist/app-bar.js +33 -2
- package/dist/app-bar.js.map +1 -1
- package/dist/app-bar.min.js +1 -1
- package/dist/app-bar.min.js.map +1 -1
- package/dist/autocomplete.js +33 -2
- package/dist/autocomplete.js.map +1 -1
- package/dist/autocomplete.min.js +1 -1
- package/dist/autocomplete.min.js.map +1 -1
- package/dist/avatar.js +33 -2
- package/dist/avatar.js.map +1 -1
- package/dist/avatar.min.js +1 -1
- package/dist/avatar.min.js.map +1 -1
- package/dist/badge.js +33 -2
- package/dist/badge.js.map +1 -1
- package/dist/badge.min.js +1 -1
- package/dist/badge.min.js.map +1 -1
- package/dist/bottom-sheet.js +35 -4
- package/dist/bottom-sheet.js.map +1 -1
- package/dist/bottom-sheet.min.js +1 -1
- package/dist/bottom-sheet.min.js.map +1 -1
- package/dist/button-group.js +33 -2
- package/dist/button-group.js.map +1 -1
- package/dist/button-group.min.js +1 -1
- package/dist/button-group.min.js.map +1 -1
- package/dist/button.js +33 -2
- package/dist/button.js.map +1 -1
- package/dist/button.min.js +1 -1
- package/dist/button.min.js.map +1 -1
- package/dist/card.js +33 -2
- package/dist/card.js.map +1 -1
- package/dist/card.min.js +1 -1
- package/dist/card.min.js.map +1 -1
- package/dist/checkbox.js +33 -2
- package/dist/checkbox.js.map +1 -1
- package/dist/checkbox.min.js +1 -1
- package/dist/checkbox.min.js.map +1 -1
- package/dist/chips.js +40 -9
- package/dist/chips.js.map +1 -1
- package/dist/chips.min.js +1 -1
- package/dist/chips.min.js.map +1 -1
- package/dist/core.js +259 -0
- package/dist/core.js.map +1 -0
- package/dist/core.min.js +7 -0
- package/dist/core.min.js.map +1 -0
- package/dist/dialog.js +35 -4
- package/dist/dialog.js.map +1 -1
- package/dist/dialog.min.js +1 -1
- package/dist/dialog.min.js.map +1 -1
- package/dist/divider.js +33 -2
- package/dist/divider.js.map +1 -1
- package/dist/divider.min.js +1 -1
- package/dist/divider.min.js.map +1 -1
- package/dist/drawer-container.js +34 -3
- package/dist/drawer-container.js.map +1 -1
- package/dist/drawer-container.min.js +1 -1
- package/dist/drawer-container.min.js.map +1 -1
- package/dist/expansion-panel.js +34 -3
- package/dist/expansion-panel.js.map +1 -1
- package/dist/expansion-panel.min.js +1 -1
- package/dist/expansion-panel.min.js.map +1 -1
- package/dist/fab-menu.js +35 -4
- package/dist/fab-menu.js.map +1 -1
- package/dist/fab-menu.min.js +1 -1
- package/dist/fab-menu.min.js.map +1 -1
- package/dist/fab.js +33 -2
- package/dist/fab.js.map +1 -1
- package/dist/fab.min.js +1 -1
- package/dist/fab.min.js.map +1 -1
- package/dist/form-field.js +33 -2
- package/dist/form-field.js.map +1 -1
- package/dist/form-field.min.js +1 -1
- package/dist/form-field.min.js.map +1 -1
- package/dist/heading.js +33 -2
- package/dist/heading.js.map +1 -1
- package/dist/heading.min.js +1 -1
- package/dist/heading.min.js.map +1 -1
- package/dist/icon-button.js +33 -2
- package/dist/icon-button.js.map +1 -1
- package/dist/icon-button.min.js +1 -1
- package/dist/icon-button.min.js.map +1 -1
- package/dist/icon.js +33 -2
- package/dist/icon.js.map +1 -1
- package/dist/icon.min.js +1 -1
- package/dist/icon.min.js.map +1 -1
- package/dist/list.js +39 -8
- package/dist/list.js.map +1 -1
- package/dist/list.min.js +1 -1
- package/dist/list.min.js.map +1 -1
- package/dist/loading-indicator.js +33 -2
- package/dist/loading-indicator.js.map +1 -1
- package/dist/loading-indicator.min.js +1 -1
- package/dist/loading-indicator.min.js.map +1 -1
- package/dist/menu.js +38 -7
- package/dist/menu.js.map +1 -1
- package/dist/menu.min.js +1 -1
- package/dist/menu.min.js.map +1 -1
- package/dist/nav-bar.js +34 -3
- package/dist/nav-bar.js.map +1 -1
- package/dist/nav-bar.min.js +1 -1
- package/dist/nav-bar.min.js.map +1 -1
- package/dist/nav-menu.js +35 -4
- package/dist/nav-menu.js.map +1 -1
- package/dist/nav-menu.min.js +1 -1
- package/dist/nav-menu.min.js.map +1 -1
- package/dist/nav-rail.js +34 -3
- package/dist/nav-rail.js.map +1 -1
- package/dist/nav-rail.min.js +1 -1
- package/dist/nav-rail.min.js.map +1 -1
- package/dist/option.js +34 -3
- package/dist/option.js.map +1 -1
- package/dist/option.min.js +1 -1
- package/dist/option.min.js.map +1 -1
- package/dist/paginator.js +1 -1
- package/dist/paginator.js.map +1 -1
- package/dist/paginator.min.js.map +1 -1
- package/dist/progress-indicator.js +34 -3
- package/dist/progress-indicator.js.map +1 -1
- package/dist/progress-indicator.min.js +1 -1
- package/dist/progress-indicator.min.js.map +1 -1
- package/dist/radio-group.js +34 -3
- package/dist/radio-group.js.map +1 -1
- package/dist/radio-group.min.js +1 -1
- package/dist/radio-group.min.js.map +1 -1
- package/dist/segmented-button.js +34 -3
- package/dist/segmented-button.js.map +1 -1
- package/dist/segmented-button.min.js +1 -1
- package/dist/segmented-button.min.js.map +1 -1
- package/dist/select.js +33 -2
- package/dist/select.js.map +1 -1
- package/dist/select.min.js +1 -1
- package/dist/select.min.js.map +1 -1
- package/dist/shape.js +33 -2
- package/dist/shape.js.map +1 -1
- package/dist/shape.min.js +1 -1
- package/dist/shape.min.js.map +1 -1
- package/dist/slide-group.js +33 -2
- package/dist/slide-group.js.map +1 -1
- package/dist/slide-group.min.js +1 -1
- package/dist/slide-group.min.js.map +1 -1
- package/dist/slider.js +34 -3
- package/dist/slider.js.map +1 -1
- package/dist/slider.min.js +1 -1
- package/dist/slider.min.js.map +1 -1
- package/dist/split-button.js +33 -2
- package/dist/split-button.js.map +1 -1
- package/dist/split-button.min.js +1 -1
- package/dist/split-button.min.js.map +1 -1
- package/dist/src/all.d.ts +1 -0
- package/dist/src/all.d.ts.map +1 -1
- package/dist/src/app-bar/AppBar.d.ts +1 -1
- package/dist/src/autocomplete/Autocomplete.d.ts +1 -1
- package/dist/src/avatar/Avatar.d.ts +1 -1
- package/dist/src/badge/Badge.d.ts +1 -1
- package/dist/src/bottom-sheet/BottomSheet.d.ts +1 -1
- package/dist/src/bottom-sheet/BottomSheetAction.d.ts +1 -1
- package/dist/src/bottom-sheet/BottomSheetTrigger.d.ts +1 -1
- package/dist/src/button/Button.d.ts +1 -1
- package/dist/src/button-group/ButtonGroup.d.ts +1 -1
- package/dist/src/card/Card.d.ts +1 -1
- package/dist/src/checkbox/Checkbox.d.ts +1 -1
- package/dist/src/chips/AssistChip.d.ts +1 -1
- package/dist/src/chips/Chip.d.ts +1 -1
- package/dist/src/chips/ChipSet.d.ts +1 -1
- package/dist/src/chips/FilterChip.d.ts +1 -1
- package/dist/src/chips/FilterChipSet.d.ts +1 -1
- package/dist/src/chips/InputChip.d.ts +1 -1
- package/dist/src/chips/InputChipSet.d.ts +1 -1
- package/dist/src/chips/SuggestionChip.d.ts +1 -1
- package/dist/src/core/Collapsible.d.ts +22 -0
- package/dist/src/core/Collapsible.d.ts.map +1 -0
- package/dist/src/core/Elevation.d.ts +17 -0
- package/dist/src/core/Elevation.d.ts.map +1 -0
- package/dist/src/core/FocusRing.d.ts +17 -0
- package/dist/src/core/FocusRing.d.ts.map +1 -0
- package/dist/src/core/PseudoCheckbox.d.ts +17 -0
- package/dist/src/core/PseudoCheckbox.d.ts.map +1 -0
- package/dist/src/core/PseudoRadio.d.ts +17 -0
- package/dist/src/core/PseudoRadio.d.ts.map +1 -0
- package/dist/src/core/Ripple.d.ts +17 -0
- package/dist/src/core/Ripple.d.ts.map +1 -0
- package/dist/src/core/ScrollContainer.d.ts +17 -0
- package/dist/src/core/ScrollContainer.d.ts.map +1 -0
- package/dist/src/core/Slide.d.ts +17 -0
- package/dist/src/core/Slide.d.ts.map +1 -0
- package/dist/src/core/StateLayer.d.ts +17 -0
- package/dist/src/core/StateLayer.d.ts.map +1 -0
- package/dist/src/core/TextHighlight.d.ts +17 -0
- package/dist/src/core/TextHighlight.d.ts.map +1 -0
- package/dist/src/core/TextOverflow.d.ts +17 -0
- package/dist/src/core/TextOverflow.d.ts.map +1 -0
- package/dist/src/core/index.d.ts +12 -0
- package/dist/src/core/index.d.ts.map +1 -0
- package/dist/src/dialog/Dialog.d.ts +1 -1
- package/dist/src/dialog/DialogAction.d.ts +1 -1
- package/dist/src/dialog/DialogTrigger.d.ts +1 -1
- package/dist/src/divider/Divider.d.ts +1 -1
- package/dist/src/drawer-container/DrawerContainer.d.ts +1 -1
- package/dist/src/drawer-container/DrawerToggle.d.ts +1 -1
- package/dist/src/expansion-panel/Accordion.d.ts +1 -1
- package/dist/src/expansion-panel/ExpansionPanel.d.ts +1 -1
- package/dist/src/fab/Fab.d.ts +1 -1
- package/dist/src/fab-menu/FabMenu.d.ts +1 -1
- package/dist/src/fab-menu/FabMenuItem.d.ts +1 -1
- package/dist/src/fab-menu/FabMenuTrigger.d.ts +1 -1
- package/dist/src/form-field/FormField.d.ts +1 -1
- package/dist/src/heading/Heading.d.ts +1 -1
- package/dist/src/icon/Icon.d.ts +1 -1
- package/dist/src/icon-button/IconButton.d.ts +1 -1
- package/dist/src/list/ActionList.d.ts +1 -1
- package/dist/src/list/ExpandableListItem.d.ts +1 -1
- package/dist/src/list/List.d.ts +1 -1
- package/dist/src/list/ListAction.d.ts +1 -1
- package/dist/src/list/ListItem.d.ts +1 -1
- package/dist/src/list/ListOption.d.ts +1 -1
- package/dist/src/list/SelectionList.d.ts +1 -1
- package/dist/src/loading-indicator/LoadingIndicator.d.ts +1 -1
- package/dist/src/menu/Menu.d.ts +1 -1
- package/dist/src/menu/MenuItem.d.ts +1 -1
- package/dist/src/menu/MenuItemCheckbox.d.ts +1 -1
- package/dist/src/menu/MenuItemGroup.d.ts +1 -1
- package/dist/src/menu/MenuItemRadio.d.ts +1 -1
- package/dist/src/menu/MenuTrigger.d.ts +1 -1
- package/dist/src/nav-bar/NavBar.d.ts +1 -1
- package/dist/src/nav-bar/NavItem.d.ts +1 -1
- package/dist/src/nav-menu/NavMenu.d.ts +1 -1
- package/dist/src/nav-menu/NavMenuItem.d.ts +1 -1
- package/dist/src/nav-menu/NavMenuItemGroup.d.ts +1 -1
- package/dist/src/nav-rail/NavRail.d.ts +1 -1
- package/dist/src/nav-rail/NavRailToggle.d.ts +1 -1
- package/dist/src/option/OptGroup.d.ts +1 -1
- package/dist/src/option/Option.d.ts +1 -1
- package/dist/src/paginator/Paginator.d.ts +1 -1
- package/dist/src/progress-indicator/CircularProgressIndicator.d.ts +1 -1
- package/dist/src/progress-indicator/LinearProgressIndicator.d.ts +1 -1
- package/dist/src/radio-group/Radio.d.ts +1 -1
- package/dist/src/radio-group/RadioGroup.d.ts +1 -1
- package/dist/src/segmented-button/ButtonSegment.d.ts +1 -1
- package/dist/src/segmented-button/SegmentedButton.d.ts +1 -1
- package/dist/src/select/Select.d.ts +1 -1
- package/dist/src/shape/Shape.d.ts +1 -1
- package/dist/src/slide-group/SlideGroup.d.ts +1 -1
- package/dist/src/slider/Slider.d.ts +1 -1
- package/dist/src/slider/SliderThumb.d.ts +1 -1
- package/dist/src/split-button/SplitButton.d.ts +1 -1
- package/dist/src/stepper/Step.d.ts +1 -1
- package/dist/src/stepper/StepPanel.d.ts +1 -1
- package/dist/src/stepper/Stepper.d.ts +1 -1
- package/dist/src/stepper/StepperNext.d.ts +1 -1
- package/dist/src/stepper/StepperPrevious.d.ts +1 -1
- package/dist/src/stepper/StepperReset.d.ts +1 -1
- package/dist/src/switch/Switch.d.ts +1 -1
- package/dist/src/tabs/Tab.d.ts +1 -1
- package/dist/src/tabs/TabPanel.d.ts +1 -1
- package/dist/src/tabs/Tabs.d.ts +1 -1
- package/dist/src/textarea-autosize/TextareaAutosize.d.ts +1 -1
- package/dist/src/theme/Theme.d.ts +1 -1
- package/dist/src/toc/Toc.d.ts +1 -1
- package/dist/src/toolbar/Toolbar.d.ts +1 -1
- package/dist/src/tooltip/RichTooltip.d.ts +1 -1
- package/dist/src/tooltip/RichTooltipAction.d.ts +1 -1
- package/dist/src/tooltip/Tooltip.d.ts +1 -1
- package/dist/src/utils/createComponent.d.ts +29 -0
- package/dist/src/utils/createComponent.d.ts.map +1 -0
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/stepper.js +38 -7
- package/dist/stepper.js.map +1 -1
- package/dist/stepper.min.js +1 -1
- package/dist/stepper.min.js.map +1 -1
- package/dist/switch.js +33 -2
- package/dist/switch.js.map +1 -1
- package/dist/switch.min.js +1 -1
- package/dist/switch.min.js.map +1 -1
- package/dist/tabs.js +35 -4
- package/dist/tabs.js.map +1 -1
- package/dist/tabs.min.js +1 -1
- package/dist/tabs.min.js.map +1 -1
- package/dist/textarea-autosize.js +33 -2
- package/dist/textarea-autosize.js.map +1 -1
- package/dist/textarea-autosize.min.js +1 -1
- package/dist/textarea-autosize.min.js.map +1 -1
- package/dist/theme.js +33 -2
- package/dist/theme.js.map +1 -1
- package/dist/theme.min.js +1 -1
- package/dist/theme.min.js.map +1 -1
- package/dist/toc.js +33 -2
- package/dist/toc.js.map +1 -1
- package/dist/toc.min.js +1 -1
- package/dist/toc.min.js.map +1 -1
- package/dist/toolbar.js +33 -2
- package/dist/toolbar.js.map +1 -1
- package/dist/toolbar.min.js +1 -1
- package/dist/toolbar.min.js.map +1 -1
- package/dist/tooltip.js +35 -4
- package/dist/tooltip.js.map +1 -1
- package/dist/tooltip.min.js +1 -1
- package/dist/tooltip.min.js.map +1 -1
- package/package.json +6 -2
package/dist/core.js
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/**
|
|
3
|
+
* @license MIT
|
|
4
|
+
* Copyright (c) 2025 matraic
|
|
5
|
+
* See LICENSE file in the project root for full license text.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import { createComponent as createComponent$1 } from '@lit/react';
|
|
10
|
+
import { M3eCollapsibleElement, M3eElevationElement, M3eFocusRingElement, M3ePseudoCheckboxElement, M3ePseudoRadioElement, M3eRippleElement, M3eScrollContainerElement, M3eSlideElement, M3eStateLayerElement, M3eTextHighlightElement, M3eTextOverflowElement } from '@m3e/web/core';
|
|
11
|
+
|
|
12
|
+
/**
|
|
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-collapsible` Web Component from `@m3e/web/web/core`.
|
|
45
|
+
*
|
|
46
|
+
* This component renders the underlying `<m3e-collapsible>` element and exposes its
|
|
47
|
+
* properties, attributes, and events through an idiomatic React interface.
|
|
48
|
+
*
|
|
49
|
+
* Props map directly to element properties, and event handlers receive the
|
|
50
|
+
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
51
|
+
* underlying `<m3e-collapsible>` instance for imperative access.
|
|
52
|
+
*
|
|
53
|
+
* See the `m3e-collapsible` documentation for full details on behavior, styling,
|
|
54
|
+
* accessibility, and supported events.
|
|
55
|
+
*/
|
|
56
|
+
const M3eCollapsible = createComponent({
|
|
57
|
+
tagName: "m3e-collapsible",
|
|
58
|
+
elementClass: M3eCollapsibleElement,
|
|
59
|
+
react: React,
|
|
60
|
+
events: {
|
|
61
|
+
onOpening: "opening",
|
|
62
|
+
onOpened: "opened",
|
|
63
|
+
onClosing: "closing",
|
|
64
|
+
onClosed: "closed",
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* React binding for the `m3e-elevation` Web Component from `@m3e/web/web/core`.
|
|
70
|
+
*
|
|
71
|
+
* This component renders the underlying `<m3e-elevation>` element and exposes its
|
|
72
|
+
* properties, attributes, and events through an idiomatic React interface.
|
|
73
|
+
*
|
|
74
|
+
* Props map directly to element properties, and event handlers receive the
|
|
75
|
+
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
76
|
+
* underlying `<m3e-elevation>` instance for imperative access.
|
|
77
|
+
*
|
|
78
|
+
* See the `m3e-elevation` documentation for full details on behavior, styling,
|
|
79
|
+
* accessibility, and supported events.
|
|
80
|
+
*/
|
|
81
|
+
const M3eElevation = createComponent({
|
|
82
|
+
tagName: "m3e-elevation",
|
|
83
|
+
elementClass: M3eElevationElement,
|
|
84
|
+
react: React,
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* React binding for the `m3e-focus-ring` Web Component from `@m3e/web/web/core`.
|
|
89
|
+
*
|
|
90
|
+
* This component renders the underlying `<m3e-focus-ring>` element and exposes its
|
|
91
|
+
* properties, attributes, and events through an idiomatic React interface.
|
|
92
|
+
*
|
|
93
|
+
* Props map directly to element properties, and event handlers receive the
|
|
94
|
+
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
95
|
+
* underlying `<m3e-focus-ring>` instance for imperative access.
|
|
96
|
+
*
|
|
97
|
+
* See the `m3e-focus-ring` documentation for full details on behavior, styling,
|
|
98
|
+
* accessibility, and supported events.
|
|
99
|
+
*/
|
|
100
|
+
const M3eFocusRing = createComponent({
|
|
101
|
+
tagName: "m3e-focus-ring",
|
|
102
|
+
elementClass: M3eFocusRingElement,
|
|
103
|
+
react: React,
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* React binding for the `m3e-pseudo-checkbox` Web Component from `@m3e/web/web/core`.
|
|
108
|
+
*
|
|
109
|
+
* This component renders the underlying `<m3e-pseudo-checkbox>` element and exposes its
|
|
110
|
+
* properties, attributes, and events through an idiomatic React interface.
|
|
111
|
+
*
|
|
112
|
+
* Props map directly to element properties, and event handlers receive the
|
|
113
|
+
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
114
|
+
* underlying `<m3e-pseudo-checkbox>` instance for imperative access.
|
|
115
|
+
*
|
|
116
|
+
* See the `m3e-pseudo-checkbox` documentation for full details on behavior, styling,
|
|
117
|
+
* accessibility, and supported events.
|
|
118
|
+
*/
|
|
119
|
+
const M3ePseudoCheckbox = createComponent({
|
|
120
|
+
tagName: "m3e-pseudo-checkbox",
|
|
121
|
+
elementClass: M3ePseudoCheckboxElement,
|
|
122
|
+
react: React,
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* React binding for the `m3e-pseudo-radio` Web Component from `@m3e/web/web/core`.
|
|
127
|
+
*
|
|
128
|
+
* This component renders the underlying `<m3e-pseudo-radio>` element and exposes its
|
|
129
|
+
* properties, attributes, and events through an idiomatic React interface.
|
|
130
|
+
*
|
|
131
|
+
* Props map directly to element properties, and event handlers receive the
|
|
132
|
+
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
133
|
+
* underlying `<m3e-pseudo-radio>` instance for imperative access.
|
|
134
|
+
*
|
|
135
|
+
* See the `m3e-pseudo-radio` documentation for full details on behavior, styling,
|
|
136
|
+
* accessibility, and supported events.
|
|
137
|
+
*/
|
|
138
|
+
const M3ePseudoRadio = createComponent({
|
|
139
|
+
tagName: "m3e-pseudo-radio",
|
|
140
|
+
elementClass: M3ePseudoRadioElement,
|
|
141
|
+
react: React,
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* React binding for the `m3e-ripple` Web Component from `@m3e/web/web/core`.
|
|
146
|
+
*
|
|
147
|
+
* This component renders the underlying `<m3e-ripple>` element and exposes its
|
|
148
|
+
* properties, attributes, and events through an idiomatic React interface.
|
|
149
|
+
*
|
|
150
|
+
* Props map directly to element properties, and event handlers receive the
|
|
151
|
+
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
152
|
+
* underlying `<m3e-ripple>` instance for imperative access.
|
|
153
|
+
*
|
|
154
|
+
* See the `m3e-ripple` documentation for full details on behavior, styling,
|
|
155
|
+
* accessibility, and supported events.
|
|
156
|
+
*/
|
|
157
|
+
const M3eRipple = createComponent({
|
|
158
|
+
tagName: "m3e-ripple",
|
|
159
|
+
elementClass: M3eRippleElement,
|
|
160
|
+
react: React,
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* React binding for the `m3e-scroll-container` Web Component from `@m3e/web/web/core`.
|
|
165
|
+
*
|
|
166
|
+
* This component renders the underlying `<m3e-scroll-container>` element and exposes its
|
|
167
|
+
* properties, attributes, and events through an idiomatic React interface.
|
|
168
|
+
*
|
|
169
|
+
* Props map directly to element properties, and event handlers receive the
|
|
170
|
+
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
171
|
+
* underlying `<m3e-scroll-container>` instance for imperative access.
|
|
172
|
+
*
|
|
173
|
+
* See the `m3e-scroll-container` documentation for full details on behavior, styling,
|
|
174
|
+
* accessibility, and supported events.
|
|
175
|
+
*/
|
|
176
|
+
const M3eScrollContainer = createComponent({
|
|
177
|
+
tagName: "m3e-scroll-container",
|
|
178
|
+
elementClass: M3eScrollContainerElement,
|
|
179
|
+
react: React,
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* React binding for the `m3e-slide` Web Component from `@m3e/web/web/core`.
|
|
184
|
+
*
|
|
185
|
+
* This component renders the underlying `<m3e-slide>` element and exposes its
|
|
186
|
+
* properties, attributes, and events through an idiomatic React interface.
|
|
187
|
+
*
|
|
188
|
+
* Props map directly to element properties, and event handlers receive the
|
|
189
|
+
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
190
|
+
* underlying `<m3e-slide>` instance for imperative access.
|
|
191
|
+
*
|
|
192
|
+
* See the `m3e-slide` documentation for full details on behavior, styling,
|
|
193
|
+
* accessibility, and supported events.
|
|
194
|
+
*/
|
|
195
|
+
const M3eSlide = createComponent({
|
|
196
|
+
tagName: "m3e-slide",
|
|
197
|
+
elementClass: M3eSlideElement,
|
|
198
|
+
react: React,
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* React binding for the `m3e-state-layer` Web Component from `@m3e/web/web/core`.
|
|
203
|
+
*
|
|
204
|
+
* This component renders the underlying `<m3e-state-layer>` element and exposes its
|
|
205
|
+
* properties, attributes, and events through an idiomatic React interface.
|
|
206
|
+
*
|
|
207
|
+
* Props map directly to element properties, and event handlers receive the
|
|
208
|
+
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
209
|
+
* underlying `<m3e-state-layer>` instance for imperative access.
|
|
210
|
+
*
|
|
211
|
+
* See the `m3e-state-layer` documentation for full details on behavior, styling,
|
|
212
|
+
* accessibility, and supported events.
|
|
213
|
+
*/
|
|
214
|
+
const M3eStateLayer = createComponent({
|
|
215
|
+
tagName: "m3e-state-layer",
|
|
216
|
+
elementClass: M3eStateLayerElement,
|
|
217
|
+
react: React,
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* React binding for the `m3e-text-highlight` Web Component from `@m3e/web/web/core`.
|
|
222
|
+
*
|
|
223
|
+
* This component renders the underlying `<m3e-text-highlight>` element and exposes its
|
|
224
|
+
* properties, attributes, and events through an idiomatic React interface.
|
|
225
|
+
*
|
|
226
|
+
* Props map directly to element properties, and event handlers receive the
|
|
227
|
+
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
228
|
+
* underlying `<m3e-text-highlight>` instance for imperative access.
|
|
229
|
+
*
|
|
230
|
+
* See the `m3e-text-highlight` documentation for full details on behavior, styling,
|
|
231
|
+
* accessibility, and supported events.
|
|
232
|
+
*/
|
|
233
|
+
const M3eTextHighlight = createComponent({
|
|
234
|
+
tagName: "m3e-text-highlight",
|
|
235
|
+
elementClass: M3eTextHighlightElement,
|
|
236
|
+
react: React,
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* React binding for the `m3e-text-overflow` Web Component from `@m3e/web/web/core`.
|
|
241
|
+
*
|
|
242
|
+
* This component renders the underlying `<m3e-text-overflow>` element and exposes its
|
|
243
|
+
* properties, attributes, and events through an idiomatic React interface.
|
|
244
|
+
*
|
|
245
|
+
* Props map directly to element properties, and event handlers receive the
|
|
246
|
+
* native DOM events dispatched by the component. Refs are forwarded to the
|
|
247
|
+
* underlying `<m3e-text-overflow>` instance for imperative access.
|
|
248
|
+
*
|
|
249
|
+
* See the `m3e-text-overflow` documentation for full details on behavior, styling,
|
|
250
|
+
* accessibility, and supported events.
|
|
251
|
+
*/
|
|
252
|
+
const M3eTextOverflow = createComponent({
|
|
253
|
+
tagName: "m3e-text-overflow",
|
|
254
|
+
elementClass: M3eTextOverflowElement,
|
|
255
|
+
react: React,
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
export { M3eCollapsible, M3eElevation, M3eFocusRing, M3ePseudoCheckbox, M3ePseudoRadio, M3eRipple, M3eScrollContainer, M3eSlide, M3eStateLayer, M3eTextHighlight, M3eTextOverflow };
|
|
259
|
+
//# sourceMappingURL=core.js.map
|
package/dist/core.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.js","sources":["../../src/utils/createComponent.ts","../../src/core/Collapsible.ts","../../src/core/Elevation.ts","../../src/core/FocusRing.ts","../../src/core/PseudoCheckbox.ts","../../src/core/PseudoRadio.ts","../../src/core/Ripple.ts","../../src/core/ScrollContainer.ts","../../src/core/Slide.ts","../../src/core/StateLayer.ts","../../src/core/TextHighlight.ts","../../src/core/TextOverflow.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 { M3eCollapsibleElement } from \"@m3e/web/core\";\r\nexport type { M3eCollapsibleElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-collapsible` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-collapsible>` 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-collapsible>` instance for imperative access.\r\n *\r\n * See the `m3e-collapsible` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eCollapsible = createComponent({\r\n tagName: \"m3e-collapsible\",\r\n elementClass: M3eCollapsibleElement,\r\n react: React,\r\n events: {\r\n onOpening: \"opening\",\r\n onOpened: \"opened\",\r\n onClosing: \"closing\",\r\n onClosed: \"closed\",\r\n },\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eElevationElement } from \"@m3e/web/core\";\r\nexport type { M3eElevationElement, ElevationLevel } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-elevation` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-elevation>` 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-elevation>` instance for imperative access.\r\n *\r\n * See the `m3e-elevation` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eElevation = createComponent({\r\n tagName: \"m3e-elevation\",\r\n elementClass: M3eElevationElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eFocusRingElement } from \"@m3e/web/core\";\r\nexport type { M3eFocusRingElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-focus-ring` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-focus-ring>` 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-focus-ring>` instance for imperative access.\r\n *\r\n * See the `m3e-focus-ring` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eFocusRing = createComponent({\r\n tagName: \"m3e-focus-ring\",\r\n elementClass: M3eFocusRingElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3ePseudoCheckboxElement } from \"@m3e/web/core\";\r\nexport type { M3ePseudoCheckboxElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-pseudo-checkbox` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-pseudo-checkbox>` 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-pseudo-checkbox>` instance for imperative access.\r\n *\r\n * See the `m3e-pseudo-checkbox` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3ePseudoCheckbox = createComponent({\r\n tagName: \"m3e-pseudo-checkbox\",\r\n elementClass: M3ePseudoCheckboxElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3ePseudoRadioElement } from \"@m3e/web/core\";\r\nexport type { M3ePseudoRadioElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-pseudo-radio` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-pseudo-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-pseudo-radio>` instance for imperative access.\r\n *\r\n * See the `m3e-pseudo-radio` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3ePseudoRadio = createComponent({\r\n tagName: \"m3e-pseudo-radio\",\r\n elementClass: M3ePseudoRadioElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eRippleElement } from \"@m3e/web/core\";\r\nexport type { M3eRippleElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-ripple` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-ripple>` 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-ripple>` instance for imperative access.\r\n *\r\n * See the `m3e-ripple` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eRipple = createComponent({\r\n tagName: \"m3e-ripple\",\r\n elementClass: M3eRippleElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eScrollContainerElement } from \"@m3e/web/core\";\r\nexport type { M3eScrollContainerElement, ScrollDividers } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-scroll-container` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-scroll-container>` 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-scroll-container>` instance for imperative access.\r\n *\r\n * See the `m3e-scroll-container` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eScrollContainer = createComponent({\r\n tagName: \"m3e-scroll-container\",\r\n elementClass: M3eScrollContainerElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eSlideElement } from \"@m3e/web/core\";\r\nexport type { M3eSlideElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-slide` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-slide>` 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>` instance for imperative access.\r\n *\r\n * See the `m3e-slide` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eSlide = createComponent({\r\n tagName: \"m3e-slide\",\r\n elementClass: M3eSlideElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eStateLayerElement } from \"@m3e/web/core\";\r\nexport type { M3eStateLayerElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-state-layer` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-state-layer>` 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-state-layer>` instance for imperative access.\r\n *\r\n * See the `m3e-state-layer` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eStateLayer = createComponent({\r\n tagName: \"m3e-state-layer\",\r\n elementClass: M3eStateLayerElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eTextHighlightElement } from \"@m3e/web/core\";\r\nexport type { M3eTextHighlightElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-text-highlight` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-text-highlight>` 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-text-highlight>` instance for imperative access.\r\n *\r\n * See the `m3e-text-highlight` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eTextHighlight = createComponent({\r\n tagName: \"m3e-text-highlight\",\r\n elementClass: M3eTextHighlightElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eTextOverflowElement } from \"@m3e/web/core\";\r\nexport type { M3eTextOverflowElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-text-overflow` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-text-overflow>` 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-text-overflow>` instance for imperative access.\r\n *\r\n * See the `m3e-text-overflow` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eTextOverflow = createComponent({\r\n tagName: \"m3e-text-overflow\",\r\n elementClass: M3eTextOverflowElement,\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,cAAc,GAAG,eAAe,CAAC;AAC5C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,YAAY,EAAE,qBAAqB;AACnC,IAAA,KAAK,EAAE,KAAK;AACZ,IAAA,MAAM,EAAE;AACN,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,QAAQ,EAAE,QAAQ;AAClB,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,QAAQ,EAAE,QAAQ;AACnB,KAAA;AACF,CAAA;;ACvBD;;;;;;;;;;;;AAYG;AACI,MAAM,YAAY,GAAG,eAAe,CAAC;AAC1C,IAAA,OAAO,EAAE,eAAe;AACxB,IAAA,YAAY,EAAE,mBAAmB;AACjC,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;ACjBD;;;;;;;;;;;;AAYG;AACI,MAAM,YAAY,GAAG,eAAe,CAAC;AAC1C,IAAA,OAAO,EAAE,gBAAgB;AACzB,IAAA,YAAY,EAAE,mBAAmB;AACjC,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;ACjBD;;;;;;;;;;;;AAYG;AACI,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAC/C,IAAA,OAAO,EAAE,qBAAqB;AAC9B,IAAA,YAAY,EAAE,wBAAwB;AACtC,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;ACjBD;;;;;;;;;;;;AAYG;AACI,MAAM,cAAc,GAAG,eAAe,CAAC;AAC5C,IAAA,OAAO,EAAE,kBAAkB;AAC3B,IAAA,YAAY,EAAE,qBAAqB;AACnC,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;ACjBD;;;;;;;;;;;;AAYG;AACI,MAAM,SAAS,GAAG,eAAe,CAAC;AACvC,IAAA,OAAO,EAAE,YAAY;AACrB,IAAA,YAAY,EAAE,gBAAgB;AAC9B,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;ACjBD;;;;;;;;;;;;AAYG;AACI,MAAM,kBAAkB,GAAG,eAAe,CAAC;AAChD,IAAA,OAAO,EAAE,sBAAsB;AAC/B,IAAA,YAAY,EAAE,yBAAyB;AACvC,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;ACjBD;;;;;;;;;;;;AAYG;AACI,MAAM,QAAQ,GAAG,eAAe,CAAC;AACtC,IAAA,OAAO,EAAE,WAAW;AACpB,IAAA,YAAY,EAAE,eAAe;AAC7B,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;ACjBD;;;;;;;;;;;;AAYG;AACI,MAAM,aAAa,GAAG,eAAe,CAAC;AAC3C,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,YAAY,EAAE,oBAAoB;AAClC,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;ACjBD;;;;;;;;;;;;AAYG;AACI,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAC9C,IAAA,OAAO,EAAE,oBAAoB;AAC7B,IAAA,YAAY,EAAE,uBAAuB;AACrC,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;ACjBD;;;;;;;;;;;;AAYG;AACI,MAAM,eAAe,GAAG,eAAe,CAAC;AAC7C,IAAA,OAAO,EAAE,mBAAmB;AAC5B,IAAA,YAAY,EAAE,sBAAsB;AACpC,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;;;"}
|
package/dist/core.min.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
/**
|
|
3
|
+
* @license MIT
|
|
4
|
+
* Copyright (c) 2025 matraic
|
|
5
|
+
* See LICENSE file in the project root for full license text.
|
|
6
|
+
*/import e from"react";import{createComponent as a}from"@lit/react";import{M3eCollapsibleElement as t,M3eElevationElement as l,M3eFocusRingElement as m,M3ePseudoCheckboxElement as s,M3ePseudoRadioElement as n,M3eRippleElement as o,M3eScrollContainerElement as r,M3eSlideElement as c,M3eStateLayerElement as i,M3eTextHighlightElement as g,M3eTextOverflowElement as p}from"@m3e/web/core";function C({react:e,tagName:t,elementClass:l,events:m,displayName:s}){return"undefined"!=typeof window?a({react:e,tagName:t,elementClass:l,events:m,displayName:s}):null}const N=C({tagName:"m3e-collapsible",elementClass:t,react:e,events:{onOpening:"opening",onOpened:"opened",onClosing:"closing",onClosed:"closed"}}),d=C({tagName:"m3e-elevation",elementClass:l,react:e}),f=C({tagName:"m3e-focus-ring",elementClass:m,react:e}),u=C({tagName:"m3e-pseudo-checkbox",elementClass:s,react:e}),v=C({tagName:"m3e-pseudo-radio",elementClass:n,react:e}),h=C({tagName:"m3e-ripple",elementClass:o,react:e}),w=C({tagName:"m3e-scroll-container",elementClass:r,react:e}),x=C({tagName:"m3e-slide",elementClass:c,react:e}),y=C({tagName:"m3e-state-layer",elementClass:i,react:e}),b=C({tagName:"m3e-text-highlight",elementClass:g,react:e}),O=C({tagName:"m3e-text-overflow",elementClass:p,react:e});export{N as M3eCollapsible,d as M3eElevation,f as M3eFocusRing,u as M3ePseudoCheckbox,v as M3ePseudoRadio,h as M3eRipple,w as M3eScrollContainer,x as M3eSlide,y as M3eStateLayer,b as M3eTextHighlight,O as M3eTextOverflow};
|
|
7
|
+
//# sourceMappingURL=core.min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.min.js","sources":["../../src/utils/createComponent.ts","../../src/core/Collapsible.ts","../../src/core/Elevation.ts","../../src/core/FocusRing.ts","../../src/core/PseudoCheckbox.ts","../../src/core/PseudoRadio.ts","../../src/core/Ripple.ts","../../src/core/ScrollContainer.ts","../../src/core/Slide.ts","../../src/core/StateLayer.ts","../../src/core/TextHighlight.ts","../../src/core/TextOverflow.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 { M3eCollapsibleElement } from \"@m3e/web/core\";\r\nexport type { M3eCollapsibleElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-collapsible` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-collapsible>` 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-collapsible>` instance for imperative access.\r\n *\r\n * See the `m3e-collapsible` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eCollapsible = createComponent({\r\n tagName: \"m3e-collapsible\",\r\n elementClass: M3eCollapsibleElement,\r\n react: React,\r\n events: {\r\n onOpening: \"opening\",\r\n onOpened: \"opened\",\r\n onClosing: \"closing\",\r\n onClosed: \"closed\",\r\n },\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eElevationElement } from \"@m3e/web/core\";\r\nexport type { M3eElevationElement, ElevationLevel } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-elevation` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-elevation>` 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-elevation>` instance for imperative access.\r\n *\r\n * See the `m3e-elevation` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eElevation = createComponent({\r\n tagName: \"m3e-elevation\",\r\n elementClass: M3eElevationElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eFocusRingElement } from \"@m3e/web/core\";\r\nexport type { M3eFocusRingElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-focus-ring` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-focus-ring>` 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-focus-ring>` instance for imperative access.\r\n *\r\n * See the `m3e-focus-ring` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eFocusRing = createComponent({\r\n tagName: \"m3e-focus-ring\",\r\n elementClass: M3eFocusRingElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3ePseudoCheckboxElement } from \"@m3e/web/core\";\r\nexport type { M3ePseudoCheckboxElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-pseudo-checkbox` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-pseudo-checkbox>` 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-pseudo-checkbox>` instance for imperative access.\r\n *\r\n * See the `m3e-pseudo-checkbox` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3ePseudoCheckbox = createComponent({\r\n tagName: \"m3e-pseudo-checkbox\",\r\n elementClass: M3ePseudoCheckboxElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3ePseudoRadioElement } from \"@m3e/web/core\";\r\nexport type { M3ePseudoRadioElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-pseudo-radio` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-pseudo-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-pseudo-radio>` instance for imperative access.\r\n *\r\n * See the `m3e-pseudo-radio` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3ePseudoRadio = createComponent({\r\n tagName: \"m3e-pseudo-radio\",\r\n elementClass: M3ePseudoRadioElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eRippleElement } from \"@m3e/web/core\";\r\nexport type { M3eRippleElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-ripple` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-ripple>` 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-ripple>` instance for imperative access.\r\n *\r\n * See the `m3e-ripple` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eRipple = createComponent({\r\n tagName: \"m3e-ripple\",\r\n elementClass: M3eRippleElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eScrollContainerElement } from \"@m3e/web/core\";\r\nexport type { M3eScrollContainerElement, ScrollDividers } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-scroll-container` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-scroll-container>` 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-scroll-container>` instance for imperative access.\r\n *\r\n * See the `m3e-scroll-container` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eScrollContainer = createComponent({\r\n tagName: \"m3e-scroll-container\",\r\n elementClass: M3eScrollContainerElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eSlideElement } from \"@m3e/web/core\";\r\nexport type { M3eSlideElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-slide` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-slide>` 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>` instance for imperative access.\r\n *\r\n * See the `m3e-slide` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eSlide = createComponent({\r\n tagName: \"m3e-slide\",\r\n elementClass: M3eSlideElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eStateLayerElement } from \"@m3e/web/core\";\r\nexport type { M3eStateLayerElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-state-layer` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-state-layer>` 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-state-layer>` instance for imperative access.\r\n *\r\n * See the `m3e-state-layer` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eStateLayer = createComponent({\r\n tagName: \"m3e-state-layer\",\r\n elementClass: M3eStateLayerElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eTextHighlightElement } from \"@m3e/web/core\";\r\nexport type { M3eTextHighlightElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-text-highlight` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-text-highlight>` 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-text-highlight>` instance for imperative access.\r\n *\r\n * See the `m3e-text-highlight` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eTextHighlight = createComponent({\r\n tagName: \"m3e-text-highlight\",\r\n elementClass: M3eTextHighlightElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eTextOverflowElement } from \"@m3e/web/core\";\r\nexport type { M3eTextOverflowElement } from \"@m3e/web/core\";\r\n\r\n/**\r\n * React binding for the `m3e-text-overflow` Web Component from `@m3e/web/web/core`.\r\n *\r\n * This component renders the underlying `<m3e-text-overflow>` 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-text-overflow>` instance for imperative access.\r\n *\r\n * See the `m3e-text-overflow` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eTextOverflow = createComponent({\r\n tagName: \"m3e-text-overflow\",\r\n elementClass: M3eTextOverflowElement,\r\n react: React,\r\n});\r\n"],"names":["createComponent","react","tagName","elementClass","events","displayName","window","createReactComponent","M3eCollapsible","M3eCollapsibleElement","React","onOpening","onOpened","onClosing","onClosed","M3eElevation","M3eElevationElement","M3eFocusRing","M3eFocusRingElement","M3ePseudoCheckbox","M3ePseudoCheckboxElement","M3ePseudoRadio","M3ePseudoRadioElement","M3eRipple","M3eRippleElement","M3eScrollContainer","M3eScrollContainerElement","M3eSlide","M3eSlideElement","M3eStateLayer","M3eStateLayerElement","M3eTextHighlight","M3eTextHighlightElement","M3eTextOverflow","M3eTextOverflowElement"],"mappings":";;;;;mYA6BM,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,EAAiBR,EAAgB,CAC5CE,QAAS,kBACTC,aAAcM,EACdR,MAAOS,EACPN,OAAQ,CACNO,UAAW,UACXC,SAAU,SACVC,UAAW,UACXC,SAAU,YCRDC,EAAef,EAAgB,CAC1CE,QAAS,gBACTC,aAAca,EACdf,MAAOS,ICHIO,EAAejB,EAAgB,CAC1CE,QAAS,iBACTC,aAAce,EACdjB,MAAOS,ICHIS,EAAoBnB,EAAgB,CAC/CE,QAAS,sBACTC,aAAciB,EACdnB,MAAOS,ICHIW,EAAiBrB,EAAgB,CAC5CE,QAAS,mBACTC,aAAcmB,EACdrB,MAAOS,ICHIa,EAAYvB,EAAgB,CACvCE,QAAS,aACTC,aAAcqB,EACdvB,MAAOS,ICHIe,EAAqBzB,EAAgB,CAChDE,QAAS,uBACTC,aAAcuB,EACdzB,MAAOS,ICHIiB,EAAW3B,EAAgB,CACtCE,QAAS,YACTC,aAAcyB,EACd3B,MAAOS,ICHImB,EAAgB7B,EAAgB,CAC3CE,QAAS,kBACTC,aAAc2B,EACd7B,MAAOS,ICHIqB,EAAmB/B,EAAgB,CAC9CE,QAAS,qBACTC,aAAc6B,EACd/B,MAAOS,ICHIuB,EAAkBjC,EAAgB,CAC7CE,QAAS,oBACTC,aAAc+B,EACdjC,MAAOS"}
|
package/dist/dialog.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 { M3eDialogElement, M3eDialogActionElement, M3eDialogTriggerElement } from '@m3e/web/dialog';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* React
|
|
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-dialog` Web Component from `@m3e/web/dialog`.
|
|
14
45
|
*
|
|
15
46
|
* This component renders the underlying `<m3e-dialog>` element and exposes its
|
|
16
47
|
* properties, attributes, and events through an idiomatic React interface.
|
|
@@ -36,7 +67,7 @@ const M3eDialog = createComponent({
|
|
|
36
67
|
});
|
|
37
68
|
|
|
38
69
|
/**
|
|
39
|
-
* React binding for the `m3e-dialog-action` Web Component from `@m3e/dialog`.
|
|
70
|
+
* React binding for the `m3e-dialog-action` Web Component from `@m3e/web/dialog`.
|
|
40
71
|
*
|
|
41
72
|
* This component renders the underlying `<m3e-dialog-action>` element and exposes its
|
|
42
73
|
* properties, attributes, and events through an idiomatic React interface.
|
|
@@ -55,7 +86,7 @@ const M3eDialogAction = createComponent({
|
|
|
55
86
|
});
|
|
56
87
|
|
|
57
88
|
/**
|
|
58
|
-
* React binding for the `m3e-dialog-trigger` Web Component from `@m3e/dialog`.
|
|
89
|
+
* React binding for the `m3e-dialog-trigger` Web Component from `@m3e/web/dialog`.
|
|
59
90
|
*
|
|
60
91
|
* This component renders the underlying `<m3e-dialog-trigger>` element and exposes its
|
|
61
92
|
* properties, attributes, and events through an idiomatic React interface.
|
package/dist/dialog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sources":["../../src/dialog/Dialog.ts","../../src/dialog/DialogAction.ts","../../src/dialog/DialogTrigger.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"
|
|
1
|
+
{"version":3,"file":"dialog.js","sources":["../../src/utils/createComponent.ts","../../src/dialog/Dialog.ts","../../src/dialog/DialogAction.ts","../../src/dialog/DialogTrigger.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 { M3eDialogElement } from \"@m3e/web/dialog\";\r\nexport type { M3eDialogElement } from \"@m3e/web/dialog\";\r\n\r\n/**\r\n * React binding for the `m3e-dialog` Web Component from `@m3e/web/dialog`.\r\n *\r\n * This component renders the underlying `<m3e-dialog>` 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-dialog>` instance for imperative access.\r\n *\r\n * See the `m3e-dialog` documentation in `@m3e/dialog` for full details on behavior,\r\n * styling, accessibility, and supported events.\r\n */\r\nexport const M3eDialog = createComponent({\r\n tagName: \"m3e-dialog\",\r\n elementClass: M3eDialogElement,\r\n react: React,\r\n events: {\r\n onOpening: \"opening\",\r\n onOpened: \"opened\",\r\n onClosing: \"closing\",\r\n onClosed: \"closed\",\r\n onCancel: \"cancel\",\r\n },\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eDialogActionElement } from \"@m3e/web/dialog\";\r\nexport type { M3eDialogActionElement } from \"@m3e/web/dialog\";\r\n\r\n/**\r\n * React binding for the `m3e-dialog-action` Web Component from `@m3e/web/dialog`.\r\n *\r\n * This component renders the underlying `<m3e-dialog-action>` 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-dialog-action>` instance for imperative access.\r\n *\r\n * See the `m3e-dialog-action` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eDialogAction = createComponent({\r\n tagName: \"m3e-dialog-action\",\r\n elementClass: M3eDialogActionElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eDialogTriggerElement } from \"@m3e/web/dialog\";\r\nexport type { M3eDialogTriggerElement } from \"@m3e/web/dialog\";\r\n\r\n/**\r\n * React binding for the `m3e-dialog-trigger` Web Component from `@m3e/web/dialog`.\r\n *\r\n * This component renders the underlying `<m3e-dialog-trigger>` 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-dialog-trigger>` instance for imperative access.\r\n *\r\n * See the `m3e-dialog-trigger` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eDialogTrigger = createComponent({\r\n tagName: \"m3e-dialog-trigger\",\r\n elementClass: M3eDialogTriggerElement,\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,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,SAAS,EAAE,SAAS;AACpB,QAAA,QAAQ,EAAE,QAAQ;AAClB,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,QAAQ,EAAE,QAAQ;AAClB,QAAA,QAAQ,EAAE,QAAQ;AACnB,KAAA;AACF,CAAA;;ACxBD;;;;;;;;;;;;AAYG;AACI,MAAM,eAAe,GAAG,eAAe,CAAC;AAC7C,IAAA,OAAO,EAAE,mBAAmB;AAC5B,IAAA,YAAY,EAAE,sBAAsB;AACpC,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;ACjBD;;;;;;;;;;;;AAYG;AACI,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAC9C,IAAA,OAAO,EAAE,oBAAoB;AAC7B,IAAA,YAAY,EAAE,uBAAuB;AACrC,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;;;"}
|
package/dist/dialog.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
|
|
6
|
+
*/import e from"react";import{createComponent as a}from"@lit/react";import{M3eDialogElement as n,M3eDialogActionElement as t,M3eDialogTriggerElement as o}from"@m3e/web/dialog";function l({react:e,tagName:n,elementClass:t,events:o,displayName:l}){return"undefined"!=typeof window?a({react:e,tagName:n,elementClass:t,events:o,displayName:l}):null}const m=l({tagName:"m3e-dialog",elementClass:n,react:e,events:{onOpening:"opening",onOpened:"opened",onClosing:"closing",onClosed:"closed",onCancel:"cancel"}}),s=l({tagName:"m3e-dialog-action",elementClass:t,react:e}),i=l({tagName:"m3e-dialog-trigger",elementClass:o,react:e});export{m as M3eDialog,s as M3eDialogAction,i as M3eDialogTrigger};
|
|
7
7
|
//# sourceMappingURL=dialog.min.js.map
|
package/dist/dialog.min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.min.js","sources":["../../src/dialog/Dialog.ts","../../src/dialog/DialogAction.ts","../../src/dialog/DialogTrigger.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"
|
|
1
|
+
{"version":3,"file":"dialog.min.js","sources":["../../src/utils/createComponent.ts","../../src/dialog/Dialog.ts","../../src/dialog/DialogAction.ts","../../src/dialog/DialogTrigger.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 { M3eDialogElement } from \"@m3e/web/dialog\";\r\nexport type { M3eDialogElement } from \"@m3e/web/dialog\";\r\n\r\n/**\r\n * React binding for the `m3e-dialog` Web Component from `@m3e/web/dialog`.\r\n *\r\n * This component renders the underlying `<m3e-dialog>` 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-dialog>` instance for imperative access.\r\n *\r\n * See the `m3e-dialog` documentation in `@m3e/dialog` for full details on behavior,\r\n * styling, accessibility, and supported events.\r\n */\r\nexport const M3eDialog = createComponent({\r\n tagName: \"m3e-dialog\",\r\n elementClass: M3eDialogElement,\r\n react: React,\r\n events: {\r\n onOpening: \"opening\",\r\n onOpened: \"opened\",\r\n onClosing: \"closing\",\r\n onClosed: \"closed\",\r\n onCancel: \"cancel\",\r\n },\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eDialogActionElement } from \"@m3e/web/dialog\";\r\nexport type { M3eDialogActionElement } from \"@m3e/web/dialog\";\r\n\r\n/**\r\n * React binding for the `m3e-dialog-action` Web Component from `@m3e/web/dialog`.\r\n *\r\n * This component renders the underlying `<m3e-dialog-action>` 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-dialog-action>` instance for imperative access.\r\n *\r\n * See the `m3e-dialog-action` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eDialogAction = createComponent({\r\n tagName: \"m3e-dialog-action\",\r\n elementClass: M3eDialogActionElement,\r\n react: React,\r\n});\r\n","import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eDialogTriggerElement } from \"@m3e/web/dialog\";\r\nexport type { M3eDialogTriggerElement } from \"@m3e/web/dialog\";\r\n\r\n/**\r\n * React binding for the `m3e-dialog-trigger` Web Component from `@m3e/web/dialog`.\r\n *\r\n * This component renders the underlying `<m3e-dialog-trigger>` 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-dialog-trigger>` instance for imperative access.\r\n *\r\n * See the `m3e-dialog-trigger` documentation for full details on behavior, styling,\r\n * accessibility, and supported events.\r\n */\r\nexport const M3eDialogTrigger = createComponent({\r\n tagName: \"m3e-dialog-trigger\",\r\n elementClass: M3eDialogTriggerElement,\r\n react: React,\r\n});\r\n"],"names":["createComponent","react","tagName","elementClass","events","displayName","window","createReactComponent","M3eDialog","M3eDialogElement","React","onOpening","onOpened","onClosing","onClosed","onCancel","M3eDialogAction","M3eDialogActionElement","M3eDialogTrigger","M3eDialogTriggerElement"],"mappings":";;;;;iLA6BM,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,EAAYR,EAAgB,CACvCE,QAAS,aACTC,aAAcM,EACdR,MAAOS,EACPN,OAAQ,CACNO,UAAW,UACXC,SAAU,SACVC,UAAW,UACXC,SAAU,SACVC,SAAU,YCTDC,EAAkBhB,EAAgB,CAC7CE,QAAS,oBACTC,aAAcc,EACdhB,MAAOS,ICHIQ,EAAmBlB,EAAgB,CAC9CE,QAAS,qBACTC,aAAcgB,EACdlB,MAAOS"}
|
package/dist/divider.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 { M3eDividerElement } from '@m3e/web/divider';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* React
|
|
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-divider` Web Component from `@m3e/web/divider`.
|
|
14
45
|
*
|
|
15
46
|
* This component renders the underlying `<m3e-divider>` element and exposes its
|
|
16
47
|
* properties, attributes, and events through an idiomatic React interface.
|
package/dist/divider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider.js","sources":["../../src/divider/Divider.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"
|
|
1
|
+
{"version":3,"file":"divider.js","sources":["../../src/utils/createComponent.ts","../../src/divider/Divider.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 { M3eDividerElement } from \"@m3e/web/divider\";\r\nexport type { M3eDividerElement } from \"@m3e/web/divider\";\r\n\r\n/**\r\n * React binding for the `m3e-divider` Web Component from `@m3e/web/divider`.\r\n *\r\n * This component renders the underlying `<m3e-divider>` 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-divider>` instance for imperative access.\r\n *\r\n * See the `m3e-divider` documentation in `@m3e/divider` for full details on behavior,\r\n * styling, accessibility, and supported events.\r\n */\r\nexport const M3eDivider = createComponent({\r\n tagName: \"m3e-divider\",\r\n elementClass: M3eDividerElement,\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,UAAU,GAAG,eAAe,CAAC;AACxC,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,YAAY,EAAE,iBAAiB;AAC/B,IAAA,KAAK,EAAE,KAAK;AACb,CAAA;;;;"}
|
package/dist/divider.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
|
|
6
|
+
*/import e from"react";import{createComponent as t}from"@lit/react";import{M3eDividerElement as a}from"@m3e/web/divider";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-divider",elementClass:a,react:e});export{m as M3eDivider};
|
|
7
7
|
//# sourceMappingURL=divider.min.js.map
|
package/dist/divider.min.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider.min.js","sources":["../../src/divider/Divider.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"
|
|
1
|
+
{"version":3,"file":"divider.min.js","sources":["../../src/divider/Divider.ts","../../src/utils/createComponent.ts"],"sourcesContent":["import React from \"react\";\r\nimport { createComponent } from \"../utils\";\r\n\r\nimport { M3eDividerElement } from \"@m3e/web/divider\";\r\nexport type { M3eDividerElement } from \"@m3e/web/divider\";\r\n\r\n/**\r\n * React binding for the `m3e-divider` Web Component from `@m3e/web/divider`.\r\n *\r\n * This component renders the underlying `<m3e-divider>` 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-divider>` instance for imperative access.\r\n *\r\n * See the `m3e-divider` documentation in `@m3e/divider` for full details on behavior,\r\n * styling, accessibility, and supported events.\r\n */\r\nexport const M3eDivider = createComponent({\r\n tagName: \"m3e-divider\",\r\n elementClass: M3eDividerElement,\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":["M3eDivider","react","tagName","elementClass","events","displayName","window","createReactComponent","createComponent","M3eDividerElement","React"],"mappings":";;;;;0HAmBO,MAAMA,ECUP,UAA4EC,MAChFA,EAAKC,QACLA,EAAOC,aACPA,EAAYC,OACZA,EAAMC,YACNA,IAEA,MAAyB,oBAAXC,OACVC,EAA2B,CAAEN,QAAOC,UAASC,eAAcC,SAAQC,gBAChC,IACzC,CDpB0BG,CAAgB,CACxCN,QAAS,cACTC,aAAcM,EACdR,MAAOS"}
|
package/dist/drawer-container.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 { M3eDrawerContainerElement, M3eDrawerToggleElement } from '@m3e/web/drawer-container';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* React
|
|
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-drawer-container` Web Component from `@m3e/web/drawer-container`.
|
|
14
45
|
*
|
|
15
46
|
* This component renders the underlying `<m3e-drawer-container>` element and exposes its
|
|
16
47
|
* properties, attributes, and events through an idiomatic React interface.
|
|
@@ -32,7 +63,7 @@ const M3eDrawerContainer = createComponent({
|
|
|
32
63
|
});
|
|
33
64
|
|
|
34
65
|
/**
|
|
35
|
-
* React binding for the `m3e-drawer-toggle` Web Component from `@m3e/drawer-container`.
|
|
66
|
+
* React binding for the `m3e-drawer-toggle` Web Component from `@m3e/web/drawer-container`.
|
|
36
67
|
*
|
|
37
68
|
* This component renders the underlying `<m3e-drawer-toggle>` element and exposes its
|
|
38
69
|
* properties, attributes, and events through an idiomatic React interface.
|