baaz-custom-components 5.1.1 → 5.2.0

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
@@ -43,6 +43,7 @@
43
43
  --font-weight-normal: 400;
44
44
  --font-weight-medium: 500;
45
45
  --font-weight-semibold: 600;
46
+ --tracking-wide: 0.025em;
46
47
  --tracking-wider: 0.05em;
47
48
  --tracking-widest: 0.1em;
48
49
  --radius-xs: 0.125rem;
@@ -391,6 +392,9 @@
391
392
  .-mx-1 {
392
393
  margin-inline: calc(var(--spacing) * -1);
393
394
  }
395
+ .mx-1 {
396
+ margin-inline: calc(var(--spacing) * 1);
397
+ }
394
398
  .mx-2 {
395
399
  margin-inline: calc(var(--spacing) * 2);
396
400
  }
@@ -488,9 +492,6 @@
488
492
  width: 100%;
489
493
  height: 100%;
490
494
  }
491
- .h-1 {
492
- height: calc(var(--spacing) * 1);
493
- }
494
495
  .h-1\.5 {
495
496
  height: calc(var(--spacing) * 1.5);
496
497
  }
@@ -509,6 +510,9 @@
509
510
  .h-5 {
510
511
  height: calc(var(--spacing) * 5);
511
512
  }
513
+ .h-6 {
514
+ height: calc(var(--spacing) * 6);
515
+ }
512
516
  .h-7 {
513
517
  height: calc(var(--spacing) * 7);
514
518
  }
@@ -572,6 +576,9 @@
572
576
  .min-h-0 {
573
577
  min-height: calc(var(--spacing) * 0);
574
578
  }
579
+ .min-h-\[48px\] {
580
+ min-height: 48px;
581
+ }
575
582
  .\!w-0 {
576
583
  width: calc(var(--spacing) * 0) !important;
577
584
  }
@@ -581,8 +588,8 @@
581
588
  .w-\(--sidebar-width\) {
582
589
  width: var(--sidebar-width);
583
590
  }
584
- .w-1 {
585
- width: calc(var(--spacing) * 1);
591
+ .w-1\.5 {
592
+ width: calc(var(--spacing) * 1.5);
586
593
  }
587
594
  .w-2 {
588
595
  width: calc(var(--spacing) * 2);
@@ -602,6 +609,9 @@
602
609
  .w-5 {
603
610
  width: calc(var(--spacing) * 5);
604
611
  }
612
+ .w-6 {
613
+ width: calc(var(--spacing) * 6);
614
+ }
605
615
  .w-8 {
606
616
  width: calc(var(--spacing) * 8);
607
617
  }
@@ -641,6 +651,9 @@
641
651
  .w-max {
642
652
  width: max-content;
643
653
  }
654
+ .w-px {
655
+ width: 1px;
656
+ }
644
657
  .max-w-\(--skeleton-width\) {
645
658
  max-width: var(--skeleton-width);
646
659
  }
@@ -742,6 +755,9 @@
742
755
  .touch-none {
743
756
  touch-action: none;
744
757
  }
758
+ .resize {
759
+ resize: both;
760
+ }
745
761
  .scroll-my-1 {
746
762
  scroll-margin-block: calc(var(--spacing) * 1);
747
763
  }
@@ -784,9 +800,6 @@
784
800
  .gap-2 {
785
801
  gap: calc(var(--spacing) * 2);
786
802
  }
787
- .gap-2\.5 {
788
- gap: calc(var(--spacing) * 2.5);
789
- }
790
803
  .gap-3 {
791
804
  gap: calc(var(--spacing) * 3);
792
805
  }
@@ -1017,6 +1030,12 @@
1017
1030
  background-color: color-mix(in oklab, var(--primary) 30%, transparent);
1018
1031
  }
1019
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
+ }
1020
1039
  .bg-red-700 {
1021
1040
  background-color: var(--color-red-700);
1022
1041
  }
@@ -1032,9 +1051,6 @@
1032
1051
  .bg-sidebar-border {
1033
1052
  background-color: var(--sidebar-border);
1034
1053
  }
