@commercelayer/app-elements 0.0.71 → 0.0.72

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.
@@ -1,8 +1,8 @@
1
- import { L as de, H as le } from "./main-1d215132.js";
1
+ import { L as de, H as le } from "./main-81037174.js";
2
2
  import * as ce from "react";
3
3
  import { useRef as F, useState as a, useEffect as x, useCallback as D, forwardRef as ve } from "react";
4
- import { _ as Oe, a as s, h as Se, b as g, u as me, S as _e, c as he, s as ge } from "./overrides-c229b969.js";
5
- import { d as ye } from "./unsupportedIterableToArray-a90c0c86.js";
4
+ import { _ as Oe, a as s, h as Se, b as g, u as me, S as _e, c as he, s as ge } from "./overrides-905d43b2.js";
5
+ import { d as ye } from "./unsupportedIterableToArray-198150f9.js";
6
6
  import "react-dom";
7
7
  import "@commercelayer/sdk";
8
8
  var Ce = ["defaultOptions", "cacheOptions", "loadOptions", "options", "isLoading", "onInputChange", "filterOption"];
@@ -1,7 +1,7 @@
1
- import { P as Ma, r as E, a as Rn, t as H, b as Mt, c as Ee, d as _, g as Cr, _ as Qt, s as je, e as cr, f as xa, h as ur, i as Ln, j as Sa, k as Oa, l as Ea, m as qr, n as _a, o as Kr, p as Pa, q as Ta, u as Na, v as An, w as ae, x as nt, y as pr, z as Hn, A as Ya, B as lr, C as Zr, D as Ia, E as Ra, F as La, G as At, H as Ke, I as Aa, J as Ha, K as Fa } from "./main-1d215132.js";
1
+ import { P as Ma, r as E, a as Rn, t as H, b as Mt, c as Ee, d as _, g as Cr, _ as Qt, s as je, e as cr, f as xa, h as ur, i as Ln, j as Sa, k as Oa, l as Ea, m as qr, n as _a, o as Kr, p as Pa, q as Ta, u as Na, v as An, w as ae, x as nt, y as pr, z as Hn, A as Ya, B as lr, C as Zr, D as Ia, E as Ra, F as La, G as At, H as Ke, I as Aa, J as Ha, K as Fa } from "./main-81037174.js";
2
2
  import * as B from "react";
3
3
  import h, { forwardRef as Fn, createElement as ja, Component as Ua, createRef as Ba } from "react";
4
- import { _ as Wa, a as I, b as R, c as N, d as D, e as b, f as Y } from "./unsupportedIterableToArray-a90c0c86.js";
4
+ import { _ as Wa, a as I, b as R, c as N, d as D, e as b, f as Y } from "./unsupportedIterableToArray-198150f9.js";
5
5
  import * as Va from "react-dom";
6
6
  import Qa, { findDOMNode as $a } from "react-dom";
7
7
  import "@commercelayer/sdk";
@@ -1,10 +1,10 @@
1
- import { H as n } from "./main-1d215132.js";
2
- import { u as s, S as m, c as p, s as i } from "./overrides-c229b969.js";
1
+ import { H as n } from "./main-81037174.js";
2
+ import { u as s, S as m, c as p, s as i } from "./overrides-905d43b2.js";
3
3
  import * as c from "react";
4
4
  import { forwardRef as S } from "react";
5
5
  import "react-dom";
6
6
  import "@commercelayer/sdk";
7
- import "./unsupportedIterableToArray-a90c0c86.js";
7
+ import "./unsupportedIterableToArray-198150f9.js";
8
8
  var f = /* @__PURE__ */ S(function(e, t) {
9
9
  var o = s(e);
10
10
  return /* @__PURE__ */ c.createElement(m, p({
@@ -1,3 +1,4 @@
1
+ import { type Simplify } from 'type-fest';
1
2
  type Format = 'date' | 'time' | 'timeWithSeconds' | 'full' | 'fullWithSeconds' | 'distanceToNow';
2
3
  interface FormatDateOptions {
3
4
  /**
@@ -61,4 +62,20 @@ export declare function getIsoDateAtDaysBefore({ isoString, days, timezone }: {
61
62
  days: number;
62
63
  timezone?: string;
63
64
  }): string | undefined;
65
+ export interface Event {
66
+ date: string;
67
+ }
68
+ type Position = 'first' | 'other';
69
+ /**
70
+ *
71
+ * @param events
72
+ * @param options
73
+ * @returns
74
+ */
75
+ export declare function sortAndGroupByDate<T extends Event>(events: T[], { timezone, orders }?: {
76
+ timezone?: string;
77
+ orders?: 'asc' | 'desc';
78
+ }): Record<string, Array<Simplify<T & {
79
+ position: Position;
80
+ }>>>;
64
81
  export {};
@@ -1,5 +1,6 @@
1
1
  import { type AvatarProps } from '../ui/atoms/Avatar';
2
2
  import { type Parcel, type Shipment } from '@commercelayer/sdk';
3
+ import { type SetNonNullable } from 'type-fest';
3
4
  import { z } from 'zod';
4
5
  export declare function getAvatarSrcFromRate(rate: Rate): AvatarProps['src'];
5
6
  /**
@@ -45,7 +46,7 @@ declare const trackingDetailSchema: z.ZodObject<{
45
46
  /** The original source of the information for this scan event, usually the carrier */
46
47
  source: z.ZodNullable<z.ZodString>;
47
48
  /** The location associated with the scan event */
48
- tracking_location: z.ZodObject<{
49
+ tracking_location: z.ZodEffects<z.ZodObject<{
49
50
  /** "TrackingLocation" */
50
51
  object: z.ZodLiteral<"TrackingLocation">;
51
52
  /** The city where the scan event occurred (if available) */
@@ -68,6 +69,18 @@ declare const trackingDetailSchema: z.ZodObject<{
68
69
  state: string | null;
69
70
  country: string | null;
70
71
  zip: string | null;
72
+ }>, SetNonNullable<{
73
+ object: "TrackingLocation";
74
+ city: string | null;
75
+ state: string | null;
76
+ country: string | null;
77
+ zip: string | null;
78
+ }, "city"> | null, {
79
+ object: "TrackingLocation";
80
+ city: string | null;
81
+ state: string | null;
82
+ country: string | null;
83
+ zip: string | null;
71
84
  }>;
72
85
  description: z.ZodNullable<z.ZodString>;
73
86
  carrier_code: z.ZodNullable<z.ZodString>;
@@ -79,13 +92,13 @@ declare const trackingDetailSchema: z.ZodObject<{
79
92
  message: string | null;
80
93
  status_detail: string | null;
81
94
  datetime: string | null;
82
- tracking_location: {
95
+ tracking_location: SetNonNullable<{
83
96
  object: "TrackingLocation";
84
97
  city: string | null;
85
98
  state: string | null;
86
99
  country: string | null;
87
100
  zip: string | null;
88
- };
101
+ }, "city"> | null;
89
102
  carrier_code: string | null;
90
103
  }, {
91
104
  object: "TrackingDetail";