@purpurds/countdown 8.8.1 → 8.9.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.
@@ -1,51 +1,45 @@
1
- import { jsx as s, jsxs as P, Fragment as Q } from "react/jsx-runtime";
2
- import * as p from "react";
3
- import { useRef as U, useState as C, useCallback as X, useEffect as z, forwardRef as Y, useId as rr } from "react";
1
+ import { jsx as p, jsxs as O, Fragment as L } from "react/jsx-runtime";
2
+ import * as s from "react";
3
+ import { useRef as U, useState as S, useCallback as X, useEffect as k, forwardRef as Y, useId as rr } from "react";
4
4
  import "react-dom";
5
5
  function nr(r) {
6
6
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
7
7
  }
8
- var T = { exports: {} };
9
- /*!
10
- Copyright (c) 2018 Jed Watson.
11
- Licensed under the MIT License (MIT), see
12
- http://jedwatson.github.io/classnames
13
- */
14
- var E;
15
- function tr() {
16
- return E || (E = 1, (function(r) {
8
+ var j = { exports: {} }, T;
9
+ function er() {
10
+ return T || (T = 1, (function(r) {
17
11
  (function() {
18
- var a = {}.hasOwnProperty;
19
- function t() {
20
- for (var n = "", e = 0; e < arguments.length; e++) {
21
- var i = arguments[e];
22
- i && (n = o(n, u.call(this, i)));
12
+ var t = {}.hasOwnProperty;
13
+ function e() {
14
+ for (var n = "", a = 0; a < arguments.length; a++) {
15
+ var i = arguments[a];
16
+ i && (n = u(n, o.call(this, i)));
23
17
  }
24
18
  return n;
25
19
  }
26
- function u(n) {
20
+ function o(n) {
27
21
  if (typeof n == "string" || typeof n == "number")
28
22
  return this && this[n] || n;
29
23
  if (typeof n != "object")
30
24
  return "";
31
25
  if (Array.isArray(n))
32
- return t.apply(this, n);
26
+ return e.apply(this, n);
33
27
  if (n.toString !== Object.prototype.toString && !n.toString.toString().includes("[native code]"))
34
28
  return n.toString();
35
- var e = "";
29
+ var a = "";
36
30
  for (var i in n)
37
- a.call(n, i) && n[i] && (e = o(e, this && this[i] || i));
38
- return e;
31
+ t.call(n, i) && n[i] && (a = u(a, this && this[i] || i));
32
+ return a;
39
33
  }
40
- function o(n, e) {
41
- return e ? n ? n + " " + e : n + e : n;
34
+ function u(n, a) {
35
+ return a ? n ? n + " " + a : n + a : n;
42
36
  }
43
- r.exports ? (t.default = t, r.exports = t) : window.classNames = t;
37
+ r.exports ? (e.default = e, r.exports = e) : window.classNames = e;
44
38
  })();
45
- })(T)), T.exports;
39
+ })(j)), j.exports;
46
40
  }
47
- var er = tr();
48
- const ar = /* @__PURE__ */ nr(er), or = {
41
+ var tr = er();
42
+ const ar = /* @__PURE__ */ nr(tr), ur = {
49
43
  "purpur-paragraph": "_purpur-paragraph_1rh57_1",
50
44
  "purpur-paragraph--disabled": "_purpur-paragraph--disabled_1rh57_7",
51
45
  "purpur-paragraph--hyphens": "_purpur-paragraph--hyphens_1rh57_10",
@@ -60,90 +54,89 @@ const ar = /* @__PURE__ */ nr(er), or = {
60
54
  "purpur-paragraph--additional-100-medium": "_purpur-paragraph--additional-100-medium_1rh57_60",
61
55
  "purpur-paragraph--overline-100": "_purpur-paragraph--overline-100_1rh57_67",
62
56
  "purpur-paragraph--overline-200": "_purpur-paragraph--overline-200_1rh57_75"
63
- }, ur = ar.bind(or), ir = {
57
+ }, or = ar.bind(ur), ir = {
64
58
  PARAGRAPH100: "paragraph-100"
65
- }, v = "purpur-paragraph", N = ({
59
+ }, $ = "purpur-paragraph", N = ({
66
60
  children: r,
67
- className: a,
68
- disabled: t,
69
- enableHyphenation: u = !1,
70
- negative: o = !1,
61
+ className: t,
62
+ disabled: e,
63
+ enableHyphenation: o = !1,
64
+ negative: u = !1,
71
65
  variant: n = ir.PARAGRAPH100,
72
- ...e
66
+ ...a
73
67
  }) => {
74
- const i = ur(a, v, `${v}--${n}`, {
75
- [`${v}--hyphens`]: u,
76
- [`${v}--disabled`]: t,
77
- [`${v}--negative`]: o
68
+ const i = or(t, $, `${$}--${n}`, {
69
+ [`${$}--hyphens`]: o,
70
+ [`${$}--disabled`]: e,
71
+ [`${$}--negative`]: u
78
72
  });
79
- return /* @__PURE__ */ s("p", { ...e, className: i, children: r });
73
+ return /* @__PURE__ */ p("p", { ...a, className: i, children: r });
80
74
  };
81
75
  N.displayName = "Paragraph";
82
- function M(r, a) {
76
+ function z(r, t) {
83
77
  if (typeof r == "function")
84
- return r(a);
85
- r != null && (r.current = a);
78
+ return r(t);
79
+ r != null && (r.current = t);
86
80
  }
87
81
  function pr(...r) {
88
- return (a) => {
89
- let t = !1;
90
- const u = r.map((o) => {
91
- const n = M(o, a);
92
- return !t && typeof n == "function" && (t = !0), n;
82
+ return (t) => {
83
+ let e = !1;
84
+ const o = r.map((u) => {
85
+ const n = z(u, t);
86
+ return !e && typeof n == "function" && (e = !0), n;
93
87
  });
94
- if (t)
88
+ if (e)
95
89
  return () => {
96
- for (let o = 0; o < u.length; o++) {
97
- const n = u[o];
98
- typeof n == "function" ? n() : M(r[o], null);
90
+ for (let u = 0; u < o.length; u++) {
91
+ const n = o[u];
92
+ typeof n == "function" ? n() : z(r[u], null);
99
93
  }
100
94
  };
101
95
  };
102
96
  }
103
97
  // @__NO_SIDE_EFFECTS__
104
98
  function sr(r) {
105
- const a = /* @__PURE__ */ cr(r), t = p.forwardRef((u, o) => {
106
- const { children: n, ...e } = u, i = p.Children.toArray(n), l = i.find(dr);
99
+ const t = /* @__PURE__ */ cr(r), e = s.forwardRef((o, u) => {
100
+ const { children: n, ...a } = o, i = s.Children.toArray(n), l = i.find(dr);
107
101
  if (l) {
108
- const h = l.props.children, g = i.map((d) => d === l ? p.Children.count(h) > 1 ? p.Children.only(null) : p.isValidElement(h) ? h.props.children : null : d);
109
- return /* @__PURE__ */ s(a, { ...e, ref: o, children: p.isValidElement(h) ? p.cloneElement(h, void 0, g) : null });
102
+ const h = l.props.children, b = i.map((d) => d === l ? s.Children.count(h) > 1 ? s.Children.only(null) : s.isValidElement(h) ? h.props.children : null : d);
103
+ return /* @__PURE__ */ p(t, { ...a, ref: u, children: s.isValidElement(h) ? s.cloneElement(h, void 0, b) : null });
110
104
  }
111
- return /* @__PURE__ */ s(a, { ...e, ref: o, children: n });
105
+ return /* @__PURE__ */ p(t, { ...a, ref: u, children: n });
112
106
  });
113
- return t.displayName = `${r}.Slot`, t;
107
+ return e.displayName = `${r}.Slot`, e;
114
108
  }
115
109
  // @__NO_SIDE_EFFECTS__
116
110
  function cr(r) {
117
- const a = p.forwardRef((t, u) => {
118
- const { children: o, ...n } = t;
119
- if (p.isValidElement(o)) {
120
- const e = fr(o), i = hr(n, o.props);
121
- return o.type !== p.Fragment && (i.ref = u ? pr(u, e) : e), p.cloneElement(o, i);
111
+ const t = s.forwardRef((e, o) => {
112
+ const { children: u, ...n } = e;
113
+ if (s.isValidElement(u)) {
114
+ const a = hr(u), i = _r(n, u.props);
115
+ return u.type !== s.Fragment && (i.ref = o ? pr(o, a) : a), s.cloneElement(u, i);
122
116
  }
123
- return p.Children.count(o) > 1 ? p.Children.only(null) : null;
117
+ return s.Children.count(u) > 1 ? s.Children.only(null) : null;
124
118
  });
125
- return a.displayName = `${r}.SlotClone`, a;
119
+ return t.displayName = `${r}.SlotClone`, t;
126
120
  }
127
121
  var lr = Symbol("radix.slottable");
128
122
  function dr(r) {
129
- return p.isValidElement(r) && typeof r.type == "function" && "__radixId" in r.type && r.type.__radixId === lr;
123
+ return s.isValidElement(r) && typeof r.type == "function" && "__radixId" in r.type && r.type.__radixId === lr;
130
124
  }
131
- function hr(r, a) {
132
- const t = { ...a };
133
- for (const u in a) {
134
- const o = r[u], n = a[u];
135
- /^on[A-Z]/.test(u) ? o && n ? t[u] = (...e) => {
136
- n(...e), o(...e);
137
- } : o && (t[u] = o) : u === "style" ? t[u] = { ...o, ...n } : u === "className" && (t[u] = [o, n].filter(Boolean).join(" "));
125
+ function _r(r, t) {
126
+ const e = { ...t };
127
+ for (const o in t) {
128
+ const u = r[o], n = t[o];
129
+ /^on[A-Z]/.test(o) ? u && n ? e[o] = (...a) => {
130
+ n(...a), u(...a);
131
+ } : u && (e[o] = u) : o === "style" ? e[o] = { ...u, ...n } : o === "className" && (e[o] = [u, n].filter(Boolean).join(" "));
138
132
  }
139
- return { ...r, ...t };
133
+ return { ...r, ...e };
140
134
  }
141
- function fr(r) {
142
- var a, t;
143
- let u = (a = Object.getOwnPropertyDescriptor(r.props, "ref")) == null ? void 0 : a.get, o = u && "isReactWarning" in u && u.isReactWarning;
144
- return o ? r.ref : (u = (t = Object.getOwnPropertyDescriptor(r, "ref")) == null ? void 0 : t.get, o = u && "isReactWarning" in u && u.isReactWarning, o ? r.props.ref : r.props.ref || r.ref);
135
+ function hr(r) {
136
+ let t = Object.getOwnPropertyDescriptor(r.props, "ref")?.get, e = t && "isReactWarning" in t && t.isReactWarning;
137
+ return e ? r.ref : (t = Object.getOwnPropertyDescriptor(r, "ref")?.get, e = t && "isReactWarning" in t && t.isReactWarning, e ? r.props.ref : r.props.ref || r.ref);
145
138
  }
146
- var _r = [
139
+ var fr = [
147
140
  "a",
148
141
  "button",
149
142
  "div",
@@ -160,18 +153,18 @@ var _r = [
160
153
  "span",
161
154
  "svg",
162
155
  "ul"
163
- ], mr = _r.reduce((r, a) => {
164
- const t = /* @__PURE__ */ sr(`Primitive.${a}`), u = p.forwardRef((o, n) => {
165
- const { asChild: e, ...i } = o, l = e ? t : a;
166
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ s(l, { ...i, ref: n });
156
+ ], mr = fr.reduce((r, t) => {
157
+ const e = /* @__PURE__ */ sr(`Primitive.${t}`), o = s.forwardRef((u, n) => {
158
+ const { asChild: a, ...i } = u, l = a ? e : t;
159
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ p(l, { ...i, ref: n });
167
160
  });
168
- return u.displayName = `Primitive.${a}`, { ...r, [a]: u };
169
- }, {}), gr = "VisuallyHidden", k = p.forwardRef(
170
- (r, a) => /* @__PURE__ */ s(
161
+ return o.displayName = `Primitive.${t}`, { ...r, [t]: o };
162
+ }, {}), gr = "VisuallyHidden", I = s.forwardRef(
163
+ (r, t) => /* @__PURE__ */ p(
171
164
  mr.span,
172
165
  {
173
166
  ...r,
174
- ref: a,
167
+ ref: t,
175
168
  style: {
176
169
  // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
177
170
  position: "absolute",
@@ -189,187 +182,200 @@ var _r = [
189
182
  }
190
183
  )
191
184
  );
192
- k.displayName = gr;
193
- var wr = k;
194
- const yr = ({ asChild: r, children: a, ...t }) => /* @__PURE__ */ s(wr, { asChild: r, ...t, children: a });
195
- function vr(r) {
185
+ I.displayName = gr;
186
+ var wr = I;
187
+ const yr = ({ asChild: r, children: t, ...e }) => /* @__PURE__ */ p(wr, { asChild: r, ...e, children: t });
188
+ function br(r) {
196
189
  return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
197
190
  }
198
- var S = { exports: {} };
199
- /*!
200
- Copyright (c) 2018 Jed Watson.
201
- Licensed under the MIT License (MIT), see
202
- http://jedwatson.github.io/classnames
203
- */
204
- var D;
205
- function br() {
206
- return D || (D = 1, (function(r) {
191
+ var R = { exports: {} };
192
+ var M;
193
+ function vr() {
194
+ return M || (M = 1, (function(r) {
207
195
  (function() {
208
- var a = {}.hasOwnProperty;
209
- function t() {
210
- for (var n = "", e = 0; e < arguments.length; e++) {
211
- var i = arguments[e];
212
- i && (n = o(n, u.call(this, i)));
196
+ var t = {}.hasOwnProperty;
197
+ function e() {
198
+ for (var n = "", a = 0; a < arguments.length; a++) {
199
+ var i = arguments[a];
200
+ i && (n = u(n, o.call(this, i)));
213
201
  }
214
202
  return n;
215
203
  }
216
- function u(n) {
204
+ function o(n) {
217
205
  if (typeof n == "string" || typeof n == "number")
218
206
  return this && this[n] || n;
219
207
  if (typeof n != "object")
220
208
  return "";
221
209
  if (Array.isArray(n))
222
- return t.apply(this, n);
210
+ return e.apply(this, n);
223
211
  if (n.toString !== Object.prototype.toString && !n.toString.toString().includes("[native code]"))
224
212
  return n.toString();
225
- var e = "";
213
+ var a = "";
226
214
  for (var i in n)
227
- a.call(n, i) && n[i] && (e = o(e, this && this[i] || i));
228
- return e;
215
+ t.call(n, i) && n[i] && (a = u(a, this && this[i] || i));
216
+ return a;
229
217
  }
230
- function o(n, e) {
231
- return e ? n ? n + " " + e : n + e : n;
218
+ function u(n, a) {
219
+ return a ? n ? n + " " + a : n + a : n;
232
220
  }
233
- r.exports ? (t.default = t, r.exports = t) : window.classNames = t;
221
+ r.exports ? (e.default = e, r.exports = e) : window.classNames = e;
234
222
  })();
235
- })(S)), S.exports;
223
+ })(R)), R.exports;
236
224
  }
237
- var $r = br();
238
- const H = /* @__PURE__ */ vr($r), xr = {
239
- "purpur-countdown--size-md": "_purpur-countdown--size-md_1ljp4_1",
240
- "purpur-countdown--size-lg": "_purpur-countdown--size-lg_1ljp4_5",
241
- "purpur-countdown": "_purpur-countdown_1ljp4_1",
242
- "purpur-countdown--variant-primary": "_purpur-countdown--variant-primary_1ljp4_12",
243
- "purpur-countdown--variant-secondary": "_purpur-countdown--variant-secondary_1ljp4_15",
244
- "purpur-countdown--negative": "_purpur-countdown--negative_1ljp4_18",
245
- "purpur-countdown--fullwidth": "_purpur-countdown--fullwidth_1ljp4_22",
246
- "purpur-countdown--showdays": "_purpur-countdown--showdays_1ljp4_28",
247
- "purpur-countdown__counter-container": "_purpur-countdown__counter-container_1ljp4_36",
248
- "purpur-countdown__label": "_purpur-countdown__label_1ljp4_41"
249
- }, Nr = {
250
- "purpur-countdown-counter--size-lg": "_purpur-countdown-counter--size-lg_vx98f_1",
251
- "purpur-countdown-counter--size-md": "_purpur-countdown-counter--size-md_vx98f_7",
252
- "purpur-countdown-counter": "_purpur-countdown-counter_vx98f_1",
253
- "purpur-countdown-counter__number": "_purpur-countdown-counter__number_vx98f_23",
254
- "tick-animation": "_tick-animation_vx98f_1",
255
- "tick-animation-pseudo": "_tick-animation-pseudo_vx98f_1",
256
- "purpur-countdown-counter__label": "_purpur-countdown-counter__label_vx98f_44"
225
+ var $r = vr();
226
+ const V = /* @__PURE__ */ br($r), Nr = {
227
+ "purpur-countdown--size-md": "_purpur-countdown--size-md_1kmr5_1",
228
+ "purpur-countdown--size-lg": "_purpur-countdown--size-lg_1kmr5_5",
229
+ "purpur-countdown--use-container-queries": "_purpur-countdown--use-container-queries_1kmr5_10",
230
+ "purpur-countdown__counter-container": "_purpur-countdown__counter-container_1kmr5_10",
231
+ "purpur-countdown--full-width": "_purpur-countdown--full-width_1kmr5_15",
232
+ "purpur-countdown--use-media-queries": "_purpur-countdown--use-media-queries_1kmr5_20",
233
+ "purpur-countdown": "_purpur-countdown_1kmr5_1",
234
+ "purpur-countdown--variant-primary": "_purpur-countdown--variant-primary_1kmr5_30",
235
+ "purpur-countdown--variant-secondary": "_purpur-countdown--variant-secondary_1kmr5_33",
236
+ "purpur-countdown--negative": "_purpur-countdown--negative_1kmr5_36",
237
+ "purpur-countdown--show-days": "_purpur-countdown--show-days_1kmr5_46",
238
+ "purpur-countdown__label": "_purpur-countdown__label_1kmr5_62"
239
+ }, xr = {
240
+ "purpur-countdown-counter": "_purpur-countdown-counter_1h7qy_1",
241
+ "purpur-countdown-counter__number--size-lg": "_purpur-countdown-counter__number--size-lg_1h7qy_11",
242
+ "purpur-countdown-counter__number--size-md": "_purpur-countdown-counter__number--size-md_1h7qy_17",
243
+ "purpur-countdown-counter__number": "_purpur-countdown-counter__number_1h7qy_11",
244
+ "tick-animation": "_tick-animation_1h7qy_1",
245
+ "tick-animation-pseudo": "_tick-animation-pseudo_1h7qy_1",
246
+ "purpur-countdown-counter__label": "_purpur-countdown-counter__label_1h7qy_44",
247
+ "purpur-countdown-counter__label--abbr": "_purpur-countdown-counter__label--abbr_1h7qy_51",
248
+ "purpur-countdown-counter__label--full": "_purpur-countdown-counter__label--full_1h7qy_54"
257
249
  };
258
- function O(r) {
259
- const a = (/* @__PURE__ */ new Date()).getTime(), t = Math.abs(r - a);
260
- let u = 0, o = 0, n = 0, e = 0;
261
- return t >= c.day && (e = Math.floor(t / c.day)), t >= c.hour && (n = Math.floor(t % c.day / c.hour)), t >= c.minute && (o = Math.floor(t % c.hour / c.minute)), t >= c.second && (u = Math.floor(t % c.minute / c.second)), {
262
- seconds: u,
263
- minutes: o,
250
+ function W(r) {
251
+ const t = (/* @__PURE__ */ new Date()).getTime(), e = Math.abs(r - t);
252
+ let o = 0, u = 0, n = 0, a = 0;
253
+ return e >= c.day && (a = Math.floor(e / c.day)), e >= c.hour && (n = Math.floor(e % c.day / c.hour)), e >= c.minute && (u = Math.floor(e % c.hour / c.minute)), e >= c.second && (o = Math.floor(e % c.minute / c.second)), {
254
+ seconds: o,
255
+ minutes: u,
264
256
  hours: n,
265
- days: e
257
+ days: a
266
258
  };
267
259
  }
268
- function I(r, a) {
269
- let t = 0;
270
- return a === "seconds" && (t = r - 1 >= 0 ? r - 1 : 59), a === "minutes" && (t = r - 1 >= 0 ? r - 1 : 59), a === "hours" && (t = r - 1 >= 0 ? r - 1 : 23), a === "days" && (t = r - 1 >= 0 ? r - 1 : 0), t;
260
+ function Cr(r, t) {
261
+ let e = 0;
262
+ return t === "seconds" && (e = r - 1 >= 0 ? r - 1 : 59), t === "minutes" && (e = r - 1 >= 0 ? r - 1 : 59), t === "hours" && (e = r - 1 >= 0 ? r - 1 : 23), t === "days" && (e = r - 1 >= 0 ? r - 1 : 0), e;
271
263
  }
272
264
  const c = {
273
265
  day: 1440 * 60 * 1e3,
274
266
  hour: 3600 * 1e3,
275
267
  minute: 60 * 1e3,
276
268
  second: 1e3
277
- }, R = H.bind(Nr), $ = "purpur-countdown-counter", V = /* @__PURE__ */ new Map(), x = ({ tag: r, size: a, end: t, counterLabels: u }) => {
278
- const o = U(null), n = `${r}-interval`, [e, i] = C(O(t)[r]), [l, h] = C(I(e, r)), [g, d] = C(0), b = X(() => {
279
- const _ = O(t), j = I(_[r], r);
280
- h(j), i(_[r]);
281
- }, [t, r]);
282
- z(() => (V.set(n, setInterval(b, c.second)), () => clearInterval(V.get(n))), [b, n]), z(() => {
283
- d((_) => _ + 1);
284
- }, [e]);
285
- const w = u[r];
286
- return /* @__PURE__ */ P(
269
+ }, C = V.bind(xr), m = "purpur-countdown-counter", E = /* @__PURE__ */ new Map(), q = ({ tag: r, size: t, end: e, counterLabels: o }) => {
270
+ const u = U(null), n = `${r}-interval`, [a, i] = S(0), [l, h] = S(0), [b, d] = S(0), g = X(() => {
271
+ const w = W(e), A = Cr(w[r], r);
272
+ h(A), i(w[r]);
273
+ }, [e, r]);
274
+ k(() => {
275
+ g();
276
+ }, []), k(() => (E.set(n, setInterval(g, c.second)), () => clearInterval(E.get(n))), [g, n]), k(() => {
277
+ d((w) => w + 1);
278
+ }, [a]);
279
+ const x = o[r], f = o[`${r}Abbr`];
280
+ return /* @__PURE__ */ O(
287
281
  "div",
288
282
  {
289
- className: R($),
283
+ className: C(m),
290
284
  role: "group",
291
285
  "aria-hidden": "true",
292
286
  "data-testid": `counter-${r}`,
293
287
  children: [
294
- /* @__PURE__ */ s(
288
+ /* @__PURE__ */ p(
295
289
  N,
296
290
  {
297
- className: R(`${$}__number`, `${$}--size-${a}`),
298
- ref: o,
291
+ className: C(`${m}__number`, `${m}__number--size-${t}`),
292
+ ref: u,
299
293
  "data-tick": l,
300
- children: e
294
+ children: a
301
295
  },
302
- g
296
+ b
303
297
  ),
304
- /* @__PURE__ */ s(N, { className: R(`${$}__label`), children: w })
298
+ f && /* @__PURE__ */ p(N, { className: C(`${m}__label`, `${m}__label--abbr`), children: /* @__PURE__ */ p("abbr", { title: x, children: f }) }),
299
+ /* @__PURE__ */ p(
300
+ N,
301
+ {
302
+ className: C(`${m}__label`, {
303
+ [`${m}__label--full`]: !!f
304
+ }),
305
+ children: x
306
+ }
307
+ )
305
308
  ]
306
309
  }
307
310
  );
308
- }, A = H.bind(xr), f = "purpur-countdown", W = /* @__PURE__ */ new Date(), jr = Y(
309
- ({ renderAfterEnd: r, renderBeforeStart: a, ...t }, u) => {
310
- const o = rr(), {
311
+ }, P = V.bind(Nr), _ = "purpur-countdown", D = /* @__PURE__ */ new Date(), qr = Y(
312
+ ({ renderAfterEnd: r, renderBeforeStart: t, ...e }, o) => {
313
+ const u = rr(), {
311
314
  size: n = "lg",
312
- fullWidth: e = !1,
315
+ fullWidth: a = !1,
313
316
  negative: i = !1,
314
317
  showDays: l = !0,
315
318
  variant: h = "primary",
316
- className: g,
317
- counterLabels: d
318
- } = t, b = new Date(t.starttime).getTime(), w = new Date(t.endtime).getTime(), _ = b > W.getTime(), j = w < W.getTime();
319
- if (_) return a ? a(t) : null;
320
- if (j) return r ? r(t) : null;
321
- const F = () => {
322
- const m = { size: n, end: w, counterLabels: d };
323
- return /* @__PURE__ */ P(Q, { children: [
324
- l && /* @__PURE__ */ s(x, { tag: "days", ...m }),
325
- /* @__PURE__ */ s(x, { tag: "hours", ...m }),
326
- /* @__PURE__ */ s(x, { tag: "minutes", ...m }),
327
- /* @__PURE__ */ s(x, { tag: "seconds", ...m })
319
+ className: b,
320
+ counterLabels: d,
321
+ useMediaQueries: g = !1
322
+ } = e, x = new Date(e.starttime).getTime(), f = new Date(e.endtime).getTime(), w = x > D.getTime(), A = f < D.getTime();
323
+ if (w) return t ? t(e) : null;
324
+ if (A) return r ? r(e) : null;
325
+ const H = () => {
326
+ const y = { size: n, end: f, counterLabels: d };
327
+ return /* @__PURE__ */ O(L, { children: [
328
+ l && /* @__PURE__ */ p(q, { tag: "days", ...y }),
329
+ /* @__PURE__ */ p(q, { tag: "hours", ...y }),
330
+ /* @__PURE__ */ p(q, { tag: "minutes", ...y }),
331
+ /* @__PURE__ */ p(q, { tag: "seconds", ...y })
328
332
  ] });
329
- }, q = () => {
330
- const m = () => {
331
- const { days: K, hours: L, minutes: Z, seconds: J } = O(w), y = [];
332
- return l && y.push(`${K} ${d.days}`), y.push(`${L} ${d.hours}`), y.push(`${Z} ${d.minutes}`), y.push(`${J} ${d.seconds}`), y.join(", ");
333
+ }, F = () => {
334
+ const y = () => {
335
+ const { days: K, hours: Q, minutes: Z, seconds: J } = W(f), v = [];
336
+ return l && v.push(`${K} ${d.days}`), v.push(`${Q} ${d.hours}`), v.push(`${Z} ${d.minutes}`), v.push(`${J} ${d.seconds}`), v.join(", ");
333
337
  };
334
- return /* @__PURE__ */ s(
338
+ return /* @__PURE__ */ p(
335
339
  yr,
336
340
  {
337
341
  "data-testid": "live-region",
338
342
  "aria-live": "polite",
339
- "aria-label": t["aria-label"],
340
- children: m()
343
+ "aria-label": e["aria-label"],
344
+ children: y()
341
345
  }
342
346
  );
343
- }, B = F(), G = A([
344
- f,
345
- `${f}--size-${n}`,
346
- `${f}--variant-${h}`,
347
+ }, B = H(), G = P(
348
+ _,
349
+ `${_}--size-${n}`,
350
+ `${_}--variant-${h}`,
347
351
  {
348
- [`${f}--fullwidth`]: e,
349
- [`${f}--negative`]: i,
350
- [`${f}--showdays`]: l
352
+ [`${_}--full-width`]: a,
353
+ [`${_}--negative`]: i,
354
+ [`${_}--show-days`]: l,
355
+ [`${_}--use-media-queries`]: g,
356
+ [`${_}--use-container-queries`]: !g
351
357
  },
352
- g
353
- ]);
354
- return /* @__PURE__ */ P(
358
+ b
359
+ );
360
+ return /* @__PURE__ */ O(
355
361
  "section",
356
362
  {
357
- id: o,
363
+ id: u,
358
364
  className: G,
359
- ref: u,
365
+ ref: o,
360
366
  role: "timer",
361
- "data-testid": t["data-testid"],
367
+ "data-testid": e["data-testid"],
362
368
  children: [
363
- q(),
364
- t.label && /* @__PURE__ */ s(N, { className: A(`${f}__label`), variant: "paragraph-100-medium", children: t.label }),
365
- /* @__PURE__ */ s("div", { className: A(`${f}__counter-container`), children: B })
369
+ F(),
370
+ e.label && /* @__PURE__ */ p(N, { className: P(`${_}__label`), variant: "paragraph-100-medium", children: e.label }),
371
+ /* @__PURE__ */ p("div", { className: P(`${_}__counter-container`), children: B })
366
372
  ]
367
373
  }
368
374
  );
369
375
  }
370
376
  );
371
- jr.displayName = "Countdown";
377
+ qr.displayName = "Countdown";
372
378
  export {
373
- jr as Countdown
379
+ qr as Countdown
374
380
  };
375
381
  //# sourceMappingURL=countdown.es.js.map