@apolitical/component-library 1.13.5 → 1.13.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.
package/index.mjs CHANGED
@@ -2029,22 +2029,51 @@ const xt = "joinCommunityButton", Tn = ({ isMember: e = !1, isShort: t = !1, fun
2029
2029
  }
2030
2030
  );
2031
2031
  };
2032
- const bt = "communityDetails_", wo = ({ isMember: e = !1, slug: t, members: { number: n, data: r } = { number: void 0, data: [] }, className: i = "", ...c }) => {
2033
- const d = A(), o = n || (r == null ? void 0 : r.length) || 0;
2034
- return /* @__PURE__ */ s.jsxs("div", { className: S("community-details", i), children: [
2032
+ const bt = "communityDetails_", wo = ({
2033
+ className: e = "",
2034
+ isMember: t = !1,
2035
+ slug: n,
2036
+ members: { number: r = 0, data: i = [] } = { number: 0, data: [] },
2037
+ functions: { invite: c, ...d }
2038
+ }) => {
2039
+ const o = A(), a = 5, u = r || i.length, l = i.length ? i : Array(a).fill({});
2040
+ return /* @__PURE__ */ s.jsxs("div", { className: S("community-details", e), children: [
2035
2041
  /* @__PURE__ */ s.jsx(De, {}),
2036
2042
  /* @__PURE__ */ s.jsxs("div", { className: "member-details", children: [
2037
2043
  /* @__PURE__ */ s.jsxs("div", { className: "top", children: [
2038
2044
  /* @__PURE__ */ s.jsxs("h3", { children: [
2039
- d.formatMessage({ id: `${bt}members` }),
2040
- /* @__PURE__ */ s.jsx("span", { className: "count", children: o })
2045
+ o.formatMessage({ id: `${bt}members` }),
2046
+ /* @__PURE__ */ s.jsx("span", { className: "count", children: u })
2041
2047
  ] }),
2042
- /* @__PURE__ */ s.jsx("p", { className: "text-small", children: /* @__PURE__ */ s.jsx("a", { href: `/communities/${t}/members`, children: d.formatMessage({ id: `${bt}viewAll` }) }) })
2048
+ /* @__PURE__ */ s.jsx("p", { className: "text-small", children: /* @__PURE__ */ s.jsx("a", { href: `/communities/${n}/members`, children: o.formatMessage({ id: `${bt}viewAll` }) }) })
2043
2049
  ] }),
2044
- /* @__PURE__ */ s.jsx(ar, { contributors: { total: n, data: r != null && r.length ? r : [{}, {}, {}, {}, {}] }, styling: { size: "medium", showGap: !0, showPlaceholders: o === 0 }, cutoff: 5 })
2050
+ /* @__PURE__ */ s.jsx(
2051
+ ar,
2052
+ {
2053
+ contributors: {
2054
+ total: r,
2055
+ data: l
2056
+ },
2057
+ styling: {
2058
+ size: "medium",
2059
+ showGap: !0,
2060
+ showPlaceholders: u === 0
2061
+ },
2062
+ cutoff: a
2063
+ }
2064
+ )
2045
2065
  ] }),
2046
- /* @__PURE__ */ s.jsx(Tn, { isMember: e, ...c }),
2047
- e && /* @__PURE__ */ s.jsx(J, { variant: "primary", icon: { icon: "plus" }, styling: { fullWidth: !0 }, children: d.formatMessage({ id: `${bt}invite` }) })
2066
+ /* @__PURE__ */ s.jsx(Tn, { isMember: t, functions: { ...d } }),
2067
+ t && /* @__PURE__ */ s.jsx(
2068
+ J,
2069
+ {
2070
+ variant: "primary",
2071
+ onClick: c,
2072
+ icon: { icon: "plus" },
2073
+ styling: { fullWidth: !0 },
2074
+ children: o.formatMessage({ id: `${bt}invite` })
2075
+ }
2076
+ )
2048
2077
  ] });
2049
2078
  };
2050
2079
  const ko = ({
@@ -3203,7 +3232,7 @@ const jr = () => {
3203
3232
  const e = A();
3204
3233
  return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3205
3234
  /* @__PURE__ */ s.jsx(An, {}),
3206
- /* @__PURE__ */ s.jsx("div", { className: "content", children: /* @__PURE__ */ s.jsx(it, { variant: "error", text: e.formatMessage({ id: "pageLayout_error" }) }) }),
3235
+ /* @__PURE__ */ s.jsx("div", { id: "content", children: /* @__PURE__ */ s.jsx(it, { variant: "error", text: e.formatMessage({ id: "pageLayout_error" }) }) }),
3207
3236
  /* @__PURE__ */ s.jsx(Mn, {})
3208
3237
  ] });
3209
3238
  }, Mo = ({ children: e, reportError: t, showFooter: n = !0, background: r = "default", className: i = "", locale: c = "en" }) => {
@@ -3214,7 +3243,7 @@ const jr = () => {
3214
3243
  const o = vn(e, { locale: c });
3215
3244
  return /* @__PURE__ */ s.jsx(gs, { onError: t, fallback: /* @__PURE__ */ s.jsx(jr, {}), children: /* @__PURE__ */ s.jsx(os, { fallback: /* @__PURE__ */ s.jsx(sr, { layout: "overview-page" }), children: /* @__PURE__ */ s.jsx("div", { id: "wrapper", className: S(i, { [r]: r !== "default" }), children: /* @__PURE__ */ s.jsxs(hs, { children: [
3216
3245
  /* @__PURE__ */ s.jsx(An, {}),
3217
- /* @__PURE__ */ s.jsx("div", { className: "content", children: o }),
3246
+ /* @__PURE__ */ s.jsx("div", { id: "content", children: o }),
3218
3247
  n && /* @__PURE__ */ s.jsx(Mn, {}),
3219
3248
  /* @__PURE__ */ s.jsx(_r, {})
3220
3249
  ] }) }) }) });
@@ -3725,8 +3754,8 @@ const No = ({
3725
3754
  showModal: t = !0,
3726
3755
  title: n,
3727
3756
  formTitle: r = "Know someone who might like to join this workshop?",
3728
- formLabel: i = "Send an invitation to your colleagues below",
3729
- ctaMessage: c = "Send invites",
3757
+ formLabel: i = "Invite your colleagues by typing or pasting their emails below.",
3758
+ ctaMessage: c = "Send",
3730
3759
  showIcon: d,
3731
3760
  onClose: o,
3732
3761
  reportError: a = () => {
@@ -3739,6 +3768,7 @@ const No = ({
3739
3768
  isOpen: t,
3740
3769
  showDivider: !1,
3741
3770
  showIcon: d,
3771
+ functions: { onClose: o },
3742
3772
  className: S("invite-modal", e, { success: !!n }),
3743
3773
  children: /* @__PURE__ */ s.jsx(
3744
3774
  wr,
@@ -4212,7 +4242,7 @@ const Ar = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
4212
4242
  }, onSuccess: (o) => {
4213
4243
  const a = e.getQueryData(t), u = a == null ? void 0 : a.map((l) => {
4214
4244
  var f, h;
4215
- return (l == null ? void 0 : l.id) === (o == null ? void 0 : o.activity_id) && ((f = l.own_reactions) != null && f.like ? l.own_reactions.like.push(o) : l.own_reactions.like = [o], (h = l.latest_reactions) != null && h.like ? l.latest_reactions.like.push(o) : l.latest_reactions.like = [o]), l;
4245
+ return (l == null ? void 0 : l.id) === (o == null ? void 0 : o.activity_id) && ((f = l.own_reactions) != null && f.like ? l.own_reactions.like.push(o) : l.own_reactions.like = [o], (h = l.latest_reactions) != null && h.like ? l.latest_reactions.like.push(o) : l.own_reactions.like = [o]), l;
4216
4246
  });
4217
4247
  return e.setQueryData(t, () => u && [...u]), { previousActivities: a };
4218
4248
  }, onSettled: (o, a, u) => {
@@ -4845,7 +4875,7 @@ const Ar = ({ count: e = 0, showRepliesButton: t = !0, children: n }) => {
4845
4875
  e.setQueryData(t, u.previousActivity);
4846
4876
  }, onSuccess: (o) => {
4847
4877
  const a = e.getQueryData(t);
4848
- return a != null && a.own_reactions.like ? a.own_reactions.like.push(o) : a && (a.own_reactions = { like: [o] }), a != null && a.latest_reactions.like ? a.latest_reactions.like.push(o) : a && (a.latest_reactions = { like: [o] }), e.setQueryData(t, () => ({
4878
+ return a != null && a.own_reactions.like ? a.own_reactions.like.push(o) : a && (a.own_reactions = { like: [o] }), a != null && a.latest_reactions.like ? a.latest_reactions.like.push(o) : a && (a.own_reactions = { like: [o] }), e.setQueryData(t, () => ({
4849
4879
  ...a
4850
4880
  })), { previousActivity: a };
4851
4881
  }, onSettled: () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/component-library",
3
- "version": "1.13.5",
3
+ "version": "1.13.6",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "exports": {