diff --git a/package.json b/package.json index ac063ab..7ab94d8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@internxt/ui", - "version": "0.1.1", + "version": "0.1.2", "description": "Library of Internxt components", "repository": { "type": "git", diff --git a/src/components/list/List.tsx b/src/components/list/List.tsx index 984e499..f6fa515 100644 --- a/src/components/list/List.tsx +++ b/src/components/list/List.tsx @@ -296,24 +296,23 @@ const List = ({ className={`relative flex h-full flex-col overflow-x-auto overflow-y-hidden ${className}`} ref={containerRef} > - {!isEmptyState ? ( - - ) : null} - {/* BODY */}
+ {!isEmptyState ? ( + + ) : null} {isEmptyState ? ( emptyState ) : items.length > 0 && !forceLoading ? ( diff --git a/src/components/list/__test__/__snapshots__/List.test.tsx.snap b/src/components/list/__test__/__snapshots__/List.test.tsx.snap index 64e4c64..e37c6ba 100644 --- a/src/components/list/__test__/__snapshots__/List.test.tsx.snap +++ b/src/components/list/__test__/__snapshots__/List.test.tsx.snap @@ -10,75 +10,75 @@ exports[`List component > should match snapshot 1`] = ` id="generic-list-component" >
- -
-
+ + +
+ - + -
+ + Age + + +
+
-
-
should match snapshot 1`] = ` id="generic-list-component" >
- -
-
+ + +
+ - + -
+ + Age + + +
+
-
-
+
{new Array(columns.length).fill(0).map((col, i) => (
))} +
); }; @@ -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. * diff --git a/src/components/skeletonLoader/__test__/SkeletonLoader.test.tsx b/src/components/skeletonLoader/__test__/SkeletonLoader.test.tsx index 8a44eec..a9fc467 100644 --- a/src/components/skeletonLoader/__test__/SkeletonLoader.test.tsx +++ b/src/components/skeletonLoader/__test__/SkeletonLoader.test.tsx @@ -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'); diff --git a/src/components/skeletonLoader/__test__/__snapshots__/SkeletonLoader.test.tsx.snap b/src/components/skeletonLoader/__test__/__snapshots__/SkeletonLoader.test.tsx.snap index bdea00f..788d845 100644 --- a/src/components/skeletonLoader/__test__/__snapshots__/SkeletonLoader.test.tsx.snap +++ b/src/components/skeletonLoader/__test__/__snapshots__/SkeletonLoader.test.tsx.snap @@ -6,9 +6,12 @@ exports[`SkeletonLoader > should match snapshot 1`] = ` "baseElement":
+
@@ -37,11 +40,17 @@ exports[`SkeletonLoader > should match snapshot 1`] = ` class="ml-3 h-4 w-24 rounded bg-gray-5" />
+
+
@@ -70,11 +79,17 @@ exports[`SkeletonLoader > should match snapshot 1`] = ` class="ml-3 h-4 w-24 rounded bg-gray-5" />
+
+
@@ -103,14 +118,20 @@ exports[`SkeletonLoader > should match snapshot 1`] = ` class="ml-3 h-4 w-24 rounded bg-gray-5" />
+
, "container":
+
@@ -139,11 +160,17 @@ exports[`SkeletonLoader > should match snapshot 1`] = ` class="ml-3 h-4 w-24 rounded bg-gray-5" />
+
+
@@ -172,11 +199,17 @@ exports[`SkeletonLoader > should match snapshot 1`] = ` class="ml-3 h-4 w-24 rounded bg-gray-5" />
+
+
@@ -205,6 +238,9 @@ exports[`SkeletonLoader > should match snapshot 1`] = ` class="ml-3 h-4 w-24 rounded bg-gray-5" />
+
, "debug": [Function],