@apolitical/component-library 3.0.2-ac.0 → 3.0.2-ac.2

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/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import K, { memo as Oe, useState as X, useEffect as ae, useRef as pe, useMemo as bt, createContext as Zn, useContext as Ne, Children as An, useCallback as Jr, useReducer as Hn, Fragment as gt, Suspense as pi } from "react";
1
+ import K, { memo as Oe, useState as ee, useEffect as ae, useRef as pe, useMemo as bt, createContext as Zn, useContext as Ne, Children as An, useCallback as Jr, useReducer as Hn, Fragment as gt, Suspense as pi } from "react";
2
2
  import ft from "lodash.clonedeep";
3
3
  import hi from "lodash.set";
4
4
  import { useIntl as G, IntlProvider as gi, FormattedMessage as _e, createIntl as vi } from "react-intl";
@@ -281,7 +281,7 @@ function $i() {
281
281
  }
282
282
  }
283
283
  var Y = v.ReactCurrentDispatcher, V;
284
- function ee(h, $, L) {
284
+ function X(h, $, L) {
285
285
  {
286
286
  if (V === void 0)
287
287
  try {
@@ -367,7 +367,7 @@ function $i() {
367
367
  } finally {
368
368
  re = !1, Y.current = me, te(), Error.prepareStackTrace = le;
369
369
  }
370
- var Ve = h ? h.displayName || h.name : "", gr = Ve ? ee(Ve) : "";
370
+ var Ve = h ? h.displayName || h.name : "", gr = Ve ? X(Ve) : "";
371
371
  return typeof h == "function" && M.set(h, gr), gr;
372
372
  }
373
373
  function ve(h, $, L) {
@@ -383,12 +383,12 @@ function $i() {
383
383
  if (typeof h == "function")
384
384
  return D(h, Pe(h));
385
385
  if (typeof h == "string")
386
- return ee(h);
386
+ return X(h);
387
387
  switch (h) {
388
388
  case l:
389
- return ee("Suspense");
389
+ return X("Suspense");
390
390
  case d:
391
- return ee("SuspenseList");
391
+ return X("SuspenseList");
392
392
  }
393
393
  if (typeof h == "object")
394
394
  switch (h.$$typeof) {
@@ -716,7 +716,7 @@ Check the top-level render call using <` + L + ">.");
716
716
  process.env.NODE_ENV === "production" ? In.exports = Pi() : In.exports = $i();
717
717
  var a = In.exports;
718
718
  const Ri = () => {
719
- const [t, e] = X(window.location.pathname), n = () => {
719
+ const [t, e] = ee(window.location.pathname), n = () => {
720
720
  const r = window.location.pathname;
721
721
  e(r);
722
722
  };
@@ -1593,42 +1593,29 @@ const vl = ({ image: t, className: e, testId: n }) => /* @__PURE__ */ a.jsx(
1593
1593
  }
1594
1594
  return n ? K.createElement(n, { children: e, className: r, ...c }) : e;
1595
1595
  };
1596
- const bl = ({ currentStep: t = 1, steps: e = 1 }) => {
1597
- const [n, r] = X([]);
1598
- return ae(() => {
1599
- const i = [];
1600
- for (let s = 1; s < e + 1; s++)
1601
- i.push(s);
1602
- r(i);
1603
- }, [e]), /* @__PURE__ */ a.jsx("div", { className: "navigation-dots-wrapper", children: /* @__PURE__ */ a.jsx("div", { className: "dots-wrapper", children: n.map((i) => /* @__PURE__ */ a.jsxs(
1604
- "div",
1605
- {
1606
- className: "dot-wrapper",
1607
- "aria-label": `Step ${t} of ${i}`,
1608
- children: [
1609
- /* @__PURE__ */ a.jsx(
1610
- "div",
1611
- {
1612
- className: S("dot", {
1613
- active: i === t,
1614
- completed: i < t
1615
- }),
1616
- "data-testid": "navigation-dot"
1617
- }
1618
- ),
1619
- /* @__PURE__ */ a.jsx(
1620
- "div",
1621
- {
1622
- className: S("line", {
1623
- active: i < t
1624
- })
1625
- }
1626
- )
1627
- ]
1628
- },
1629
- i
1630
- )) }) });
1631
- };
1596
+ const bl = ({ currentStep: t = 1, steps: e = 1 }) => /* @__PURE__ */ a.jsx(be, { children: /* @__PURE__ */ a.jsx("div", { className: "wrapper", children: /* @__PURE__ */ a.jsx("div", { className: "dots-wrapper", children: new Array(e).fill("").map((n, r) => {
1597
+ const i = r + 1;
1598
+ return /* @__PURE__ */ a.jsxs("div", { className: "dot-wrapper", children: [
1599
+ /* @__PURE__ */ a.jsx(
1600
+ "div",
1601
+ {
1602
+ className: S("dot", {
1603
+ active: i === t,
1604
+ completed: i < t
1605
+ }),
1606
+ "data-testid": "progress-dot"
1607
+ }
1608
+ ),
1609
+ /* @__PURE__ */ a.jsx(
1610
+ "div",
1611
+ {
1612
+ className: S("line", {
1613
+ active: i < t
1614
+ })
1615
+ }
1616
+ )
1617
+ ] }, r);
1618
+ }) }) }) });
1632
1619
  const yl = ({ elementId: t, offset: e = 20 }) => {
1633
1620
  const n = G(), r = () => {
1634
1621
  const i = document.getElementById(t);
@@ -1653,7 +1640,7 @@ const yl = ({ elementId: t, offset: e = 20 }) => {
1653
1640
  };
1654
1641
  let st = !1;
1655
1642
  const Gi = ({ isOpen: t = !1, isLoading: e = !1, children: n }) => {
1656
- const r = G(), i = pe(null), [s, o] = X("hidden");
1643
+ const r = G(), i = pe(null), [s, o] = ee("hidden");
1657
1644
  ae(() => {
1658
1645
  const f = i.current;
1659
1646
  if (f)
@@ -2031,7 +2018,7 @@ function Gn() {
2031
2018
  return Ne(De);
2032
2019
  }
2033
2020
  const ss = ({ children: t, user: e }) => /* @__PURE__ */ a.jsx(De.Provider, { value: e, children: t }), Sl = ({ bootstrap: t, children: e, intl: n, showDevTools: r }) => {
2034
- const [i, s] = X({ isLoading: !0 });
2021
+ const [i, s] = ee({ isLoading: !0 });
2035
2022
  return ae(() => {
2036
2023
  t().then((o) => {
2037
2024
  s({ ...o, isLoading: !1 }), Hi(5e3);
@@ -2131,7 +2118,7 @@ const Cl = ({
2131
2118
  text: r,
2132
2119
  children: i
2133
2120
  }) => {
2134
- const s = G(), o = pe(null), [c, f] = X(""), [l, d] = X("closed");
2121
+ const s = G(), o = pe(null), [c, f] = ee(""), [l, d] = ee("closed");
2135
2122
  ae(() => {
2136
2123
  const p = o.current;
2137
2124
  if (p)
@@ -2469,7 +2456,7 @@ const wr = 256, Ze = ({
2469
2456
  height: s = wr,
2470
2457
  ...o
2471
2458
  }) => {
2472
- const [c, f] = X(!1), l = pe(null);
2459
+ const [c, f] = ee(!1), l = pe(null);
2473
2460
  ae(() => {
2474
2461
  const u = l.current;
2475
2462
  if (!u)
@@ -2774,7 +2761,7 @@ function js() {
2774
2761
  function V(D) {
2775
2762
  return j(D) === p;
2776
2763
  }
2777
- function ee(D) {
2764
+ function X(D) {
2778
2765
  return j(D) === n;
2779
2766
  }
2780
2767
  function re(D) {
@@ -2786,7 +2773,7 @@ function js() {
2786
2773
  function oe(D) {
2787
2774
  return j(D) === u;
2788
2775
  }
2789
- ue.AsyncMode = w, ue.ConcurrentMode = U, ue.ContextConsumer = F, ue.ContextProvider = q, ue.Element = R, ue.ForwardRef = O, ue.Fragment = C, ue.Lazy = T, ue.Memo = x, ue.Portal = N, ue.Profiler = I, ue.StrictMode = W, ue.Suspense = A, ue.isAsyncMode = J, ue.isConcurrentMode = k, ue.isContextConsumer = P, ue.isContextProvider = z, ue.isElement = B, ue.isForwardRef = H, ue.isFragment = te, ue.isLazy = Y, ue.isMemo = V, ue.isPortal = ee, ue.isProfiler = re, ue.isStrictMode = M, ue.isSuspense = oe, ue.isValidElementType = E, ue.typeOf = j;
2776
+ ue.AsyncMode = w, ue.ConcurrentMode = U, ue.ContextConsumer = F, ue.ContextProvider = q, ue.Element = R, ue.ForwardRef = O, ue.Fragment = C, ue.Lazy = T, ue.Memo = x, ue.Portal = N, ue.Profiler = I, ue.StrictMode = W, ue.Suspense = A, ue.isAsyncMode = J, ue.isConcurrentMode = k, ue.isContextConsumer = P, ue.isContextProvider = z, ue.isElement = B, ue.isForwardRef = H, ue.isFragment = te, ue.isLazy = Y, ue.isMemo = V, ue.isPortal = X, ue.isProfiler = re, ue.isStrictMode = M, ue.isSuspense = oe, ue.isValidElementType = E, ue.typeOf = j;
2790
2777
  }()), ue;
2791
2778
  }
2792
2779
  var Er;
@@ -2963,31 +2950,31 @@ function Ss() {
2963
2950
  function _(k) {
2964
2951
  if (process.env.NODE_ENV !== "production")
2965
2952
  var P = {}, z = 0;
2966
- function B(te, Y, V, ee, re, M, oe) {
2967
- if (ee = ee || m, M = M || V, oe !== n) {
2953
+ function B(te, Y, V, X, re, M, oe) {
2954
+ if (X = X || m, M = M || V, oe !== n) {
2968
2955
  if (f) {
2969
2956
  var D = new Error(
2970
2957
  "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
2971
2958
  );
2972
2959
  throw D.name = "Invariant Violation", D;
2973
2960
  } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
2974
- var ve = ee + ":" + V;
2961
+ var ve = X + ":" + V;
2975
2962
  !P[ve] && // Avoid spamming the console because they are often not actionable except for lib authors
2976
2963
  z < 3 && (s(
2977
- "You are manually calling a React.PropTypes validation function for the `" + M + "` prop on `" + ee + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
2964
+ "You are manually calling a React.PropTypes validation function for the `" + M + "` prop on `" + X + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
2978
2965
  ), P[ve] = !0, z++);
2979
2966
  }
2980
2967
  }
2981
- return Y[V] == null ? te ? Y[V] === null ? new y("The " + re + " `" + M + "` is marked as required " + ("in `" + ee + "`, but its value is `null`.")) : new y("The " + re + " `" + M + "` is marked as required in " + ("`" + ee + "`, but its value is `undefined`.")) : null : k(Y, V, ee, re, M);
2968
+ return Y[V] == null ? te ? Y[V] === null ? new y("The " + re + " `" + M + "` is marked as required " + ("in `" + X + "`, but its value is `null`.")) : new y("The " + re + " `" + M + "` is marked as required in " + ("`" + X + "`, but its value is `undefined`.")) : null : k(Y, V, X, re, M);
2982
2969
  }
2983
2970
  var H = B.bind(null, !1);
2984
2971
  return H.isRequired = B.bind(null, !0), H;
2985
2972
  }
