@fgv/ts-app-shell 5.1.0-11 → 5.1.0-14

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.
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright (c) 2026 Erik Fortune
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ export { renderStatusBadge } from './renderStatusBadge';
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,44 @@
1
+ /*
2
+ * Copyright (c) 2026 Erik Fortune
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in all
12
+ * copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+ import React from 'react';
23
+ const BADGE_COUNT_BASE_CLASSES = 'ml-1.5 min-w-4 px-1.5 py-0.5 text-[0.6875rem] inline-flex shrink-0 items-center justify-center rounded-full font-medium leading-none';
24
+ const BADGE_DOT_BASE_CLASSES = 'ml-1.5 h-2 w-2 inline-block shrink-0 rounded-full';
25
+ const BADGE_COUNT_TONE_CLASSES = {
26
+ info: 'bg-status-info-bg text-status-info-text',
27
+ warning: 'bg-status-warning-bg text-status-warning-text',
28
+ danger: 'bg-status-error-bg text-status-error-text'
29
+ };
30
+ const BADGE_DOT_TONE_CLASSES = {
31
+ info: 'bg-status-info-icon',
32
+ warning: 'bg-status-warning-icon',
33
+ danger: 'bg-status-error-icon'
34
+ };
35
+ export function renderStatusBadge(badge) {
36
+ var _a, _b;
37
+ const tone = (_a = badge.tone) !== null && _a !== void 0 ? _a : 'info';
38
+ const ariaLabel = badge.ariaLabel;
39
+ if (badge.kind === 'dot') {
40
+ return (React.createElement("span", { className: `${BADGE_DOT_BASE_CLASSES} ${BADGE_DOT_TONE_CLASSES[tone]}`, "aria-label": ariaLabel }));
41
+ }
42
+ return (React.createElement("span", { className: `${BADGE_COUNT_BASE_CLASSES} ${BADGE_COUNT_TONE_CLASSES[tone]}`, "aria-label": ariaLabel }, (_b = badge.count) !== null && _b !== void 0 ? _b : 0));
43
+ }
44
+ //# sourceMappingURL=renderStatusBadge.js.map
@@ -29,22 +29,8 @@
29
29
  */
30
30
  import React, { useCallback, useEffect, useRef, useState } from 'react';
31
31
  import { StarIcon as StarIconOutline } from '@heroicons/react/24/outline';
32
- import { StarIcon as StarIconSolid, ExclamationTriangleIcon, BuildingLibraryIcon, ShieldCheckIcon, ShieldExclamationIcon, ArrowDownTrayIcon, PencilSquareIcon, ArrowsPointingInIcon, TrashIcon, FolderPlusIcon, ArchiveBoxArrowDownIcon, FolderOpenIcon, ArrowUpTrayIcon, PlusIcon, ChevronRightIcon } from '@heroicons/react/20/solid';
33
- const BADGE_BASE_CLASSES = 'inline-flex shrink-0 items-center justify-center rounded-full font-medium leading-none';
34
- const BADGE_TONE_CLASSES = {
35
- info: 'bg-status-info-bg text-status-info-text',
36
- warning: 'bg-status-warning-bg text-status-warning-text',
37
- danger: 'bg-status-error-bg text-status-error-text'
38
- };
39
- function renderBadge(badge) {
40
- var _a, _b;
41
- const tone = (_a = badge.tone) !== null && _a !== void 0 ? _a : 'info';
42
- const ariaLabel = badge.ariaLabel;
43
- if (badge.kind === 'dot') {
44
- return (React.createElement("span", { className: `ml-1.5 h-2 w-2 ${BADGE_BASE_CLASSES} ${BADGE_TONE_CLASSES[tone]}`, "aria-label": ariaLabel }));
45
- }
46
- return (React.createElement("span", { className: `ml-1.5 min-w-4 px-1.5 py-0.5 text-[0.6875rem] ${BADGE_BASE_CLASSES} ${BADGE_TONE_CLASSES[tone]}`, "aria-label": ariaLabel }, (_b = badge.count) !== null && _b !== void 0 ? _b : 0));
47
- }
32
+ import { StarIcon as StarIconSolid, ExclamationTriangleIcon, BuildingLibraryIcon, BuildingStorefrontIcon, ShieldCheckIcon, ShieldExclamationIcon, ArrowDownTrayIcon, PencilSquareIcon, ArrowsPointingInIcon, TrashIcon, FolderPlusIcon, ArchiveBoxArrowDownIcon, FolderOpenIcon, ArrowUpTrayIcon, PlusIcon, ChevronRightIcon } from '@heroicons/react/20/solid';
33
+ import { renderStatusBadge } from '../badge';
48
34
  // ============================================================================
