@commercelayer/app-elements 1.23.3 → 1.24.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.
@@ -0,0 +1,52 @@
1
+ import { z } from 'zod';
2
+
3
+ export declare const resourceAddressFormFieldsSchema: z.ZodObject<{
4
+ first_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
5
+ last_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6
+ company: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7
+ line_1: z.ZodString;
8
+ line_2: z.ZodOptional<z.ZodNullable<z.ZodString>>;
9
+ city: z.ZodString;
10
+ zip_code: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11
+ state_code: z.ZodString;
12
+ country_code: z.ZodString;
13
+ phone: z.ZodString;
14
+ billing_info: z.ZodOptional<z.ZodNullable<z.ZodString>>;
15
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ city: string;
18
+ country_code: string;
19
+ line_1: string;
20
+ state_code: string;
21
+ phone: string;
22
+ first_name?: string | null | undefined;
23
+ last_name?: string | null | undefined;
24
+ company?: string | null | undefined;
25
+ line_2?: string | null | undefined;
26
+ zip_code?: string | null | undefined;
27
+ notes?: string | null | undefined;
28
+ billing_info?: string | null | undefined;
29
+ }, {
30
+ city: string;
31
+ country_code: string;
32
+ line_1: string;
33
+ state_code: string;
34
+ phone: string;
35
+ first_name?: string | null | undefined;
36
+ last_name?: string | null | undefined;
37
+ company?: string | null | undefined;
38
+ line_2?: string | null | undefined;
39
+ zip_code?: string | null | undefined;
40
+ notes?: string | null | undefined;
41
+ billing_info?: string | null | undefined;
42
+ }>;
43
+ export interface ResourceAddressFormFieldsProps {
44
+ name?: string;
45
+ showBillingInfo?: boolean;
46
+ }
47
+ export declare const ResourceAddressFormFields: import('../../atoms/SkeletonTemplate').SkeletonTemplateComponent<{
48
+ name?: string | undefined;
49
+ showBillingInfo?: boolean | undefined;
50
+ delayMs?: number | undefined;
51
+ isLoading?: boolean | undefined;
52
+ }>;
@@ -1 +1,3 @@
1
1
  export { ResourceAddress, type ResourceAddressProps } from './ResourceAddress';
2
+ export { ResourceAddressFormFields, resourceAddressFormFieldsSchema, type ResourceAddressFormFieldsProps } from './ResourceAddressFormFields';
3
+ export { useResourceAddressOverlay } from './useResourceAddressOverlay';
@@ -0,0 +1,11 @@
1
+ import { Address } from '@commercelayer/sdk';
2
+
3
+ export declare const useResourceAddressOverlay: ({ title, address, showBillingInfo, onUpdate }: {
4
+ title?: string;
5
+ address: Address;
6
+ showBillingInfo?: boolean;
7
+ onUpdate?: (updatedAddress: Address) => void;
8
+ }) => {
9
+ ResourceAddressOverlay: () => false | import("react/jsx-runtime").JSX.Element;
10
+ openAddressOverlay: () => void;
11
+ };
@@ -9,7 +9,7 @@ export declare const ListItemDescription: import('../../atoms/SkeletonTemplate')
9
9
  }>;
