@peers-app/peers-ui 0.33.18 → 0.33.20

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.
Files changed (59) hide show
  1. package/dist/apps-home/app-tile.js +2 -1
  2. package/dist/apps-home/get-apps-sheet.js +2 -1
  3. package/dist/apps-home/remove-app-dialog.js +2 -1
  4. package/dist/command-palette/command-palette-ui.js +3 -2
  5. package/dist/command-palette/command-palette.d.ts +47 -0
  6. package/dist/command-palette/command-palette.js +42 -9
  7. package/dist/components/color-picker.d.ts +28 -0
  8. package/dist/components/color-picker.js +97 -0
  9. package/dist/components/group-switcher.d.ts +3 -2
  10. package/dist/components/group-switcher.js +74 -101
  11. package/dist/components/icon-picker.d.ts +20 -0
  12. package/dist/components/icon-picker.js +98 -0
  13. package/dist/components/icon-search.d.ts +60 -0
  14. package/dist/components/icon-search.js +227 -0
  15. package/dist/components/icon.d.ts +35 -0
  16. package/dist/components/icon.js +34 -0
  17. package/dist/components/markdown-editor/mention-preview-card.js +2 -1
  18. package/dist/components/markdown-editor/mentions-plugin.js +2 -1
  19. package/dist/groups/group-appearance-dialog.d.ts +45 -0
  20. package/dist/groups/group-appearance-dialog.js +239 -0
  21. package/dist/groups/group-look.d.ts +45 -0
  22. package/dist/groups/group-look.js +47 -0
  23. package/dist/groups/groups-client.d.ts +29 -0
  24. package/dist/groups/groups-client.js +81 -0
  25. package/dist/groups/index.d.ts +3 -0
  26. package/dist/groups/index.js +15 -0
  27. package/dist/icon-index/bootstrap-icons.json +1 -0
  28. package/dist/icon-index/emoji.json +1 -0
  29. package/dist/index.d.ts +5 -0
  30. package/dist/index.js +8 -1
  31. package/dist/mentions/mention-chip.js +2 -1
  32. package/dist/mentions/mention-chooser.js +2 -1
  33. package/dist/root-layout/layouts/full-screen-layout.js +2 -1
  34. package/dist/screens/groups/group-details.js +16 -2
  35. package/dist/screens/groups/group-list.js +37 -43
  36. package/dist/screens/groups/groups-ipc.d.ts +15 -0
  37. package/dist/screens/groups/groups-ipc.js +28 -0
  38. package/dist/screens/packages/package-waiting.js +4 -3
  39. package/dist/screens/peer-types/peer-type-details.d.ts +9 -1
  40. package/dist/screens/peer-types/peer-type-details.js +16 -13
  41. package/dist/screens/peer-types/peer-type-list.d.ts +1 -0
  42. package/dist/screens/peer-types/peer-type-list.js +3 -1
  43. package/dist/screens/search/global-search.js +2 -1
  44. package/dist/tabs-layout/tab-color.d.ts +9 -2
  45. package/dist/tabs-layout/tab-color.js +14 -4
  46. package/dist/tabs-layout/tab-order.d.ts +51 -0
  47. package/dist/tabs-layout/tab-order.js +70 -0
  48. package/dist/tabs-layout/tab-switcher-overlay.d.ts +16 -0
  49. package/dist/tabs-layout/tab-switcher-overlay.js +68 -0
  50. package/dist/tabs-layout/tab-switcher.d.ts +64 -0
  51. package/dist/tabs-layout/tab-switcher.js +150 -0
  52. package/dist/tabs-layout/tabs-layout.d.ts +3 -1
  53. package/dist/tabs-layout/tabs-layout.js +92 -47
  54. package/dist/tabs-layout/tabs-state.d.ts +34 -13
  55. package/dist/tabs-layout/tabs-state.js +104 -31
  56. package/dist/theme.css +327 -0
  57. package/dist/ui-defaults/list-screen.d.ts +1 -0
  58. package/dist/ui-defaults/list-screen.js +3 -1
  59. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.switchToPreviousTab = exports.switchToNextTab = exports.closeCurrentTab = exports.openNewTab = exports.setSingleTabMode = exports.updateActiveTabTitle = exports.handleMainPathChanged = exports.initializedTabs = exports.activeTabId = exports.activeTabs = exports.launcherApp = void 0;