2986
2973
  function v(k) {
2987
2974
  function P(z, B, H, te, Y, V) {
2988
- var ee = z[B], re = W(ee);
2975
+ var X = z[B], re = W(X);
2989
2976
  if (re !== k) {
2990
- var M = A(ee);
2977
+ var M = A(X);
2991
2978
  return new y(
2992
2979
  "Invalid " + te + " `" + Y + "` of type " + ("`" + M + "` supplied to `" + H + "`, expected ") + ("`" + k + "`."),
2993
2980
  { expectedType: k }
@@ -3006,8 +2993,8 @@ function Ss() {
3006
2993
  return new y("Property `" + Y + "` of component `" + H + "` has invalid PropType notation inside arrayOf.");
3007
2994
  var V = z[B];
3008
2995
  if (!Array.isArray(V)) {
3009
- var ee = W(V);
3010
- return new y("Invalid " + te + " `" + Y + "` of type " + ("`" + ee + "` supplied to `" + H + "`, expected an array."));
2996
+ var X = W(V);
2997
+ return new y("Invalid " + te + " `" + Y + "` of type " + ("`" + X + "` supplied to `" + H + "`, expected an array."));
3011
2998
  }
3012
2999
  for (var re = 0; re < V.length; re++) {
3013
3000
  var M = k(V, re, H, te, Y + "[" + re + "]", n);
@@ -3043,8 +3030,8 @@ function Ss() {
3043
3030
  function U(k) {
3044
3031
  function P(z, B, H, te, Y) {
3045
3032
  if (!(z[B] instanceof k)) {
3046
- var V = k.name || m, ee = J(z[B]);
3047
- return new y("Invalid " + te + " `" + Y + "` of type " + ("`" + ee + "` supplied to `" + H + "`, expected ") + ("instance of `" + V + "`."));
3033
+ var V = k.name || m, X = J(z[B]);
3034
+ return new y("Invalid " + te + " `" + Y + "` of type " + ("`" + X + "` supplied to `" + H + "`, expected ") + ("instance of `" + V + "`."));
3048
3035
  }
3049
3036
  return null;
3050
3037
  }
@@ -3056,8 +3043,8 @@ function Ss() {
3056
3043
  "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
3057
3044
  ) : s("Invalid argument supplied to oneOf, expected an array.")), o;
3058
3045
  function P(z, B, H, te, Y) {
3059
- for (var V = z[B], ee = 0; ee < k.length; ee++)
3060
- if (g(V, k[ee]))
3046
+ for (var V = z[B], X = 0; X < k.length; X++)
3047
+ if (g(V, k[X]))
3061
3048
  return null;
3062
3049
  var re = JSON.stringify(k, function(oe, D) {
3063
3050
  var ve = A(D);
@@ -3071,9 +3058,9 @@ function Ss() {
3071
3058
  function P(z, B, H, te, Y) {
3072
3059
  if (typeof k != "function")
3073
3060
  return new y("Property `" + Y + "` of component `" + H + "` has invalid PropType notation inside objectOf.");
3074
- var V = z[B], ee = W(V);
3075
- if (ee !== "object")
3076
- return new y("Invalid " + te + " `" + Y + "` of type " + ("`" + ee + "` supplied to `" + H + "`, expected an object."));
3061
+ var V = z[B], X = W(V);
3062
+ if (X !== "object")
3063
+ return new y("Invalid " + te + " `" + Y + "` of type " + ("`" + X + "` supplied to `" + H + "`, expected an object."));
3077
3064
  for (var re in V)
3078
3065
  if (r(V, re)) {
3079
3066
  var M = k(V, re, H, te, Y + "." + re, n);
@@ -3094,15 +3081,15 @@ function Ss() {
3094
3081
  "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + Z(z) + " at index " + P + "."
3095
3082
  ), o;
3096
3083
  }
3097
- function B(H, te, Y, V, ee) {
3084
+ function B(H, te, Y, V, X) {
3098
3085
  for (var re = [], M = 0; M < k.length; M++) {
3099
- var oe = k[M], D = oe(H, te, Y, V, ee, n);
3086
+ var oe = k[M], D = oe(H, te, Y, V, X, n);
3100
3087
  if (D == null)
3101
3088
  return null;
3102
3089
  D.data && r(D.data, "expectedType") && re.push(D.data.expectedType);
3103
3090
  }
3104
3091
  var ve = re.length > 0 ? ", expected one of type [" + re.join(", ") + "]" : "";
3105
- return new y("Invalid " + V + " `" + ee + "` supplied to " + ("`" + Y + "`" + ve + "."));
3092
+ return new y("Invalid " + V + " `" + X + "` supplied to " + ("`" + Y + "`" + ve + "."));
3106
3093
  }
3107
3094
  return _(B);
3108
3095
  }
@@ -3119,9 +3106,9 @@ function Ss() {
3119
3106
  }
3120
3107
  function T(k) {
3121
3108
  function P(z, B, H, te, Y) {
3122
- var V = z[B], ee = W(V);
3123
- if (ee !== "object")
3124
- return new y("Invalid " + te + " `" + Y + "` of type `" + ee + "` " + ("supplied to `" + H + "`, expected `object`."));
3109
+ var V = z[B], X = W(V);
3110
+ if (X !== "object")
3111
+ return new y("Invalid " + te + " `" + Y + "` of type `" + X + "` " + ("supplied to `" + H + "`, expected `object`."));
3125
3112
  for (var re in k) {
3126
3113
  var M = k[re];
3127
3114
  if (typeof M != "function")
@@ -3136,9 +3123,9 @@ function Ss() {
3136
3123
  }
3137
3124
  function x(k) {
3138
3125
  function P(z, B, H, te, Y) {
3139
- var V = z[B], ee = W(V);
3140
- if (ee !== "object")
3141
- return new y("Invalid " + te + " `" + Y + "` of type `" + ee + "` " + ("supplied to `" + H + "`, expected `object`."));
3126
+ var V = z[B], X = W(V);
3127
+ if (X !== "object")
3128
+ return new y("Invalid " + te + " `" + Y + "` of type `" + X + "` " + ("supplied to `" + H + "`, expected `object`."));
3142
3129
  var re = e({}, z[B], k);
3143
3130
  for (var M in re) {
3144
3131
  var oe = k[M];
@@ -4279,7 +4266,7 @@ const en = ({
4279
4266
  className: d = "",
4280
4267
  gtmContext: u = "Modal"
4281
4268
  }) => {
4282
- const m = G(), [p, g] = X(e), y = (b) => {
4269
+ const m = G(), [p, g] = ee(e), y = (b) => {
4283
4270
  b.key === "Escape" && _(!1);
4284
4271
  };
4285
4272
  ae(() => (window.addEventListener("keyup", y), () => {
@@ -4339,13 +4326,13 @@ const Ct = "emailHelperTextBox_", wo = ({
4339
4326
  redirectPath: n,
4340
4327
  resendVerificationCode: r
4341
4328
  }) => {
4342
- const i = G(), [s, o] = X({
4329
+ const i = G(), [s, o] = ee({
4343
4330
  path: `${Ct}default`,
4344
4331
  type: "default",
4345
4332
  link: {},
4346
4333
  mail: {},
4347
4334
  error: ""
4348
- }), [c, f] = X(!1), l = Jr(
4335
+ }), [c, f] = ee(!1), l = Jr(
4349
4336
  (p) => {
4350
4337
  p.preventDefault(), p.stopPropagation();
4351
4338
  const g = (y) => {
@@ -4520,11 +4507,11 @@ const Ye = {
4520
4507
  }) => {
4521
4508
  const { onChange: r = () => {
4522
4509
  }, onKeyInput: i = async () => {
4523
- } } = n, [{ input: s, displayInput: o, debouncedInput: c }, f] = X({
4510
+ } } = n, [{ input: s, displayInput: o, debouncedInput: c }, f] = ee({
4524
4511
  input: t,
4525
4512
  displayInput: t,
4526
4513
  debouncedInput: t
4527
- }), [{ predictions: l, activePredictionIndex: d, isPredictionSelected: u }, m] = X({
4514
+ }), [{ predictions: l, activePredictionIndex: d, isPredictionSelected: u }, m] = ee({
4528
4515
  predictions: [],
4529
4516
  activePredictionIndex: -1,
4530
4517
  isPredictionSelected: !!t
@@ -4655,7 +4642,7 @@ const Eo = ({
4655
4642
  multiSelectOptions: f,
4656
4643
  id: l
4657
4644
  }) => {
4658
- const d = G(), [u, m] = X(!1), p = r || n, g = Array.isArray(p) ? [...p] : p ? [p] : [], [y, _] = X(g);
4645
+ const d = G(), [u, m] = ee(!1), p = r || n, g = Array.isArray(p) ? [...p] : p ? [p] : [], [y, _] = ee(g);
4659
4646
  let v;
4660
4647
  Array.isArray(y) && y.length === 1 && typeof y[0] == "string" ? v = e && y ? e.find((F) => F.id === y[0]) : e ? e[0] : { id: "", label: "" } : Array.isArray(y) && y.length === 1 && typeof y[0] != "string" ? v = y[0] : v = { id: "", label: "" }, ae(() => {
4661
4648
  _(g);
@@ -4857,7 +4844,7 @@ const Co = ({
4857
4844
  gtm: { context: n } = { context: void 0 },
4858
4845
  ...r
4859
4846
  }) => {
4860
- const i = G(), s = pe(), o = t || s, [c, f] = X(!1), [l, d] = X(e), u = () => {
4847
+ const i = G(), s = pe(), o = t || s, [c, f] = ee(!1), [l, d] = ee(e), u = () => {
4861
4848
  var m;
4862
4849
  f(!c), d(c ? "password" : "text"), (m = o.current) == null || m.focus();
4863
4850
  };
@@ -5347,7 +5334,7 @@ const $l = ({
5347
5334
  className: s = "",
5348
5335
  hasLoaded: o = !1
5349
5336
  }) => {
5350
- const c = G(), [f, l] = X({
5337
+ const c = G(), [f, l] = ee({
5351
5338
  setUp: !1,
5352
5339
  id: null,
5353
5340
  rating: null,
@@ -5429,7 +5416,7 @@ const Rl = ({
5429
5416
  isDisabled: s = !1,
5430
5417
  className: o = ""
5431
5418
  }) => {
5432
- const [c, f] = X(
5419
+ const [c, f] = ee(
5433
5420
  typeof r == "boolean" || typeof r == "string" ? r : n[0].value
5434
5421
  );
5435
5422
  ae(() => {
@@ -5479,7 +5466,7 @@ const Rl = ({
5479
5466
  );
5480
5467
  };
5481
5468
  function Ml({ className: t = "", userId: e, userName: n, src: r, setUserImage: i, uploadImage: s }) {
5482
- const [o, c] = X(!1), [f, l] = X(!1), d = pe(null), u = async (m) => {
5469
+ const [o, c] = ee(!1), [f, l] = ee(!1), d = pe(null), u = async (m) => {
5483
5470
  c(!0), l(!1);
5484
5471
  try {
5485
5472
  const p = m.target.files && m.target.files[0];
@@ -5590,7 +5577,7 @@ const Oo = ({
5590
5577
  initialFormStatus: l = "NOT_SUBMITTED"
5591
5578
  /* NOT_SUBMITTED */
5592
5579
  }) => {
5593
- const [d, u] = X([]), [m, p] = X(!0), [g, y] = X(l), { formatMessage: _ } = G(), v = async (j) => {
5580
+ const [d, u] = ee([]), [m, p] = ee(!0), [g, y] = ee(l), { formatMessage: _ } = G(), v = async (j) => {
5594
5581
  j.preventDefault();
5595
5582
  try {
5596
5583
  await f(d), u([]), y(
@@ -5675,7 +5662,7 @@ const Oo = ({
5675
5662
  CONFIRMED_PASSWORD: "confirmedPassword",
5676
5663
  CURRENT_PASSWORD: "oldPassword"
5677
5664
  }, Fl = ({ functions: t, ...e }) => {
5678
- const { formatMessage: n } = G(), [r, i] = X(null), [s, o] = X(!1), [c, f] = X({
5665
+ const { formatMessage: n } = G(), [r, i] = ee(null), [s, o] = ee(!1), [c, f] = ee({
5679
5666
  isMoreThanEightCharacters: !1,
5680
5667
  includesNumberAndSymbol: !1,
5681
5668
  includesLowerAndUppercase: !1
@@ -5685,7 +5672,7 @@ const Oo = ({
5685
5672
  id: Te.NEW_PASSWORD,
5686
5673
  type: "password",
5687
5674
  autoComplete: "password",
5688
- placeholder: "•••••••••",
5675
+ placeholder: "",
5689
5676
  label: n({ id: "passwordRules_newPassword_label" }),
5690
5677
  validation: xn(["required", d]),
5691
5678
  functions: {
@@ -5699,7 +5686,7 @@ const Oo = ({
5699
5686
  id: Te.CONFIRMED_PASSWORD,
5700
5687
  type: "password",
5701
5688
  autoComplete: "password",
5702
- placeholder: "•••••••••",
5689
+ placeholder: "",
5703
5690
  label: n({ id: "passwordRules_confirmPassword_label" }),
5704
5691
  validation: xn(["required", l])
5705
5692
  }
@@ -5708,7 +5695,7 @@ const Oo = ({
5708
5695
  "data-testid": Te.CURRENT_PASSWORD,
5709
5696
  id: Te.CURRENT_PASSWORD,
5710
5697
  type: "password",
5711
- placeholder: "•••••••••",
5698
+ placeholder: "",
5712
5699
  label: n({ id: "passwordRules_currentPassword_label" }),
5713
5700
  validation: xn(["required"])
5714
5701
  }), s && u.push({
@@ -5720,6 +5707,7 @@ const Oo = ({
5720
5707
  fields: u,
5721
5708
  functions: {
5722
5709
  ...t,
5710
+ onSuccess: async (p) => (t.createPassword(p), t.onSuccess && t.onSuccess(p)),
5723
5711
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5724
5712
  onCatch: (p) => i(p == null ? void 0 : p.statusCode),
5725
5713
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -6241,7 +6229,7 @@ const Dl = ({
6241
6229
  }
6242
6230
  );
6243
6231
  const Al = ({ members: t }) => {
6244
- const [e, n] = X(!1), r = (i) => {
6232
+ const [e, n] = ee(!1), r = (i) => {
6245
6233
  const { fullName: s, jobTitle: o, organisation: c, photo: f } = i || {};
6246
6234
  return /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
6247
6235
  /* @__PURE__ */ a.jsx(Ze, { name: s, src: f }),
@@ -6397,7 +6385,7 @@ const Al = ({ members: t }) => {
6397
6385
  }
6398
6386
  }, Uo = ({ data: t, cta: e, link: n, gtmContext: r }) => {
6399
6387
  var g;
6400
- const i = G(), [s, o] = X({
6388
+ const i = G(), [s, o] = ee({
6401
6389
  loading: !1,
6402
6390
  registered: t.registered || !1
6403
6391
  });
@@ -6484,7 +6472,7 @@ const Zo = {
6484
6472
  gtmContext: i = "Carousel",
6485
6473
  className: s = ""
6486
6474
  }) => {
6487
- const o = G(), c = Ne(De), f = c && typeof c.id == "string", [l, d] = X({
6475
+ const o = G(), c = Ne(De), f = c && typeof c.id == "string", [l, d] = ee({
6488
6476
  data: null,
6489
6477
  isLoading: !0
6490
6478
  }), { data: u, isLoading: m } = l, p = Jr(() => {
@@ -6638,10 +6626,10 @@ const Ko = ({
6638
6626
  className: s,
6639
6627
  gtmContext: o
6640
6628
  }) => {
6641
- const c = G(), [f, l] = X({
6629
+ const c = G(), [f, l] = ee({
6642
6630
  cardsPerPage: 4,
6643
6631
  isLoading: !0
6644
- }), { cardsPerPage: d, isLoading: u } = f, [m, p] = X({
6632
+ }), { cardsPerPage: d, isLoading: u } = f, [m, p] = ee({
6645
6633
  currentPage: 0,
6646
6634
  loadedPages: [0]
6647
6635
  }), { currentPage: g, loadedPages: y } = m, _ = e.length, v = Math.ceil(_ / d), b = pe(null), E = yt(!0, !0, b == null ? void 0 : b.current);
@@ -6818,7 +6806,7 @@ const kn = "joinCommunityButton", Da = ({
6818
6806
  }, leave: () => {
6819
6807
  } }
6820
6808
  }) => {
6821
- const i = G(), s = Ne(De), o = s && typeof s.id == "string", [c, f] = X(t), [l, d] = X(t ? "joined" : "notJoined");
6809
+ const i = G(), s = Ne(De), o = s && typeof s.id == "string", [c, f] = ee(t), [l, d] = ee(t ? "joined" : "notJoined");
6822
6810
  ae(() => {
6823
6811
  l === "joining" ? d("joined") : l === "leaving" && d("notJoined");
6824
6812
  }, [c]);
@@ -6929,7 +6917,7 @@ const ql = ({
6929
6917
  text: typeof e != "boolean" && e.text || s.formatMessage({ id: "filters_all" })
6930
6918
  },
6931
6919
  ...t
6932
- ] : t, [c, f] = X(e ? ["all"] : []), l = (d, u) => {
6920
+ ] : t, [c, f] = ee(e ? ["all"] : []), l = (d, u) => {
6933
6921
  let m = [];
6934
6922
  c.includes(d) ? m = c.filter((p) => p !== d) : d === "all" ? m = ["all"] : n ? m = [...c.filter((p) => p !== "all"), d] : m = [d], f((p) => (r && typeof r == "function" && r({ current: m, previous: p }), m)), u && typeof u == "function" && u();
6935
6923
  };
@@ -6977,7 +6965,7 @@ const Tn = {
6977
6965
  label: c,
6978
6966
  className: f = ""
6979
6967
  }) => {
6980
- const l = G(), [d, u] = X(t);
6968
+ const l = G(), [d, u] = ee(t);
6981
6969
  if (ae(() => {
6982
6970
  t !== d && u(t);
6983
6971
  }, [t]), !r || !Object.values(r).some(
@@ -7040,7 +7028,7 @@ const En = vi({ locale: "en", messages: Kn }), nn = ({
7040
7028
  className: c = "",
7041
7029
  gtmContext: f = "LoadMore"
7042
7030
  }) => {
7043
- const [l, d] = X(""), u = async (m) => {
7031
+ const [l, d] = ee(""), u = async (m) => {
7044
7032
  try {
7045
7033
  await e(m);
7046
7034
  } catch (p) {
@@ -7086,7 +7074,7 @@ const Qo = ({
7086
7074
  }) => {
7087
7075
  const i = G(), s = pe(
7088
7076
  null
7089
- ), [o, c] = X(!1), f = (l) => {
7077
+ ), [o, c] = ee(!1), f = (l) => {
7090
7078
  s.current && l.target instanceof HTMLElement && !s.current.contains(l.target) && c(!1);
7091
7079
  };
7092
7080
  return ae(() => (document.addEventListener("click", f, !0), () => {
@@ -7287,7 +7275,7 @@ const zl = ({ tabs: t, className: e = "", preventLocationChange: n }) => {
7287
7275
  }
7288
7276
  }
7289
7277
  }
7290
- const [s, o] = X(
7278
+ const [s, o] = ee(
7291
7279
  (l = t[i]) != null && l.id ? t[i].id : r(t[i].id, t[i].text, i)
7292
7280
  );
7293
7281
  ae(() => {
@@ -7397,7 +7385,7 @@ const Nn = "cookieBanner_", Pn = [
7397
7385
  "apolitical-performance-cookie-consent",
7398
7386
  "functional-cookie-consent"
7399
7387
  ], $n = new Date(Date.now() + 12 * 30 * 24 * 60 * 60 * 1e3), ic = () => {
7400
- const t = G(), [e, n, r] = ea(Pn), [i, s] = X(
7388
+ const t = G(), [e, n, r] = ea(Pn), [i, s] = ee(
7401
7389
  !e["apol-cookie-banner"]
7402
7390
  ), o = () => {
7403
7391
  Pn.forEach((d) => {
@@ -8300,9 +8288,9 @@ const we = "discussion_form_", er = ({
8300
8288
  gtmContext: l = "DiscussionForm"
8301
8289
  }) => {
8302
8290
  var O, C, T;
8303
- const d = G(), u = Ne(De), [m, p] = X(
8291
+ const d = G(), u = Ne(De), [m, p] = ee(
8304
8292
  n.isEditing && n.isEditing.text || ""
8305
- ), [g, y] = X(c.error || !1), [_, v] = X(!1), b = pe(null);
8293
+ ), [g, y] = ee(c.error || !1), [_, v] = ee(!1), b = pe(null);
8306
8294
  if (r || (r = b), n.isLoading)
8307
8295
  return /* @__PURE__ */ a.jsx(
8308
8296
  Ee,
@@ -8517,7 +8505,7 @@ const we = "discussion_form_", er = ({
8517
8505
  }, dc = {
8518
8506
  showForm: !1
8519
8507
  }, tr = Zn(dc), uc = ({ children: t }) => {
8520
- const [e, n] = X({
8508
+ const [e, n] = ee({
8521
8509
  showForm: !1
8522
8510
  });
8523
8511
  return /* @__PURE__ */ a.jsx(tr.Provider, { value: { ...e, updateConversation: n }, children: t });
@@ -8549,7 +8537,7 @@ const Mn = () => {
8549
8537
  ae(() => {
8550
8538
  p(i);
8551
8539
  }, [i]);
8552
- const [d, u] = X(e), [m, p] = X(i), [g, y] = X(!1), [_, v] = X(!1), b = bt(
8540
+ const [d, u] = ee(e), [m, p] = ee(i), [g, y] = ee(!1), [_, v] = ee(!1), b = bt(
8553
8541
  () => mc(n, Fn),
8554
8542
  [n]
8555
8543
  ), E = (w) => {
@@ -8686,14 +8674,14 @@ const Re = "discussion_", hc = 280, an = ({
8686
8674
  children: y,
8687
8675
  isTruncated: _ = !1
8688
8676
  }) => {
8689
- const v = G(), b = Ne(De), E = Ne(tr), { author: j, canLike: w, createdAt: U, id: F, likes: q = 0, userLiked: R, comments: O = 0 } = e, C = b && b.id && typeof j != "string" && j.id && j.id === b.id || !1, T = typeof w == "boolean" ? w : n ? !C : !1, x = C && (!e.createdAt || Li(e.createdAt, 10, "seconds")), N = pe(null), [I, W] = X({
8677
+ const v = G(), b = Ne(De), E = Ne(tr), { author: j, canLike: w, createdAt: U, id: F, likes: q = 0, userLiked: R, comments: O = 0 } = e, C = b && b.id && typeof j != "string" && j.id && j.id === b.id || !1, T = typeof w == "boolean" ? w : n ? !C : !1, x = C && (!e.createdAt || Li(e.createdAt, 10, "seconds")), N = pe(null), [I, W] = ee({
8690
8678
  body: e && e.body || "",
8691
8679
  isEditing: !1,
8692
8680
  didEdit: e && e.isEdited || !1
8693
- }), [A, Z] = X(!1), [J, k] = X(
8681
+ }), [A, Z] = ee(!1), [J, k] = ee(
8694
8682
  x ? "highlighted" : "default"
8695
8683
  /* Default */
8696
- ), [P, z] = X("");
8684
+ ), [P, z] = ee("");
8697
8685
  ae(() => {
8698
8686
  const M = N.current;
8699
8687
  if (!(!M || J === "default"))
@@ -8736,7 +8724,7 @@ const Re = "discussion_", hc = 280, an = ({
8736
8724
  const oe = `reply-form-${(e.type === "answer" ? e.slug : ((Pe = e.slugs) == null ? void 0 : Pe.reply) || ((Se = e.slugs) == null ? void 0 : Se.answer) || ((Be = e.slugs) == null ? void 0 : Be.question) || "").toLowerCase().slice(-15)}`, D = document.getElementById(oe), ve = document.getElementById(`${oe}-input`);
8737
8725
  ve && ve.focus(), D && D.scrollIntoView({ behavior: "smooth" });
8738
8726
  }, 0);
8739
- }, ee = async () => {
8727
+ }, X = async () => {
8740
8728
  Z(!1);
8741
8729
  try {
8742
8730
  await c(zr(e.slugs));
@@ -8974,7 +8962,7 @@ const Re = "discussion_", hc = 280, an = ({
8974
8962
  {
8975
8963
  variant: "primary",
8976
8964
  className: "destructive",
8977
- onClick: ee,
8965
+ onClick: X,
8978
8966
  children: v.formatMessage({ id: "discussion_delete_delete" })
8979
8967
  }
8980
8968
  ],
@@ -10467,12 +10455,12 @@ const Yc = ({
10467
10455
  latest_children: E,
10468
10456
  children_counts: j
10469
10457
  } = _, U = (((I = b == null ? void 0 : b.like) == null ? void 0 : I.length) || 0) > 0 ? (W = b == null ? void 0 : b.like) == null ? void 0 : W.find((V) => {
10470
- var ee;
10471
- return ((ee = V == null ? void 0 : V.user) == null ? void 0 : ee.id) === (y == null ? void 0 : y.id);
10458
+ var X;
10459
+ return ((X = V == null ? void 0 : V.user) == null ? void 0 : X.id) === (y == null ? void 0 : y.id);
10472
10460
  }) : !1, F = U ? U == null ? void 0 : U.id : "", q = !!U, O = (((A = E == null ? void 0 : E.like) == null ? void 0 : A.length) || 0) > 0 ? (Z = E == null ? void 0 : E.like) == null ? void 0 : Z.map((V) => {
10473
- var ee, re, M;
10461
+ var X, re, M;
10474
10462
  return {
10475
- id: (ee = V == null ? void 0 : V.user) == null ? void 0 : ee.id,
10463
+ id: (X = V == null ? void 0 : V.user) == null ? void 0 : X.id,
10476
10464
  name: (M = (re = V == null ? void 0 : V.user) == null ? void 0 : re.data) == null ? void 0 : M.name
10477
10465
  };
10478
10466
  }) : !1, C = _ == null ? void 0 : _.user, T = (C == null ? void 0 : C.id) === (y == null ? void 0 : y.id), x = rn(i, T), N = typeof _.data.content == "string" ? (J = _ == null ? void 0 : _.data) == null ? void 0 : J.content : (
@@ -10515,7 +10503,7 @@ const Yc = ({
10515
10503
  createContent: () => null,
10516
10504
  deleteContent: () => p({ replyId: v }),
10517
10505
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
10518
- updateContent: (V, { body: ee }) => u({ replyId: v, content: ee })
10506
+ updateContent: (V, { body: X }) => u({ replyId: v, content: X })
10519
10507
  },
10520
10508
  likes: {
10521
10509
  createLike: () => m({ replyId: v }),
@@ -10572,7 +10560,7 @@ const Yc = ({
10572
10560
  }
10573
10561
  ),
10574
10562
  f == null ? void 0 : f.map((E) => {
10575
- var Z, J, k, P, z, B, H, te, Y, V, ee, re;
10563
+ var Z, J, k, P, z, B, H, te, Y, V, X, re;
10576
10564
  const { id: j, own_children: w, latest_children: U, children_counts: F } = E, R = (((Z = w == null ? void 0 : w.like) == null ? void 0 : Z.length) || 0) > 0 ? (J = w == null ? void 0 : w.like) == null ? void 0 : J.find((M) => {
10577
10565
  var oe;
10578
10566
  return ((oe = M == null ? void 0 : M.user) == null ? void 0 : oe.id) === (b == null ? void 0 : b.id);
@@ -10606,7 +10594,7 @@ const Yc = ({
10606
10594
  name: (te = N.data) == null ? void 0 : te.name,
10607
10595
  organization: (Y = N.data) == null ? void 0 : Y.organization,
10608
10596
  jobTitle: (V = N.data) == null ? void 0 : V.jobTitle,
10609
- location: (ee = N.data) == null ? void 0 : ee.location,
10597
+ location: (X = N.data) == null ? void 0 : X.location,
10610
10598
  image: {
10611
10599
  thumbnail: ((re = N.data) == null ? void 0 : re.thumbnail) || void 0
10612
10600
  }
@@ -11010,7 +10998,6 @@ export {
11010
10998
  Pa as Modal,
11011
10999
  Qo as MoreMenu,
11012
11000
  gl as NUMBER_OF_USERS,
11013
- bl as NavigationDots,
11014
11001
  ec as NavigationMenu,
11015
11002
  Xl as NotFoundError,
11016
11003
  en as Overlay,
@@ -11022,6 +11009,7 @@ export {
11022
11009
  Ml as ProfileImageChange,
11023
11010
  Ze as ProfilePicture,
11024
11011
  ys as ProgressBar,
11012
+ bl as ProgressTracker,
11025
11013
  $l as Rating,
11026
11014
  Kc as RepliesFeed,
11027
11015
  gc as ResponsesHeading,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/component-library",
3
- "version": "3.0.2-ac.0",
3
+ "version": "3.0.2-ac.2",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {