Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@internxt/ui",
"version": "0.1.1",
"version": "0.1.2",
"description": "Library of Internxt components",
"repository": {
"type": "git",
Expand Down
31 changes: 15 additions & 16 deletions src/components/list/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -296,24 +296,23 @@ const List = <T extends { id: number }, F extends keyof T>({
className={`relative flex h-full flex-col overflow-x-auto overflow-y-hidden ${className}`}
ref={containerRef}
>
{!isEmptyState ? (
<ListHeader
selectedItems={selectedItems}
onTopSelectionCheckboxClick={onTopSelectionCheckboxClick}
items={items}
header={header}
orderBy={orderBy}
onOrderableColumnClicked={onOrderableColumnClicked}
menu={menu}
displayMenuDiv={displayMenuDiv}
isVerticalScrollbarVisible={isVerticalScrollbarVisible}
checkboxDataCy={checkboxDataCy}
onClose={onCloseContextMenu}
/>
) : null}

{/* BODY */}
<div id="scrollableList" className="flex h-full flex-col min-w-max overflow-x-hidden overflow-y-auto">
{!isEmptyState ? (
<ListHeader
selectedItems={selectedItems}
onTopSelectionCheckboxClick={onTopSelectionCheckboxClick}
items={items}
header={header}
orderBy={orderBy}
onOrderableColumnClicked={onOrderableColumnClicked}
menu={menu}
displayMenuDiv={displayMenuDiv}
isVerticalScrollbarVisible={isVerticalScrollbarVisible}
checkboxDataCy={checkboxDataCy}
onClose={onCloseContextMenu}
/>
) : null}
{isEmptyState ? (
emptyState
) : items.length > 0 && !forceLoading ? (
Expand Down
224 changes: 112 additions & 112 deletions src/components/list/__test__/__snapshots__/List.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -10,75 +10,75 @@ exports[`List component > should match snapshot 1`] = `
id="generic-list-component"
>
<div
class="flex min-w-max h-12 shrink-0 flex-row px-5"
class="flex h-full flex-col min-w-max overflow-x-hidden overflow-y-auto"
id="scrollableList"
>
<div
class="flex h-full min-w-full flex-row items-center border-b border-gray-10"
class="flex min-w-max h-12 shrink-0 flex-row px-5"
>
<div
class="flex h-full flex-row items-center justify-between pr-4"
class="flex h-full min-w-full flex-row items-center border-b border-gray-10"
>
<label
class="relative h-5 w-5 rounded focus-within:outline-primary undefined"
<div
class="flex h-full flex-row items-center justify-between pr-4"
>
<div
class="relative flex h-5 w-5 cursor-pointer flex-col items-center justify-center rounded border text-white border-primary bg-primary"
<label
class="relative h-5 w-5 rounded focus-within:outline-primary undefined"
>
<svg
class="absolute -inset-px"
fill="none"
height="20"
viewBox="0 0 20 20"
width="20"
xmlns="http://www.w3.org/2000/svg"
<div
class="relative flex h-5 w-5 cursor-pointer flex-col items-center justify-center rounded border text-white border-primary bg-primary"
>
<rect
fill="currentColor"
height="2"
rx="1"
width="12"
x="4"
y="9"
/>
</svg>
</div>
<input
checked=""
class="base-checkbox h-0 w-0 appearance-none opacity-0"
readonly=""
type="checkbox"
/>
</label>
</div>
<button
class="flex h-full shrink-0 flex-row items-center space-x-1.5 text-base font-medium text-gray-60 100px cursor-pointer hover:text-gray-80"
data-cy="false"
>
<span
<svg
class="absolute -inset-px"
fill="none"
height="20"
viewBox="0 0 20 20"
width="20"
xmlns="http://www.w3.org/2000/svg"
>
<rect
fill="currentColor"
height="2"
rx="1"
width="12"
x="4"
y="9"
/>
</svg>
</div>
<input
checked=""
class="base-checkbox h-0 w-0 appearance-none opacity-0"
readonly=""
type="checkbox"
/>
</label>
</div>
<button
class="flex h-full shrink-0 flex-row items-center space-x-1.5 text-base font-medium text-gray-60 100px cursor-pointer hover:text-gray-80"
data-cy="false"
>
Name
</span>
</button>
<button
class="flex h-full shrink-0 flex-row items-center space-x-1.5 text-base font-medium text-gray-60 50px cursor-pointer hover:text-gray-80"
data-cy="false"
>
<span
<span
data-cy="false"
>
Name
</span>
</button>
<button
class="flex h-full shrink-0 flex-row items-center space-x-1.5 text-base font-medium text-gray-60 50px cursor-pointer hover:text-gray-80"
data-cy="false"
>
Age
</span>
</button>
<div
class="flex h-full w-12 shrink-0"
/>
<span
data-cy="false"
>
Age
</span>
</button>
<div
class="flex h-full w-12 shrink-0"
/>
</div>
</div>
</div>
<div
class="flex h-full flex-col min-w-max overflow-x-hidden overflow-y-auto"
id="scrollableList"
>
<div>
<div
class="group relative flex h-14 flex-row items-center pl-14 pr-5 bg-primary/10 text-gray-100 dark:bg-primary/20"
Expand Down Expand Up @@ -204,75 +204,75 @@ exports[`List component > should match snapshot 1`] = `
id="generic-list-component"
>
<div
class="flex min-w-max h-12 shrink-0 flex-row px-5"
class="flex h-full flex-col min-w-max overflow-x-hidden overflow-y-auto"
id="scrollableList"
>
<div
class="flex h-full min-w-full flex-row items-center border-b border-gray-10"
class="flex min-w-max h-12 shrink-0 flex-row px-5"
>
<div
class="flex h-full flex-row items-center justify-between pr-4"
class="flex h-full min-w-full flex-row items-center border-b border-gray-10"
>
<label
class="relative h-5 w-5 rounded focus-within:outline-primary undefined"
<div
class="flex h-full flex-row items-center justify-between pr-4"
>
<div
class="relative flex h-5 w-5 cursor-pointer flex-col items-center justify-center rounded border text-white border-primary bg-primary"
<label
class="relative h-5 w-5 rounded focus-within:outline-primary undefined"
>
<svg
class="absolute -inset-px"
fill="none"
height="20"
viewBox="0 0 20 20"
width="20"
xmlns="http://www.w3.org/2000/svg"
<div
class="relative flex h-5 w-5 cursor-pointer flex-col items-center justify-center rounded border text-white border-primary bg-primary"
>
<rect
fill="currentColor"
height="2"
rx="1"
width="12"
x="4"
y="9"
/>
</svg>
</div>
<input
checked=""
class="base-checkbox h-0 w-0 appearance-none opacity-0"
readonly=""
type="checkbox"
/>
</label>
</div>
<button
class="flex h-full shrink-0 flex-row items-center space-x-1.5 text-base font-medium text-gray-60 100px cursor-pointer hover:text-gray-80"
data-cy="false"
>
<span
<svg
class="absolute -inset-px"
fill="none"
height="20"
viewBox="0 0 20 20"
width="20"
xmlns="http://www.w3.org/2000/svg"
>
<rect
fill="currentColor"
height="2"
rx="1"
width="12"
x="4"
y="9"
/>
</svg>
</div>
<input
checked=""
class="base-checkbox h-0 w-0 appearance-none opacity-0"
readonly=""
type="checkbox"
/>
</label>
</div>
<button
class="flex h-full shrink-0 flex-row items-center space-x-1.5 text-base font-medium text-gray-60 100px cursor-pointer hover:text-gray-80"
data-cy="false"
>
Name
</span>
</button>
<button
class="flex h-full shrink-0 flex-row items-center space-x-1.5 text-base font-medium text-gray-60 50px cursor-pointer hover:text-gray-80"
data-cy="false"
>
<span
<span
data-cy="false"
>
Name
</span>
</button>
<button
class="flex h-full shrink-0 flex-row items-center space-x-1.5 text-base font-medium text-gray-60 50px cursor-pointer hover:text-gray-80"
data-cy="false"
>
Age
</span>
</button>
<div
class="flex h-full w-12 shrink-0"
/>
<span
data-cy="false"
>
Age
</span>
</button>
<div
class="flex h-full w-12 shrink-0"
/>
</div>
</div>
</div>
<div
class="flex h-full flex-col min-w-max overflow-x-hidden overflow-y-auto"
id="scrollableList"
>
<div>
<div
class="group relative flex h-14 flex-row items-center pl-14 pr-5 bg-primary/10 text-gray-100 dark:bg-primary/20"
Expand Down
6 changes: 4 additions & 2 deletions src/components/skeletonLoader/SkeletonLoader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ export const SkeletonLoaderItem = ({ skeletonItem, columns }: SkeletonLoaderItem
return (
<div
data-testid="skeleton-loader-item"
className={'group relative flex h-14 animate-pulse flex-row items-center pl-14 pr-5'}
className={'group relative flex h-14 animate-pulse flex-row items-center px-5'}
>
<div className="w-9 shrink-0" />
{new Array(columns.length).fill(0).map((col, i) => (
<div
key={`${col}-${i}`}
Expand All @@ -21,6 +22,7 @@ export const SkeletonLoaderItem = ({ skeletonItem, columns }: SkeletonLoaderItem
{skeletonItem?.[i]}
</div>
))}
<div className="flex h-14 w-12 shrink-0 flex-col items-center justify-center border-b border-gray-5" />
</div>
);
};
Expand All @@ -29,7 +31,7 @@ export const SkeletonLoaderItem = ({ skeletonItem, columns }: SkeletonLoaderItem
* SkeletonLoader component to display loading placeholders in list layouts.
*
* @param skeleton - Array of skeleton items, {skeletonItem, columns}
* - The params of each sekeletonItem:
* - The params of each skeletonItem:
* - skeletonItem: - Array of elements representing the loading placeholders.
* - columns: - An array of CSS class names for each column, defining their layout and style.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ describe('SkeletonLoader', () => {

const items = screen.getAllByTestId('skeleton-loader-item')[0].querySelectorAll('div');

const column1 = items[0];
const column2 = items[4];
const column3 = items[6];
const column1 = items[1];
const column2 = items[5];
const column3 = items[7];
expect(column1).toHaveClass('flex');
expect(column2).toHaveClass('w-date');
expect(column3).toHaveClass('w-size');
Expand Down
Loading