anentrypoint-design 0.0.341 → 0.0.342

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anentrypoint-design",
3
- "version": "0.0.341",
3
+ "version": "0.0.342",
4
4
  "description": "247420 design system SDK — webjsx + modified ripple-ui, single-file ESM bundle for reproducible use of the AnEntrypoint design.",
5
5
  "type": "module",
6
6
  "main": "./dist/247420.js",
@@ -84,6 +84,8 @@
84
84
  "lint:ui-kits": "node scripts/generate-ui-kit-scaffolds.mjs --check",
85
85
  "tokens": "node scripts/generate-tokens-json.mjs",
86
86
  "tokens:doc": "node scripts/generate-tokens-json.mjs && node scripts/generate-theme-tokens-doc.mjs",
87
+ "docs:components": "node scripts/generate-component-docs.mjs",
88
+ "lint:component-docs": "node scripts/generate-component-docs.mjs --check",
87
89
  "generate:ui-kits": "node scripts/generate-ui-kit-scaffolds.mjs",
88
90
  "generate:preview-index": "node scripts/generate-preview-index.mjs",
89
91
  "a11y": "node scripts/a11y-audit.mjs",
@@ -37,17 +37,24 @@ export function fmtDuration(ms) {
37
37
  return hrs + 'h ' + (m % 60) + 'm';
38
38
  }
39
39
 
