@uselets/ui 1.18.2 → 1.18.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.
package/README.md CHANGED
@@ -166,8 +166,7 @@ force horizontal scroll when the parent is narrower. Combine `stickyHeader` on `
166
166
  scrolls vertically. `DataTable` already wraps its `Table` in a `TableContainer`.
167
167
 
168
168
  ```tsx
169
- import type { ColumnDef } from '@tanstack/react-table'
170
- import { DataTable, DataTableColumnHeader } from '@uselets/ui/data-table'
169
+ import { type ColumnDef, DataTable, DataTableColumnHeader } from '@uselets/ui/data-table'
171
170
 
172
171
  type Payment = {
173
172
  id: string
@@ -313,6 +312,7 @@ Use semantic tokens for application UI instead of hardcoding palette steps in co
313
312
  - Supporting tokens: `border`, `input`, `ring`
314
313
  - Sidebar tokens: `sidebar`, `sidebar-primary`, `sidebar-accent`, `sidebar-border`, `sidebar-ring`
315
314
  - Data viz tokens: `chart-1` to `chart-5`
315
+ - Component-scoped tokens: `--logo-foreground` (used by the Intelitrack, Neutra, Kovra, and Fibonash logos' `color` tone so they stay legible in dark mode) and `--rd-logo-foreground` (used by the RD logo's wordmark for the same reason)
316
316
 
317
317
  The theme also exposes the shadcn foreground pair for destructive surfaces:
318
318
 
@@ -1,2 +1,2 @@
1
- import { C as createDataTableSelectColumn, E as useDataTableContext, S as UseDataTableOptions, T as useDataTable, _ as DataTableToolbarProps, a as DataTableBodyProps, b as RowData, c as DataTableHeader, d as DataTablePagination, f as DataTablePaginationProps, g as DataTableToolbar, h as DataTableRootProps, i as DataTableBody, l as DataTableHeaderProps, m as DataTableRoot, n as ColumnDef, o as DataTableColumnHeader, p as DataTableProps, r as DataTable, s as DataTableColumnHeaderProps, t as Column, u as DataTableLabels, v as DataTableViewOptions, w as defaultDataTableLabels, x as TanStackTable, y as DataTableViewOptionsProps } from "../data-table-BT75MSO9.js";
2
- export { type Column, type ColumnDef, DataTable, DataTableBody, DataTableBodyProps, DataTableColumnHeader, DataTableColumnHeaderProps, DataTableHeader, DataTableHeaderProps, DataTableLabels, DataTablePagination, DataTablePaginationProps, DataTableProps, DataTableRoot, DataTableRootProps, DataTableToolbar, DataTableToolbarProps, DataTableViewOptions, DataTableViewOptionsProps, type RowData, type TanStackTable, UseDataTableOptions, createDataTableSelectColumn, defaultDataTableLabels, useDataTable, useDataTableContext };
1
+ import { C as createDataTableSelectColumn, E as useDataTableContext, S as UseDataTableOptions, T as useDataTable, _ as DataTableToolbarProps, a as DataTableBodyProps, b as RowData, c as DataTableHeader, d as DataTablePagination, f as DataTablePaginationProps, g as DataTableToolbar, h as DataTableRootProps, i as DataTableBody, l as DataTableHeaderProps, m as DataTableRoot, n as ColumnDef, o as DataTableColumnHeader, p as DataTableProps, r as DataTable, s as DataTableColumnHeaderProps, t as Column, u as DataTableLabels, v as DataTableViewOptions, w as defaultDataTableLabels, x as TanStackTable, y as DataTableViewOptionsProps } from "../data-table-DXNWHN9R.js";
2
+ export { Column, ColumnDef, DataTable, DataTableBody, DataTableBodyProps, DataTableColumnHeader, DataTableColumnHeaderProps, DataTableHeader, DataTableHeaderProps, DataTableLabels, DataTablePagination, DataTablePaginationProps, DataTableProps, DataTableRoot, DataTableRootProps, DataTableToolbar, DataTableToolbarProps, DataTableViewOptions, DataTableViewOptionsProps, type RowData, TanStackTable, UseDataTableOptions, createDataTableSelectColumn, defaultDataTableLabels, useDataTable, useDataTableContext };
@@ -1 +1 @@
1
- import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"../data-table-B0h5peCQ.js";export{u as DataTable,o as DataTableBody,c as DataTableColumnHeader,i as DataTableHeader,e as DataTablePagination,s as DataTableRoot,l as DataTableToolbar,t as DataTableViewOptions,a as createDataTableSelectColumn,d as defaultDataTableLabels,n as useDataTable,r as useDataTableContext};
1
+ import{a as e,c as t,d as n,f as r,i,l as a,n as o,o as s,r as c,s as l,t as u,u as d}from"../data-table-tnfPcXqc.js";export{u as DataTable,o as DataTableBody,c as DataTableColumnHeader,i as DataTableHeader,e as DataTablePagination,s as DataTableRoot,l as DataTableToolbar,t as DataTableViewOptions,a as createDataTableSelectColumn,d as defaultDataTableLabels,n as useDataTable,r as useDataTableContext};
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-Bdj-bS2b.js";import{t as e}from"../table-CuE0Aenj.js";import{a as t,c as n,d as r,f as i,i as a,l as o,n as s,o as c,r as l,t as u,u as d}from"../data-table-B0h5peCQ.js";import{a as f,n as p,r as m}from"../react.esm-BkhVXJ8s.js";import{jsx as h,jsxs as g}from"react/jsx-runtime";const _=[{id:`1`,name:`Ada Lovelace`,email:`ada@example.com`,age:36},{id:`2`,name:`Grace Hopper`,email:`grace@example.com`,age:85},{id:`3`,name:`Alan Turing`,email:`alan@example.com`,age:41},{id:`4`,name:`Katherine Johnson`,email:`katherine@example.com`,age:101},{id:`5`,name:`Margaret Hamilton`,email:`margaret@example.com`,age:89}],v=[{accessorKey:`name`,header:({column:e})=>h(l,{column:e,title:`Name`}),cell:({row:e})=>e.getValue(`name`)},{accessorKey:`email`,header:`Email`,cell:({row:e})=>e.getValue(`email`)},{accessorKey:`age`,header:`Age`,cell:({row:e})=>e.getValue(`age`)}];function getBodyRowNames(e){return Array.from(e.querySelectorAll(`[data-slot="table-body"] [data-slot="table-row"]`)).map(e=>e.querySelector(`[data-slot="table-cell"]`)?.textContent)}describe(`DataTable`,()=>{it(`renders a header cell per column and a body row per data item`,()=>{let{container:e}=m(h(u,{columns:v,data:_}));expect(f.getByRole(`columnheader`,{name:`Email`})).not.toBeNull(),expect(f.getByRole(`columnheader`,{name:`Age`})).not.toBeNull(),expect(e.querySelectorAll(`[data-slot="table-body"] [data-slot="table-row"]`)).toHaveLength(_.length),expect(f.getByText(`Ada Lovelace`)).not.toBeNull(),expect(f.getByText(`katherine@example.com`)).not.toBeNull()}),it(`renders the default empty-state message spanning all columns when data is empty`,()=>{let{container:e}=m(h(u,{columns:v,data:[]})),t=e.querySelector(`[data-slot="table-body"] [data-slot="table-cell"]`);expect(f.getByText(d.emptyMessage)).not.toBeNull(),expect(t?.getAttribute(`colspan`)).toBe(String(v.length))}),it(`renders a custom empty message provided via labels`,()=>{m(h(u,{columns:v,data:[],labels:{emptyMessage:`No people found`}})),expect(f.getByText(`No people found`)).not.toBeNull(),expect(f.queryByText(d.emptyMessage)).toBeNull()}),it(`sorts rows ascending, then descending, then clears sorting on repeated header clicks`,()=>{let{container:e}=m(h(u,{columns:v,data:_,enableSorting:!0})),t=f.getByRole(`button`);p.click(t),expect(getBodyRowNames(e)).toEqual([`Ada Lovelace`,`Alan Turing`,`Grace Hopper`,`Katherine Johnson`,`Margaret Hamilton`]),p.click(t),expect(getBodyRowNames(e)).toEqual([`Margaret Hamilton`,`Katherine Johnson`,`Grace Hopper`,`Alan Turing`,`Ada Lovelace`]),p.click(t),expect(getBodyRowNames(e)).toEqual(_.map(e=>e.name))}),it(`does not render a sort toggle when sorting is disabled at the table level`,()=>{m(h(u,{columns:v,data:_})),expect(f.queryByRole(`button`)).toBeNull()}),it(`supports row selection with header select-all and per-row checkboxes`,()=>{m(h(u,{columns:v,data:_,enableRowSelection:!0}));let e=f.getByRole(`checkbox`,{name:d.selectAllRows}),t=f.getAllByRole(`checkbox`,{name:d.selectRow});expect(t).toHaveLength(_.length),expect(e.getAttribute(`data-state`)).toBe(`unchecked`),p.click(t[0]),expect(t[0].getAttribute(`data-state`)).toBe(`checked`),expect(e.getAttribute(`data-state`)).toBe(`indeterminate`),p.click(e);for(let e of f.getAllByRole(`checkbox`,{name:d.selectRow}))expect(e.getAttribute(`data-state`)).toBe(`checked`);expect(e.getAttribute(`data-state`)).toBe(`checked`)}),it(`does not prepend a second select column when the columns already define one`,()=>{let e=[{id:`select`,header:()=>`S`,cell:()=>`x`},...v];m(h(u,{columns:e,data:_,enableRowSelection:!0})),expect(f.getAllByRole(`columnheader`)).toHaveLength(e.length)})}),describe(`DataTableToolbar`,()=>{it(`renders no toolbar content when there is no filter, no toolbarActions, and column visibility is off`,()=>{let{container:e}=m(h(u,{columns:v,data:_}));expect(e.querySelector(`[data-slot="input"]`)).toBeNull(),expect(f.queryByRole(`button`,{name:d.columnsButton})).toBeNull()}),it(`filters rows by a single column via the toolbar input`,()=>{let{container:e}=m(h(u,{columns:v,data:_,filterColumns:`name`})),t=f.getByPlaceholderText(d.filterPlaceholder);p.change(t,{target:{value:`ada`}}),expect(getBodyRowNames(e)).toEqual([`Ada Lovelace`])}),it(`lets the active filter column be switched and resets the previous filter value`,()=>{let{container:e}=m(h(u,{columns:v,data:_,filterColumns:[`name`,`email`]})),t=f.getByLabelText(d.filterColumnSelectorLabel),n=f.getByPlaceholderText(d.filterPlaceholder);p.change(n,{target:{value:`ada`}}),expect(getBodyRowNames(e)).toEqual([`Ada Lovelace`]),p.change(t,{target:{value:`email`}}),expect(getBodyRowNames(e)).toEqual(_.map(e=>e.name)),p.change(n,{target:{value:`grace@`}}),expect(getBodyRowNames(e)).toEqual([`Grace Hopper`])}),it(`renders static toolbarActions content`,()=>{m(h(u,{columns:v,data:_,toolbarActions:h(`button`,{type:`button`,children:`Export`})})),expect(f.getByRole(`button`,{name:`Export`})).not.toBeNull()}),it(`renders function toolbarActions with access to the live table instance`,()=>{m(h(u,{columns:v,data:_,toolbarActions:e=>g(`span`,{children:[e.getRowModel().rows.length,` rows`]})})),expect(f.getByText(`${_.length} rows`)).not.toBeNull()}),it(`renders the column-visibility button when showColumnVisibility is set`,()=>{m(h(u,{columns:v,data:_,showColumnVisibility:!0})),expect(f.getByRole(`button`,{name:d.columnsButton})).not.toBeNull()})}),describe(`DataTableColumnHeader`,()=>{function fakeColumn(e){return{getCanSort:e.getCanSort??(()=>!0),getIsSorted:e.getIsSorted??(()=>!1),toggleSorting:e.toggleSorting??(()=>{}),clearSorting:e.clearSorting??(()=>{})}}it(`renders only the title, with no sort control, when the column cannot sort`,()=>{let{container:e}=m(h(l,{column:fakeColumn({getCanSort:()=>!1}),title:`Name`}));expect(f.getByText(`Name`)).not.toBeNull(),expect(e.querySelector(`button`)).toBeNull()}),it(`toggles to ascending sort when clicked while unsorted`,()=>{let e=vi.fn(),{container:t}=m(h(l,{column:fakeColumn({getIsSorted:()=>!1,toggleSorting:e}),title:`Name`}));p.click(t.querySelector(`button`)),expect(e).toHaveBeenCalledWith(!1)}),it(`toggles to descending sort when clicked while sorted ascending`,()=>{let e=vi.fn(),{container:t}=m(h(l,{column:fakeColumn({getIsSorted:()=>`asc`,toggleSorting:e}),title:`Name`}));p.click(t.querySelector(`button`)),expect(e).toHaveBeenCalledWith(!0)}),it(`clears sorting when clicked while sorted descending`,()=>{let e=vi.fn(),{container:t}=m(h(l,{column:fakeColumn({getIsSorted:()=>`desc`,clearSorting:e}),title:`Name`}));p.click(t.querySelector(`button`)),expect(e).toHaveBeenCalledTimes(1)})}),describe(`DataTablePagination`,()=>{it(`throws when rendered without a table prop or DataTableRoot context`,()=>{expect(()=>m(h(t,{}))).toThrow("DataTablePagination requires a `table` prop or to be rendered within <DataTableRoot>")}),it(`paginates rows and updates page/button state when navigating first/next/last/previous`,()=>{let{container:n}=m(g(c,{columns:v,data:_,enablePagination:!0,pageSize:2,children:[g(e,{children:[h(a,{}),h(s,{})]}),h(t,{})]}));expect(getBodyRowNames(n)).toEqual([`Ada Lovelace`,`Grace Hopper`]),expect(f.getByText(d.pageOf(1,3))).not.toBeNull(),expect(f.getByRole(`button`,{name:d.goToPreviousPage}).disabled).toBe(!0),p.click(f.getByRole(`button`,{name:d.goToNextPage})),expect(getBodyRowNames(n)).toEqual([`Alan Turing`,`Katherine Johnson`]),expect(f.getByText(d.pageOf(2,3))).not.toBeNull(),p.click(f.getByRole(`button`,{name:d.goToLastPage})),expect(getBodyRowNames(n)).toEqual([`Margaret Hamilton`]),expect(f.getByRole(`button`,{name:d.goToNextPage}).disabled).toBe(!0),p.click(f.getByRole(`button`,{name:d.goToFirstPage})),expect(getBodyRowNames(n)).toEqual([`Ada Lovelace`,`Grace Hopper`]),p.click(f.getByRole(`button`,{name:d.goToNextPage})),p.click(f.getByRole(`button`,{name:d.goToPreviousPage})),expect(getBodyRowNames(n)).toEqual([`Ada Lovelace`,`Grace Hopper`])})}),describe(`DataTableViewOptions`,()=>{it(`throws when rendered without a table prop or DataTableRoot context`,()=>{expect(()=>m(h(n,{}))).toThrow("DataTableViewOptions requires a `table` prop or to be rendered within <DataTableRoot>")}),it(`renders nothing when there are no hideable columns`,()=>{let{container:e}=m(h(n,{table:{getAllColumns:()=>[]}}));expect(e.firstChild).toBeNull()}),it(`opens the dropdown and hides a column when its checkbox item is toggled off`,()=>{let{container:e}=m(h(u,{columns:v,data:_,showColumnVisibility:!0})),t=f.getByRole(`button`,{name:d.columnsButton});p.pointerDown(t,{button:0,pointerId:1}),p.pointerUp(t,{button:0,pointerId:1});let n=f.getByRole(`menuitemcheckbox`,{name:`email`});p.pointerDown(n,{button:0,pointerId:1}),p.pointerUp(n,{button:0,pointerId:1}),p.click(n),expect(f.queryByRole(`columnheader`,{name:`Email`})).toBeNull(),expect(e.querySelector(`[data-slot="table-container"]`)).not.toBeNull()})}),describe(`createDataTableSelectColumn`,()=>{it(`returns a non-sortable, non-hideable select column definition`,()=>{let e=o();expect(e.id).toBe(`select`),expect(e.enableSorting).toBe(!1),expect(e.enableHiding).toBe(!1),expect(typeof e.header).toBe(`function`),expect(typeof e.cell).toBe(`function`)}),it(`uses custom select-all and select-row labels when the table provides them`,()=>{m(h(u,{columns:v,data:_,enableRowSelection:!0,labels:{selectAllRows:`Pick all`,selectRow:`Pick one`}})),expect(f.getByRole(`checkbox`,{name:`Pick all`})).not.toBeNull(),expect(f.getAllByRole(`checkbox`,{name:`Pick one`})).toHaveLength(_.length)})}),describe(`useDataTable`,()=>{function Harness(e){return h(`span`,{"data-testid":`column-count`,children:r(e).getAllColumns().length})}it(`does not add a select column when row selection is disabled`,()=>{m(h(Harness,{columns:v,data:_})),expect(f.getByTestId(`column-count`).textContent).toBe(String(v.length))}),it(`prepends a select column when row selection is enabled`,()=>{m(h(Harness,{columns:v,data:_,enableRowSelection:!0})),expect(f.getByTestId(`column-count`).textContent).toBe(String(v.length+1))})}),describe(`DataTableRoot`,()=>{it(`renders children within context when given an externally created table (controlled mode)`,()=>{function Wrapper(){return h(c,{table:r({columns:v,data:_}),children:g(e,{children:[h(a,{}),h(s,{})]})})}let{container:t}=m(h(Wrapper,{}));expect(t.querySelectorAll(`[data-slot="table-body"] [data-slot="table-row"]`)).toHaveLength(_.length)}),it(`builds its own table from columns and data when no table prop is given (uncontrolled mode)`,()=>{let{container:t}=m(h(c,{columns:v,data:_,children:g(e,{children:[h(a,{}),h(s,{})]})}));expect(t.querySelectorAll(`[data-slot="table-body"] [data-slot="table-row"]`)).toHaveLength(_.length)}),it(`applies the className to the wrapping element`,()=>{let{container:t}=m(h(c,{columns:v,data:_,className:`custom-root`,children:h(e,{children:h(a,{})})}));expect(t.firstChild.className).toContain(`custom-root`)})}),describe(`useDataTableContext`,()=>{it(`throws a descriptive error when called outside of DataTableRoot`,()=>{function Consumer(){return i(),null}expect(()=>m(h(Consumer,{}))).toThrow(`useDataTableContext must be used within <DataTableRoot>`)})});
1
+ import"../rolldown-runtime-Bdj-bS2b.js";import{t as e}from"../table-CuE0Aenj.js";import{a as t,c as n,d as r,f as i,i as a,l as o,n as s,o as c,r as l,t as u,u as d}from"../data-table-tnfPcXqc.js";import{a as f,n as p,r as m}from"../react.esm-BkhVXJ8s.js";import{jsx as h,jsxs as g}from"react/jsx-runtime";const _=[{id:`1`,name:`Ada Lovelace`,email:`ada@example.com`,age:36},{id:`2`,name:`Grace Hopper`,email:`grace@example.com`,age:85},{id:`3`,name:`Alan Turing`,email:`alan@example.com`,age:41},{id:`4`,name:`Katherine Johnson`,email:`katherine@example.com`,age:101},{id:`5`,name:`Margaret Hamilton`,email:`margaret@example.com`,age:89}],v=[{accessorKey:`name`,header:({column:e})=>h(l,{column:e,title:`Name`}),cell:({row:e})=>e.getValue(`name`)},{accessorKey:`email`,header:`Email`,cell:({row:e})=>e.getValue(`email`)},{accessorKey:`age`,header:`Age`,cell:({row:e})=>e.getValue(`age`)}];function getBodyRowNames(e){return Array.from(e.querySelectorAll(`[data-slot="table-body"] [data-slot="table-row"]`)).map(e=>e.querySelector(`[data-slot="table-cell"]`)?.textContent)}describe(`DataTable`,()=>{it(`renders a header cell per column and a body row per data item`,()=>{let{container:e}=m(h(u,{columns:v,data:_}));expect(f.getByRole(`columnheader`,{name:`Email`})).not.toBeNull(),expect(f.getByRole(`columnheader`,{name:`Age`})).not.toBeNull(),expect(e.querySelectorAll(`[data-slot="table-body"] [data-slot="table-row"]`)).toHaveLength(_.length),expect(f.getByText(`Ada Lovelace`)).not.toBeNull(),expect(f.getByText(`katherine@example.com`)).not.toBeNull()}),it(`renders the default empty-state message spanning all columns when data is empty`,()=>{let{container:e}=m(h(u,{columns:v,data:[]})),t=e.querySelector(`[data-slot="table-body"] [data-slot="table-cell"]`);expect(f.getByText(d.emptyMessage)).not.toBeNull(),expect(t?.getAttribute(`colspan`)).toBe(String(v.length))}),it(`renders a custom empty message provided via labels`,()=>{m(h(u,{columns:v,data:[],labels:{emptyMessage:`No people found`}})),expect(f.getByText(`No people found`)).not.toBeNull(),expect(f.queryByText(d.emptyMessage)).toBeNull()}),it(`sorts rows ascending, then descending, then clears sorting on repeated header clicks`,()=>{let{container:e}=m(h(u,{columns:v,data:_,enableSorting:!0})),t=f.getByRole(`button`);p.click(t),expect(getBodyRowNames(e)).toEqual([`Ada Lovelace`,`Alan Turing`,`Grace Hopper`,`Katherine Johnson`,`Margaret Hamilton`]),p.click(t),expect(getBodyRowNames(e)).toEqual([`Margaret Hamilton`,`Katherine Johnson`,`Grace Hopper`,`Alan Turing`,`Ada Lovelace`]),p.click(t),expect(getBodyRowNames(e)).toEqual(_.map(e=>e.name))}),it(`does not render a sort toggle when sorting is disabled at the table level`,()=>{m(h(u,{columns:v,data:_})),expect(f.queryByRole(`button`)).toBeNull()}),it(`supports row selection with header select-all and per-row checkboxes`,()=>{m(h(u,{columns:v,data:_,enableRowSelection:!0}));let e=f.getByRole(`checkbox`,{name:d.selectAllRows}),t=f.getAllByRole(`checkbox`,{name:d.selectRow});expect(t).toHaveLength(_.length),expect(e.getAttribute(`data-state`)).toBe(`unchecked`),p.click(t[0]),expect(t[0].getAttribute(`data-state`)).toBe(`checked`),expect(e.getAttribute(`data-state`)).toBe(`indeterminate`),p.click(e);for(let e of f.getAllByRole(`checkbox`,{name:d.selectRow}))expect(e.getAttribute(`data-state`)).toBe(`checked`);expect(e.getAttribute(`data-state`)).toBe(`checked`)}),it(`does not prepend a second select column when the columns already define one`,()=>{let e=[{id:`select`,header:()=>`S`,cell:()=>`x`},...v];m(h(u,{columns:e,data:_,enableRowSelection:!0})),expect(f.getAllByRole(`columnheader`)).toHaveLength(e.length)}),it(`actually paginates rows when showPagination is set`,()=>{let{container:e}=m(h(u,{columns:v,data:_,showPagination:!0,pageSize:2}));expect(getBodyRowNames(e)).toEqual([`Ada Lovelace`,`Grace Hopper`])})}),describe(`DataTableToolbar`,()=>{it(`renders no toolbar content when there is no filter, no toolbarActions, and column visibility is off`,()=>{let{container:e}=m(h(u,{columns:v,data:_}));expect(e.querySelector(`[data-slot="input"]`)).toBeNull(),expect(f.queryByRole(`button`,{name:d.columnsButton})).toBeNull()}),it(`filters rows by a single column via the toolbar input`,()=>{let{container:e}=m(h(u,{columns:v,data:_,filterColumns:`name`})),t=f.getByPlaceholderText(d.filterPlaceholder);p.change(t,{target:{value:`ada`}}),expect(getBodyRowNames(e)).toEqual([`Ada Lovelace`])}),it(`lets the active filter column be switched and resets the previous filter value`,()=>{let{container:e}=m(h(u,{columns:v,data:_,filterColumns:[`name`,`email`]})),t=f.getByLabelText(d.filterColumnSelectorLabel),n=f.getByPlaceholderText(d.filterPlaceholder);p.change(n,{target:{value:`ada`}}),expect(getBodyRowNames(e)).toEqual([`Ada Lovelace`]),p.change(t,{target:{value:`email`}}),expect(getBodyRowNames(e)).toEqual(_.map(e=>e.name)),p.change(n,{target:{value:`grace@`}}),expect(getBodyRowNames(e)).toEqual([`Grace Hopper`])}),it(`renders static toolbarActions content`,()=>{m(h(u,{columns:v,data:_,toolbarActions:h(`button`,{type:`button`,children:`Export`})})),expect(f.getByRole(`button`,{name:`Export`})).not.toBeNull()}),it(`renders function toolbarActions with access to the live table instance`,()=>{m(h(u,{columns:v,data:_,toolbarActions:e=>g(`span`,{children:[e.getRowModel().rows.length,` rows`]})})),expect(f.getByText(`${_.length} rows`)).not.toBeNull()}),it(`renders the column-visibility button when showColumnVisibility is set`,()=>{m(h(u,{columns:v,data:_,showColumnVisibility:!0})),expect(f.getByRole(`button`,{name:d.columnsButton})).not.toBeNull()})}),describe(`DataTableColumnHeader`,()=>{function fakeColumn(e){return{getCanSort:e.getCanSort??(()=>!0),getIsSorted:e.getIsSorted??(()=>!1),toggleSorting:e.toggleSorting??(()=>{}),clearSorting:e.clearSorting??(()=>{})}}it(`renders only the title, with no sort control, when the column cannot sort`,()=>{let{container:e}=m(h(l,{column:fakeColumn({getCanSort:()=>!1}),title:`Name`}));expect(f.getByText(`Name`)).not.toBeNull(),expect(e.querySelector(`button`)).toBeNull()}),it(`toggles to ascending sort when clicked while unsorted`,()=>{let e=vi.fn(),{container:t}=m(h(l,{column:fakeColumn({getIsSorted:()=>!1,toggleSorting:e}),title:`Name`}));p.click(t.querySelector(`button`)),expect(e).toHaveBeenCalledWith(!1)}),it(`toggles to descending sort when clicked while sorted ascending`,()=>{let e=vi.fn(),{container:t}=m(h(l,{column:fakeColumn({getIsSorted:()=>`asc`,toggleSorting:e}),title:`Name`}));p.click(t.querySelector(`button`)),expect(e).toHaveBeenCalledWith(!0)}),it(`clears sorting when clicked while sorted descending`,()=>{let e=vi.fn(),{container:t}=m(h(l,{column:fakeColumn({getIsSorted:()=>`desc`,clearSorting:e}),title:`Name`}));p.click(t.querySelector(`button`)),expect(e).toHaveBeenCalledTimes(1)})}),describe(`DataTablePagination`,()=>{it(`throws when rendered without a table prop or DataTableRoot context`,()=>{expect(()=>m(h(t,{}))).toThrow("DataTablePagination requires a `table` prop or to be rendered within <DataTableRoot>")}),it(`paginates rows and updates page/button state when navigating first/next/last/previous`,()=>{let{container:n}=m(g(c,{columns:v,data:_,enablePagination:!0,pageSize:2,children:[g(e,{children:[h(a,{}),h(s,{})]}),h(t,{})]}));expect(getBodyRowNames(n)).toEqual([`Ada Lovelace`,`Grace Hopper`]),expect(f.getByText(d.pageOf(1,3))).not.toBeNull(),expect(f.getByRole(`button`,{name:d.goToPreviousPage}).disabled).toBe(!0),p.click(f.getByRole(`button`,{name:d.goToNextPage})),expect(getBodyRowNames(n)).toEqual([`Alan Turing`,`Katherine Johnson`]),expect(f.getByText(d.pageOf(2,3))).not.toBeNull(),p.click(f.getByRole(`button`,{name:d.goToLastPage})),expect(getBodyRowNames(n)).toEqual([`Margaret Hamilton`]),expect(f.getByRole(`button`,{name:d.goToNextPage}).disabled).toBe(!0),p.click(f.getByRole(`button`,{name:d.goToFirstPage})),expect(getBodyRowNames(n)).toEqual([`Ada Lovelace`,`Grace Hopper`]),p.click(f.getByRole(`button`,{name:d.goToNextPage})),p.click(f.getByRole(`button`,{name:d.goToPreviousPage})),expect(getBodyRowNames(n)).toEqual([`Ada Lovelace`,`Grace Hopper`])})}),describe(`DataTableViewOptions`,()=>{it(`throws when rendered without a table prop or DataTableRoot context`,()=>{expect(()=>m(h(n,{}))).toThrow("DataTableViewOptions requires a `table` prop or to be rendered within <DataTableRoot>")}),it(`renders nothing when there are no hideable columns`,()=>{let{container:e}=m(h(n,{table:{getAllColumns:()=>[]}}));expect(e.firstChild).toBeNull()}),it(`opens the dropdown and hides a column when its checkbox item is toggled off`,()=>{let{container:e}=m(h(u,{columns:v,data:_,showColumnVisibility:!0})),t=f.getByRole(`button`,{name:d.columnsButton});p.pointerDown(t,{button:0,pointerId:1}),p.pointerUp(t,{button:0,pointerId:1});let n=f.getByRole(`menuitemcheckbox`,{name:`email`});p.pointerDown(n,{button:0,pointerId:1}),p.pointerUp(n,{button:0,pointerId:1}),p.click(n),expect(f.queryByRole(`columnheader`,{name:`Email`})).toBeNull(),expect(e.querySelector(`[data-slot="table-container"]`)).not.toBeNull()})}),describe(`createDataTableSelectColumn`,()=>{it(`returns a non-sortable, non-hideable select column definition`,()=>{let e=o();expect(e.id).toBe(`select`),expect(e.enableSorting).toBe(!1),expect(e.enableHiding).toBe(!1),expect(typeof e.header).toBe(`function`),expect(typeof e.cell).toBe(`function`)}),it(`uses custom select-all and select-row labels when the table provides them`,()=>{m(h(u,{columns:v,data:_,enableRowSelection:!0,labels:{selectAllRows:`Pick all`,selectRow:`Pick one`}})),expect(f.getByRole(`checkbox`,{name:`Pick all`})).not.toBeNull(),expect(f.getAllByRole(`checkbox`,{name:`Pick one`})).toHaveLength(_.length)})}),describe(`useDataTable`,()=>{function Harness(e){return h(`span`,{"data-testid":`column-count`,children:r(e).getAllColumns().length})}it(`does not add a select column when row selection is disabled`,()=>{m(h(Harness,{columns:v,data:_})),expect(f.getByTestId(`column-count`).textContent).toBe(String(v.length))}),it(`prepends a select column when row selection is enabled`,()=>{m(h(Harness,{columns:v,data:_,enableRowSelection:!0})),expect(f.getByTestId(`column-count`).textContent).toBe(String(v.length+1))})}),describe(`DataTableRoot`,()=>{it(`renders children within context when given an externally created table (controlled mode)`,()=>{function Wrapper(){return h(c,{table:r({columns:v,data:_}),children:g(e,{children:[h(a,{}),h(s,{})]})})}let{container:t}=m(h(Wrapper,{}));expect(t.querySelectorAll(`[data-slot="table-body"] [data-slot="table-row"]`)).toHaveLength(_.length)}),it(`builds its own table from columns and data when no table prop is given (uncontrolled mode)`,()=>{let{container:t}=m(h(c,{columns:v,data:_,children:g(e,{children:[h(a,{}),h(s,{})]})}));expect(t.querySelectorAll(`[data-slot="table-body"] [data-slot="table-row"]`)).toHaveLength(_.length)}),it(`applies the className to the wrapping element`,()=>{let{container:t}=m(h(c,{columns:v,data:_,className:`custom-root`,children:h(e,{children:h(a,{})})}));expect(t.firstChild.className).toContain(`custom-root`)})}),describe(`useDataTableContext`,()=>{it(`throws a descriptive error when called outside of DataTableRoot`,()=>{function Consumer(){return i(),null}expect(()=>m(h(Consumer,{}))).toThrow(`useDataTableContext must be used within <DataTableRoot>`)})});
2
2
  //# sourceMappingURL=data-table.spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-table.spec.js","names":[],"sources":["../../src/components/data-table.spec.tsx"],"sourcesContent":["import type { Column, ColumnDef } from '@tanstack/react-table'\nimport { fireEvent, render, screen } from '@testing-library/react'\n\nimport {\n createDataTableSelectColumn,\n DataTable,\n DataTableBody,\n DataTableColumnHeader,\n DataTableHeader,\n DataTablePagination,\n DataTableRoot,\n DataTableViewOptions,\n defaultDataTableLabels,\n type UseDataTableOptions,\n useDataTable,\n useDataTableContext\n} from './data-table'\nimport { Table } from './table'\n\ntype Person = {\n id: string\n name: string\n email: string\n age: number\n}\n\nconst people: Person[] = [\n { id: '1', name: 'Ada Lovelace', email: 'ada@example.com', age: 36 },\n { id: '2', name: 'Grace Hopper', email: 'grace@example.com', age: 85 },\n { id: '3', name: 'Alan Turing', email: 'alan@example.com', age: 41 },\n { id: '4', name: 'Katherine Johnson', email: 'katherine@example.com', age: 101 },\n { id: '5', name: 'Margaret Hamilton', email: 'margaret@example.com', age: 89 }\n]\n\nconst columns: ColumnDef<Person>[] = [\n {\n accessorKey: 'name',\n header: ({ column }) => <DataTableColumnHeader column={column} title=\"Name\" />,\n cell: ({ row }) => row.getValue('name')\n },\n {\n accessorKey: 'email',\n header: 'Email',\n cell: ({ row }) => row.getValue('email')\n },\n {\n accessorKey: 'age',\n header: 'Age',\n cell: ({ row }) => row.getValue('age')\n }\n]\n\nfunction getBodyRowNames(container: HTMLElement) {\n return Array.from(container.querySelectorAll('[data-slot=\"table-body\"] [data-slot=\"table-row\"]')).map(\n (row) => row.querySelector('[data-slot=\"table-cell\"]')?.textContent\n )\n}\n\ndescribe('DataTable', () => {\n it('renders a header cell per column and a body row per data item', () => {\n const { container } = render(<DataTable columns={columns} data={people} />)\n\n expect(screen.getByRole('columnheader', { name: 'Email' })).not.toBeNull()\n expect(screen.getByRole('columnheader', { name: 'Age' })).not.toBeNull()\n expect(container.querySelectorAll('[data-slot=\"table-body\"] [data-slot=\"table-row\"]')).toHaveLength(people.length)\n expect(screen.getByText('Ada Lovelace')).not.toBeNull()\n expect(screen.getByText('katherine@example.com')).not.toBeNull()\n })\n\n it('renders the default empty-state message spanning all columns when data is empty', () => {\n const { container } = render(<DataTable columns={columns} data={[]} />)\n\n const emptyCell = container.querySelector('[data-slot=\"table-body\"] [data-slot=\"table-cell\"]')\n\n expect(screen.getByText(defaultDataTableLabels.emptyMessage as string)).not.toBeNull()\n expect(emptyCell?.getAttribute('colspan')).toBe(String(columns.length))\n })\n\n it('renders a custom empty message provided via labels', () => {\n render(<DataTable columns={columns} data={[]} labels={{ emptyMessage: 'No people found' }} />)\n\n expect(screen.getByText('No people found')).not.toBeNull()\n expect(screen.queryByText(defaultDataTableLabels.emptyMessage as string)).toBeNull()\n })\n\n it('sorts rows ascending, then descending, then clears sorting on repeated header clicks', () => {\n const { container } = render(<DataTable columns={columns} data={people} enableSorting />)\n\n const sortButton = screen.getByRole('button')\n\n fireEvent.click(sortButton)\n expect(getBodyRowNames(container)).toEqual([\n 'Ada Lovelace',\n 'Alan Turing',\n 'Grace Hopper',\n 'Katherine Johnson',\n 'Margaret Hamilton'\n ])\n\n fireEvent.click(sortButton)\n expect(getBodyRowNames(container)).toEqual([\n 'Margaret Hamilton',\n 'Katherine Johnson',\n 'Grace Hopper',\n 'Alan Turing',\n 'Ada Lovelace'\n ])\n\n fireEvent.click(sortButton)\n expect(getBodyRowNames(container)).toEqual(people.map((person) => person.name))\n })\n\n it('does not render a sort toggle when sorting is disabled at the table level', () => {\n render(<DataTable columns={columns} data={people} />)\n\n expect(screen.queryByRole('button')).toBeNull()\n })\n\n it('supports row selection with header select-all and per-row checkboxes', () => {\n render(<DataTable columns={columns} data={people} enableRowSelection />)\n\n const selectAll = screen.getByRole('checkbox', { name: defaultDataTableLabels.selectAllRows })\n const rowCheckboxes = screen.getAllByRole('checkbox', { name: defaultDataTableLabels.selectRow })\n\n expect(rowCheckboxes).toHaveLength(people.length)\n expect(selectAll.getAttribute('data-state')).toBe('unchecked')\n\n fireEvent.click(rowCheckboxes[0]!)\n expect(rowCheckboxes[0]!.getAttribute('data-state')).toBe('checked')\n expect(selectAll.getAttribute('data-state')).toBe('indeterminate')\n\n fireEvent.click(selectAll)\n for (const checkbox of screen.getAllByRole('checkbox', { name: defaultDataTableLabels.selectRow })) {\n expect(checkbox.getAttribute('data-state')).toBe('checked')\n }\n expect(selectAll.getAttribute('data-state')).toBe('checked')\n })\n\n it('does not prepend a second select column when the columns already define one', () => {\n const columnsWithSelect: ColumnDef<Person>[] = [{ id: 'select', header: () => 'S', cell: () => 'x' }, ...columns]\n\n render(<DataTable columns={columnsWithSelect} data={people} enableRowSelection />)\n\n expect(screen.getAllByRole('columnheader')).toHaveLength(columnsWithSelect.length)\n })\n})\n\ndescribe('DataTableToolbar', () => {\n it('renders no toolbar content when there is no filter, no toolbarActions, and column visibility is off', () => {\n const { container } = render(<DataTable columns={columns} data={people} />)\n\n expect(container.querySelector('[data-slot=\"input\"]')).toBeNull()\n expect(screen.queryByRole('button', { name: defaultDataTableLabels.columnsButton })).toBeNull()\n })\n\n it('filters rows by a single column via the toolbar input', () => {\n const { container } = render(<DataTable columns={columns} data={people} filterColumns=\"name\" />)\n\n const filterInput = screen.getByPlaceholderText(defaultDataTableLabels.filterPlaceholder)\n fireEvent.change(filterInput, { target: { value: 'ada' } })\n\n expect(getBodyRowNames(container)).toEqual(['Ada Lovelace'])\n })\n\n it('lets the active filter column be switched and resets the previous filter value', () => {\n const { container } = render(<DataTable columns={columns} data={people} filterColumns={['name', 'email']} />)\n\n const columnSelect = screen.getByLabelText(defaultDataTableLabels.filterColumnSelectorLabel)\n const filterInput = screen.getByPlaceholderText(defaultDataTableLabels.filterPlaceholder)\n\n fireEvent.change(filterInput, { target: { value: 'ada' } })\n expect(getBodyRowNames(container)).toEqual(['Ada Lovelace'])\n\n fireEvent.change(columnSelect, { target: { value: 'email' } })\n expect(getBodyRowNames(container)).toEqual(people.map((person) => person.name))\n\n fireEvent.change(filterInput, { target: { value: 'grace@' } })\n expect(getBodyRowNames(container)).toEqual(['Grace Hopper'])\n })\n\n it('renders static toolbarActions content', () => {\n render(<DataTable columns={columns} data={people} toolbarActions={<button type=\"button\">Export</button>} />)\n\n expect(screen.getByRole('button', { name: 'Export' })).not.toBeNull()\n })\n\n it('renders function toolbarActions with access to the live table instance', () => {\n render(\n <DataTable\n columns={columns}\n data={people}\n toolbarActions={(table) => <span>{table.getRowModel().rows.length} rows</span>}\n />\n )\n\n expect(screen.getByText(`${people.length} rows`)).not.toBeNull()\n })\n\n it('renders the column-visibility button when showColumnVisibility is set', () => {\n render(<DataTable columns={columns} data={people} showColumnVisibility />)\n\n expect(screen.getByRole('button', { name: defaultDataTableLabels.columnsButton })).not.toBeNull()\n })\n})\n\ndescribe('DataTableColumnHeader', () => {\n function fakeColumn(overrides: {\n getCanSort?: () => boolean\n getIsSorted?: () => false | 'asc' | 'desc'\n toggleSorting?: (desc?: boolean) => void\n clearSorting?: () => void\n }) {\n return {\n getCanSort: overrides.getCanSort ?? (() => true),\n getIsSorted: overrides.getIsSorted ?? (() => false),\n toggleSorting: overrides.toggleSorting ?? (() => {}),\n clearSorting: overrides.clearSorting ?? (() => {})\n } as unknown as Column<Person, unknown>\n }\n\n it('renders only the title, with no sort control, when the column cannot sort', () => {\n const { container } = render(\n <DataTableColumnHeader column={fakeColumn({ getCanSort: () => false })} title=\"Name\" />\n )\n\n expect(screen.getByText('Name')).not.toBeNull()\n expect(container.querySelector('button')).toBeNull()\n })\n\n it('toggles to ascending sort when clicked while unsorted', () => {\n const toggleSorting = vi.fn()\n const { container } = render(\n <DataTableColumnHeader column={fakeColumn({ getIsSorted: () => false, toggleSorting })} title=\"Name\" />\n )\n\n fireEvent.click(container.querySelector('button')!)\n\n expect(toggleSorting).toHaveBeenCalledWith(false)\n })\n\n it('toggles to descending sort when clicked while sorted ascending', () => {\n const toggleSorting = vi.fn()\n const { container } = render(\n <DataTableColumnHeader column={fakeColumn({ getIsSorted: () => 'asc', toggleSorting })} title=\"Name\" />\n )\n\n fireEvent.click(container.querySelector('button')!)\n\n expect(toggleSorting).toHaveBeenCalledWith(true)\n })\n\n it('clears sorting when clicked while sorted descending', () => {\n const clearSorting = vi.fn()\n const { container } = render(\n <DataTableColumnHeader column={fakeColumn({ getIsSorted: () => 'desc', clearSorting })} title=\"Name\" />\n )\n\n fireEvent.click(container.querySelector('button')!)\n\n expect(clearSorting).toHaveBeenCalledTimes(1)\n })\n})\n\ndescribe('DataTablePagination', () => {\n it('throws when rendered without a table prop or DataTableRoot context', () => {\n expect(() => render(<DataTablePagination />)).toThrow(\n 'DataTablePagination requires a `table` prop or to be rendered within <DataTableRoot>'\n )\n })\n\n it('paginates rows and updates page/button state when navigating first/next/last/previous', () => {\n const { container } = render(\n <DataTableRoot columns={columns} data={people} enablePagination pageSize={2}>\n <Table>\n <DataTableHeader />\n <DataTableBody />\n </Table>\n <DataTablePagination />\n </DataTableRoot>\n )\n\n expect(getBodyRowNames(container)).toEqual(['Ada Lovelace', 'Grace Hopper'])\n expect(screen.getByText(defaultDataTableLabels.pageOf(1, 3) as string)).not.toBeNull()\n expect(\n (screen.getByRole('button', { name: defaultDataTableLabels.goToPreviousPage }) as HTMLButtonElement).disabled\n ).toBe(true)\n\n fireEvent.click(screen.getByRole('button', { name: defaultDataTableLabels.goToNextPage }))\n expect(getBodyRowNames(container)).toEqual(['Alan Turing', 'Katherine Johnson'])\n expect(screen.getByText(defaultDataTableLabels.pageOf(2, 3) as string)).not.toBeNull()\n\n fireEvent.click(screen.getByRole('button', { name: defaultDataTableLabels.goToLastPage }))\n expect(getBodyRowNames(container)).toEqual(['Margaret Hamilton'])\n expect(\n (screen.getByRole('button', { name: defaultDataTableLabels.goToNextPage }) as HTMLButtonElement).disabled\n ).toBe(true)\n\n fireEvent.click(screen.getByRole('button', { name: defaultDataTableLabels.goToFirstPage }))\n expect(getBodyRowNames(container)).toEqual(['Ada Lovelace', 'Grace Hopper'])\n\n fireEvent.click(screen.getByRole('button', { name: defaultDataTableLabels.goToNextPage }))\n fireEvent.click(screen.getByRole('button', { name: defaultDataTableLabels.goToPreviousPage }))\n expect(getBodyRowNames(container)).toEqual(['Ada Lovelace', 'Grace Hopper'])\n })\n})\n\ndescribe('DataTableViewOptions', () => {\n it('throws when rendered without a table prop or DataTableRoot context', () => {\n expect(() => render(<DataTableViewOptions />)).toThrow(\n 'DataTableViewOptions requires a `table` prop or to be rendered within <DataTableRoot>'\n )\n })\n\n it('renders nothing when there are no hideable columns', () => {\n const table = { getAllColumns: () => [] } as unknown as Parameters<typeof DataTableViewOptions>[0]['table']\n const { container } = render(<DataTableViewOptions table={table} />)\n\n expect(container.firstChild).toBeNull()\n })\n\n it('opens the dropdown and hides a column when its checkbox item is toggled off', () => {\n const { container } = render(<DataTable columns={columns} data={people} showColumnVisibility />)\n\n const trigger = screen.getByRole('button', { name: defaultDataTableLabels.columnsButton })\n // Radix opens the menu from pointerdown/pointerup, not a plain click event.\n fireEvent.pointerDown(trigger, { button: 0, pointerId: 1 })\n fireEvent.pointerUp(trigger, { button: 0, pointerId: 1 })\n\n const emailItem = screen.getByRole('menuitemcheckbox', { name: 'email' })\n fireEvent.pointerDown(emailItem, { button: 0, pointerId: 1 })\n fireEvent.pointerUp(emailItem, { button: 0, pointerId: 1 })\n fireEvent.click(emailItem)\n\n expect(screen.queryByRole('columnheader', { name: 'Email' })).toBeNull()\n expect(container.querySelector('[data-slot=\"table-container\"]')).not.toBeNull()\n })\n})\n\ndescribe('createDataTableSelectColumn', () => {\n it('returns a non-sortable, non-hideable select column definition', () => {\n const column = createDataTableSelectColumn<Person>()\n\n expect(column.id).toBe('select')\n expect(column.enableSorting).toBe(false)\n expect(column.enableHiding).toBe(false)\n expect(typeof column.header).toBe('function')\n expect(typeof column.cell).toBe('function')\n })\n\n it('uses custom select-all and select-row labels when the table provides them', () => {\n render(\n <DataTable\n columns={columns}\n data={people}\n enableRowSelection\n labels={{ selectAllRows: 'Pick all', selectRow: 'Pick one' }}\n />\n )\n\n expect(screen.getByRole('checkbox', { name: 'Pick all' })).not.toBeNull()\n expect(screen.getAllByRole('checkbox', { name: 'Pick one' })).toHaveLength(people.length)\n })\n})\n\ndescribe('useDataTable', () => {\n function Harness(props: UseDataTableOptions<Person>) {\n const table = useDataTable(props)\n return <span data-testid=\"column-count\">{table.getAllColumns().length}</span>\n }\n\n it('does not add a select column when row selection is disabled', () => {\n render(<Harness columns={columns} data={people} />)\n\n expect(screen.getByTestId('column-count').textContent).toBe(String(columns.length))\n })\n\n it('prepends a select column when row selection is enabled', () => {\n render(<Harness columns={columns} data={people} enableRowSelection />)\n\n expect(screen.getByTestId('column-count').textContent).toBe(String(columns.length + 1))\n })\n})\n\ndescribe('DataTableRoot', () => {\n it('renders children within context when given an externally created table (controlled mode)', () => {\n function Wrapper() {\n const table = useDataTable({ columns, data: people })\n return (\n <DataTableRoot table={table}>\n <Table>\n <DataTableHeader />\n <DataTableBody />\n </Table>\n </DataTableRoot>\n )\n }\n\n const { container } = render(<Wrapper />)\n\n expect(container.querySelectorAll('[data-slot=\"table-body\"] [data-slot=\"table-row\"]')).toHaveLength(people.length)\n })\n\n it('builds its own table from columns and data when no table prop is given (uncontrolled mode)', () => {\n const { container } = render(\n <DataTableRoot columns={columns} data={people}>\n <Table>\n <DataTableHeader />\n <DataTableBody />\n </Table>\n </DataTableRoot>\n )\n\n expect(container.querySelectorAll('[data-slot=\"table-body\"] [data-slot=\"table-row\"]')).toHaveLength(people.length)\n })\n\n it('applies the className to the wrapping element', () => {\n const { container } = render(\n <DataTableRoot columns={columns} data={people} className=\"custom-root\">\n <Table>\n <DataTableHeader />\n </Table>\n </DataTableRoot>\n )\n\n expect((container.firstChild as HTMLElement).className).toContain('custom-root')\n })\n})\n\ndescribe('useDataTableContext', () => {\n it('throws a descriptive error when called outside of DataTableRoot', () => {\n function Consumer() {\n useDataTableContext()\n return null\n }\n\n expect(() => render(<Consumer />)).toThrow('useDataTableContext must be used within <DataTableRoot>')\n })\n})\n"],"mappings":"kTA0BA,MAAM,EAAmB,CACvB,CAAE,GAAI,IAAK,KAAM,eAAgB,MAAO,kBAAmB,IAAK,EAAG,EACnE,CAAE,GAAI,IAAK,KAAM,eAAgB,MAAO,oBAAqB,IAAK,EAAG,EACrE,CAAE,GAAI,IAAK,KAAM,cAAe,MAAO,mBAAoB,IAAK,EAAG,EACnE,CAAE,GAAI,IAAK,KAAM,oBAAqB,MAAO,wBAAyB,IAAK,GAAI,EAC/E,CAAE,GAAI,IAAK,KAAM,oBAAqB,MAAO,uBAAwB,IAAK,EAAG,CAC/E,EAEM,EAA+B,CACnC,CACE,YAAa,OACb,QAAS,CAAE,YAAa,EAAC,EAAD,CAA+B,SAAQ,MAAM,MAAQ,CAAA,EAC7E,MAAO,CAAE,SAAU,EAAI,SAAS,MAAM,CACxC,EACA,CACE,YAAa,QACb,OAAQ,QACR,MAAO,CAAE,SAAU,EAAI,SAAS,OAAO,CACzC,EACA,CACE,YAAa,MACb,OAAQ,MACR,MAAO,CAAE,SAAU,EAAI,SAAS,KAAK,CACvC,CACF,EAEA,SAAS,gBAAgB,EAAwB,CAC/C,OAAO,MAAM,KAAK,EAAU,iBAAiB,kDAAkD,CAAC,CAAC,CAAC,IAC/F,GAAQ,EAAI,cAAc,0BAA0B,CAAC,EAAE,WAC1D,CACF,CAEA,SAAS,gBAAmB,CAC1B,GAAG,oEAAuE,CACxE,GAAM,CAAE,aAAc,EAAO,EAAC,EAAD,CAAoB,UAAS,KAAM,CAAS,CAAA,CAAC,EAE1E,OAAO,EAAO,UAAU,eAAgB,CAAE,KAAM,OAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,EACzE,OAAO,EAAO,UAAU,eAAgB,CAAE,KAAM,KAAM,CAAC,CAAC,CA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,CAAC,CAAC,aAAa,EAAO,MAAM,CACnH,CAAC,EAED,GAAG,iGAAoG,CACrG,GAAM,CAAE,aAAc,EACpB,EAAC,EAAD,CAAwB,UAAS,KAAM,EACrC,SAAA,EAAC,EAAD,CAAA,SAAA,CACE,EAAC,EAAD,CAAkB,CAAA,EAClB,EAAC,EAAD,CAAgB,CAAA,CACX,CAAA,CAAA,CACM,CAAA,CACjB,EAEA,OAAO,EAAU,iBAAiB,kDAAkD,CAAC,CAAC,CAAC,aAAa,EAAO,MAAM,CACnH,CAAC,EAED,GAAG,oDAAuD,CACxD,GAAM,CAAE,aAAc,EACpB,EAAC,EAAD,CAAwB,UAAS,KAAM,EAAQ,UAAU,cACvD,SAAA,EAAC,EAAD,CAAA,SACE,EAAC,EAAD,CAAkB,CAAA,CACb,CAAA,CACM,CAAA,CACjB,EAEA,OAAQ,EAAU,WAA2B,SAAS,CAAC,CAAC,UAAU,aAAa,CACjF,CAAC,CACH,CAAC,EAED,SAAS,0BAA6B,CACpC,GAAG,sEAAyE,CAC1E,SAAS,UAAW,CAElB,OADA,EAAoB,EACb,IACT,CAEA,WAAa,EAAO,EAAC,SAAD,CAAW,CAAA,CAAC,CAAC,CAAC,CAAC,QAAQ,yDAAyD,CACtG,CAAC,CACH,CAAC"}
1
+ {"version":3,"file":"data-table.spec.js","names":[],"sources":["../../src/components/data-table.spec.tsx"],"sourcesContent":["import { fireEvent, render, screen } from '@testing-library/react'\n\nimport {\n type Column,\n type ColumnDef,\n createDataTableSelectColumn,\n DataTable,\n DataTableBody,\n DataTableColumnHeader,\n DataTableHeader,\n DataTablePagination,\n DataTableRoot,\n DataTableViewOptions,\n defaultDataTableLabels,\n type UseDataTableOptions,\n useDataTable,\n useDataTableContext\n} from './data-table'\nimport { Table } from './table'\n\ntype Person = {\n id: string\n name: string\n email: string\n age: number\n}\n\nconst people: Person[] = [\n { id: '1', name: 'Ada Lovelace', email: 'ada@example.com', age: 36 },\n { id: '2', name: 'Grace Hopper', email: 'grace@example.com', age: 85 },\n { id: '3', name: 'Alan Turing', email: 'alan@example.com', age: 41 },\n { id: '4', name: 'Katherine Johnson', email: 'katherine@example.com', age: 101 },\n { id: '5', name: 'Margaret Hamilton', email: 'margaret@example.com', age: 89 }\n]\n\nconst columns: ColumnDef<Person>[] = [\n {\n accessorKey: 'name',\n header: ({ column }) => <DataTableColumnHeader column={column} title=\"Name\" />,\n cell: ({ row }) => row.getValue('name')\n },\n {\n accessorKey: 'email',\n header: 'Email',\n cell: ({ row }) => row.getValue('email')\n },\n {\n accessorKey: 'age',\n header: 'Age',\n cell: ({ row }) => row.getValue('age')\n }\n]\n\nfunction getBodyRowNames(container: HTMLElement) {\n return Array.from(container.querySelectorAll('[data-slot=\"table-body\"] [data-slot=\"table-row\"]')).map(\n (row) => row.querySelector('[data-slot=\"table-cell\"]')?.textContent\n )\n}\n\ndescribe('DataTable', () => {\n it('renders a header cell per column and a body row per data item', () => {\n const { container } = render(<DataTable columns={columns} data={people} />)\n\n expect(screen.getByRole('columnheader', { name: 'Email' })).not.toBeNull()\n expect(screen.getByRole('columnheader', { name: 'Age' })).not.toBeNull()\n expect(container.querySelectorAll('[data-slot=\"table-body\"] [data-slot=\"table-row\"]')).toHaveLength(people.length)\n expect(screen.getByText('Ada Lovelace')).not.toBeNull()\n expect(screen.getByText('katherine@example.com')).not.toBeNull()\n })\n\n it('renders the default empty-state message spanning all columns when data is empty', () => {\n const { container } = render(<DataTable columns={columns} data={[]} />)\n\n const emptyCell = container.querySelector('[data-slot=\"table-body\"] [data-slot=\"table-cell\"]')\n\n expect(screen.getByText(defaultDataTableLabels.emptyMessage as string)).not.toBeNull()\n expect(emptyCell?.getAttribute('colspan')).toBe(String(columns.length))\n })\n\n it('renders a custom empty message provided via labels', () => {\n render(<DataTable columns={columns} data={[]} labels={{ emptyMessage: 'No people found' }} />)\n\n expect(screen.getByText('No people found')).not.toBeNull()\n expect(screen.queryByText(defaultDataTableLabels.emptyMessage as string)).toBeNull()\n })\n\n it('sorts rows ascending, then descending, then clears sorting on repeated header clicks', () => {\n const { container } = render(<DataTable columns={columns} data={people} enableSorting />)\n\n const sortButton = screen.getByRole('button')\n\n fireEvent.click(sortButton)\n expect(getBodyRowNames(container)).toEqual([\n 'Ada Lovelace',\n 'Alan Turing',\n 'Grace Hopper',\n 'Katherine Johnson',\n 'Margaret Hamilton'\n ])\n\n fireEvent.click(sortButton)\n expect(getBodyRowNames(container)).toEqual([\n 'Margaret Hamilton',\n 'Katherine Johnson',\n 'Grace Hopper',\n 'Alan Turing',\n 'Ada Lovelace'\n ])\n\n fireEvent.click(sortButton)\n expect(getBodyRowNames(container)).toEqual(people.map((person) => person.name))\n })\n\n it('does not render a sort toggle when sorting is disabled at the table level', () => {\n render(<DataTable columns={columns} data={people} />)\n\n expect(screen.queryByRole('button')).toBeNull()\n })\n\n it('supports row selection with header select-all and per-row checkboxes', () => {\n render(<DataTable columns={columns} data={people} enableRowSelection />)\n\n const selectAll = screen.getByRole('checkbox', { name: defaultDataTableLabels.selectAllRows })\n const rowCheckboxes = screen.getAllByRole('checkbox', { name: defaultDataTableLabels.selectRow })\n\n expect(rowCheckboxes).toHaveLength(people.length)\n expect(selectAll.getAttribute('data-state')).toBe('unchecked')\n\n fireEvent.click(rowCheckboxes[0]!)\n expect(rowCheckboxes[0]!.getAttribute('data-state')).toBe('checked')\n expect(selectAll.getAttribute('data-state')).toBe('indeterminate')\n\n fireEvent.click(selectAll)\n for (const checkbox of screen.getAllByRole('checkbox', { name: defaultDataTableLabels.selectRow })) {\n expect(checkbox.getAttribute('data-state')).toBe('checked')\n }\n expect(selectAll.getAttribute('data-state')).toBe('checked')\n })\n\n it('does not prepend a second select column when the columns already define one', () => {\n const columnsWithSelect: ColumnDef<Person>[] = [{ id: 'select', header: () => 'S', cell: () => 'x' }, ...columns]\n\n render(<DataTable columns={columnsWithSelect} data={people} enableRowSelection />)\n\n expect(screen.getAllByRole('columnheader')).toHaveLength(columnsWithSelect.length)\n })\n\n it('actually paginates rows when showPagination is set', () => {\n const { container } = render(<DataTable columns={columns} data={people} showPagination pageSize={2} />)\n\n expect(getBodyRowNames(container)).toEqual(['Ada Lovelace', 'Grace Hopper'])\n })\n})\n\ndescribe('DataTableToolbar', () => {\n it('renders no toolbar content when there is no filter, no toolbarActions, and column visibility is off', () => {\n const { container } = render(<DataTable columns={columns} data={people} />)\n\n expect(container.querySelector('[data-slot=\"input\"]')).toBeNull()\n expect(screen.queryByRole('button', { name: defaultDataTableLabels.columnsButton })).toBeNull()\n })\n\n it('filters rows by a single column via the toolbar input', () => {\n const { container } = render(<DataTable columns={columns} data={people} filterColumns=\"name\" />)\n\n const filterInput = screen.getByPlaceholderText(defaultDataTableLabels.filterPlaceholder)\n fireEvent.change(filterInput, { target: { value: 'ada' } })\n\n expect(getBodyRowNames(container)).toEqual(['Ada Lovelace'])\n })\n\n it('lets the active filter column be switched and resets the previous filter value', () => {\n const { container } = render(<DataTable columns={columns} data={people} filterColumns={['name', 'email']} />)\n\n const columnSelect = screen.getByLabelText(defaultDataTableLabels.filterColumnSelectorLabel)\n const filterInput = screen.getByPlaceholderText(defaultDataTableLabels.filterPlaceholder)\n\n fireEvent.change(filterInput, { target: { value: 'ada' } })\n expect(getBodyRowNames(container)).toEqual(['Ada Lovelace'])\n\n fireEvent.change(columnSelect, { target: { value: 'email' } })\n expect(getBodyRowNames(container)).toEqual(people.map((person) => person.name))\n\n fireEvent.change(filterInput, { target: { value: 'grace@' } })\n expect(getBodyRowNames(container)).toEqual(['Grace Hopper'])\n })\n\n it('renders static toolbarActions content', () => {\n render(<DataTable columns={columns} data={people} toolbarActions={<button type=\"button\">Export</button>} />)\n\n expect(screen.getByRole('button', { name: 'Export' })).not.toBeNull()\n })\n\n it('renders function toolbarActions with access to the live table instance', () => {\n render(\n <DataTable\n columns={columns}\n data={people}\n toolbarActions={(table) => <span>{table.getRowModel().rows.length} rows</span>}\n />\n )\n\n expect(screen.getByText(`${people.length} rows`)).not.toBeNull()\n })\n\n it('renders the column-visibility button when showColumnVisibility is set', () => {\n render(<DataTable columns={columns} data={people} showColumnVisibility />)\n\n expect(screen.getByRole('button', { name: defaultDataTableLabels.columnsButton })).not.toBeNull()\n })\n})\n\ndescribe('DataTableColumnHeader', () => {\n function fakeColumn(overrides: {\n getCanSort?: () => boolean\n getIsSorted?: () => false | 'asc' | 'desc'\n toggleSorting?: (desc?: boolean) => void\n clearSorting?: () => void\n }) {\n return {\n getCanSort: overrides.getCanSort ?? (() => true),\n getIsSorted: overrides.getIsSorted ?? (() => false),\n toggleSorting: overrides.toggleSorting ?? (() => {}),\n clearSorting: overrides.clearSorting ?? (() => {})\n } as unknown as Column<Person, unknown>\n }\n\n it('renders only the title, with no sort control, when the column cannot sort', () => {\n const { container } = render(\n <DataTableColumnHeader column={fakeColumn({ getCanSort: () => false })} title=\"Name\" />\n )\n\n expect(screen.getByText('Name')).not.toBeNull()\n expect(container.querySelector('button')).toBeNull()\n })\n\n it('toggles to ascending sort when clicked while unsorted', () => {\n const toggleSorting = vi.fn()\n const { container } = render(\n <DataTableColumnHeader column={fakeColumn({ getIsSorted: () => false, toggleSorting })} title=\"Name\" />\n )\n\n fireEvent.click(container.querySelector('button')!)\n\n expect(toggleSorting).toHaveBeenCalledWith(false)\n })\n\n it('toggles to descending sort when clicked while sorted ascending', () => {\n const toggleSorting = vi.fn()\n const { container } = render(\n <DataTableColumnHeader column={fakeColumn({ getIsSorted: () => 'asc', toggleSorting })} title=\"Name\" />\n )\n\n fireEvent.click(container.querySelector('button')!)\n\n expect(toggleSorting).toHaveBeenCalledWith(true)\n })\n\n it('clears sorting when clicked while sorted descending', () => {\n const clearSorting = vi.fn()\n const { container } = render(\n <DataTableColumnHeader column={fakeColumn({ getIsSorted: () => 'desc', clearSorting })} title=\"Name\" />\n )\n\n fireEvent.click(container.querySelector('button')!)\n\n expect(clearSorting).toHaveBeenCalledTimes(1)\n })\n})\n\ndescribe('DataTablePagination', () => {\n it('throws when rendered without a table prop or DataTableRoot context', () => {\n expect(() => render(<DataTablePagination />)).toThrow(\n 'DataTablePagination requires a `table` prop or to be rendered within <DataTableRoot>'\n )\n })\n\n it('paginates rows and updates page/button state when navigating first/next/last/previous', () => {\n const { container } = render(\n <DataTableRoot columns={columns} data={people} enablePagination pageSize={2}>\n <Table>\n <DataTableHeader />\n <DataTableBody />\n </Table>\n <DataTablePagination />\n </DataTableRoot>\n )\n\n expect(getBodyRowNames(container)).toEqual(['Ada Lovelace', 'Grace Hopper'])\n expect(screen.getByText(defaultDataTableLabels.pageOf(1, 3) as string)).not.toBeNull()\n expect(\n (screen.getByRole('button', { name: defaultDataTableLabels.goToPreviousPage }) as HTMLButtonElement).disabled\n ).toBe(true)\n\n fireEvent.click(screen.getByRole('button', { name: defaultDataTableLabels.goToNextPage }))\n expect(getBodyRowNames(container)).toEqual(['Alan Turing', 'Katherine Johnson'])\n expect(screen.getByText(defaultDataTableLabels.pageOf(2, 3) as string)).not.toBeNull()\n\n fireEvent.click(screen.getByRole('button', { name: defaultDataTableLabels.goToLastPage }))\n expect(getBodyRowNames(container)).toEqual(['Margaret Hamilton'])\n expect(\n (screen.getByRole('button', { name: defaultDataTableLabels.goToNextPage }) as HTMLButtonElement).disabled\n ).toBe(true)\n\n fireEvent.click(screen.getByRole('button', { name: defaultDataTableLabels.goToFirstPage }))\n expect(getBodyRowNames(container)).toEqual(['Ada Lovelace', 'Grace Hopper'])\n\n fireEvent.click(screen.getByRole('button', { name: defaultDataTableLabels.goToNextPage }))\n fireEvent.click(screen.getByRole('button', { name: defaultDataTableLabels.goToPreviousPage }))\n expect(getBodyRowNames(container)).toEqual(['Ada Lovelace', 'Grace Hopper'])\n })\n})\n\ndescribe('DataTableViewOptions', () => {\n it('throws when rendered without a table prop or DataTableRoot context', () => {\n expect(() => render(<DataTableViewOptions />)).toThrow(\n 'DataTableViewOptions requires a `table` prop or to be rendered within <DataTableRoot>'\n )\n })\n\n it('renders nothing when there are no hideable columns', () => {\n const table = { getAllColumns: () => [] } as unknown as Parameters<typeof DataTableViewOptions>[0]['table']\n const { container } = render(<DataTableViewOptions table={table} />)\n\n expect(container.firstChild).toBeNull()\n })\n\n it('opens the dropdown and hides a column when its checkbox item is toggled off', () => {\n const { container } = render(<DataTable columns={columns} data={people} showColumnVisibility />)\n\n const trigger = screen.getByRole('button', { name: defaultDataTableLabels.columnsButton })\n // Radix opens the menu from pointerdown/pointerup, not a plain click event.\n fireEvent.pointerDown(trigger, { button: 0, pointerId: 1 })\n fireEvent.pointerUp(trigger, { button: 0, pointerId: 1 })\n\n const emailItem = screen.getByRole('menuitemcheckbox', { name: 'email' })\n fireEvent.pointerDown(emailItem, { button: 0, pointerId: 1 })\n fireEvent.pointerUp(emailItem, { button: 0, pointerId: 1 })\n fireEvent.click(emailItem)\n\n expect(screen.queryByRole('columnheader', { name: 'Email' })).toBeNull()\n expect(container.querySelector('[data-slot=\"table-container\"]')).not.toBeNull()\n })\n})\n\ndescribe('createDataTableSelectColumn', () => {\n it('returns a non-sortable, non-hideable select column definition', () => {\n const column = createDataTableSelectColumn<Person>()\n\n expect(column.id).toBe('select')\n expect(column.enableSorting).toBe(false)\n expect(column.enableHiding).toBe(false)\n expect(typeof column.header).toBe('function')\n expect(typeof column.cell).toBe('function')\n })\n\n it('uses custom select-all and select-row labels when the table provides them', () => {\n render(\n <DataTable\n columns={columns}\n data={people}\n enableRowSelection\n labels={{ selectAllRows: 'Pick all', selectRow: 'Pick one' }}\n />\n )\n\n expect(screen.getByRole('checkbox', { name: 'Pick all' })).not.toBeNull()\n expect(screen.getAllByRole('checkbox', { name: 'Pick one' })).toHaveLength(people.length)\n })\n})\n\ndescribe('useDataTable', () => {\n function Harness(props: UseDataTableOptions<Person>) {\n const table = useDataTable(props)\n return <span data-testid=\"column-count\">{table.getAllColumns().length}</span>\n }\n\n it('does not add a select column when row selection is disabled', () => {\n render(<Harness columns={columns} data={people} />)\n\n expect(screen.getByTestId('column-count').textContent).toBe(String(columns.length))\n })\n\n it('prepends a select column when row selection is enabled', () => {\n render(<Harness columns={columns} data={people} enableRowSelection />)\n\n expect(screen.getByTestId('column-count').textContent).toBe(String(columns.length + 1))\n })\n})\n\ndescribe('DataTableRoot', () => {\n it('renders children within context when given an externally created table (controlled mode)', () => {\n function Wrapper() {\n const table = useDataTable({ columns, data: people })\n return (\n <DataTableRoot table={table}>\n <Table>\n <DataTableHeader />\n <DataTableBody />\n </Table>\n </DataTableRoot>\n )\n }\n\n const { container } = render(<Wrapper />)\n\n expect(container.querySelectorAll('[data-slot=\"table-body\"] [data-slot=\"table-row\"]')).toHaveLength(people.length)\n })\n\n it('builds its own table from columns and data when no table prop is given (uncontrolled mode)', () => {\n const { container } = render(\n <DataTableRoot columns={columns} data={people}>\n <Table>\n <DataTableHeader />\n <DataTableBody />\n </Table>\n </DataTableRoot>\n )\n\n expect(container.querySelectorAll('[data-slot=\"table-body\"] [data-slot=\"table-row\"]')).toHaveLength(people.length)\n })\n\n it('applies the className to the wrapping element', () => {\n const { container } = render(\n <DataTableRoot columns={columns} data={people} className=\"custom-root\">\n <Table>\n <DataTableHeader />\n </Table>\n </DataTableRoot>\n )\n\n expect((container.firstChild as HTMLElement).className).toContain('custom-root')\n })\n})\n\ndescribe('useDataTableContext', () => {\n it('throws a descriptive error when called outside of DataTableRoot', () => {\n function Consumer() {\n useDataTableContext()\n return null\n }\n\n expect(() => render(<Consumer />)).toThrow('useDataTableContext must be used within <DataTableRoot>')\n })\n})\n"],"mappings":"kTA2BA,MAAM,EAAmB,CACvB,CAAE,GAAI,IAAK,KAAM,eAAgB,MAAO,kBAAmB,IAAK,EAAG,EACnE,CAAE,GAAI,IAAK,KAAM,eAAgB,MAAO,oBAAqB,IAAK,EAAG,EACrE,CAAE,GAAI,IAAK,KAAM,cAAe,MAAO,mBAAoB,IAAK,EAAG,EACnE,CAAE,GAAI,IAAK,KAAM,oBAAqB,MAAO,wBAAyB,IAAK,GAAI,EAC/E,CAAE,GAAI,IAAK,KAAM,oBAAqB,MAAO,uBAAwB,IAAK,EAAG,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,kDAAkD,CAAC,CAAC,CAAC,aAAa,EAAO,MAAM,CACnH,CAAC,EAED,GAAG,oDAAuD,CACxD,GAAM,CAAE,aAAc,EACpB,EAAC,EAAD,CAAwB,UAAS,KAAM,EAAQ,UAAU,cACvD,SAAA,EAAC,EAAD,CAAA,SACE,EAAC,EAAD,CAAkB,CAAA,CACb,CAAA,CACM,CAAA,CACjB,EAEA,OAAQ,EAAU,WAA2B,SAAS,CAAC,CAAC,UAAU,aAAa,CACjF,CAAC,CACH,CAAC,EAED,SAAS,0BAA6B,CACpC,GAAG,sEAAyE,CAC1E,SAAS,UAAW,CAElB,OADA,EAAoB,EACb,IACT,CAEA,WAAa,EAAO,EAAC,SAAD,CAAW,CAAA,CAAC,CAAC,CAAC,CAAC,QAAQ,yDAAyD,CACtG,CAAC,CACH,CAAC"}
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"../logo-B0v9bNJH.js";export{c as BippiLogo,i as FibonashLogo,o as GomaxLogo,n as IntelitrackLogo,e as KovraLogo,a as LetsLogo,s as MaxLogo,t as NeutraLogo,r as RdLogo};
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"../logo-BkwNxZNw.js";export{c as BippiLogo,i as FibonashLogo,o as GomaxLogo,n as IntelitrackLogo,e as KovraLogo,a as LetsLogo,s as MaxLogo,t as NeutraLogo,r as RdLogo};
@@ -1,2 +1,2 @@
1
- import"../rolldown-runtime-Bdj-bS2b.js";import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"../logo-B0v9bNJH.js";import{r as l}from"../react.esm-BkhVXJ8s.js";import{jsx as u}from"react/jsx-runtime";const d=[{Component:c,slot:`bippi-logo`,supportsVariant:!0},{Component:i,slot:`fibonash-logo`,supportsVariant:!0},{Component:o,slot:`gomax-logo`,supportsVariant:!0},{Component:n,slot:`intelitrack-logo`,supportsVariant:!0},{Component:e,slot:`kovra-logo`,supportsVariant:!0},{Component:a,slot:`lets-logo`,supportsVariant:!1},{Component:s,slot:`max-logo`,supportsVariant:!0},{Component:t,slot:`neutra-logo`,supportsVariant:!0},{Component:r,slot:`rd-logo`,supportsVariant:!0}];describe(`Logo`,()=>{it(`mounts every exported logo component without throwing`,()=>{for(let{Component:e}of d)expect(()=>l(u(e,{}))).not.toThrow()}),it(`renders each logo as an svg element with its expected data-slot`,()=>{for(let{Component:e,slot:t}of d){let{container:n,unmount:r}=l(u(e,{})),i=n.querySelector(`[data-slot="${t}"]`);expect(i).not.toBeNull(),expect(i?.tagName.toLowerCase()).toBe(`svg`),r()}}),it(`applies the mono tone to every logo`,()=>{for(let{Component:e,slot:t}of d){let{container:n,unmount:r}=l(u(e,{tone:`mono`})),i=n.querySelector(`[data-slot="${t}"]`);expect(i?.getAttribute(`data-tone`)).toBe(`mono`),r()}}),it(`applies the icon variant for logos that support a variant prop`,()=>{for(let{Component:e,slot:t,supportsVariant:n}of d){if(!n)continue;let{container:r,unmount:i}=l(u(e,{variant:`icon`})),a=r.querySelector(`[data-slot="${t}"]`);expect(a?.getAttribute(`data-variant`)).toBe(`icon`),i()}})});
1
+ import"../rolldown-runtime-Bdj-bS2b.js";import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"../logo-BkwNxZNw.js";import{r as l}from"../react.esm-BkhVXJ8s.js";import{jsx as u}from"react/jsx-runtime";const d=[{Component:c,slot:`bippi-logo`,supportsVariant:!0},{Component:i,slot:`fibonash-logo`,supportsVariant:!0},{Component:o,slot:`gomax-logo`,supportsVariant:!0},{Component:n,slot:`intelitrack-logo`,supportsVariant:!0},{Component:e,slot:`kovra-logo`,supportsVariant:!0},{Component:a,slot:`lets-logo`,supportsVariant:!1},{Component:s,slot:`max-logo`,supportsVariant:!0},{Component:t,slot:`neutra-logo`,supportsVariant:!0},{Component:r,slot:`rd-logo`,supportsVariant:!0}];describe(`Logo`,()=>{it(`mounts every exported logo component without throwing`,()=>{for(let{Component:e}of d)expect(()=>l(u(e,{}))).not.toThrow()}),it(`renders each logo as an svg element with its expected data-slot`,()=>{for(let{Component:e,slot:t}of d){let{container:n,unmount:r}=l(u(e,{})),i=n.querySelector(`[data-slot="${t}"]`);expect(i).not.toBeNull(),expect(i?.tagName.toLowerCase()).toBe(`svg`),r()}}),it(`applies the mono tone to every logo`,()=>{for(let{Component:e,slot:t}of d){let{container:n,unmount:r}=l(u(e,{tone:`mono`})),i=n.querySelector(`[data-slot="${t}"]`);expect(i?.getAttribute(`data-tone`)).toBe(`mono`),r()}}),it(`applies the icon variant for logos that support a variant prop`,()=>{for(let{Component:e,slot:t,supportsVariant:n}of d){if(!n)continue;let{container:r,unmount:i}=l(u(e,{variant:`icon`})),a=r.querySelector(`[data-slot="${t}"]`);expect(a?.getAttribute(`data-variant`)).toBe(`icon`),i()}}),it(`uses the logo-foreground token instead of a hardcoded hex fill for color tone`,()=>{let a=[{Component:n,slot:`intelitrack-logo`},{Component:t,slot:`neutra-logo`},{Component:e,slot:`kovra-logo`},{Component:i,slot:`fibonash-logo`}];for(let{Component:e,slot:t}of a){let{container:n,unmount:r}=l(u(e,{tone:`color`})),i=n.querySelector(`[data-slot="${t}"]`);expect(i?.innerHTML).toContain(`var(--logo-foreground)`),expect(i?.innerHTML).not.toContain(`1D2436`),r()}let{container:o,unmount:s}=l(u(r,{tone:`color`})),c=o.querySelector(`[data-slot="rd-logo"]`);expect(c?.innerHTML).toContain(`var(--rd-logo-foreground)`),expect(c?.innerHTML).not.toContain(`0A2F2A`),s()})});
2
2
  //# sourceMappingURL=logo.spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"logo.spec.js","names":[],"sources":["../../src/components/logo.spec.tsx"],"sourcesContent":["import { render } from '@testing-library/react'\n\nimport {\n BippiLogo,\n FibonashLogo,\n GomaxLogo,\n IntelitrackLogo,\n KovraLogo,\n LetsLogo,\n MaxLogo,\n NeutraLogo,\n RdLogo\n} from './logo'\n\nconst logos = [\n { Component: BippiLogo, slot: 'bippi-logo', supportsVariant: true },\n { Component: FibonashLogo, slot: 'fibonash-logo', supportsVariant: true },\n { Component: GomaxLogo, slot: 'gomax-logo', supportsVariant: true },\n { Component: IntelitrackLogo, slot: 'intelitrack-logo', supportsVariant: true },\n { Component: KovraLogo, slot: 'kovra-logo', supportsVariant: true },\n { Component: LetsLogo, slot: 'lets-logo', supportsVariant: false },\n { Component: MaxLogo, slot: 'max-logo', supportsVariant: true },\n { Component: NeutraLogo, slot: 'neutra-logo', supportsVariant: true },\n { Component: RdLogo, slot: 'rd-logo', supportsVariant: true }\n] as const\n\ndescribe('Logo', () => {\n it('mounts every exported logo component without throwing', () => {\n for (const { Component } of logos) {\n expect(() => render(<Component />)).not.toThrow()\n }\n })\n\n it('renders each logo as an svg element with its expected data-slot', () => {\n for (const { Component, slot } of logos) {\n const { container, unmount } = render(<Component />)\n\n const svg = container.querySelector(`[data-slot=\"${slot}\"]`)\n\n expect(svg).not.toBeNull()\n expect(svg?.tagName.toLowerCase()).toBe('svg')\n\n unmount()\n }\n })\n\n it('applies the mono tone to every logo', () => {\n for (const { Component, slot } of logos) {\n const { container, unmount } = render(<Component tone=\"mono\" />)\n\n const svg = container.querySelector(`[data-slot=\"${slot}\"]`)\n\n expect(svg?.getAttribute('data-tone')).toBe('mono')\n\n unmount()\n }\n })\n\n it('applies the icon variant for logos that support a variant prop', () => {\n for (const { Component, slot, supportsVariant } of logos) {\n if (!supportsVariant) {\n continue\n }\n\n const { container, unmount } = render(<Component variant=\"icon\" />)\n\n const svg = container.querySelector(`[data-slot=\"${slot}\"]`)\n\n expect(svg?.getAttribute('data-variant')).toBe('icon')\n\n unmount()\n }\n })\n})\n"],"mappings":"wNAcA,MAAM,EAAQ,CACZ,CAAE,UAAW,EAAW,KAAM,aAAc,gBAAiB,EAAK,EAClE,CAAE,UAAW,EAAc,KAAM,gBAAiB,gBAAiB,EAAK,EACxE,CAAE,UAAW,EAAW,KAAM,aAAc,gBAAiB,EAAK,EAClE,CAAE,UAAW,EAAiB,KAAM,mBAA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AAK,GAAG,EAE3D,OAAO,GAAK,aAAa,cAAc,CAAC,CAAC,CAAC,KAAK,MAAM,EAErD,EAAQ,CACV,CACF,CAAC,CACH,CAAC"}
1
+ {"version":3,"file":"logo.spec.js","names":[],"sources":["../../src/components/logo.spec.tsx"],"sourcesContent":["import { render } from '@testing-library/react'\n\nimport {\n BippiLogo,\n FibonashLogo,\n GomaxLogo,\n IntelitrackLogo,\n KovraLogo,\n LetsLogo,\n MaxLogo,\n NeutraLogo,\n RdLogo\n} from './logo'\n\nconst logos = [\n { Component: BippiLogo, slot: 'bippi-logo', supportsVariant: true },\n { Component: FibonashLogo, slot: 'fibonash-logo', supportsVariant: true },\n { Component: GomaxLogo, slot: 'gomax-logo', supportsVariant: true },\n { Component: IntelitrackLogo, slot: 'intelitrack-logo', supportsVariant: true },\n { Component: KovraLogo, slot: 'kovra-logo', supportsVariant: true },\n { Component: LetsLogo, slot: 'lets-logo', supportsVariant: false },\n { Component: MaxLogo, slot: 'max-logo', supportsVariant: true },\n { Component: NeutraLogo, slot: 'neutra-logo', supportsVariant: true },\n { Component: RdLogo, slot: 'rd-logo', supportsVariant: true }\n] as const\n\ndescribe('Logo', () => {\n it('mounts every exported logo component without throwing', () => {\n for (const { Component } of logos) {\n expect(() => render(<Component />)).not.toThrow()\n }\n })\n\n it('renders each logo as an svg element with its expected data-slot', () => {\n for (const { Component, slot } of logos) {\n const { container, unmount } = render(<Component />)\n\n const svg = container.querySelector(`[data-slot=\"${slot}\"]`)\n\n expect(svg).not.toBeNull()\n expect(svg?.tagName.toLowerCase()).toBe('svg')\n\n unmount()\n }\n })\n\n it('applies the mono tone to every logo', () => {\n for (const { Component, slot } of logos) {\n const { container, unmount } = render(<Component tone=\"mono\" />)\n\n const svg = container.querySelector(`[data-slot=\"${slot}\"]`)\n\n expect(svg?.getAttribute('data-tone')).toBe('mono')\n\n unmount()\n }\n })\n\n it('applies the icon variant for logos that support a variant prop', () => {\n for (const { Component, slot, supportsVariant } of logos) {\n if (!supportsVariant) {\n continue\n }\n\n const { container, unmount } = render(<Component variant=\"icon\" />)\n\n const svg = container.querySelector(`[data-slot=\"${slot}\"]`)\n\n expect(svg?.getAttribute('data-variant')).toBe('icon')\n\n unmount()\n }\n })\n\n it('uses the logo-foreground token instead of a hardcoded hex fill for color tone', () => {\n const colorTokenLogos = [\n { Component: IntelitrackLogo, slot: 'intelitrack-logo' },\n { Component: NeutraLogo, slot: 'neutra-logo' },\n { Component: KovraLogo, slot: 'kovra-logo' },\n { Component: FibonashLogo, slot: 'fibonash-logo' }\n ] as const\n\n for (const { Component, slot } of colorTokenLogos) {\n const { container, unmount } = render(<Component tone=\"color\" />)\n\n const svg = container.querySelector(`[data-slot=\"${slot}\"]`)\n\n expect(svg?.innerHTML).toContain('var(--logo-foreground)')\n expect(svg?.innerHTML).not.toContain('1D2436')\n\n unmount()\n }\n\n const { container: rdContainer, unmount: unmountRd } = render(<RdLogo tone=\"color\" />)\n\n const rdSvg = rdContainer.querySelector('[data-slot=\"rd-logo\"]')\n\n expect(rdSvg?.innerHTML).toContain('var(--rd-logo-foreground)')\n expect(rdSvg?.innerHTML).not.toContain('0A2F2A')\n\n unmountRd()\n })\n})\n"],"mappings":"wNAcA,MAAM,EAAQ,CACZ,CAAE,UAAW,EAAW,KAAM,aAAc,gBAAiB,EAAK,EAClE,CAAE,UAAW,EAAc,KAAM,gBAAiB,gBAAiB,EAAK,EACxE,CAAE,UAAW,EAAW,KAAM,aAAc,gBAAiB,EAAK,EAClE,CAAE,UAAW,EAAiB,KAAM,mBAAoB,gBAAiB,EAAK,EAC9E,CAAE,UAAW,EAAW,KAAM,aAAc,gBAAiB,EAAK,EAClE,CAAE,UAAW,EAAU,KAAM,YAAa,gBAAiB,EAAM,EACjE,CAAE,UAAW,EAAS,KAAM,WAAY,gBAAiB,EAAK,EAC9D,CAAE,UAAW,EAAY,KAAM,cAAe,gBAAiB,EAAK,EACpE,CAAE,UAAW,EAAQ,KAAM,UAAW,gBAAiB,EAAK,CA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