@campxdev/react-blueprint 3.0.0-alpha.6 → 3.0.0-alpha.7
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/dist/cjs/index.js +1 -1
- package/dist/cjs/types/src/components/DataDisplay/DataTable/DataTable.d.ts +3 -3
- package/dist/cjs/types/src/components/DataDisplay/DataTable/components/CardsView.d.ts +14 -2
- package/dist/cjs/types/src/components/Layout/PageContent/PageContent.d.ts +2 -1
- package/dist/cjs/types/src/components/Navigation/TabsContainer/TabsContainer.d.ts +5 -1
- package/dist/cjs/types/src/shadcn-components/Input/Button/Button.d.ts +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/types/src/components/DataDisplay/DataTable/DataTable.d.ts +3 -3
- package/dist/esm/types/src/components/DataDisplay/DataTable/components/CardsView.d.ts +14 -2
- package/dist/esm/types/src/components/Layout/PageContent/PageContent.d.ts +2 -1
- package/dist/esm/types/src/components/Navigation/TabsContainer/TabsContainer.d.ts +5 -1
- package/dist/esm/types/src/shadcn-components/Input/Button/Button.d.ts +1 -1
- package/dist/index.d.ts +10 -6
- package/dist/styles.css +0 -72
- package/package.json +1 -1
- package/src/components/DataDisplay/DataTable/DataTable.tsx +16 -4
- package/src/components/DataDisplay/DataTable/components/CardsView.tsx +28 -13
- package/src/components/DataDisplay/DataTable/components/ColumnSelector/ColumnSelector.tsx +22 -4
- package/src/components/DataDisplay/DataTable/components/TableHeaders/TableActionHeader.tsx +9 -4
- package/src/components/DataDisplay/DataTable/components/TableView.tsx +5 -1
- package/src/components/Layout/AppLayout/AppLayout.tsx +1 -10
- package/src/components/Layout/AppLayout/components/UserProfilePopup.tsx +1 -1
- package/src/components/Layout/PageContent/PageContent.tsx +4 -3
- package/src/components/Layout/PageHeader/PageHeader.tsx +22 -7
- package/src/components/Navigation/Breadcrumbs/Breadcrumbs.tsx +20 -4
- package/src/components/Navigation/Dialog/Dialog.tsx +7 -2
- package/src/components/Navigation/TabsContainer/TabsContainer.tsx +6 -1
|
@@ -27,7 +27,7 @@ import { TablePagination, type PaginationProps } from './components/TablePaginat
|
|
|
27
27
|
* @property {(newSortingState: SortingState) => void} [onSortingChange] - Sorting change callback
|
|
28
28
|
* @property {boolean} [hideTableActionHeader] - Hide the action header
|
|
29
29
|
* @property {Object} [tableActionProps] - Table action header configuration
|
|
30
|
-
* @property {React.ReactNode[]
|
|
30
|
+
* @property {(row: TData, index: number) => React.ReactNode} [card] - Render function for card layout items
|
|
31
31
|
* @property {string} [className] - CSS class for wrapper
|
|
32
32
|
* @property {string} [tableClassName] - CSS class for table element
|
|
33
33
|
* @property {string} [headerClassName] - CSS class for header row
|
|
@@ -66,7 +66,7 @@ type DataTableProps<TData = any> = {
|
|
|
66
66
|
axios: Axios;
|
|
67
67
|
};
|
|
68
68
|
};
|
|
69
|
-
|
|
69
|
+
card?: (row: TData, index: number) => React.ReactNode;
|
|
70
70
|
className?: string;
|
|
71
71
|
tableClassName?: string;
|
|
72
72
|
headerClassName?: string;
|
|
@@ -100,7 +100,7 @@ type DataTableProps<TData = any> = {
|
|
|
100
100
|
* @param {boolean} [props.isLoading] - Show loading skeletons
|
|
101
101
|
* @param {boolean} [props.hideTableActionHeader] - Hide action header
|
|
102
102
|
* @param {Object} [props.tableActionProps] - Table action configuration
|
|
103
|
-
* @param {React.ReactNode
|
|
103
|
+
* @param {(row: TData, index: number) => React.ReactNode} [props.card] - Card render function
|
|
104
104
|
* @param {string} [props.className] - Wrapper CSS class
|
|
105
105
|
* @param {string} [props.tableClassName] - Table CSS class
|
|
106
106
|
* @param {string} [props.headerClassName] - Header CSS class
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type CardsViewProps<TData = any> = {
|
|
2
|
+
card?: (row: TData, index: number) => React.ReactNode;
|
|
3
|
+
rows: TData[];
|
|
4
|
+
cardContainerClassName?: string;
|
|
5
|
+
isLoading?: boolean;
|
|
6
|
+
limit?: number;
|
|
7
|
+
offset?: number;
|
|
8
|
+
totalCount?: number;
|
|
9
|
+
onPageChange?: (page: number) => void;
|
|
10
|
+
onLimitChange?: (limit: number) => void;
|
|
11
|
+
rowSelectionModel?: Record<string, boolean>;
|
|
12
|
+
onRowSelectionModelChange?: (newRowSelectionModel: Record<string, boolean>) => void;
|
|
13
|
+
};
|
|
14
|
+
declare const CardsView: <TData extends Record<string, any> = any>({ card, rows, cardContainerClassName, limit, offset, totalCount, onPageChange, onLimitChange, isLoading, }: CardsViewProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
3
15
|
export default CardsView;
|
|
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
interface PageContentProps {
|
|
3
3
|
children: ReactNode;
|
|
4
4
|
className?: string;
|
|
5
|
+
styles?: React.CSSProperties;
|
|
5
6
|
}
|
|
6
7
|
/**
|
|
7
8
|
* PageContent Component
|
|
@@ -22,6 +23,6 @@ interface PageContentProps {
|
|
|
22
23
|
* </PageContent>
|
|
23
24
|
* ```
|
|
24
25
|
*/
|
|
25
|
-
declare const PageContent: ({ children, className }: PageContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
declare const PageContent: ({ children, className, styles }: PageContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
27
|
export { PageContent };
|
|
27
28
|
export default PageContent;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
1
2
|
/**
|
|
2
3
|
* Configuration for an individual tab in TabsContainer
|
|
3
4
|
*/
|
|
@@ -31,6 +32,8 @@ export interface TabsContainerProps {
|
|
|
31
32
|
tabsListClassName?: string;
|
|
32
33
|
/** Optional CSS class names for each TabsTrigger element */
|
|
33
34
|
tabsTriggerClassName?: string;
|
|
35
|
+
/** Optional inline styles for the TabsContent container */
|
|
36
|
+
tabsContainerStyles?: CSSProperties;
|
|
34
37
|
/** Layout variant - 'fixed' uses viewport height, 'dynamic' uses content height. Defaults to 'fixed' */
|
|
35
38
|
variant?: 'fixed' | 'dynamic';
|
|
36
39
|
}
|
|
@@ -49,6 +52,7 @@ export interface TabsContainerProps {
|
|
|
49
52
|
* @param {string} [props.className] - CSS classes for the Tabs root
|
|
50
53
|
* @param {string} [props.tabsListClassName] - CSS classes for the TabsList
|
|
51
54
|
* @param {string} [props.tabsTriggerClassName] - CSS classes for TabsTrigger elements
|
|
55
|
+
* @param {CSSProperties} [props.tabsContainerStyles] - Inline styles for TabsContent
|
|
52
56
|
* @param {'fixed' | 'dynamic'} [props.variant='fixed'] - Layout mode for tab content
|
|
53
57
|
*
|
|
54
58
|
* @returns {React.ReactElement} A Tabs component with tab list and content area
|
|
@@ -95,5 +99,5 @@ export interface TabsContainerProps {
|
|
|
95
99
|
* currentTabIndex={0}
|
|
96
100
|
* />
|
|
97
101
|
*/
|
|
98
|
-
export declare const TabsContainer: ({ tabs, onTabChange, currentTabIndex, className, tabsListClassName, tabsTriggerClassName, variant, }: TabsContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
102
|
+
export declare const TabsContainer: ({ tabs, onTabChange, currentTabIndex, className, tabsListClassName, tabsTriggerClassName, tabsContainerStyles, variant, }: TabsContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
99
103
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare const buttonVariants: (props?: {
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "input" | "link" | "default" | "destructive" | "outline" | "secondary" | "ghost";
|
|
5
5
|
size?: "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg";
|
|
6
6
|
} & import("class-variance-authority/dist/types").ClassProp) => string;
|
|
7
7
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<'button'> & VariantProps<typeof buttonVariants> & {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as React$1 from 'react';
|
|
3
|
-
import React__default, { ReactNode, MouseEvent as MouseEvent$1, FC, SyntheticEvent, ReactElement } from 'react';
|
|
3
|
+
import React__default, { ReactNode, MouseEvent as MouseEvent$1, FC, SyntheticEvent, ReactElement, CSSProperties } from 'react';
|
|
4
4
|
import { HorizontalAlignmentType, VerticalAlignmentType, IconType } from 'recharts/types/component/DefaultLegendContent';
|
|
5
5
|
import { LayoutType, AnimationTiming } from 'recharts/types/util/types';
|
|
6
6
|
import { CurveType } from 'recharts/types/shape/Curve';
|
|
@@ -1413,7 +1413,7 @@ declare const TablePagination: (props: PaginationProps) => react_jsx_runtime.JSX
|
|
|
1413
1413
|
* @property {(newSortingState: SortingState) => void} [onSortingChange] - Sorting change callback
|
|
1414
1414
|
* @property {boolean} [hideTableActionHeader] - Hide the action header
|
|
1415
1415
|
* @property {Object} [tableActionProps] - Table action header configuration
|
|
1416
|
-
* @property {React.ReactNode[]
|
|
1416
|
+
* @property {(row: TData, index: number) => React.ReactNode} [card] - Render function for card layout items
|
|
1417
1417
|
* @property {string} [className] - CSS class for wrapper
|
|
1418
1418
|
* @property {string} [tableClassName] - CSS class for table element
|
|
1419
1419
|
* @property {string} [headerClassName] - CSS class for header row
|
|
@@ -1452,7 +1452,7 @@ type DataTableProps<TData = any> = {
|
|
|
1452
1452
|
axios: Axios;
|
|
1453
1453
|
};
|
|
1454
1454
|
};
|
|
1455
|
-
|
|
1455
|
+
card?: (row: TData, index: number) => React__default.ReactNode;
|
|
1456
1456
|
className?: string;
|
|
1457
1457
|
tableClassName?: string;
|
|
1458
1458
|
headerClassName?: string;
|
|
@@ -1486,7 +1486,7 @@ type DataTableProps<TData = any> = {
|
|
|
1486
1486
|
* @param {boolean} [props.isLoading] - Show loading skeletons
|
|
1487
1487
|
* @param {boolean} [props.hideTableActionHeader] - Hide action header
|
|
1488
1488
|
* @param {Object} [props.tableActionProps] - Table action configuration
|
|
1489
|
-
* @param {React.ReactNode
|
|
1489
|
+
* @param {(row: TData, index: number) => React.ReactNode} [props.card] - Card render function
|
|
1490
1490
|
* @param {string} [props.className] - Wrapper CSS class
|
|
1491
1491
|
* @param {string} [props.tableClassName] - Table CSS class
|
|
1492
1492
|
* @param {string} [props.headerClassName] - Header CSS class
|
|
@@ -3425,6 +3425,7 @@ declare function SheetDescription({ className, ...props }: React$1.ComponentProp
|
|
|
3425
3425
|
interface PageContentProps {
|
|
3426
3426
|
children: ReactNode;
|
|
3427
3427
|
className?: string;
|
|
3428
|
+
styles?: React.CSSProperties;
|
|
3428
3429
|
}
|
|
3429
3430
|
/**
|
|
3430
3431
|
* PageContent Component
|
|
@@ -3445,7 +3446,7 @@ interface PageContentProps {
|
|
|
3445
3446
|
* </PageContent>
|
|
3446
3447
|
* ```
|
|
3447
3448
|
*/
|
|
3448
|
-
declare const PageContent: ({ children, className }: PageContentProps) => react_jsx_runtime.JSX.Element;
|
|
3449
|
+
declare const PageContent: ({ children, className, styles }: PageContentProps) => react_jsx_runtime.JSX.Element;
|
|
3449
3450
|
|
|
3450
3451
|
interface PageHeaderProps {
|
|
3451
3452
|
uniqueId?: string;
|
|
@@ -4287,6 +4288,8 @@ interface TabsContainerProps {
|
|
|
4287
4288
|
tabsListClassName?: string;
|
|
4288
4289
|
/** Optional CSS class names for each TabsTrigger element */
|
|
4289
4290
|
tabsTriggerClassName?: string;
|
|
4291
|
+
/** Optional inline styles for the TabsContent container */
|
|
4292
|
+
tabsContainerStyles?: CSSProperties;
|
|
4290
4293
|
/** Layout variant - 'fixed' uses viewport height, 'dynamic' uses content height. Defaults to 'fixed' */
|
|
4291
4294
|
variant?: 'fixed' | 'dynamic';
|
|
4292
4295
|
}
|
|
@@ -4305,6 +4308,7 @@ interface TabsContainerProps {
|
|
|
4305
4308
|
* @param {string} [props.className] - CSS classes for the Tabs root
|
|
4306
4309
|
* @param {string} [props.tabsListClassName] - CSS classes for the TabsList
|
|
4307
4310
|
* @param {string} [props.tabsTriggerClassName] - CSS classes for TabsTrigger elements
|
|
4311
|
+
* @param {CSSProperties} [props.tabsContainerStyles] - Inline styles for TabsContent
|
|
4308
4312
|
* @param {'fixed' | 'dynamic'} [props.variant='fixed'] - Layout mode for tab content
|
|
4309
4313
|
*
|
|
4310
4314
|
* @returns {React.ReactElement} A Tabs component with tab list and content area
|
|
@@ -4351,7 +4355,7 @@ interface TabsContainerProps {
|
|
|
4351
4355
|
* currentTabIndex={0}
|
|
4352
4356
|
* />
|
|
4353
4357
|
*/
|
|
4354
|
-
declare const TabsContainer: ({ tabs, onTabChange, currentTabIndex, className, tabsListClassName, tabsTriggerClassName, variant, }: TabsContainerProps) => react_jsx_runtime.JSX.Element;
|
|
4358
|
+
declare const TabsContainer: ({ tabs, onTabChange, currentTabIndex, className, tabsListClassName, tabsTriggerClassName, tabsContainerStyles, variant, }: TabsContainerProps) => react_jsx_runtime.JSX.Element;
|
|
4355
4359
|
|
|
4356
4360
|
/**
|
|
4357
4361
|
* Props for the UploadDialog component
|
package/dist/styles.css
CHANGED
|
@@ -392,9 +392,6 @@
|
|
|
392
392
|
.bottom-0 {
|
|
393
393
|
bottom: calc(var(--spacing) * 0);
|
|
394
394
|
}
|
|
395
|
-
.bottom-4 {
|
|
396
|
-
bottom: calc(var(--spacing) * 4);
|
|
397
|
-
}
|
|
398
395
|
.bottom-5 {
|
|
399
396
|
bottom: calc(var(--spacing) * 5);
|
|
400
397
|
}
|
|
@@ -419,9 +416,6 @@
|
|
|
419
416
|
.z-50 {
|
|
420
417
|
z-index: 50;
|
|
421
418
|
}
|
|
422
|
-
.z-\[999\] {
|
|
423
|
-
z-index: 999;
|
|
424
|
-
}
|
|
425
419
|
.z-\[1000\] {
|
|
426
420
|
z-index: 1000;
|
|
427
421
|
}
|
|
@@ -1269,9 +1263,6 @@
|
|
|
1269
1263
|
.rounded-\[5px\] {
|
|
1270
1264
|
border-radius: 5px;
|
|
1271
1265
|
}
|
|
1272
|
-
.rounded-\[32px\] {
|
|
1273
|
-
border-radius: 32px;
|
|
1274
|
-
}
|
|
1275
1266
|
.rounded-full {
|
|
1276
1267
|
border-radius: calc(infinity * 1px);
|
|
1277
1268
|
}
|
|
@@ -1561,18 +1552,6 @@
|
|
|
1561
1552
|
.bg-yellow-background {
|
|
1562
1553
|
background-color: var(--yellow-background);
|
|
1563
1554
|
}
|
|
1564
|
-
.bg-gradient-to-r {
|
|
1565
|
-
--tw-gradient-position: to right in oklab;
|
|
1566
|
-
background-image: linear-gradient(var(--tw-gradient-stops));
|
|
1567
|
-
}
|
|
1568
|
-
.from-\[\#573DAB\] {
|
|
1569
|
-
--tw-gradient-from: #573DAB;
|
|
1570
|
-
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
1571
|
-
}
|
|
1572
|
-
.to-\[\#846AD6\] {
|
|
1573
|
-
--tw-gradient-to: #846AD6;
|
|
1574
|
-
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
1575
|
-
}
|
|
1576
1555
|
.fill-current {
|
|
1577
1556
|
fill: currentcolor;
|
|
1578
1557
|
}
|
|
@@ -4479,48 +4458,6 @@
|
|
|
4479
4458
|
inherits: false;
|
|
4480
4459
|
initial-value: solid;
|
|
4481
4460
|
}
|
|
4482
|
-
@property --tw-gradient-position {
|
|
4483
|
-
syntax: "*";
|
|
4484
|
-
inherits: false;
|
|
4485
|
-
}
|
|
4486
|
-
@property --tw-gradient-from {
|
|
4487
|
-
syntax: "<color>";
|
|
4488
|
-
inherits: false;
|
|
4489
|
-
initial-value: #0000;
|
|
4490
|
-
}
|
|
4491
|
-
@property --tw-gradient-via {
|
|
4492
|
-
syntax: "<color>";
|
|
4493
|
-
inherits: false;
|
|
4494
|
-
initial-value: #0000;
|
|
4495
|
-
}
|
|
4496
|
-
@property --tw-gradient-to {
|
|
4497
|
-
syntax: "<color>";
|
|
4498
|
-
inherits: false;
|
|
4499
|
-
initial-value: #0000;
|
|
4500
|
-
}
|
|
4501
|
-
@property --tw-gradient-stops {
|
|
4502
|
-
syntax: "*";
|
|
4503
|
-
inherits: false;
|
|
4504
|
-
}
|
|
4505
|
-
@property --tw-gradient-via-stops {
|
|
4506
|
-
syntax: "*";
|
|
4507
|
-
inherits: false;
|
|
4508
|
-
}
|
|
4509
|
-
@property --tw-gradient-from-position {
|
|
4510
|
-
syntax: "<length-percentage>";
|
|
4511
|
-
inherits: false;
|
|
4512
|
-
initial-value: 0%;
|
|
4513
|
-
}
|
|
4514
|
-
@property --tw-gradient-via-position {
|
|
4515
|
-
syntax: "<length-percentage>";
|
|
4516
|
-
inherits: false;
|
|
4517
|
-
initial-value: 50%;
|
|
4518
|
-
}
|
|
4519
|
-
@property --tw-gradient-to-position {
|
|
4520
|
-
syntax: "<length-percentage>";
|
|
4521
|
-
inherits: false;
|
|
4522
|
-
initial-value: 100%;
|
|
4523
|
-
}
|
|
4524
4461
|
@property --tw-leading {
|
|
4525
4462
|
syntax: "*";
|
|
4526
4463
|
inherits: false;
|
|
@@ -4713,15 +4650,6 @@
|
|
|
4713
4650
|
--tw-space-y-reverse: 0;
|
|
4714
4651
|
--tw-space-x-reverse: 0;
|
|
4715
4652
|
--tw-border-style: solid;
|
|
4716
|
-
--tw-gradient-position: initial;
|
|
4717
|
-
--tw-gradient-from: #0000;
|
|
4718
|
-
--tw-gradient-via: #0000;
|
|
4719
|
-
--tw-gradient-to: #0000;
|
|
4720
|
-
--tw-gradient-stops: initial;
|
|
4721
|
-
--tw-gradient-via-stops: initial;
|
|
4722
|
-
--tw-gradient-from-position: 0%;
|
|
4723
|
-
--tw-gradient-via-position: 50%;
|
|
4724
|
-
--tw-gradient-to-position: 100%;
|
|
4725
4653
|
--tw-leading: initial;
|
|
4726
4654
|
--tw-font-weight: initial;
|
|
4727
4655
|
--tw-tracking: initial;
|
package/package.json
CHANGED
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
* @property {(newSortingState: SortingState) => void} [onSortingChange] - Sorting change callback
|
|
52
52
|
* @property {boolean} [hideTableActionHeader] - Hide the action header
|
|
53
53
|
* @property {Object} [tableActionProps] - Table action header configuration
|
|
54
|
-
* @property {React.ReactNode[]
|
|
54
|
+
* @property {(row: TData, index: number) => React.ReactNode} [card] - Render function for card layout items
|
|
55
55
|
* @property {string} [className] - CSS class for wrapper
|
|
56
56
|
* @property {string} [tableClassName] - CSS class for table element
|
|
57
57
|
* @property {string} [headerClassName] - CSS class for header row
|
|
@@ -103,7 +103,7 @@ type DataTableProps<TData = any> = {
|
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
// Card view props
|
|
106
|
-
|
|
106
|
+
card?: (row: TData, index: number) => React.ReactNode;
|
|
107
107
|
|
|
108
108
|
// Optional customization
|
|
109
109
|
className?: string;
|
|
@@ -140,7 +140,7 @@ type DataTableProps<TData = any> = {
|
|
|
140
140
|
* @param {boolean} [props.isLoading] - Show loading skeletons
|
|
141
141
|
* @param {boolean} [props.hideTableActionHeader] - Hide action header
|
|
142
142
|
* @param {Object} [props.tableActionProps] - Table action configuration
|
|
143
|
-
* @param {React.ReactNode
|
|
143
|
+
* @param {(row: TData, index: number) => React.ReactNode} [props.card] - Card render function
|
|
144
144
|
* @param {string} [props.className] - Wrapper CSS class
|
|
145
145
|
* @param {string} [props.tableClassName] - Table CSS class
|
|
146
146
|
* @param {string} [props.headerClassName] - Header CSS class
|
|
@@ -372,7 +372,19 @@ const DataTable = <TData extends Record<string, any> = any>(
|
|
|
372
372
|
)}
|
|
373
373
|
|
|
374
374
|
{layoutMode === 'card' ? (
|
|
375
|
-
<CardsView
|
|
375
|
+
<CardsView
|
|
376
|
+
card={props.card}
|
|
377
|
+
rows={rows}
|
|
378
|
+
cardContainerClassName={props.cardContainerClassName}
|
|
379
|
+
limit={limit}
|
|
380
|
+
offset={offset}
|
|
381
|
+
totalCount={totalCount}
|
|
382
|
+
onPageChange={onPageChange}
|
|
383
|
+
onLimitChange={onLimitChange}
|
|
384
|
+
isLoading={isLoading}
|
|
385
|
+
rowSelectionModel={rowSelectionModel}
|
|
386
|
+
onRowSelectionModelChange={onRowSelectionModelChange}
|
|
387
|
+
/>
|
|
376
388
|
) : (
|
|
377
389
|
<TableView
|
|
378
390
|
table={table}
|
|
@@ -2,11 +2,27 @@ import { cn } from '@/lib/utils';
|
|
|
2
2
|
import { Card } from '@/shadcn-components/DataDisplay/Card/Card';
|
|
3
3
|
import { Typography } from '@/shadcn-components/DataDisplay/Typography/Typography';
|
|
4
4
|
import { Skeleton } from '../../Skeleton/Skeleton';
|
|
5
|
-
import { DataTableProps } from '../DataTable';
|
|
6
5
|
import { TablePagination } from './TablePagination';
|
|
7
6
|
|
|
7
|
+
type CardsViewProps<TData = any> = {
|
|
8
|
+
card?: (row: TData, index: number) => React.ReactNode;
|
|
9
|
+
rows: TData[];
|
|
10
|
+
cardContainerClassName?: string;
|
|
11
|
+
isLoading?: boolean;
|
|
12
|
+
limit?: number;
|
|
13
|
+
offset?: number;
|
|
14
|
+
totalCount?: number;
|
|
15
|
+
onPageChange?: (page: number) => void;
|
|
16
|
+
onLimitChange?: (limit: number) => void;
|
|
17
|
+
rowSelectionModel?: Record<string, boolean>;
|
|
18
|
+
onRowSelectionModelChange?: (
|
|
19
|
+
newRowSelectionModel: Record<string, boolean>,
|
|
20
|
+
) => void;
|
|
21
|
+
};
|
|
22
|
+
|
|
8
23
|
const CardsView = <TData extends Record<string, any> = any>({
|
|
9
|
-
|
|
24
|
+
card,
|
|
25
|
+
rows,
|
|
10
26
|
cardContainerClassName = '',
|
|
11
27
|
limit,
|
|
12
28
|
offset,
|
|
@@ -14,7 +30,7 @@ const CardsView = <TData extends Record<string, any> = any>({
|
|
|
14
30
|
onPageChange,
|
|
15
31
|
onLimitChange,
|
|
16
32
|
isLoading,
|
|
17
|
-
}:
|
|
33
|
+
}: CardsViewProps<TData>) => {
|
|
18
34
|
return (
|
|
19
35
|
<Card
|
|
20
36
|
className={cn('w-full rounded-md border bg-background p-0 m-0 gap-0')}
|
|
@@ -22,7 +38,7 @@ const CardsView = <TData extends Record<string, any> = any>({
|
|
|
22
38
|
<Typography
|
|
23
39
|
className="border-b p-3 bg-secondary text-muted-foreground"
|
|
24
40
|
variant={'small'}
|
|
25
|
-
>{`Showing ${
|
|
41
|
+
>{`Showing ${rows?.length} cards`}</Typography>
|
|
26
42
|
<div
|
|
27
43
|
className={cn(
|
|
28
44
|
'grid gap-2 p-3',
|
|
@@ -36,21 +52,20 @@ const CardsView = <TData extends Record<string, any> = any>({
|
|
|
36
52
|
>
|
|
37
53
|
{isLoading ? (
|
|
38
54
|
Array.from({ length: 8 }).map((_, index) => (
|
|
39
|
-
<div
|
|
55
|
+
<div
|
|
56
|
+
key={`skeleton-card-${index}`}
|
|
57
|
+
className="flex flex-col h-full gap-3"
|
|
58
|
+
>
|
|
40
59
|
<Skeleton className="h-40 w-full rounded-lg" />
|
|
41
60
|
<Skeleton className="h-4 w-3/4" />
|
|
42
61
|
<Skeleton className="h-4 w-1/2" />
|
|
43
62
|
</div>
|
|
44
63
|
))
|
|
45
|
-
) :
|
|
46
|
-
|
|
47
|
-
<div key={index} className={cn('flex flex-col', 'h-full')}>
|
|
48
|
-
{card}
|
|
49
|
-
</div>
|
|
50
|
-
))
|
|
64
|
+
) : card && rows && rows.length > 0 ? (
|
|
65
|
+
rows.map((row, index) => card(row, index))
|
|
51
66
|
) : (
|
|
52
67
|
<div className="col-span-full p-4 text-center border rounded-md">
|
|
53
|
-
<p className="text-muted-foreground">No
|
|
68
|
+
<p className="text-muted-foreground">No items available</p>
|
|
54
69
|
</div>
|
|
55
70
|
)}
|
|
56
71
|
</div>
|
|
@@ -66,7 +81,7 @@ const CardsView = <TData extends Record<string, any> = any>({
|
|
|
66
81
|
totalCount={totalCount}
|
|
67
82
|
onPageChange={onPageChange}
|
|
68
83
|
onLimitChange={onLimitChange}
|
|
69
|
-
rowCount={
|
|
84
|
+
rowCount={rows?.length || 0}
|
|
70
85
|
/>
|
|
71
86
|
)}
|
|
72
87
|
</Card>
|
|
@@ -48,6 +48,16 @@ const ColumnSelector: React.FC<ColumnSelectorProps> = ({
|
|
|
48
48
|
);
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
+
const handleClearAllHidden = () => {
|
|
52
|
+
// Clear all hidden columns by resetting to empty object
|
|
53
|
+
dispatch(
|
|
54
|
+
setColumnVisibilityModelForUniqueId({
|
|
55
|
+
uniqueId,
|
|
56
|
+
columnVisibilityModel: {},
|
|
57
|
+
}),
|
|
58
|
+
);
|
|
59
|
+
};
|
|
60
|
+
|
|
51
61
|
return (
|
|
52
62
|
<DropdownMenu
|
|
53
63
|
anchor={({ open }) => (
|
|
@@ -55,8 +65,8 @@ const ColumnSelector: React.FC<ColumnSelectorProps> = ({
|
|
|
55
65
|
<Columns3 size={16} />
|
|
56
66
|
</Button>
|
|
57
67
|
)}
|
|
58
|
-
menu={() =>
|
|
59
|
-
visibleColumns.map((column) => {
|
|
68
|
+
menu={() => [
|
|
69
|
+
...visibleColumns.map((column) => {
|
|
60
70
|
// React Table uses accessorKey as the column ID if no explicit id is set
|
|
61
71
|
const columnId = column.id || (column as any).accessorKey || '';
|
|
62
72
|
if (!columnId) return null;
|
|
@@ -88,8 +98,16 @@ const ColumnSelector: React.FC<ColumnSelectorProps> = ({
|
|
|
88
98
|
)}
|
|
89
99
|
</div>
|
|
90
100
|
);
|
|
91
|
-
})
|
|
92
|
-
|
|
101
|
+
}),
|
|
102
|
+
<Button
|
|
103
|
+
variant={'link'}
|
|
104
|
+
size={'sm'}
|
|
105
|
+
className="text-destructive hover:no-underline"
|
|
106
|
+
onClick={handleClearAllHidden}
|
|
107
|
+
>
|
|
108
|
+
Clear
|
|
109
|
+
</Button>,
|
|
110
|
+
]}
|
|
93
111
|
/>
|
|
94
112
|
);
|
|
95
113
|
};
|
|
@@ -95,10 +95,15 @@ const TableActionHeader = ({
|
|
|
95
95
|
</div>
|
|
96
96
|
|
|
97
97
|
<div className="flex items-center gap-2">
|
|
98
|
-
{
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
98
|
+
{layoutMode === 'table' && (
|
|
99
|
+
<>
|
|
100
|
+
{' '}
|
|
101
|
+
{/* Density Selector */}
|
|
102
|
+
<DensitySelector uniqueId={uniqueId} />
|
|
103
|
+
{/* Column Selector */}
|
|
104
|
+
<ColumnSelector columns={columns} uniqueId={uniqueId} />
|
|
105
|
+
</>
|
|
106
|
+
)}
|
|
102
107
|
{/* Layout Switcher */}
|
|
103
108
|
<div className="flex gap-1 border rounded-md flex-shrink-0 bg-background">
|
|
104
109
|
<Button
|
|
@@ -167,7 +167,11 @@ const TableView = React.forwardRef<HTMLDivElement, TableViewProps>(
|
|
|
167
167
|
<TableRow
|
|
168
168
|
key={row.id}
|
|
169
169
|
data-state={row.getIsSelected() && 'selected'}
|
|
170
|
-
className={cn(
|
|
170
|
+
className={cn(
|
|
171
|
+
rowHeightClass,
|
|
172
|
+
customRowClassName,
|
|
173
|
+
onRowClick && 'cursor-pointer',
|
|
174
|
+
)}
|
|
171
175
|
onClick={() => onRowClick?.({ row })}
|
|
172
176
|
>
|
|
173
177
|
{row.getVisibleCells().map((cell: any, index: number) => (
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { FileText } from 'lucide-react';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { useMediaQuery } from '../../../hooks/useMediaQuery';
|
|
4
|
-
import { Button } from '../../Input/Button/Button';
|
|
5
3
|
import { Sidebar } from './components/Sidebar/Sidebar';
|
|
6
4
|
import { SidebarProvider, useSidebar } from './context/SidebarContext';
|
|
7
5
|
import { AppLayoutProps } from './types';
|
|
@@ -90,18 +88,11 @@ const AppLayoutContent: React.FC<AppLayoutProps> = ({
|
|
|
90
88
|
}
|
|
91
89
|
/>
|
|
92
90
|
|
|
93
|
-
<Button
|
|
94
|
-
className="bg-gradient-to-r from-[#573DAB] to-[#846AD6] rounded-[32px] fixed bottom-4 right-4 z-[999] p-2"
|
|
95
|
-
onClick={() => window.open('https://docs.campx.in/', '_blank')}
|
|
96
|
-
>
|
|
97
|
-
<FileText className="w-8 h-8 text-white" />
|
|
98
|
-
</Button>
|
|
99
|
-
|
|
100
91
|
{/* Main Content */}
|
|
101
92
|
<div
|
|
102
93
|
style={{
|
|
103
94
|
height: '100vh',
|
|
104
|
-
overflow: '
|
|
95
|
+
overflow: 'auto',
|
|
105
96
|
display: 'flex',
|
|
106
97
|
flexDirection: 'column',
|
|
107
98
|
}}
|
|
@@ -130,7 +130,7 @@ export const UserProfilePopup: React.FC<UserProfilePopupProps> = ({
|
|
|
130
130
|
label={
|
|
131
131
|
<div className="flex flex-col gap-1 flex-1">
|
|
132
132
|
Account
|
|
133
|
-
<div className="flex flex-row items-center justify-between">
|
|
133
|
+
<div className="flex flex-row items-center justify-between gap-4">
|
|
134
134
|
<div className="flex flex-row gap-2">
|
|
135
135
|
<CircularAvatar
|
|
136
136
|
text={userFullName}
|
|
@@ -5,6 +5,7 @@ import { ReactNode } from 'react';
|
|
|
5
5
|
interface PageContentProps {
|
|
6
6
|
children: ReactNode;
|
|
7
7
|
className?: string;
|
|
8
|
+
styles?: React.CSSProperties;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -26,7 +27,7 @@ interface PageContentProps {
|
|
|
26
27
|
* </PageContent>
|
|
27
28
|
* ```
|
|
28
29
|
*/
|
|
29
|
-
const PageContent = ({ children, className }: PageContentProps) => {
|
|
30
|
+
const PageContent = ({ children, className, styles }: PageContentProps) => {
|
|
30
31
|
const isSmallScreen = useMediaQuery('(max-width: 768px)');
|
|
31
32
|
|
|
32
33
|
return (
|
|
@@ -36,9 +37,9 @@ const PageContent = ({ children, className }: PageContentProps) => {
|
|
|
36
37
|
className,
|
|
37
38
|
)}
|
|
38
39
|
style={{
|
|
39
|
-
height: isSmallScreen ? 'calc(100vh - 101px)' : `calc(100vh -
|
|
40
|
-
maxHeight: isSmallScreen ? 'calc(100vh - 101px)' : `calc(100vh - 90px)`,
|
|
40
|
+
height: isSmallScreen ? 'calc(100vh - 101px)' : `calc(100vh - 80px)`,
|
|
41
41
|
overflowY: 'auto',
|
|
42
|
+
...styles,
|
|
42
43
|
}}
|
|
43
44
|
>
|
|
44
45
|
{children}
|
|
@@ -9,7 +9,10 @@ import { cn } from '@/lib/utils';
|
|
|
9
9
|
import { EllipsisVertical, Funnel, Plus } from 'lucide-react';
|
|
10
10
|
import { cloneElement, ReactElement, ReactNode } from 'react';
|
|
11
11
|
import { useDispatch } from 'react-redux';
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
resetStateForUniqueId,
|
|
14
|
+
setFilterByNameForUniqueId,
|
|
15
|
+
} from '../../../redux/slices/pageHeaderSlice';
|
|
13
16
|
import { SearchBarProps } from '../../Input/SearchBar/SearchBar';
|
|
14
17
|
import { Breadcrumbs } from '../../Navigation/Breadcrumbs/Breadcrumbs';
|
|
15
18
|
import { PageHeaderSearchBar } from './components/SearchBar';
|
|
@@ -144,12 +147,24 @@ const PageHeader = ({
|
|
|
144
147
|
useMenuSlot={true}
|
|
145
148
|
menuSlot={() => (
|
|
146
149
|
<div className="flex flex-col gap-2 p-1 w-80">
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
<div className="flex justify-between">
|
|
151
|
+
<Typography
|
|
152
|
+
variant={'lead'}
|
|
153
|
+
className="flex gap-1 items-center p-1 pb-0 text-sm"
|
|
154
|
+
>
|
|
155
|
+
<Funnel size={16} /> Advanced Filters
|
|
156
|
+
</Typography>
|
|
157
|
+
<Button
|
|
158
|
+
variant={'link'}
|
|
159
|
+
size={'sm'}
|
|
160
|
+
className="text-destructive hover:no-underline"
|
|
161
|
+
onClick={() =>
|
|
162
|
+
dispatch(resetStateForUniqueId({ uniqueId }))
|
|
163
|
+
}
|
|
164
|
+
>
|
|
165
|
+
Clear
|
|
166
|
+
</Button>
|
|
167
|
+
</div>
|
|
153
168
|
<Separator />
|
|
154
169
|
{filterButtonProps.components.map((component, index) => (
|
|
155
170
|
<div key={index} className="w-full ">
|