40
- // ConversationList — the Claude-Desktop "Chats" column. Sessions grouped by a
41
- // caller-supplied group label, each row showing title/project, relative time,
42
- // agent badge, and a running/new-event indicator. Selecting a row switches the
43
- // active conversation.
44
- //
45
- // sessions : [{ sid, title, project, agent, time, running, unread, rail }]
46
- // selected : the active sid
47
- // groups : OPTIONAL [{ label, sids:[...] }] to bucket rows; else one flat list
48
- // search : { value, onInput, placeholder } inline filter (optional)
49
- // onSelect(session), onNew() : intents
50
- // emptyText, loading, error : explicit states
40
+ /**
41
+ * The Claude-Desktop "Chats" column. Sessions grouped by a caller-supplied
42
+ * group label, each row showing title/project, relative time, agent badge,
43
+ * and a running/new-event indicator. Selecting a row switches the active
44
+ * conversation.
45
+ *
46
+ * @param {Object} [props]
47
+ * @param {Array<{sid:*, title?:string, project?:string, agent?:string, time?:string, running?:boolean, unread?:boolean, rail?:string}>} [props.sessions=[]]
48
+ * @param {*} [props.selected] - the active sid.
49
+ * @param {Array<{label:string, sids:Array<*>}>} [props.groups] - OPTIONAL buckets for the rows; else one flat list.
50
+ * @param {{value:string, onInput:Function, placeholder?:string}} [props.search] - inline filter (optional).
51
+ * @param {Function} [props.onSelect] - onSelect(session).
52
+ * @param {Function} [props.onNew] - onNew().
53
+ * @param {string} [props.emptyText='No conversations yet']
54
+ * @param {boolean} [props.loading=false]
55
+ * @param {*} [props.error=null]
56
+ * @returns {*} webjsx vnode
57
+ */
51
58
  export function ConversationList({ sessions = [], selected, groups, search, caption,
52
59
  onSelect, onNew, newLabel = 'New chat',
53
60
  emptyText = 'No conversations yet', loading = false, error = null,
@@ -304,11 +311,27 @@ const STREAM_WORD = {
304
311
  lost: 'live stream offline — retrying…',
305
312
  };
306
313
 
307
- // The stop-all / stop-selected danger buttons are two-step (host-driven, the kit
308
- // is stateless): the first click fires onArmStop* so the host flips confirming*
309
- // true and re-renders; the armed button reads 'stop N sessions - press again'
310
- // and only THAT click fires the real onStopAll/onStopSelected. Hosts that wire
311
- // no onArmStop* keep the old single-click behavior.
314
+ /**
315
+ * The live multi-session command center ("Live" dashboard).
316
+ *
317
+ * The stop-all / stop-selected danger buttons are two-step (host-driven, the
318
+ * kit is stateless): the first click fires onArmStop* so the host flips
319
+ * confirming* true and re-renders; the armed button reads 'stop N sessions -
320
+ * press again' and only THAT click fires the real onStopAll/onStopSelected.
321
+ * Hosts that wire no onArmStop* keep the old single-click behavior.
322
+ *
323
+ * @param {Object} [props]
324
+ * @param {Array<Object>} [props.sessions=[]] - session shape: `{ sid, realSid, title, agent, model, cwd, elapsedMs, counter, lastActivity, currentTool, status, stopping, external, isNew, cost, tokens }`.
325
+ * @param {Function} [props.onStop] - onStop(session).
326
+ * @param {Function} [props.onOpen] - onOpen(session).
327
+ * @param {Function} [props.onView] - onView(session).
328
+ * @param {Function} [props.onStopAll]
329
+ * @param {Function} [props.onStopSelected]
330
+ * @param {boolean} [props.confirmingStopAll=false]
331
+ * @param {boolean} [props.confirmingStopSelected=false]
332
+ * @param {'connected'|'connecting'|'lost'|'offline'} [props.streamState]
333
+ * @returns {*} webjsx vnode
334
+ */
312
335
  export function SessionDashboard({ sessions = [], onStop, onOpen, onView, onStopAll, onStopSelected,
313
336
  confirmingStopAll = false, confirmingStopSelected = false,
314
337
  onArmStopAll, onArmStopSelected,
@@ -6,19 +6,54 @@ import * as webjsx from '../../vendor/webjsx/index.js';
6
6
  import { trapTab } from './overlay-primitives.js';
7
7
  const h = webjsx.createElement;
8
8
 
9
+ /**
10
+ * The wordmark used in Topbar/AppShell headers.
11
+ *
12
+ * @param {Object} [props]
13
+ * @param {string} [props.name='247420'] - the brand text.
14
+ * @param {*} [props.leaf] - optional trailing breadcrumb-style leaf, rendered after a " / " separator.
15
+ * @returns {*} webjsx vnode
16
+ */
9
17
  export function Brand({ name = '247420', leaf } = {}) {
10
18
  return h('span', { class: 'brand' }, name,
11
19
  leaf ? h('span', { class: 'slash' }, ' / ') : null,
12
20
  leaf || null);
13
21
  }
14
22
 
23
+ /**
24
+ * A small pill/tag label.
25
+ *
26
+ * @param {Object} props
27
+ * @param {string} [props.tone=''] - semantic color tone (empty = neutral).
28
+ * @param {'sm'|'md'|'lg'} [props.size='md']
29
+ * @param {boolean} [props.tag=false] - true renders a rectangular sentence-case variant for dense data (drops the all-caps pill styling). Orthogonal to tone.
30
+ * @param {*} props.children
31
+ * @returns {*} webjsx vnode
32
+ */
15
33
  export function Chip({ tone = '', size = 'md', tag = false, children }) {
16
- // size: 'sm' | 'md' | 'lg'; tag=true -> rectangular sentence-case variant
17
- // for dense data (drops the all-caps pill). Both are orthogonal to tone.
18
34
  const sizeCls = size === 'sm' ? ' chip--sm' : (size === 'lg' ? ' chip--lg' : '');
19
35
  return h('span', { class: 'chip' + sizeCls + (tag ? ' chip--tag' : '') + (tone ? ' tone-' + tone : '') }, children);
20
36
  }
21
37
 
38
+ /**
39
+ * The standard button/link factory. Renders an `<a>` when `href` is given,
40
+ * otherwise a `<button>`.
41
+ *
42
+ * @param {Object} props
43
+ * @param {string} [props.href] - if present, renders as a link instead of a button.
44
+ * @param {'default'|'primary'|'ghost'|'danger'} [props.variant='default']
45
+ * @param {'sm'|'md'|'lg'} [props.size='md']
46
+ * @param {*} props.children
47
+ * @param {Function} [props.onClick]
48
+ * @param {string} [props['aria-label']]
49
+ * @param {boolean} [props.primary] - legacy alias for variant:'primary', kept for backward compatibility.
50
+ * @param {boolean} [props.ghost] - legacy alias for variant:'ghost'.
51
+ * @param {boolean} [props.danger] - legacy alias for variant:'danger'.
52
+ * @param {boolean} [props.disabled]
53
+ * @param {string} [props.class] - extra class name(s) appended to the generated class list.
54
+ * @param {*} [props.key]
55
+ * @returns {*} webjsx vnode
56
+ */
22
57
  export function Btn({ href, variant = 'default', size = 'md', children, onClick, 'aria-label': ariaLabel, primary, ghost, danger, disabled, class: className, key }) {
23
58
  // Support legacy primary/ghost props for backward compatibility, but prefer variant
24
59
  const resolvedVariant = variant !== 'default' ? variant : (primary ? 'primary' : (ghost ? 'ghost' : (danger ? 'danger' : 'default')));
@@ -576,24 +611,25 @@ function wsCollapsed(which, fallback) {
576
611
  return !!fallback;
577
612
  }
578
613
 
579
- // WorkspaceShell — a Claude-Desktop / cowork three-(or four-)column app shell.
580
- //
581
- // rail : the persistent left workspace nav (icon+label items, collapsible
582
- // to icon-only). Pass the result of WorkspaceRail() or any vnode.
583
- // sessions: an OPTIONAL second column (a conversation/session list) shown
584
- // between the rail and the main content. Null hides it.
585
- // main : the primary content column (chat thread, files view, dashboard...).
586
- // pane : an OPTIONAL right context pane (per-conversation context, file
587
- // preview...). Null hides it; collapsible when present.
588
- // crumb : an optional thin top chrome bar (breadcrumb + status), spanning
589
- // the content area only (the rail has its own header).
590
- // status : an optional footer.
591
- // narrow : caller's isNarrow() drives the mobile single-column collapse.
592
- // railCollapsed / paneCollapsed : initial collapse (persisted state wins).
593
- //
594
- // Pure stateless chrome (props in, vnode out). Collapse is DOM-class + a
595
- // persisted flag, so the host does not have to thread collapse state through its
596
- // own store. Visual styling lives in app-shell.css (.ws-*).
614
+ /**
615
+ * A Claude-Desktop / cowork three-(or four-)column app shell.
616
+ *
617
+ * Pure stateless chrome (props in, vnode out). Collapse is DOM-class + a
618
+ * persisted flag, so the host does not have to thread collapse state through
619
+ * its own store. Visual styling lives in app-shell.css (.ws-*).
620
+ *
621
+ * @param {Object} props
622
+ * @param {*} props.rail - the persistent left workspace nav (icon+label items, collapsible to icon-only). Pass the result of WorkspaceRail() or any vnode.
623
+ * @param {*} props.sessions - an OPTIONAL second column (a conversation/session list) shown between the rail and the main content. Null hides it.
624
+ * @param {*} props.main - the primary content column (chat thread, files view, dashboard...).
625
+ * @param {*} props.pane - an OPTIONAL right context pane (per-conversation context, file preview...). Null hides it; collapsible when present.
626
+ * @param {*} props.crumb - an optional thin top chrome bar (breadcrumb + status), spanning the content area only (the rail has its own header).
627
+ * @param {*} props.status - an optional footer.
628
+ * @param {boolean} props.narrow - caller's isNarrow() — drives the mobile single-column collapse.
629
+ * @param {boolean} props.railCollapsed - initial rail collapse (persisted state wins).
630
+ * @param {boolean} props.paneCollapsed - initial pane collapse (persisted state wins).
631
+ * @returns {*} webjsx vnode
632
+ */
597
633
  export function WorkspaceShell({ rail, sessions, main, pane, crumb, status, narrow,
598
634
  railCollapsed = false, paneCollapsed = false,
599
635
  railLabel = 'workspace navigation',