@agentero/design-system 0.22.1 → 0.22.3

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.
@@ -576,13 +576,13 @@
576
576
  <header>
577
577
  <div class="wrap">
578
578
  <h1>Manifest Debugger</h1>
579
- <div class="summary"><a class="filter-pill all" data-k="all" href="#filter-all">All</a><span class="filter-pill ok" aria-disabled="true">23 components ok</span><span class="filter-pill ok" aria-disabled="true">178 stories ok</span></div>
579
+ <div class="summary"><a class="filter-pill all" data-k="all" href="#filter-all">All</a><span class="filter-pill ok" aria-disabled="true">23 components ok</span><span class="filter-pill ok" aria-disabled="true">179 stories ok</span></div>
580
580
  </div>
581
581
  </header>
582
582
  <main>
583
583
  <div class="wrap">
584
584
  <div class="note ok" style="margin-bottom: 16px;">
585
- Using <code>react-docgen-typescript</code>. Generation took <strong>3.1s</strong>.
585
+ Using <code>react-docgen-typescript</code>. Generation took <strong>2.0s</strong>.
586
586
  </div>
587
587
  <h2 class="section-title">Components</h2>
588
588
  <div class="grid" role="list">
@@ -3134,13 +3134,13 @@ label?: ReactNode</code></pre>
3134
3134
  <div class="badges">
3135
3135
 
3136
3136
 
3137
- <label for="c-9-components-hovercard-stories" class="badge ok as-toggle">6 stories</label>
3137
+ <label for="c-9-components-hovercard-stories" class="badge ok as-toggle">7 stories</label>
3138
3138
 
3139
3139
  </div>
3140
3140
  </div>
3141
3141
  <div class="meta" title="./src/hover-card/hover-card.stories.tsx">components-hovercard · ./src/hover-card/hover-card.stories.tsx</div>
3142
3142
 
3143
- <div class="hint">HoverCard reveals rich, sighted-user preview content anchored to a trigger on pointer hover or keyboard focus. Compose it from `Root` / `Trigger` / `Portal` / `Content`.</div>
3143
+ <div class="hint">HoverCard reveals rich, sighted-user preview content anchored to a trigger on pointer hover or keyboard focus. Compose it from `Root` / `Trigger` / `Portal` / `Content`. `Trigger` takes any focusable control through `asChild`; these stories use a `secondary` Button throughout. Radix mirrors open state onto whatever you pass, so the trigger can style itself off `data-state`.</div>
3144
3144
 
3145
3145
  </div>
3146
3146
 
@@ -3164,7 +3164,7 @@ label?: ReactNode</code></pre>
3164
3164
  <div class="row">
3165
3165
  <span class="ex-name">Imports</span>
3166
3166
  </div>
3167
- <pre><code>import { Avatar, HoverCard } from "@agentero/design-system";</code></pre>
3167
+ <pre><code>import { Avatar, Button, HoverCard } from "@agentero/design-system";</code></pre>
3168
3168
  </div>
3169
3169
 
3170
3170
 
@@ -3177,10 +3177,25 @@ label?: ReactNode</code></pre>
3177
3177
  <div class="hint">Default preview revealed on hover; hides again on unhover.</div>
3178
3178
  <pre><code>const Default = () =&gt; &lt;HoverCard.Root openDelay={0} closeDelay={0}&gt;
3179
3179
  &lt;HoverCard.Trigger asChild&gt;
