@commmerce/ui-react 0.0.0-stage → 1.0.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +17 -0
- package/README.md +26 -2
- package/dist/index.d.ts +250 -0
- package/dist/index.js +314 -0
- package/package.json +53 -4
package/LICENSE.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Commmerce UI Licence — DRAFT, NOT YET IN FORCE
|
|
2
|
+
|
|
3
|
+
> Draft for legal review. Do not publish packages until this is approved.
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026 Outdo Inc. (Commmerce). All rights reserved.
|
|
6
|
+
|
|
7
|
+
1. **Grant.** You may install, use and include unmodified copies of the Commmerce UI packages
|
|
8
|
+
(`@commmerce/tokens`, `@commmerce/ui`, `@commmerce/ui-react`, `@commmerce/app-bridge`) in
|
|
9
|
+
software whose purpose is to run on, integrate with or extend a Commmerce platform, including
|
|
10
|
+
apps listed in, or privately installed through, the Commmerce app marketplace.
|
|
11
|
+
2. **Restrictions.** You may not use the packages, or the Commmerce name, logo or visual identity
|
|
12
|
+
they carry, to build a product that is not for use with a Commmerce platform, or one that
|
|
13
|
+
presents itself as made or endorsed by Commmerce. You may not redistribute the packages on their
|
|
14
|
+
own or as a competing design system.
|
|
15
|
+
3. **No warranty.** The packages are provided "as is", without warranty of any kind. Commmerce is
|
|
16
|
+
not liable for any claim or damages arising from their use.
|
|
17
|
+
4. **Termination.** This licence ends automatically if you breach it.
|
package/README.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @commmerce/ui-react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
React components for Commmerce UI, generated from the `@commmerce/ui` web components, with typed props and
|
|
4
|
+
`on…` event props for each component's events.
|
|
5
|
+
|
|
6
|
+
**Preview.** APIs can change between releases. Docs: https://commmerce.com/blog/commmerceui/
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npm install @commmerce/ui-react @commmerce/tokens
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
```jsx
|
|
13
|
+
import '@commmerce/tokens/fonts.css'; // the Poppins typeface (Google Fonts)
|
|
14
|
+
import '@commmerce/tokens/tokens.css';
|
|
15
|
+
import { Button, TextField } from '@commmerce/ui-react';
|
|
16
|
+
|
|
17
|
+
export function ProductTitle({ value, onChange, onSave }) {
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
<TextField label="Title" value={value} onInput={(e) => onChange(e.currentTarget.value)} />
|
|
21
|
+
<Button variant="primary" onClick={onSave}>Save</Button>
|
|
22
|
+
</>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Requires React 17 or later. Support: support@commmerce.com
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { type EventName } from '@lit/react';
|
|
2
|
+
import { CmButton, CmTextField, CmCheckbox, CmRadio, CmRadioGroup, CmToggle, CmSelect, CmSearch, CmFileUpload, CmOptionGroup, CmTag, CmBadge, CmCard, CmBanner, CmIcon, CmPageHeader, CmActionBar, CmSaveBar, CmInfoPanel, CmInfoItem, CmAccordion, CmEmptyState, CmSkeleton, CmSkeletonDisplay, CmComment, CmCommentBox, CmSmartTip, CmSmartTips, CmPagination, CmStatusTabs, CmTableHeader, CmDataTable, CmResourceList, CmResourceItem, CmNestedList, CmNestedItem, CmReportTile, CmReportTiles, CmNavItem, CmSideNavigation, CmHeaderBar, CmBottomNavigation, CmMobileMenu, CmFlashOfferBar, CmLinkTabs, CmAppCard, CmModal, CmSidePanel, CmFilterPanel, CmMenuItem, CmActionMenu, CmBottomSheet, CmNotificationPanel, CmNotificationItem, CmAvatar, CmThumbnail, CmTooltip, CmToast, CmToastRegion, CmSpinner, CmProgressBar, CmStack, CmGrid, CmLayout, CmLayoutSection, CmPage } from '@commmerce/ui';
|
|
3
|
+
import type { CloseReason, FilterValues, MenuItem, NotificationItem, ToastDismissReason } from '@commmerce/ui';
|
|
4
|
+
export { showToast } from '@commmerce/ui';
|
|
5
|
+
export type { ShowToastOptions } from '@commmerce/ui';
|
|
6
|
+
import type { NavItem } from '@commmerce/ui';
|
|
7
|
+
export declare const Button: import("@lit/react").ReactWebComponent<CmButton, {}>;
|
|
8
|
+
export declare const TextField: import("@lit/react").ReactWebComponent<CmTextField, {
|
|
9
|
+
onInput: EventName<InputEvent>;
|
|
10
|
+
onChange: EventName<Event>;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const Checkbox: import("@lit/react").ReactWebComponent<CmCheckbox, {
|
|
13
|
+
onChange: EventName<Event>;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const RadioGroup: import("@lit/react").ReactWebComponent<CmRadioGroup, {
|
|
16
|
+
onChange: EventName<Event>;
|
|
17
|
+
onInput: EventName<Event>;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const Radio: import("@lit/react").ReactWebComponent<CmRadio, {}>;
|
|
20
|
+
export declare const Toggle: import("@lit/react").ReactWebComponent<CmToggle, {
|
|
21
|
+
onChange: EventName<Event>;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const Select: import("@lit/react").ReactWebComponent<CmSelect, {
|
|
24
|
+
onChange: EventName<Event>;
|
|
25
|
+
onInput: EventName<Event>;
|
|
26
|
+
}>;
|
|
27
|
+
export declare const Search: import("@lit/react").ReactWebComponent<CmSearch, {
|
|
28
|
+
onInput: EventName<Event>;
|
|
29
|
+
onChange: EventName<Event>;
|
|
30
|
+
onSearch: EventName<CustomEvent<{
|
|
31
|
+
value: string;
|
|
32
|
+
}>>;
|
|
33
|
+
onFilter: EventName<CustomEvent>;
|
|
34
|
+
}>;
|
|
35
|
+
export declare const FileUpload: import("@lit/react").ReactWebComponent<CmFileUpload, {
|
|
36
|
+
onChange: EventName<Event>;
|
|
37
|
+
onReject: EventName<CustomEvent<{
|
|
38
|
+
files: File[];
|
|
39
|
+
}>>;
|
|
40
|
+
}>;
|
|
41
|
+
export declare const OptionGroup: import("@lit/react").ReactWebComponent<CmOptionGroup, {
|
|
42
|
+
onChange: EventName<Event>;
|
|
43
|
+
onInput: EventName<Event>;
|
|
44
|
+
}>;
|
|
45
|
+
export declare const Tag: import("@lit/react").ReactWebComponent<CmTag, {
|
|
46
|
+
onRemove: EventName<CustomEvent>;
|
|
47
|
+
}>;
|
|
48
|
+
export declare const Badge: import("@lit/react").ReactWebComponent<CmBadge, {}>;
|
|
49
|
+
export declare const Stack: import("@lit/react").ReactWebComponent<CmStack, {}>;
|
|
50
|
+
export declare const Grid: import("@lit/react").ReactWebComponent<CmGrid, {}>;
|
|
51
|
+
export declare const Layout: import("@lit/react").ReactWebComponent<CmLayout, {}>;
|
|
52
|
+
export declare const LayoutSection: import("@lit/react").ReactWebComponent<CmLayoutSection, {}>;
|
|
53
|
+
export declare const Page: import("@lit/react").ReactWebComponent<CmPage, {}>;
|
|
54
|
+
export declare const Card: import("@lit/react").ReactWebComponent<CmCard, {}>;
|
|
55
|
+
export declare const Banner: import("@lit/react").ReactWebComponent<CmBanner, {
|
|
56
|
+
onDismiss: EventName<CustomEvent>;
|
|
57
|
+
}>;
|
|
58
|
+
export declare const Icon: import("@lit/react").ReactWebComponent<CmIcon, {}>;
|
|
59
|
+
export declare const PageHeader: import("@lit/react").ReactWebComponent<CmPageHeader, {
|
|
60
|
+
onPrevious: EventName<CustomEvent>;
|
|
61
|
+
onNext: EventName<CustomEvent>;
|
|
62
|
+
}>;
|
|
63
|
+
export declare const ActionBar: import("@lit/react").ReactWebComponent<CmActionBar, {}>;
|
|
64
|
+
export declare const SaveBar: import("@lit/react").ReactWebComponent<CmSaveBar, {
|
|
65
|
+
onSave: EventName<CustomEvent>;
|
|
66
|
+
onDiscard: EventName<CustomEvent>;
|
|
67
|
+
}>;
|
|
68
|
+
export declare const InfoPanel: import("@lit/react").ReactWebComponent<CmInfoPanel, {
|
|
69
|
+
onAction: EventName<CustomEvent>;
|
|
70
|
+
}>;
|
|
71
|
+
export declare const InfoItem: import("@lit/react").ReactWebComponent<CmInfoItem, {}>;
|
|
72
|
+
export declare const Accordion: import("@lit/react").ReactWebComponent<CmAccordion, {
|
|
73
|
+
onToggle: EventName<CustomEvent<{
|
|
74
|
+
open: boolean;
|
|
75
|
+
}>>;
|
|
76
|
+
}>;
|
|
77
|
+
export declare const EmptyState: import("@lit/react").ReactWebComponent<CmEmptyState, {}>;
|
|
78
|
+
export declare const Skeleton: import("@lit/react").ReactWebComponent<CmSkeleton, {}>;
|
|
79
|
+
export declare const SkeletonDisplay: import("@lit/react").ReactWebComponent<CmSkeletonDisplay, {}>;
|
|
80
|
+
export declare const Comment: import("@lit/react").ReactWebComponent<CmComment, {}>;
|
|
81
|
+
export declare const CommentBox: import("@lit/react").ReactWebComponent<CmCommentBox, {
|
|
82
|
+
onSubmit: EventName<CustomEvent<{
|
|
83
|
+
value: string;
|
|
84
|
+
}>>;
|
|
85
|
+
}>;
|
|
86
|
+
export declare const SmartTip: import("@lit/react").ReactWebComponent<CmSmartTip, {}>;
|
|
87
|
+
export declare const SmartTips: import("@lit/react").ReactWebComponent<CmSmartTips, {
|
|
88
|
+
onTour: EventName<CustomEvent>;
|
|
89
|
+
}>;
|
|
90
|
+
export declare const Pagination: import("@lit/react").ReactWebComponent<CmPagination, {
|
|
91
|
+
onPageChange: EventName<CustomEvent<{
|
|
92
|
+
page: number;
|
|
93
|
+
}>>;
|
|
94
|
+
onPageSizeChange: EventName<CustomEvent<{
|
|
95
|
+
pageSize: number;
|
|
96
|
+
}>>;
|
|
97
|
+
}>;
|
|
98
|
+
export declare const StatusTabs: import("@lit/react").ReactWebComponent<CmStatusTabs, {
|
|
99
|
+
onChange: EventName<Event>;
|
|
100
|
+
}>;
|
|
101
|
+
export declare const TableHeader: import("@lit/react").ReactWebComponent<CmTableHeader, {
|
|
102
|
+
onSort: EventName<CustomEvent<{
|
|
103
|
+
key: string;
|
|
104
|
+
direction: "ascending" | "descending";
|
|
105
|
+
}>>;
|
|
106
|
+
onSelectAll: EventName<CustomEvent<{
|
|
107
|
+
checked: boolean;
|
|
108
|
+
}>>;
|
|
109
|
+
}>;
|
|
110
|
+
export declare const DataTable: import("@lit/react").ReactWebComponent<CmDataTable, {
|
|
111
|
+
onSort: EventName<CustomEvent<{
|
|
112
|
+
key: string;
|
|
113
|
+
direction: "ascending" | "descending";
|
|
114
|
+
}>>;
|
|
115
|
+
}>;
|
|
116
|
+
export declare const ResourceList: import("@lit/react").ReactWebComponent<CmResourceList, {
|
|
117
|
+
onSelectionChange: EventName<CustomEvent<{
|
|
118
|
+
selected: string[];
|
|
119
|
+
all: boolean;
|
|
120
|
+
}>>;
|
|
121
|
+
}>;
|
|
122
|
+
export declare const ResourceItem: import("@lit/react").ReactWebComponent<CmResourceItem, {
|
|
123
|
+
onResourceSelect: EventName<CustomEvent<{
|
|
124
|
+
value: string;
|
|
125
|
+
selected: boolean;
|
|
126
|
+
}>>;
|
|
127
|
+
}>;
|
|
128
|
+
type ReorderDetail = {
|
|
129
|
+
item: HTMLElement;
|
|
130
|
+
from: number;
|
|
131
|
+
to: number;
|
|
132
|
+
};
|
|
133
|
+
export declare const NestedList: import("@lit/react").ReactWebComponent<CmNestedList, {
|
|
134
|
+
onReorder: EventName<CustomEvent<ReorderDetail>>;
|
|
135
|
+
onToggle: EventName<CustomEvent<{
|
|
136
|
+
open: boolean;
|
|
137
|
+
}>>;
|
|
138
|
+
}>;
|
|
139
|
+
export declare const NestedItem: import("@lit/react").ReactWebComponent<CmNestedItem, {
|
|
140
|
+
onReorder: EventName<CustomEvent<ReorderDetail>>;
|
|
141
|
+
}>;
|
|
142
|
+
export declare const ReportTile: import("@lit/react").ReactWebComponent<CmReportTile, {}>;
|
|
143
|
+
export declare const ReportTiles: import("@lit/react").ReactWebComponent<CmReportTiles, {}>;
|
|
144
|
+
type NavigateDetail = {
|
|
145
|
+
item: NavItem;
|
|
146
|
+
value: string;
|
|
147
|
+
href: string;
|
|
148
|
+
};
|
|
149
|
+
export declare const NavItemElement: import("@lit/react").ReactWebComponent<CmNavItem, {}>;
|
|
150
|
+
export declare const SideNavigation: import("@lit/react").ReactWebComponent<CmSideNavigation, {
|
|
151
|
+
onNavigate: EventName<CustomEvent<NavigateDetail>>;
|
|
152
|
+
onExpand: EventName<CustomEvent<{
|
|
153
|
+
item: NavItem;
|
|
154
|
+
expanded: boolean;
|
|
155
|
+
}>>;
|
|
156
|
+
}>;
|
|
157
|
+
export declare const HeaderBar: import("@lit/react").ReactWebComponent<CmHeaderBar, {
|
|
158
|
+
onStoreSwitch: EventName<CustomEvent>;
|
|
159
|
+
onWallet: EventName<CustomEvent>;
|
|
160
|
+
onAccount: EventName<CustomEvent>;
|
|
161
|
+
}>;
|
|
162
|
+
export declare const BottomNavigation: import("@lit/react").ReactWebComponent<CmBottomNavigation, {
|
|
163
|
+
onNavigate: EventName<CustomEvent<NavigateDetail>>;
|
|
164
|
+
}>;
|
|
165
|
+
export declare const MobileMenu: import("@lit/react").ReactWebComponent<CmMobileMenu, {
|
|
166
|
+
onNavigate: EventName<CustomEvent<NavigateDetail>>;
|
|
167
|
+
onStoreSwitch: EventName<CustomEvent>;
|
|
168
|
+
onAccount: EventName<CustomEvent>;
|
|
169
|
+
}>;
|
|
170
|
+
export declare const FlashOfferBar: import("@lit/react").ReactWebComponent<CmFlashOfferBar, {
|
|
171
|
+
onDismiss: EventName<CustomEvent>;
|
|
172
|
+
}>;
|
|
173
|
+
export declare const LinkTabs: import("@lit/react").ReactWebComponent<CmLinkTabs, {
|
|
174
|
+
onNavigate: EventName<CustomEvent<NavigateDetail>>;
|
|
175
|
+
}>;
|
|
176
|
+
export declare const AppCard: import("@lit/react").ReactWebComponent<CmAppCard, {}>;
|
|
177
|
+
export declare const Modal: import("@lit/react").ReactWebComponent<CmModal, {
|
|
178
|
+
onOpen: EventName<CustomEvent>;
|
|
179
|
+
onClose: EventName<CustomEvent<{
|
|
180
|
+
reason: CloseReason;
|
|
181
|
+
}>>;
|
|
182
|
+
onClosed: EventName<CustomEvent>;
|
|
183
|
+
}>;
|
|
184
|
+
export declare const SidePanel: import("@lit/react").ReactWebComponent<CmSidePanel, {
|
|
185
|
+
onOpen: EventName<CustomEvent>;
|
|
186
|
+
onClose: EventName<CustomEvent<{
|
|
187
|
+
reason: CloseReason;
|
|
188
|
+
}>>;
|
|
189
|
+
onClosed: EventName<CustomEvent>;
|
|
190
|
+
}>;
|
|
191
|
+
export declare const FilterPanel: import("@lit/react").ReactWebComponent<CmFilterPanel, {
|
|
192
|
+
onFilterApply: EventName<CustomEvent<{
|
|
193
|
+
values: FilterValues;
|
|
194
|
+
query: string;
|
|
195
|
+
}>>;
|
|
196
|
+
onFilterReset: EventName<CustomEvent>;
|
|
197
|
+
onOpen: EventName<CustomEvent>;
|
|
198
|
+
onClose: EventName<CustomEvent<{
|
|
199
|
+
reason: CloseReason;
|
|
200
|
+
}>>;
|
|
201
|
+
onClosed: EventName<CustomEvent>;
|
|
202
|
+
}>;
|
|
203
|
+
export declare const MenuItemElement: import("@lit/react").ReactWebComponent<CmMenuItem, {}>;
|
|
204
|
+
export declare const ActionMenu: import("@lit/react").ReactWebComponent<CmActionMenu, {
|
|
205
|
+
onSelect: EventName<CustomEvent<{
|
|
206
|
+
value: string;
|
|
207
|
+
item: MenuItem;
|
|
208
|
+
}>>;
|
|
209
|
+
onToggle: EventName<CustomEvent<{
|
|
210
|
+
open: boolean;
|
|
211
|
+
}>>;
|
|
212
|
+
}>;
|
|
213
|
+
export declare const BottomSheet: import("@lit/react").ReactWebComponent<CmBottomSheet, {
|
|
214
|
+
onSelect: EventName<CustomEvent<{
|
|
215
|
+
value: string;
|
|
216
|
+
item: MenuItem;
|
|
217
|
+
}>>;
|
|
218
|
+
onOpen: EventName<CustomEvent>;
|
|
219
|
+
onClose: EventName<CustomEvent<{
|
|
220
|
+
reason: CloseReason;
|
|
221
|
+
}>>;
|
|
222
|
+
onClosed: EventName<CustomEvent>;
|
|
223
|
+
}>;
|
|
224
|
+
export declare const NotificationItemElement: import("@lit/react").ReactWebComponent<CmNotificationItem, {}>;
|
|
225
|
+
export declare const NotificationPanel: import("@lit/react").ReactWebComponent<CmNotificationPanel, {
|
|
226
|
+
onSelect: EventName<CustomEvent<{
|
|
227
|
+
value: string;
|
|
228
|
+
item: NotificationItem;
|
|
229
|
+
}>>;
|
|
230
|
+
onOpen: EventName<CustomEvent>;
|
|
231
|
+
onClose: EventName<CustomEvent<{
|
|
232
|
+
reason: CloseReason;
|
|
233
|
+
}>>;
|
|
234
|
+
onClosed: EventName<CustomEvent>;
|
|
235
|
+
}>;
|
|
236
|
+
export declare const Tooltip: import("@lit/react").ReactWebComponent<CmTooltip, {
|
|
237
|
+
onShow: EventName<CustomEvent>;
|
|
238
|
+
onHide: EventName<CustomEvent>;
|
|
239
|
+
}>;
|
|
240
|
+
export declare const Avatar: import("@lit/react").ReactWebComponent<CmAvatar, {}>;
|
|
241
|
+
export declare const Thumbnail: import("@lit/react").ReactWebComponent<CmThumbnail, {}>;
|
|
242
|
+
export declare const Toast: import("@lit/react").ReactWebComponent<CmToast, {
|
|
243
|
+
onAction: EventName<CustomEvent<void>>;
|
|
244
|
+
onDismiss: EventName<CustomEvent<{
|
|
245
|
+
reason: ToastDismissReason;
|
|
246
|
+
}>>;
|
|
247
|
+
}>;
|
|
248
|
+
export declare const ToastRegion: import("@lit/react").ReactWebComponent<CmToastRegion, {}>;
|
|
249
|
+
export declare const Spinner: import("@lit/react").ReactWebComponent<CmSpinner, {}>;
|
|
250
|
+
export declare const ProgressBar: import("@lit/react").ReactWebComponent<CmProgressBar, {}>;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { createComponent } from '@lit/react';
|
|
3
|
+
import { CmButton, CmTextField, CmCheckbox, CmRadio, CmRadioGroup, CmToggle, CmSelect, CmSearch, CmFileUpload, CmOptionGroup, CmTag, CmBadge, CmCard, CmBanner, CmIcon, CmPageHeader, CmActionBar, CmSaveBar, CmInfoPanel, CmInfoItem, CmAccordion, CmEmptyState, CmSkeleton, CmSkeletonDisplay, CmComment, CmCommentBox, CmSmartTip, CmSmartTips, CmPagination, CmStatusTabs, CmTableHeader, CmDataTable, CmResourceList, CmResourceItem, CmNestedList, CmNestedItem, CmReportTile, CmReportTiles, CmNavItem, CmSideNavigation, CmHeaderBar, CmBottomNavigation, CmMobileMenu, CmFlashOfferBar, CmLinkTabs, CmAppCard, CmModal, CmSidePanel, CmFilterPanel, CmMenuItem, CmActionMenu, CmBottomSheet, CmNotificationPanel, CmNotificationItem, CmAvatar, CmThumbnail, CmTooltip, CmToast, CmToastRegion, CmSpinner, CmProgressBar, CmStack, CmGrid, CmLayout, CmLayoutSection, CmPage } from '@commmerce/ui';
|
|
4
|
+
export { showToast } from '@commmerce/ui';
|
|
5
|
+
export const Button = createComponent({ tagName: 'cm-button', elementClass: CmButton, react: React });
|
|
6
|
+
export const TextField = createComponent({
|
|
7
|
+
tagName: 'cm-text-field',
|
|
8
|
+
elementClass: CmTextField,
|
|
9
|
+
react: React,
|
|
10
|
+
events: {
|
|
11
|
+
onInput: 'input',
|
|
12
|
+
onChange: 'change',
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
export const Checkbox = createComponent({
|
|
16
|
+
tagName: 'cm-checkbox',
|
|
17
|
+
elementClass: CmCheckbox,
|
|
18
|
+
react: React,
|
|
19
|
+
events: { onChange: 'change' },
|
|
20
|
+
});
|
|
21
|
+
export const RadioGroup = createComponent({
|
|
22
|
+
tagName: 'cm-radio-group',
|
|
23
|
+
elementClass: CmRadioGroup,
|
|
24
|
+
react: React,
|
|
25
|
+
events: {
|
|
26
|
+
onChange: 'change',
|
|
27
|
+
onInput: 'input',
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
export const Radio = createComponent({ tagName: 'cm-radio', elementClass: CmRadio, react: React });
|
|
31
|
+
export const Toggle = createComponent({
|
|
32
|
+
tagName: 'cm-toggle',
|
|
33
|
+
elementClass: CmToggle,
|
|
34
|
+
react: React,
|
|
35
|
+
events: { onChange: 'change' },
|
|
36
|
+
});
|
|
37
|
+
export const Select = createComponent({
|
|
38
|
+
tagName: 'cm-select',
|
|
39
|
+
elementClass: CmSelect,
|
|
40
|
+
react: React,
|
|
41
|
+
events: {
|
|
42
|
+
onChange: 'change',
|
|
43
|
+
onInput: 'input',
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
export const Search = createComponent({
|
|
47
|
+
tagName: 'cm-search',
|
|
48
|
+
elementClass: CmSearch,
|
|
49
|
+
react: React,
|
|
50
|
+
events: {
|
|
51
|
+
onInput: 'input',
|
|
52
|
+
onChange: 'change',
|
|
53
|
+
onSearch: 'cm-search',
|
|
54
|
+
onFilter: 'cm-filter',
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
export const FileUpload = createComponent({
|
|
58
|
+
tagName: 'cm-file-upload',
|
|
59
|
+
elementClass: CmFileUpload,
|
|
60
|
+
react: React,
|
|
61
|
+
events: {
|
|
62
|
+
onChange: 'change',
|
|
63
|
+
onReject: 'cm-reject',
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
export const OptionGroup = createComponent({
|
|
67
|
+
tagName: 'cm-option-group',
|
|
68
|
+
elementClass: CmOptionGroup,
|
|
69
|
+
react: React,
|
|
70
|
+
events: {
|
|
71
|
+
onChange: 'change',
|
|
72
|
+
onInput: 'input',
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
export const Tag = createComponent({
|
|
76
|
+
tagName: 'cm-tag',
|
|
77
|
+
elementClass: CmTag,
|
|
78
|
+
react: React,
|
|
79
|
+
events: { onRemove: 'cm-remove' },
|
|
80
|
+
});
|
|
81
|
+
export const Badge = createComponent({ tagName: 'cm-badge', elementClass: CmBadge, react: React });
|
|
82
|
+
export const Stack = createComponent({ tagName: 'cm-stack', elementClass: CmStack, react: React });
|
|
83
|
+
export const Grid = createComponent({ tagName: 'cm-grid', elementClass: CmGrid, react: React });
|
|
84
|
+
export const Layout = createComponent({ tagName: 'cm-layout', elementClass: CmLayout, react: React });
|
|
85
|
+
export const LayoutSection = createComponent({ tagName: 'cm-layout-section', elementClass: CmLayoutSection, react: React });
|
|
86
|
+
export const Page = createComponent({ tagName: 'cm-page', elementClass: CmPage, react: React });
|
|
87
|
+
export const Card = createComponent({ tagName: 'cm-card', elementClass: CmCard, react: React });
|
|
88
|
+
export const Banner = createComponent({
|
|
89
|
+
tagName: 'cm-banner',
|
|
90
|
+
elementClass: CmBanner,
|
|
91
|
+
react: React,
|
|
92
|
+
events: { onDismiss: 'cm-dismiss' },
|
|
93
|
+
});
|
|
94
|
+
export const Icon = createComponent({ tagName: 'cm-icon', elementClass: CmIcon, react: React });
|
|
95
|
+
export const PageHeader = createComponent({
|
|
96
|
+
tagName: 'cm-page-header',
|
|
97
|
+
elementClass: CmPageHeader,
|
|
98
|
+
react: React,
|
|
99
|
+
events: {
|
|
100
|
+
onPrevious: 'cm-previous',
|
|
101
|
+
onNext: 'cm-next',
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
export const ActionBar = createComponent({ tagName: 'cm-action-bar', elementClass: CmActionBar, react: React });
|
|
105
|
+
export const SaveBar = createComponent({
|
|
106
|
+
tagName: 'cm-save-bar',
|
|
107
|
+
elementClass: CmSaveBar,
|
|
108
|
+
react: React,
|
|
109
|
+
events: {
|
|
110
|
+
onSave: 'cm-save',
|
|
111
|
+
onDiscard: 'cm-discard',
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
export const InfoPanel = createComponent({
|
|
115
|
+
tagName: 'cm-info-panel',
|
|
116
|
+
elementClass: CmInfoPanel,
|
|
117
|
+
react: React,
|
|
118
|
+
events: { onAction: 'cm-action' },
|
|
119
|
+
});
|
|
120
|
+
export const InfoItem = createComponent({ tagName: 'cm-info-item', elementClass: CmInfoItem, react: React });
|
|
121
|
+
export const Accordion = createComponent({
|
|
122
|
+
tagName: 'cm-accordion',
|
|
123
|
+
elementClass: CmAccordion,
|
|
124
|
+
react: React,
|
|
125
|
+
events: { onToggle: 'cm-toggle' },
|
|
126
|
+
});
|
|
127
|
+
export const EmptyState = createComponent({ tagName: 'cm-empty-state', elementClass: CmEmptyState, react: React });
|
|
128
|
+
export const Skeleton = createComponent({ tagName: 'cm-skeleton', elementClass: CmSkeleton, react: React });
|
|
129
|
+
export const SkeletonDisplay = createComponent({ tagName: 'cm-skeleton-display', elementClass: CmSkeletonDisplay, react: React });
|
|
130
|
+
export const Comment = createComponent({ tagName: 'cm-comment', elementClass: CmComment, react: React });
|
|
131
|
+
export const CommentBox = createComponent({
|
|
132
|
+
tagName: 'cm-comment-box',
|
|
133
|
+
elementClass: CmCommentBox,
|
|
134
|
+
react: React,
|
|
135
|
+
events: { onSubmit: 'cm-submit' },
|
|
136
|
+
});
|
|
137
|
+
export const SmartTip = createComponent({ tagName: 'cm-smart-tip', elementClass: CmSmartTip, react: React });
|
|
138
|
+
export const SmartTips = createComponent({
|
|
139
|
+
tagName: 'cm-smart-tips',
|
|
140
|
+
elementClass: CmSmartTips,
|
|
141
|
+
react: React,
|
|
142
|
+
events: { onTour: 'cm-tour' },
|
|
143
|
+
});
|
|
144
|
+
export const Pagination = createComponent({
|
|
145
|
+
tagName: 'cm-pagination',
|
|
146
|
+
elementClass: CmPagination,
|
|
147
|
+
react: React,
|
|
148
|
+
events: {
|
|
149
|
+
onPageChange: 'cm-page-change',
|
|
150
|
+
onPageSizeChange: 'cm-page-size-change',
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
export const StatusTabs = createComponent({
|
|
154
|
+
tagName: 'cm-status-tabs',
|
|
155
|
+
elementClass: CmStatusTabs,
|
|
156
|
+
react: React,
|
|
157
|
+
events: { onChange: 'change' },
|
|
158
|
+
});
|
|
159
|
+
export const TableHeader = createComponent({
|
|
160
|
+
tagName: 'cm-table-header',
|
|
161
|
+
elementClass: CmTableHeader,
|
|
162
|
+
react: React,
|
|
163
|
+
events: {
|
|
164
|
+
onSort: 'cm-sort',
|
|
165
|
+
onSelectAll: 'cm-select-all',
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
export const DataTable = createComponent({
|
|
169
|
+
tagName: 'cm-data-table',
|
|
170
|
+
elementClass: CmDataTable,
|
|
171
|
+
react: React,
|
|
172
|
+
events: {
|
|
173
|
+
onSort: 'cm-sort',
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
export const ResourceList = createComponent({
|
|
177
|
+
tagName: 'cm-resource-list',
|
|
178
|
+
elementClass: CmResourceList,
|
|
179
|
+
react: React,
|
|
180
|
+
events: { onSelectionChange: 'cm-selection-change' },
|
|
181
|
+
});
|
|
182
|
+
export const ResourceItem = createComponent({
|
|
183
|
+
tagName: 'cm-resource-item',
|
|
184
|
+
elementClass: CmResourceItem,
|
|
185
|
+
react: React,
|
|
186
|
+
events: { onResourceSelect: 'cm-resource-select' },
|
|
187
|
+
});
|
|
188
|
+
export const NestedList = createComponent({
|
|
189
|
+
tagName: 'cm-nested-list',
|
|
190
|
+
elementClass: CmNestedList,
|
|
191
|
+
react: React,
|
|
192
|
+
events: {
|
|
193
|
+
onReorder: 'cm-reorder',
|
|
194
|
+
onToggle: 'cm-toggle',
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
export const NestedItem = createComponent({
|
|
198
|
+
tagName: 'cm-nested-item',
|
|
199
|
+
elementClass: CmNestedItem,
|
|
200
|
+
react: React,
|
|
201
|
+
events: { onReorder: 'cm-reorder' },
|
|
202
|
+
});
|
|
203
|
+
export const ReportTile = createComponent({ tagName: 'cm-report-tile', elementClass: CmReportTile, react: React });
|
|
204
|
+
export const ReportTiles = createComponent({ tagName: 'cm-report-tiles', elementClass: CmReportTiles, react: React });
|
|
205
|
+
export const NavItemElement = createComponent({ tagName: 'cm-nav-item', elementClass: CmNavItem, react: React });
|
|
206
|
+
export const SideNavigation = createComponent({
|
|
207
|
+
tagName: 'cm-side-navigation',
|
|
208
|
+
elementClass: CmSideNavigation,
|
|
209
|
+
react: React,
|
|
210
|
+
events: {
|
|
211
|
+
onNavigate: 'cm-navigate',
|
|
212
|
+
onExpand: 'cm-expand',
|
|
213
|
+
},
|
|
214
|
+
});
|
|
215
|
+
export const HeaderBar = createComponent({
|
|
216
|
+
tagName: 'cm-header-bar',
|
|
217
|
+
elementClass: CmHeaderBar,
|
|
218
|
+
react: React,
|
|
219
|
+
events: {
|
|
220
|
+
onStoreSwitch: 'cm-store-switch',
|
|
221
|
+
onWallet: 'cm-wallet',
|
|
222
|
+
onAccount: 'cm-account',
|
|
223
|
+
},
|
|
224
|
+
});
|
|
225
|
+
export const BottomNavigation = createComponent({
|
|
226
|
+
tagName: 'cm-bottom-navigation',
|
|
227
|
+
elementClass: CmBottomNavigation,
|
|
228
|
+
react: React,
|
|
229
|
+
events: { onNavigate: 'cm-navigate' },
|
|
230
|
+
});
|
|
231
|
+
export const MobileMenu = createComponent({
|
|
232
|
+
tagName: 'cm-mobile-menu',
|
|
233
|
+
elementClass: CmMobileMenu,
|
|
234
|
+
react: React,
|
|
235
|
+
events: {
|
|
236
|
+
onNavigate: 'cm-navigate',
|
|
237
|
+
onStoreSwitch: 'cm-store-switch',
|
|
238
|
+
onAccount: 'cm-account',
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
export const FlashOfferBar = createComponent({
|
|
242
|
+
tagName: 'cm-flash-offer-bar',
|
|
243
|
+
elementClass: CmFlashOfferBar,
|
|
244
|
+
react: React,
|
|
245
|
+
events: { onDismiss: 'cm-dismiss' },
|
|
246
|
+
});
|
|
247
|
+
export const LinkTabs = createComponent({
|
|
248
|
+
tagName: 'cm-link-tabs',
|
|
249
|
+
elementClass: CmLinkTabs,
|
|
250
|
+
react: React,
|
|
251
|
+
events: { onNavigate: 'cm-navigate' },
|
|
252
|
+
});
|
|
253
|
+
export const AppCard = createComponent({ tagName: 'cm-app-card', elementClass: CmAppCard, react: React });
|
|
254
|
+
/** Overlay events: `onClose` is cancelable (`event.preventDefault()` keeps it open). */
|
|
255
|
+
const overlayEvents = {
|
|
256
|
+
onOpen: 'cm-open',
|
|
257
|
+
onClose: 'cm-close',
|
|
258
|
+
onClosed: 'cm-closed',
|
|
259
|
+
};
|
|
260
|
+
export const Modal = createComponent({ tagName: 'cm-modal', elementClass: CmModal, react: React, events: overlayEvents });
|
|
261
|
+
export const SidePanel = createComponent({ tagName: 'cm-side-panel', elementClass: CmSidePanel, react: React, events: overlayEvents });
|
|
262
|
+
export const FilterPanel = createComponent({
|
|
263
|
+
tagName: 'cm-filter-panel',
|
|
264
|
+
elementClass: CmFilterPanel,
|
|
265
|
+
react: React,
|
|
266
|
+
events: {
|
|
267
|
+
...overlayEvents,
|
|
268
|
+
onFilterApply: 'cm-filter-apply',
|
|
269
|
+
onFilterReset: 'cm-filter-reset',
|
|
270
|
+
},
|
|
271
|
+
});
|
|
272
|
+
export const MenuItemElement = createComponent({ tagName: 'cm-menu-item', elementClass: CmMenuItem, react: React });
|
|
273
|
+
export const ActionMenu = createComponent({
|
|
274
|
+
tagName: 'cm-action-menu',
|
|
275
|
+
elementClass: CmActionMenu,
|
|
276
|
+
react: React,
|
|
277
|
+
events: {
|
|
278
|
+
onSelect: 'cm-select',
|
|
279
|
+
onToggle: 'cm-toggle',
|
|
280
|
+
},
|
|
281
|
+
});
|
|
282
|
+
export const BottomSheet = createComponent({
|
|
283
|
+
tagName: 'cm-bottom-sheet',
|
|
284
|
+
elementClass: CmBottomSheet,
|
|
285
|
+
react: React,
|
|
286
|
+
events: { ...overlayEvents, onSelect: 'cm-select' },
|
|
287
|
+
});
|
|
288
|
+
export const NotificationItemElement = createComponent({ tagName: 'cm-notification-item', elementClass: CmNotificationItem, react: React });
|
|
289
|
+
export const NotificationPanel = createComponent({
|
|
290
|
+
tagName: 'cm-notification-panel',
|
|
291
|
+
elementClass: CmNotificationPanel,
|
|
292
|
+
react: React,
|
|
293
|
+
events: { ...overlayEvents, onSelect: 'cm-select' },
|
|
294
|
+
});
|
|
295
|
+
export const Tooltip = createComponent({
|
|
296
|
+
tagName: 'cm-tooltip',
|
|
297
|
+
elementClass: CmTooltip,
|
|
298
|
+
react: React,
|
|
299
|
+
events: { onShow: 'cm-show', onHide: 'cm-hide' },
|
|
300
|
+
});
|
|
301
|
+
export const Avatar = createComponent({ tagName: 'cm-avatar', elementClass: CmAvatar, react: React });
|
|
302
|
+
export const Thumbnail = createComponent({ tagName: 'cm-thumbnail', elementClass: CmThumbnail, react: React });
|
|
303
|
+
export const Toast = createComponent({
|
|
304
|
+
tagName: 'cm-toast',
|
|
305
|
+
elementClass: CmToast,
|
|
306
|
+
react: React,
|
|
307
|
+
events: {
|
|
308
|
+
onAction: 'cm-action',
|
|
309
|
+
onDismiss: 'cm-dismiss',
|
|
310
|
+
},
|
|
311
|
+
});
|
|
312
|
+
export const ToastRegion = createComponent({ tagName: 'cm-toast-region', elementClass: CmToastRegion, react: React });
|
|
313
|
+
export const Spinner = createComponent({ tagName: 'cm-spinner', elementClass: CmSpinner, react: React });
|
|
314
|
+
export const ProgressBar = createComponent({ tagName: 'cm-progress-bar', elementClass: CmProgressBar, react: React });
|
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commmerce/ui-react",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0-rc.3",
|
|
4
|
+
"description": "React components for Commmerce UI, generated from the web components.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"web-components",
|
|
8
|
+
"commmerce",
|
|
9
|
+
"design-system",
|
|
10
|
+
"ui"
|
|
11
|
+
],
|
|
12
|
+
"author": "Commmerce",
|
|
13
|
+
"homepage": "https://commmerce.com/blog/commmerceui/",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"email": "support@commmerce.com"
|
|
16
|
+
},
|
|
17
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
18
|
+
"type": "module",
|
|
19
|
+
"main": "./dist/index.js",
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"LICENSE.md",
|
|
30
|
+
"README.md"
|
|
31
|
+
],
|
|
32
|
+
"publishConfig": {
|
|
33
|
+
"access": "public"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsc -p tsconfig.json",
|
|
37
|
+
"test": "vitest run"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@commmerce/ui": "1.0.0-rc.3",
|
|
41
|
+
"@lit/react": "1.0.6"
|
|
42
|
+
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"react": ">=17"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/react": "18.3.12",
|
|
48
|
+
"@types/react-dom": "18.3.1",
|
|
49
|
+
"@vitest/browser": "^2.1.8",
|
|
50
|
+
"playwright": "^1.49.0",
|
|
51
|
+
"react": "18.3.1",
|
|
52
|
+
"react-dom": "18.3.1",
|
|
53
|
+
"vitest": "^2.1.8"
|
|
54
|
+
}
|
|
55
|
+
}
|