@peers-app/peers-ui 0.33.15 → 0.33.16

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.
@@ -253,17 +253,26 @@ function MenuTabIcon({ tab }) {
253
253
  const color = (0, tab_color_1.useTabIconColorClass)(tab);
254
254
  return (0, jsx_runtime_1.jsx)("i", { className: `${tab.iconClassName} me-3 ${color}`, style: { fontSize: "20px" } });
255
255
  }
256
+ /**
257
+ * The selected tab in dark mode: a step above the strip (#343a40), and dark enough that every
258
+ * app's tab icon, in the brighter shade theme.css gives it in dark mode, keeps 3:1 contrast.
259
+ */
260
+ const DARK_ACTIVE_TAB_BG = "#454b52";
256
261
  function TabHeader({ tab, isActive, onSwitch, onClose, colorMode }) {
257
262
  const isLight = colorMode === "light";
258
263
  const iconColor = (0, tab_color_1.useTabIconColorClass)(tab);
259
- const activeClass = isLight ? "" : isActive ? "bg-secondary" : "bg-dark";
264
+ const activeClass = isLight || isActive ? "" : "bg-dark";
260
265
  return ((0, jsx_runtime_1.jsxs)("div", { className: `peers-tab ${isActive ? "peers-tab-active" : ""} d-flex align-items-center px-2 py-1 user-select-none ${activeClass}`, style: {
261
266
  cursor: "pointer",
262
267
  minWidth: "100px",
263
268
  maxWidth: "180px",
264
269
  height: "34px",
265
270
  fontSize: "13px",
266
- backgroundColor: isLight ? "var(--peers-tab-bg)" : undefined,
271
+ backgroundColor: isLight
272
+ ? "var(--peers-tab-bg)"
273
+ : isActive
274
+ ? DARK_ACTIVE_TAB_BG
275
+ : undefined,
267
276
  borderTop: isLight ? undefined : isActive ? "2px solid #0d6efd" : "2px solid transparent",
268
277
  borderLeft: isLight ? undefined : "1px solid transparent",
269
278
  borderRight: isLight ? undefined : "1px solid #495057",
package/dist/theme.css CHANGED
@@ -481,6 +481,51 @@
481
481
  color: var(--peers-tile-bg);
482
482
  }
483
483
 
484
+ /* The desktop strip's tab icons: a size up and a hair heavier, so their thin outlines show
485
+ their color. */
486
+ .peers-tab > i {
487
+ font-size: 15px;
488
+ -webkit-text-stroke: 0.35px currentColor;
489
+ }
490
+
491
+ /* Dark mode: the tile shades are made for white glyphs and sink on the dark strip, so tab icons
492
+ use brighter, saturated shades of each hue, with at least 3:1 contrast on the strip and the
493
+ selected tab. */
494
+ [data-bs-theme="dark"] .peers-tab-icon {
495
+ color: var(--peers-tab-icon-dark, var(--peers-tile-bg));
496
+ }
497
+
498
+ [data-bs-theme="dark"] .peers-app-color-blue {
499
+ --peers-tab-icon-dark: #5696fb;
500
+ }
501
+ [data-bs-theme="dark"] .peers-app-color-teal {
502
+ --peers-tab-icon-dark: #28cab6;
503
+ }
504
+ [data-bs-theme="dark"] .peers-app-color-red {
505
+ --peers-tab-icon-dark: #fa6666;
506
+ }
507
+ [data-bs-theme="dark"] .peers-app-color-amber {
508
+ --peers-tab-icon-dark: #fac23d;
509
+ }
510
+ [data-bs-theme="dark"] .peers-app-color-purple {
511
+ --peers-tab-icon-dark: #b77cf3;
512
+ }
513
+ [data-bs-theme="dark"] .peers-app-color-orange {
514
+ --peers-tab-icon-dark: #f48c37;
515
+ }
516
+ [data-bs-theme="dark"] .peers-app-color-green {
517
+ --peers-tab-icon-dark: #44d37b;
518
+ }
519
+ [data-bs-theme="dark"] .peers-app-color-pink {
520
+ --peers-tab-icon-dark: #ed69b0;
521
+ }
522
+ [data-bs-theme="dark"] .peers-app-color-violet {
523
+ --peers-tab-icon-dark: #9b8af6;
524
+ }
525
+ [data-bs-theme="dark"] .peers-app-color-slate {
526
+ --peers-tab-icon-dark: #96a3b7;
527
+ }
528
+
484
529
  /* An app's icon: a rounded square in its color. Size it with --peers-tile-size. */
485
530
  .peers-app-icon {
486
531
  --peers-tile-size: 66px;
@@ -130,12 +130,10 @@ exports.UIRouter = UIRouter;
130
130
  * why, instead of the line an embedded part shows.
131
131
  */
132
132
  const UILoader = (args) => {
133
- if (!args.props) {
134
- args.props = {};
135
- }
136
- const { props, peersUIId } = args;
133
+ const { peersUIId } = args;
137
134
  const [lastReloadTime] = (0, hooks_1.useObservable)(globals_1.packageReloaded);
138
- props.__lastPackageReload = lastReloadTime;
135
+ // A copy: React freezes a component's props in development, and PeersUI passes its own here.
136
+ const props = { ...args.props, __lastPackageReload: lastReloadTime };
139
137
  // Keep the same loader ancestor after the bundle enters the cache. Replacing it
140
138
  // on a path change would unmount the screen before its navigation guard can run.
141
139
  return (0, jsx_runtime_1.jsx)(UIAsyncLoader, { peersUIId: peersUIId, props: props, screen: args.screen }, peersUIId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peers-app/peers-ui",
3
- "version": "0.33.15",
3
+ "version": "0.33.16",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/peers-app/peers-ui.git"
@@ -36,7 +36,7 @@
36
36
  "lint:fix": "biome check --write ."
37
37
  },
38
38
  "peerDependencies": {
39
- "@peers-app/peers-sdk": "^0.33.15",
39
+ "@peers-app/peers-sdk": "^0.33.16",
40
40
  "bootstrap": "^5.3.3",
41
41
  "react": "^18.0.0",
42
42
  "react-dom": "^18.0.0"
@@ -47,7 +47,7 @@
47
47
  "@babel/preset-react": "^7.24.1",
48
48
  "@babel/preset-typescript": "^7.27.1",
49
49
  "@biomejs/biome": "2.3.11",
50
- "@peers-app/peers-sdk": "0.33.15",
50
+ "@peers-app/peers-sdk": "0.33.16",
51
51
  "@testing-library/dom": "^10.4.0",
52
52
  "@testing-library/jest-dom": "^6.6.3",
53
53
  "@testing-library/react": "^16.3.0",