3180
- &lt;a
3181
- href=&quot;https://agentero.com&quot;
3182
- className=&quot;text-text-default-base-primary underline&quot;&gt;@agentero
3183
- &lt;/a&gt;
3180
+ &lt;Button variant=&quot;secondary&quot;&gt;Hover me&lt;/Button&gt;
3181
+ &lt;/HoverCard.Trigger&gt;
3182
+ &lt;HoverCard.Portal&gt;
3183
+ &lt;HoverCard.Content&gt;
3184
+ &lt;PreviewCard /&gt;
3185
+ &lt;/HoverCard.Content&gt;
3186
+ &lt;/HoverCard.Portal&gt;
3187
+ &lt;/HoverCard.Root&gt;;</code></pre>
3188
+ </div>
3189
+ <div class="note ok">
3190
+ <div class="row">
3191
+ <span class="ex-name">Abandoned Hover</span>
3192
+ <span class="badge ok">story ok</span>
3193
+ </div>
3194
+
3195
+ <div class="hint">Brushing the trigger and leaving without ever reaching the card is the most common way a hover card gets dismissed, so the exit reverses the entrance from wherever it got to. Driving it with keyframes instead would restart the exit at full opacity and scale, popping the half-faded card to fully visible on its way out.</div>
3196
+ <pre><code>const AbandonedHover = () =&gt; &lt;HoverCard.Root openDelay={0} closeDelay={0}&gt;
3197
+ &lt;HoverCard.Trigger asChild&gt;
3198
+ &lt;Button variant=&quot;secondary&quot;&gt;Hover me&lt;/Button&gt;
3184
3199
  &lt;/HoverCard.Trigger&gt;
3185
3200
  &lt;HoverCard.Portal&gt;
3186
3201
  &lt;HoverCard.Content&gt;
@@ -3198,10 +3213,7 @@ label?: ReactNode</code></pre>
3198
3213
  <div class="hint">Opens on focus as a supplementary affordance. Note this is not the same as being keyboard-accessible: focus does not move into the card and it closes on blur, so any interactive content inside stays unreachable by keyboard — never put essential actions there.</div>
3199
3214
  <pre><code>const OpensOnFocus = () =&gt; &lt;HoverCard.Root openDelay={0} closeDelay={0}&gt;
3200
3215
  &lt;HoverCard.Trigger asChild&gt;
3201
- &lt;a
3202
- href=&quot;https://agentero.com&quot;
3203
- className=&quot;text-text-default-base-primary underline&quot;&gt;@agentero
3204
- &lt;/a&gt;
3216
+ &lt;Button variant=&quot;secondary&quot;&gt;Focus me&lt;/Button&gt;
3205
3217
  &lt;/HoverCard.Trigger&gt;
3206
3218
  &lt;HoverCard.Portal&gt;
3207
3219
  &lt;HoverCard.Content&gt;
@@ -3216,15 +3228,17 @@ label?: ReactNode</code></pre>
3216
3228
  <span class="badge ok">story ok</span>
3217
3229
  </div>
3218
3230
 
