@ponchia/ui 0.4.0 → 0.5.0
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/CHANGELOG.md +352 -12
- package/MIGRATIONS.json +92 -0
- package/README.md +27 -17
- package/annotations/index.d.ts +280 -0
- package/annotations/index.js +522 -0
- package/behaviors/carousel.js +197 -0
- package/behaviors/combobox.js +195 -0
- package/behaviors/command.js +187 -0
- package/behaviors/connectors.js +96 -0
- package/behaviors/crosshair.js +58 -0
- package/behaviors/dialog.js +73 -0
- package/behaviors/disclosure.js +25 -0
- package/behaviors/dismissible.js +24 -0
- package/behaviors/forms.js +158 -0
- package/behaviors/glyph.js +109 -0
- package/behaviors/index.d.ts +82 -1
- package/behaviors/index.js +18 -1336
- package/behaviors/internal.js +50 -0
- package/behaviors/legend.js +46 -0
- package/behaviors/menu.js +46 -0
- package/behaviors/popover.js +108 -0
- package/behaviors/spotlight.js +53 -0
- package/behaviors/table.js +109 -0
- package/behaviors/tabs.js +103 -0
- package/behaviors/theme.js +82 -0
- package/behaviors/toast.js +152 -0
- package/classes/index.d.ts +318 -0
- package/classes/index.js +352 -0
- package/classes/vscode.css-custom-data.json +18 -14
- package/connectors/index.d.ts +71 -0
- package/connectors/index.js +179 -0
- package/css/analytical.css +21 -0
- package/css/annotations.css +292 -0
- package/css/command.css +97 -0
- package/css/connectors.css +93 -0
- package/css/crosshair.css +100 -0
- package/css/disclosure.css +29 -0
- package/css/dots.css +2 -0
- package/css/feedback.css +104 -0
- package/css/fonts.css +11 -7
- package/css/generated.css +117 -0
- package/css/legend.css +268 -0
- package/css/marks.css +144 -0
- package/css/motion.css +88 -0
- package/css/overlay.css +52 -1
- package/css/primitives.css +18 -0
- package/css/report.css +363 -0
- package/css/selection.css +46 -0
- package/css/sources.css +179 -0
- package/css/spotlight.css +104 -0
- package/css/state.css +121 -0
- package/css/tokens.css +78 -60
- package/css/workbench.css +83 -0
- package/dist/bronto.css +1 -1
- package/dist/css/analytical.css +1 -0
- package/dist/css/annotations.css +1 -0
- package/dist/css/command.css +1 -0
- package/dist/css/connectors.css +1 -0
- package/dist/css/crosshair.css +1 -0
- package/dist/css/disclosure.css +1 -1
- package/dist/css/dots.css +1 -1
- package/dist/css/feedback.css +1 -1
- package/dist/css/fonts.css +1 -1
- package/dist/css/generated.css +1 -0
- package/dist/css/legend.css +1 -0
- package/dist/css/marks.css +1 -0
- package/dist/css/motion.css +1 -1
- package/dist/css/overlay.css +1 -1
- package/dist/css/primitives.css +1 -1
- package/dist/css/report.css +1 -0
- package/dist/css/selection.css +1 -0
- package/dist/css/sources.css +1 -0
- package/dist/css/spotlight.css +1 -0
- package/dist/css/state.css +1 -0
- package/dist/css/tokens.css +1 -1
- package/dist/css/workbench.css +1 -0
- package/docs/adr/0001-color-system.md +26 -27
- package/docs/adr/0002-scope-and-2026-baseline.md +104 -0
- package/docs/adr/0003-theme-model.md +97 -0
- package/docs/annotations.md +345 -0
- package/docs/architecture.md +202 -0
- package/docs/command.md +95 -0
- package/docs/connectors.md +91 -0
- package/docs/contrast.md +42 -42
- package/docs/crosshair.md +63 -0
- package/docs/generated.md +91 -0
- package/docs/legends.md +168 -0
- package/docs/marks.md +86 -0
- package/docs/reference.md +418 -15
- package/docs/reporting.md +305 -0
- package/docs/selection.md +40 -0
- package/docs/sources.md +110 -0
- package/docs/spotlight.md +78 -0
- package/docs/stability.md +52 -0
- package/docs/state.md +85 -0
- package/docs/theming.md +18 -6
- package/docs/usage.md +43 -3
- package/docs/workbench.md +72 -0
- package/fonts/doto-400.woff2 +0 -0
- package/fonts/doto-500.woff2 +0 -0
- package/fonts/doto-600.woff2 +0 -0
- package/fonts/doto-700.woff2 +0 -0
- package/fonts/doto-800.woff2 +0 -0
- package/fonts/doto-900.woff2 +0 -0
- package/llms.txt +288 -8
- package/package.json +95 -5
- package/qwik/index.d.ts +60 -0
- package/qwik/index.js +149 -0
- package/react/index.d.ts +40 -14
- package/react/index.js +32 -5
- package/solid/index.d.ts +40 -14
- package/solid/index.js +31 -3
- package/tokens/index.d.ts +3 -3
- package/tokens/index.js +25 -19
- package/tokens/index.json +32 -28
- package/tokens/resolved.json +34 -32
- package/tokens/tokens.dtcg.json +22 -14
- package/fonts/doto-400.ttf +0 -0
- package/fonts/doto-500.ttf +0 -0
- package/fonts/doto-600.ttf +0 -0
- package/fonts/doto-700.ttf +0 -0
- package/fonts/doto-800.ttf +0 -0
- package/fonts/doto-900.ttf +0 -0
package/classes/index.js
CHANGED
|
@@ -245,7 +245,227 @@ export const cls = Object.freeze({
|
|
|
245
245
|
timeline: 'ui-timeline',
|
|
246
246
|
timelineItem: 'ui-timeline__item',
|
|
247
247
|
timelineTime: 'ui-timeline__time',
|
|
248
|
+
// report kit (opt-in css/report.css)
|
|
249
|
+
report: 'ui-report',
|
|
250
|
+
reportCompact: 'ui-report--compact',
|
|
251
|
+
reportNumbered: 'ui-report--numbered',
|
|
252
|
+
reportCover: 'ui-report__cover',
|
|
253
|
+
reportCoverCompact: 'ui-report__cover--compact',
|
|
254
|
+
reportHeader: 'ui-report__header',
|
|
255
|
+
reportTitle: 'ui-report__title',
|
|
256
|
+
reportSubtitle: 'ui-report__subtitle',
|
|
257
|
+
reportMeta: 'ui-report__meta',
|
|
258
|
+
reportToc: 'ui-report__toc',
|
|
259
|
+
reportSummary: 'ui-report__summary',
|
|
260
|
+
reportSection: 'ui-report__section',
|
|
261
|
+
reportSectionUnnumbered: 'ui-report__section--unnumbered',
|
|
262
|
+
reportSectionHead: 'ui-report__section-head',
|
|
263
|
+
reportFinding: 'ui-report__finding',
|
|
264
|
+
reportEvidence: 'ui-report__evidence',
|
|
265
|
+
reportFigure: 'ui-report__figure',
|
|
266
|
+
reportCaption: 'ui-report__caption',
|
|
267
|
+
reportSources: 'ui-report__sources',
|
|
268
|
+
reportAppendix: 'ui-report__appendix',
|
|
269
|
+
reportFootnotes: 'ui-report__footnotes',
|
|
270
|
+
chart: 'ui-chart',
|
|
271
|
+
chartCaption: 'ui-chart__caption',
|
|
272
|
+
chartPlot: 'ui-chart__plot',
|
|
273
|
+
chartBar: 'ui-chart__bar',
|
|
274
|
+
chartLabel: 'ui-chart__label',
|
|
275
|
+
chartTrack: 'ui-chart__track',
|
|
276
|
+
chartFill: 'ui-chart__fill',
|
|
277
|
+
chartFallback: 'ui-chart__fallback',
|
|
278
|
+
// legend (standalone data keys — css/legend.css)
|
|
279
|
+
legend: 'ui-legend',
|
|
280
|
+
legendVertical: 'ui-legend--vertical',
|
|
281
|
+
legendCompact: 'ui-legend--compact',
|
|
282
|
+
legendGradient: 'ui-legend--gradient',
|
|
283
|
+
legendDiverging: 'ui-legend--diverging',
|
|
284
|
+
legendThreshold: 'ui-legend--threshold',
|
|
285
|
+
legendWithValues: 'ui-legend--with-values',
|
|
286
|
+
legendInteractive: 'ui-legend--interactive',
|
|
287
|
+
legendTitle: 'ui-legend__title',
|
|
288
|
+
legendItem: 'ui-legend__item',
|
|
289
|
+
legendSwatch: 'ui-legend__swatch',
|
|
290
|
+
legendSwatchCircle: 'ui-legend__swatch--circle',
|
|
291
|
+
legendSwatchLine: 'ui-legend__swatch--line',
|
|
292
|
+
legendSwatch1: 'ui-legend__swatch--1',
|
|
293
|
+
legendSwatch2: 'ui-legend__swatch--2',
|
|
294
|
+
legendSwatch3: 'ui-legend__swatch--3',
|
|
295
|
+
legendSwatch4: 'ui-legend__swatch--4',
|
|
296
|
+
legendSwatch5: 'ui-legend__swatch--5',
|
|
297
|
+
legendSwatch6: 'ui-legend__swatch--6',
|
|
298
|
+
legendSwatch7: 'ui-legend__swatch--7',
|
|
299
|
+
legendSwatch8: 'ui-legend__swatch--8',
|
|
300
|
+
legendSymbol: 'ui-legend__symbol',
|
|
301
|
+
legendLabel: 'ui-legend__label',
|
|
302
|
+
legendValue: 'ui-legend__value',
|
|
303
|
+
legendCaption: 'ui-legend__caption',
|
|
304
|
+
legendTrack: 'ui-legend__track',
|
|
305
|
+
legendTicks: 'ui-legend__ticks',
|
|
306
|
+
legendTick: 'ui-legend__tick',
|
|
307
|
+
annotation: 'ui-annotation',
|
|
308
|
+
annotationSubject: 'ui-annotation__subject',
|
|
309
|
+
annotationConnector: 'ui-annotation__connector',
|
|
310
|
+
annotationConnectorEnd: 'ui-annotation__connector-end',
|
|
311
|
+
annotationNote: 'ui-annotation__note',
|
|
312
|
+
annotationNoteLine: 'ui-annotation__note-line',
|
|
313
|
+
annotationTitle: 'ui-annotation__title',
|
|
314
|
+
annotationLabel: 'ui-annotation__label',
|
|
315
|
+
annotationBadge: 'ui-annotation__badge',
|
|
316
|
+
annotationLabelVariant: 'ui-annotation--label',
|
|
317
|
+
annotationCallout: 'ui-annotation--callout',
|
|
318
|
+
annotationElbow: 'ui-annotation--elbow',
|
|
319
|
+
annotationCurve: 'ui-annotation--curve',
|
|
320
|
+
annotationCircle: 'ui-annotation--circle',
|
|
321
|
+
annotationRect: 'ui-annotation--rect',
|
|
322
|
+
annotationThreshold: 'ui-annotation--threshold',
|
|
323
|
+
annotationBadgeVariant: 'ui-annotation--badge',
|
|
324
|
+
annotationBracket: 'ui-annotation--bracket',
|
|
325
|
+
annotationBand: 'ui-annotation--band',
|
|
326
|
+
annotationSlope: 'ui-annotation--slope',
|
|
327
|
+
annotationCompare: 'ui-annotation--compare',
|
|
328
|
+
annotationCluster: 'ui-annotation--cluster',
|
|
329
|
+
annotationAxis: 'ui-annotation--axis',
|
|
330
|
+
annotationTimeline: 'ui-annotation--timeline',
|
|
331
|
+
annotationEvidence: 'ui-annotation--evidence',
|
|
332
|
+
annotationAccent: 'ui-annotation--accent',
|
|
333
|
+
annotationMuted: 'ui-annotation--muted',
|
|
334
|
+
annotationSuccess: 'ui-annotation--success',
|
|
335
|
+
annotationWarning: 'ui-annotation--warning',
|
|
336
|
+
annotationDanger: 'ui-annotation--danger',
|
|
337
|
+
annotationInfo: 'ui-annotation--info',
|
|
338
|
+
annotationDraw: 'ui-annotation--draw',
|
|
339
|
+
annotationPulse: 'ui-annotation--pulse',
|
|
340
|
+
annotationReveal: 'ui-annotation--reveal',
|
|
341
|
+
annotationFocus: 'ui-annotation--focus',
|
|
342
|
+
// marks (evidence/emphasis for running text — css/marks.css)
|
|
343
|
+
mark: 'ui-mark',
|
|
344
|
+
markAccent: 'ui-mark--accent',
|
|
345
|
+
markSuccess: 'ui-mark--success',
|
|
346
|
+
markWarning: 'ui-mark--warning',
|
|
347
|
+
markDanger: 'ui-mark--danger',
|
|
348
|
+
markInfo: 'ui-mark--info',
|
|
349
|
+
markMuted: 'ui-mark--muted',
|
|
350
|
+
markUnderline: 'ui-mark--underline',
|
|
351
|
+
markBox: 'ui-mark--box',
|
|
352
|
+
markStrike: 'ui-mark--strike',
|
|
353
|
+
markDraw: 'ui-mark--draw',
|
|
354
|
+
bracketNote: 'ui-bracket-note',
|
|
355
|
+
bracketNoteLabel: 'ui-bracket-note__label',
|
|
356
|
+
bracketNoteAccent: 'ui-bracket-note--accent',
|
|
357
|
+
bracketNoteWarning: 'ui-bracket-note--warning',
|
|
358
|
+
bracketNoteDanger: 'ui-bracket-note--danger',
|
|
359
|
+
bracketNoteInfo: 'ui-bracket-note--info',
|
|
360
|
+
// connectors (leader lines — css/connectors.css)
|
|
361
|
+
connector: 'ui-connector',
|
|
362
|
+
connectorPath: 'ui-connector__path',
|
|
363
|
+
connectorEnd: 'ui-connector__end',
|
|
364
|
+
connectorDashed: 'ui-connector--dashed',
|
|
365
|
+
connectorAccent: 'ui-connector--accent',
|
|
366
|
+
connectorMuted: 'ui-connector--muted',
|
|
367
|
+
connectorSuccess: 'ui-connector--success',
|
|
368
|
+
connectorWarning: 'ui-connector--warning',
|
|
369
|
+
connectorDanger: 'ui-connector--danger',
|
|
370
|
+
connectorInfo: 'ui-connector--info',
|
|
371
|
+
connectorDraw: 'ui-connector--draw',
|
|
372
|
+
// spotlight (guided-focus overlay — css/spotlight.css)
|
|
373
|
+
spotlight: 'ui-spotlight',
|
|
374
|
+
spotlightHole: 'ui-spotlight__hole',
|
|
375
|
+
spotlightRing: 'ui-spotlight--ring',
|
|
376
|
+
tourNote: 'ui-tour-note',
|
|
377
|
+
tourNoteStep: 'ui-tour-note__step',
|
|
378
|
+
tourNoteTitle: 'ui-tour-note__title',
|
|
379
|
+
tourNoteBody: 'ui-tour-note__body',
|
|
380
|
+
tourNoteActions: 'ui-tour-note__actions',
|
|
381
|
+
// crosshair (plot ruler + readout — css/crosshair.css)
|
|
382
|
+
crosshair: 'ui-crosshair',
|
|
383
|
+
crosshairMuted: 'ui-crosshair--muted',
|
|
384
|
+
crosshairLine: 'ui-crosshair__line',
|
|
385
|
+
crosshairLineX: 'ui-crosshair__line--x',
|
|
386
|
+
crosshairLineY: 'ui-crosshair__line--y',
|
|
387
|
+
crosshairBadge: 'ui-crosshair__badge',
|
|
388
|
+
readout: 'ui-readout',
|
|
389
|
+
// selection-state vocabulary (cross-cutting — css/selection.css)
|
|
390
|
+
sel: 'ui-sel',
|
|
391
|
+
selOn: 'ui-sel--on',
|
|
392
|
+
selOff: 'ui-sel--off',
|
|
393
|
+
selMaybe: 'ui-sel--maybe',
|
|
394
|
+
// source / citation / provenance — the trust layer (css/sources.css)
|
|
395
|
+
citation: 'ui-citation',
|
|
396
|
+
citationChip: 'ui-citation--chip',
|
|
397
|
+
sourceList: 'ui-source-list',
|
|
398
|
+
sourceListItem: 'ui-source-list__item',
|
|
399
|
+
sourceCard: 'ui-source-card',
|
|
400
|
+
sourceCardTitle: 'ui-source-card__title',
|
|
401
|
+
sourceCardOrigin: 'ui-source-card__origin',
|
|
402
|
+
sourceCardTime: 'ui-source-card__time',
|
|
403
|
+
sourceCardExcerpt: 'ui-source-card__excerpt',
|
|
404
|
+
sourceCardActions: 'ui-source-card__actions',
|
|
405
|
+
provenance: 'ui-provenance',
|
|
406
|
+
provenanceItem: 'ui-provenance__item',
|
|
407
|
+
srcVerified: 'ui-src--verified',
|
|
408
|
+
srcUnverified: 'ui-src--unverified',
|
|
409
|
+
srcGenerated: 'ui-src--generated',
|
|
410
|
+
srcReviewed: 'ui-src--reviewed',
|
|
411
|
+
srcStale: 'ui-src--stale',
|
|
412
|
+
srcConflict: 'ui-src--conflict',
|
|
413
|
+
// lifecycle / system state (css/state.css)
|
|
414
|
+
state: 'ui-state',
|
|
415
|
+
stateLabel: 'ui-state__label',
|
|
416
|
+
stateDetail: 'ui-state__detail',
|
|
417
|
+
stateBusy: 'ui-state--busy',
|
|
418
|
+
stateSaving: 'ui-state--saving',
|
|
419
|
+
stateSaved: 'ui-state--saved',
|
|
420
|
+
stateQueued: 'ui-state--queued',
|
|
421
|
+
stateOffline: 'ui-state--offline',
|
|
422
|
+
stateStale: 'ui-state--stale',
|
|
423
|
+
stateConflict: 'ui-state--conflict',
|
|
424
|
+
stateError: 'ui-state--error',
|
|
425
|
+
stateLocked: 'ui-state--locked',
|
|
426
|
+
stateReviewed: 'ui-state--reviewed',
|
|
427
|
+
stateNeedsReview: 'ui-state--needs-review',
|
|
428
|
+
syncbar: 'ui-syncbar',
|
|
429
|
+
// generated content / AI-trust surfaces (css/generated.css)
|
|
430
|
+
generated: 'ui-generated',
|
|
431
|
+
generatedLabel: 'ui-generated__label',
|
|
432
|
+
originLabel: 'ui-origin-label',
|
|
433
|
+
originLabelAi: 'ui-origin-label--ai',
|
|
434
|
+
reasoning: 'ui-reasoning',
|
|
435
|
+
reasoningBody: 'ui-reasoning__body',
|
|
436
|
+
toolLog: 'ui-tool-log',
|
|
437
|
+
toolCall: 'ui-tool-call',
|
|
438
|
+
toolCallName: 'ui-tool-call__name',
|
|
439
|
+
toolCallStatus: 'ui-tool-call__status',
|
|
440
|
+
toolCallBody: 'ui-tool-call__body',
|
|
441
|
+
// workbench — inspector / property / selection bar (css/workbench.css)
|
|
442
|
+
inspector: 'ui-inspector',
|
|
443
|
+
inspectorHeader: 'ui-inspector__header',
|
|
444
|
+
inspectorBody: 'ui-inspector__body',
|
|
445
|
+
property: 'ui-property',
|
|
446
|
+
propertyLabel: 'ui-property__label',
|
|
447
|
+
propertyValue: 'ui-property__value',
|
|
448
|
+
selectionbar: 'ui-selectionbar',
|
|
449
|
+
selectionbarCount: 'ui-selectionbar__count',
|
|
450
|
+
selectionbarActions: 'ui-selectionbar__actions',
|
|
451
|
+
// command palette shell (css/command.css + initCommand)
|
|
452
|
+
command: 'ui-command',
|
|
453
|
+
commandInput: 'ui-command__input',
|
|
454
|
+
commandList: 'ui-command__list',
|
|
455
|
+
commandGroup: 'ui-command__group',
|
|
456
|
+
commandItem: 'ui-command__item',
|
|
457
|
+
commandShortcut: 'ui-command__shortcut',
|
|
458
|
+
commandMeta: 'ui-command__meta',
|
|
459
|
+
commandEmpty: 'ui-command__empty',
|
|
460
|
+
printOnly: 'ui-print-only',
|
|
461
|
+
screenOnly: 'ui-screen-only',
|
|
462
|
+
breakBefore: 'ui-break-before',
|
|
463
|
+
breakAfter: 'ui-break-after',
|
|
464
|
+
keep: 'ui-keep',
|
|
465
|
+
printExact: 'ui-print-exact',
|
|
248
466
|
kbd: 'ui-kbd',
|
|
467
|
+
shortcut: 'ui-shortcut',
|
|
468
|
+
shortcutSep: 'ui-shortcut__sep',
|
|
249
469
|
display: 'ui-display',
|
|
250
470
|
mono: 'ui-mono',
|
|
251
471
|
muted: 'ui-muted',
|
|
@@ -262,6 +482,9 @@ export const cls = Object.freeze({
|
|
|
262
482
|
animateFade: 'ui-animate-fade',
|
|
263
483
|
animateDot: 'ui-animate-dot',
|
|
264
484
|
animateMatrix: 'ui-animate-matrix',
|
|
485
|
+
scrollProgress: 'ui-scroll-progress',
|
|
486
|
+
scrollReveal: 'ui-scroll-reveal',
|
|
487
|
+
vt: 'ui-vt',
|
|
265
488
|
// admin shell (was the legacy .app-* vocabulary; promoted in 0.3.0)
|
|
266
489
|
appShell: 'ui-app-shell',
|
|
267
490
|
appShellFull: 'ui-app-shell--full',
|
|
@@ -304,6 +527,31 @@ export function cx(...parts) {
|
|
|
304
527
|
|
|
305
528
|
const j = (...p) => p.filter(Boolean).join(' ');
|
|
306
529
|
|
|
530
|
+
// Lifecycle state → canonical tone class.
|
|
531
|
+
const stateTone = (state) =>
|
|
532
|
+
({
|
|
533
|
+
saving: cls.stateSaving,
|
|
534
|
+
saved: cls.stateSaved,
|
|
535
|
+
queued: cls.stateQueued,
|
|
536
|
+
offline: cls.stateOffline,
|
|
537
|
+
stale: cls.stateStale,
|
|
538
|
+
conflict: cls.stateConflict,
|
|
539
|
+
error: cls.stateError,
|
|
540
|
+
locked: cls.stateLocked,
|
|
541
|
+
reviewed: cls.stateReviewed,
|
|
542
|
+
'needs-review': cls.stateNeedsReview,
|
|
543
|
+
})[state] || '';
|
|
544
|
+
|
|
545
|
+
// Trust-state → tone class, shared by the source/citation/provenance recipes.
|
|
546
|
+
const srcTone = (state) =>
|
|
547
|
+
(state === 'verified' && cls.srcVerified) ||
|
|
548
|
+
(state === 'unverified' && cls.srcUnverified) ||
|
|
549
|
+
(state === 'generated' && cls.srcGenerated) ||
|
|
550
|
+
(state === 'reviewed' && cls.srcReviewed) ||
|
|
551
|
+
(state === 'stale' && cls.srcStale) ||
|
|
552
|
+
(state === 'conflict' && cls.srcConflict) ||
|
|
553
|
+
'';
|
|
554
|
+
|
|
307
555
|
export const ui = {
|
|
308
556
|
button: ({ variant, icon, size } = {}) =>
|
|
309
557
|
j(
|
|
@@ -399,6 +647,110 @@ export const ui = {
|
|
|
399
647
|
j(cls.container, narrow && cls.containerNarrow, wide && cls.containerWide),
|
|
400
648
|
tag: ({ accent } = {}) => j(cls.tag, accent && cls.tagAccent),
|
|
401
649
|
inputIcon: ({ end } = {}) => j(cls.inputIcon, end && cls.inputIconEnd),
|
|
650
|
+
legend: ({ orient, type, diverging, compact, withValues, interactive } = {}) =>
|
|
651
|
+
j(
|
|
652
|
+
cls.legend,
|
|
653
|
+
orient === 'vertical' && cls.legendVertical,
|
|
654
|
+
type === 'gradient' && cls.legendGradient,
|
|
655
|
+
type === 'threshold' && cls.legendThreshold,
|
|
656
|
+
diverging && cls.legendDiverging,
|
|
657
|
+
compact && cls.legendCompact,
|
|
658
|
+
withValues && cls.legendWithValues,
|
|
659
|
+
interactive && cls.legendInteractive,
|
|
660
|
+
),
|
|
661
|
+
legendItem: ({ inactive } = {}) => j(cls.legendItem, inactive && 'is-inactive'),
|
|
662
|
+
legendSwatch: ({ series, shape } = {}) =>
|
|
663
|
+
j(
|
|
664
|
+
cls.legendSwatch,
|
|
665
|
+
series === 1 && cls.legendSwatch1,
|
|
666
|
+
series === 2 && cls.legendSwatch2,
|
|
667
|
+
series === 3 && cls.legendSwatch3,
|
|
668
|
+
series === 4 && cls.legendSwatch4,
|
|
669
|
+
series === 5 && cls.legendSwatch5,
|
|
670
|
+
series === 6 && cls.legendSwatch6,
|
|
671
|
+
series === 7 && cls.legendSwatch7,
|
|
672
|
+
series === 8 && cls.legendSwatch8,
|
|
673
|
+
shape === 'circle' && cls.legendSwatchCircle,
|
|
674
|
+
shape === 'line' && cls.legendSwatchLine,
|
|
675
|
+
),
|
|
676
|
+
annotation: ({ variant = 'callout', tone = 'accent', motion } = {}) =>
|
|
677
|
+
j(
|
|
678
|
+
cls.annotation,
|
|
679
|
+
variant === 'label' && cls.annotationLabelVariant,
|
|
680
|
+
variant === 'callout' && cls.annotationCallout,
|
|
681
|
+
variant === 'elbow' && cls.annotationElbow,
|
|
682
|
+
variant === 'curve' && cls.annotationCurve,
|
|
683
|
+
variant === 'circle' && cls.annotationCircle,
|
|
684
|
+
variant === 'rect' && cls.annotationRect,
|
|
685
|
+
variant === 'threshold' && cls.annotationThreshold,
|
|
686
|
+
variant === 'badge' && cls.annotationBadgeVariant,
|
|
687
|
+
variant === 'bracket' && cls.annotationBracket,
|
|
688
|
+
variant === 'band' && cls.annotationBand,
|
|
689
|
+
variant === 'slope' && cls.annotationSlope,
|
|
690
|
+
variant === 'compare' && cls.annotationCompare,
|
|
691
|
+
variant === 'cluster' && cls.annotationCluster,
|
|
692
|
+
variant === 'axis' && cls.annotationAxis,
|
|
693
|
+
variant === 'timeline' && cls.annotationTimeline,
|
|
694
|
+
variant === 'evidence' && cls.annotationEvidence,
|
|
695
|
+
tone === 'accent' && cls.annotationAccent,
|
|
696
|
+
tone === 'muted' && cls.annotationMuted,
|
|
697
|
+
tone === 'success' && cls.annotationSuccess,
|
|
698
|
+
tone === 'warning' && cls.annotationWarning,
|
|
699
|
+
tone === 'danger' && cls.annotationDanger,
|
|
700
|
+
tone === 'info' && cls.annotationInfo,
|
|
701
|
+
motion === 'draw' && cls.annotationDraw,
|
|
702
|
+
motion === 'pulse' && cls.annotationPulse,
|
|
703
|
+
motion === 'reveal' && cls.annotationReveal,
|
|
704
|
+
motion === 'focus' && cls.annotationFocus,
|
|
705
|
+
),
|
|
706
|
+
mark: ({ style, tone, motion } = {}) =>
|
|
707
|
+
j(
|
|
708
|
+
cls.mark,
|
|
709
|
+
style === 'underline' && cls.markUnderline,
|
|
710
|
+
style === 'box' && cls.markBox,
|
|
711
|
+
style === 'strike' && cls.markStrike,
|
|
712
|
+
tone === 'accent' && cls.markAccent,
|
|
713
|
+
tone === 'success' && cls.markSuccess,
|
|
714
|
+
tone === 'warning' && cls.markWarning,
|
|
715
|
+
tone === 'danger' && cls.markDanger,
|
|
716
|
+
tone === 'info' && cls.markInfo,
|
|
717
|
+
tone === 'muted' && cls.markMuted,
|
|
718
|
+
motion === 'draw' && cls.markDraw,
|
|
719
|
+
),
|
|
720
|
+
bracketNote: ({ tone } = {}) =>
|
|
721
|
+
j(
|
|
722
|
+
cls.bracketNote,
|
|
723
|
+
tone === 'accent' && cls.bracketNoteAccent,
|
|
724
|
+
tone === 'warning' && cls.bracketNoteWarning,
|
|
725
|
+
tone === 'danger' && cls.bracketNoteDanger,
|
|
726
|
+
tone === 'info' && cls.bracketNoteInfo,
|
|
727
|
+
),
|
|
728
|
+
connector: ({ tone, dashed, motion } = {}) =>
|
|
729
|
+
j(
|
|
730
|
+
cls.connector,
|
|
731
|
+
tone === 'accent' && cls.connectorAccent,
|
|
732
|
+
tone === 'muted' && cls.connectorMuted,
|
|
733
|
+
tone === 'success' && cls.connectorSuccess,
|
|
734
|
+
tone === 'warning' && cls.connectorWarning,
|
|
735
|
+
tone === 'danger' && cls.connectorDanger,
|
|
736
|
+
tone === 'info' && cls.connectorInfo,
|
|
737
|
+
dashed && cls.connectorDashed,
|
|
738
|
+
motion === 'draw' && cls.connectorDraw,
|
|
739
|
+
),
|
|
740
|
+
spotlight: ({ ring } = {}) => j(cls.spotlight, ring && cls.spotlightRing),
|
|
741
|
+
crosshair: ({ muted } = {}) => j(cls.crosshair, muted && cls.crosshairMuted),
|
|
742
|
+
sel: ({ state } = {}) =>
|
|
743
|
+
j(
|
|
744
|
+
cls.sel,
|
|
745
|
+
state === 'on' && cls.selOn,
|
|
746
|
+
state === 'off' && cls.selOff,
|
|
747
|
+
state === 'maybe' && cls.selMaybe,
|
|
748
|
+
),
|
|
749
|
+
citation: ({ chip, state } = {}) => j(cls.citation, chip && cls.citationChip, srcTone(state)),
|
|
750
|
+
source: ({ state } = {}) => j(cls.sourceCard, srcTone(state)),
|
|
751
|
+
provenance: ({ state } = {}) => j(cls.provenance, srcTone(state)),
|
|
752
|
+
state: ({ state, busy } = {}) => j(cls.state, stateTone(state), busy && cls.stateBusy),
|
|
753
|
+
originLabel: ({ ai } = {}) => j(cls.originLabel, ai && cls.originLabelAi),
|
|
402
754
|
};
|
|
403
755
|
|
|
404
756
|
export default ui;
|
|
@@ -7,19 +7,19 @@
|
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
"name": "--accent-1",
|
|
10
|
-
"description": "Global scale token. Value: `color-mix(in oklch, var(--accent) 8%, var(--
|
|
10
|
+
"description": "Global scale token. Value: `color-mix(in oklch, var(--accent) 8%, var(--accent-ramp-end))`"
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"name": "--accent-2",
|
|
14
|
-
"description": "Global scale token. Value: `color-mix(in oklch, var(--accent) 16%, var(--
|
|
14
|
+
"description": "Global scale token. Value: `color-mix(in oklch, var(--accent) 16%, var(--accent-ramp-end))`"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"name": "--accent-3",
|
|
18
|
-
"description": "Global scale token. Value: `color-mix(in oklch, var(--accent) 32%, var(--
|
|
18
|
+
"description": "Global scale token. Value: `color-mix(in oklch, var(--accent) 32%, var(--accent-ramp-end))`"
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
"name": "--accent-4",
|
|
22
|
-
"description": "Global scale token. Value: `color-mix(in oklch, var(--accent) 60%, var(--
|
|
22
|
+
"description": "Global scale token. Value: `color-mix(in oklch, var(--accent) 60%, var(--accent-ramp-end))`"
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"name": "--accent-5",
|
|
@@ -29,6 +29,10 @@
|
|
|
29
29
|
"name": "--accent-6",
|
|
30
30
|
"description": "Global scale token. Value: `var(--accent-strong)`"
|
|
31
31
|
},
|
|
32
|
+
{
|
|
33
|
+
"name": "--accent-ramp-end",
|
|
34
|
+
"description": "Theme token. Light: `#ffffff` · Dark: `#000000`"
|
|
35
|
+
},
|
|
32
36
|
{
|
|
33
37
|
"name": "--accent-soft",
|
|
34
38
|
"description": "Theme token. Light: `color-mix(in srgb, var(--accent) 10%, transparent)` · Dark: `color-mix(in srgb, var(--accent) 14%, transparent)`"
|
|
@@ -43,7 +47,7 @@
|
|
|
43
47
|
},
|
|
44
48
|
{
|
|
45
49
|
"name": "--bg",
|
|
46
|
-
"description": "Theme token. Light: `#f4f4f2` · Dark: `#
|
|
50
|
+
"description": "Theme token. Light: `#f4f4f2` · Dark: `#121212`"
|
|
47
51
|
},
|
|
48
52
|
{
|
|
49
53
|
"name": "--bg-accent",
|
|
@@ -51,7 +55,7 @@
|
|
|
51
55
|
},
|
|
52
56
|
{
|
|
53
57
|
"name": "--bg-elevated",
|
|
54
|
-
"description": "Theme token. Light: `#fbfbfa` · Dark: `#
|
|
58
|
+
"description": "Theme token. Light: `#fbfbfa` · Dark: `#181818`"
|
|
55
59
|
},
|
|
56
60
|
{
|
|
57
61
|
"name": "--border",
|
|
@@ -199,11 +203,11 @@
|
|
|
199
203
|
},
|
|
200
204
|
{
|
|
201
205
|
"name": "--line",
|
|
202
|
-
"description": "Theme token. Light: `#d8d8d4` · Dark: `#
|
|
206
|
+
"description": "Theme token. Light: `#d8d8d4` · Dark: `#383838`"
|
|
203
207
|
},
|
|
204
208
|
{
|
|
205
209
|
"name": "--line-strong",
|
|
206
|
-
"description": "Theme token. Light: `#a8a8a2` · Dark: `#
|
|
210
|
+
"description": "Theme token. Light: `#a8a8a2` · Dark: `#555555`"
|
|
207
211
|
},
|
|
208
212
|
{
|
|
209
213
|
"name": "--mono",
|
|
@@ -211,15 +215,15 @@
|
|
|
211
215
|
},
|
|
212
216
|
{
|
|
213
217
|
"name": "--panel",
|
|
214
|
-
"description": "Theme token. Light: `#ffffff` · Dark: `#
|
|
218
|
+
"description": "Theme token. Light: `#ffffff` · Dark: `#1c1c1c`"
|
|
215
219
|
},
|
|
216
220
|
{
|
|
217
221
|
"name": "--panel-soft",
|
|
218
|
-
"description": "Theme token. Light: `#ececea` · Dark: `#
|
|
222
|
+
"description": "Theme token. Light: `#ececea` · Dark: `#242424`"
|
|
219
223
|
},
|
|
220
224
|
{
|
|
221
225
|
"name": "--panel-strong",
|
|
222
|
-
"description": "Theme token. Light: `#ffffff` · Dark: `#
|
|
226
|
+
"description": "Theme token. Light: `#ffffff` · Dark: `#222222`"
|
|
223
227
|
},
|
|
224
228
|
{
|
|
225
229
|
"name": "--radius-lg",
|
|
@@ -327,7 +331,7 @@
|
|
|
327
331
|
},
|
|
328
332
|
{
|
|
329
333
|
"name": "--text",
|
|
330
|
-
"description": "Theme token. Light: `#0a0a0a` · Dark: `#
|
|
334
|
+
"description": "Theme token. Light: `#0a0a0a` · Dark: `#e6e6e6`"
|
|
331
335
|
},
|
|
332
336
|
{
|
|
333
337
|
"name": "--text-2xs",
|
|
@@ -339,7 +343,7 @@
|
|
|
339
343
|
},
|
|
340
344
|
{
|
|
341
345
|
"name": "--text-dim",
|
|
342
|
-
"description": "Theme token. Light: `#686863` · Dark: `#
|
|
346
|
+
"description": "Theme token. Light: `#686863` · Dark: `#a0a0a0`"
|
|
343
347
|
},
|
|
344
348
|
{
|
|
345
349
|
"name": "--text-lg",
|
|
@@ -351,7 +355,7 @@
|
|
|
351
355
|
},
|
|
352
356
|
{
|
|
353
357
|
"name": "--text-soft",
|
|
354
|
-
"description": "Theme token. Light: `#353533` · Dark: `#
|
|
358
|
+
"description": "Theme token. Light: `#353533` · Dark: `#c8c8c8`"
|
|
355
359
|
},
|
|
356
360
|
{
|
|
357
361
|
"name": "--text-xl",
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @ponchia/ui/connectors — dependency-free SVG geometry for leader lines.
|
|
3
|
+
* Pure functions: points/rects in, SVG path strings (or coordinates) out.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface Point {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface Rect {
|
|
12
|
+
x: number;
|
|
13
|
+
y: number;
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type Side = 'top' | 'right' | 'bottom' | 'left' | 'center';
|
|
19
|
+
export type ConnectorShape = 'straight' | 'elbow' | 'curve';
|
|
20
|
+
|
|
21
|
+
export interface ConnectorPathOptions {
|
|
22
|
+
from: Point;
|
|
23
|
+
to: Point;
|
|
24
|
+
shape?: ConnectorShape;
|
|
25
|
+
/** Curve control-point reach along the dominant axis (curve shape). Default 0.5. */
|
|
26
|
+
curvature?: number;
|
|
27
|
+
/** Turn position 0..1 along the span (elbow shape). Default 0.5. */
|
|
28
|
+
mid?: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ConnectRectsOptions {
|
|
32
|
+
fromRect: Rect;
|
|
33
|
+
toRect: Rect;
|
|
34
|
+
/** Anchor edges. Omit both to auto-pick facing edges from the rects. */
|
|
35
|
+
fromSide?: Side;
|
|
36
|
+
toSide?: Side;
|
|
37
|
+
shape?: ConnectorShape;
|
|
38
|
+
curvature?: number;
|
|
39
|
+
mid?: number;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ConnectRectsResult {
|
|
43
|
+
/** SVG path data. */
|
|
44
|
+
d: string;
|
|
45
|
+
from: Point;
|
|
46
|
+
to: Point;
|
|
47
|
+
/**
|
|
48
|
+
* The path's **end-tangent** at `to` in radians (`endTangentAngle(from, to,
|
|
49
|
+
* shape)`) — the direction the path arrives, so rotating an arrowhead at `to`
|
|
50
|
+
* by this points it along the path. Equals the straight `from`→`to` angle for
|
|
51
|
+
* `shape: 'straight'`; axis-aligned for `elbow`/`curve`.
|
|
52
|
+
*/
|
|
53
|
+
angle: number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export declare function anchorPoint(rect: Rect, side?: Side): Point;
|
|
57
|
+
export declare function angleBetween(from: Point, to: Point): number;
|
|
58
|
+
export declare function straightPath(from: Point, to: Point): string;
|
|
59
|
+
export declare function elbowPath(from: Point, to: Point, opts?: { mid?: number }): string;
|
|
60
|
+
export declare function curvePath(from: Point, to: Point, opts?: { curvature?: number }): string;
|
|
61
|
+
export declare function connectorPath(opts: ConnectorPathOptions): string;
|
|
62
|
+
export declare function arrowHead(p: Point, angle: number, size?: number): string;
|
|
63
|
+
export declare function dotMark(p: Point, radius?: number): string;
|
|
64
|
+
export declare function autoSides(
|
|
65
|
+
fromRect: Rect,
|
|
66
|
+
toRect: Rect,
|
|
67
|
+
): { from: Side; to: Side };
|
|
68
|
+
/** Angle (radians) at which a `shape` path arrives at `to` — the chord for
|
|
69
|
+
* `straight`, axis-aligned for `elbow`/`curve`. Use it to rotate an end marker. */
|
|
70
|
+
export declare function endTangentAngle(from: Point, to: Point, shape?: ConnectorShape): number;
|
|
71
|
+
export declare function connectRects(opts: ConnectRectsOptions): ConnectRectsResult;
|