1035
- .bg-surface-alt {
1036
- background-color: var(--surface-alt);
1037
- }
1038
1054
  .bg-transparent {
1039
1055
  background-color: transparent;
1040
1056
  }
@@ -1065,9 +1081,6 @@
1065
1081
  .p-2 {
1066
1082
  padding: calc(var(--spacing) * 2);
1067
1083
  }
1068
- .p-2\.5 {
1069
- padding: calc(var(--spacing) * 2.5);
1070
- }
1071
1084
  .p-4 {
1072
1085
  padding: calc(var(--spacing) * 4);
1073
1086
  }
@@ -1119,9 +1132,15 @@
1119
1132
  .py-2\.5 {
1120
1133
  padding-block: calc(var(--spacing) * 2.5);
1121
1134
  }
1135
+ .py-3 {
1136
+ padding-block: calc(var(--spacing) * 3);
1137
+ }
1122
1138
  .py-4 {
1123
1139
  padding-block: calc(var(--spacing) * 4);
1124
1140
  }
1141
+ .pt-1 {
1142
+ padding-top: calc(var(--spacing) * 1);
1143
+ }
1125
1144
  .pt-2 {
1126
1145
  padding-top: calc(var(--spacing) * 2);
1127
1146
  }
@@ -1168,8 +1187,11 @@
1168
1187
  font-size: var(--text-xs);
1169
1188
  line-height: var(--tw-leading, var(--text-xs--line-height));
1170
1189
  }
