@commercelayer/app-elements 1.7.1 → 1.8.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/{InputDateComponent-ed463f1b.js → InputDateComponent-2f1ab98b.js} +1 -1
- package/dist/dictionaries/shipments.d.ts +11 -0
- package/dist/{main-b52943eb.js → main-45beb1e7.js} +12944 -24161
- package/dist/main.d.ts +3 -0
- package/dist/main.js +124 -119
- package/dist/mocks/data/countries.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/ui/atoms/AvatarLetter/AvatarLetter.d.ts +6 -1
- package/dist/ui/atoms/Icon/icons.d.ts +8 -1
- package/dist/ui/composite/OrganizationMenu.d.ts +21 -0
- package/dist/ui/composite/OrganizationMenu.test.d.ts +1 -0
- package/dist/ui/composite/SwitchMode.d.ts +6 -0
- package/dist/ui/composite/SwitchMode.test.d.ts +1 -0
- package/dist/ui/resources/ResourceLineItems/ResourceLineItems.d.ts +3 -2
- package/dist/ui/resources/ResourceLineItems/ResourceLineItems.mocks.d.ts +53 -0
- package/dist/ui/resources/ResourceLineItems/types.d.ts +4 -0
- package/dist/ui/resources/ResourceListItem/ResourceListItem.mocks.d.ts +115 -0
- package/dist/ui/resources/ResourceListItem/common.d.ts +1 -1
- package/dist/ui/resources/ResourceListItem/transformers/index.d.ts +1 -0
- package/dist/ui/resources/ResourceListItem/transformers/shipments.d.ts +3 -0
- package/dist/ui/resources/ResourceListItem/types.d.ts +2 -2
- package/package.json +1 -2
|
@@ -9,6 +9,11 @@ export interface AvatarLetterProps {
|
|
|
9
9
|
*/
|
|
10
10
|
className?: string;
|
|
11
11
|
style?: React.CSSProperties;
|
|
12
|
+
children?: (values: {
|
|
13
|
+
initials: string;
|
|
14
|
+
backgroundColor: string;
|
|
15
|
+
textColor: string;
|
|
16
|
+
}) => JSX.Element;
|
|
12
17
|
}
|
|
13
18
|
/**
|
|
14
19
|
* This component can be used to show a profile picture without being forced to use an image.
|
|
@@ -16,7 +21,7 @@ export interface AvatarLetterProps {
|
|
|
16
21
|
* It takes the text and renders the initials with a background.
|
|
17
22
|
* <span type="info" title="Background color">Given the same text, the background color will be always the same.</span>
|
|
18
23
|
*/
|
|
19
|
-
export declare function AvatarLetter({ text, className, style, ...rest }: AvatarLetterProps): JSX.Element;
|
|
24
|
+
export declare function AvatarLetter({ text, className, style, children, ...rest }: AvatarLetterProps): JSX.Element;
|
|
20
25
|
export declare namespace AvatarLetter {
|
|
21
26
|
var displayName: string;
|
|
22
27
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as phosphor from '@phosphor-icons/react';
|
|
2
2
|
export declare const iconMapping: {
|
|
3
3
|
readonly arrowBendDownRight: phosphor.Icon;
|
|
4
|
+
readonly apps: phosphor.Icon;
|
|
4
5
|
readonly arrowCircleDown: phosphor.Icon;
|
|
5
6
|
readonly arrowClockwise: phosphor.Icon;
|
|
6
7
|
readonly arrowDown: phosphor.Icon;
|
|
@@ -12,19 +13,25 @@ export declare const iconMapping: {
|
|
|
12
13
|
readonly chatCircle: phosphor.Icon;
|
|
13
14
|
readonly check: phosphor.Icon;
|
|
14
15
|
readonly cloud: phosphor.Icon;
|
|
16
|
+
readonly credentials: phosphor.Icon;
|
|
15
17
|
readonly creditCard: phosphor.Icon;
|
|
16
18
|
readonly download: phosphor.Icon;
|
|
17
19
|
readonly eye: phosphor.Icon;
|
|
18
20
|
readonly flag: phosphor.Icon;
|
|
19
21
|
readonly funnel: phosphor.Icon;
|
|
22
|
+
readonly github: phosphor.Icon;
|
|
23
|
+
readonly google: phosphor.Icon;
|
|
24
|
+
readonly home: phosphor.Icon;
|
|
20
25
|
readonly hourglass: phosphor.Icon;
|
|
21
26
|
readonly magnifyingGlass: phosphor.Icon;
|
|
22
27
|
readonly minus: phosphor.Icon;
|
|
23
28
|
readonly package: phosphor.Icon;
|
|
24
29
|
readonly pencilSimple: phosphor.Icon;
|
|
25
30
|
readonly printer: phosphor.Icon;
|
|
31
|
+
readonly resources: phosphor.Icon;
|
|
32
|
+
readonly settings: phosphor.Icon;
|
|
26
33
|
readonly shoppingBag: phosphor.Icon;
|
|
27
|
-
readonly
|
|
34
|
+
readonly team: phosphor.Icon;
|
|
28
35
|
readonly truck: phosphor.Icon;
|
|
29
36
|
readonly upload: phosphor.Icon;
|
|
30
37
|
readonly user: phosphor.Icon;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { type FC, type ReactNode } from 'react';
|
|
2
|
+
export interface OrganizationMenuItemProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children' | 'type'> {
|
|
3
|
+
/**
|
|
4
|
+
* the type will be used to render the icon and the label
|
|
5
|
+
*/
|
|
6
|
+
type: 'home' | 'apps' | 'resources' | 'credentials' | 'team' | 'settings';
|
|
7
|
+
/**
|
|
8
|
+
* set the active status of the menu item
|
|
9
|
+
*/
|
|
10
|
+
isActive?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Render the wrapper for the OrganizationMenuItem
|
|
14
|
+
*/
|
|
15
|
+
export declare const OrganizationMenuItem: FC<OrganizationMenuItemProps>;
|
|
16
|
+
/**
|
|
17
|
+
* Render the wrapper for the OrganizationMenuItem
|
|
18
|
+
*/
|
|
19
|
+
export declare const OrganizationMenu: FC<{
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { LineItem, ParcelLineItem, ReturnLineItem
|
|
1
|
+
import type { LineItem, ParcelLineItem, ReturnLineItem } from '@commercelayer/sdk';
|
|
2
2
|
import { type ComponentProps } from 'react';
|
|
3
|
-
|
|
3
|
+
import { type StockLineItemWithStockTransfer } from './types';
|
|
4
|
+
type Item = LineItem | ParcelLineItem | StockLineItemWithStockTransfer | ReturnLineItem;
|
|
4
5
|
export type ResourceLineItemsProps = ComponentProps<typeof ResourceLineItems>;
|
|
5
6
|
/**
|
|
6
7
|
* This component renders a list of line items taking care of showing the right informations and structure depending of provided line item type.
|
|
@@ -214,6 +214,59 @@ export declare const presetLineItems: {
|
|
|
214
214
|
metadata: {};
|
|
215
215
|
};
|
|
216
216
|
};
|
|
217
|
+
stockLineItemWithStockTransfer: {
|
|
218
|
+
id: string;
|
|
219
|
+
type: "stock_line_items";
|
|
220
|
+
sku_code: string;
|
|
221
|
+
quantity: number;
|
|
222
|
+
created_at: string;
|
|
223
|
+
updated_at: string;
|
|
224
|
+
reference: null;
|
|
225
|
+
reference_origin: null;
|
|
226
|
+
metadata: {};
|
|
227
|
+
sku: {
|
|
228
|
+
id: string;
|
|
229
|
+
type: "skus";
|
|
230
|
+
code: string;
|
|
231
|
+
name: string;
|
|
232
|
+
description: string;
|
|
233
|
+
image_url: string;
|
|
234
|
+
weight: number;
|
|
235
|
+
unit_of_weight: "gr";
|
|
236
|
+
hs_tariff_number: string;
|
|
237
|
+
do_not_ship: false;
|
|
238
|
+
do_not_track: false;
|
|
239
|
+
inventory: null;
|
|
240
|
+
created_at: string;
|
|
241
|
+
updated_at: string;
|
|
242
|
+
reference: string;
|
|
243
|
+
reference_origin: string;
|
|
244
|
+
metadata: {};
|
|
245
|
+
};
|
|
246
|
+
stockTransfer: {
|
|
247
|
+
readonly type: "stock_transfers";
|
|
248
|
+
readonly id: "";
|
|
249
|
+
readonly number: 3478;
|
|
250
|
+
readonly quantity: 1;
|
|
251
|
+
readonly updated_at: "2023-06-10T06:38:44.964Z";
|
|
252
|
+
readonly created_at: "2023-06-09T11:00:00.000Z";
|
|
253
|
+
readonly status: "upcoming";
|
|
254
|
+
readonly origin_stock_location: {
|
|
255
|
+
readonly type: "stock_locations";
|
|
256
|
+
readonly id: "";
|
|
257
|
+
readonly name: "US Warehouse";
|
|
258
|
+
readonly created_at: "";
|
|
259
|
+
readonly updated_at: "";
|
|
260
|
+
};
|
|
261
|
+
readonly destination_stock_location: {
|
|
262
|
+
readonly type: "stock_locations";
|
|
263
|
+
readonly id: "";
|
|
264
|
+
readonly name: "NY Store";
|
|
265
|
+
readonly created_at: "";
|
|
266
|
+
readonly updated_at: "";
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
};
|
|
217
270
|
parcelLineItem: {
|
|
218
271
|
id: string;
|
|
219
272
|
type: "parcel_line_items";
|
|
@@ -466,4 +466,119 @@ export declare const presetResourceListItem: {
|
|
|
466
466
|
readonly updated_at: "";
|
|
467
467
|
};
|
|
468
468
|
};
|
|
469
|
+
shipmentUpcoming: {
|
|
470
|
+
type: "shipments";
|
|
471
|
+
id: string;
|
|
472
|
+
created_at: string;
|
|
473
|
+
updated_at: string;
|
|
474
|
+
number: string;
|
|
475
|
+
status: "upcoming";
|
|
476
|
+
stock_location: {
|
|
477
|
+
readonly type: "stock_locations";
|
|
478
|
+
readonly id: "";
|
|
479
|
+
readonly name: "US Warehouse";
|
|
480
|
+
readonly created_at: "";
|
|
481
|
+
readonly updated_at: "";
|
|
482
|
+
};
|
|
483
|
+
};
|
|
484
|
+
shipmentPicking: {
|
|
485
|
+
type: "shipments";
|
|
486
|
+
id: string;
|
|
487
|
+
created_at: string;
|
|
488
|
+
updated_at: string;
|
|
489
|
+
number: string;
|
|
490
|
+
status: "picking";
|
|
491
|
+
stock_location: {
|
|
492
|
+
readonly type: "stock_locations";
|
|
493
|
+
readonly id: "";
|
|
494
|
+
readonly name: "US Warehouse";
|
|
495
|
+
readonly created_at: "";
|
|
496
|
+
readonly updated_at: "";
|
|
497
|
+
};
|
|
498
|
+
};
|
|
499
|
+
shipmentPacking: {
|
|
500
|
+
type: "shipments";
|
|
501
|
+
id: string;
|
|
502
|
+
created_at: string;
|
|
503
|
+
updated_at: string;
|
|
504
|
+
number: string;
|
|
505
|
+
status: "packing";
|
|
506
|
+
stock_location: {
|
|
507
|
+
readonly type: "stock_locations";
|
|
508
|
+
readonly id: "";
|
|
509
|
+
readonly name: "US Warehouse";
|
|
510
|
+
readonly created_at: "";
|
|
511
|
+
readonly updated_at: "";
|
|
512
|
+
};
|
|
513
|
+
};
|
|
514
|
+
shipmentReadyToShip: {
|
|
515
|
+
type: "shipments";
|
|
516
|
+
id: string;
|
|
517
|
+
created_at: string;
|
|
518
|
+
updated_at: string;
|
|
519
|
+
number: string;
|
|
520
|
+
status: "ready_to_ship";
|
|
521
|
+
stock_location: {
|
|
522
|
+
readonly type: "stock_locations";
|
|
523
|
+
readonly id: "";
|
|
524
|
+
readonly name: "US Warehouse";
|
|
525
|
+
readonly created_at: "";
|
|
526
|
+
readonly updated_at: "";
|
|
527
|
+
};
|
|
528
|
+
};
|
|
529
|
+
shipmentOnHold: {
|
|
530
|
+
type: "shipments";
|
|
531
|
+
id: string;
|
|
532
|
+
created_at: string;
|
|
533
|
+
updated_at: string;
|
|
534
|
+
number: string;
|
|
535
|
+
status: "on_hold";
|
|
536
|
+
stock_location: {
|
|
537
|
+
readonly type: "stock_locations";
|
|
538
|
+
readonly id: "";
|
|
539
|
+
readonly name: "US Warehouse";
|
|
540
|
+
readonly created_at: "";
|
|
541
|
+
readonly updated_at: "";
|
|
542
|
+
};
|
|
543
|
+
};
|
|
544
|
+
shipmentShipped: {
|
|
545
|
+
type: "shipments";
|
|
546
|
+
id: string;
|
|
547
|
+
created_at: string;
|
|
548
|
+
updated_at: string;
|
|
549
|
+
number: string;
|
|
550
|
+
status: "shipped";
|
|
551
|
+
stock_location: {
|
|
552
|
+
readonly type: "stock_locations";
|
|
553
|
+
readonly id: "";
|
|
554
|
+
readonly name: "US Warehouse";
|
|
555
|
+
readonly created_at: "";
|
|
556
|
+
readonly updated_at: "";
|
|
557
|
+
};
|
|
558
|
+
};
|
|
559
|
+
shipmentWithStockTransfer: {
|
|
560
|
+
type: "shipments";
|
|
561
|
+
id: string;
|
|
562
|
+
created_at: string;
|
|
563
|
+
updated_at: string;
|
|
564
|
+
number: string;
|
|
565
|
+
status: "upcoming";
|
|
566
|
+
stock_location: {
|
|
567
|
+
readonly type: "stock_locations";
|
|
568
|
+
readonly id: "";
|
|
569
|
+
readonly name: "US Warehouse";
|
|
570
|
+
readonly created_at: "";
|
|
571
|
+
readonly updated_at: "";
|
|
572
|
+
};
|
|
573
|
+
stock_transfers: {
|
|
574
|
+
readonly type: "stock_transfers";
|
|
575
|
+
readonly id: "";
|
|
576
|
+
readonly number: 30817130;
|
|
577
|
+
readonly sku_code: "BABYBIBXA19D9D000000XXXX";
|
|
578
|
+
readonly quantity: 1;
|
|
579
|
+
readonly status: "upcoming";
|
|
580
|
+
readonly created_at: "";
|
|
581
|
+
readonly updated_at: "";
|
|
582
|
+
}[];
|
|
583
|
+
};
|
|
469
584
|
};
|
|
@@ -8,7 +8,7 @@ export declare const ListItemDescription: import('../../atoms/SkeletonTemplate')
|
|
|
8
8
|
}>;
|
|
9
9
|
export declare const ListItemIcon: import('../../atoms/SkeletonTemplate').SkeletonTemplateComponent<{
|
|
10
10
|
color: "none" | "green" | "orange" | "red" | "gray" | "teal" | "white" | "black" | undefined;
|
|
11
|
-
icon: "download" | "package" | "arrowBendDownRight" | "arrowCircleDown" | "arrowClockwise" | "arrowDown" | "arrowLeft" | "arrowsLeftRight" | "arrowUpRight" | "asterisk" | "caretRight" | "chatCircle" | "check" | "cloud" | "creditCard" | "eye" | "flag" | "funnel" | "hourglass" | "magnifyingGlass" | "minus" | "pencilSimple" | "printer" | "shoppingBag" | "
|
|
11
|
+
icon: "download" | "package" | "settings" | "arrowBendDownRight" | "apps" | "arrowCircleDown" | "arrowClockwise" | "arrowDown" | "arrowLeft" | "arrowsLeftRight" | "arrowUpRight" | "asterisk" | "caretRight" | "chatCircle" | "check" | "cloud" | "credentials" | "creditCard" | "eye" | "flag" | "funnel" | "github" | "google" | "home" | "hourglass" | "magnifyingGlass" | "minus" | "pencilSimple" | "printer" | "resources" | "shoppingBag" | "team" | "truck" | "upload" | "user" | "warning" | "warningCircle" | "x";
|
|
12
12
|
delayMs?: number | undefined;
|
|
13
13
|
isLoading?: boolean | undefined;
|
|
14
14
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { TokenProviderAuthUser } from '../../../providers/TokenProvider/types';
|
|
3
|
-
import type { Customer, Order, Return, StockTransfer } from '@commercelayer/sdk';
|
|
4
|
-
export type ResourceListItemType = Order | Return | Customer | StockTransfer;
|
|
3
|
+
import type { Customer, Order, Return, Shipment, StockTransfer } from '@commercelayer/sdk';
|
|
4
|
+
export type ResourceListItemType = Order | Return | Customer | StockTransfer | Shipment;
|
|
5
5
|
export interface ResourceListItemComponentProps {
|
|
6
6
|
name: string;
|
|
7
7
|
description: JSX.Element | string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@commercelayer/app-elements",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"pnpm": ">=7"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@ac-dev/countries-service": "^1.2.0",
|
|
25
24
|
"@commercelayer/sdk": "5.21.1",
|
|
26
25
|
"@types/lodash": "^4.14.200",
|
|
27
26
|
"@types/react": "^18.2.34",
|