3
+ exports.switchToPreviousTab = exports.switchToNextTab = exports.switchToPreviousApp = exports.moveTab = exports.closeCurrentTab = exports.closeTab = exports.openNewTab = exports.setSingleTabMode = exports.updateActiveTabTitle = exports.handleMainPathChanged = exports.initializedTabs = exports.tabHistory = exports.activeTabId = exports.activeTabs = exports.tabsByRecentUse = exports.previousAppTabId = exports.normalizeTabHistory = exports.launcherApp = void 0;
4
4
  exports.navigateTo = navigateTo;
5
5
  exports.goToTabPath = goToTabPath;
6
6
  exports.isRemovedAppRoute = isRemovedAppRoute;
@@ -11,21 +11,22 @@ const globals_1 = require("../globals");
11
11
  const identity_routes_1 = require("../screens/identity/identity-routes");
12
12
  const system_apps_1 = require("../system-apps");
13
13
  const routes_loader_1 = require("../ui-router/routes-loader");
14
- /** The app launcher tab. It is always present and cannot be closed. */
15
- exports.launcherApp = {
16
- tabId: "launcher",
17
- packageId: "launcher",
18
- path: "",
19
- title: "Apps",
20
- iconClassName: "bi-grid-3x3-gap",
21
- };
14
+ const tab_order_1 = require("./tab-order");
15
+ var tab_order_2 = require("./tab-order");
16
+ Object.defineProperty(exports, "launcherApp", { enumerable: true, get: function () { return tab_order_2.launcherApp; } });
17
+ Object.defineProperty(exports, "normalizeTabHistory", { enumerable: true, get: function () { return tab_order_2.normalizeTabHistory; } });
18
+ Object.defineProperty(exports, "previousAppTabId", { enumerable: true, get: function () { return tab_order_2.previousAppTabId; } });
19
+ Object.defineProperty(exports, "tabsByRecentUse", { enumerable: true, get: function () { return tab_order_2.tabsByRecentUse; } });
22
20
  // Persistent vars for storage (write-only, no subscription to avoid oscillation)
23
21
  const _persistentActiveTabs = (0, peers_sdk_1.groupDeviceVar)("activeTabs", {
24
- defaultValue: [exports.launcherApp],
22
+ defaultValue: [tab_order_1.launcherApp],
25
23
  });
26
24
  const _persistentActiveTabId = (0, peers_sdk_1.groupDeviceVar)("activeTabId", {
27
25
  defaultValue: "launcher",
28
26
  });
27
+ const _persistentTabHistory = (0, peers_sdk_1.groupDeviceVar)("tabHistory", {
28
+ defaultValue: [],
29
+ });
29
30
  let finishNavigationRestore = () => { };