3219
- <div class="hint">`side` sets the preferred placement; it flips on viewport collision.</div>
3231
+
3220
3232
  <pre><code>const Sides = args =&gt; (
3221
- &lt;div className=&quot;grid grid-cols-2 gap-10&quot;&gt;
3233
+ &lt;div className=&quot;grid grid-cols-3 grid-rows-3 gap-4&quot;&gt;
3222
3234
  {([&#39;top&#39;, &#39;right&#39;, &#39;bottom&#39;, &#39;left&#39;] as const).map(side =&gt; (
3223
3235
  &lt;HoverCard.Root key={side} {...args}&gt;
3224
3236
  &lt;HoverCard.Trigger asChild&gt;
3225
- &lt;a href=&quot;https://agentero.com&quot; className=&quot;text-text-default-base-primary underline&quot;&gt;
3237
+ {/* `capitalize` sits on the Button because Preflight resets
3238
+ text-transform on &lt;button&gt;, so it can&#39;t be inherited. */}
3239
+ &lt;Button variant=&quot;secondary&quot; className={`capitalize ${SIDE_CELL[side]}`}&gt;
3226
3240
  {side}
3227
- &lt;/a&gt;
3241
+ &lt;/Button&gt;
3228
3242
  &lt;/HoverCard.Trigger&gt;
3229
3243
  &lt;HoverCard.Portal&gt;
3230
3244
  &lt;HoverCard.Content side={side}&gt;
@@ -3242,37 +3256,36 @@ label?: ReactNode</code></pre>
3242
3256
  <span class="badge ok">story ok</span>
3243
3257
  </div>
3244
3258
 
3245
- <div class="hint">The whole point of a HoverCard over a Tooltip: freely laid-out content that may include its own links and actions. Still supplementary — never the only path to an action.</div>
3259
+ <div class="hint">The whole point of a HoverCard over a Tooltip: freely laid-out content that may include its own links and actions. Keep those actions at `secondary` or below — a primary CTA inside a card the keyboard can&#39;t reach reads as the main path to something it isn&#39;t. The trigger still has to stand on its own.</div>
3246
3260
  <pre><code>const RichContent = () =&gt; &lt;HoverCard.Root openDelay={0} closeDelay={0}&gt;
3247
3261
  &lt;HoverCard.Trigger asChild&gt;
3248
- &lt;a
3249
- href=&quot;https://agentero.com&quot;
3250
- className=&quot;text-text-default-base-primary underline&quot;&gt;@agentero
3251
- &lt;/a&gt;
3262
+ &lt;Button variant=&quot;secondary&quot;&gt;Hover me&lt;/Button&gt;
3252
3263
  &lt;/HoverCard.Trigger&gt;
3253
3264
  &lt;HoverCard.Portal&gt;
3254
- &lt;HoverCard.Content className=&quot;w-80&quot;&gt;
3255
- &lt;div className=&quot;flex flex-col gap-3&quot;&gt;
3265
+ &lt;HoverCard.Content&gt;
3266
+ {/* Identity and stats are one unit at gap-2; the action is a
3267
+ separate concern, so it gets mt-2 on top of that for 16px. */}
3268
+ &lt;div className=&quot;flex flex-col gap-2&quot;&gt;
3256
3269
  &lt;div className=&quot;flex gap-3&quot;&gt;
3257
- &lt;Avatar fallback=&quot;AG&quot; colorize=&quot;Agentero&quot; type=&quot;initials&quot; size=&quot;lg&quot; /&gt;
3258
- &lt;div className=&quot;flex flex-col gap-1&quot;&gt;
3259
- &lt;p className=&quot;font-medium text-text-default-base-primary&quot;&gt;Agentero&lt;/p&gt;
3260
- &lt;p className=&quot;text-text-default-base-tertiary&quot;&gt;Insurance marketplace for independent agents.
3270
+ &lt;Avatar fallback=&quot;AL&quot; colorize=&quot;Ada Lovelace&quot; type=&quot;initials&quot; size=&quot;lg&quot; /&gt;
3271
+ &lt;div className=&quot;flex flex-col gap-0.5&quot;&gt;
3272
+ &lt;p className=&quot;text-base font-semibold text-text-default-base-primary&quot;&gt;Ada Lovelace
3273
+ &lt;/p&gt;
3274
+ &lt;p className=&quot;text-text-default-base-tertiary&quot;&gt;Product designer on the design systems team.
3261
3275
  &lt;/p&gt;
3262
3276
  &lt;/div&gt;
3263
3277
  &lt;/div&gt;
3264
- &lt;div className=&quot;flex gap-4 text-text-default-base-secondary&quot;&gt;
3278
+ &lt;div className=&quot;flex gap-5 text-text-default-base-secondary&quot;&gt;
3265
3279
  &lt;span&gt;
3266
- &lt;span className=&quot;font-medium text-text-default-base-primary&quot;&gt;128&lt;/span&gt;carriers
3280
+ &lt;span className=&quot;font-medium text-text-default-base-primary&quot;&gt;128&lt;/span&gt;followers
3267
3281
  &lt;/span&gt;
3268
3282
  &lt;span&gt;
3269
- &lt;span className=&quot;font-medium text-text-default-base-primary&quot;&gt;50&lt;/span&gt;states
3283
+ &lt;span className=&quot;font-medium text-text-default-base-primary&quot;&gt;24&lt;/span&gt;projects
3270
3284
  &lt;/span&gt;
3271
3285
  &lt;/div&gt;
3272
- &lt;a
3273
- href=&quot;https://agentero.com&quot;
3274
- className=&quot;text-text-default-base-primary underline&quot;&gt;View profile
3275
- &lt;/a&gt;
3286
+ &lt;Button variant=&quot;secondary&quot; size=&quot;sm&quot; className=&quot;mt-2&quot; asChild&gt;
3287
+ &lt;a href=&quot;https://example.com/ada-lovelace&quot;&gt;View profile&lt;/a&gt;
3288
+ &lt;/Button&gt;
3276
3289
  &lt;/div&gt;
3277
3290
  &lt;/HoverCard.Content&gt;
3278
3291
  &lt;/HoverCard.Portal&gt;
@@ -3284,13 +3297,10 @@ label?: ReactNode</code></pre>
3284
3297
  <span class="badge ok">story ok</span>
3285
3298
  </div>
3286
3299
 
3287
- <div class="hint">An optional `Arrow` points back at the trigger; render it inside `Content`. The arrow is filled with the card background (white), so it only reads against a surface that contrasts with the card — shown here on a muted backdrop.</div>
3300
+ <div class="hint">An optional `Arrow` points back at the trigger; render it inside `Content`. It carries the card&#39;s border down both slopes and leaves its base open, so the card and the point read as one shape on any background.</div>
3288
3301
  <pre><code>const WithArrow = () =&gt; &lt;HoverCard.Root openDelay={0} closeDelay={0}&gt;
3289
3302
  &lt;HoverCard.Trigger asChild&gt;
3290
- &lt;a
3291
- href=&quot;https://agentero.com&quot;
3292
- className=&quot;text-text-default-base-primary underline&quot;&gt;@agentero
3293
- &lt;/a&gt;
3303
+ &lt;Button variant=&quot;secondary&quot;&gt;Hover me&lt;/Button&gt;
3294
3304
  &lt;/HoverCard.Trigger&gt;
3295
3305
  &lt;HoverCard.Portal&gt;
3296
3306
  &lt;HoverCard.Content&gt;
@@ -3308,12 +3318,12 @@ label?: ReactNode</code></pre>
3308
3318
 
3309
3319
  <div class="hint">`openDelay` / `closeDelay` tune the hover latency. Default is a deliberate `700ms` open so cards don&#39;t flash on incidental passes; drop it to `0` for trigger-dense UIs where an instant preview reads as more responsive.</div>
3310
3320
  <pre><code>const Delays = () =&gt; (
3311
- &lt;div className=&quot;flex gap-10&quot;&gt;
3321
+ // Grid rather than flex so both triggers take the wider label&#39;s width —
3322
+ // a size difference would read as part of what the delay changes.
3323
+ (&lt;div className=&quot;grid grid-cols-2 gap-10&quot;&gt;
3312
3324
  &lt;HoverCard.Root openDelay={700} closeDelay={300}&gt;
3313
3325
  &lt;HoverCard.Trigger asChild&gt;
3314
- &lt;a href=&quot;https://agentero.com&quot; className=&quot;text-text-default-base-primary underline&quot;&gt;
3315
- Default (700ms)
3316
- &lt;/a&gt;
3326
+ &lt;Button variant=&quot;secondary&quot;&gt;Default (700ms)&lt;/Button&gt;
3317
3327
  &lt;/HoverCard.Trigger&gt;
3318
3328
  &lt;HoverCard.Portal&gt;
3319
3329
  &lt;HoverCard.Content&gt;
@@ -3323,9 +3333,7 @@ label?: ReactNode</code></pre>
3323
3333
  &lt;/HoverCard.Root&gt;
3324
3334
  &lt;HoverCard.Root openDelay={0} closeDelay={0}&gt;
3325
3335
  &lt;HoverCard.Trigger asChild&gt;
3326
- &lt;a href=&quot;https://agentero.com&quot; className=&quot;text-text-default-base-primary underline&quot;&gt;
3327
- Instant (0ms)
3328
- &lt;/a&gt;
3336
+ &lt;Button variant=&quot;secondary&quot;&gt;Instant (0ms)&lt;/Button&gt;
3329
3337
  &lt;/HoverCard.Trigger&gt;
3330
3338
  &lt;HoverCard.Portal&gt;
3331
3339
  &lt;HoverCard.Content&gt;
@@ -3333,7 +3341,7 @@ label?: ReactNode</code></pre>
3333
3341
  &lt;/HoverCard.Content&gt;
3334
3342
  &lt;/HoverCard.Portal&gt;
3335
3343
  &lt;/HoverCard.Root&gt;
3336
- &lt;/div&gt;
3344
+ &lt;/div&gt;)
3337
3345
  );</code></pre>
3338
3346
  </div>
3339
3347
  </div>