@lovett/ui 0.0.10 → 0.1.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/dist/chunk-RBYWGBQ2.js +2752 -0
- package/dist/chunk-RBYWGBQ2.js.map +1 -0
- package/dist/index.d.ts +6064 -80
- package/dist/index.js +21561 -9696
- package/dist/index.js.map +1 -1
- package/dist/rich-composer-impl-5NO443A6.js +1859 -0
- package/dist/rich-composer-impl-5NO443A6.js.map +1 -0
- package/dist/styles.css +1586 -2
- package/dist/theme-v2.css +228 -0
- package/dist/tokens.css +121 -0
- package/package.json +8 -1
- package/src/__tests__/anchor.test.tsx +422 -0
- package/src/__tests__/avatar.test.tsx +272 -0
- package/src/__tests__/bar-chart.test.tsx +809 -0
- package/src/__tests__/board.test.tsx +420 -0
- package/src/__tests__/chart-math.test.ts +922 -0
- package/src/__tests__/chart-series.test.ts +339 -0
- package/src/__tests__/code-block.test.tsx +134 -0
- package/src/__tests__/combobox.test.tsx +677 -0
- package/src/__tests__/display-popover.test.tsx +195 -0
- package/src/__tests__/display-store.test.tsx +208 -0
- package/src/__tests__/donut-chart.test.tsx +397 -0
- package/src/__tests__/dropdown-menu.test.tsx +572 -0
- package/src/__tests__/filter-menu.test.tsx +175 -0
- package/src/__tests__/gauge-ring.test.tsx +233 -0
- package/src/__tests__/helpers/geometry.ts +58 -0
- package/src/__tests__/layer-stack.test.tsx +228 -0
- package/src/__tests__/line-chart.test.tsx +612 -0
- package/src/__tests__/popover.test.tsx +460 -0
- package/src/__tests__/ranked-bars.test.tsx +343 -0
- package/src/__tests__/remark-underline.test.ts +194 -0
- package/src/__tests__/select.test.tsx +543 -0
- package/src/__tests__/sparkline.test.tsx +368 -0
- package/src/__tests__/stat-layer.test.tsx +271 -0
- package/src/__tests__/stat-strip.test.tsx +175 -0
- package/src/__tests__/status.test.tsx +293 -0
- package/src/__tests__/tabs.test.tsx +303 -0
- package/src/__tests__/token-shape.test.ts +132 -2
- package/src/__tests__/tooltip.test.tsx +355 -0
- package/src/avatar.tsx +352 -0
- package/src/bar-chart.tsx +1214 -0
- package/src/board.tsx +658 -0
- package/src/calculator-shell-v2.tsx +19 -39
- package/src/chart-frame.tsx +960 -0
- package/src/chart-legend.tsx +304 -0
- package/src/chart-tooltip.tsx +267 -0
- package/src/code-block.tsx +62 -8
- package/src/combobox.tsx +796 -0
- package/src/delta-chip.tsx +263 -0
- package/src/detail/__tests__/activity-pane.test.tsx +186 -0
- package/src/detail/__tests__/detail-chrome.test.tsx +134 -0
- package/src/detail/__tests__/detail-surface.test.tsx +529 -0
- package/src/detail/__tests__/field-row.test.tsx +357 -0
- package/src/detail/activity-pane.tsx +507 -0
- package/src/detail/calendar.tsx +355 -0
- package/src/detail/detail-divider.tsx +261 -0
- package/src/detail/detail-header.tsx +287 -0
- package/src/detail/detail-menu.tsx +254 -0
- package/src/detail/detail-surface.tsx +1110 -0
- package/src/detail/field-list.tsx +196 -0
- package/src/detail/field-row.tsx +1131 -0
- package/src/detail/index.ts +58 -0
- package/src/detail/segmented-choice.tsx +94 -0
- package/src/detail/types.ts +129 -0
- package/src/display-popover.tsx +487 -0
- package/src/display-store.tsx +242 -0
- package/src/donut-chart.tsx +988 -0
- package/src/dropdown-menu.tsx +412 -151
- package/src/filter-core/EXPORTS.md +85 -0
- package/src/filter-core/__tests__/columns.test.ts +159 -0
- package/src/filter-core/__tests__/faceting.test.ts +193 -0
- package/src/filter-core/__tests__/filter-fns.test.ts +519 -0
- package/src/filter-core/__tests__/operators.test.ts +235 -0
- package/src/filter-core/__tests__/state.test.ts +268 -0
- package/src/filter-core/__tests__/url.test.ts +350 -0
- package/src/filter-core/columns.ts +134 -0
- package/src/filter-core/date-utils.ts +38 -0
- package/src/filter-core/examples/task-filter-columns.ts +121 -0
- package/src/filter-core/faceting.ts +120 -0
- package/src/filter-core/filter-fns.ts +335 -0
- package/src/filter-core/index.ts +105 -0
- package/src/filter-core/operators.ts +433 -0
- package/src/filter-core/state.ts +280 -0
- package/src/filter-core/types.ts +247 -0
- package/src/filter-core/url.ts +261 -0
- package/src/filter-dropdown.tsx +12 -0
- package/src/filter-menu.tsx +649 -0
- package/src/floating-drawer.tsx +19 -1
- package/src/gauge-ring.tsx +435 -0
- package/src/hue.ts +52 -0
- package/src/index.ts +402 -0
- package/src/kbd.tsx +27 -4
- package/src/lib/anchor.ts +427 -0
- package/src/lib/chart.ts +866 -0
- package/src/lib/focus.ts +74 -0
- package/src/lib/layer-stack.ts +215 -0
- package/src/lib/refs.ts +31 -0
- package/src/lib/remark-underline.ts +443 -0
- package/src/lib/series.ts +169 -0
- package/src/line-chart.tsx +1176 -0
- package/src/markdown.tsx +26 -7
- package/src/metric-card.tsx +57 -22
- package/src/modal.tsx +73 -66
- package/src/popover.tsx +407 -0
- package/src/progress-ledger.tsx +304 -0
- package/src/ranked-bars.tsx +386 -0
- package/src/segmented-pill.tsx +32 -9
- package/src/select.tsx +646 -0
- package/src/sortable.tsx +315 -1
- package/src/sparkline.tsx +416 -0
- package/src/stat-card.tsx +376 -0
- package/src/stat-row.tsx +108 -70
- package/src/stat-strip.tsx +327 -0
- package/src/status.tsx +215 -0
- package/src/styles.css +1586 -2
- package/src/tabs.tsx +206 -25
- package/src/task-card.tsx +610 -0
- package/src/thread/__tests__/comment-body-hostile.test.tsx +331 -0
- package/src/thread/__tests__/comment-tree.test.ts +151 -0
- package/src/thread/__tests__/emoji.test.ts +187 -0
- package/src/thread/__tests__/fixtures/thread-fixture.ts +235 -0
- package/src/thread/__tests__/link-preview-source.test.ts +120 -0
- package/src/thread/__tests__/link-preview.test.tsx +600 -0
- package/src/thread/__tests__/markdown-format.test.ts +82 -0
- package/src/thread/__tests__/markdown-spec.test.ts +469 -0
- package/src/thread/__tests__/relative-time.test.ts +71 -0
- package/src/thread/__tests__/rich-composer.test.tsx +799 -0
- package/src/thread/__tests__/scroll-caret.test.ts +58 -0
- package/src/thread/__tests__/suggestion-list.test.tsx +648 -0
- package/src/thread/__tests__/thread-scroll-ownership.test.tsx +88 -0
- package/src/thread/__tests__/thread.test.tsx +662 -0
- package/src/thread/__tests__/use-attachments.test.tsx +679 -0
- package/src/thread/actions.tsx +196 -0
- package/src/thread/attachments.tsx +1071 -0
- package/src/thread/comment-body.tsx +148 -0
- package/src/thread/comment-tree.ts +182 -0
- package/src/thread/comment.tsx +915 -0
- package/src/thread/composer-footer.tsx +125 -0
- package/src/thread/composer.tsx +319 -0
- package/src/thread/emoji.ts +283 -0
- package/src/thread/index.ts +153 -0
- package/src/thread/link-preview.tsx +341 -0
- package/src/thread/markdown-format.ts +155 -0
- package/src/thread/markdown-spec.ts +754 -0
- package/src/thread/rail.tsx +372 -0
- package/src/thread/reactions.tsx +415 -0
- package/src/thread/relative-time.tsx +94 -0
- package/src/thread/rich-composer-impl.tsx +1601 -0
- package/src/thread/rich-composer.tsx +195 -0
- package/src/thread/scroll-caret.ts +37 -0
- package/src/thread/suggestion-list.tsx +182 -0
- package/src/thread/thread.tsx +718 -0
- package/src/thread/types.ts +218 -0
- package/src/thread/use-attachments.ts +598 -0
- package/src/thread/use-now.ts +73 -0
- package/src/thread/use-thread.ts +316 -0
- package/src/tokens.css +121 -0
- package/src/tooltip.tsx +297 -0
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
* layout="shell" (default) — a single contained card (radius 24,
|
|
12
12
|
* --shell-shadow): flat header + padded body + bordered footer.
|
|
13
13
|
* For compact calculators.
|
|
14
|
+
* Responsive (ADR-145 amendment): header / body / footer tighten to
|
|
15
|
+
* 16px padding below `sm` and the footer wraps, so a calculator reads
|
|
16
|
+
* on a phone without the shell owning any width logic.
|
|
14
17
|
* layout="open" — the header becomes a rounded banner and the Frames
|
|
15
18
|
* sit directly on the page in a vertical stack; the footer is
|
|
16
19
|
* borderless/transparent. Scales to long forms (funnels).
|
|
@@ -21,17 +24,18 @@
|
|
|
21
24
|
* `[lead, accentWord]` tuple for explicit control. No completion ring.
|
|
22
25
|
*
|
|
23
26
|
* Data seam (D9): `prefill` + `benchmarkSlot` are accepted but STUBBED
|
|
24
|
-
* this ADR — `prefill` is typed and not read
|
|
25
|
-
*
|
|
26
|
-
* mode" placeholder
|
|
27
|
-
*
|
|
27
|
+
* this ADR — `prefill` is typed and not read; `benchmarkSlot` renders only
|
|
28
|
+
* when a caller passes one. (ADR-076 Amendment 1 E's "Benchmark unavailable
|
|
29
|
+
* in manual mode" placeholder was retired by owner directive 2026-09-04 —
|
|
30
|
+
* ADR-145 amendment: a permanent "unavailable" strip on every calculator
|
|
31
|
+
* read as broken, not promising.) The live data wiring is a separate
|
|
32
|
+
* future ADR.
|
|
28
33
|
*
|
|
29
34
|
* Amendment 1 additions (2026-06-05):
|
|
30
35
|
* - `assumptions` (B) — manual-vs-connected inputs, "directional planning
|
|
31
36
|
* math, not observed performance," and the config/formula version.
|
|
32
37
|
* Rendered as a compact hover popover in the FOOTER (next to the footer
|
|
33
38
|
* note), not a body strip, so honest framing never lengthens the shell.
|
|
34
|
-
* - benchmark placeholder (E) — see above.
|
|
35
39
|
* - `copyReport` (F) — the footer Copy action emits a structured
|
|
36
40
|
* mini-report (inputs + result + StatRow chain + assumptions +
|
|
37
41
|
* benchmark status), not the bare number. Shell-owned so every
|
|
@@ -39,7 +43,7 @@
|
|
|
39
43
|
*/
|
|
40
44
|
|
|
41
45
|
import { useState, type CSSProperties, type ReactNode } from 'react'
|
|
42
|
-
import {
|
|
46
|
+
import { Copy, Info } from 'lucide-react'
|
|
43
47
|
import { Button } from './button'
|
|
44
48
|
import { toast } from './toast'
|
|
45
49
|
|
|
@@ -90,8 +94,8 @@ export interface CalculatorShellV2Props {
|
|
|
90
94
|
copyReport?: string | (() => string)
|
|
91
95
|
/** STUBBED (D9) — typed, not read this ADR. */
|
|
92
96
|
prefill?: CalcPrefill
|
|
93
|
-
/** "vs. benchmark" rail.
|
|
94
|
-
*
|
|
97
|
+
/** "vs. benchmark" rail. Rendered only when provided (the Amendment 1 E
|
|
98
|
+
* placeholder is retired — ADR-145 amendment). */
|
|
95
99
|
benchmarkSlot?: ReactNode
|
|
96
100
|
}
|
|
97
101
|
|
|
@@ -119,29 +123,6 @@ function HeaderTitle({ title }: { title: string | [string, string] }) {
|
|
|
119
123
|
)
|
|
120
124
|
}
|
|
121
125
|
|
|
122
|
-
/** Muted rail shown in place of `benchmarkSlot` until the benchmark data
|
|
123
|
-
* layer exists (Amendment 1 E) — reinforces the data-backed promise. */
|
|
124
|
-
function BenchmarkPlaceholder() {
|
|
125
|
-
return (
|
|
126
|
-
<div
|
|
127
|
-
className="flex items-center"
|
|
128
|
-
style={{
|
|
129
|
-
gap: 10,
|
|
130
|
-
padding: '12px 16px',
|
|
131
|
-
borderRadius: 'var(--radius-lg)',
|
|
132
|
-
background: 'rgb(var(--muted))',
|
|
133
|
-
border: '1px dashed rgb(var(--border))',
|
|
134
|
-
color: 'rgb(var(--text-muted))',
|
|
135
|
-
}}
|
|
136
|
-
>
|
|
137
|
-
<BarChart3 size={15} />
|
|
138
|
-
<span style={{ fontSize: 12, fontWeight: 500 }}>
|
|
139
|
-
Benchmark unavailable in manual mode
|
|
140
|
-
</span>
|
|
141
|
-
</div>
|
|
142
|
-
)
|
|
143
|
-
}
|
|
144
|
-
|
|
145
126
|
/** Footer assumptions affordance (Amendment 1 B). A compact "Assumptions"
|
|
146
127
|
* trigger that reveals the full disclaimer in a hover/focus popover. The
|
|
147
128
|
* popover is absolutely positioned, so it never lengthens the shell — the
|
|
@@ -237,10 +218,9 @@ export function CalculatorShellV2({
|
|
|
237
218
|
|
|
238
219
|
const header = (
|
|
239
220
|
<header
|
|
240
|
-
className="flex items-center"
|
|
221
|
+
className="flex items-center px-4 py-4 sm:px-6 sm:py-5"
|
|
241
222
|
style={{
|
|
242
223
|
gap: 16,
|
|
243
|
-
padding: '20px 24px',
|
|
244
224
|
background: 'rgb(var(--brand-ink))',
|
|
245
225
|
borderRadius: isOpen ? 'var(--radius-xl)' : 0,
|
|
246
226
|
}}
|
|
@@ -260,7 +240,8 @@ export function CalculatorShellV2({
|
|
|
260
240
|
</span>
|
|
261
241
|
<div className="flex-1 min-w-0">
|
|
262
242
|
<div
|
|
263
|
-
className="font-semibold uppercase"
|
|
243
|
+
className="font-semibold uppercase truncate"
|
|
244
|
+
title={eyebrow}
|
|
264
245
|
style={{
|
|
265
246
|
fontFamily: 'var(--font-mono)',
|
|
266
247
|
fontSize: 11,
|
|
@@ -287,10 +268,9 @@ export function CalculatorShellV2({
|
|
|
287
268
|
|
|
288
269
|
const footer = (
|
|
289
270
|
<footer
|
|
290
|
-
className="flex items-center"
|
|
271
|
+
className="flex flex-wrap items-center px-4 py-4 sm:px-6"
|
|
291
272
|
style={{
|
|
292
273
|
gap: 12,
|
|
293
|
-
padding: '16px 24px',
|
|
294
274
|
borderTop: isOpen ? 'none' : '1px solid rgb(var(--border))',
|
|
295
275
|
marginTop: isOpen ? 4 : 0,
|
|
296
276
|
background: isOpen ? 'transparent' : 'rgb(var(--bg-card))',
|
|
@@ -336,7 +316,7 @@ export function CalculatorShellV2({
|
|
|
336
316
|
<>
|
|
337
317
|
{inputs}
|
|
338
318
|
{result}
|
|
339
|
-
{benchmarkSlot
|
|
319
|
+
{benchmarkSlot}
|
|
340
320
|
</>
|
|
341
321
|
)
|
|
342
322
|
|
|
@@ -367,8 +347,8 @@ export function CalculatorShellV2({
|
|
|
367
347
|
>
|
|
368
348
|
{header}
|
|
369
349
|
<div
|
|
370
|
-
className="flex flex-col"
|
|
371
|
-
style={{
|
|
350
|
+
className="flex flex-col p-4 sm:p-6"
|
|
351
|
+
style={{ gap: 'var(--space-4)' }}
|
|
372
352
|
>
|
|
373
353
|
{body}
|
|
374
354
|
</div>
|