@local-civics/hub-ui 0.1.250 → 0.1.251

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/dist/index.d.ts CHANGED
@@ -1597,7 +1597,7 @@ declare const FileLocker: (props: FileLockerProps) => JSX.Element;
1597
1597
  */
1598
1598
  type CommentsItem = {
1599
1599
  commentId: string;
1600
- authorName?: string;
1600
+ commenterName?: string;
1601
1601
  badgeId?: string;
1602
1602
  badgeName?: string;
1603
1603
  lessonId?: string;
@@ -1605,6 +1605,7 @@ type CommentsItem = {
1605
1605
  commentText: string;
1606
1606
  requireValidation: boolean;
1607
1607
  resolvedAt?: string;
1608
+ needsSubmission?: boolean;
1608
1609
  createdAt: string;
1609
1610
  };
1610
1611
  /**
package/dist/index.js CHANGED
@@ -3986,7 +3986,7 @@ const MonthSelection = (props) => {
3986
3986
  const month = props.month;
3987
3987
  const previousMonth = () => props.setMonth(new Date(month.getFullYear(), month.getMonth() - 1, 1));
3988
3988
  const nextMonth = () => props.setMonth(new Date(month.getFullYear(), month.getMonth() + 1, 1));
3989
- return /* @__PURE__ */ React.createElement("div", { className: "flex items-center" }, /* @__PURE__ */ React.createElement("div", { className: "grow" }, /* @__PURE__ */ React.createElement("span", { className: "font-semibold text-md text-slate-300" }, formatDate$1(month, { month: "long" })), /* @__PURE__ */ React.createElement("span", { className: "text-md ml-1 text-slate-300" }, formatDate$1(month, { year: "numeric" }))), /* @__PURE__ */ React.createElement("div", { onClick: previousMonth, className: "cursor-pointer w-3 h-3 min-w-3 text-slate-300 hover:text-slate-500" }, /* @__PURE__ */ React.createElement(Icon$1, { name: "leftArrow" })), /* @__PURE__ */ React.createElement("div", { onClick: nextMonth, className: "cursor-pointer ml-2 w-3 h-3 min-w-3 text-slate-300 hover:text-slate-500" }, /* @__PURE__ */ React.createElement(Icon$1, { name: "rightArrow" })));
3989
+ return /* @__PURE__ */ React.createElement("div", { className: "flex items-center" }, /* @__PURE__ */ React.createElement("div", { className: "grow" }, /* @__PURE__ */ React.createElement("span", { className: "font-semibold text-md text-slate-300" }, formatDate$2(month, { month: "long" })), /* @__PURE__ */ React.createElement("span", { className: "text-md ml-1 text-slate-300" }, formatDate$2(month, { year: "numeric" }))), /* @__PURE__ */ React.createElement("div", { onClick: previousMonth, className: "cursor-pointer w-3 h-3 min-w-3 text-slate-300 hover:text-slate-500" }, /* @__PURE__ */ React.createElement(Icon$1, { name: "leftArrow" })), /* @__PURE__ */ React.createElement("div", { onClick: nextMonth, className: "cursor-pointer ml-2 w-3 h-3 min-w-3 text-slate-300 hover:text-slate-500" }, /* @__PURE__ */ React.createElement(Icon$1, { name: "rightArrow" })));
3990
3990
  };
3991
3991
  const DaySelection = (props) => {
3992
3992
  const today = new Date();
@@ -4031,7 +4031,7 @@ const calend = (date) => {
4031
4031
  const isSameDate = (left, right) => {
4032
4032
  return left === right || !!(left && right) && left.getFullYear() === right.getFullYear() && left.getMonth() === right.getMonth() && left.getDate() === right.getDate();
4033
4033
  };
4034
- const formatDate$1 = (date, options) => {
4034
+ const formatDate$2 = (date, options) => {
4035
4035
  return Intl.DateTimeFormat("en-US", options).format(date);
4036
4036
  };
4037
4037
  const nextDate$1 = (date) => {
@@ -4078,9 +4078,9 @@ const EventList = (props) => {
4078
4078
  return /* @__PURE__ */ React.createElement(Widget, null, /* @__PURE__ */ React.createElement(WidgetHeader, { divide: true }, /* @__PURE__ */ React.createElement(WidgetTitle, null, /* @__PURE__ */ React.createElement(DateTitle, null, date)), /* @__PURE__ */ React.createElement(WidgetHeaderLink, { onClick: () => props.onSetDate(previousDate(date)), display: !!props.date }, /* @__PURE__ */ React.createElement(Icon$1, { name: "leftArrow" })), /* @__PURE__ */ React.createElement(WidgetHeaderLink, { onClick: () => props.onSetDate(nextDate(date)), display: !!props.date }, /* @__PURE__ */ React.createElement(Icon$1, { name: "rightArrow" }))), /* @__PURE__ */ React.createElement(WidgetBody, null, /* @__PURE__ */ React.createElement(Loader, { isLoading: props.isLoading }, hasChildren && /* @__PURE__ */ React.createElement("div", { className: "grid grid-cols-1 max-h-[30rem] overflow-auto gap-2" }, props.children), !hasChildren && /* @__PURE__ */ React.createElement("div", { className: "grid justify-items-center content-center h-[16rem] lg:h-[22rem]" }, /* @__PURE__ */ React.createElement("p", { className: "text-sm text-center align-middle leading-6 font-semibold text-slate-300" }, "No events for the day.")))));
4079
4079
  };
4080
4080
  const DateTitle = (props) => {
4081
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("span", { className: "font-semibold text-3xl text-slate-600" }, formatDate(props.children, { month: "long" })), /* @__PURE__ */ React.createElement("span", { className: "font-semibold ml-2 text-3xl text-slate-600" }, ordNumber(props.children.getDate())), /* @__PURE__ */ React.createElement("span", { className: "text-3xl ml-2 text-slate-600" }, formatDate(props.children, { year: "numeric" })));
4081
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("span", { className: "font-semibold text-3xl text-slate-600" }, formatDate$1(props.children, { month: "long" })), /* @__PURE__ */ React.createElement("span", { className: "font-semibold ml-2 text-3xl text-slate-600" }, ordNumber(props.children.getDate())), /* @__PURE__ */ React.createElement("span", { className: "text-3xl ml-2 text-slate-600" }, formatDate$1(props.children, { year: "numeric" })));
4082
4082
  };
4083
- const formatDate = (date, options) => {
4083
+ const formatDate$1 = (date, options) => {
4084
4084
  return Intl.DateTimeFormat("en-US", options).format(date);
4085
4085
  };
4086
4086
  const previousDate = (date) => {
@@ -7256,6 +7256,12 @@ const Comments = (props) => {
7256
7256
  }
7257
7257
  ))));
