@logora/debate 0.4.34 → 0.4.36

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.
@@ -3,46 +3,47 @@ import N from "classnames";
3
3
  import "react";
4
4
  import { useIntl as B, FormattedMessage as w } from "react-intl";
5
5
  import a from "./AuthorBox.module.scss.js";
6
- import { useRoutes as L } from "../../data/config_provider/useRoutes.js";
6
+ import { useRoutes as _ } from "../../data/config_provider/useRoutes.js";
7
+ import { useConfig as k } from "../../data/config_provider/useConfig.js";
7
8
  import { Avatar as g } from "../avatar/Avatar.js";
8
9
  import { Link as v } from "../../action/link/Link.js";
9
- import { Icon as _ } from "../../icons/icon/Icon.js";
10
+ import { Icon as P } from "../../icons/icon/Icon.js";
10
11
  import { getLocaleIcon as S } from "../../util/lang_emojis/langEmojis.js";
11
- const q = ({
12
+ const R = ({
12
13
  fullName: i,
13
14
  slug: s,
14
15
  avatarUrl: c,
15
- lastActivity: M,
16
- showBadge: b = !1,
16
+ lastActivity: b,
17
+ showBadge: M = !1,
17
18
  points: n = 0,
18
19
  eloquenceTitle: m,
19
20
  occupation: d,
20
21
  disableLinks: l = !1,
21
22
  isDeleted: o = !1,
22
- language: h = null,
23
- languageDialect: u = null
23
+ language: u = null,
24
+ languageDialect: h = null
24
25
  }) => {
25
- const t = B(), p = L(), f = new Date(M) > Date.now();
26
+ const t = B(), f = _(), L = k()?.actions?.disableProfileLinks === !0, p = new Date(b) > Date.now();
26
27
  return /* @__PURE__ */ r("div", { className: N(a.authorBox, "author-box"), children: [
27
- !s || l || o ? /* @__PURE__ */ e(
28
+ !s || l || L || o ? /* @__PURE__ */ e(
28
29
  g,
29
30
  {
30
31
  avatarUrl: o ? null : c,
31
32
  userName: i,
32
- isOnline: f,
33
+ isOnline: p,
33
34
  size: 48
34
35
  }
35
36
  ) : /* @__PURE__ */ e(
36
37
  v,
37
38
  {
38
- to: p.userShowLocation.toUrl({ userSlug: s }),
39
+ to: f.userShowLocation.toUrl({ userSlug: s }),
39
40
  className: a.authorLink,
40
41
  children: /* @__PURE__ */ e(
41
42
  g,
42
43
  {
43
44
  avatarUrl: c,
44
45
  userName: i,
45
- isOnline: f,
46
+ isOnline: p,
46
47
  size: 48
47
48
  }
48
49
  )
@@ -62,15 +63,15 @@ const q = ({
62
63
  defaultMessage: "Deleted"
63
64
  }) : i
64
65
  }
65
- ) : /* @__PURE__ */ e("div", { className: a.authorLink, children: /* @__PURE__ */ e(v, { to: p.userShowLocation.toUrl({ userSlug: s }), children: i }) }),
66
- b && !o && /* @__PURE__ */ r("div", { className: a.expertContainer, children: [
67
- /* @__PURE__ */ e(_, { name: "expertBadge", width: 14, height: 14 }),
66
+ ) : /* @__PURE__ */ e("div", { className: a.authorLink, children: /* @__PURE__ */ e(v, { to: f.userShowLocation.toUrl({ userSlug: s }), children: i }) }),
67
+ M && !o && /* @__PURE__ */ r("div", { className: a.expertContainer, children: [
68
+ /* @__PURE__ */ e(P, { name: "expertBadge", width: 14, height: 14 }),
68
69
  /* @__PURE__ */ e("span", { className: a.expertBadge, children: t.formatMessage({
69
70
  id: "user.author_box.expert",
70
71
  defaultMessage: "Journalist"
71
72
  }) })
72
73
  ] }),
73
- h && u && /* @__PURE__ */ e("div", { className: a.languageContainer, children: S(h, u) })
74
+ u && h && /* @__PURE__ */ e("div", { className: a.languageContainer, children: S(u, h) })
74
75
  ] }) }),
75
76
  !o && /* @__PURE__ */ r(x, { children: [
76
77
  /* @__PURE__ */ r("div", { className: a.authorPointsBox, children: [
@@ -114,5 +115,5 @@ const q = ({
114
115
  ] });
115
116
  };
116
117
  export {
117
- q as AuthorBox
118
+ R as AuthorBox
118
119
  };
@@ -1,73 +1,83 @@
1
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import n from "classnames";
1
+ import { jsxs as o, jsx as a } from "react/jsx-runtime";
2
+ import c from "classnames";
3
3
  import "react";
4
- import { useIntl as u, FormattedMessage as i } from "react-intl";
5
- import o from "./UserBox.module.scss.js";
6
- import { useRoutes as c } from "../../data/config_provider/useRoutes.js";
7
- import { Link as t } from "../../action/link/Link.js";
8
- import { Avatar as d } from "../avatar/Avatar.js";
9
- const N = ({ user: s }) => {
10
- const l = u(), a = c();
11
- return /* @__PURE__ */ r("div", { className: n(o.userBox, "author-box"), children: [
12
- /* @__PURE__ */ e("div", { className: o.userBoxHeader, children: /* @__PURE__ */ e(
13
- t,
4
+ import { useIntl as d, FormattedMessage as r } from "react-intl";
5
+ import s from "./UserBox.module.scss.js";
6
+ import { useRoutes as m } from "../../data/config_provider/useRoutes.js";
7
+ import { useConfig as _ } from "../../data/config_provider/useConfig.js";
8
+ import { Avatar as l } from "../avatar/Avatar.js";
9
+ import { Link as i } from "../../action/link/Link.js";
10
+ const B = ({ user: e }) => {
11
+ const n = d(), t = m(), u = _()?.actions?.disableProfileLinks === !0;
12
+ return /* @__PURE__ */ o("div", { className: c(s.userBox, "author-box"), children: [
13
+ /* @__PURE__ */ a("div", { className: s.userBoxHeader, children: u ? /* @__PURE__ */ a(
14
+ l,
14
15
  {
15
- to: a.userShowLocation.toUrl({ userSlug: s.hash_id }),
16
- "aria-label": l.formatMessage({
16
+ "data-tid": "action_view_user_image",
17
+ userName: e.full_name,
18
+ avatarUrl: e.image_url,
19
+ isOnline: new Date(e.last_activity) > Date.now(),
20
+ size: 60
21
+ }
22
+ ) : /* @__PURE__ */ a(
23
+ i,
24
+ {
25
+ to: t.userShowLocation.toUrl({ userSlug: e.hash_id }),
26
+ "aria-label": n.formatMessage({
17
27
  id: "user.user_box.author_link.aria_label",
18
28
  defaultMessage: "View profile"
19
29
  }),
20
- children: /* @__PURE__ */ e(
21
- d,
30
+ children: /* @__PURE__ */ a(
31
+ l,
22
32
  {
23
33
  "data-tid": "action_view_user_image",
24
- userName: s.full_name,
25
- avatarUrl: s.image_url,
26
- isOnline: new Date(s.last_activity) > Date.now(),
34
+ userName: e.full_name,
35
+ avatarUrl: e.image_url,
36
+ isOnline: new Date(e.last_activity) > Date.now(),
27
37
  size: 60
28
38
  }
29
39
  )
30
40
  }
31
41
  ) }),
32
- /* @__PURE__ */ r("div", { className: o.userBoxDescription, children: [
33
- /* @__PURE__ */ e(t, { to: a.userShowLocation.toUrl({ userSlug: s.hash_id }), children: /* @__PURE__ */ e(
42
+ /* @__PURE__ */ o("div", { className: s.userBoxDescription, children: [
43
+ /* @__PURE__ */ a(i, { to: t.userShowLocation.toUrl({ userSlug: e.hash_id }), children: /* @__PURE__ */ a(
34
44
  "div",
35
45
  {
36
46
  "data-tid": "action_view_user_name",
37
- className: o.userBoxName,
38
- title: s.full_name,
39
- children: s.full_name
47
+ className: s.userBoxName,
48
+ title: e.full_name,
49
+ children: e.full_name
40
50
  }
41
51
  ) }),
42
- s.role === "contributor" && /* @__PURE__ */ e(
43
- t,
52
+ e.role === "contributor" && /* @__PURE__ */ a(
53
+ i,
44
54
  {
45
- to: a.userShowLocation.toUrl({ userSlug: s.hash_id }),
55
+ to: t.userShowLocation.toUrl({ userSlug: e.hash_id }),
46
56
  hash: "activity",
47
- children: /* @__PURE__ */ e("div", { className: o.userBoxPoints, children: /* @__PURE__ */ e("span", { children: /* @__PURE__ */ e(
48
- i,
57
+ children: /* @__PURE__ */ a("div", { className: s.userBoxPoints, children: /* @__PURE__ */ a("span", { children: /* @__PURE__ */ a(
58
+ r,
49
59
  {
50
60
  id: "user.user_box.points",
51
- values: { count: s.points },
61
+ values: { count: e.points },
52
62
  defaultMessage: "{count} points"
53
63
  }
54
64
  ) }) })
55
65
  }
56
66
  ),
57
- /* @__PURE__ */ e(t, { to: a.userShowLocation.toUrl({ userSlug: s.hash_id }), children: /* @__PURE__ */ r("div", { className: o.userBoxStats, children: [
58
- /* @__PURE__ */ e("div", { className: o.userDebates, children: /* @__PURE__ */ e(
59
- i,
67
+ /* @__PURE__ */ a(i, { to: t.userShowLocation.toUrl({ userSlug: e.hash_id }), children: /* @__PURE__ */ o("div", { className: s.userBoxStats, children: [
68
+ /* @__PURE__ */ a("div", { className: s.userDebates, children: /* @__PURE__ */ a(
69
+ r,
60
70
  {
61
71
  id: "user.user_box.user_arguments",
62
- values: { count: s.messages_count },
72
+ values: { count: e.messages_count },
63
73
  defaultMessage: "{count} arguments"
64
74
  }
65
75
  ) }),
66
- /* @__PURE__ */ e("div", { className: o.userVotes, children: /* @__PURE__ */ e(
67
- i,
76
+ /* @__PURE__ */ a("div", { className: s.userVotes, children: /* @__PURE__ */ a(
77
+ r,
68
78
  {
69
79
  id: "user.user_box.user_votes",
70
- values: { count: s.upvotes },
80
+ values: { count: e.upvotes },
71
81
  defaultMessage: "{count} votes"
72
82
  }
73
83
  ) })
@@ -76,5 +86,5 @@ const N = ({ user: s }) => {
76
86
  ] });
77
87
  };
78
88
  export {
79
- N as UserBox
89
+ B as UserBox
80
90
  };
@@ -1,34 +1,35 @@
1
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
2
- import n from "classnames";
1
+ import { jsxs as c, jsx as o } from "react/jsx-runtime";
2
+ import u from "classnames";
3
3
  import "react";
4
- import { useIntl as u } from "react-intl";
4
+ import { useIntl as f } from "react-intl";
5
5
  import r from "./UserBoxSmall.module.scss.js";
6
- import { useRoutes as c } from "../../data/config_provider/useRoutes.js";
7
- import { Link as i } from "../../action/link/Link.js";
8
- import { Avatar as f } from "../avatar/Avatar.js";
9
- const L = ({ userName: a, avatarUrl: l, userSlug: t }) => {
10
- const e = u(), s = c();
11
- return /* @__PURE__ */ m("div", { className: n(r.authorContainer, "author-box"), children: [
12
- /* @__PURE__ */ o(
13
- i,
6
+ import { useRoutes as h } from "../../data/config_provider/useRoutes.js";
7
+ import { useConfig as d } from "../../data/config_provider/useConfig.js";
8
+ import { Avatar as l } from "../avatar/Avatar.js";
9
+ import { Link as n } from "../../action/link/Link.js";
10
+ const N = ({ userName: a, avatarUrl: t, userSlug: e }) => {
11
+ const i = f(), s = h(), m = d()?.actions?.disableProfileLinks === !0;
12
+ return /* @__PURE__ */ c("div", { className: u(r.authorContainer, "author-box"), children: [
13
+ m ? /* @__PURE__ */ o("div", { className: r.authorLink, children: /* @__PURE__ */ o(l, { avatarUrl: t, userName: a, size: 25 }) }) : /* @__PURE__ */ o(
14
+ n,
14
15
  {
15
- to: s.userShowLocation.toUrl({ userSlug: t }),
16
+ to: s.userShowLocation.toUrl({ userSlug: e }),
16
17
  className: r.authorLink,
17
18
  target: "_top",
18
- "aria-label": e.formatMessage({
19
+ "aria-label": i.formatMessage({
19
20
  id: "user.user_box_small.author_link.aria_label",
20
21
  defaultMessage: "View profile"
21
22
  }),
22
- children: /* @__PURE__ */ o(f, { avatarUrl: l, userName: a, size: 25 })
23
+ children: /* @__PURE__ */ o(l, { avatarUrl: t, userName: a, size: 25 })
23
24
  }
24
25
  ),
25
26
  /* @__PURE__ */ o("div", { className: r.authorName, children: /* @__PURE__ */ o(
26
- i,
27
+ n,
27
28
  {
28
- to: s.userShowLocation.toUrl({ userSlug: t }),
29
+ to: s.userShowLocation.toUrl({ userSlug: e }),
29
30
  className: r.authorLink,
30
31
  target: "_top",
31
- "aria-label": e.formatMessage({
32
+ "aria-label": i.formatMessage({
32
33
  id: "user.user_box_small.author_link.aria_label",
33
34
  defaultMessage: "View profile"
34
35
  }),
@@ -38,5 +39,5 @@ const L = ({ userName: a, avatarUrl: l, userSlug: t }) => {
38
39
  ] });
39
40
  };
40
41
  export {
41
- L as UserBoxSmall
42
+ N as UserBoxSmall
42
43
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logora/debate",
3
- "version": "0.4.34",
3
+ "version": "0.4.36",
4
4
  "type": "module",
5
5
  "license": "AGPL-3.0",
6
6
  "description": "Design system of @Logora made with React",
@@ -25,11 +25,8 @@ $text-tertiary: var(--text-tertiary, #fafafa);
25
25
  $text-light: var(--text-light, white);
26
26
  $font-weight-normal: var(--font-weight-normal, 400);
27
27
  $font-weight-bold: var(--font-weight-bold, 700);
28
- $font-variation-light: var(--font-variation-light, normal);
29
28
  $font-variation-normal: var(--font-variation-normal, normal);
30
- $font-variation-medium: var(--font-variation-medium, normal);
31
29
  $font-variation-bold: var(--font-variation-bold, normal);
32
- $font-variation-extra-bold: var(--font-variation-extra-bold, normal);
33
30
  $darken-text-tertiary: var(--darken-text-tertiary, #F1EFED);
34
31
  $darkest-text-tertiary: var(--darkest-text-tertiary, #c7c7c7);
35
32
  $font-family: var(--font-family, 'Montserrat');
@@ -51,11 +51,8 @@ This SASS file contains all the variables used for defining colors, fonts, borde
51
51
  - **$font-size-extra-small**: Extra small font size (`14px`).
52
52
  - **$font-weight-normal**: Normal font weight (`400`).
53
53
  - **$font-weight-bold**: Bold font weight (`700`).
54
- - **$font-variation-light**: `font-variation-settings` value for light text, applied alongside `font-weight` (defaults to `normal`, i.e. no effect). Override for variable fonts, e.g. `"wght" 300, "opsz" 66`.
55
54
  - **$font-variation-normal**: `font-variation-settings` value for normal text (defaults to `normal`, i.e. no effect). Override for variable fonts, e.g. `"wght" 400, "opsz" 66`.
56
- - **$font-variation-medium**: `font-variation-settings` value for medium text (defaults to `normal`, i.e. no effect). Override for variable fonts, e.g. `"wght" 500, "opsz" 66`.
57
55
  - **$font-variation-bold**: `font-variation-settings` value for bold text (defaults to `normal`, i.e. no effect). Override for variable fonts, e.g. `"wght" 700, "opsz" 66`.
58
- - **$font-variation-extra-bold**: `font-variation-settings` value for extra-bold text (defaults to `normal`, i.e. no effect). Override for variable fonts, e.g. `"wght" 800, "opsz" 66`.
59
56
 
60
57
  > **Variable fonts (e.g. Clarín's `ClarinvarVF`)**: These variables let a client apply `font-variation-settings` in addition to the standard `font-weight`. By default they are `normal` and have no effect, so `font-weight` behaves as usual. When a client overrides them (via the corresponding CSS custom properties `--font-variation-*`), the `font-variation-settings` takes precedence over `font-weight` for fonts that support it.
61
58