@agentero/design-system 0.24.5 → 0.25.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/mcp/manifests/components.html +4 -4
- package/mcp/manifests/components.json +193 -193
- package/package.json +5 -1
- package/src/data-table/data-table.d.ts +1 -1
- package/src/data-table/data-table.js +74 -74
- package/src/data-table/icons.d.ts +0 -8
- package/src/data-table/icons.js +1 -12
- package/src/data-table/index.d.ts +89 -7
- package/src/data-table/index.js +10 -19
- package/src/table/icons.d.ts +9 -0
- package/src/table/icons.js +16 -0
- package/src/table/index.d.ts +57 -0
- package/src/table/index.js +15 -0
- package/src/{data-table → table}/table.d.ts +12 -12
- package/src/{data-table → table}/table.js +2 -2
|
@@ -594,7 +594,7 @@
|
|
|
594
594
|
<main>
|
|
595
595
|
<div class="wrap">
|
|
596
596
|
<div class="note ok" style="margin-bottom: 16px;">
|
|
597
|
-
Using <code>react-component-meta</code>. Generation took <strong>
|
|
597
|
+
Using <code>react-component-meta</code>. Generation took <strong>2.9s</strong>.
|
|
598
598
|
</div>
|
|
599
599
|
<h2 class="section-title">Components</h2>
|
|
600
600
|
<div class="grid" role="list">
|
|
@@ -5888,13 +5888,13 @@ size?: "sm" | "md"</code></pre>
|
|
|
5888
5888
|
|
|
5889
5889
|
</div>
|
|
5890
5890
|
</div>
|
|
5891
|
-
<div class="meta" title="./src/
|
|
5891
|
+
<div class="meta" title="./src/table/table.stories.tsx">components-table · ./src/table/table.stories.tsx</div>
|
|
5892
5892
|
<div>Table root that owns the scroll viewport and `<table>` element</div>
|
|
5893
5893
|
<div class="hint">Low-level presentational table primitive: native `<table>` markup themed for
|
|
5894
5894
|
scrolling, sticky rows, cell padding, dividers, hover, and expandable rows.
|
|
5895
5895
|
For sorting/toolbar/pagination, prefer `DataTable`.</div>
|
|
5896
5896
|
<div class="kv"><span class="chip">summary: Table root that owns the scroll viewport and `<table>` element</span><span class="chip">example: ```tsx
|
|
5897
|
-
import { Table } from '@agentero/design-system/
|
|
5897
|
+
import { Table } from '@agentero/design-system/table';
|
|
5898
5898
|
|
|
5899
5899
|
<Table.Root size="md" sticky="head">
|
|
5900
5900
|
<Table.Head>
|
|
@@ -5929,7 +5929,7 @@ import { Table } from '@agentero/design-system/data-table';
|
|
|
5929
5929
|
<span class="ex-name">Prop types <small>(react-component-meta)</small></span>
|
|
5930
5930
|
<span class="badge ok">6 prop types</span>
|
|
5931
5931
|
</div>
|
|
5932
|
-
<pre><code>Component: src/
|
|
5932
|
+
<pre><code>Component: src/table/index.ts::Table</code></pre>
|
|
5933
5933
|
<pre><code>Props:</code></pre>
|
|
5934
5934
|
<pre><code>children?: ReactNode
|
|
5935
5935
|
|
|
@@ -3670,198 +3670,6 @@
|
|
|
3670
3670
|
],
|
|
3671
3671
|
"import": "import { Button, DataTable, DropdownMenu, Pagination, Table } from \"@agentero/design-system\";"
|
|
3672
3672
|
},
|
|
3673
|
-
"components-table": {
|
|
3674
|
-
"id": "components-table",
|
|
3675
|
-
"name": "Table.Root",
|
|
3676
|
-
"path": "./src/data-table/table.stories.tsx",
|
|
3677
|
-
"jsDocTags": {
|
|
3678
|
-
"summary": [
|
|
3679
|
-
"Table root that owns the scroll viewport and `<table>` element"
|
|
3680
|
-
],
|
|
3681
|
-
"example": [
|
|
3682
|
-
"```tsx\nimport { Table } from '@agentero/design-system/data-table';\n\n<Table.Root size=\"md\" sticky=\"head\">\n <Table.Head>\n <Table.Row>\n <Table.Header>Name</Table.Header>\n </Table.Row>\n </Table.Head>\n <Table.Body>\n <Table.Row>\n <Table.Cell>Jane Doe</Table.Cell>\n </Table.Row>\n </Table.Body>\n</Table.Root>\n```"
|
|
3683
|
-
]
|
|
3684
|
-
},
|
|
3685
|
-
"description": "Low-level presentational table primitive: native `<table>` markup themed for\nscrolling, sticky rows, cell padding, dividers, hover, and expandable rows.\nFor sorting/toolbar/pagination, prefer `DataTable`.",
|
|
3686
|
-
"summary": "Table root that owns the scroll viewport and `<table>` element",
|
|
3687
|
-
"reactComponentMeta": {
|
|
3688
|
-
"displayName": "Table.Root",
|
|
3689
|
-
"exportName": "Table",
|
|
3690
|
-
"filePath": "/home/runner/work/design-system/design-system/src/data-table/index.ts",
|
|
3691
|
-
"description": "The outermost part of the low-level presentational table primitive — a thin\nthemed wrapper over native `<table>` markup (scrolling, sticky rows, row\nsizing, dividers, hover, expandable rows). It renders the scroll viewport and\n`<table>`, shares variants with the other parts via context, and forwards\n`ref` to the scroll container. The viewport fills its (bounded) parent — cap\nheight by constraining that parent.\n\nCompose `Root` with `Head` / `Body` / `Row` / `Header` / `Cell`, plus\n`ExpandButton` / `ExpandedRow` and `RowActions`. For sorting, toolbar and\npagination, prefer `DataTable`, which is built on top of this.",
|
|
3692
|
-
"jsDocTags": {
|
|
3693
|
-
"summary": [
|
|
3694
|
-
"Table root that owns the scroll viewport and `<table>` element"
|
|
3695
|
-
],
|
|
3696
|
-
"example": [
|
|
3697
|
-
"```tsx\nimport { Table } from '@agentero/design-system/data-table';\n\n<Table.Root size=\"md\" sticky=\"head\">\n <Table.Head>\n <Table.Row>\n <Table.Header>Name</Table.Header>\n </Table.Row>\n </Table.Head>\n <Table.Body>\n <Table.Row>\n <Table.Cell>Jane Doe</Table.Cell>\n </Table.Row>\n </Table.Body>\n</Table.Root>\n```"
|
|
3698
|
-
]
|
|
3699
|
-
},
|
|
3700
|
-
"props": {
|
|
3701
|
-
"enclosed": {
|
|
3702
|
-
"name": "enclosed",
|
|
3703
|
-
"required": false,
|
|
3704
|
-
"type": {
|
|
3705
|
-
"name": "boolean"
|
|
3706
|
-
},
|
|
3707
|
-
"description": "",
|
|
3708
|
-
"defaultValue": null
|
|
3709
|
-
},
|
|
3710
|
-
"embed": {
|
|
3711
|
-
"name": "embed",
|
|
3712
|
-
"required": false,
|
|
3713
|
-
"type": {
|
|
3714
|
-
"name": "boolean"
|
|
3715
|
-
},
|
|
3716
|
-
"description": "",
|
|
3717
|
-
"defaultValue": null
|
|
3718
|
-
},
|
|
3719
|
-
"size": {
|
|
3720
|
-
"name": "size",
|
|
3721
|
-
"required": false,
|
|
3722
|
-
"type": {
|
|
3723
|
-
"name": "enum",
|
|
3724
|
-
"raw": "\"sm\" | \"md\" | \"lg\"",
|
|
3725
|
-
"value": [
|
|
3726
|
-
{
|
|
3727
|
-
"value": "\"sm\""
|
|
3728
|
-
},
|
|
3729
|
-
{
|
|
3730
|
-
"value": "\"md\""
|
|
3731
|
-
},
|
|
3732
|
-
{
|
|
3733
|
-
"value": "\"lg\""
|
|
3734
|
-
}
|
|
3735
|
-
]
|
|
3736
|
-
},
|
|
3737
|
-
"description": "",
|
|
3738
|
-
"defaultValue": null
|
|
3739
|
-
},
|
|
3740
|
-
"sticky": {
|
|
3741
|
-
"name": "sticky",
|
|
3742
|
-
"required": false,
|
|
3743
|
-
"type": {
|
|
3744
|
-
"name": "enum",
|
|
3745
|
-
"raw": "\"header\" | \"headerAndFooter\"",
|
|
3746
|
-
"value": [
|
|
3747
|
-
{
|
|
3748
|
-
"value": "\"header\""
|
|
3749
|
-
},
|
|
3750
|
-
{
|
|
3751
|
-
"value": "\"headerAndFooter\""
|
|
3752
|
-
}
|
|
3753
|
-
]
|
|
3754
|
-
},
|
|
3755
|
-
"description": "",
|
|
3756
|
-
"defaultValue": null
|
|
3757
|
-
},
|
|
3758
|
-
"ref": {
|
|
3759
|
-
"name": "ref",
|
|
3760
|
-
"required": false,
|
|
3761
|
-
"type": {
|
|
3762
|
-
"name": "Ref<HTMLDivElement> | undefined"
|
|
3763
|
-
},
|
|
3764
|
-
"description": "",
|
|
3765
|
-
"defaultValue": null,
|
|
3766
|
-
"parent": {
|
|
3767
|
-
"name": "TableRootProps",
|
|
3768
|
-
"fileName": "src/data-table/table.tsx"
|
|
3769
|
-
},
|
|
3770
|
-
"declarations": [
|
|
3771
|
-
{
|
|
3772
|
-
"name": "TypeLiteral",
|
|
3773
|
-
"fileName": "src/data-table/table.tsx"
|
|
3774
|
-
}
|
|
3775
|
-
]
|
|
3776
|
-
},
|
|
3777
|
-
"children": {
|
|
3778
|
-
"name": "children",
|
|
3779
|
-
"required": false,
|
|
3780
|
-
"type": {
|
|
3781
|
-
"name": "ReactNode"
|
|
3782
|
-
},
|
|
3783
|
-
"description": "",
|
|
3784
|
-
"defaultValue": null,
|
|
3785
|
-
"parent": {
|
|
3786
|
-
"name": "PropsWithChildren",
|
|
3787
|
-
"fileName": "node_modules/@types/react/index.d.ts"
|
|
3788
|
-
},
|
|
3789
|
-
"declarations": [
|
|
3790
|
-
{
|
|
3791
|
-
"name": "TypeLiteral",
|
|
3792
|
-
"fileName": "node_modules/@types/react/index.d.ts"
|
|
3793
|
-
}
|
|
3794
|
-
]
|
|
3795
|
-
}
|
|
3796
|
-
}
|
|
3797
|
-
},
|
|
3798
|
-
"stories": [
|
|
3799
|
-
{
|
|
3800
|
-
"id": "components-table--default",
|
|
3801
|
-
"name": "Default",
|
|
3802
|
-
"snippet": "const Default = args => renderTable(args);",
|
|
3803
|
-
"description": "Default args playground.",
|
|
3804
|
-
"summary": "Default table"
|
|
3805
|
-
},
|
|
3806
|
-
{
|
|
3807
|
-
"id": "components-table--sizes",
|
|
3808
|
-
"name": "Sizes",
|
|
3809
|
-
"snippet": "const Sizes = () => (\n <div className=\"flex flex-col gap-6\">\n {(['sm', 'md', 'lg'] as const).map(size => (\n <div key={size} className=\"flex flex-col gap-1\">\n <span className=\"text-xs text-text-default-base-tertiary\">size="{size}"</span>\n {renderTable({ size })}\n </div>\n ))}\n </div>\n);",
|
|
3810
|
-
"description": "The three row densities. `size` sets row min-height: sm 48 / md 64 / lg 88px.",
|
|
3811
|
-
"summary": "size — sm / md / lg"
|
|
3812
|
-
},
|
|
3813
|
-
{
|
|
3814
|
-
"id": "components-table--sticky-header",
|
|
3815
|
-
"name": "Sticky Header",
|
|
3816
|
-
"snippet": "const StickyHeader = args => renderTable(args);",
|
|
3817
|
-
"description": "`sticky=\"header\"` pins the header while the body scrolls. Needs a bounded-height parent.",
|
|
3818
|
-
"summary": "sticky=\"header\" with a scrolling body"
|
|
3819
|
-
},
|
|
3820
|
-
{
|
|
3821
|
-
"id": "components-table--sticky-header-and-footer",
|
|
3822
|
-
"name": "Sticky Header And Footer",
|
|
3823
|
-
"snippet": "const StickyHeaderAndFooter = args => renderTable(args, { totals: true });",
|
|
3824
|
-
"description": "`sticky=\"headerAndFooter\"` pins the header and the last body row (totals here).",
|
|
3825
|
-
"summary": "sticky=\"headerAndFooter\" with a pinned totals row"
|
|
3826
|
-
},
|
|
3827
|
-
{
|
|
3828
|
-
"id": "components-table--embed",
|
|
3829
|
-
"name": "Embed",
|
|
3830
|
-
"snippet": "const Embed = args => renderTable(args);",
|
|
3831
|
-
"description": "`embed` drops the per-row dividers and tightens the edge gutter to 1rem.",
|
|
3832
|
-
"summary": "embed — no row dividers, 1rem edge gutter"
|
|
3833
|
-
},
|
|
3834
|
-
{
|
|
3835
|
-
"id": "components-table--enclosed",
|
|
3836
|
-
"name": "Enclosed",
|
|
3837
|
-
"snippet": "const Enclosed = args => renderTable(args);",
|
|
3838
|
-
"description": "`enclosed` wraps the table in a bordered, rounded container — the standalone\n\"card\" look, as opposed to a full-bleed page table.",
|
|
3839
|
-
"summary": "enclosed — bordered, rounded card container"
|
|
3840
|
-
},
|
|
3841
|
-
{
|
|
3842
|
-
"id": "components-table--with-checkbox",
|
|
3843
|
-
"name": "With Checkbox",
|
|
3844
|
-
"snippet": "const WithCheckbox = args => renderTable(args, { checkbox: true });",
|
|
3845
|
-
"description": "A leading checkbox column; checkbox cells collapse to zero width.",
|
|
3846
|
-
"summary": "Selectable rows with a collapsing checkbox column"
|
|
3847
|
-
},
|
|
3848
|
-
{
|
|
3849
|
-
"id": "components-table--with-row-actions",
|
|
3850
|
-
"name": "With Row Actions",
|
|
3851
|
-
"snippet": "const WithRowActions = args => renderTable(args, { actions: true });",
|
|
3852
|
-
"description": "Hover-revealed row actions pinned to the trailing edge.",
|
|
3853
|
-
"summary": "Hover-revealed row actions"
|
|
3854
|
-
},
|
|
3855
|
-
{
|
|
3856
|
-
"id": "components-table--expandable-rows",
|
|
3857
|
-
"name": "Expandable Rows",
|
|
3858
|
-
"snippet": "const ExpandableRows = args => {\n const Demo = () => {\n const [openId, setOpenId] = useState<string | null>(ROWS[0]!.id);\n return (\n <Table.Root {...args}>\n <Table.Head>\n <Table.Row>\n <Table.Header>\n <span className=\"sr-only\">Expand</span>\n </Table.Header>\n <Table.Header>Name</Table.Header>\n <Table.Header>Email</Table.Header>\n <Table.Header>Role</Table.Header>\n </Table.Row>\n </Table.Head>\n <Table.Body>\n {ROWS.slice(0, 4).map(row => (\n <Fragment key={row.id}>\n <Table.Row>\n <Table.Cell>\n <Table.ExpandButton\n isExpanded={openId === row.id}\n toggleExpanded={() => setOpenId(openId === row.id ? null : row.id)}\n aria-label={`Toggle ${row.name}`}\n />\n </Table.Cell>\n <Table.Cell className=\"font-bold\">{row.name}</Table.Cell>\n <Table.Cell className=\"text-text-default-base-secondary\">{row.email}</Table.Cell>\n <Table.Cell>{row.role}</Table.Cell>\n </Table.Row>\n {openId === row.id && (\n <Table.ExpandedRow>\n <Table.Cell colSpan={4}>\n <div className=\"py-2 text-text-default-base-secondary\">\n Extended details for {row.name} — {row.amount} lifetime value.\n </div>\n </Table.Cell>\n </Table.ExpandedRow>\n )}\n </Fragment>\n ))}\n </Table.Body>\n </Table.Root>\n );\n };\n return <Demo />;\n};",
|
|
3859
|
-
"description": "`Table.ExpandButton` toggles a `Table.ExpandedRow` detail panel under its row.",
|
|
3860
|
-
"summary": "Expandable rows with a detail panel"
|
|
3861
|
-
}
|
|
3862
|
-
],
|
|
3863
|
-
"import": "import { Button, Table } from \"@agentero/design-system\";\nimport { Fragment } from \"react\";"
|
|
3864
|
-
},
|
|
3865
3673
|
"components-divider": {
|
|
3866
3674
|
"id": "components-divider",
|
|
3867
3675
|
"name": "Divider",
|
|
@@ -5634,6 +5442,198 @@
|
|
|
5634
5442
|
],
|
|
5635
5443
|
"import": "import { Switch } from \"@agentero/design-system\";"
|
|
5636
5444
|
},
|
|
5445
|
+
"components-table": {
|
|
5446
|
+
"id": "components-table",
|
|
5447
|
+
"name": "Table.Root",
|
|
5448
|
+
"path": "./src/table/table.stories.tsx",
|
|
5449
|
+
"jsDocTags": {
|
|
5450
|
+
"summary": [
|
|
5451
|
+
"Table root that owns the scroll viewport and `<table>` element"
|
|
5452
|
+
],
|
|
5453
|
+
"example": [
|
|
5454
|
+
"```tsx\nimport { Table } from '@agentero/design-system/table';\n\n<Table.Root size=\"md\" sticky=\"head\">\n <Table.Head>\n <Table.Row>\n <Table.Header>Name</Table.Header>\n </Table.Row>\n </Table.Head>\n <Table.Body>\n <Table.Row>\n <Table.Cell>Jane Doe</Table.Cell>\n </Table.Row>\n </Table.Body>\n</Table.Root>\n```"
|
|
5455
|
+
]
|
|
5456
|
+
},
|
|
5457
|
+
"description": "Low-level presentational table primitive: native `<table>` markup themed for\nscrolling, sticky rows, cell padding, dividers, hover, and expandable rows.\nFor sorting/toolbar/pagination, prefer `DataTable`.",
|
|
5458
|
+
"summary": "Table root that owns the scroll viewport and `<table>` element",
|
|
5459
|
+
"reactComponentMeta": {
|
|
5460
|
+
"displayName": "Table.Root",
|
|
5461
|
+
"exportName": "Table",
|
|
5462
|
+
"filePath": "/home/runner/work/design-system/design-system/src/table/index.ts",
|
|
5463
|
+
"description": "The outermost part of the low-level presentational table primitive — a thin\nthemed wrapper over native `<table>` markup (scrolling, sticky rows, row\nsizing, dividers, hover, expandable rows). It renders the scroll viewport and\n`<table>`, shares variants with the other parts via context, and forwards\n`ref` to the scroll container. The viewport fills its (bounded) parent — cap\nheight by constraining that parent.\n\nCompose `Root` with `Head` / `Body` / `Row` / `Header` / `Cell`, plus\n`ExpandButton` / `ExpandedRow` and `RowActions`. For sorting, toolbar and\npagination, prefer `DataTable`, which is built on top of this.",
|
|
5464
|
+
"jsDocTags": {
|
|
5465
|
+
"summary": [
|
|
5466
|
+
"Table root that owns the scroll viewport and `<table>` element"
|
|
5467
|
+
],
|
|
5468
|
+
"example": [
|
|
5469
|
+
"```tsx\nimport { Table } from '@agentero/design-system/table';\n\n<Table.Root size=\"md\" sticky=\"head\">\n <Table.Head>\n <Table.Row>\n <Table.Header>Name</Table.Header>\n </Table.Row>\n </Table.Head>\n <Table.Body>\n <Table.Row>\n <Table.Cell>Jane Doe</Table.Cell>\n </Table.Row>\n </Table.Body>\n</Table.Root>\n```"
|
|
5470
|
+
]
|
|
5471
|
+
},
|
|
5472
|
+
"props": {
|
|
5473
|
+
"enclosed": {
|
|
5474
|
+
"name": "enclosed",
|
|
5475
|
+
"required": false,
|
|
5476
|
+
"type": {
|
|
5477
|
+
"name": "boolean"
|
|
5478
|
+
},
|
|
5479
|
+
"description": "",
|
|
5480
|
+
"defaultValue": null
|
|
5481
|
+
},
|
|
5482
|
+
"embed": {
|
|
5483
|
+
"name": "embed",
|
|
5484
|
+
"required": false,
|
|
5485
|
+
"type": {
|
|
5486
|
+
"name": "boolean"
|
|
5487
|
+
},
|
|
5488
|
+
"description": "",
|
|
5489
|
+
"defaultValue": null
|
|
5490
|
+
},
|
|
5491
|
+
"size": {
|
|
5492
|
+
"name": "size",
|
|
5493
|
+
"required": false,
|
|
5494
|
+
"type": {
|
|
5495
|
+
"name": "enum",
|
|
5496
|
+
"raw": "\"sm\" | \"md\" | \"lg\"",
|
|
5497
|
+
"value": [
|
|
5498
|
+
{
|
|
5499
|
+
"value": "\"sm\""
|
|
5500
|
+
},
|
|
5501
|
+
{
|
|
5502
|
+
"value": "\"md\""
|
|
5503
|
+
},
|
|
5504
|
+
{
|
|
5505
|
+
"value": "\"lg\""
|
|
5506
|
+
}
|
|
5507
|
+
]
|
|
5508
|
+
},
|
|
5509
|
+
"description": "",
|
|
5510
|
+
"defaultValue": null
|
|
5511
|
+
},
|
|
5512
|
+
"sticky": {
|
|
5513
|
+
"name": "sticky",
|
|
5514
|
+
"required": false,
|
|
5515
|
+
"type": {
|
|
5516
|
+
"name": "enum",
|
|
5517
|
+
"raw": "\"header\" | \"headerAndFooter\"",
|
|
5518
|
+
"value": [
|
|
5519
|
+
{
|
|
5520
|
+
"value": "\"header\""
|
|
5521
|
+
},
|
|
5522
|
+
{
|
|
5523
|
+
"value": "\"headerAndFooter\""
|
|
5524
|
+
}
|
|
5525
|
+
]
|
|
5526
|
+
},
|
|
5527
|
+
"description": "",
|
|
5528
|
+
"defaultValue": null
|
|
5529
|
+
},
|
|
5530
|
+
"ref": {
|
|
5531
|
+
"name": "ref",
|
|
5532
|
+
"required": false,
|
|
5533
|
+
"type": {
|
|
5534
|
+
"name": "Ref<HTMLDivElement> | undefined"
|
|
5535
|
+
},
|
|
5536
|
+
"description": "",
|
|
5537
|
+
"defaultValue": null,
|
|
5538
|
+
"parent": {
|
|
5539
|
+
"name": "TableRootProps",
|
|
5540
|
+
"fileName": "src/table/table.tsx"
|
|
5541
|
+
},
|
|
5542
|
+
"declarations": [
|
|
5543
|
+
{
|
|
5544
|
+
"name": "TypeLiteral",
|
|
5545
|
+
"fileName": "src/table/table.tsx"
|
|
5546
|
+
}
|
|
5547
|
+
]
|
|
5548
|
+
},
|
|
5549
|
+
"children": {
|
|
5550
|
+
"name": "children",
|
|
5551
|
+
"required": false,
|
|
5552
|
+
"type": {
|
|
5553
|
+
"name": "ReactNode"
|
|
5554
|
+
},
|
|
5555
|
+
"description": "",
|
|
5556
|
+
"defaultValue": null,
|
|
5557
|
+
"parent": {
|
|
5558
|
+
"name": "PropsWithChildren",
|
|
5559
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
5560
|
+
},
|
|
5561
|
+
"declarations": [
|
|
5562
|
+
{
|
|
5563
|
+
"name": "TypeLiteral",
|
|
5564
|
+
"fileName": "node_modules/@types/react/index.d.ts"
|
|
5565
|
+
}
|
|
5566
|
+
]
|
|
5567
|
+
}
|
|
5568
|
+
}
|
|
5569
|
+
},
|
|
5570
|
+
"stories": [
|
|
5571
|
+
{
|
|
5572
|
+
"id": "components-table--default",
|
|
5573
|
+
"name": "Default",
|
|
5574
|
+
"snippet": "const Default = args => renderTable(args);",
|
|
5575
|
+
"description": "Default args playground.",
|
|
5576
|
+
"summary": "Default table"
|
|
5577
|
+
},
|
|
5578
|
+
{
|
|
5579
|
+
"id": "components-table--sizes",
|
|
5580
|
+
"name": "Sizes",
|
|
5581
|
+
"snippet": "const Sizes = () => (\n <div className=\"flex flex-col gap-6\">\n {(['sm', 'md', 'lg'] as const).map(size => (\n <div key={size} className=\"flex flex-col gap-1\">\n <span className=\"text-xs text-text-default-base-tertiary\">size="{size}"</span>\n {renderTable({ size })}\n </div>\n ))}\n </div>\n);",
|
|
5582
|
+
"description": "The three row densities. `size` sets row min-height: sm 48 / md 64 / lg 88px.",
|
|
5583
|
+
"summary": "size — sm / md / lg"
|
|
5584
|
+
},
|
|
5585
|
+
{
|
|
5586
|
+
"id": "components-table--sticky-header",
|
|
5587
|
+
"name": "Sticky Header",
|
|
5588
|
+
"snippet": "const StickyHeader = args => renderTable(args);",
|
|
5589
|
+
"description": "`sticky=\"header\"` pins the header while the body scrolls. Needs a bounded-height parent.",
|
|
5590
|
+
"summary": "sticky=\"header\" with a scrolling body"
|
|
5591
|
+
},
|
|
5592
|
+
{
|
|
5593
|
+
"id": "components-table--sticky-header-and-footer",
|
|
5594
|
+
"name": "Sticky Header And Footer",
|
|
5595
|
+
"snippet": "const StickyHeaderAndFooter = args => renderTable(args, { totals: true });",
|
|
5596
|
+
"description": "`sticky=\"headerAndFooter\"` pins the header and the last body row (totals here).",
|
|
5597
|
+
"summary": "sticky=\"headerAndFooter\" with a pinned totals row"
|
|
5598
|
+
},
|
|
5599
|
+
{
|
|
5600
|
+
"id": "components-table--embed",
|
|
5601
|
+
"name": "Embed",
|
|
5602
|
+
"snippet": "const Embed = args => renderTable(args);",
|
|
5603
|
+
"description": "`embed` drops the per-row dividers and tightens the edge gutter to 1rem.",
|
|
5604
|
+
"summary": "embed — no row dividers, 1rem edge gutter"
|
|
5605
|
+
},
|
|
5606
|
+
{
|
|
5607
|
+
"id": "components-table--enclosed",
|
|
5608
|
+
"name": "Enclosed",
|
|
5609
|
+
"snippet": "const Enclosed = args => renderTable(args);",
|
|
5610
|
+
"description": "`enclosed` wraps the table in a bordered, rounded container — the standalone\n\"card\" look, as opposed to a full-bleed page table.",
|
|
5611
|
+
"summary": "enclosed — bordered, rounded card container"
|
|
5612
|
+
},
|
|
5613
|
+
{
|
|
5614
|
+
"id": "components-table--with-checkbox",
|
|
5615
|
+
"name": "With Checkbox",
|
|
5616
|
+
"snippet": "const WithCheckbox = args => renderTable(args, { checkbox: true });",
|
|
5617
|
+
"description": "A leading checkbox column; checkbox cells collapse to zero width.",
|
|
5618
|
+
"summary": "Selectable rows with a collapsing checkbox column"
|
|
5619
|
+
},
|
|
5620
|
+
{
|
|
5621
|
+
"id": "components-table--with-row-actions",
|
|
5622
|
+
"name": "With Row Actions",
|
|
5623
|
+
"snippet": "const WithRowActions = args => renderTable(args, { actions: true });",
|
|
5624
|
+
"description": "Hover-revealed row actions pinned to the trailing edge.",
|
|
5625
|
+
"summary": "Hover-revealed row actions"
|
|
5626
|
+
},
|
|
5627
|
+
{
|
|
5628
|
+
"id": "components-table--expandable-rows",
|
|
5629
|
+
"name": "Expandable Rows",
|
|
5630
|
+
"snippet": "const ExpandableRows = args => {\n const Demo = () => {\n const [openId, setOpenId] = useState<string | null>(ROWS[0]!.id);\n return (\n <Table.Root {...args}>\n <Table.Head>\n <Table.Row>\n <Table.Header>\n <span className=\"sr-only\">Expand</span>\n </Table.Header>\n <Table.Header>Name</Table.Header>\n <Table.Header>Email</Table.Header>\n <Table.Header>Role</Table.Header>\n </Table.Row>\n </Table.Head>\n <Table.Body>\n {ROWS.slice(0, 4).map(row => (\n <Fragment key={row.id}>\n <Table.Row>\n <Table.Cell>\n <Table.ExpandButton\n isExpanded={openId === row.id}\n toggleExpanded={() => setOpenId(openId === row.id ? null : row.id)}\n aria-label={`Toggle ${row.name}`}\n />\n </Table.Cell>\n <Table.Cell className=\"font-bold\">{row.name}</Table.Cell>\n <Table.Cell className=\"text-text-default-base-secondary\">{row.email}</Table.Cell>\n <Table.Cell>{row.role}</Table.Cell>\n </Table.Row>\n {openId === row.id && (\n <Table.ExpandedRow>\n <Table.Cell colSpan={4}>\n <div className=\"py-2 text-text-default-base-secondary\">\n Extended details for {row.name} — {row.amount} lifetime value.\n </div>\n </Table.Cell>\n </Table.ExpandedRow>\n )}\n </Fragment>\n ))}\n </Table.Body>\n </Table.Root>\n );\n };\n return <Demo />;\n};",
|
|
5631
|
+
"description": "`Table.ExpandButton` toggles a `Table.ExpandedRow` detail panel under its row.",
|
|
5632
|
+
"summary": "Expandable rows with a detail panel"
|
|
5633
|
+
}
|
|
5634
|
+
],
|
|
5635
|
+
"import": "import { Button, Table } from \"@agentero/design-system\";\nimport { Fragment } from \"react\";"
|
|
5636
|
+
},
|
|
5637
5637
|
"components-tabs": {
|
|
5638
5638
|
"id": "components-tabs",
|
|
5639
5639
|
"name": "Tabs.Root",
|
|
@@ -6980,6 +6980,6 @@
|
|
|
6980
6980
|
},
|
|
6981
6981
|
"meta": {
|
|
6982
6982
|
"docgen": "react-component-meta",
|
|
6983
|
-
"durationMs":
|
|
6983
|
+
"durationMs": 2944
|
|
6984
6984
|
}
|
|
6985
6985
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentero/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "A React component library built with Tailwind CSS v4 and Radix UI primitives",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -97,6 +97,10 @@
|
|
|
97
97
|
"types": "./src/switch/index.d.ts",
|
|
98
98
|
"import": "./src/switch/index.js"
|
|
99
99
|
},
|
|
100
|
+
"./table": {
|
|
101
|
+
"types": "./src/table/index.d.ts",
|
|
102
|
+
"import": "./src/table/index.js"
|
|
103
|
+
},
|
|
100
104
|
"./tabs": {
|
|
101
105
|
"types": "./src/tabs/index.d.ts",
|
|
102
106
|
"import": "./src/tabs/index.js"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CSSProperties, ElementType, HTMLAttributes, PropsWithChildren, RefObject } from 'react';
|
|
2
2
|
import { RowData, Table as TableType, TableOptions } from '@tanstack/react-table';
|
|
3
3
|
import { PaginationProps } from '../pagination';
|
|
4
|
-
import { TableRootProps } from '
|
|
4
|
+
import { TableRootProps } from '../table';
|
|
5
5
|
/**
|
|
6
6
|
* Shape a column's `meta` may carry; spread onto the `<th>`/`<td>`.
|
|
7
7
|
* Right alignment of the header content is derived from either `style.textAlign: 'right'`
|
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { tv as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { flexRender as
|
|
3
|
+
import { Table as t } from "../table/index.js";
|
|
4
|
+
import { Pagination as n } from "../pagination/pagination.js";
|
|
5
|
+
import { IconArrowUpward as r, IconSwapVert as i } from "./icons.js";
|
|
6
|
+
import { tv as a } from "tailwind-variants";
|
|
7
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
+
import { Fragment as l, createContext as u, use as d, useRef as f } from "react";
|
|
9
|
+
import { flexRender as p, getCoreRowModel as m, useReactTable as h } from "@tanstack/react-table";
|
|
10
10
|
//#region src/data-table/data-table.tsx
|
|
11
|
-
var
|
|
12
|
-
let e = g
|
|
11
|
+
var g = u(null), _ = () => {
|
|
12
|
+
let e = d(g);
|
|
13
13
|
if (!e) throw Error("useDataTable must be used within a DataTable.Root");
|
|
14
14
|
return e;
|
|
15
|
-
},
|
|
15
|
+
}, v = ({ children: e, isLoading: t = !1, onRowClick: n, rowHref: r, linkComponent: i = "a", ...a }) => /* @__PURE__ */ s(g, {
|
|
16
16
|
value: {
|
|
17
|
-
table:
|
|
17
|
+
table: h({
|
|
18
18
|
...a,
|
|
19
|
-
getCoreRowModel:
|
|
19
|
+
getCoreRowModel: m()
|
|
20
20
|
}),
|
|
21
21
|
isLoading: t,
|
|
22
|
-
scrollRef:
|
|
22
|
+
scrollRef: f(null),
|
|
23
23
|
onRowClick: n,
|
|
24
24
|
rowHref: r,
|
|
25
25
|
linkComponent: i
|
|
26
26
|
},
|
|
27
|
-
children: /* @__PURE__ */
|
|
27
|
+
children: /* @__PURE__ */ s("div", {
|
|
28
28
|
"data-slot": "data-table-root",
|
|
29
29
|
className: "flex min-h-0 flex-1 flex-col",
|
|
30
30
|
children: e
|
|
31
31
|
})
|
|
32
32
|
});
|
|
33
|
-
|
|
34
|
-
var
|
|
33
|
+
v.displayName = "DataTable.Root";
|
|
34
|
+
var y = ({ children: e }) => /* @__PURE__ */ s("div", {
|
|
35
35
|
"data-slot": "data-table-toolbar",
|
|
36
36
|
role: "toolbar",
|
|
37
37
|
className: "flex gap-2 border-b border-border-default-base-primary px-4 py-3",
|
|
38
38
|
children: e
|
|
39
39
|
});
|
|
40
|
-
|
|
41
|
-
var
|
|
40
|
+
y.displayName = "DataTable.ToolBar";
|
|
41
|
+
var b = a({
|
|
42
42
|
base: "size-4 transition-transform duration-200",
|
|
43
43
|
variants: { direction: {
|
|
44
44
|
asc: "",
|
|
45
45
|
desc: "rotate-180",
|
|
46
46
|
false: ""
|
|
47
47
|
} }
|
|
48
|
-
}),
|
|
48
|
+
}), x = a({
|
|
49
49
|
base: "flex w-full appearance-none items-center bg-transparent p-0 text-left [font:inherit]",
|
|
50
50
|
variants: {
|
|
51
51
|
canSort: {
|
|
@@ -57,96 +57,96 @@ var T = u({
|
|
|
57
57
|
left: "justify-start"
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
}),
|
|
61
|
-
let { table:
|
|
62
|
-
return /* @__PURE__ */
|
|
60
|
+
}), S = (e) => !!e.closest("a, button, [role=\"menu\"]"), C = ({ children: n = /* @__PURE__ */ s(w, {}), size: a = "md", sticky: u = "header", embed: d = !0, enclosed: f = !1 }) => {
|
|
61
|
+
let { table: m, isLoading: h, scrollRef: g, onRowClick: v, rowHref: y, linkComponent: C } = _(), T = m.getAllColumns().length;
|
|
62
|
+
return /* @__PURE__ */ s("div", {
|
|
63
63
|
"data-slot": "data-table-loading-overlay",
|
|
64
|
-
className: e("flex min-h-0 flex-1 flex-col transition-opacity duration-150",
|
|
65
|
-
children: /* @__PURE__ */
|
|
66
|
-
size:
|
|
67
|
-
sticky:
|
|
68
|
-
embed:
|
|
69
|
-
enclosed:
|
|
70
|
-
ref:
|
|
71
|
-
children: [/* @__PURE__ */
|
|
72
|
-
let
|
|
64
|
+
className: e("flex min-h-0 flex-1 flex-col transition-opacity duration-150", h && "opacity-50"),
|
|
65
|
+
children: /* @__PURE__ */ c(t.Root, {
|
|
66
|
+
size: a,
|
|
67
|
+
sticky: u,
|
|
68
|
+
embed: d,
|
|
69
|
+
enclosed: f,
|
|
70
|
+
ref: g,
|
|
71
|
+
children: [/* @__PURE__ */ s(t.Head, { children: m.getHeaderGroups().map((e) => /* @__PURE__ */ s(t.Row, { children: e.headers.map((e) => {
|
|
72
|
+
let n = e.column.columnDef.meta, a = e.column.getCanSort(), l = e.column.getIsSorted(), u = n?.style?.textAlign === "right" || n?.className?.includes("text-right") ? "right" : "left", d = e.isPlaceholder ? null : /* @__PURE__ */ c(o, { children: [p(e.column.columnDef.header, e.getContext()), a && /* @__PURE__ */ s("span", {
|
|
73
73
|
className: "size-4",
|
|
74
|
-
children:
|
|
74
|
+
children: l ? /* @__PURE__ */ s(r, { className: b({ direction: l }) }) : /* @__PURE__ */ s(i, { className: "size-4" })
|
|
75
75
|
})] });
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
...
|
|
78
|
-
"aria-sort":
|
|
79
|
-
children:
|
|
76
|
+
return /* @__PURE__ */ s(t.Header, {
|
|
77
|
+
...n,
|
|
78
|
+
"aria-sort": a ? l === "asc" ? "ascending" : l === "desc" ? "descending" : "none" : void 0,
|
|
79
|
+
children: a ? /* @__PURE__ */ s("button", {
|
|
80
80
|
type: "button",
|
|
81
|
-
className:
|
|
81
|
+
className: x({
|
|
82
82
|
canSort: !0,
|
|
83
|
-
align:
|
|
83
|
+
align: u
|
|
84
84
|
}),
|
|
85
85
|
onClick: e.column.getToggleSortingHandler(),
|
|
86
86
|
title: e.column.getNextSortingOrder() === "asc" ? "Sort ascending" : e.column.getNextSortingOrder() === "desc" ? "Sort descending" : "Clear sort",
|
|
87
|
-
children:
|
|
88
|
-
}) : /* @__PURE__ */
|
|
89
|
-
className:
|
|
87
|
+
children: d
|
|
88
|
+
}) : /* @__PURE__ */ s("div", {
|
|
89
|
+
className: x({
|
|
90
90
|
canSort: !1,
|
|
91
|
-
align:
|
|
91
|
+
align: u
|
|
92
92
|
}),
|
|
93
|
-
children:
|
|
93
|
+
children: d
|
|
94
94
|
})
|
|
95
95
|
}, e.id);
|
|
96
|
-
}) }, e.id)) }), /* @__PURE__ */
|
|
97
|
-
let
|
|
98
|
-
return /* @__PURE__ */
|
|
99
|
-
className: e("has-aria-expanded:bg-bg-default-base-secondary",
|
|
100
|
-
onClick:
|
|
101
|
-
|
|
96
|
+
}) }, e.id)) }), /* @__PURE__ */ s(t.Body, { children: m.getRowModel().rows.length ? m.getRowModel().rows.map((n) => {
|
|
97
|
+
let r = y?.(n.original), i = !!v || !!r;
|
|
98
|
+
return /* @__PURE__ */ s(l, { children: /* @__PURE__ */ s(t.Row, {
|
|
99
|
+
className: e("has-aria-expanded:bg-bg-default-base-secondary", i && "cursor-pointer"),
|
|
100
|
+
onClick: i ? (e) => {
|
|
101
|
+
S(e.target) || !e.currentTarget.contains(e.target) || (v ? v(n.original) : r && e.currentTarget.querySelector("[data-row-link]")?.click());
|
|
102
102
|
} : void 0,
|
|
103
|
-
children:
|
|
104
|
-
let
|
|
105
|
-
return /* @__PURE__ */
|
|
106
|
-
...
|
|
107
|
-
children: [
|
|
108
|
-
href:
|
|
103
|
+
children: n.getVisibleCells().map((e, n) => {
|
|
104
|
+
let i = e.column.columnDef.meta;
|
|
105
|
+
return /* @__PURE__ */ c(t.Cell, {
|
|
106
|
+
...i,
|
|
107
|
+
children: [n === 0 && r && /* @__PURE__ */ s(C, {
|
|
108
|
+
href: r,
|
|
109
109
|
"data-row-link": !0,
|
|
110
110
|
className: "hidden",
|
|
111
111
|
tabIndex: -1,
|
|
112
112
|
"aria-hidden": "true"
|
|
113
|
-
}),
|
|
113
|
+
}), p(e.column.columnDef.cell, e.getContext())]
|
|
114
114
|
}, e.id);
|
|
115
115
|
})
|
|
116
|
-
}) },
|
|
117
|
-
}) :
|
|
118
|
-
colSpan:
|
|
119
|
-
children: /* @__PURE__ */
|
|
116
|
+
}) }, n.id);
|
|
117
|
+
}) : h ? null : /* @__PURE__ */ s(t.Row, { children: /* @__PURE__ */ s(t.Cell, {
|
|
118
|
+
colSpan: T,
|
|
119
|
+
children: /* @__PURE__ */ s("div", {
|
|
120
120
|
"data-slot": "table-empty-state",
|
|
121
121
|
className: "whitespace-normal",
|
|
122
|
-
children:
|
|
122
|
+
children: n
|
|
123
123
|
})
|
|
124
124
|
}) }) })]
|
|
125
125
|
})
|
|
126
126
|
});
|
|
127
127
|
};
|
|
128
|
-
|
|
129
|
-
var
|
|
128
|
+
C.displayName = "DataTable.Table";
|
|
129
|
+
var w = () => /* @__PURE__ */ s("div", {
|
|
130
130
|
className: "mb-6 flex flex-col items-center gap-4",
|
|
131
|
-
children: /* @__PURE__ */
|
|
131
|
+
children: /* @__PURE__ */ s("div", {
|
|
132
132
|
className: "text-lg",
|
|
133
|
-
children: /* @__PURE__ */
|
|
133
|
+
children: /* @__PURE__ */ s("b", { children: "No results." })
|
|
134
134
|
})
|
|
135
|
-
}),
|
|
135
|
+
}), T = ({ children: e }) => /* @__PURE__ */ s("div", {
|
|
136
136
|
"data-slot": "data-table-pagination",
|
|
137
137
|
className: "flex justify-end border-t border-border-default-base-primary px-6 py-3",
|
|
138
138
|
children: e
|
|
139
139
|
});
|
|
140
|
-
|
|
141
|
-
var
|
|
142
|
-
let { scrollRef:
|
|
143
|
-
return /* @__PURE__ */
|
|
140
|
+
T.displayName = "DataTable.Footer";
|
|
141
|
+
var E = (e) => {
|
|
142
|
+
let { scrollRef: t } = _();
|
|
143
|
+
return /* @__PURE__ */ s(n, {
|
|
144
144
|
...e,
|
|
145
|
-
onPageChange: (
|
|
146
|
-
|
|
145
|
+
onPageChange: (n) => {
|
|
146
|
+
t.current?.scrollTo({ top: 0 }), e.onPageChange(n);
|
|
147
147
|
}
|
|
148
148
|
});
|
|
149
149
|
};
|
|
150
|
-
|
|
150
|
+
E.displayName = "DataTable.Pagination";
|
|
151
151
|
//#endregion
|
|
152
|
-
export {
|
|
152
|
+
export { E as DataTablePagination, C as DataTableTable, T as Footer, v as Root, y as ToolBar, _ as useDataTable };
|
|
@@ -16,11 +16,3 @@ export declare const IconArrowUpward: (props: SVGProps<SVGSVGElement>) => import
|
|
|
16
16
|
* @summary 24px swap-vert icon used as the sortable (unsorted) indicator
|
|
17
17
|
*/
|
|
18
18
|
export declare const IconSwapVert: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
/**
|
|
20
|
-
* Downward chevron glyph used by the row expand/collapse button. Rotates 180°
|
|
21
|
-
* when its row is expanded (driven by `data-state=open`). The fill follows
|
|
22
|
-
* `currentColor` so it inherits the button's text color token.
|
|
23
|
-
*
|
|
24
|
-
* @summary 24px chevron-down icon used by the row expand button
|
|
25
|
-
*/
|
|
26
|
-
export declare const IconKeyboardArrowDown: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
package/src/data-table/icons.js
CHANGED
|
@@ -22,17 +22,6 @@ var t = (t) => /* @__PURE__ */ e("svg", {
|
|
|
22
22
|
fill: "currentColor",
|
|
23
23
|
d: "M9.163 12.644a.73.73 0 0 1-.534-.216.73.73 0 0 1-.215-.534v-6.53L6.096 7.68a.68.68 0 0 1-.507.207.767.767 0 0 1-.77-.751q0-.303.233-.535l3.47-3.47a.8.8 0 0 1 .297-.197 1.001 1.001 0 0 1 .678 0 .8.8 0 0 1 .3.198l3.493 3.494a.7.7 0 0 1 .22.517.788.788 0 0 1-.763.752.7.7 0 0 1-.526-.225L9.914 5.364v6.54q0 .315-.216.527a.73.73 0 0 1-.535.213m5.682 8.47a1 1 0 0 1-.341-.059.8.8 0 0 1-.3-.197l-3.495-3.495a.7.7 0 0 1-.22-.517.788.788 0 0 1 .763-.752.7.7 0 0 1 .527.225l2.307 2.308v-6.54q0-.315.216-.528a.73.73 0 0 1 .535-.213q.318 0 .534.216a.73.73 0 0 1 .215.534v6.531l2.318-2.317a.68.68 0 0 1 .507-.208.767.767 0 0 1 .77.752q0 .302-.233.535l-3.47 3.469a.8.8 0 0 1-.296.198 1 1 0 0 1-.337.057"
|
|
24
24
|
})
|
|
25
|
-
}), r = (t) => /* @__PURE__ */ e("svg", {
|
|
26
|
-
width: "24",
|
|
27
|
-
height: "24",
|
|
28
|
-
viewBox: "0 0 24 24",
|
|
29
|
-
fill: "none",
|
|
30
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
31
|
-
...t,
|
|
32
|
-
children: /* @__PURE__ */ e("path", {
|
|
33
|
-
fill: "currentColor",
|
|
34
|
-
d: "M12 14.677a.83.83 0 0 1-.633-.256L6.873 9.927a.73.73 0 0 1-.212-.522.7.7 0 0 1 .212-.532.72.72 0 0 1 .527-.217q.31 0 .527.217L12 12.946l4.073-4.073a.73.73 0 0 1 .522-.212.7.7 0 0 1 .532.212q.217.217.217.527a.72.72 0 0 1-.217.527l-4.494 4.494a.83.83 0 0 1-.633.256"
|
|
35
|
-
})
|
|
36
25
|
});
|
|
37
26
|
//#endregion
|
|
38
|
-
export { t as IconArrowUpward,
|
|
27
|
+
export { t as IconArrowUpward, n as IconSwapVert };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
export { tableRecipe } from './table';
|
|
2
|
-
export type { TableRootProps } from './table';
|
|
3
1
|
export { useDataTable } from './data-table';
|
|
4
2
|
export type { DataTableColumnMeta, PaginationState } from './data-table';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Import from `@agentero/design-system/table` instead — that entry
|
|
5
|
+
* point carries no `@tanstack/react-table` dependency.
|
|
6
|
+
*/
|
|
5
7
|
export declare const Table: {
|
|
6
8
|
Root: {
|
|
7
|
-
({ children, ref, ...variants }: import('react').PropsWithChildren<import('
|
|
9
|
+
({ children, ref, ...variants }: import('react').PropsWithChildren<import('.').TableRootProps>): import("react/jsx-runtime").JSX.Element;
|
|
8
10
|
displayName: string;
|
|
9
11
|
};
|
|
10
12
|
Head: {
|
|
@@ -57,6 +59,86 @@ export declare const Table: {
|
|
|
57
59
|
displayName: string;
|
|
58
60
|
};
|
|
59
61
|
};
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated Import from `@agentero/design-system/table` instead.
|
|
64
|
+
*/
|
|
65
|
+
export declare const tableRecipe: import('tailwind-variants').TVReturnType<{
|
|
66
|
+
size: {
|
|
67
|
+
sm: {};
|
|
68
|
+
md: {};
|
|
69
|
+
lg: {};
|
|
70
|
+
};
|
|
71
|
+
embed: {
|
|
72
|
+
true: {
|
|
73
|
+
root: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
enclosed: {
|
|
77
|
+
true: {
|
|
78
|
+
root: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
sticky: {
|
|
82
|
+
header: {};
|
|
83
|
+
headerAndFooter: {};
|
|
84
|
+
};
|
|
85
|
+
}, {
|
|
86
|
+
root: string[];
|
|
87
|
+
scroll: string;
|
|
88
|
+
table: string;
|
|
89
|
+
}, undefined, {
|
|
90
|
+
size: {
|
|
91
|
+
sm: {};
|
|
92
|
+
md: {};
|
|
93
|
+
lg: {};
|
|
94
|
+
};
|
|
95
|
+
embed: {
|
|
96
|
+
true: {
|
|
97
|
+
root: string;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
enclosed: {
|
|
101
|
+
true: {
|
|
102
|
+
root: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
sticky: {
|
|
106
|
+
header: {};
|
|
107
|
+
headerAndFooter: {};
|
|
108
|
+
};
|
|
109
|
+
}, {
|
|
110
|
+
root: string[];
|
|
111
|
+
scroll: string;
|
|
112
|
+
table: string;
|
|
113
|
+
}, import('tailwind-variants').TVReturnType<{
|
|
114
|
+
size: {
|
|
115
|
+
sm: {};
|
|
116
|
+
md: {};
|
|
117
|
+
lg: {};
|
|
118
|
+
};
|
|
119
|
+
embed: {
|
|
120
|
+
true: {
|
|
121
|
+
root: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
enclosed: {
|
|
125
|
+
true: {
|
|
126
|
+
root: string;
|
|
127
|
+
};
|
|
128
|
+
};
|
|
129
|
+
sticky: {
|
|
130
|
+
header: {};
|
|
131
|
+
headerAndFooter: {};
|
|
132
|
+
};
|
|
133
|
+
}, {
|
|
134
|
+
root: string[];
|
|
135
|
+
scroll: string;
|
|
136
|
+
table: string;
|
|
137
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
138
|
+
/**
|
|
139
|
+
* @deprecated Import from `@agentero/design-system/table` instead.
|
|
140
|
+
*/
|
|
141
|
+
export type { TableRootProps } from '../table';
|
|
60
142
|
export declare const DataTable: {
|
|
61
143
|
Root: {
|
|
62
144
|
<TData extends import('@tanstack/table-core').RowData>({ children, isLoading, onRowClick, rowHref, linkComponent, ...tableOptions }: import('react').PropsWithChildren<{
|
|
@@ -157,10 +239,10 @@ export declare const DataTable: {
|
|
|
157
239
|
};
|
|
158
240
|
Table: {
|
|
159
241
|
({ children, size, sticky, embed, enclosed }: {
|
|
160
|
-
size?: import('
|
|
161
|
-
sticky?: import('
|
|
162
|
-
embed?: import('
|
|
163
|
-
enclosed?: import('
|
|
242
|
+
size?: import('.').TableRootProps["size"];
|
|
243
|
+
sticky?: import('.').TableRootProps["sticky"];
|
|
244
|
+
embed?: import('.').TableRootProps["embed"];
|
|
245
|
+
enclosed?: import('.').TableRootProps["enclosed"];
|
|
164
246
|
} & {
|
|
165
247
|
children?: import('react').ReactNode | undefined;
|
|
166
248
|
}): import("react/jsx-runtime").JSX.Element;
|
package/src/data-table/index.js
CHANGED
|
@@ -1,22 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { tableRecipe as e } from "../table/table.js";
|
|
2
|
+
import { Table as t } from "../table/index.js";
|
|
3
|
+
import { DataTablePagination as n, DataTableTable as r, Footer as i, Root as a, ToolBar as o, useDataTable as s } from "./data-table.js";
|
|
3
4
|
//#region src/data-table/index.ts
|
|
4
|
-
var
|
|
5
|
-
Root:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
Cell: t,
|
|
11
|
-
ExpandButton: n,
|
|
12
|
-
ExpandedRow: r,
|
|
13
|
-
RowActions: c
|
|
14
|
-
}, _ = {
|
|
15
|
-
Root: p,
|
|
16
|
-
ToolBar: m,
|
|
17
|
-
Table: d,
|
|
18
|
-
Footer: f,
|
|
19
|
-
Pagination: u
|
|
5
|
+
var c = t, l = e, u = {
|
|
6
|
+
Root: a,
|
|
7
|
+
ToolBar: o,
|
|
8
|
+
Table: r,
|
|
9
|
+
Footer: i,
|
|
10
|
+
Pagination: n
|
|
20
11
|
};
|
|
21
12
|
//#endregion
|
|
22
|
-
export {
|
|
13
|
+
export { u as DataTable, c as Table, l as tableRecipe, s as useDataTable };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Downward chevron glyph used by the row expand/collapse button. Rotates 180°
|
|
4
|
+
* when its row is expanded (driven by `data-state=open`). The fill follows
|
|
5
|
+
* `currentColor` so it inherits the button's text color token.
|
|
6
|
+
*
|
|
7
|
+
* @summary 24px chevron-down icon used by the row expand button
|
|
8
|
+
*/
|
|
9
|
+
export declare const IconKeyboardArrowDown: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
//#region src/table/icons.tsx
|
|
3
|
+
var t = (t) => /* @__PURE__ */ e("svg", {
|
|
4
|
+
width: "24",
|
|
5
|
+
height: "24",
|
|
6
|
+
viewBox: "0 0 24 24",
|
|
7
|
+
fill: "none",
|
|
8
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
9
|
+
...t,
|
|
10
|
+
children: /* @__PURE__ */ e("path", {
|
|
11
|
+
fill: "currentColor",
|
|
12
|
+
d: "M12 14.677a.83.83 0 0 1-.633-.256L6.873 9.927a.73.73 0 0 1-.212-.522.7.7 0 0 1 .212-.532.72.72 0 0 1 .527-.217q.31 0 .527.217L12 12.946l4.073-4.073a.73.73 0 0 1 .522-.212.7.7 0 0 1 .532.212q.217.217.217.527a.72.72 0 0 1-.217.527l-4.494 4.494a.83.83 0 0 1-.633.256"
|
|
13
|
+
})
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
export { t as IconKeyboardArrowDown };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export { tableRecipe } from './table';
|
|
2
|
+
export type { TableRootProps } from './table';
|
|
3
|
+
export declare const Table: {
|
|
4
|
+
Root: {
|
|
5
|
+
({ children, ref, ...variants }: import('react').PropsWithChildren<import('./table').TableRootProps>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
8
|
+
Head: {
|
|
9
|
+
({ children, ...props }: import('react').PropsWithChildren<import('react').HTMLAttributes<HTMLTableSectionElement>>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
Body: {
|
|
13
|
+
({ children, ...props }: import('react').PropsWithChildren<import('react').HTMLAttributes<HTMLTableSectionElement>>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
Row: {
|
|
17
|
+
({ className, ...props }: import('react').ComponentProps<"tr">): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
Header: {
|
|
21
|
+
({ className, ...props }: import('react').PropsWithChildren<import('react').HTMLAttributes<HTMLTableCellElement>>): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
displayName: string;
|
|
23
|
+
};
|
|
24
|
+
Cell: {
|
|
25
|
+
({ className, ...props }: import('react').PropsWithChildren<import('react').TdHTMLAttributes<HTMLTableCellElement>>): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
};
|
|
28
|
+
ExpandButton: {
|
|
29
|
+
({ toggleExpanded, isExpanded, className, ...props }: {
|
|
30
|
+
toggleExpanded: () => void;
|
|
31
|
+
isExpanded: boolean;
|
|
32
|
+
} & {
|
|
33
|
+
children?: import('react').ReactNode;
|
|
34
|
+
variant?: import('../button').ButtonVariantType;
|
|
35
|
+
size?: import('../button').ButtonSizeType;
|
|
36
|
+
status?: "danger";
|
|
37
|
+
loading?: boolean;
|
|
38
|
+
disabled?: boolean;
|
|
39
|
+
iconOnly?: boolean;
|
|
40
|
+
rounded?: boolean;
|
|
41
|
+
align?: "center" | "start" | "end" | "justify";
|
|
42
|
+
fitContent?: boolean;
|
|
43
|
+
ref?: import('react').Ref<HTMLButtonElement | HTMLAnchorElement>;
|
|
44
|
+
} & import('react').ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
45
|
+
asChild?: boolean;
|
|
46
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
displayName: string;
|
|
48
|
+
};
|
|
49
|
+
ExpandedRow: {
|
|
50
|
+
({ className, ...props }: import('react').PropsWithChildren<import('react').HTMLAttributes<HTMLTableRowElement>>): import("react/jsx-runtime").JSX.Element;
|
|
51
|
+
displayName: string;
|
|
52
|
+
};
|
|
53
|
+
RowActions: {
|
|
54
|
+
({ children }: import('react').PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
55
|
+
displayName: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Body as e, Cell as t, ExpandButton as n, ExpandedRow as r, Head as i, Header as a, Root as o, Row as s, RowActions as c, tableRecipe as l } from "./table.js";
|
|
2
|
+
//#region src/table/index.ts
|
|
3
|
+
var u = {
|
|
4
|
+
Root: o,
|
|
5
|
+
Head: i,
|
|
6
|
+
Body: e,
|
|
7
|
+
Row: s,
|
|
8
|
+
Header: a,
|
|
9
|
+
Cell: t,
|
|
10
|
+
ExpandButton: n,
|
|
11
|
+
ExpandedRow: r,
|
|
12
|
+
RowActions: c
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { u as Table, l as tableRecipe };
|
|
@@ -100,7 +100,7 @@ export type TableRootProps = TableVariants & {
|
|
|
100
100
|
*
|
|
101
101
|
* @example
|
|
102
102
|
* ```tsx
|
|
103
|
-
* import { Table } from '@agentero/design-system/
|
|
103
|
+
* import { Table } from '@agentero/design-system/table';
|
|
104
104
|
*
|
|
105
105
|
* <Table.Root size="md" sticky="head">
|
|
106
106
|
* <Table.Head>
|
|
@@ -116,7 +116,7 @@ export type TableRootProps = TableVariants & {
|
|
|
116
116
|
* </Table.Root>
|
|
117
117
|
* ```
|
|
118
118
|
*/
|
|
119
|
-
export declare const
|
|
119
|
+
export declare const Root: {
|
|
120
120
|
({ children, ref, ...variants }: PropsWithChildren<TableRootProps>): import("react/jsx-runtime").JSX.Element;
|
|
121
121
|
displayName: string;
|
|
122
122
|
};
|
|
@@ -125,7 +125,7 @@ export declare const TableRoot: {
|
|
|
125
125
|
*
|
|
126
126
|
* @summary `<thead>` wrapper for header rows
|
|
127
127
|
*/
|
|
128
|
-
export declare const
|
|
128
|
+
export declare const Head: {
|
|
129
129
|
({ children, ...props }: PropsWithChildren<HTMLAttributes<HTMLTableSectionElement>>): import("react/jsx-runtime").JSX.Element;
|
|
130
130
|
displayName: string;
|
|
131
131
|
};
|
|
@@ -134,7 +134,7 @@ export declare const TableHead: {
|
|
|
134
134
|
*
|
|
135
135
|
* @summary `<tbody>` wrapper
|
|
136
136
|
*/
|
|
137
|
-
export declare const
|
|
137
|
+
export declare const Body: {
|
|
138
138
|
({ children, ...props }: PropsWithChildren<HTMLAttributes<HTMLTableSectionElement>>): import("react/jsx-runtime").JSX.Element;
|
|
139
139
|
displayName: string;
|
|
140
140
|
};
|
|
@@ -144,7 +144,7 @@ export declare const TableBody: {
|
|
|
144
144
|
*
|
|
145
145
|
* @summary Table row element
|
|
146
146
|
*/
|
|
147
|
-
export declare const
|
|
147
|
+
export declare const Row: {
|
|
148
148
|
({ className, ...props }: ComponentProps<"tr">): import("react/jsx-runtime").JSX.Element;
|
|
149
149
|
displayName: string;
|
|
150
150
|
};
|
|
@@ -153,7 +153,7 @@ export declare const TableRow: {
|
|
|
153
153
|
*
|
|
154
154
|
* @summary Header cell element
|
|
155
155
|
*/
|
|
156
|
-
export declare const
|
|
156
|
+
export declare const Header: {
|
|
157
157
|
({ className, ...props }: PropsWithChildren<HTMLAttributes<HTMLTableCellElement>>): import("react/jsx-runtime").JSX.Element;
|
|
158
158
|
displayName: string;
|
|
159
159
|
};
|
|
@@ -162,11 +162,11 @@ export declare const TableHeader: {
|
|
|
162
162
|
*
|
|
163
163
|
* @summary Data cell element
|
|
164
164
|
*/
|
|
165
|
-
export declare const
|
|
165
|
+
export declare const Cell: {
|
|
166
166
|
({ className, ...props }: PropsWithChildren<TdHTMLAttributes<HTMLTableCellElement>>): import("react/jsx-runtime").JSX.Element;
|
|
167
167
|
displayName: string;
|
|
168
168
|
};
|
|
169
|
-
type
|
|
169
|
+
type ExpandButtonProps = {
|
|
170
170
|
toggleExpanded: () => void;
|
|
171
171
|
isExpanded: boolean;
|
|
172
172
|
} & ButtonProps;
|
|
@@ -175,8 +175,8 @@ type TableExpandButtonProps = {
|
|
|
175
175
|
*
|
|
176
176
|
* @summary Expand/collapse toggle button for an expandable row
|
|
177
177
|
*/
|
|
178
|
-
export declare const
|
|
179
|
-
({ toggleExpanded, isExpanded, className, ...props }:
|
|
178
|
+
export declare const ExpandButton: {
|
|
179
|
+
({ toggleExpanded, isExpanded, className, ...props }: ExpandButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
180
180
|
displayName: string;
|
|
181
181
|
};
|
|
182
182
|
/**
|
|
@@ -185,7 +185,7 @@ export declare const TableExpandButton: {
|
|
|
185
185
|
*
|
|
186
186
|
* @summary Detail row shown under an expanded parent row
|
|
187
187
|
*/
|
|
188
|
-
export declare const
|
|
188
|
+
export declare const ExpandedRow: {
|
|
189
189
|
({ className, ...props }: PropsWithChildren<HTMLAttributes<HTMLTableRowElement>>): import("react/jsx-runtime").JSX.Element;
|
|
190
190
|
displayName: string;
|
|
191
191
|
};
|
|
@@ -195,7 +195,7 @@ export declare const TableExpandedRow: {
|
|
|
195
195
|
*
|
|
196
196
|
* @summary Hover-revealed row action cluster
|
|
197
197
|
*/
|
|
198
|
-
export declare const
|
|
198
|
+
export declare const RowActions: {
|
|
199
199
|
({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
200
200
|
displayName: string;
|
|
201
201
|
};
|
|
@@ -5,7 +5,7 @@ import { IconKeyboardArrowDown as n } from "./icons.js";
|
|
|
5
5
|
import { tv as r } from "tailwind-variants";
|
|
6
6
|
import { jsx as i } from "react/jsx-runtime";
|
|
7
7
|
import { createContext as a, use as o } from "react";
|
|
8
|
-
//#region src/
|
|
8
|
+
//#region src/table/table.tsx
|
|
9
9
|
var s = "ps-[var(--table-cell-padding-inline)] pe-[var(--table-cell-padding-inline)] first:ps-[var(--table-cell-padding-inline-ends)] last:pe-[var(--table-cell-padding-inline-ends)] has-[[type=checkbox]]:w-0 has-[[type=checkbox]]:pe-0", c = r({
|
|
10
10
|
slots: {
|
|
11
11
|
root: ["flex min-h-0 flex-1 flex-col overflow-hidden", "[--table-cell-padding-inline:1.25rem] [--table-cell-padding-inline-ends:1.25rem]"],
|
|
@@ -169,4 +169,4 @@ var E = r({ base: [
|
|
|
169
169
|
});
|
|
170
170
|
D.displayName = "Table.RowActions";
|
|
171
171
|
//#endregion
|
|
172
|
-
export { g as
|
|
172
|
+
export { g as Body, S as Cell, w as ExpandButton, T as ExpandedRow, h as Head, b as Header, m as Root, v as Row, D as RowActions, c as tableRecipe };
|