baaz-custom-components 5.1.2 → 5.2.1

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/index.css CHANGED
@@ -392,6 +392,9 @@
392
392
  .-mx-1 {
393
393
  margin-inline: calc(var(--spacing) * -1);
394
394
  }
395
+ .mx-1 {
396
+ margin-inline: calc(var(--spacing) * 1);
397
+ }
395
398
  .mx-2 {
396
399
  margin-inline: calc(var(--spacing) * 2);
397
400
  }
@@ -573,6 +576,9 @@
573
576
  .min-h-0 {
574
577
  min-height: calc(var(--spacing) * 0);
575
578
  }
579
+ .min-h-\[48px\] {
580
+ min-height: 48px;
581
+ }
576
582
  .\!w-0 {
577
583
  width: calc(var(--spacing) * 0) !important;
578
584
  }
@@ -645,6 +651,9 @@
645
651
  .w-max {
646
652
  width: max-content;
647
653
  }
654
+ .w-px {
655
+ width: 1px;
656
+ }
648
657
  .max-w-\(--skeleton-width\) {
649
658
  max-width: var(--skeleton-width);
650
659
  }
@@ -746,6 +755,9 @@
746
755
  .touch-none {
747
756
  touch-action: none;
748
757
  }
758
+ .resize {
759
+ resize: both;
760
+ }
749
761
  .scroll-my-1 {
750
762
  scroll-margin-block: calc(var(--spacing) * 1);
751
763
  }
@@ -826,6 +838,9 @@
826
838
  .overflow-y-auto {
827
839
  overflow-y: auto;
828
840
  }
841
+ .rounded {
842
+ border-radius: 0.25rem;
843
+ }
829
844
  .rounded-\[2px\] {
830
845
  border-radius: 2px;
831
846
  }
@@ -1015,6 +1030,12 @@
1015
1030
  background-color: color-mix(in oklab, var(--primary) 30%, transparent);
1016
1031
  }
1017
1032
  }
1033
+ .bg-primary\/90 {
1034
+ background-color: var(--primary);
1035
+ @supports (color: color-mix(in lab, red, red)) {
1036
+ background-color: color-mix(in oklab, var(--primary) 90%, transparent);
1037
+ }
1038
+ }
1018
1039
  .bg-red-700 {
1019
1040
  background-color: var(--color-red-700);
1020
1041
  }
@@ -1054,6 +1075,9 @@
1054
1075
  .p-1 {
1055
1076
  padding: calc(var(--spacing) * 1);
1056
1077
  }
1078
+ .p-1\.5 {
1079
+ padding: calc(var(--spacing) * 1.5);
1080
+ }
1057
1081
  .p-2 {
1058
1082
  padding: calc(var(--spacing) * 2);
1059
1083
  }
@@ -1315,6 +1339,9 @@
1315
1339
  -webkit-font-smoothing: antialiased;
1316
1340
  -moz-osx-font-smoothing: grayscale;
1317
1341
  }
1342
+ .accent-primary {
1343
+ accent-color: var(--primary);
1344
+ }
1318
1345
  .opacity-0 {
1319
1346
  opacity: 0%;
1320
1347
  }
@@ -1563,6 +1590,12 @@
1563
1590
  --tw-enter-scale: calc(95*1%);
1564
1591
  --tw-enter-scale: .95;
1565
1592
  }
1593
+ .fade-in {
1594
+ --tw-enter-opacity: 0;
1595
+ }
1596
+ .slide-in-from-left-2 {
1597
+ --tw-enter-translate-x: calc(2*var(--spacing)*-1);
1598
+ }
1566
1599
  .group-focus-within\/menu-item\:opacity-100 {
1567
1600
  &:is(:where(.group\/menu-item):focus-within *) {
1568
1601
  opacity: 100%;
@@ -1970,6 +2003,13 @@
1970
2003
  }
1971
2004
  }
1972
2005
  }