1171
- .text-\[9px\] {
1172
- font-size: 9px;
1190
+ .text-\[10px\] {
1191
+ font-size: 10px;
1192
+ }
1193
+ .text-\[13px\] {
1194
+ font-size: 13px;
1173
1195
  }
1174
1196
  .leading-none {
1175
1197
  --tw-leading: 1;
@@ -1195,22 +1217,22 @@
1195
1217
  --tw-font-weight: var(--font-weight-semibold);
1196
1218
  font-weight: var(--font-weight-semibold);
1197
1219
  }
1198
- .tracking-\[0\.1em\] {
1199
- --tw-tracking: 0.1em;
1200
- letter-spacing: 0.1em;
1201
- }
1202
- .tracking-\[0\.14em\] {
1203
- --tw-tracking: 0.14em;
1204
- letter-spacing: 0.14em;
1220
+ .tracking-\[0\.12em\] {
1221
+ --tw-tracking: 0.12em;
1222
+ letter-spacing: 0.12em;
1205
1223
  }
1206
- .tracking-\[0\.15em\] {
1207
- --tw-tracking: 0.15em;
1208
- letter-spacing: 0.15em;
1224
+ .tracking-\[0\.16em\] {
1225
+ --tw-tracking: 0.16em;
1226
+ letter-spacing: 0.16em;
1209
1227
  }
1210
1228
  .tracking-\[0\.25rem\] {
1211
1229
  --tw-tracking: 0.25rem;
1212
1230
  letter-spacing: 0.25rem;
1213
1231
  }
1232
+ .tracking-wide {
1233
+ --tw-tracking: var(--tracking-wide);
1234
+ letter-spacing: var(--tracking-wide);
1235
+ }
1214
1236
  .tracking-wider {
1215
1237
  --tw-tracking: var(--tracking-wider);
1216
1238
  letter-spacing: var(--tracking-wider);
@@ -1237,22 +1259,34 @@
1237
1259
  .text-foreground {
1238
1260
  color: var(--foreground);
1239
1261
  }
1240
- .text-foreground\/25 {
1262
+ .text-foreground\/30 {
1241
1263
  color: var(--foreground);
1242
1264
  @supports (color: color-mix(in lab, red, red)) {
1243
- color: color-mix(in oklab, var(--foreground) 25%, transparent);
1265
+ color: color-mix(in oklab, var(--foreground) 30%, transparent);
1244
1266
  }
1245
1267
  }
1246
- .text-foreground\/30 {
1268
+ .text-foreground\/35 {
1247
1269
  color: var(--foreground);
1248
1270
  @supports (color: color-mix(in lab, red, red)) {
1249
- color: color-mix(in oklab, var(--foreground) 30%, transparent);
1271
+ color: color-mix(in oklab, var(--foreground) 35%, transparent);
1272
+ }
1273
+ }
1274
+ .text-foreground\/40 {
1275
+ color: var(--foreground);
1276
+ @supports (color: color-mix(in lab, red, red)) {
1277
+ color: color-mix(in oklab, var(--foreground) 40%, transparent);
1278
+ }
1279
+ }
1280
+ .text-foreground\/50 {
1281
+ color: var(--foreground);
1282
+ @supports (color: color-mix(in lab, red, red)) {
1283
+ color: color-mix(in oklab, var(--foreground) 50%, transparent);
1250
1284
  }
1251
1285
  }
1252
- .text-foreground\/70 {
1286
+ .text-foreground\/60 {
1253
1287
  color: var(--foreground);
1254
1288
  @supports (color: color-mix(in lab, red, red)) {
1255
- color: color-mix(in oklab, var(--foreground) 70%, transparent);
1289
+ color: color-mix(in oklab, var(--foreground) 60%, transparent);
1256
1290
  }
1257
1291
  }
1258
1292
  .text-green-800 {
@@ -1305,6 +1339,9 @@
1305
1339
  -webkit-font-smoothing: antialiased;
1306
1340
  -moz-osx-font-smoothing: grayscale;
1307
1341
  }
1342
+ .accent-primary {
1343
+ accent-color: var(--primary);
1344
+ }
1308
1345
  .opacity-0 {
1309
1346
  opacity: 0%;
1310
1347
  }
@@ -1513,9 +1550,9 @@
1513
1550
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1514
1551
  transition-duration: var(--tw-duration, var(--default-transition-duration));
1515
1552
  }
1516
- .duration-100 {
1517
- --tw-duration: 100ms;
1518
- transition-duration: 100ms;
1553
+ .duration-150 {
1554
+ --tw-duration: 150ms;
1555
+ transition-duration: 150ms;
1519
1556
  }
1520
1557
  .duration-200 {
1521
1558
  --tw-duration: 200ms;
@@ -1553,18 +1590,21 @@
1553
1590
  --tw-enter-scale: calc(95*1%);
1554
1591
  --tw-enter-scale: .95;
1555
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
+ }
1556
1599
  .group-focus-within\/menu-item\:opacity-100 {
1557
1600
  &:is(:where(.group\/menu-item):focus-within *) {
1558
1601
  opacity: 100%;
1559
1602
  }
1560
1603
  }
1561
- .group-hover\:text-foreground\/90 {
1604
+ .group-hover\:text-primary {
1562
1605
  &:is(:where(.group):hover *) {
1563
1606
  @media (hover: hover) {
1564
- color: var(--foreground);
1565
- @supports (color: color-mix(in lab, red, red)) {
1566
- color: color-mix(in oklab, var(--foreground) 90%, transparent);
1567
- }
1607
+ color: var(--primary);
1568
1608
  }
1569
1609
  }
1570
1610
  }
@@ -1922,13 +1962,6 @@
1922
1962
  }
1923
1963
  }
1924
1964
  }
1925
- .hover\:bg-border {
1926
- &:hover {
1927
- @media (hover: hover) {
1928
- background-color: var(--border);
1929
- }
1930
- }
1931
- }
1932
1965
  .hover\:bg-card-foreground {
1933
1966
  &:hover {
1934
1967
  @media (hover: hover) {
@@ -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);
@@ -7939,6 +7995,9 @@ i.wx-U0Bx7pIR {
7939
7995
  .wx-4VuBwK2D:last-child {
7940
7996
  border-bottom: 0.1px solid rgb(56, 64, 71);
7941
7997
  }
7998
+ .wx-table-box.wx-4VuBwK2D {
7999
+ border: none;
8000
+ }
7942
8001
  @property --tw-translate-x { syntax: "*"; inherits: false; initial-value: 0; }
7943
8002
  @property --tw-translate-y { syntax: "*"; inherits: false; initial-value: 0; }
7944
8003
  @property --tw-translate-z { syntax: "*"; inherits: false; initial-value: 0; }
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ReactNode } 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[];
@@ -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,32 @@ 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
+ needsConfirmation?: boolean;
150
+ }
151
+ interface GridSelectionProps {
152
+ selectionEnabled?: boolean;
153
+ selectedIds?: RowId[];
154
+ onRowSelectionChange?: (id: RowId, rowData: AnyRow, checked: boolean) => void;
155
+ onSelectAllPage?: (pageData: AnyRow[], checked: boolean) => void;
156
+ }
157
+ interface GridHeaderSelectionProps {
158
+ selectedCount?: number;
159
+ selectedData?: AnyRow[];
160
+ selectionActions?: SelectionAction[];
161
+ onSelectionAction?: (actionId: string, selectedData: AnyRow[]) => void;
162
+ onClearSelection?: () => void;
163
+ }
164
+
165
+ declare const Grid: react.ForwardRefExoticComponent<GridProps & GridSelectionProps & GridHeaderSelectionProps & react.RefAttributes<IApi | null>>;
135
166
 
136
167
  type Props = {
137
168
  cell: {
@@ -142,7 +173,7 @@ type Props = {
142
173
  sortOrder?: SortOrder | null;
143
174
  onSortChange?: (key: string, order: SortOrder) => void;
144
175
  };
145
- declare function SortableHeaderCell({ cell, sortKey, sortOrder, onSortChange }: Props): react.JSX.Element;
176
+ declare const _default: react__default.MemoExoticComponent<({ cell, sortKey, sortOrder, onSortChange }: Props) => react__default.JSX.Element>;
146
177
 
147
178
  type Pagination$1 = {
148
179
  totalCount: number;
@@ -176,4 +207,4 @@ interface SlideToolbarProps {
176
207
 
177
208
  declare const SlideToolbar: React.FC<SlideToolbarProps>;
178
209
 
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 };
210
+ 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, _default as SortableHeaderCell, type ToolbarItem, type UserData };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ReactNode } 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[];
@@ -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,32 @@ 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
+ needsConfirmation?: boolean;
150
+ }
151
+ interface GridSelectionProps {
152
+ selectionEnabled?: boolean;
153
+ selectedIds?: RowId[];
154
+ onRowSelectionChange?: (id: RowId, rowData: AnyRow, checked: boolean) => void;
155
+ onSelectAllPage?: (pageData: AnyRow[], checked: boolean) => void;
156
+ }
157
+ interface GridHeaderSelectionProps {
158
+ selectedCount?: number;
159
+ selectedData?: AnyRow[];
160
+ selectionActions?: SelectionAction[];
161
+ onSelectionAction?: (actionId: string, selectedData: AnyRow[]) => void;
162
+ onClearSelection?: () => void;
163
+ }
164
+
165
+ declare const Grid: react.ForwardRefExoticComponent<GridProps & GridSelectionProps & GridHeaderSelectionProps & react.RefAttributes<IApi | null>>;
135
166
 
136
167
  type Props = {
137
168
  cell: {
@@ -142,7 +173,7 @@ type Props = {
142
173
  sortOrder?: SortOrder | null;
143
174
  onSortChange?: (key: string, order: SortOrder) => void;
144
175
  };
145
- declare function SortableHeaderCell({ cell, sortKey, sortOrder, onSortChange }: Props): react.JSX.Element;
176
+ declare const _default: react__default.MemoExoticComponent<({ cell, sortKey, sortOrder, onSortChange }: Props) => react__default.JSX.Element>;
146
177
 
147
178
  type Pagination$1 = {
148
179
  totalCount: number;
@@ -176,4 +207,4 @@ interface SlideToolbarProps {
176
207
 
177
208
  declare const SlideToolbar: React.FC<SlideToolbarProps>;
178
209
 
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 };
210
+ 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, _default as SortableHeaderCell, type ToolbarItem, type UserData };