anentrypoint-design 0.0.256 → 0.0.258
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/app-shell.css +44 -0
- package/chat.css +6 -0
- package/dist/247420.css +50 -0
- package/dist/247420.js +15 -15
- package/package.json +1 -1
- package/src/components/content.js +37 -2
- package/src/components.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "anentrypoint-design",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.258",
|
|
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",
|
|
@@ -355,12 +355,47 @@ export function Manifesto({ paragraphs = [], maxWidth }) {
|
|
|
355
355
|
);
|
|
356
356
|
}
|
|
357
357
|
|
|
358
|
+
// items: [n, label] or [n, label, {delta, tone: 'up'|'down', spark: number[]}]
|
|
359
|
+
// meta is optional and additive — every existing 2-tuple call site is untouched.
|
|
358
360
|
export function Kpi({ items = [], emptyText = 'no metrics yet' }) {
|
|
359
361
|
if (!items.length) return h('div', { class: 'empty' }, emptyText);
|
|
360
|
-
return h('div', { class: 'kpi' }, ...items.map(([n, l], i) =>
|
|
362
|
+
return h('div', { class: 'kpi' }, ...items.map(([n, l, meta], i) =>
|
|
361
363
|
h('div', { key: i, class: 'kpi-card' },
|
|
362
364
|
h('div', { class: 'num' }, String(n)),
|
|
363
|
-
h('div', { class: 'lbl' }, l)
|
|
365
|
+
h('div', { class: 'lbl' }, l),
|
|
366
|
+
meta && (meta.delta != null || meta.spark)
|
|
367
|
+
? h('div', { class: 'kpi-foot' },
|
|
368
|
+
meta.delta != null
|
|
369
|
+
? h('span', { class: 'kpi-delta kpi-delta-' + (meta.tone === 'down' ? 'down' : 'up') },
|
|
370
|
+
Icon(meta.tone === 'down' ? 'arrow-down' : 'arrow-up', { size: 12 }),
|
|
371
|
+
String(meta.delta))
|
|
372
|
+
: null,
|
|
373
|
+
meta.spark ? Sparkline({ values: meta.spark, tone: meta.tone }) : null)
|
|
374
|
+
: null)));
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// Minimal inline SVG trend line — token-stroke only, no raw color literals.
|
|
378
|
+
export function Sparkline({ values = [], width = 72, height = 24, tone }) {
|
|
379
|
+
if (!values.length) return null;
|
|
380
|
+
const max = Math.max(...values), min = Math.min(...values);
|
|
381
|
+
const span = (max - min) || 1;
|
|
382
|
+
const step = width / (values.length - 1 || 1);
|
|
383
|
+
const points = values.map((v, i) => [i * step, height - ((v - min) / span) * height]);
|
|
384
|
+
const d = points.map(([x, y], i) => (i === 0 ? 'M' : 'L') + x.toFixed(1) + ',' + y.toFixed(1)).join(' ');
|
|
385
|
+
return h('svg', { class: 'ds-sparkline ds-sparkline-' + (tone === 'down' ? 'down' : 'up'), viewBox: '0 0 ' + width + ' ' + height, width, height, 'aria-hidden': 'true' },
|
|
386
|
+
h('path', { d, fill: 'none', 'stroke-width': '2', 'stroke-linecap': 'round', 'stroke-linejoin': 'round' }));
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// Horizontal token-only bar breakdown — e.g. revenue by channel, traffic by source.
|
|
390
|
+
export function BarChart({ items = [], emptyText = 'no data yet' }) {
|
|
391
|
+
if (!items.length) return h('div', { class: 'empty' }, emptyText);
|
|
392
|
+
const max = Math.max(...items.map(it => it.value || 0)) || 1;
|
|
393
|
+
return h('div', { class: 'ds-barchart' }, ...items.map((it, i) =>
|
|
394
|
+
h('div', { key: i, class: 'ds-barchart-row' },
|
|
395
|
+
h('div', { class: 'ds-barchart-label' }, it.label),
|
|
396
|
+
h('div', { class: 'ds-barchart-track' },
|
|
397
|
+
h('div', { class: 'ds-barchart-fill', style: '--bar-pct:' + Math.round((it.value / max) * 100) + '%' })),
|
|
398
|
+
h('div', { class: 'ds-barchart-value' }, it.display != null ? it.display : String(it.value)))));
|
|
364
399
|
}
|
|
365
400
|
|
|
366
401
|
export function Table({ headers = [], rows = [], onRowClick, emptyText = 'nothing here yet', rowLabels }) {
|
package/src/components.js
CHANGED
|
@@ -14,7 +14,7 @@ export {
|
|
|
14
14
|
Panel, Card, Row, RowLink, PanelFromItems,
|
|
15
15
|
Hero, HeroFromPageData, Marquee, Install, CliBlock, Receipt, Changelog,
|
|
16
16
|
WorksList, WritingList, Manifesto, Section, PageHeader,
|
|
17
|
-
Kpi, Table, SearchInput, TextField, Select, EventList,
|
|
17
|
+
Kpi, Sparkline, BarChart, Table, SearchInput, TextField, Select, EventList,
|
|
18
18
|
HomeView, ProjectView, Form,
|
|
19
19
|
Spinner, Skeleton, Alert, FilterPills
|
|
20
20
|
} from './components/content.js';
|