@commercelayer/app-elements 0.0.4 → 0.0.6

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
1
  import * as de from "react";
2
2
  import le, { useRef as W, useState as a, useEffect as z, useCallback as B, forwardRef as ce } from "react";
3
- import { _ as ve, a as s, h as Oe, b as O, c as Se, u as _e, S as he, d as me, s as ge } from "./overrides-18663ab9.js";
3
+ import { _ as ve, a as s, h as Oe, b as O, c as Se, u as _e, S as he, d as me, s as ge } from "./overrides-f94d9794.js";
4
4
  import "react-dom";
5
- import "./main-a1e1dc18.js";
5
+ import "./main-77ae32fd.js";
6
6
  import "@commercelayer/sdk";
7
7
  var ye = ["defaultOptions", "cacheOptions", "loadOptions", "options", "isLoading", "onInputChange", "filterOption"];
8
8
  function Ce(t) {
@@ -1,6 +1,6 @@
1
1
  import * as Y from "react";
2
2
  import h, { forwardRef as Gi, createElement as Yu, Component as Lu, createRef as Au } from "react";
3
- import { I as ju, r as Bu, a as O, b as Zi, t as L, c as D, g as Io, d as fn, e as Fu, s as pn, f as Ji, h as Hu, i as Wu, j as Uu, l as aa, k as qu, m as ia, n as Vu, o as Ku, p as J, q as eu, u as Qu, v as ua, w as zu, x as Xu, X as Gu } from "./main-a1e1dc18.js";
3
+ import { I as ju, r as Bu, a as O, b as Zi, t as L, c as D, g as Io, d as fn, e as Fu, s as pn, f as Ji, h as Hu, i as Wu, j as Uu, l as aa, k as qu, m as ia, n as Vu, o as Ku, p as J, q as eu, u as Qu, v as ua, w as zu, x as Xu, X as Gu } from "./main-77ae32fd.js";
4
4
  import * as Zu from "react-dom";
5
5
  import Ju, { findDOMNode as es } from "react-dom";
6
6
  import "@commercelayer/sdk";
@@ -7673,7 +7673,7 @@ const Ry = Gi(
7673
7673
  minDate: i,
7674
7674
  openToDate: e ?? i,
7675
7675
  className: J(
7676
- "block w-full px-4 py-2 h-10 placeholder:text-gray-400 font-medium",
7676
+ "block w-full px-4 py-2.5 placeholder:text-gray-400 font-medium",
7677
7677
  "rounded outline-0",
7678
7678
  "transition duration-500 ease-in-out focus:outline-0 focus:border-primary-light",
7679
7679
  Xu(d),
@@ -1,8 +1,8 @@
1
1
  import * as r from "react";
2
2
  import a, { forwardRef as s } from "react";
3
- import { u as m, S as c, d as p, s as i } from "./overrides-18663ab9.js";
3
+ import { u as m, S as c, d as p, s as i } from "./overrides-f94d9794.js";
4
4
  import "react-dom";
5
- import "./main-a1e1dc18.js";
5
+ import "./main-77ae32fd.js";
6
6
  import "@commercelayer/sdk";
7
7
  var l = /* @__PURE__ */ s(function(e, t) {
8
8
  var o = m(e);
@@ -1,18 +1,37 @@
1
- /**
2
- * Format the date as nice string
3
- * @returns a nice string representation. Example: 'Jul 21, 2022' or 'Jul 21, 2022 · 1:16 PM' if includeTime
4
- */
5
- export declare function formatDate({ isoDate, includeTime, timezone }: {
1
+ declare type Format = 'full' | 'noTime' | 'noYear';
2
+ declare type FormatDateOptions = {
6
3
  /**
7
4
  * JavaScript ISO date string. Example '2022-10-06T11:59:30.371Z'
8
5
  */
9
6
  isoDate?: string;
10
- /**
11
- * Boolean value to include time in returned string: Example: 'Oct 26, 2022 · 4:16 PM'
12
- */
13
- includeTime?: boolean;
14
7
  /**
15
8
  * Set a specific timezone, when not passed default value is 'UTC'
16
9
  */
17
10
  timezone?: string;
18
- }): string;
11
+ } & ({
12
+ /**
13
+ * How to format the date:
14
+ * - full `Feb 28, 2023 · 5:30 PM`
15
+ * - noTime `Feb 28, 2023`
16
+ * - noYear `Feb 28`
17
+ * @default noTime
18
+ */
19
+ format?: Format;
20
+ } | {
21
+ /**
22
+ * When set as `custom` a `customTemplate` is required
23
+ */
24
+ format: 'custom';
25
+ /**
26
+ * Custom template to override the default one ('LLL dd, yyyy').
27
+ * @link https://date-fns.org/v2.29.3/docs/format
28
+ */
29
+ customTemplate: string;
30
+ });
31
+ /**
32
+ * Format the date as nice string also specifying a custom timezone
33
+ * @param opts a set of `FormatDateOptions`
34
+ * @returns a nice string representation. Example: 'Jul 21, 2022' or 'Jul 21, 2022 · 1:16 PM' if includeTime
35
+ */
36
+ export declare function formatDate({ isoDate, timezone, ...opts }: FormatDateOptions): string;
37
+ export {};