7258
7258
  };
7259
+ const formatDate = (iso) => {
7260
+ const d = new Date(iso);
7261
+ if (isNaN(d.getTime()))
7262
+ return "";
7263
+ return d.toLocaleDateString(void 0, { month: "short", day: "numeric", year: "numeric" });
7264
+ };
7259
7265
  const CommentCard = (props) => {
7260
7266
  const { comment } = props;
7261
7267
  const target = comment.badgeId ? {
@@ -7269,7 +7275,7 @@ const CommentCard = (props) => {
7269
7275
  } : { label: "General", kind: "general", onClick: void 0 };
7270
7276
  const needsAttention = comment.requireValidation && !comment.resolvedAt;
7271
7277
  const actionLabel = needsAttention && target.kind === "badge" ? "Resubmit this badge" : target.kind === "badge" ? "View this badge" : target.kind === "lesson" ? "View this lesson" : void 0;
7272
- return /* @__PURE__ */ React__namespace.createElement("div", { className: `rounded-2xl border bg-white p-4 ${needsAttention ? "border-gold-400/40" : "border-slate-200"}` }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-start justify-between gap-3" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-xs font-extrabold text-dark-blue-400" }, target.label), comment.authorName && /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-0.5 text-[11px] text-slate-400" }, "from ", comment.authorName)), comment.requireValidation && (comment.resolvedAt ? /* @__PURE__ */ React__namespace.createElement("span", { className: "flex shrink-0 items-center gap-1 rounded-full bg-mint-400/15 px-2.5 py-1 text-[10px] font-bold text-dark-blue-400" }, /* @__PURE__ */ React__namespace.createElement(icons$1.IconCheck, { size: 11, stroke: 3, className: "text-mint-400" }), "Resolved") : /* @__PURE__ */ React__namespace.createElement("span", { className: "shrink-0 rounded-full bg-gold-400/15 px-2.5 py-1 text-[10px] font-bold text-dark-blue-400" }, "Needs attention"))), /* @__PURE__ */ React__namespace.createElement("p", { className: "mt-2.5 text-xs text-slate-600" }, comment.commentText), actionLabel && target.onClick && /* @__PURE__ */ React__namespace.createElement(
7278
+ return /* @__PURE__ */ React__namespace.createElement("div", { className: `rounded-2xl border bg-white p-4 ${needsAttention ? "border-gold-400/40" : "border-slate-200"}` }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-start justify-between gap-3" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "min-w-0" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-xs font-extrabold text-dark-blue-400" }, target.label), /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-0.5 flex items-center gap-1.5 text-[11px] text-slate-400" }, comment.commenterName && /* @__PURE__ */ React__namespace.createElement("span", null, "Commenter: ", comment.commenterName), comment.commenterName && comment.createdAt && /* @__PURE__ */ React__namespace.createElement("span", null, "\xB7"), comment.createdAt && /* @__PURE__ */ React__namespace.createElement("span", null, formatDate(comment.createdAt)))), comment.requireValidation && (!comment.resolvedAt ? /* @__PURE__ */ React__namespace.createElement("span", { className: "shrink-0 rounded-full bg-gold-400/15 px-2.5 py-1 text-[10px] font-bold text-dark-blue-400" }, "Needs attention") : comment.needsSubmission ? /* @__PURE__ */ React__namespace.createElement("span", { className: "shrink-0 rounded-full bg-sky-blue-400/15 px-2.5 py-1 text-[10px] font-bold text-dark-blue-400" }, "Needs submission") : /* @__PURE__ */ React__namespace.createElement("span", { className: "flex shrink-0 items-center gap-1 rounded-full bg-mint-400/15 px-2.5 py-1 text-[10px] font-bold text-dark-blue-400" }, /* @__PURE__ */ React__namespace.createElement(icons$1.IconCheck, { size: 11, stroke: 3, className: "text-mint-400" }), "Resolved"))), /* @__PURE__ */ React__namespace.createElement("p", { className: "mt-2.5 text-xs text-slate-600" }, comment.commentText), actionLabel && target.onClick && /* @__PURE__ */ React__namespace.createElement(
7273
7279
  "button",
7274
7280
  {
7275
7281
  type: "button",