@agentero/design-system 0.11.0 → 0.13.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.
@@ -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">12 components ok</span><span class="filter-pill ok" aria-disabled="true">127 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">14 components ok</span><span class="filter-pill ok" aria-disabled="true">138 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.0s</strong>.
585
+ Using <code>react-docgen-typescript</code>. Generation took <strong>2.9s</strong>.
586
586
  </div>
587
587
  <h2 class="section-title">Components</h2>
588
588
  <div class="grid" role="list">
@@ -3220,6 +3220,171 @@ totalCount: number</code></pre>
3220
3220
 
3221
3221
  </div>
3222
3222
  </article>
3223
+ <article
3224
+ class="card
3225
+ no-error
3226
+ no-info
3227
+ no-story-error
3228
+ no-doc-error"
3229
+ role="listitem"
3230
+ aria-label="Switch">
3231
+ <div class="head">
3232
+ <div class="title">
3233
+ <h2><span class="status-dot dot-ok"></span> Switch</h2>
3234
+ <div class="badges">
3235
+ <label for="c-9-components-switch-props" class="badge ok as-toggle">2 prop types</label>
3236
+
3237
+ <label for="c-9-components-switch-stories" class="badge ok as-toggle">6 stories</label>
3238
+
3239
+ </div>
3240
+ </div>
3241
+ <div class="meta" title="./src/switch/switch.stories.tsx">components-switch · ./src/switch/switch.stories.tsx</div>
3242
+
3243
+ <div class="hint">Two-state toggle for a setting that takes effect immediately. Prefer it over a Checkbox for a single boolean that applies instantly, and pair it with a `&lt;label htmlFor&gt;` to give it an accessible name.</div>
3244
+
3245
+ </div>
3246
+
3247
+ <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
3248
+
3249
+
3250
+ <input id="c-9-components-switch-stories" class="tg tg-stories" type="checkbox" hidden />
3251
+
3252
+ <input id="c-9-components-switch-props" class="tg tg-props" type="checkbox" hidden />
3253
+
3254
+ <div class="panels">
3255
+
3256
+
3257
+
3258
+ <div class="panel panel-props">
3259
+ <div class="note ok">
3260
+ <div class="row">
3261
+ <span class="ex-name">Prop types <small>(react-docgen-typescript)</small></span>
3262
+ <span class="badge ok">2 prop types</span>
3263
+ </div>
3264
+ <pre><code>Component: src/switch/switch.tsx::Switch</code></pre>
3265
+ <pre><code>Props:</code></pre>
3266
+ <pre><code>asChild?: boolean
3267
+
3268
+ size?: &quot;sm&quot; | &quot;md&quot;</code></pre>
3269
+ </div>
3270
+ </div>
3271
+
3272
+ <div class="panel panel-stories">
3273
+
3274
+
3275
+
3276
+ <div class="note ok">
3277
+ <div class="row">
3278
+ <span class="ex-name">Imports</span>
3279
+ </div>
3280
+ <pre><code>import { Switch } from "@agentero/design-system";</code></pre>
3281
+ </div>
3282
+
3283
+
3284
+ <div class="note ok">
3285
+ <div class="row">
3286
+ <span class="ex-name">Default</span>
3287
+ <span class="badge ok">story ok</span>
3288
+ </div>
3289
+
3290
+
3291
+ <pre><code>const Default = () =&gt; &lt;Switch size=&quot;md&quot; disabled={false} defaultChecked aria-label=&quot;Toggle setting&quot; /&gt;;</code></pre>
3292
+ </div>
3293
+ <div class="note ok">
3294
+ <div class="row">
3295
+ <span class="ex-name">Sizes</span>
3296
+ <span class="badge ok">story ok</span>
3297
+ </div>
3298
+
3299
+ <div class="hint">The `sm` and `md` sizes compared.</div>
3300
+ <pre><code>const Sizes = () =&gt; (
3301
+ &lt;div className=&quot;flex items-center gap-6&quot;&gt;
3302
+ &lt;div className=&quot;flex items-center gap-2&quot;&gt;
3303
+ &lt;Switch id=&quot;size-sm&quot; size=&quot;sm&quot; defaultChecked /&gt;
3304
+ &lt;label htmlFor=&quot;size-sm&quot; className=&quot;text-sm text-text-default-base-primary&quot;&gt;
3305
+ Small
3306
+ &lt;/label&gt;
3307
+ &lt;/div&gt;
3308
+ &lt;div className=&quot;flex items-center gap-2&quot;&gt;
3309
+ &lt;Switch id=&quot;size-md&quot; size=&quot;md&quot; defaultChecked /&gt;
3310
+ &lt;label htmlFor=&quot;size-md&quot; className=&quot;text-sm text-text-default-base-primary&quot;&gt;
3311
+ Medium
3312
+ &lt;/label&gt;
3313
+ &lt;/div&gt;
3314
+ &lt;/div&gt;
3315
+ );</code></pre>
3316
+ </div>
3317
+ <div class="note ok">
3318
+ <div class="row">
3319
+ <span class="ex-name">States</span>
3320
+ <span class="badge ok">story ok</span>
3321
+ </div>
3322
+
3323
+ <div class="hint">Unchecked and checked tracks.</div>
3324
+ <pre><code>const States = () =&gt; &lt;div className=&quot;flex items-center gap-6&quot;&gt;
3325
+ &lt;Switch size=&quot;md&quot; disabled={false} defaultChecked={false} aria-label=&quot;Off&quot; /&gt;
3326
+ &lt;Switch size=&quot;md&quot; disabled={false} defaultChecked aria-label=&quot;On&quot; /&gt;
3327
+ &lt;/div&gt;;</code></pre>
3328
+ </div>
3329
+ <div class="note ok">
3330
+ <div class="row">
3331
+ <span class="ex-name">Disabled</span>
3332
+ <span class="badge ok">story ok</span>
3333
+ </div>
3334
+
3335
+ <div class="hint">Disabled switches are dimmed and reject pointer and keyboard interaction.</div>
3336
+ <pre><code>const Disabled = () =&gt; (
3337
+ &lt;div className=&quot;flex items-center gap-6&quot;&gt;
3338
+ &lt;Switch disabled aria-label=&quot;Disabled off&quot; /&gt;
3339
+ &lt;Switch disabled defaultChecked aria-label=&quot;Disabled on&quot; /&gt;
3340
+ &lt;/div&gt;
3341
+ );</code></pre>
3342
+ </div>
3343
+ <div class="note ok">
3344
+ <div class="row">
3345
+ <span class="ex-name">Controlled</span>
3346
+ <span class="badge ok">story ok</span>
3347
+ </div>
3348
+
3349
+ <div class="hint">Controlled switch wired to component state via `checked` + `onCheckedChange`.</div>
3350
+ <pre><code>const Controlled = () =&gt; {
3351
+ const [enabled, setEnabled] = useState(false);
3352
+
3353
+ return (
3354
+ &lt;div className=&quot;flex items-center gap-2&quot;&gt;
3355
+ &lt;Switch id=&quot;controlled&quot; checked={enabled} onCheckedChange={setEnabled} /&gt;
3356
+ &lt;label htmlFor=&quot;controlled&quot; className=&quot;text-sm text-text-default-base-primary&quot;&gt;
3357
+ Notifications {enabled ? &#39;on&#39; : &#39;off&#39;}
3358
+ &lt;/label&gt;
3359
+ &lt;/div&gt;
3360
+ );
3361
+ };</code></pre>
3362
+ </div>
3363
+ <div class="note ok">
3364
+ <div class="row">
3365
+ <span class="ex-name">Setting Row</span>
3366
+ <span class="badge ok">story ok</span>
3367
+ </div>
3368
+
3369
+ <div class="hint">Switch aligned in a labelled settings row.</div>
3370
+ <pre><code>const SettingRow = () =&gt; (
3371
+ &lt;div className=&quot;flex w-80 items-center justify-between gap-4 rounded-lg border border-border-default-base-primary bg-bg-default-base-primary p-4&quot;&gt;
3372
+ &lt;div className=&quot;flex flex-col gap-0.5&quot;&gt;
3373
+ &lt;label htmlFor=&quot;marketing&quot; className=&quot;text-sm font-medium text-text-default-base-primary&quot;&gt;
3374
+ Marketing emails
3375
+ &lt;/label&gt;
3376
+ &lt;p className=&quot;text-xs text-text-default-base-secondary&quot;&gt;
3377
+ Receive product updates and offers.
3378
+ &lt;/p&gt;
3379
+ &lt;/div&gt;
3380
+ &lt;Switch id=&quot;marketing&quot; defaultChecked /&gt;
3381
+ &lt;/div&gt;
3382
+ );</code></pre>
3383
+ </div>
3384
+ </div>
3385
+
3386
+ </div>
3387
+ </article>
3223
3388
  <article
3224
3389
  class="card
3225
3390
  no-error
@@ -3234,7 +3399,7 @@ totalCount: number</code></pre>
3234
3399
  <div class="badges">
3235
3400
 
3236
3401
 
3237
- <label for="c-9-components-table-stories" class="badge ok as-toggle">9 stories</label>
3402
+ <label for="c-10-components-table-stories" class="badge ok as-toggle">9 stories</label>
3238
3403
 
3239
3404
  </div>
3240
3405
  </div>
@@ -3247,7 +3412,7 @@ totalCount: number</code></pre>
3247
3412
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
3248
3413
 
3249
3414
 
3250
- <input id="c-9-components-table-stories" class="tg tg-stories" type="checkbox" hidden />
3415
+ <input id="c-10-components-table-stories" class="tg tg-stories" type="checkbox" hidden />
3251
3416
 
3252
3417
 
3253
3418
 
@@ -3421,9 +3586,9 @@ import { Fragment } from "react";</code></pre>
3421
3586
  <div class="title">
3422
3587
  <h2><span class="status-dot dot-ok"></span> Tag</h2>
3423
3588
  <div class="badges">
3424
- <label for="c-10-components-tag-props" class="badge ok as-toggle">6 prop types</label>
3589
+ <label for="c-11-components-tag-props" class="badge ok as-toggle">6 prop types</label>
3425
3590
 
3426
- <label for="c-10-components-tag-stories" class="badge ok as-toggle">10 stories</label>
3591
+ <label for="c-11-components-tag-stories" class="badge ok as-toggle">10 stories</label>
3427
3592
 
3428
3593
  </div>
3429
3594
  </div>
@@ -3436,9 +3601,9 @@ import { Fragment } from "react";</code></pre>
3436
3601
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
3437
3602
 
3438
3603
 
3439
- <input id="c-10-components-tag-stories" class="tg tg-stories" type="checkbox" hidden />
3604
+ <input id="c-11-components-tag-stories" class="tg tg-stories" type="checkbox" hidden />
3440
3605
 
3441
- <input id="c-10-components-tag-props" class="tg tg-props" type="checkbox" hidden />
3606
+ <input id="c-11-components-tag-props" class="tg tg-props" type="checkbox" hidden />
3442
3607
 
3443
3608
  <div class="panels">
3444
3609
 
@@ -3795,9 +3960,9 @@ variant?: &quot;ghost&quot; | &quot;secondary&quot; | &quot;tertiary&quot; | &qu
3795
3960
  <div class="title">
3796
3961
  <h2><span class="status-dot dot-ok"></span> Toast</h2>
3797
3962
  <div class="badges">
3798
- <label for="c-11-components-toast-props" class="badge ok as-toggle">11 prop types</label>
3963
+ <label for="c-12-components-toast-props" class="badge ok as-toggle">11 prop types</label>
3799
3964
 
3800
- <label for="c-11-components-toast-stories" class="badge ok as-toggle">11 stories</label>
3965
+ <label for="c-12-components-toast-stories" class="badge ok as-toggle">11 stories</label>
3801
3966
 
3802
3967
  </div>
3803
3968
  </div>
@@ -3810,9 +3975,9 @@ variant?: &quot;ghost&quot; | &quot;secondary&quot; | &quot;tertiary&quot; | &qu
3810
3975
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
3811
3976
 
3812
3977
 
3813
- <input id="c-11-components-toast-stories" class="tg tg-stories" type="checkbox" hidden />
3978
+ <input id="c-12-components-toast-stories" class="tg tg-stories" type="checkbox" hidden />
3814
3979
 
3815
- <input id="c-11-components-toast-props" class="tg tg-props" type="checkbox" hidden />
3980
+ <input id="c-12-components-toast-props" class="tg tg-props" type="checkbox" hidden />
3816
3981
 
3817
3982
  <div class="panels">
3818
3983
 
@@ -4207,6 +4372,188 @@ visibleToasts?: number</code></pre>
4207
4372
  </div>
4208
4373
  </div>
4209
4374
 
4375
+ </div>
4376
+ </article>
4377
+ <article
4378
+ class="card
4379
+ no-error
4380
+ no-info
4381
+ no-story-error
4382
+ no-doc-error"
4383
+ role="listitem"
4384
+ aria-label="Tooltip">
4385
+ <div class="head">
4386
+ <div class="title">
4387
+ <h2><span class="status-dot dot-ok"></span> Tooltip</h2>
4388
+ <div class="badges">
4389
+ <label for="c-13-components-tooltip-props" class="badge ok as-toggle">9 prop types</label>
4390
+
4391
+ <label for="c-13-components-tooltip-stories" class="badge ok as-toggle">5 stories</label>
4392
+
4393
+ </div>
4394
+ </div>
4395
+ <div class="meta" title="./src/tooltip/tooltip.stories.tsx">components-tooltip · ./src/tooltip/tooltip.stories.tsx</div>
4396
+
4397
+ <div class="hint">Tooltip reveals a short, non-essential hint anchored to a trigger element on hover or focus.</div>
4398
+
4399
+ </div>
4400
+
4401
+ <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
4402
+
4403
+
4404
+ <input id="c-13-components-tooltip-stories" class="tg tg-stories" type="checkbox" hidden />
4405
+
4406
+ <input id="c-13-components-tooltip-props" class="tg tg-props" type="checkbox" hidden />
4407
+
4408
+ <div class="panels">
4409
+
4410
+
4411
+
4412
+ <div class="panel panel-props">
4413
+ <div class="note ok">
4414
+ <div class="row">
4415
+ <span class="ex-name">Prop types <small>(react-docgen-typescript)</small></span>
4416
+ <span class="badge ok">9 prop types</span>
4417
+ </div>
4418
+ <pre><code>Component: src/tooltip/tooltip.tsx::Tooltip</code></pre>
4419
+ <pre><code>Props:</code></pre>
4420
+ <pre><code>/**
4421
+ * Preferred alignment against the trigger. Defaults to `&#39;center&#39;`.
4422
+ */
4423
+ align?: &quot;center&quot; | &quot;start&quot; | &quot;end&quot;
4424
+
4425
+ /**
4426
+ * Merge Radix&#39;s behavior onto an already-interactive child instead of wrapping it in a `&lt;button&gt;`. Defaults to `false`.
4427
+ */
4428
+ asChild?: boolean = false
4429
+
4430
+ /**
4431
+ * The trigger element. Hovering or focusing it reveals the tooltip.
4432
+ */
4433
+ children: ReactNode
4434
+
4435
+ /**
4436
+ * Extra classes for the content surface, merged last.
4437
+ */
4438
+ className?: string
4439
+
4440
+ /**
4441
+ * The floating hint. Keep it short — labels or hints, not paragraphs.
4442
+ */
4443
+ content: ReactNode
4444
+
4445
+ /**
4446
+ * Delay in ms before opening on hover. Defaults to `0`; focus always opens instantly.
4447
+ */
4448
+ delayDuration?: number = 0
4449
+
4450
+ /**
4451
+ * Hide the tooltip when the trigger is clipped away (e.g. scrolled out of an `overflow` container).
4452
+ */
4453
+ hideWhenDetached?: boolean
4454
+
4455
+ /**
4456
+ * Preferred side of the trigger; flips on collision. Defaults to `&#39;top&#39;`.
4457
+ */
4458
+ side?: &quot;top&quot; | &quot;right&quot; | &quot;bottom&quot; | &quot;left&quot; = top
4459
+
4460
+ /**
4461
+ * Distance in pixels between the tooltip and its trigger. Defaults to `4`.
4462
+ */
4463
+ sideOffset?: number = 4</code></pre>
4464
+ </div>
4465
+ </div>
4466
+
4467
+ <div class="panel panel-stories">
4468
+
4469
+
4470
+
4471
+ <div class="note ok">
4472
+ <div class="row">
4473
+ <span class="ex-name">Imports</span>
4474
+ </div>
4475
+ <pre><code>import { Button, Tooltip } from "@agentero/design-system";</code></pre>
4476
+ </div>
4477
+
4478
+
4479
+ <div class="note ok">
4480
+ <div class="row">
4481
+ <span class="ex-name">Default</span>
4482
+ <span class="badge ok">story ok</span>
4483
+ </div>
4484
+
4485
+ <div class="hint">Default hint revealed on hover; hides again on unhover.</div>
4486
+ <pre><code>const Default = () =&gt; &lt;Tooltip content=&quot;Archive this carrier&quot; side=&quot;top&quot; asChild&gt;
4487
+ &lt;Button variant=&quot;secondary&quot;&gt;Hover me&lt;/Button&gt;
4488
+ &lt;/Tooltip&gt;;</code></pre>
4489
+ </div>
4490
+ <div class="note ok">
4491
+ <div class="row">
4492
+ <span class="ex-name">Opens On Focus</span>
4493
+ <span class="badge ok">story ok</span>
4494
+ </div>
4495
+
4496
+ <div class="hint">Opens on keyboard focus too, wiring `aria-describedby` on the trigger.</div>
4497
+ <pre><code>const OpensOnFocus = () =&gt; &lt;Tooltip content=&quot;Archive this carrier&quot; side=&quot;top&quot; asChild&gt;
4498
+ &lt;Button variant=&quot;secondary&quot;&gt;Focus me&lt;/Button&gt;
4499
+ &lt;/Tooltip&gt;;</code></pre>
4500
+ </div>
4501
+ <div class="note ok">
4502
+ <div class="row">
4503
+ <span class="ex-name">Sides</span>
4504
+ <span class="badge ok">story ok</span>
4505
+ </div>
4506
+
4507
+ <div class="hint">`side` sets the preferred placement; it flips on viewport collision.</div>
4508
+ <pre><code>const Sides = () =&gt; (
4509
+ &lt;div className=&quot;grid grid-cols-2 gap-6&quot;&gt;
4510
+ &lt;Tooltip content=&quot;Tooltip on top&quot; side=&quot;top&quot; asChild&gt;
4511
+ &lt;Button variant=&quot;secondary&quot;&gt;Top&lt;/Button&gt;
4512
+ &lt;/Tooltip&gt;
4513
+ &lt;Tooltip content=&quot;Tooltip on the right&quot; side=&quot;right&quot; asChild&gt;
4514
+ &lt;Button variant=&quot;secondary&quot;&gt;Right&lt;/Button&gt;
4515
+ &lt;/Tooltip&gt;
4516
+ &lt;Tooltip content=&quot;Tooltip on the bottom&quot; side=&quot;bottom&quot; asChild&gt;
4517
+ &lt;Button variant=&quot;secondary&quot;&gt;Bottom&lt;/Button&gt;
4518
+ &lt;/Tooltip&gt;
4519
+ &lt;Tooltip content=&quot;Tooltip on the left&quot; side=&quot;left&quot; asChild&gt;
4520
+ &lt;Button variant=&quot;secondary&quot;&gt;Left&lt;/Button&gt;
4521
+ &lt;/Tooltip&gt;
4522
+ &lt;/div&gt;
4523
+ );</code></pre>
4524
+ </div>
4525
+ <div class="note ok">
4526
+ <div class="row">
4527
+ <span class="ex-name">As Child</span>
4528
+ <span class="badge ok">story ok</span>
4529
+ </div>
4530
+
4531
+ <div class="hint">`asChild` decorates an already-interactive trigger instead of wrapping it in a `&lt;button&gt;`.</div>
4532
+ <pre><code>const AsChild = () =&gt; &lt;Tooltip content=&quot;Opens in a new tab&quot; side=&quot;bottom&quot; asChild&gt;
4533
+ &lt;a
4534
+ href=&quot;https://agentero.com&quot;
4535
+ target=&quot;_blank&quot;
4536
+ rel=&quot;noreferrer&quot;
4537
+ className=&quot;text-text-default-base-primary underline&quot;&gt;Docs
4538
+ &lt;/a&gt;
4539
+ &lt;/Tooltip&gt;;</code></pre>
4540
+ </div>
4541
+ <div class="note ok">
4542
+ <div class="row">
4543
+ <span class="ex-name">Long Content</span>
4544
+ <span class="badge ok">story ok</span>
4545
+ </div>
4546
+
4547
+ <div class="hint">Content wraps at the `32ch` max width.</div>
4548
+ <pre><code>const LongContent = () =&gt; &lt;Tooltip
4549
+ content=&quot;This carrier requires a completed appointment before you can request quotes for this line of business.&quot;
4550
+ side=&quot;top&quot;
4551
+ asChild&gt;
4552
+ &lt;Button variant=&quot;secondary&quot;&gt;Why is this disabled?&lt;/Button&gt;
4553
+ &lt;/Tooltip&gt;;</code></pre>
4554
+ </div>
4555
+ </div>
4556
+
4210
4557
  </div>
4211
4558
  </article>
4212
4559
  </div>