reifyui 0.7.1 → 0.7.2

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": "reifyui",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "The open-source rendering & interaction layer for agentic applications. Stream and render any agent's output as polished, application-native UI \u2014 model-agnostic, framework-agnostic, design-system-native. The foundation for building generative-UI and agent products.",
5
5
  "keywords": [
6
6
  "react",
@@ -4,12 +4,12 @@
4
4
  // things — a full-width row with a Preview button, and a bare text chip — which is how one surface
5
5
  // ends up with a download affordance the other never got.
6
6
  //
7
- // `compact` is the only difference between them, and it is a size, not a second component: in a
8
- // grid cell there is room for a glyph and a name, so the sub-line and the button labels collapse
9
- // to icons. Everything remains reachable.
10
- import { Fragment } from 'react';
7
+ // There is ONE card. There was briefly a `compact` variant for grid cells, which shrank the
8
+ // actions to two 20px glyphs on a tinted background; it was a worse version of the thing it was
9
+ // a variant of, which is what a variant usually is. A cell narrow enough to need a different card
10
+ // is a cell too narrow to show the file at all — the name ellipsises and the card still works.
11
11
  import { FileTypeIcon, extOf } from './FileTypeIcon.jsx';
12
- import { IcDownload, IcEye } from './icons.jsx';
12
+ import { IcDownload } from './icons.jsx';
13
13
 
14
14
  /** "PPTX · output" — what it is, then where it came from. `origin` is the caller's word. */
15
15
  function subtitle(name, origin, bytes) {
@@ -26,39 +26,33 @@ export function bytesLabel(n) {
26
26
  return `${(n / 1048576).toFixed(1)} MB`;
27
27
  }
28
28
 
29
- export function FileCard({
30
- name, origin, bytes, onPreview, onDownload, compact = false, className = '',
31
- }) {
29
+ export function FileCard({ name, origin = 'output', bytes, onPreview, onDownload, className = '' }) {
32
30
  // The whole card opens the preview, and the eye repeats it as an explicit target — a card that
33
31
  // is clickable without saying so is a card people do not click.
34
32
  const open = onPreview ? (e) => { e.stopPropagation(); onPreview(); } : undefined;
35
33
  return (
36
- <div className={'uic-filecard' + (compact ? ' is-compact' : '') + (open ? ' is-clickable' : '')
37
- + (className ? ' ' + className : '')}
34
+ <div className={'uic-filecard' + (open ? ' is-clickable' : '') + (className ? ' ' + className : '')}
38
35
  onClick={open}
39
36
  role={open ? 'button' : undefined}
40
37
  tabIndex={open ? 0 : undefined}
41
38
  onKeyDown={open ? (e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); open(e); } } : undefined}
42
39
  title={name}>
43
- <span className="uic-filecard-ic"><FileTypeIcon name={name} size={compact ? 20 : 30} /></span>
40
+ <span className="uic-filecard-ic"><FileTypeIcon name={name} size={32} /></span>
44
41
  <span className="uic-filecard-meta">
45
42
  <span className="uic-filecard-name">{name}</span>
46
- {!compact && <span className="uic-filecard-sub">{subtitle(name, origin, bytes)}</span>}
43
+ <span className="uic-filecard-sub">{subtitle(name, origin, bytes)}</span>
47
44
  </span>
48
- <Fragment>
49
- {onDownload && (
50
- <button type="button" className="uic-filecard-btn" aria-label={`Download ${name}`} title="Download"
51
- onClick={(e) => { e.stopPropagation(); onDownload(); }}>
52
- <IcDownload />
53
- </button>
54
- )}
55
- {onPreview && (
56
- <button type="button" className="uic-filecard-btn" aria-label={`Preview ${name}`} title="Preview"
57
- onClick={open}>
58
- <IcEye />
59
- </button>
60
- )}
61
- </Fragment>
45
+ {onDownload && (
46
+ <button type="button" className="uic-filecard-dl" aria-label={`Download ${name}`} title="Download"
47
+ onClick={(e) => { e.stopPropagation(); onDownload(); }}>
48
+ <IcDownload size={18} />
49
+ </button>
50
+ )}
51
+ {onPreview && (
52
+ <button type="button" className="uic-filecard-open" aria-label={`Preview ${name}`} onClick={open}>
53
+ Preview
54
+ </button>
55
+ )}
62
56
  </div>
63
57
  );
64
58
  }
package/styles/file.css CHANGED
@@ -23,25 +23,24 @@
23
23
  display: block; margin-top: 2px; font-size: 12px; color: var(--uic-mute, #5B5D66);
24
24
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
25
25
  }
26
- .uic-filecard-btn {
27
- width: 28px; height: 28px; flex: 0 0 auto; border-radius: 8px;
26
+ .uic-filecard-dl {
27
+ width: 34px; height: 34px; flex: 0 0 auto; border-radius: 9px;
28
28
  display: inline-flex; align-items: center; justify-content: center;
29
29
  border: 1px solid transparent; background: transparent; cursor: pointer;
30
30
  color: var(--uic-mute, #5B5D66);
31
31
  }
32
- .uic-filecard-btn:hover { background: var(--uic-brand-faint, #EFF3FF); color: var(--uic-brand, #285AFF); }
32
+ .uic-filecard-dl:hover { background: var(--uic-brand-faint, #EFF3FF); color: var(--uic-brand, #285AFF); }
33
+ .uic-filecard-open {
34
+ flex: 0 0 auto; font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
35
+ white-space: nowrap; padding: 7px 15px; border-radius: 9px;
36
+ color: var(--uic-brand, #285AFF); background: var(--uic-surface, #FFFFFF);
37
+ border: 1px solid var(--uic-line, #DDDFE6);
38
+ }
39
+ .uic-filecard-open:hover { border-color: var(--uic-brand-soft, #E1E9FF); background: var(--uic-brand-faint, #EFF3FF); }
40
+ .uic-filecard-dl:focus-visible, .uic-filecard-open:focus-visible {
41
+ outline: 2px solid var(--uic-brand, #285AFF); outline-offset: 2px;
42
+ }
33
43
 
34
- /* Compact is a size, not a second component: in a grid cell there is room for a glyph and a name,
35
- so the sub-line goes and the buttons appear on hover. Everything stays reachable by keyboard. */
36
- .uic-filecard.is-compact {
37
- gap: 6px; padding: 3px 5px; border-radius: 8px; box-shadow: none;
38
- background: var(--uic-brand-faint, #EFF3FF); border-color: transparent;
39
- max-width: 100%;
40
- }
41
- .uic-filecard.is-compact .uic-filecard-name { font-size: 11.5px; font-weight: 500; }
42
- .uic-filecard.is-compact .uic-filecard-btn { width: 20px; height: 20px; opacity: 0; }
43
- .uic-filecard.is-compact:hover .uic-filecard-btn,
44
- .uic-filecard.is-compact:focus-within .uic-filecard-btn { opacity: 1; }
45
44
 
46
45
  /* The fallback glyph, for a build without react-file-icon. A file with no icon still has to be
47
46
  identifiable, so the extension itself is the icon. */