10
10
  export declare const ListItemIcon: import('../../atoms/SkeletonTemplate').SkeletonTemplateComponent<{
11
11
  color: "none" | "green" | "orange" | "red" | "gray" | "lightGray" | "teal" | "white" | "black" | undefined;
12
- icon: "download" | "package" | "tag" | "list" | "warning" | "info" | "x" | "airplaneTakeoff" | "appWindow" | "arrowBendDownRight" | "arrowCircleDown" | "arrowCircleUp" | "arrowClockwise" | "arrowDown" | "arrowLeft" | "arrowRight" | "arrowsLeftRight" | "arrowSquareOut" | "arrowUpRight" | "arrowUUpLeft" | "asteriskSimple" | "bank" | "bookOpenText" | "bracketsCurly" | "buildings" | "calculator" | "calendarBlank" | "calendarCheck" | "camera" | "caretDown" | "caretRight" | "chat" | "chatCircle" | "check" | "clipboardText" | "clockClockwise" | "cloudArrowUp" | "creditCard" | "currencyEur" | "dotsThree" | "eye" | "eyeSlash" | "flag" | "folderOpen" | "funnelSimple" | "gearFine" | "gift" | "gitFork" | "githubLogo" | "globe" | "globeSimple" | "googleLogo" | "hourglass" | "houseSimple" | "lifebuoy" | "lightbulbFilament" | "linkSimple" | "lockSimple" | "lockSimpleOpen" | "magnifyingGlass" | "mapPin" | "megaphoneSimple" | "minus" | "minusCircle" | "pencilSimple" | "percent" | "plus" | "printer" | "pulse" | "pushPin" | "puzzlePiece" | "question" | "receipt" | "rocketLaunch" | "seal" | "shapes" | "shield" | "shoppingBag" | "signOut" | "slackLogo" | "sliders" | "squaresFour" | "stack" | "storefront" | "suitcaseSimple" | "ticket" | "trash" | "treeStructure" | "truck" | "tShirt" | "upload" | "user" | "userCircle" | "userRectangle" | "users" | "warehouse" | "warningCircle" | "webhooksLogo" | "xCircle";
12
+ icon: "download" | "package" | "tag" | "list" | "warning" | "info" | "x" | "airplaneTakeoff" | "appWindow" | "arrowBendDownRight" | "arrowCircleDown" | "arrowCircleUp" | "arrowClockwise" | "arrowDown" | "arrowLeft" | "arrowRight" | "arrowsLeftRight" | "arrowSquareOut" | "arrowUpRight" | "arrowUUpLeft" | "asteriskSimple" | "bank" | "bookOpenText" | "bracketsCurly" | "buildings" | "calculator" | "calendarBlank" | "calendarCheck" | "camera" | "caretDown" | "caretRight" | "chat" | "chatCircle" | "check" | "clipboardText" | "clockClockwise" | "cloudArrowUp" | "creditCard" | "currencyEur" | "dotsThree" | "envelopeSimple" | "eye" | "eyeSlash" | "flag" | "folderOpen" | "funnelSimple" | "gearFine" | "gift" | "gitFork" | "githubLogo" | "globe" | "globeSimple" | "googleLogo" | "hourglass" | "houseSimple" | "lifebuoy" | "lightbulbFilament" | "linkSimple" | "lockSimple" | "lockSimpleOpen" | "magnifyingGlass" | "mapPin" | "megaphoneSimple" | "minus" | "minusCircle" | "pencilSimple" | "percent" | "plus" | "printer" | "pulse" | "pushPin" | "puzzlePiece" | "question" | "receipt" | "rocketLaunch" | "seal" | "shapes" | "shield" | "shoppingBag" | "signOut" | "slackLogo" | "sliders" | "squaresFour" | "stack" | "storefront" | "suitcaseSimple" | "ticket" | "trash" | "treeStructure" | "truck" | "tShirt" | "upload" | "user" | "userCircle" | "userRectangle" | "users" | "warehouse" | "warningCircle" | "webhooksLogo" | "xCircle";
13
13
  delayMs?: number | undefined;
14
14
  isLoading?: boolean | undefined;
15
15
  }>;
@@ -16,6 +16,21 @@ export declare function isFunctionComponent(reactNode: ReactNode): reactNode is
16
16
  * ```
17
17
  */
18
18
  export declare function isSpecificReactComponent(reactNode: ReactNode, displayNames: RegExp[]): reactNode is JSX.Element;
19
+ /**
20
+ * Checks if a ReactNode matches a specific JSX tag.
21
+ * @param reactNode - a ReactNode single child
22
+ * @param tagNames - a list of names of the jsx tags we would like to match
23
+ * @returns a boolean value indicating argument match the passed displayNames
24
+ *
25
+ * @example
26
+ * ```jsx
27
+ * React.Children.map(children, (child) =>
28
+ * isSpecificJsxTag(child, ['button', 'input'])
29
+ * )
30
+ * // will return an array of true/false values depending if some child is a button
31
+ * ```
32
+ */
33
+ export declare function isSpecificJsxTag(reactNode: ReactNode, tagNames: string[]): reactNode is JSX.Element;
19
34
  export declare function getInnerText(reactNode: ReactNode): string;
20
35
  /**
21
36
  * Filter an `Element` looking for all children with the given `displayName`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commercelayer/app-elements",
3
- "version": "1.23.3",
3
+ "version": "1.24.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -39,7 +39,7 @@
39
39
  "query-string": "^9.0.0",
40
40
  "react": "^18.2.0",
41
41
  "react-currency-input-field": "^3.8.0",
42
- "react-datepicker": "^6.7.0",
42
+ "react-datepicker": "^6.9.0",
43
43
  "react-dom": "^18.2.0",
44
44
  "react-hook-form": "^7.51.3",
45
45
  "react-select": "^5.8.0",
@@ -47,7 +47,7 @@
47
47
  "swr": "^2.2.5",
48
48
  "ts-invariant": "^0.10.3",
49
49
  "type-fest": "^4.15.0",
50
- "zod": "^3.22.4"
50
+ "zod": "^3.23.4"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@commercelayer/eslint-config-ts-react": "^1.4.5",
@@ -63,8 +63,8 @@
63
63
  "@vitejs/plugin-react": "^4.2.1",
64
64
  "autoprefixer": "^10.4.19",
65
65
  "cross-fetch": "^4.0.0",
66
- "date-fns": "^2.30.0",
67
- "date-fns-tz": "^2.0.0",
66
+ "date-fns": "^3.6.0",
67
+ "date-fns-tz": "^3.1.3",
68
68
  "eslint": "^8.56.0",
69
69
  "jsdom": "^24.0.0",
70
70
  "msw": "^2.2.13",