@commmerce/ui-react 1.5.2 → 1.6.0

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/dist/index.d.ts CHANGED
@@ -5,7 +5,8 @@ export type { GlobalSearchGroup, GlobalSearchItem, NotificationItem } from '@com
5
5
  export { showToast, configure, setStrings, resetStrings, getDefaultStrings, formatNumber, formatDate } from '@commmerce/ui';
6
6
  export type { CmStrings, CmStringsInput, Message, MessageVars, PluralMessage } from '@commmerce/ui';
7
7
  export type { ShowToastOptions, DateRangePreset, DateRangePresetKey, MetricTrend, MetricSentiment, ColorSwatch, BoardMoveDetail, BoardMoveSource, CalendarView, CalendarEventTone, CalendarMoveSource, CalendarMoveDetail, CalendarTimes, CalendarRange, CalendarAddDetail } from '@commmerce/ui';
8
- import type { NavItem } from '@commmerce/ui';
8
+ import type { NavItem, DataTableColumn, DataTableRow } from '@commmerce/ui';
9
+ export type { DataTableColumn, DataTableRow, DataTableAction, SortDirection } from '@commmerce/ui';
9
10
  export declare const Button: import("@lit/react").ReactWebComponent<CmButton, {}>;
10
11
  export declare const TextField: import("@lit/react").ReactWebComponent<CmTextField, {
11
12
  onInput: EventName<InputEvent>;
@@ -67,6 +68,10 @@ export declare const FileUpload: import("@lit/react").ReactWebComponent<CmFileUp
67
68
  onReject: EventName<CustomEvent<{
68
69
  files: File[];
69
70
  }>>;
71
+ /** Since 1.6: the merchant cancelled a file's upload (`setProgress`). */
72
+ onCancel: EventName<CustomEvent<{
73
+ file: File;
74
+ }>>;
70
75
  }>;
71
76
  export declare const ColorField: import("@lit/react").ReactWebComponent<CmColorField, {
72
77
  onChange: EventName<Event>;
@@ -102,7 +107,9 @@ export declare const AppFrame: import("@lit/react").ReactWebComponent<CmAppFrame
102
107
  open: boolean;
103
108
  }>>;
104
109
  }>;
105
- export declare const Card: import("@lit/react").ReactWebComponent<CmCard, {}>;
110
+ export declare const Card: import("@lit/react").ReactWebComponent<CmCard, {
111
+ onAction: EventName<CustomEvent>;
112
+ }>;
106
113
  export declare const Banner: import("@lit/react").ReactWebComponent<CmBanner, {
107
114
  onDismiss: EventName<CustomEvent>;
108
115
  }>;
@@ -198,6 +205,23 @@ export declare const DataTable: import("@lit/react").ReactWebComponent<CmDataTab
198
205
  key: string;
199
206
  direction: "ascending" | "descending";
200
207
  }>>;
208
+ /** Since 1.6: a button in an `actions` column was pressed. */
209
+ onRowAction: EventName<CustomEvent<{
210
+ action: string;
211
+ row: DataTableRow;
212
+ index: number;
213
+ }>>;
214
+ /** Since 1.6: the merchant resized a column (`resizable`). */
215
+ onColumnResize: EventName<CustomEvent<{
216
+ key: string;
217
+ width: number;
218
+ }>>;
219
+ /** Since 1.6: the merchant showed or hid a column with the column picker. */
220
+ onColumnsChange: EventName<CustomEvent<{
221
+ key: string;
222
+ visible: boolean;
223
+ columns: DataTableColumn[];
224
+ }>>;
201
225
  }>;
202
226
  export declare const ResourceList: import("@lit/react").ReactWebComponent<CmResourceList, {
203
227
  onSelectionChange: EventName<CustomEvent<{
package/dist/index.js CHANGED
@@ -99,6 +99,8 @@ export const FileUpload = createComponent({
99
99
  events: {
100
100
  onChange: 'change',
101
101
  onReject: 'cm-reject',
102
+ /** Since 1.6: the merchant cancelled a file's upload (`setProgress`). */
103
+ onCancel: 'cm-cancel',
102
104
  },
103
105
  });
104
106
  export const ColorField = createComponent({
@@ -155,7 +157,12 @@ export const AppFrame = createComponent({
155
157
  react: React,
156
158
  events: { onMenuToggle: 'cm-menu-toggle' },
157
159
  });
158
- export const Card = createComponent({ tagName: 'cm-card', elementClass: CmCard, react: React });
160
+ export const Card = createComponent({
161
+ tagName: 'cm-card',
162
+ elementClass: CmCard,
163
+ react: React,
164
+ events: { onAction: 'cm-action' },
165
+ });
159
166
  export const Banner = createComponent({
160
167
  tagName: 'cm-banner',
161
168
  elementClass: CmBanner,
@@ -287,6 +294,12 @@ export const DataTable = createComponent({
287
294
  react: React,
288
295
  events: {
289
296
  onSort: 'cm-sort',
297
+ /** Since 1.6: a button in an `actions` column was pressed. */
298
+ onRowAction: 'cm-row-action',
299
+ /** Since 1.6: the merchant resized a column (`resizable`). */
300
+ onColumnResize: 'cm-column-resize',
301
+ /** Since 1.6: the merchant showed or hid a column with the column picker. */
302
+ onColumnsChange: 'cm-columns-change',
290
303
  },
291
304
  });
292
305
  export const ResourceList = createComponent({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commmerce/ui-react",
3
- "version": "1.5.2",
3
+ "version": "1.6.0",
4
4
  "description": "React components for Commmerce UI, generated from the web components.",
5
5
  "keywords": [
6
6
  "react",
@@ -39,7 +39,7 @@
39
39
  "test:react19": "npm ci --prefix react19 --no-audit --no-fund && vitest run --config vitest.react19.config.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@commmerce/ui": "1.5.2",
42
+ "@commmerce/ui": "1.6.0",
43
43
  "@lit/react": "1.0.6"
44
44
  },
45
45
  "peerDependencies": {