@commercelayer/app-elements 0.0.26 → 0.0.28

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/main.js CHANGED
@@ -1,4 +1,4 @@
1
- import { O as o, P as r, Q as n, R as i, S as l, U as u, V as d, W as p, ak as g, Y as S, K as T, Z as D, _ as I, $ as m, a0 as k, M as c, a1 as B, a2 as P, a3 as y, ar as L, as as C, at as b, au as x, av as R, aw as f, ax as v, ay as w, az as A, aD as F, aE as h, aF as M, aG as E, a4 as V, aJ as H, aK as J, aL as N, aM as O, aP as G, al as K, a5 as Q, am as U, an as W, a6 as j, a7 as q, aH as z, ao as X, aQ as Y, ap as Z, a8 as _, a9 as $, ab as aa, ac as sa, ad as ea, af as ta, aN as oa, aO as ra, ae as na, ag as ia, aj as la, ai as ua, aq as da, aI as pa, T as ga, ah as Sa, aR as Ta, aB as Da, aS as Ia, aW as ma, aC as ka, aT as ca, aU as Ba, aA as Pa, aV as ya, L as La, aX as Ca, N as ba, aa as xa } from "./main-81ebe20f.js";
1
+ import { N as o, O as r, Q as n, R as i, S as l, U as u, V as d, W as p, aj as g, X as S, J as T, Y as D, Z as I, _ as m, $ as k, L as c, a0 as B, a1 as y, a2 as L, aq as P, ar as C, as as b, at as x, au as R, av as f, aw as v, ax as w, ay as A, aC as F, aD as h, aE as M, aF as E, a3 as V, aI as J, aJ as H, aK as N, aL as O, aO as G, ak as K, a4 as Q, al as U, am as W, a5 as j, a6 as q, aG as z, an as X, aP as Y, ao as Z, a7 as _, a8 as $, aa, ab as sa, ac as ea, ae as ta, aM as oa, aN as ra, ad as na, af as ia, ai as la, ah as ua, ap as da, aH as pa, T as ga, ag as Sa, aQ as Ta, aA as Da, aR as Ia, aV as ma, aB as ka, aS as ca, aT as Ba, az as ya, aU as La, K as Pa, aW as Ca, M as ba, a9 as xa } from "./main-37264eee.js";
2
2
  import "react";
3
3
  import "@commercelayer/sdk";
4
4
  export {
@@ -19,9 +19,9 @@ export {
19
19
  k as EmptyState,
20
20
  c as ErrorBoundary,
21
21
  B as Grid,
22
- P as Hint,
23
- y as Icon,
24
- L as Input,
22
+ y as Hint,
23
+ L as Icon,
24
+ P as Input,
25
25
  C as InputCheckbox,
26
26
  b as InputDate,
27
27
  x as InputDateRange,
@@ -35,8 +35,8 @@ export {
35
35
  M as InputToggleListBox,
36
36
  E as Label,
37
37
  V as Legend,
38
- H as List,
39
- J as ListDetails,
38
+ J as List,
39
+ H as ListDetails,
40
40
  N as ListDetailsItem,
41
41
  O as ListItem,
42
42
  G as OrderSummary,
@@ -73,9 +73,9 @@ export {
73
73
  ka as getDefaultValueFromFlatten,
74
74
  ca as getIsoDateAtDayEdge,
75
75
  Ba as getIsoDateAtDaysBefore,
76
- Pa as isSingleValueSelected,
77
- ya as timeSeparator,
78
- La as useCoreSdkProvider,
76
+ ya as isSingleValueSelected,
77
+ La as timeSeparator,
78
+ Pa as useCoreSdkProvider,
79
79
  Ca as useDelayShow,
80
80
  ba as useTokenProvider,
81
81
  xa as withSkeletonTemplate
@@ -1,7 +1,7 @@
1
1
  import * as V from "react";
2
2
  import fe, { useLayoutEffect as yn, createContext as Et, forwardRef as Cr, useContext as Te, createElement as pe, Fragment as Ne, useRef as ue, useState as me, useMemo as Ce, useCallback as Y, Component as Ar, useEffect as En } from "react";
3
- import { createPortal as yr } from "react-dom";
4
- import { X as Er } from "./main-81ebe20f.js";
3
+ import { H as yr } from "./main-37264eee.js";
4
+ import { createPortal as Er } from "react-dom";
5
5
  var Ue = {}, xr = {
6
6
  get exports() {
7
7
  return Ue;
@@ -2098,7 +2098,7 @@ var Na = function(e) {
2098
2098
  }), a), i);
2099
2099
  return G(er.Provider, {
2100
2100
  value: f
2101
- }, r ? /* @__PURE__ */ yr(y, r) : y);
2101
+ }, r ? /* @__PURE__ */ Er(y, r) : y);
2102
2102
  }, Ra = function(e) {
2103
2103
  var r = e.isDisabled, i = e.isRtl;
2104
2104
  return {
@@ -4334,7 +4334,7 @@ function su(t) {
4334
4334
  )));
