@agentero/design-system 0.7.4 → 0.8.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,7 +576,7 @@
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">8 components ok</span><span class="filter-pill ok" aria-disabled="true">97 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">9 components ok</span><span class="filter-pill ok" aria-disabled="true">104 stories ok</span></div>
580
580
  </div>
581
581
  </header>
582
582
  <main>
@@ -919,12 +919,7 @@ size?: AlertSizeType = sm</code></pre>
919
919
  </div>
920
920
  <div>Alert with a dismiss button</div>
921
921
  <div class="hint">Dismissible alert. Providing `onDismiss` shows an icon-only close button with `aria-label=&quot;Dismiss&quot;` that inherits the alert&#39;s color.</div>
922
- <pre><code>const WithDismiss = () =&gt; &lt;Alert
923
- color=&quot;warning&quot;
924
- size=&quot;sm&quot;
925
- ghost={false}
926
- hasIcon
927
- onDismiss={onDismiss ? () =&gt; {} : undefined}&gt;
922
+ <pre><code>const WithDismiss = () =&gt; &lt;Alert color=&quot;warning&quot; size=&quot;sm&quot; ghost={false} hasIcon onDismiss={fn()}&gt;
928
923
  &lt;Alert.Content&gt;
929
924
  &lt;Alert.Title&gt;Title&lt;/Alert.Title&gt;
930
925
  &lt;Alert.Paragraph&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit.&lt;/Alert.Paragraph&gt;
@@ -2663,6 +2658,167 @@ size?: &quot;sm&quot; | &quot;md&quot; | &quot;lg&quot;</code></pre>
2663
2658
 
2664
2659
  </div>
2665
2660
  </article>