30
31
  const navigationReady = new Promise((resolve) => {
31
32
  finishNavigationRestore = resolve;
@@ -33,7 +34,7 @@ const navigationReady = new Promise((resolve) => {
33
34
  // In-memory observables for UI state (loaded once, then write-through to persistent vars)
34
35
  /** Open tabs. Writes through to device storage after the initial restore. */
35
36
  exports.activeTabs = (() => {
36
- const obs = (0, peers_sdk_1.observable)([exports.launcherApp]);
37
+ const obs = (0, peers_sdk_1.observable)([tab_order_1.launcherApp]);
37
38
  // Write-through to persistent var on change
38
39
  obs.subscribe((value) => {
39
40
  _persistentActiveTabs(value);
@@ -49,17 +50,48 @@ exports.activeTabId = (() => {
49
50
  });
50
51
  return Object.assign(obs, { loadingPromise: navigationReady });
51
52
  })();
53
+ // Stored history is only written after it has been restored, so nothing that runs before the
54
+ // restore can overwrite it.
55
+ let tabHistoryRestored = false;
56
+ /**
57
+ * Ids of the open tabs, the most recently active first, the launcher included. It is
58
+ * separate from {@link activeTabs}: recent use orders the switchers (the phone's tab menu,
59
+ * Ctrl+Tab), never the tab strip. Kept per device.
60
+ */
61
+ exports.tabHistory = (() => {
62
+ const obs = (0, peers_sdk_1.observable)([]);
63
+ obs.subscribe((value) => {
64
+ if (tabHistoryRestored) {
65
+ _persistentTabHistory(value);
66
+ }
67
+ });
68
+ return Object.assign(obs, { loadingPromise: navigationReady });
69
+ })();
52
70
  void Promise.all([
53
71
  _persistentActiveTabs.loadingPromise,
54
72
  _persistentActiveTabId.loadingPromise,
73
+ _persistentTabHistory.loadingPromise,
55
74
  ]).then(() => {
56
75
  const restored = restoreNavigationState(_persistentActiveTabs(), _persistentActiveTabId());
57
76
  (0, exports.activeTabs)(restored.tabs);
58
77
  if ((0, exports.activeTabId)() !== restored.activeId) {
59
78
  (0, exports.activeTabId)(restored.activeId);
60
79
  }
80
+ tabHistoryRestored = true;
81
+ (0, exports.tabHistory)((0, tab_order_1.normalizeTabHistory)(_persistentTabHistory() ?? [], (0, exports.activeTabs)(), (0, exports.activeTabId)()));
61
82
  finishNavigationRestore();
62
83
  });
84
+ function sameIds(left, right) {
85
+ return left.length === right.length && left.every((id, index) => id === right[index]);
86
+ }
87
+ function refreshTabHistory() {
88
+ const next = (0, tab_order_1.normalizeTabHistory)((0, exports.tabHistory)(), (0, exports.activeTabs)(), (0, exports.activeTabId)());
89
+ if (!sameIds(next, (0, exports.tabHistory)())) {
90
+ (0, exports.tabHistory)(next);
91
+ }
92
+ }
93
+ exports.activeTabs.subscribe(refreshTabHistory);
94
+ exports.activeTabId.subscribe(refreshTabHistory);
63
95
  /** Tab ids whose bodies have been mounted at least once. */
64
96
  exports.initializedTabs = new Set();
65
97
  /**
@@ -158,7 +190,7 @@ function isRemovedAppRoute(path) {
158
190
  */
159
191
  function restoreNavigationState(tabs, activeId) {
160
192
  const kept = tabs.filter((tab) => tab.tabId === "launcher" || !isRemovedAppRoute(tab.path));
161
- const migrated = (kept.length > 0 ? kept : [exports.launcherApp]).map(migrateStoredTab);
193
+ const migrated = (kept.length > 0 ? kept : [tab_order_1.launcherApp]).map(migrateStoredTab);
162
194
  const merged = mergeIdentityTabs(migrated, activeId);
163
195
  const activeExists = merged.tabs.some((tab) => tab.tabId === merged.activeId);
164
196
  return {
@@ -177,7 +209,7 @@ function determineAppFromPath(path) {
177
209
  navItem: {
178
210
  name: "Apps",
179
211
  navigationPath: "",
180
- iconClassName: exports.launcherApp.iconClassName || "bi-grid-3x3-gap",
212
+ iconClassName: tab_order_1.launcherApp.iconClassName || "bi-grid-3x3-gap",
181
213
  },
182
214
  package: system_apps_1.systemPackage,
183
215
  };
@@ -392,29 +424,70 @@ const openNewTab = (tab, forceNew = false) => {
392
424
  }
393
425
  };
394
426
  exports.openNewTab = openNewTab;
427
+ /**
428
+ * Close a tab. The launcher tab stays open. Closing the active tab activates the tab used
429
+ * most recently before it (see {@link tabHistory}), which may be the launcher.
430
+ *
431
+ * @param tabId - The tab to close.
432
+ */
433
+ const closeTab = (tabId) => {
434
+ const currentTabs = (0, exports.activeTabs)();
435
+ if (tabId === tab_order_1.launcherApp.tabId || !currentTabs.some((t) => t.tabId === tabId))
436
+ return;
437
+ const history = (0, exports.tabHistory)();
438
+ const newTabs = currentTabs.filter((t) => t.tabId !== tabId);
439
+ (0, exports.activeTabs)(newTabs);
440
+ exports.initializedTabs.delete(tabId);
441
+ if ((0, exports.activeTabId)() !== tabId)
442
+ return;
443
+ const open = new Set(newTabs.map((t) => t.tabId));
444
+ const next = history.find((id) => id !== tabId && open.has(id));
445
+ (0, exports.activeTabId)(next ?? newTabs[0]?.tabId ?? tab_order_1.launcherApp.tabId);
446
+ };
447
+ exports.closeTab = closeTab;
395
448
  /** Close the active tab. The launcher tab stays open. */
396
449
  const closeCurrentTab = () => {
450
+ (0, exports.closeTab)((0, exports.activeTabId)());
451
+ };
452
+ exports.closeCurrentTab = closeCurrentTab;
453
+ /**
454
+ * Move a tab to another place in the strip. The launcher keeps its place, and no tab moves
455
+ * in front of it.
456
+ *
457
+ * @param tabId - The tab to move.
458
+ * @param toIndex - Its new index in {@link activeTabs}.
459
+ */
460
+ const moveTab = (tabId, toIndex) => {
397
461
  const currentTabs = (0, exports.activeTabs)();
398
- const _activeTabId = (0, exports.activeTabId)();
399
- const tabToClose = currentTabs.find((t) => t.tabId === _activeTabId);
400
- if (!tabToClose || tabToClose.tabId === "launcher")
462
+ const fromIndex = currentTabs.findIndex((t) => t.tabId === tabId);
463
+ if (fromIndex < 0 || tabId === tab_order_1.launcherApp.tabId)
401
464
  return;
402
- const closedIndex = currentTabs.findIndex((t) => t.tabId === _activeTabId);
403
- const newTabs = currentTabs.filter((t) => t.tabId !== _activeTabId);
465
+ const launcherIndex = currentTabs.findIndex((t) => t.tabId === tab_order_1.launcherApp.tabId);
466
+ const minIndex = launcherIndex === 0 ? 1 : 0;
467
+ const target = Math.max(minIndex, Math.min(toIndex, currentTabs.length - 1));
468
+ if (target === fromIndex)
469
+ return;
470
+ const newTabs = [...currentTabs];
471
+ const [moved] = newTabs.splice(fromIndex, 1);
472
+ newTabs.splice(target, 0, moved);
404
473
  (0, exports.activeTabs)(newTabs);
405
- exports.initializedTabs.delete(_activeTabId);
406
- if (newTabs.length === 0) {
407
- (0, exports.activeTabId)("launcher");
408
- }
409
- else if (closedIndex < newTabs.length) {
410
- (0, exports.activeTabId)(newTabs[closedIndex].tabId);
411
- }
412
- else {
413
- (0, exports.activeTabId)(newTabs[newTabs.length - 1].tabId);
414
- }
415
474
  };
416
- exports.closeCurrentTab = closeCurrentTab;
417
- /** Activate the next open tab, wrapping around. */
475
+ exports.moveTab = moveTab;
476
+ /**
477
+ * Activate the app tab used before the active one (see {@link previousAppTabId}). From the
478
+ * launcher, that is the most recently used app. Doing it again goes back.
479
+ *
480
+ * @returns Whether a tab was activated; `false` when no other app is open.
481
+ */
482
+ const switchToPreviousApp = () => {
483
+ const previous = (0, tab_order_1.previousAppTabId)((0, exports.tabHistory)(), (0, exports.activeTabId)());
484
+ if (!previous)
485
+ return false;
486
+ (0, exports.activeTabId)(previous);
487
+ return true;
488
+ };
489
+ exports.switchToPreviousApp = switchToPreviousApp;
490
+ /** Activate the next open tab in strip order, wrapping around. */
418
491
  const switchToNextTab = () => {
419
492
  const currentTabs = (0, exports.activeTabs)();
420
493
  const activeTab = (0, exports.activeTabId)();
@@ -425,7 +498,7 @@ const switchToNextTab = () => {
425
498
  (0, exports.activeTabId)(currentTabs[nextIndex].tabId);
426
499
  };
427
500
  exports.switchToNextTab = switchToNextTab;
428
- /** Activate the previous open tab, wrapping around. */
501
+ /** Activate the previous open tab in strip order, wrapping around. */
429
502
  const switchToPreviousTab = () => {
430
503
  const currentTabs = (0, exports.activeTabs)();
431
504
  const activeTab = (0, exports.activeTabId)();
package/dist/theme.css CHANGED
@@ -126,6 +126,112 @@
126
126
  box-shadow: var(--peers-tab-active-shadow);
127
127
  }
128
128
 
129
+ /* A tab's ×: at the tab's right edge, shown while the tab is hovered or the × has keyboard
130
+ focus. Touch screens, which can't hover, always show it. */
131
+ .peers-tab-close {
132
+ display: inline-flex;
133
+ align-items: center;
134
+ justify-content: center;
135
+ flex: 0 0 auto;
136
+ width: 18px;
137
+ height: 18px;
138
+ margin-left: auto;
139
+ padding: 0;
140
+ border: none;
141
+ border-radius: 4px;
142
+ background: none;
143
+ color: inherit;
144
+ font-size: 15px;
145
+ line-height: 1;
146
+ opacity: 0;
147
+ transition:
148
+ opacity 0.1s ease,
149
+ background-color 0.1s ease;
150
+ }
151
+
152
+ .peers-tab:hover .peers-tab-close,
153
+ .peers-tab-close:focus-visible {
154
+ opacity: 0.7;
155
+ }
156
+
157
+ .peers-tab-close:hover {
158
+ opacity: 1;
159
+ background-color: rgba(var(--bs-emphasis-color-rgb), 0.14);
160
+ }
161
+
162
+ @media (hover: none) {
163
+ .peers-tab-close {
164
+ opacity: 0.7;
165
+ }
166
+ }
167
+
168
+ /* The Ctrl+Tab switcher (tab-switcher-overlay.tsx), after the Mac's app switcher: a row of app
169
+ tiles on a translucent panel in the middle of the window, the highlighted tile on a soft
170
+ rounded square with its name below. The overlay sets --peers-switcher-tile to fit the row. */
171
+ .peers-tab-switcher-backdrop {
172
+ align-items: center;
173
+ display: flex;
174
+ inset: 0;
175
+ justify-content: center;
176
+ pointer-events: none;
177
+ position: fixed;
178
+ z-index: 2000;
179
+ }
180
+
181
+ .peers-tab-switcher {
182
+ --peers-switcher-bg: rgba(246, 247, 249, 0.78);
183
+ --peers-switcher-border: rgba(0, 0, 0, 0.12);
184
+ --peers-switcher-highlight: rgba(0, 0, 0, 0.1);
185
+ -webkit-backdrop-filter: blur(24px) saturate(1.6);
186
+ backdrop-filter: blur(24px) saturate(1.6);
187
+ background-color: var(--peers-switcher-bg);
188
+ border: 1px solid var(--peers-switcher-border);
189
+ border-radius: 24px;
190
+ box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
191
+ display: flex;
192
+ flex-wrap: wrap;
193
+ gap: 30px 4px;
194
+ justify-content: center;
195
+ max-width: calc(100vw - 48px);
196
+ padding: 16px 16px 36px;
197
+ pointer-events: auto;
198
+ user-select: none;
199
+ }
200
+
201
+ [data-bs-theme="dark"] .peers-tab-switcher {
202
+ --peers-switcher-bg: rgba(36, 38, 42, 0.72);
203
+ --peers-switcher-border: rgba(255, 255, 255, 0.14);
204
+ --peers-switcher-highlight: rgba(255, 255, 255, 0.16);
205
+ }
206
+
207
+ .peers-tab-switcher .peers-app-icon {
208
+ --peers-tile-size: var(--peers-switcher-tile, 64px);
209
+ }
210
+
211
+ .peers-tab-switcher-item {
212
+ border-radius: calc(var(--peers-switcher-tile, 64px) * 0.3);
213
+ cursor: pointer;
214
+ padding: 10px;
215
+ position: relative;
216
+ }
217
+
218
+ .peers-tab-switcher-item.is-highlighted {
219
+ background-color: var(--peers-switcher-highlight);
220
+ }
221
+
222
+ .peers-tab-switcher-name {
223
+ color: var(--bs-emphasis-color);
224
+ font-size: 13px;
225
+ left: 50%;
226
+ max-width: calc(var(--peers-switcher-tile, 64px) + 56px);
227
+ overflow: hidden;
228
+ position: absolute;
229
+ text-overflow: ellipsis;
230
+ top: calc(100% + 6px);
231
+ transform: translateX(-50%);
232
+ white-space: nowrap;
233
+ }
234
+
129
235
  /* Keyboard shortcut hints mean nothing on a touch screen without a keyboard. */
130
236
  @media (hover: none) and (pointer: coarse) {
131
237
  .peers-keyboard-hint {
@@ -488,6 +594,11 @@
488
594
  -webkit-text-stroke: 0.35px currentColor;
489
595
  }
490
596
 
597
+ /* An emoji tab icon, the same size as a glyph. */
598
+ .peers-tab > .peers-icon-emoji {
599
+ font-size: 15px;
600
+ }
601
+
491
602
  /* Dark mode: the tile shades are made for white glyphs and sink on the dark strip, so tab icons
492
603
  use brighter, saturated shades of each hue, with at least 3:1 contrast on the strip and the
493
604
  selected tab. */
@@ -1400,3 +1511,219 @@
1400
1511
  padding: 12px 12px 2px;
1401
1512
  }
1402
1513
  }
1514
+
1515
+ /* ─── Group colors and icons ────────────────────────────────────────────
1516
+ Icons from data (Icon), a group's icon and color (GroupIcon, ColorDot), and the color and icon
1517
+ pickers in GroupAppearanceDialog. */
1518
+
1519
+ /* An emoji drawn as an icon: the size of the text around it, like a Bootstrap glyph. */
1520
+ .peers-icon-emoji {
1521
+ display: inline-block;
1522
+ font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
1523
+ font-size: 1em;
1524
+ font-style: normal;
1525
+ line-height: 1;
1526
+ text-align: center;
1527
+ vertical-align: -0.125em;
1528
+ }
1529
+
1530
+ /* A group's icon on a rounded square of its color. */
1531
+ .peers-group-tile {
1532
+ align-items: center;
1533
+ border-radius: 28%;
1534
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
1535
+ display: inline-flex;
1536
+ flex-shrink: 0;
1537
+ justify-content: center;
1538
+ line-height: 1;
1539
+ vertical-align: middle;
1540
+ }
1541
+
1542
+ /* A color dot, ringed so dark colors show on a dark page and pale ones on a light page. */
1543
+ .peers-color-dot {
1544
+ border-radius: 50%;
1545
+ box-shadow: 0 0 0 1px var(--bs-border-color);
1546
+ display: inline-block;
1547
+ flex-shrink: 0;
1548
+ vertical-align: middle;
1549
+ }
1550
+
1551
+ /* The group switcher's dot beside an emoji icon, which keeps its own colors. */
1552
+ .peers-switcher-dot {
1553
+ width: 0.5em;
1554
+ height: 0.5em;
1555
+ margin-left: 0.2em;
1556
+ }
1557
+
1558
+ /* Bounded by the screen (the backdrop pads 12vh above and 16px below), so on a short screen the
1559
+ dialog scrolls and Done stays reachable. */
1560
+ .peers-look-dialog {
1561
+ max-height: calc(88vh - 16px);
1562
+ max-height: calc(100dvh - 12vh - 16px);
1563
+ max-width: 520px;
1564
+ overflow-y: auto;
1565
+ }
1566
+
1567
+ /* The group switcher's create form, with the color and icon pickers: bounded by the screen (its
1568
+ backdrop pads 10vh above), so on a short screen it scrolls and Create stays reachable. */
1569
+ .peers-create-group-panel {
1570
+ max-height: calc(90vh - 16px);
1571
+ max-height: calc(100dvh - 10vh - 16px);
1572
+ overflow-y: auto;
1573
+ }
1574
+
1575
+ .peers-look-dialog .peers-look-layers {
1576
+ display: flex;
1577
+ gap: 6px;
1578
+ margin-bottom: 14px;
1579
+ }
1580
+
1581
+ .peers-look-preview {
1582
+ align-items: center;
1583
+ display: flex;
1584
+ gap: 12px;
1585
+ margin-bottom: 14px;
1586
+ }
1587
+
1588
+ .peers-look-chip {
1589
+ align-items: center;
1590
+ border: 1px solid var(--bs-border-color);
1591
+ border-radius: 999px;
1592
+ display: inline-flex;
1593
+ font-size: 13px;
1594
+ gap: 6px;
1595
+ padding: 2px 10px;
1596
+ }
1597
+
1598
+ .peers-look-section-title {
1599
+ color: var(--bs-secondary-color);
1600
+ font-size: 12px;
1601
+ font-weight: 600;
1602
+ letter-spacing: 0.02em;
1603
+ margin: 12px 0 6px;
1604
+ text-transform: uppercase;
1605
+ }
1606
+
1607
+ /* ColorPicker: named swatches, then a custom color. */
1608
+ .peers-color-swatches {
1609
+ display: flex;
1610
+ flex-wrap: wrap;
1611
+ gap: 8px;
1612
+ }
1613
+
1614
+ .peers-color-swatch {
1615
+ align-items: center;
1616
+ background: none;
1617
+ border: 2px solid transparent;
1618
+ border-radius: 50%;
1619
+ color: #ffffff;
1620
+ display: inline-flex;
1621
+ height: 32px;
1622
+ justify-content: center;
1623
+ padding: 0;
1624
+ width: 32px;
1625
+ }
1626
+
1627
+ .peers-color-swatch > span {
1628
+ align-items: center;
1629
+ border-radius: 50%;
1630
+ box-shadow: 0 0 0 1px var(--bs-border-color);
1631
+ display: inline-flex;
1632
+ height: 24px;
1633
+ justify-content: center;
1634
+ width: 24px;
1635
+ }
1636
+
1637
+ .peers-color-swatch[aria-checked="true"] {
1638
+ border-color: var(--bs-emphasis-color);
1639
+ }
1640
+
1641
+ .peers-color-swatch:focus-visible {
1642
+ outline: 2px solid var(--bs-primary);
1643
+ outline-offset: 2px;
1644
+ }
1645
+
1646
+ .peers-color-swatch-none > span {
1647
+ background: repeating-linear-gradient(45deg, transparent 0 4px, var(--bs-border-color) 4px 5px);
1648
+ color: var(--bs-body-color);
1649
+ }
1650
+
1651
+ .peers-color-custom {
1652
+ align-items: center;
1653
+ display: flex;
1654
+ gap: 8px;
1655
+ margin-top: 10px;
1656
+ }
1657
+
1658
+ .peers-color-custom input[type="color"] {
1659
+ border: 1px solid var(--bs-border-color);
1660
+ border-radius: 6px;
1661
+ height: 32px;
1662
+ padding: 2px;
1663
+ width: 44px;
1664
+ }
1665
+
1666
+ .peers-color-custom input[type="text"] {
1667
+ font-family: var(--bs-font-monospace);
1668
+ max-width: 120px;
1669
+ }
1670
+
1671
+ /* IconPicker: a search box, then sections of results. */
1672
+ .peers-icon-results {
1673
+ max-height: 260px;
1674
+ overflow-y: auto;
1675
+ padding: 2px;
1676
+ }
1677
+
1678
+ .peers-icon-grid {
1679
+ display: grid;
1680
+ gap: 4px;
1681
+ grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
1682
+ }
1683
+
1684
+ .peers-icon-choice {
1685
+ align-items: center;
1686
+ background: none;
1687
+ border: 1px solid transparent;
1688
+ border-radius: 8px;
1689
+ color: var(--bs-body-color);
1690
+ display: inline-flex;
1691
+ font-size: 20px;
1692
+ height: 38px;
1693
+ justify-content: center;
1694
+ padding: 0;
1695
+ position: relative;
1696
+ }
1697
+
1698
+ .peers-icon-choice:hover {
1699
+ background-color: var(--bs-tertiary-bg);
1700
+ }
1701
+
1702
+ .peers-icon-choice:focus-visible {
1703
+ outline: 2px solid var(--bs-primary);
1704
+ outline-offset: 1px;
1705
+ }
1706
+
1707
+ .peers-icon-choice[aria-selected="true"] {
1708
+ background-color: var(--bs-secondary-bg);
1709
+ border-color: var(--bs-emphasis-color);
1710
+ }
1711
+
1712
+ .peers-icon-choice-check {
1713
+ background-color: var(--bs-emphasis-color);
1714
+ border-radius: 50%;
1715
+ color: var(--bs-body-bg);
1716
+ font-size: 9px;
1717
+ height: 14px;
1718
+ line-height: 14px;
1719
+ position: absolute;
1720
+ right: -3px;
1721
+ top: -3px;
1722
+ width: 14px;
1723
+ }
1724
+
1725
+ .peers-icon-empty {
1726
+ color: var(--bs-secondary-color);
1727
+ font-size: 13px;
1728
+ padding: 8px 2px;
1729
+ }
@@ -1,5 +1,6 @@
1
1
  import { z } from "@peers-app/peers-sdk";
2
2
  declare const propsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
3
3
  type IProps = z.infer<typeof propsSchema>;
4
+ /** Browse records when a table has no more specific list screen. */
4
5
  export declare const DefaultListScreen: (_props: IProps) => import("react/jsx-runtime").JSX.Element;
5
6
  export {};
@@ -3,12 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DefaultListScreen = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const peers_sdk_1 = require("@peers-app/peers-sdk");
6
+ const icon_1 = require("../components/icon");
6
7
  const list_screen_1 = require("../components/list-screen");
7
8
  const globals_1 = require("../globals");
8
9
  const ui_loader_1 = require("../ui-router/ui-loader");
9
10
  const propsSchema = peers_sdk_1.z.object({
10
11
  // items: zodAnyObject.array().describe('Items to display in the list'),
11
12
  });
13
+ /** Browse records when a table has no more specific list screen. */
12
14
  const DefaultListScreen = (_props) => {
13
15
  const path = (0, globals_1.mainContentPath)().toLowerCase().trim().split("?")[0].split("#").pop()?.split("/")[0] || "";
14
16
  const fuzzyTableName = ({
@@ -48,7 +50,7 @@ const DefaultListScreen = (_props) => {
48
50
  const row = item;
49
51
  const rowId = row[idField.name];
50
52
  const displayName = row.name;
51
- return ((0, jsx_runtime_1.jsxs)("div", { className: "container-fluid pb-4", children: [(0, jsx_runtime_1.jsx)("i", { className: (0, peers_sdk_1.getIconClassName)(table) }), "\u00A0", (0, jsx_runtime_1.jsx)("a", { href: `#${path}/${String(rowId)}`, children: typeof displayName === "string" ? displayName : "<empty-name>" }), (0, jsx_runtime_1.jsx)("div", { style: { paddingLeft: "20px" } })] }, String(rowId)));
53
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "container-fluid pb-4", children: [(0, jsx_runtime_1.jsx)(icon_1.Icon, { icon: (0, peers_sdk_1.getIconClassName)(table), fallback: "bi:question" }), "\u00A0", (0, jsx_runtime_1.jsx)("a", { href: `#${path}/${String(rowId)}`, children: typeof displayName === "string" ? displayName : "<empty-name>" }), (0, jsx_runtime_1.jsx)("div", { style: { paddingLeft: "20px" } })] }, String(rowId)));
52
54
  } }, path));
53
55
  };
54
56
  exports.DefaultListScreen = DefaultListScreen;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@peers-app/peers-ui",
3
- "version": "0.33.18",
3
+ "version": "0.33.20",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/peers-app/peers-ui.git"
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "scripts": {
22
22
  "clean": "rm -rf dist",
23
- "build": "npm run clean && tsc && cp src/theme.css dist/theme.css",
23
+ "build": "npm run clean && tsc && cp src/theme.css dist/theme.css && cp -R src/icon-index dist/icon-index",
24
24
  "dev": "tsc -w",
25
25
  "clean:build": "npm run clean && npm run build",
26
26
  "release:guard": "node release-guard.js",
@@ -36,7 +36,7 @@
36
36
  "lint:fix": "biome check --write ."
37
37
  },
38
38
  "peerDependencies": {
39
- "@peers-app/peers-sdk": "^0.33.18",
39
+ "@peers-app/peers-sdk": "^0.33.20",
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.18",
50
+ "@peers-app/peers-sdk": "0.33.20",
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",