4335
4335
  }
4336
4336
  function cu(t) {
4337
- return /* @__PURE__ */ fe.createElement(Pt.ClearIndicator, { ...t, className: "p-0" }, /* @__PURE__ */ fe.createElement("button", { type: "button", className: "px-2 cursor-pointer" }, /* @__PURE__ */ fe.createElement(Er, null)));
4337
+ return /* @__PURE__ */ fe.createElement(Pt.ClearIndicator, { ...t, className: "p-0" }, /* @__PURE__ */ fe.createElement("button", { type: "button", className: "px-2 cursor-pointer" }, /* @__PURE__ */ fe.createElement(yr, null)));
4338
4338
  }
4339
4339
  const pu = {
4340
4340
  DropdownIndicator: su,
@@ -3,7 +3,7 @@ import { type TokenProviderAllowedApp, type TokenProviderRoleActions, type Token
3
3
  interface TokenProviderValue {
4
4
  dashboardUrl?: string;
5
5
  settings: TokenProviderAuthSettings;
6
- user: TokenProviderAuthUser;
6
+ user: TokenProviderAuthUser | null;
7
7
  canUser: (action: TokenProviderRoleActions, resource: TokenProviderResourceType) => boolean;
8
8
  emitInvalidAuth: (reason: string) => void;
9
9
  }
@@ -6,7 +6,7 @@ interface TokenProviderInternalState {
6
6
  isTokenError: boolean;
7
7
  rolePermissions: TokenProviderRolePermissions;
8
8
  settings: TokenProviderAuthSettings;
9
- user: TokenProviderAuthUser;
9
+ user: TokenProviderAuthUser | null;
10
10
  }
11
11
  export declare const initialTokenProviderState: TokenProviderInternalState;
12
12
  type Action = {
@@ -15,7 +15,7 @@ type Action = {
15
15
  type: 'validToken';
16
16
  payload: {
17
17
  settings: TokenProviderAuthSettings;
18
- user: TokenProviderAuthUser;
18
+ user: TokenProviderAuthUser | null;
19
19
  rolePermissions: TokenProviderRolePermissions;
20
20
  };
21
21
  };
@@ -3,6 +3,20 @@ export type TokenProviderAllowedApp = 'imports' | 'exports' | 'webhooks' | 'reso
3
3
  export type TokenProviderRoleActions = 'create' | 'destroy' | 'read' | 'update';
4
4
  export type TokenProviderPermissionItem = Record<TokenProviderRoleActions, boolean>;
5
5
  export type TokenProviderRolePermissions = Partial<Record<TokenProviderResourceType, TokenProviderPermissionItem>>;
6
+ interface CoreApiOwnerUser {
7
+ type: 'User';
8
+ id: string;
9
+ first_name: string;
10
+ last_name: string;
11
+ email: string;
12
+ owner: boolean;
13
+ time_zone: string;
14
+ }
15
+ interface CoreApiOwnerCustomer {
16
+ type: 'Customer';
17
+ id: string;
18
+ email: string;
19
+ }
6
20
  export interface TokenProviderTokenInfo {
7
21
  token: {
8
22
  test: boolean;
@@ -24,15 +38,7 @@ export interface TokenProviderTokenInfo {
24
38
  permissions: Record<TokenProviderResourceType, {
25
39
  actions: TokenProviderRoleActions[];
26
40
  }>;
27
- owner?: {
28
- id: string;
29
- type: 'User';
30
- first_name?: string;
31
- last_name?: string;
32
- email?: string;
33
- owner?: boolean;
34
- time_zone?: string;
35
- };
41
+ owner?: CoreApiOwnerUser | CoreApiOwnerCustomer;
36
42
  }
37
43
  export type Mode = 'live' | 'test';
38
44
  export interface TokenProviderAuthSettings {
@@ -42,11 +48,12 @@ export interface TokenProviderAuthSettings {
42
48
  mode: Mode;
43
49
  }
44
50
  export interface TokenProviderAuthUser {
45
- id?: string;
46
- email?: string;
47
- firstName?: string;
48
- lastName?: string;
49
- displayName?: string;
50
- fullName?: string;
51
- timezone?: string;
51
+ id: string;
52
+ email: string;
53
+ firstName: string;
54
+ lastName: string;
55
+ displayName: string;
56
+ fullName: string;
57
+ timezone: string;
52
58
  }
59
+ export {};
@@ -9,7 +9,7 @@ interface ValidToken {
9
9
  mode: Mode;
10
10
  organizationSlug: string;
11
11
  permissions?: TokenProviderRolePermissions;
12
- user: TokenProviderAuthUser;
12
+ user: TokenProviderAuthUser | null;
13
13
  }
14
14
  interface InvalidToken {
15
15
  isValidToken: false;
@@ -1,8 +1,8 @@
1
- export interface AvatarProps extends React.HTMLAttributes<HTMLImageElement> {
1
+ export interface AvatarProps {
2
2
  /**
3
3
  * Image URL
4
4
  */
5
- src: string;
5
+ src: keyof typeof presets | `https://${string}` | `data:image/${string}`;
6
6
  /**
7
7
  * Alt text
8
8
  */
@@ -22,9 +22,23 @@ export interface AvatarProps extends React.HTMLAttributes<HTMLImageElement> {
22
22
  * @default "normal"
23
23
  */
24
24
  size?: 'small' | 'normal';
25
+ /**
26
+ * Image class
27
+ */
28
+ className?: string;
25
29
  }
26
30
  declare function Avatar({ src, alt, border, shape, size, className, ...rest }: AvatarProps): JSX.Element;
27
31
  declare namespace Avatar {
28
32
  var displayName: string;
29
33
  }
30
34
  export { Avatar };
35
+ declare const presets: {
36
+ 'payments:stripe': string;
37
+ 'payments:braintree': string;
38
+ 'payments:paypal': string;
39
+ 'payments:klarna': string;
40
+ 'payments:checkout': string;
41
+ 'payments:adyen': string;
42
+ 'payments:axerve': string;
43
+ 'payments:satispay': string;
44
+ };
@@ -1,4 +1,4 @@
1
- import * as phosphor from 'phosphor-react';
1
+ import * as phosphor from '@phosphor-icons/react';
2
2
  export interface IconProps extends React.HTMLAttributes<HTMLDivElement> {
3
3
  /**
4
4
  * Name of the icon to display
@@ -23,27 +23,27 @@ declare namespace Icon {
23
23
  }
24
24
  export { Icon };
25
25
  declare const iconMapping: {
26
- arrowBendDownRight: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
27
- arrowCircleDown: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
28
- arrowClockwise: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
29
- arrowDown: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
30
- arrowLeft: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
31
- asterisk: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
32
- caretRight: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
33
- chatCircle: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
34
- check: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
35
- cloud: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
36
- creditCard: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
37
- download: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
38
- eye: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
39
- flag: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
40
- funnel: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
41
- magnifyingGlass: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
42
- minus: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
43
- package: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
44
- stack: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
45
- upload: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
46
- user: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
47
- warning: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
48
- x: import("react").ForwardRefExoticComponent<phosphor.IconProps & import("react").RefAttributes<SVGSVGElement>>;
26
+ arrowBendDownRight: phosphor.Icon;
27
+ arrowCircleDown: phosphor.Icon;
28
+ arrowClockwise: phosphor.Icon;
29
+ arrowDown: phosphor.Icon;
30
+ arrowLeft: phosphor.Icon;
31
+ asterisk: phosphor.Icon;
32
+ caretRight: phosphor.Icon;
33
+ chatCircle: phosphor.Icon;
34
+ check: phosphor.Icon;
35
+ cloud: phosphor.Icon;
36
+ creditCard: phosphor.Icon;
37
+ download: phosphor.Icon;
38
+ eye: phosphor.Icon;
39
+ flag: phosphor.Icon;
40
+ funnel: phosphor.Icon;
41
+ magnifyingGlass: phosphor.Icon;
42
+ minus: phosphor.Icon;
43
+ package: phosphor.Icon;
44
+ stack: phosphor.Icon;
45
+ upload: phosphor.Icon;
46
+ user: phosphor.Icon;
47
+ warning: phosphor.Icon;
48
+ x: phosphor.Icon;
49
49
  };
@@ -6,6 +6,7 @@ export interface TimelineEvent {
6
6
  }
7
7
  export declare const Timeline: import('../atoms/SkeletonTemplate').SkeletonTemplateComponent<{
8
8
  events: TimelineEvent[];
9
+ timezone?: string | undefined;
9
10
  onChange?: import("react").ChangeEventHandler<HTMLInputElement> | undefined;
10
11
  onKeyDown?: import("react").KeyboardEventHandler<HTMLInputElement> | undefined;
11
12
  delayMs?: number | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercelayer/app-elements",
3
- "version": "0.0.26",
3
+ "version": "0.0.28",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -37,6 +37,7 @@
37
37
  },
38
38
  "devDependencies": {
39
39
  "@commercelayer/eslint-config-ts-react": "^1.0.0",
40
+ "@phosphor-icons/react": "v2.0.9",
40
41
  "@tailwindcss/forms": "^0.5.3",
41
42
  "@testing-library/jest-dom": "^5.16.5",
42
43
  "@testing-library/react": "^13.4.0",
@@ -50,7 +51,6 @@
50
51
  "eslint": "^8.37.0",
51
52
  "jsdom": "^21.1.1",
52
53
  "msw": "^1.2.1",
53
- "phosphor-react": "^1.4.1",
54
54
  "polished": "^4.2.2",
55
55
  "postcss": "^8.4.21",
56
56
  "tailwindcss": "^3.3.1",