2661
+ <article
2662
+ class="card
2663
+ no-error
2664
+ no-info
2665
+ no-story-error
2666
+ no-doc-error"
2667
+ role="listitem"
2668
+ aria-label="Pagination">
2669
+ <div class="head">
2670
+ <div class="title">
2671
+ <h2><span class="status-dot dot-ok"></span> Pagination</h2>
2672
+ <div class="badges">
2673
+ <label for="c-6-components-pagination-props" class="badge ok as-toggle">5 prop types</label>
2674
+
2675
+ <label for="c-6-components-pagination-stories" class="badge ok as-toggle">7 stories</label>
2676
+
2677
+ </div>
2678
+ </div>
2679
+ <div class="meta" title="./src/pagination/pagination.stories.tsx">components-pagination · ./src/pagination/pagination.stories.tsx</div>
2680
+
2681
+ <div class="hint">Pagination is a 1-indexed paged navigation control with previous/next icon buttons, numeric page buttons, and a leading &quot;X - Y of Z&quot; entries summary. The page list collapses long ranges with `…` ellipses so the control stays compact regardless of total page count. Use it for lists, tables, or grids that are split across pages.</div>
2682
+
2683
+ </div>
2684
+
2685
+ <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
2686
+
2687
+
2688
+ <input id="c-6-components-pagination-stories" class="tg tg-stories" type="checkbox" hidden />
2689
+
2690
+ <input id="c-6-components-pagination-props" class="tg tg-props" type="checkbox" hidden />
2691
+
2692
+ <div class="panels">
2693
+
2694
+
2695
+
2696
+ <div class="panel panel-props">
2697
+ <div class="note ok">
2698
+ <div class="row">
2699
+ <span class="ex-name">Prop types <small>(react-docgen-typescript)</small></span>
2700
+ <span class="badge ok">5 prop types</span>
2701
+ </div>
2702
+ <pre><code>Component: src/pagination/pagination.tsx::Pagination</code></pre>
2703
+ <pre><code>Props:</code></pre>
2704
+ <pre><code>className?: string
2705
+
2706
+ currentPage: number
2707
+
2708
+ onPageChange: (page: number) =&gt; void
2709
+
2710
+ pageSize: number
2711
+
2712
+ totalCount: number</code></pre>
2713
+ </div>
2714
+ </div>
2715
+
2716
+ <div class="panel panel-stories">
2717
+
2718
+
2719
+
2720
+ <div class="note ok">
2721
+ <div class="row">
2722
+ <span class="ex-name">Imports</span>
2723
+ </div>
2724
+ <pre><code>import { Pagination } from "@agentero/design-system";</code></pre>
2725
+ </div>
2726
+
2727
+
2728
+ <div class="note ok">
2729
+ <div class="row">
2730
+ <span class="ex-name">Default</span>
2731
+ <span class="badge ok">story ok</span>
2732
+ </div>
2733
+ <div>Default args playground for Pagination</div>
2734
+ <div class="hint">Default args playground. The first page of a 1,000-item list paged 10 at a time — renders pages 1–5, an ellipsis, and the last page (100), with the previous-page button disabled because we&#39;re on page 1.</div>
2735
+ <pre><code>const Default = () =&gt; &lt;Pagination currentPage={1} totalCount={1000} pageSize={10} onPageChange={fn()} /&gt;;</code></pre>
2736
+ </div>
2737
+ <div class="note ok">
2738
+ <div class="row">
2739
+ <span class="ex-name">Few Pages</span>
2740
+ <span class="badge ok">story ok</span>
2741
+ </div>
2742
+ <div>Short page list with no ellipsis collapse</div>
2743
+ <div class="hint">Short list whose total pages fit in the visible window — no ellipsis is rendered. Exercises the `totalPageNumbers &gt;= totalPageCount` branch in `getPages`.</div>
2744
+ <pre><code>const FewPages = () =&gt; &lt;Pagination
2745
+ currentPage={2}
2746
+ totalCount={30}
2747
+ pageSize={10}
2748
+ onPageChange={(page: number) =&gt; console.log(&#39;onPageChange&#39;, page)} /&gt;;</code></pre>
2749
+ </div>
2750
+ <div class="note ok">
2751
+ <div class="row">
2752
+ <span class="ex-name">Dots Right</span>
2753
+ <span class="badge ok">story ok</span>
2754
+ </div>
2755
+ <div>Right-side ellipsis only (current page near start)</div>
2756
+ <div class="hint">Current page sits near the start of the range — left ellipsis is hidden, right ellipsis is shown, and the last page button anchors the right edge.</div>
2757
+ <pre><code>const DotsRight = () =&gt; &lt;Pagination
2758
+ currentPage={2}
2759
+ totalCount={1000}
2760
+ pageSize={10}
2761
+ onPageChange={(page: number) =&gt; console.log(&#39;onPageChange&#39;, page)} /&gt;;</code></pre>
2762
+ </div>
2763
+ <div class="note ok">
2764
+ <div class="row">
2765
+ <span class="ex-name">Dots Left</span>
2766
+ <span class="badge ok">story ok</span>
2767
+ </div>
2768
+ <div>Left-side ellipsis only (current page near end)</div>
2769
+ <div class="hint">Current page sits near the end of the range — left ellipsis is shown, right ellipsis is hidden, and the first page button anchors the left edge.</div>
2770
+ <pre><code>const DotsLeft = () =&gt; &lt;Pagination
2771
+ currentPage={99}
2772
+ totalCount={1000}
2773
+ pageSize={10}
2774
+ onPageChange={(page: number) =&gt; console.log(&#39;onPageChange&#39;, page)} /&gt;;</code></pre>
2775
+ </div>
2776
+ <div class="note ok">
2777
+ <div class="row">
2778
+ <span class="ex-name">Dots Both</span>
2779
+ <span class="badge ok">story ok</span>
2780
+ </div>
2781
+ <div>Both ellipses visible (current page in middle)</div>
2782
+ <div class="hint">Current page sits in the middle of the range — both ellipses are visible, with the first and last page buttons anchoring each edge.</div>
2783
+ <pre><code>const DotsBoth = () =&gt; &lt;Pagination
2784
+ currentPage={50}
2785
+ totalCount={1000}
2786
+ pageSize={10}
2787
+ onPageChange={(page: number) =&gt; console.log(&#39;onPageChange&#39;, page)} /&gt;;</code></pre>
2788
+ </div>
2789
+ <div class="note ok">
2790
+ <div class="row">
2791
+ <span class="ex-name">Last Page</span>
2792
+ <span class="badge ok">story ok</span>
2793
+ </div>
2794
+ <div>Last page selected with disabled next button</div>
2795
+ <div class="hint">Last page selected — the next-page button is disabled and the active page indicator sits on the trailing number.</div>
2796
+ <pre><code>const LastPage = () =&gt; &lt;Pagination currentPage={100} totalCount={1000} pageSize={10} onPageChange={fn()} /&gt;;</code></pre>
2797
+ </div>
2798
+ <div class="note ok">
2799
+ <div class="row">
2800
+ <span class="ex-name">Controlled</span>
2801
+ <span class="badge ok">story ok</span>
2802
+ </div>
2803
+ <div>Interactive controlled example backed by `useState`</div>
2804
+ <div class="hint">Interactive controlled example. Local `useState` owns the page; clicking a page, previous, or next button updates it so the active page indicator and entries summary follow along.</div>
2805
+ <pre><code>const Controlled = ({ totalCount, pageSize }) =&gt; {
2806
+ const [page, setPage] = useState(1);
2807
+
2808
+ return (
2809
+ &lt;Pagination
2810
+ currentPage={page}
2811
+ totalCount={totalCount}
2812
+ pageSize={pageSize}
2813
+ onPageChange={setPage}
2814
+ /&gt;
2815
+ );
2816
+ };</code></pre>
2817
+ </div>
2818
+ </div>
2819
+
2820
+ </div>
2821
+ </article>
2666
2822
  <article
2667
2823
  class="card
2668
2824
  no-error
@@ -2677,7 +2833,7 @@ size?: &quot;sm&quot; | &quot;md&quot; | &quot;lg&quot;</code></pre>
2677
2833
  <div class="badges">
2678
2834
 
2679
2835
 
2680
- <label for="c-6-components-statusball-stories" class="badge ok as-toggle">12 stories</label>
2836
+ <label for="c-7-components-statusball-stories" class="badge ok as-toggle">12 stories</label>
2681
2837
 
2682
2838
  </div>
2683
2839
  </div>
@@ -2690,7 +2846,7 @@ size?: &quot;sm&quot; | &quot;md&quot; | &quot;lg&quot;</code></pre>
2690
2846
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
2691
2847
 
2692
2848
 
2693
- <input id="c-6-components-statusball-stories" class="tg tg-stories" type="checkbox" hidden />
2849
+ <input id="c-7-components-statusball-stories" class="tg tg-stories" type="checkbox" hidden />
2694
2850
 
2695
2851
 
2696
2852
 
@@ -2760,7 +2916,7 @@ size?: &quot;sm&quot; | &quot;md&quot; | &quot;lg&quot;</code></pre>
2760
2916
  </div>
2761
2917
  <div>Success dot for positive or active statuses</div>
2762
2918
  <div class="hint">Success dot for positive / active states — the most common pairing for &quot;live&quot; records such as active licenses or confirmed appointments.</div>
2763
- <pre><code>const Success = () =&gt; &lt;StatusBall color=&quot;success&quot; /&gt;;</code></pre>
2919
+ <pre><code>const Success = () =&gt; &lt;StatusBall color=&quot;success&quot; data-testid=&quot;status-ball-success&quot; /&gt;;</code></pre>
2764
2920
  </div>
2765
2921
  <div class="note ok">
2766
2922
  <div class="row">
@@ -2895,9 +3051,9 @@ size?: &quot;sm&quot; | &quot;md&quot; | &quot;lg&quot;</code></pre>
2895
3051
  <div class="title">
2896
3052
  <h2><span class="status-dot dot-ok"></span> Toast</h2>
2897
3053
  <div class="badges">
2898
- <label for="c-7-components-toast-props" class="badge ok as-toggle">11 prop types</label>
3054
+ <label for="c-8-components-toast-props" class="badge ok as-toggle">11 prop types</label>
2899
3055
 
2900
- <label for="c-7-components-toast-stories" class="badge ok as-toggle">11 stories</label>
3056
+ <label for="c-8-components-toast-stories" class="badge ok as-toggle">11 stories</label>
2901
3057
 
2902
3058
  </div>
2903
3059
  </div>
@@ -2910,9 +3066,9 @@ size?: &quot;sm&quot; | &quot;md&quot; | &quot;lg&quot;</code></pre>
2910
3066
  <!-- ⬇️ Hidden toggles must be siblings BEFORE .panels -->
2911
3067
 
2912
3068
 
2913
- <input id="c-7-components-toast-stories" class="tg tg-stories" type="checkbox" hidden />
3069
+ <input id="c-8-components-toast-stories" class="tg tg-stories" type="checkbox" hidden />
2914
3070
 
2915
- <input id="c-7-components-toast-props" class="tg tg-props" type="checkbox" hidden />
3071
+ <input id="c-8-components-toast-props" class="tg tg-props" type="checkbox" hidden />
2916
3072
 
2917
3073
  <div class="panels">
2918
3074