49
35
  // Context Menu (internal)
50
36
  // ============================================================================
@@ -96,7 +82,7 @@ function useLongPress(onLongPress) {
96
82
  // CollectionRow (internal)
97
83
  // ============================================================================
98
84
  function CollectionRow(props) {
99
- var _a;
85
+ var _a, _b, _c;
100
86
  const { collection, onToggleVisibility, onSetDefault, onDelete, onExport, onUnlock, onRename, onMerge, borderColorClass, onContextMenu, isHiddenRow } = props;
101
87
  const displayName = (_a = collection.name) !== null && _a !== void 0 ? _a : collection.id;
102
88
  const handleContextMenu = useCallback((e) => {
@@ -127,8 +113,7 @@ function CollectionRow(props) {
127
113
  : 'Set as default collection for new items', "aria-label": collection.isDefault ? `${displayName} is default` : `Set ${displayName} as default`, "aria-pressed": collection.isDefault }, collection.isDefault ? (React.createElement(StarIconSolid, { className: "w-4 h-4" })) : (React.createElement(StarIconOutline, { className: "w-4 h-4" })))),
128
114
  collection.hasConflict && (React.createElement("span", { className: "shrink-0 text-status-warning-strong cursor-default", title: "An encrypted copy of this collection from another storage root has the same ID. Go to Settings \u2192 Storage to resolve the conflict.", "aria-label": `Conflict: encrypted shadow for ${displayName}` },
129
115
  React.createElement(ExclamationTriangleIcon, { className: "w-4 h-4" }))),
130
- !collection.isMutable && (React.createElement("span", { className: "shrink-0 text-muted", title: "Built-in collection (read-only)" },
131
- React.createElement(BuildingLibraryIcon, { className: "w-4 h-4" }))),
116
+ !collection.isMutable && (React.createElement("span", { className: "shrink-0 text-muted", title: (_b = collection.readOnlyLabel) !== null && _b !== void 0 ? _b : 'Built-in collection (read-only)' }, collection.isDeletable ? (React.createElement(BuildingStorefrontIcon, { className: "w-4 h-4" })) : (React.createElement(BuildingLibraryIcon, { className: "w-4 h-4" })))),
132
117
  collection.isProtected &&
133
118
  (collection.isUnlocked || !onUnlock ? (React.createElement("span", { className: `shrink-0 ${collection.isUnlocked ? 'text-status-success-icon' : 'text-muted'}`, title: collection.isUnlocked ? 'Protected (unlocked)' : 'Protected (locked)' }, collection.isUnlocked ? (React.createElement(ShieldCheckIcon, { className: "w-4 h-4" })) : (React.createElement(ShieldExclamationIcon, { className: "w-4 h-4" })))) : (React.createElement("button", { onClick: (e) => {
134
119
  e.stopPropagation();
@@ -136,7 +121,7 @@ function CollectionRow(props) {
136
121
  }, className: "shrink-0 text-muted hover:text-star transition-colors", title: "Click to unlock", "aria-label": `Unlock ${displayName}` },
137
122
  React.createElement(ShieldExclamationIcon, { className: "w-4 h-4" })))),
138
123
  React.createElement("span", { className: "flex-1 truncate", title: displayName }, displayName),
139
- collection.badge && renderBadge(collection.badge),
124
+ collection.badge && renderStatusBadge(collection.badge),
140
125
  React.createElement("span", { className: "shrink-0 text-xs text-muted" }, collection.itemCount)),
141
126
  React.createElement("div", { className: "flex items-center gap-1 mt-1 ml-[24px]" },
142
127
  collection.isMutable && onExport && (React.createElement("button", { onClick: (e) => {
@@ -154,12 +139,12 @@ function CollectionRow(props) {
154
139
  onMerge(collection.id);
155
140
  }, className: "shrink-0 w-5 h-5 flex items-center justify-center text-faint hover:text-brand-accent transition-colors", title: `Merge ${displayName} into another collection`, "aria-label": `Merge ${displayName}` },
156
141
  React.createElement(ArrowsPointingInIcon, { className: "w-4 h-4" }))),
157
- collection.isMutable && onDelete && (React.createElement("button", { onClick: (e) => {
142
+ (collection.isMutable || collection.isDeletable) && onDelete && (React.createElement("button", { onClick: (e) => {
158
143
  e.stopPropagation();
159
144
  onDelete(collection.id);
160
145
  }, className: "shrink-0 w-5 h-5 flex items-center justify-center text-faint hover:text-status-error-icon transition-colors", title: `Remove ${displayName}`, "aria-label": `Remove ${displayName}` },
161
146
  React.createElement(TrashIcon, { className: "w-4 h-4" }))),
162
- !collection.isMutable && React.createElement("span", { className: "text-xs text-muted" }, "(built-in)"))));
147
+ !collection.isMutable && (React.createElement("span", { className: "text-xs text-muted" }, (_c = collection.readOnlyLabel) !== null && _c !== void 0 ? _c : '(built-in)')))));
163
148
  }
164
149
  // ============================================================================
165
150
  // CollectionSection
@@ -20,21 +20,7 @@
20
20
  * SOFTWARE.
21
21
  */
22
22
  import React from 'react';
23
- const BADGE_BASE_CLASSES = 'inline-flex shrink-0 items-center justify-center rounded-full font-medium leading-none';
24
- const BADGE_TONE_CLASSES = {
25
- info: 'bg-status-info-bg text-status-info-text',
26
- warning: 'bg-status-warning-bg text-status-warning-text',
27
- danger: 'bg-status-error-bg text-status-error-text'
28
- };
29
- function renderBadge(badge) {
30
- var _a, _b;
31
- const tone = (_a = badge.tone) !== null && _a !== void 0 ? _a : 'info';
32
- const ariaLabel = badge.ariaLabel;
33
- if (badge.kind === 'dot') {
34
- return (React.createElement("span", { className: `ml-1.5 h-2 w-2 ${BADGE_BASE_CLASSES} ${BADGE_TONE_CLASSES[tone]}`, "aria-label": ariaLabel }));
35
- }
36
- return (React.createElement("span", { className: `ml-1.5 min-w-4 px-1.5 py-0.5 text-[0.6875rem] ${BADGE_BASE_CLASSES} ${BADGE_TONE_CLASSES[tone]}`, "aria-label": ariaLabel }, (_b = badge.count) !== null && _b !== void 0 ? _b : 0));
37
- }
23
+ import { renderStatusBadge } from '../badge';
38
24
  /**
39
25
  * Second-level tab bar for switching views within a mode.
40
26
  * @public
@@ -46,7 +32,7 @@ export function TabBar(props) {
46
32
  ? 'bg-white/20 text-white'
47
33
  : 'text-white/60 hover:text-white hover:bg-white/10'}`, "aria-current": activeTab === tab.id ? 'page' : undefined },
48
34
  React.createElement("span", null, tab.label),
49
- tab.badge && renderBadge(tab.badge)))),
35
+ tab.badge && renderStatusBadge(tab.badge)))),
50
36
  rightContent !== undefined && (React.createElement(React.Fragment, null,
51
37
  React.createElement("div", { className: "flex-1" }),
52
38
  rightContent))));
@@ -0,0 +1,2 @@
1
+ export { renderStatusBadge } from './renderStatusBadge';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2026 Erik Fortune
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in all
13
+ * copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.renderStatusBadge = void 0;
25
+ var renderStatusBadge_1 = require("./renderStatusBadge");
26
+ Object.defineProperty(exports, "renderStatusBadge", { enumerable: true, get: function () { return renderStatusBadge_1.renderStatusBadge; } });
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ type BadgeTone = 'info' | 'warning' | 'danger';
3
+ interface IBadgeLike {
4
+ readonly kind: 'dot' | 'count';
5
+ readonly tone?: BadgeTone;
6
+ readonly count?: number;
7
+ readonly ariaLabel?: string;
8
+ }
9
+ export declare function renderStatusBadge(badge: IBadgeLike): React.ReactElement;
10
+ export {};
11
+ //# sourceMappingURL=renderStatusBadge.d.ts.map
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright (c) 2026 Erik Fortune
4
+ *
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
11
+ *
12
+ * The above copyright notice and this permission notice shall be included in all
13
+ * copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ * SOFTWARE.
22
+ */
23
+ var __importDefault = (this && this.__importDefault) || function (mod) {
24
+ return (mod && mod.__esModule) ? mod : { "default": mod };
25
+ };
26
+ Object.defineProperty(exports, "__esModule", { value: true });
27
+ exports.renderStatusBadge = renderStatusBadge;
28
+ const react_1 = __importDefault(require("react"));
29
+ const BADGE_COUNT_BASE_CLASSES = 'ml-1.5 min-w-4 px-1.5 py-0.5 text-[0.6875rem] inline-flex shrink-0 items-center justify-center rounded-full font-medium leading-none';
30
+ const BADGE_DOT_BASE_CLASSES = 'ml-1.5 h-2 w-2 inline-block shrink-0 rounded-full';
31
+ const BADGE_COUNT_TONE_CLASSES = {
32
+ info: 'bg-status-info-bg text-status-info-text',
33
+ warning: 'bg-status-warning-bg text-status-warning-text',
34
+ danger: 'bg-status-error-bg text-status-error-text'
35
+ };
36
+ const BADGE_DOT_TONE_CLASSES = {
37
+ info: 'bg-status-info-icon',
38
+ warning: 'bg-status-warning-icon',
39
+ danger: 'bg-status-error-icon'
40
+ };
41
+ function renderStatusBadge(badge) {
42
+ var _a, _b;
43
+ const tone = (_a = badge.tone) !== null && _a !== void 0 ? _a : 'info';
44
+ const ariaLabel = badge.ariaLabel;
45
+ if (badge.kind === 'dot') {
46
+ return (react_1.default.createElement("span", { className: `${BADGE_DOT_BASE_CLASSES} ${BADGE_DOT_TONE_CLASSES[tone]}`, "aria-label": ariaLabel }));
47
+ }
48
+ return (react_1.default.createElement("span", { className: `${BADGE_COUNT_BASE_CLASSES} ${BADGE_COUNT_TONE_CLASSES[tone]}`, "aria-label": ariaLabel }, (_b = badge.count) !== null && _b !== void 0 ? _b : 0));
49
+ }
50
+ //# sourceMappingURL=renderStatusBadge.js.map
@@ -49,6 +49,17 @@ export interface ICollectionRowItem {
49
49
  readonly sourceName?: string;
50
50
  /** Optional badge rendered alongside the collection name */
51
51
  readonly badge?: ICollectionBadge;
52
+ /**
53
+ * Label shown for immutable collections. Defaults to `"(built-in)"` when
54
+ * omitted. Set to e.g. `"(trading post)"` for imported read-only content.
55
+ */
56
+ readonly readOnlyLabel?: string;
57
+ /**
58
+ * When true, the collection can be deleted even though it is not mutable.
59
+ * Use for user-imported read-only content (e.g., Trading Post collections)
60
+ * that the user should be able to remove but not edit.
61
+ */
62
+ readonly isDeletable?: boolean;
52
63
  }
53
64
  /**
54
65
  * Props for the CollectionSection component.
@@ -66,21 +66,7 @@ exports.CollectionSection = CollectionSection;
66
66
  const react_1 = __importStar(require("react"));
67
67
  const outline_1 = require("@heroicons/react/24/outline");
68
68
  const solid_1 = require("@heroicons/react/20/solid");
69
- const BADGE_BASE_CLASSES = 'inline-flex shrink-0 items-center justify-center rounded-full font-medium leading-none';
70
- const BADGE_TONE_CLASSES = {
71
- info: 'bg-status-info-bg text-status-info-text',
72
- warning: 'bg-status-warning-bg text-status-warning-text',
73
- danger: 'bg-status-error-bg text-status-error-text'
74
- };
75
- function renderBadge(badge) {
76
- var _a, _b;
77
- const tone = (_a = badge.tone) !== null && _a !== void 0 ? _a : 'info';
78
- const ariaLabel = badge.ariaLabel;
79
- if (badge.kind === 'dot') {
80
- return (react_1.default.createElement("span", { className: `ml-1.5 h-2 w-2 ${BADGE_BASE_CLASSES} ${BADGE_TONE_CLASSES[tone]}`, "aria-label": ariaLabel }));
81
- }
82
- return (react_1.default.createElement("span", { className: `ml-1.5 min-w-4 px-1.5 py-0.5 text-[0.6875rem] ${BADGE_BASE_CLASSES} ${BADGE_TONE_CLASSES[tone]}`, "aria-label": ariaLabel }, (_b = badge.count) !== null && _b !== void 0 ? _b : 0));
83
- }
69
+ const badge_1 = require("../badge");
84
70
  // ============================================================================
85
71
  // Context Menu (internal)
86
72
  // ============================================================================
@@ -132,7 +118,7 @@ function useLongPress(onLongPress) {
132
118
  // CollectionRow (internal)
133
119
  // ============================================================================
134
120
  function CollectionRow(props) {
135
- var _a;
121
+ var _a, _b, _c;
136
122
  const { collection, onToggleVisibility, onSetDefault, onDelete, onExport, onUnlock, onRename, onMerge, borderColorClass, onContextMenu, isHiddenRow } = props;
137
123
  const displayName = (_a = collection.name) !== null && _a !== void 0 ? _a : collection.id;
138
124
  const handleContextMenu = (0, react_1.useCallback)((e) => {
@@ -163,8 +149,7 @@ function CollectionRow(props) {
163
149
  : 'Set as default collection for new items', "aria-label": collection.isDefault ? `${displayName} is default` : `Set ${displayName} as default`, "aria-pressed": collection.isDefault }, collection.isDefault ? (react_1.default.createElement(solid_1.StarIcon, { className: "w-4 h-4" })) : (react_1.default.createElement(outline_1.StarIcon, { className: "w-4 h-4" })))),
164
150
  collection.hasConflict && (react_1.default.createElement("span", { className: "shrink-0 text-status-warning-strong cursor-default", title: "An encrypted copy of this collection from another storage root has the same ID. Go to Settings \u2192 Storage to resolve the conflict.", "aria-label": `Conflict: encrypted shadow for ${displayName}` },
165
151
  react_1.default.createElement(solid_1.ExclamationTriangleIcon, { className: "w-4 h-4" }))),
166
- !collection.isMutable && (react_1.default.createElement("span", { className: "shrink-0 text-muted", title: "Built-in collection (read-only)" },
167
- react_1.default.createElement(solid_1.BuildingLibraryIcon, { className: "w-4 h-4" }))),
152
+ !collection.isMutable && (react_1.default.createElement("span", { className: "shrink-0 text-muted", title: (_b = collection.readOnlyLabel) !== null && _b !== void 0 ? _b : 'Built-in collection (read-only)' }, collection.isDeletable ? (react_1.default.createElement(solid_1.BuildingStorefrontIcon, { className: "w-4 h-4" })) : (react_1.default.createElement(solid_1.BuildingLibraryIcon, { className: "w-4 h-4" })))),
168
153
  collection.isProtected &&
169
154
  (collection.isUnlocked || !onUnlock ? (react_1.default.createElement("span", { className: `shrink-0 ${collection.isUnlocked ? 'text-status-success-icon' : 'text-muted'}`, title: collection.isUnlocked ? 'Protected (unlocked)' : 'Protected (locked)' }, collection.isUnlocked ? (react_1.default.createElement(solid_1.ShieldCheckIcon, { className: "w-4 h-4" })) : (react_1.default.createElement(solid_1.ShieldExclamationIcon, { className: "w-4 h-4" })))) : (react_1.default.createElement("button", { onClick: (e) => {
170
155
  e.stopPropagation();
@@ -172,7 +157,7 @@ function CollectionRow(props) {
172
157
  }, className: "shrink-0 text-muted hover:text-star transition-colors", title: "Click to unlock", "aria-label": `Unlock ${displayName}` },
173
158
  react_1.default.createElement(solid_1.ShieldExclamationIcon, { className: "w-4 h-4" })))),
174
159
  react_1.default.createElement("span", { className: "flex-1 truncate", title: displayName }, displayName),
175
- collection.badge && renderBadge(collection.badge),
160
+ collection.badge && (0, badge_1.renderStatusBadge)(collection.badge),
176
161
  react_1.default.createElement("span", { className: "shrink-0 text-xs text-muted" }, collection.itemCount)),
177
162
  react_1.default.createElement("div", { className: "flex items-center gap-1 mt-1 ml-[24px]" },
178
163
  collection.isMutable && onExport && (react_1.default.createElement("button", { onClick: (e) => {
@@ -190,12 +175,12 @@ function CollectionRow(props) {
190
175
  onMerge(collection.id);
191
176
  }, className: "shrink-0 w-5 h-5 flex items-center justify-center text-faint hover:text-brand-accent transition-colors", title: `Merge ${displayName} into another collection`, "aria-label": `Merge ${displayName}` },
192
177
  react_1.default.createElement(solid_1.ArrowsPointingInIcon, { className: "w-4 h-4" }))),
193
- collection.isMutable && onDelete && (react_1.default.createElement("button", { onClick: (e) => {
178
+ (collection.isMutable || collection.isDeletable) && onDelete && (react_1.default.createElement("button", { onClick: (e) => {
194
179
  e.stopPropagation();
195
180
  onDelete(collection.id);
196
181
  }, className: "shrink-0 w-5 h-5 flex items-center justify-center text-faint hover:text-status-error-icon transition-colors", title: `Remove ${displayName}`, "aria-label": `Remove ${displayName}` },
197
182
  react_1.default.createElement(solid_1.TrashIcon, { className: "w-4 h-4" }))),
198
- !collection.isMutable && react_1.default.createElement("span", { className: "text-xs text-muted" }, "(built-in)"))));
183
+ !collection.isMutable && (react_1.default.createElement("span", { className: "text-xs text-muted" }, (_c = collection.readOnlyLabel) !== null && _c !== void 0 ? _c : '(built-in)')))));
199
184
  }
200
185
  // ============================================================================
201
186
  // CollectionSection
@@ -26,21 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  Object.defineProperty(exports, "__esModule", { value: true });
27
27
  exports.TabBar = TabBar;
28
28
  const react_1 = __importDefault(require("react"));
29
- const BADGE_BASE_CLASSES = 'inline-flex shrink-0 items-center justify-center rounded-full font-medium leading-none';
30
- const BADGE_TONE_CLASSES = {
31
- info: 'bg-status-info-bg text-status-info-text',
32
- warning: 'bg-status-warning-bg text-status-warning-text',
33
- danger: 'bg-status-error-bg text-status-error-text'
34
- };
35
- function renderBadge(badge) {
36
- var _a, _b;
37
- const tone = (_a = badge.tone) !== null && _a !== void 0 ? _a : 'info';
38
- const ariaLabel = badge.ariaLabel;
39
- if (badge.kind === 'dot') {
40
- return (react_1.default.createElement("span", { className: `ml-1.5 h-2 w-2 ${BADGE_BASE_CLASSES} ${BADGE_TONE_CLASSES[tone]}`, "aria-label": ariaLabel }));
41
- }
42
- return (react_1.default.createElement("span", { className: `ml-1.5 min-w-4 px-1.5 py-0.5 text-[0.6875rem] ${BADGE_BASE_CLASSES} ${BADGE_TONE_CLASSES[tone]}`, "aria-label": ariaLabel }, (_b = badge.count) !== null && _b !== void 0 ? _b : 0));
43
- }
29
+ const badge_1 = require("../badge");
44
30
  /**
45
31
  * Second-level tab bar for switching views within a mode.
46
32
  * @public
@@ -52,7 +38,7 @@ function TabBar(props) {
52
38
  ? 'bg-white/20 text-white'
53
39
  : 'text-white/60 hover:text-white hover:bg-white/10'}`, "aria-current": activeTab === tab.id ? 'page' : undefined },
54
40
  react_1.default.createElement("span", null, tab.label),
55
- tab.badge && renderBadge(tab.badge)))),
41
+ tab.badge && (0, badge_1.renderStatusBadge)(tab.badge)))),
56
42
  rightContent !== undefined && (react_1.default.createElement(react_1.default.Fragment, null,
57
43
  react_1.default.createElement("div", { className: "flex-1" }),
58
44
  rightContent))));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fgv/ts-app-shell",
3
- "version": "5.1.0-11",
3
+ "version": "5.1.0-14",
4
4
  "description": "Shared React UI primitives for application shells: column cascade, sidebar, toast/log messages, command palette, keybinding registry",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -17,8 +17,8 @@
17
17
  "dependencies": {
18
18
  "@heroicons/react": "~2.2.0",
19
19
  "tslib": "^2.8.1",
20
- "@fgv/ts-utils": "5.1.0-11",
21
- "@fgv/ts-extras": "5.1.0-11"
20
+ "@fgv/ts-utils": "5.1.0-14",
21
+ "@fgv/ts-extras": "5.1.0-14"
22
22
  },
23
23
  "peerDependencies": {
24
24
  "react": ">=18.0.0",
@@ -51,8 +51,8 @@
51
51
  "@rushstack/heft-jest-plugin": "1.2.6",
52
52
  "@testing-library/dom": "^10.4.0",
53
53
  "@rushstack/heft-node-rig": "2.11.27",
54
- "@fgv/heft-dual-rig": "5.1.0-11",
55
- "@fgv/ts-utils-jest": "5.1.0-11"
54
+ "@fgv/heft-dual-rig": "5.1.0-14",
55
+ "@fgv/ts-utils-jest": "5.1.0-14"
56
56
  },
57
57
  "exports": {
58
58
  ".": {