@natoe/colab 0.1.17 → 0.1.18

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.mjs CHANGED
@@ -1534,8 +1534,8 @@ function PatientHeader({
1534
1534
  if (patientData.bodyParts && patientData.bodyParts.length > 0) {
1535
1535
  metaParts.push(patientData.bodyParts.join(", "));
1536
1536
  }
1537
- const hasActions = hasDicom && onOpenDicom || onOpenCase || onOpenSettings;
1538
- const actions = hasActions ? /* @__PURE__ */ jsxs("div", { style: styles.actions, children: [
1537
+ const hasPrimaryActions = hasDicom && onOpenDicom || onOpenCase;
1538
+ const primaryActions = hasPrimaryActions ? /* @__PURE__ */ jsxs("div", { style: styles.actions, children: [
1539
1539
  hasDicom && onOpenDicom && /* @__PURE__ */ jsxs(
1540
1540
  "button",
1541
1541
  {
@@ -1562,22 +1562,22 @@ function PatientHeader({
1562
1562
  /* @__PURE__ */ jsx("span", { children: "Open" })
1563
1563
  ]
1564
1564
  }
1565
- ),
1566
- onOpenSettings && /* @__PURE__ */ jsxs(
1567
- "button",
1568
- {
1569
- onClick: onOpenSettings,
1570
- style: styles.settingsIconButton,
1571
- type: "button",
1572
- "aria-label": `Open channel settings (${participants.length} participants)`,
1573
- title: "Channel participants",
1574
- children: [
1575
- /* @__PURE__ */ jsx(PeopleIcon, { size: 18, color: COLOR.neutral600 }),
1576
- /* @__PURE__ */ jsx("span", { style: styles.participantCount, children: participants.length })
1577
- ]
1578
- }
1579
1565
  )
1580
1566
  ] }) : null;
1567
+ const settingsButton = onOpenSettings ? /* @__PURE__ */ jsxs(
1568
+ "button",
1569
+ {
1570
+ onClick: onOpenSettings,
1571
+ style: styles.settingsIconButton,
1572
+ type: "button",
1573
+ "aria-label": `Open channel settings (${participants.length} participants)`,
1574
+ title: "Channel participants",
1575
+ children: [
1576
+ /* @__PURE__ */ jsx(PeopleIcon, { size: 18, color: COLOR.neutral600 }),
1577
+ /* @__PURE__ */ jsx("span", { style: styles.participantCount, children: participants.length })
1578
+ ]
1579
+ }
1580
+ ) : null;
1581
1581
  return /* @__PURE__ */ jsxs("div", { className, style: styles.container, children: [
1582
1582
  !hideName && /* @__PURE__ */ jsxs("div", { style: styles.nameRow, children: [
1583
1583
  onBack && /* @__PURE__ */ jsx(
@@ -1592,10 +1592,16 @@ function PatientHeader({
1592
1592
  }
1593
1593
  ),
1594
1594
  /* @__PURE__ */ jsx("span", { style: styles.nameText, children: resolvedName }),
1595
- actions
1595
+ primaryActions
1596
+ ] }),
1597
+ !hideName && (metaParts.length > 0 || settingsButton) && /* @__PURE__ */ jsxs("div", { style: styles.metaRow, children: [
1598
+ metaParts.length > 0 && /* @__PURE__ */ jsx("span", { style: styles.metaText, children: metaParts.join(" \xB7 ") }),
1599
+ settingsButton && /* @__PURE__ */ jsx("div", { style: styles.metaRowEnd, children: settingsButton })
1596
1600
  ] }),
1597
- !hideName && metaParts.length > 0 && /* @__PURE__ */ jsx("div", { style: styles.metaRow, children: /* @__PURE__ */ jsx("span", { style: styles.metaText, children: metaParts.join(" \xB7 ") }) }),
1598
- hideName && actions && /* @__PURE__ */ jsx("div", { style: styles.actionsOnlyRow, children: actions })
1601
+ hideName && (primaryActions || settingsButton) && /* @__PURE__ */ jsxs("div", { style: styles.actionsOnlyRow, children: [
1602
+ primaryActions,
1603
+ settingsButton
1604
+ ] })
1599
1605
  ] });
1600
1606
  }
1601
1607
  var styles = {
@@ -1639,15 +1645,21 @@ var styles = {
1639
1645
  textOverflow: "ellipsis",
1640
1646
  whiteSpace: "nowrap"
1641
1647
  },
1642
- // Sub-row beneath the title — small muted meta. Aligned under the
1643
- // name (past the back button) so it visually anchors to the title
1644
- // rather than the panel edge.
1648
+ // Sub-row beneath the title — small muted meta on the left, the
1649
+ // channel-settings pill on the right when present. Meta text can
1650
+ // ellipsis on narrow widths; the settings pill stays its content
1651
+ // width and hugs the trailing edge via `metaRowEnd`.
1645
1652
  metaRow: {
1646
1653
  display: "flex",
1647
1654
  alignItems: "center",
1655
+ gap: SPACE.S2,
1648
1656
  paddingLeft: `calc(${SIZE.controlIcon} + ${SPACE.S2} - ${SPACE.S2})`,
1649
1657
  minWidth: 0
1650
1658
  },
1659
+ metaRowEnd: {
1660
+ marginLeft: "auto",
1661
+ flexShrink: 0
1662
+ },
1651
1663
  // When hideName=true (popup mode), only the actions render. The
1652
1664
  // popup's own title bar carries the name + meta above this row, so
1653
1665
  // the actions land flush-left here — pinning them to the right
@@ -1848,7 +1860,6 @@ var styles3 = {
1848
1860
  display: "flex",
1849
1861
  alignItems: "center",
1850
1862
  gap: SPACE.S1,
1851
- marginTop: "2px",
1852
1863
  fontSize: FONT_SIZE.xs,
1853
1864
  opacity: 0.85
1854
1865
  },
@@ -2556,7 +2567,7 @@ var styles5 = {
2556
2567
  minWidth: 0
2557
2568
  },
2558
2569
  bubble: {
2559
- padding: `${SPACE.S3} ${SPACE.S4}`,
2570
+ padding: `${SPACE.S2} ${SPACE.S4}`,
2560
2571
  borderRadius: "18px",
2561
2572
  wordBreak: "break-word",
2562
2573
  border: "1px solid transparent"
@@ -2603,7 +2614,7 @@ var styles5 = {
2603
2614
  alignItems: "center",
2604
2615
  justifyContent: "flex-end",
2605
2616
  gap: SPACE.S2,
2606
- marginTop: SPACE.S2,
2617
+ marginTop: SPACE.S1,
2607
2618
  fontSize: "11px",
2608
2619
  opacity: 0.85
2609
2620
  },
@@ -4208,11 +4219,16 @@ function CollabPanel({
4208
4219
  hideOpenCase = false,
4209
4220
  onConversationChange,
4210
4221
  themeMode = "light",
4222
+ showSettings: controlledShowSettings,
4223
+ onSettingsChange,
4211
4224
  className,
4212
4225
  style
4213
4226
  }) {
4214
4227
  const { config } = useCollab();
4215
- const [showSettings, setShowSettings] = useState(false);
4228
+ const isSettingsControlled = controlledShowSettings !== void 0 && onSettingsChange !== void 0;
4229
+ const [internalShowSettings, setInternalShowSettings] = useState(false);
4230
+ const showSettings = isSettingsControlled ? controlledShowSettings : internalShowSettings;
4231
+ const updateShowSettings = isSettingsControlled ? onSettingsChange : setInternalShowSettings;
4216
4232
  const [toast, setToast] = useState(null);
4217
4233
  const messageListRef = useRef(null);
4218
4234
  const {
@@ -4315,7 +4331,7 @@ function CollabPanel({
4315
4331
  onRemoveUser: channelSettings.removeUser,
4316
4332
  onLeaveChannel: channelSettings.leaveChannel,
4317
4333
  onDeleteChannel: channelSettings.deleteChannel,
4318
- onClose: () => setShowSettings(false)
4334
+ onClose: () => updateShowSettings(false)
4319
4335
  }
4320
4336
  ) : /* @__PURE__ */ jsxs(Fragment, { children: [
4321
4337
  /* @__PURE__ */ jsx(
@@ -4325,7 +4341,7 @@ function CollabPanel({
4325
4341
  participants,
4326
4342
  onOpenDicom: handleOpenDicom,
4327
4343
  onOpenCase: handleOpenCase,
4328
- onOpenSettings: () => setShowSettings(true),
4344
+ onOpenSettings: hidePatientName ? void 0 : () => updateShowSettings(true),
4329
4345
  onBack,
4330
4346
  hideName: hidePatientName,
4331
4347
  displayName: conversation?.name
@@ -4468,6 +4484,7 @@ function CollabPopup({
4468
4484
  );
4469
4485
  const [isDragging, setIsDragging] = useState(false);
4470
4486
  const [isMinimized, setIsMinimized] = useState(false);
4487
+ const [showSettings, setShowSettings] = useState(false);
4471
4488
  const [loadedConversation, setLoadedConversation] = useState(null);
4472
4489
  const dragOffset = useRef({ x: 0, y: 0 });
4473
4490
  const containerRef = useRef(null);
@@ -4591,6 +4608,20 @@ function CollabPopup({
4591
4608
  })()
4592
4609
  ] }),
4593
4610
  /* @__PURE__ */ jsxs("div", { style: styles13.titleActions, children: [
4611
+ loadedConversation && /* @__PURE__ */ jsxs(
4612
+ "button",
4613
+ {
4614
+ type: "button",
4615
+ onClick: () => setShowSettings(true),
4616
+ style: styles13.titleSettingsPill,
4617
+ "aria-label": `Open channel settings (${loadedConversation.participants.length} participants)`,
4618
+ title: "Channel participants",
4619
+ children: [
4620
+ /* @__PURE__ */ jsx(PeopleIcon, { size: 18, color: COLOR.neutral600 }),
4621
+ /* @__PURE__ */ jsx("span", { style: styles13.titleParticipantCount, children: loadedConversation.participants.length })
4622
+ ]
4623
+ }
4624
+ ),
4594
4625
  /* @__PURE__ */ jsx(
4595
4626
  "button",
4596
4627
  {
@@ -4625,7 +4656,9 @@ function CollabPopup({
4625
4656
  patientData,
4626
4657
  participantIds,
4627
4658
  hidePatientName: true,
4628
- onConversationChange: setLoadedConversation
4659
+ onConversationChange: setLoadedConversation,
4660
+ showSettings,
4661
+ onSettingsChange: setShowSettings
4629
4662
  }
4630
4663
  ) })
4631
4664
  ]
@@ -4707,6 +4740,29 @@ var styles13 = {
4707
4740
  color: COLOR.neutral700,
4708
4741
  flexShrink: 0
4709
4742
  },
4743
+ // People-icon + participant-count pill in the title-actions row.
4744
+ // Matches the in-panel settings button's shape (icon + count) so a
4745
+ // user moving between popup mode and standalone mode (CollabInbox
4746
+ // compact) sees the same control language.
4747
+ titleSettingsPill: {
4748
+ height: "36px",
4749
+ display: "inline-flex",
4750
+ alignItems: "center",
4751
+ gap: SPACE.S2,
4752
+ padding: `0 ${SPACE.S3}`,
4753
+ backgroundColor: COLOR.neutral100,
4754
+ border: `1px solid ${COLOR.neutral200}`,
4755
+ borderRadius: RADIUS.md,
4756
+ color: COLOR.neutral600,
4757
+ cursor: "pointer",
4758
+ flexShrink: 0
4759
+ },
4760
+ titleParticipantCount: {
4761
+ fontSize: FONT_SIZE.sm,
4762
+ fontWeight: FONT_WEIGHT.semibold,
4763
+ color: COLOR.neutral700,
4764
+ fontVariantNumeric: "tabular-nums"
4765
+ },
4710
4766
  panelWrapper: {
4711
4767
  flex: 1,
4712
4768
  overflow: "hidden"