2006
+ .hover\:bg-primary {
2007
+ &:hover {
2008
+ @media (hover: hover) {
2009
+ background-color: var(--primary);
2010
+ }
2011
+ }
2012
+ }
1973
2013
  .hover\:bg-primary\/90 {
1974
2014
  &:hover {
1975
2015
  @media (hover: hover) {
@@ -2106,6 +2146,17 @@
2106
2146
  color: var(--accent-foreground);
2107
2147
  }
2108
2148
  }
2149
+ .focus\:ring-1 {
2150
+ &:focus {
2151
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
2152
+ box-shadow:
2153
+ var(--tw-inset-shadow),
2154
+ var(--tw-inset-ring-shadow),
2155
+ var(--tw-ring-offset-shadow),
2156
+ var(--tw-ring-shadow),
2157
+ var(--tw-shadow);
2158
+ }
2159
+ }
2109
2160
  .focus\:ring-2 {
2110
2161
  &:focus {
2111
2162
  --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
@@ -2117,6 +2168,11 @@
2117
2168
  var(--tw-shadow);
2118
2169
  }
2119
2170
  }
2171
+ .focus\:ring-primary {
2172
+ &:focus {
2173
+ --tw-ring-color: var(--primary);
2174
+ }
2175
+ }
2120
2176
  .focus\:ring-ring {
2121
2177
  &:focus {
2122
2178
  --tw-ring-color: var(--ring);
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import * as react from 'react';
2
- import { ReactNode } from 'react';
1
+ import * as React$1 from 'react';
2
+ import React__default, { ReactNode } from 'react';
3
3
  import { IApi } from '@svar-ui/react-grid';
4
4
 
5
5
  type NavbarData = NavbarEntry[];
@@ -48,7 +48,7 @@ interface NavbarProps {
48
48
  hubIdChangeHandler: (value: string) => void;
49
49
  }
50
50
 
51
- declare function Navbar({ navbarData, userData, onLogout, notificationData, router, hubDetails, hubIdEnable, hubIdChangeHandler, notificationHandler, }: NavbarProps): react.JSX.Element | null;
51
+ declare function Navbar({ navbarData, userData, onLogout, notificationData, router, hubDetails, hubIdEnable, hubIdChangeHandler, notificationHandler, }: NavbarProps): React$1.JSX.Element | null;
52
52
 
53
53
  type BreadcrumbProps = {
54
54
  layoutName: string;
@@ -57,7 +57,7 @@ type BreadcrumbProps = {
57
57
  pathname?: string;
58
58
  };
59
59
 
60
- declare const CustomBreadcrumb: ({ layoutName, includeFrom, pathname, }: BreadcrumbProps) => react.JSX.Element;
60
+ declare const CustomBreadcrumb: ({ layoutName, includeFrom, pathname, }: BreadcrumbProps) => React$1.JSX.Element;
61
61
 
62
62
  type SortOrder = "asc" | "desc";
63
63
 
@@ -84,11 +84,11 @@ type Filters = {
84
84
  }[];
85
85
  };
86
86
  type GridProps = {
87
- data: Record<string, any>[];
87
+ data: AnyRow[];
88
+ select?: boolean;
88
89
  columns: GridColumn[];
89
90
  sortKey?: string | null;
90
91
  sortOrder?: SortOrder | null;
91
- onSortChange?: (key: string, order: SortOrder) => void;
92
92
  multiselect?: boolean;
93
93
  reorder?: boolean;
94
94
  overlay?: React.FC | string;
@@ -102,14 +102,20 @@ type GridProps = {
102
102
  searchkey: string;
103
103
  searchValue: string;
104
104
  loading: boolean;
105
+ filterList: Filters[];
106
+ initialFilters?: any[];
107
+ children?: React.ReactNode;
108
+ onSortChange?: (key: string, order: SortOrder) => void;
105
109
  onExportPdf?: () => void;
106
110
  onExportExcel?: () => void;
107
111
  onSearch: (e: React.ChangeEvent<HTMLInputElement>) => void;
108
- filterList: Filters[];
109
112
  onFilterChange?: (payload: MultiFilterPayload) => void;
110
113
  onApiReady?: (api: IApi) => void;
111
- initialFilters?: any[];
112
- children?: React.ReactNode;
114
+ onFocusCell?: (params: {
115
+ row?: string | number;
116
+ column?: string | number;
117
+ eventSource?: string;
118
+ }) => boolean | void;
113
119
  };
114
120
  type FilterCondition = ActiveFilter & {
115
121
  id: string;
@@ -131,7 +137,31 @@ type ActiveFilter = {
131
137
  value?: FilterValue;
132
138
  };
133
139
 
134
- declare const Grid: react.ForwardRefExoticComponent<GridProps & react.RefAttributes<IApi | null>>;
140
+ type RowId = string | number;
141
+ type AnyRow = {
142
+ id: RowId;
143
+ [key: string]: any;
144
+ };
145
+ interface SelectionAction {
146
+ id: string;
147
+ label: string;
148
+ icon?: React__default.ReactNode;
149
+ }
150
+ interface GridSelectionProps {
151
+ getSelectedIds: () => RowId[];
152
+ selectionEnabled?: boolean;
153
+ onRowSelectionChange?: (id: RowId, rowData: AnyRow, checked: boolean) => void;
154
+ onSelectAllPage?: (pageData: AnyRow[], checked: boolean) => void;
155
+ }
156
+ interface GridHeaderSelectionProps {
157
+ selectedCount?: number;
158
+ selectedData?: AnyRow[];
159
+ selectionActions?: SelectionAction[];
160
+ onSelectionAction?: (actionId: string, selectedData: AnyRow[]) => void;
161
+ onClearSelection?: () => void;
162
+ }
163
+
164
+ declare const _default$1: React__default.NamedExoticComponent<GridProps & GridSelectionProps & GridHeaderSelectionProps & React__default.RefAttributes<IApi | null>>;
135
165
 
136
166
  type Props = {
137
167
  cell: {
@@ -142,7 +172,7 @@ type Props = {
142
172
  sortOrder?: SortOrder | null;
143
173
  onSortChange?: (key: string, order: SortOrder) => void;
144
174
  };
145
- declare function SortableHeaderCell({ cell, sortKey, sortOrder, onSortChange }: Props): react.JSX.Element;
175
+ declare const _default: React__default.MemoExoticComponent<({ cell, sortKey, sortOrder, onSortChange }: Props) => React__default.JSX.Element>;
146
176
 
147
177
  type Pagination$1 = {
148
178
  totalCount: number;
@@ -156,7 +186,7 @@ type Pagination$1 = {
156
186
  sizeChangerOptions?: number[];
157
187
  };
158
188
 
159
- declare function Pagination({ totalCount, count, currentPage, totalPages, pageSize, onPageChange, onPageSizeChange, showSizeChanger, sizeChangerOptions, }: Pagination$1): react.JSX.Element;
189
+ declare function Pagination({ totalCount, count, currentPage, totalPages, pageSize, onPageChange, onPageSizeChange, showSizeChanger, sizeChangerOptions, }: Pagination$1): React$1.JSX.Element;
160
190
 
161
191
  interface ToolbarItem {
162
192
  id: string;
@@ -176,4 +206,4 @@ interface SlideToolbarProps {
176
206
 
177
207
  declare const SlideToolbar: React.FC<SlideToolbarProps>;
178
208
 
179
- export { type BreadcrumbProps, CustomBreadcrumb, Grid, type GridProps, Navbar, type NavbarData, type NavbarEntry, type NavbarProps, type NotificationDataTypes, Pagination, type Pagination$1 as PaginationProps, type RouteTree, type RouterAdapter, SlideToolbar, type SlideToolbarProps, SortableHeaderCell, type ToolbarItem, type UserData };
209
+ export { type BreadcrumbProps, CustomBreadcrumb, _default$1 as Grid, type GridProps, Navbar, type NavbarData, type NavbarEntry, type NavbarProps, type NotificationDataTypes, Pagination, type Pagination$1 as PaginationProps, type RouteTree, type RouterAdapter, SlideToolbar, type SlideToolbarProps, _default as SortableHeaderCell, type ToolbarItem, type UserData };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as react from 'react';
2
- import { ReactNode } from 'react';
1
+ import * as React$1 from 'react';
2
+ import React__default, { ReactNode } from 'react';
3
3
  import { IApi } from '@svar-ui/react-grid';
4
4
 
5
5
  type NavbarData = NavbarEntry[];
@@ -48,7 +48,7 @@ interface NavbarProps {
48
48
  hubIdChangeHandler: (value: string) => void;
49
49
  }
50
50
 
51
- declare function Navbar({ navbarData, userData, onLogout, notificationData, router, hubDetails, hubIdEnable, hubIdChangeHandler, notificationHandler, }: NavbarProps): react.JSX.Element | null;
51
+ declare function Navbar({ navbarData, userData, onLogout, notificationData, router, hubDetails, hubIdEnable, hubIdChangeHandler, notificationHandler, }: NavbarProps): React$1.JSX.Element | null;
52
52
 
53
53
  type BreadcrumbProps = {
54
54
  layoutName: string;
@@ -57,7 +57,7 @@ type BreadcrumbProps = {
57
57
  pathname?: string;
58
58
  };
59
59
 
60
- declare const CustomBreadcrumb: ({ layoutName, includeFrom, pathname, }: BreadcrumbProps) => react.JSX.Element;
60
+ declare const CustomBreadcrumb: ({ layoutName, includeFrom, pathname, }: BreadcrumbProps) => React$1.JSX.Element;
61
61
 
62
62
  type SortOrder = "asc" | "desc";
63
63
 
@@ -84,11 +84,11 @@ type Filters = {
84
84
  }[];
85
85
  };
86
86
  type GridProps = {
87
- data: Record<string, any>[];
87
+ data: AnyRow[];
88
+ select?: boolean;
88
89
  columns: GridColumn[];
89
90
  sortKey?: string | null;
90
91
  sortOrder?: SortOrder | null;
91
- onSortChange?: (key: string, order: SortOrder) => void;
92
92
  multiselect?: boolean;
93
93
  reorder?: boolean;
94
94
  overlay?: React.FC | string;
@@ -102,14 +102,20 @@ type GridProps = {
102
102
  searchkey: string;
103
103
  searchValue: string;
104
104
  loading: boolean;
105
+ filterList: Filters[];
106
+ initialFilters?: any[];
107
+ children?: React.ReactNode;
108
+ onSortChange?: (key: string, order: SortOrder) => void;
105
109
  onExportPdf?: () => void;
106
110
  onExportExcel?: () => void;
107
111
  onSearch: (e: React.ChangeEvent<HTMLInputElement>) => void;
108
- filterList: Filters[];
109
112
  onFilterChange?: (payload: MultiFilterPayload) => void;
110
113
  onApiReady?: (api: IApi) => void;
111
- initialFilters?: any[];
112
- children?: React.ReactNode;
114
+ onFocusCell?: (params: {
115
+ row?: string | number;
116
+ column?: string | number;
117
+ eventSource?: string;
118
+ }) => boolean | void;
113
119
  };
114
120
  type FilterCondition = ActiveFilter & {
115
121
  id: string;
@@ -131,7 +137,31 @@ type ActiveFilter = {
131
137
  value?: FilterValue;
132
138
  };
133
139
 
134
- declare const Grid: react.ForwardRefExoticComponent<GridProps & react.RefAttributes<IApi | null>>;
140
+ type RowId = string | number;
141
+ type AnyRow = {
142
+ id: RowId;
143
+ [key: string]: any;
144
+ };
145
+ interface SelectionAction {
146
+ id: string;
147
+ label: string;
148
+ icon?: React__default.ReactNode;
149
+ }
150
+ interface GridSelectionProps {
151
+ getSelectedIds: () => RowId[];
152
+ selectionEnabled?: boolean;
153
+ onRowSelectionChange?: (id: RowId, rowData: AnyRow, checked: boolean) => void;
154
+ onSelectAllPage?: (pageData: AnyRow[], checked: boolean) => void;
155
+ }
156
+ interface GridHeaderSelectionProps {
157
+ selectedCount?: number;
158
+ selectedData?: AnyRow[];
159
+ selectionActions?: SelectionAction[];
160
+ onSelectionAction?: (actionId: string, selectedData: AnyRow[]) => void;
161
+ onClearSelection?: () => void;
162
+ }
163
+
164
+ declare const _default$1: React__default.NamedExoticComponent<GridProps & GridSelectionProps & GridHeaderSelectionProps & React__default.RefAttributes<IApi | null>>;
135
165
 
136
166
  type Props = {
137
167
  cell: {
@@ -142,7 +172,7 @@ type Props = {
142
172
  sortOrder?: SortOrder | null;
143
173
  onSortChange?: (key: string, order: SortOrder) => void;
144
174
  };
145
- declare function SortableHeaderCell({ cell, sortKey, sortOrder, onSortChange }: Props): react.JSX.Element;
175
+ declare const _default: React__default.MemoExoticComponent<({ cell, sortKey, sortOrder, onSortChange }: Props) => React__default.JSX.Element>;
146
176
 
147
177
  type Pagination$1 = {
148
178
  totalCount: number;
@@ -156,7 +186,7 @@ type Pagination$1 = {
156
186
  sizeChangerOptions?: number[];
157
187
  };
158
188
 
159
- declare function Pagination({ totalCount, count, currentPage, totalPages, pageSize, onPageChange, onPageSizeChange, showSizeChanger, sizeChangerOptions, }: Pagination$1): react.JSX.Element;
189
+ declare function Pagination({ totalCount, count, currentPage, totalPages, pageSize, onPageChange, onPageSizeChange, showSizeChanger, sizeChangerOptions, }: Pagination$1): React$1.JSX.Element;
160
190
 
161
191
  interface ToolbarItem {
162
192
  id: string;
@@ -176,4 +206,4 @@ interface SlideToolbarProps {
176
206
 
177
207
  declare const SlideToolbar: React.FC<SlideToolbarProps>;
178
208
 
179
- export { type BreadcrumbProps, CustomBreadcrumb, Grid, type GridProps, Navbar, type NavbarData, type NavbarEntry, type NavbarProps, type NotificationDataTypes, Pagination, type Pagination$1 as PaginationProps, type RouteTree, type RouterAdapter, SlideToolbar, type SlideToolbarProps, SortableHeaderCell, type ToolbarItem, type UserData };
209
+ export { type BreadcrumbProps, CustomBreadcrumb, _default$1 as Grid, type GridProps, Navbar, type NavbarData, type NavbarEntry, type NavbarProps, type NotificationDataTypes, Pagination, type Pagination$1 as PaginationProps, type RouteTree, type RouterAdapter, SlideToolbar, type SlideToolbarProps, _default as SortableHeaderCell, type ToolbarItem, type UserData };