@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.
Files changed (158) hide show
  1. package/dist/chunk-RBYWGBQ2.js +2752 -0
  2. package/dist/chunk-RBYWGBQ2.js.map +1 -0
  3. package/dist/index.d.ts +6064 -80
  4. package/dist/index.js +21561 -9696
  5. package/dist/index.js.map +1 -1
  6. package/dist/rich-composer-impl-5NO443A6.js +1859 -0
  7. package/dist/rich-composer-impl-5NO443A6.js.map +1 -0
  8. package/dist/styles.css +1586 -2
  9. package/dist/theme-v2.css +228 -0
  10. package/dist/tokens.css +121 -0
  11. package/package.json +8 -1
  12. package/src/__tests__/anchor.test.tsx +422 -0
  13. package/src/__tests__/avatar.test.tsx +272 -0
  14. package/src/__tests__/bar-chart.test.tsx +809 -0
  15. package/src/__tests__/board.test.tsx +420 -0
  16. package/src/__tests__/chart-math.test.ts +922 -0
  17. package/src/__tests__/chart-series.test.ts +339 -0
  18. package/src/__tests__/code-block.test.tsx +134 -0
  19. package/src/__tests__/combobox.test.tsx +677 -0
  20. package/src/__tests__/display-popover.test.tsx +195 -0
  21. package/src/__tests__/display-store.test.tsx +208 -0
  22. package/src/__tests__/donut-chart.test.tsx +397 -0
  23. package/src/__tests__/dropdown-menu.test.tsx +572 -0
  24. package/src/__tests__/filter-menu.test.tsx +175 -0
  25. package/src/__tests__/gauge-ring.test.tsx +233 -0
  26. package/src/__tests__/helpers/geometry.ts +58 -0
  27. package/src/__tests__/layer-stack.test.tsx +228 -0
  28. package/src/__tests__/line-chart.test.tsx +612 -0
  29. package/src/__tests__/popover.test.tsx +460 -0
  30. package/src/__tests__/ranked-bars.test.tsx +343 -0
  31. package/src/__tests__/remark-underline.test.ts +194 -0
  32. package/src/__tests__/select.test.tsx +543 -0
  33. package/src/__tests__/sparkline.test.tsx +368 -0
  34. package/src/__tests__/stat-layer.test.tsx +271 -0
  35. package/src/__tests__/stat-strip.test.tsx +175 -0
  36. package/src/__tests__/status.test.tsx +293 -0
  37. package/src/__tests__/tabs.test.tsx +303 -0
  38. package/src/__tests__/token-shape.test.ts +132 -2
  39. package/src/__tests__/tooltip.test.tsx +355 -0
  40. package/src/avatar.tsx +352 -0
  41. package/src/bar-chart.tsx +1214 -0
  42. package/src/board.tsx +658 -0
  43. package/src/calculator-shell-v2.tsx +19 -39
  44. package/src/chart-frame.tsx +960 -0
  45. package/src/chart-legend.tsx +304 -0
  46. package/src/chart-tooltip.tsx +267 -0
  47. package/src/code-block.tsx +62 -8
  48. package/src/combobox.tsx +796 -0
  49. package/src/delta-chip.tsx +263 -0
  50. package/src/detail/__tests__/activity-pane.test.tsx +186 -0
  51. package/src/detail/__tests__/detail-chrome.test.tsx +134 -0
  52. package/src/detail/__tests__/detail-surface.test.tsx +529 -0
  53. package/src/detail/__tests__/field-row.test.tsx +357 -0
  54. package/src/detail/activity-pane.tsx +507 -0
  55. package/src/detail/calendar.tsx +355 -0
  56. package/src/detail/detail-divider.tsx +261 -0
  57. package/src/detail/detail-header.tsx +287 -0
  58. package/src/detail/detail-menu.tsx +254 -0
  59. package/src/detail/detail-surface.tsx +1110 -0
  60. package/src/detail/field-list.tsx +196 -0
  61. package/src/detail/field-row.tsx +1131 -0
  62. package/src/detail/index.ts +58 -0
  63. package/src/detail/segmented-choice.tsx +94 -0
  64. package/src/detail/types.ts +129 -0
  65. package/src/display-popover.tsx +487 -0
  66. package/src/display-store.tsx +242 -0
  67. package/src/donut-chart.tsx +988 -0
  68. package/src/dropdown-menu.tsx +412 -151
  69. package/src/filter-core/EXPORTS.md +85 -0
  70. package/src/filter-core/__tests__/columns.test.ts +159 -0
  71. package/src/filter-core/__tests__/faceting.test.ts +193 -0
  72. package/src/filter-core/__tests__/filter-fns.test.ts +519 -0
  73. package/src/filter-core/__tests__/operators.test.ts +235 -0
  74. package/src/filter-core/__tests__/state.test.ts +268 -0
  75. package/src/filter-core/__tests__/url.test.ts +350 -0
  76. package/src/filter-core/columns.ts +134 -0
  77. package/src/filter-core/date-utils.ts +38 -0
  78. package/src/filter-core/examples/task-filter-columns.ts +121 -0
  79. package/src/filter-core/faceting.ts +120 -0
  80. package/src/filter-core/filter-fns.ts +335 -0
  81. package/src/filter-core/index.ts +105 -0
  82. package/src/filter-core/operators.ts +433 -0
  83. package/src/filter-core/state.ts +280 -0
  84. package/src/filter-core/types.ts +247 -0
  85. package/src/filter-core/url.ts +261 -0
  86. package/src/filter-dropdown.tsx +12 -0
  87. package/src/filter-menu.tsx +649 -0
  88. package/src/floating-drawer.tsx +19 -1
  89. package/src/gauge-ring.tsx +435 -0
  90. package/src/hue.ts +52 -0
  91. package/src/index.ts +402 -0
  92. package/src/kbd.tsx +27 -4
  93. package/src/lib/anchor.ts +427 -0
  94. package/src/lib/chart.ts +866 -0
  95. package/src/lib/focus.ts +74 -0
  96. package/src/lib/layer-stack.ts +215 -0
  97. package/src/lib/refs.ts +31 -0
  98. package/src/lib/remark-underline.ts +443 -0
  99. package/src/lib/series.ts +169 -0
  100. package/src/line-chart.tsx +1176 -0
  101. package/src/markdown.tsx +26 -7
  102. package/src/metric-card.tsx +57 -22
  103. package/src/modal.tsx +73 -66
  104. package/src/popover.tsx +407 -0
  105. package/src/progress-ledger.tsx +304 -0
  106. package/src/ranked-bars.tsx +386 -0
  107. package/src/segmented-pill.tsx +32 -9
  108. package/src/select.tsx +646 -0
  109. package/src/sortable.tsx +315 -1
  110. package/src/sparkline.tsx +416 -0
  111. package/src/stat-card.tsx +376 -0
  112. package/src/stat-row.tsx +108 -70
  113. package/src/stat-strip.tsx +327 -0
  114. package/src/status.tsx +215 -0
  115. package/src/styles.css +1586 -2
  116. package/src/tabs.tsx +206 -25
  117. package/src/task-card.tsx +610 -0
  118. package/src/thread/__tests__/comment-body-hostile.test.tsx +331 -0
  119. package/src/thread/__tests__/comment-tree.test.ts +151 -0
  120. package/src/thread/__tests__/emoji.test.ts +187 -0
  121. package/src/thread/__tests__/fixtures/thread-fixture.ts +235 -0
  122. package/src/thread/__tests__/link-preview-source.test.ts +120 -0
  123. package/src/thread/__tests__/link-preview.test.tsx +600 -0
  124. package/src/thread/__tests__/markdown-format.test.ts +82 -0
  125. package/src/thread/__tests__/markdown-spec.test.ts +469 -0
  126. package/src/thread/__tests__/relative-time.test.ts +71 -0
  127. package/src/thread/__tests__/rich-composer.test.tsx +799 -0
  128. package/src/thread/__tests__/scroll-caret.test.ts +58 -0
  129. package/src/thread/__tests__/suggestion-list.test.tsx +648 -0
  130. package/src/thread/__tests__/thread-scroll-ownership.test.tsx +88 -0
  131. package/src/thread/__tests__/thread.test.tsx +662 -0
  132. package/src/thread/__tests__/use-attachments.test.tsx +679 -0
  133. package/src/thread/actions.tsx +196 -0
  134. package/src/thread/attachments.tsx +1071 -0
  135. package/src/thread/comment-body.tsx +148 -0
  136. package/src/thread/comment-tree.ts +182 -0
  137. package/src/thread/comment.tsx +915 -0
  138. package/src/thread/composer-footer.tsx +125 -0
  139. package/src/thread/composer.tsx +319 -0
  140. package/src/thread/emoji.ts +283 -0
  141. package/src/thread/index.ts +153 -0
  142. package/src/thread/link-preview.tsx +341 -0
  143. package/src/thread/markdown-format.ts +155 -0
  144. package/src/thread/markdown-spec.ts +754 -0
  145. package/src/thread/rail.tsx +372 -0
  146. package/src/thread/reactions.tsx +415 -0
  147. package/src/thread/relative-time.tsx +94 -0
  148. package/src/thread/rich-composer-impl.tsx +1601 -0
  149. package/src/thread/rich-composer.tsx +195 -0
  150. package/src/thread/scroll-caret.ts +37 -0
  151. package/src/thread/suggestion-list.tsx +182 -0
  152. package/src/thread/thread.tsx +718 -0
  153. package/src/thread/types.ts +218 -0
  154. package/src/thread/use-attachments.ts +598 -0
  155. package/src/thread/use-now.ts +73 -0
  156. package/src/thread/use-thread.ts +316 -0
  157. package/src/tokens.css +121 -0
  158. 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. Per ADR-076 Amendment 1 E,
25
- * `benchmarkSlot` now renders a muted "Benchmark unavailable in manual
26
- * mode" placeholder when absent (was: nothing). The live data wiring is a
27
- * separate future ADR.
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 { BarChart3, Copy, Info } from 'lucide-react'
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. When absent, the shell renders a muted
94
- * "Benchmark unavailable in manual mode" placeholder (Amendment 1 E). */
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 ?? <BenchmarkPlaceholder />}
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={{ padding: 'var(--space-6)', gap: 'var(--space-4)' }}
350
+ className="flex flex-col p-4 sm:p-6"
351
+ style={{ gap: 'var(--space-4)' }}
372
352
  >
373
353
  {body}
374
354
  </div>