@fuf-stack/pixels 0.29.3 → 0.30.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/Accordion/index.cjs +3 -3
- package/dist/Accordion/index.js +2 -2
- package/dist/Avatar/index.cjs +1 -1
- package/dist/Avatar/index.js +1 -1
- package/dist/AvatarGroup/index.cjs +3 -3
- package/dist/AvatarGroup/index.js +2 -2
- package/dist/Badge/index.cjs +1 -1
- package/dist/Badge/index.js +1 -1
- package/dist/Breadcrumb/index.cjs +3 -3
- package/dist/Breadcrumb/index.js +2 -2
- package/dist/Button/index.cjs +1 -1
- package/dist/Button/index.js +1 -1
- package/dist/Card/index.cjs +3 -3
- package/dist/Card/index.js +2 -2
- package/dist/Json/index.cjs +3 -3
- package/dist/Json/index.d.cts +3 -2
- package/dist/Json/index.d.ts +3 -2
- package/dist/Json/index.js +2 -2
- package/dist/Json-DZue23GO.d.cts +24 -0
- package/dist/Json-DZue23GO.d.ts +24 -0
- package/dist/Label/index.cjs +1 -1
- package/dist/Label/index.js +1 -1
- package/dist/Menu/index.cjs +3 -3
- package/dist/Menu/index.js +2 -2
- package/dist/Modal/index.cjs +1 -1
- package/dist/Modal/index.js +1 -1
- package/dist/Popover/index.cjs +3 -3
- package/dist/Popover/index.js +2 -2
- package/dist/ScrollShadow/index.cjs +1 -1
- package/dist/ScrollShadow/index.js +1 -1
- package/dist/Table/index.cjs +112 -0
- package/dist/Table/index.cjs.map +1 -0
- package/dist/Table/index.d.cts +244 -0
- package/dist/Table/index.d.ts +244 -0
- package/dist/Table/index.js +112 -0
- package/dist/Table/index.js.map +1 -0
- package/dist/Tabs/index.cjs +1 -1
- package/dist/Tabs/index.js +1 -1
- package/dist/Tooltip/index.cjs +1 -1
- package/dist/Tooltip/index.js +1 -1
- package/dist/{chunk-37C63OKM.cjs → chunk-2WDAJ6ER.cjs} +9 -5
- package/dist/chunk-2WDAJ6ER.cjs.map +1 -0
- package/dist/{chunk-EIOL2HNA.js → chunk-33DBA7U2.js} +8 -5
- package/dist/{chunk-EIOL2HNA.js.map → chunk-33DBA7U2.js.map} +1 -1
- package/dist/{chunk-JDLU5AUA.js → chunk-3QI2ODV2.js} +9 -5
- package/dist/{chunk-JDLU5AUA.js.map → chunk-3QI2ODV2.js.map} +1 -1
- package/dist/{chunk-L2RCVUXK.js → chunk-7LABJBKF.js} +2 -2
- package/dist/{chunk-L2RCVUXK.js.map → chunk-7LABJBKF.js.map} +1 -1
- package/dist/{chunk-OP6ST4KB.cjs → chunk-7XJHVFT3.cjs} +16 -14
- package/dist/chunk-7XJHVFT3.cjs.map +1 -0
- package/dist/{chunk-JPALSO5E.cjs → chunk-AVYWDZ7X.cjs} +8 -4
- package/dist/chunk-AVYWDZ7X.cjs.map +1 -0
- package/dist/{chunk-APEDJG3R.js → chunk-CZJKT7IC.js} +7 -3
- package/dist/{chunk-APEDJG3R.js.map → chunk-CZJKT7IC.js.map} +1 -1
- package/dist/chunk-D4TLDLEX.cjs +63 -0
- package/dist/chunk-D4TLDLEX.cjs.map +1 -0
- package/dist/{chunk-5WRI5ZAA.js → chunk-J7N2552D.js} +33 -1
- package/dist/{chunk-C2BIHVLT.js → chunk-LCSYN3DI.js} +180 -96
- package/dist/chunk-LCSYN3DI.js.map +1 -0
- package/dist/{chunk-RMLPCTDU.js → chunk-LPCCBJ2T.js} +8 -5
- package/dist/{chunk-RMLPCTDU.js.map → chunk-LPCCBJ2T.js.map} +1 -1
- package/dist/{chunk-5HEZFVFG.cjs → chunk-LY45VQ2E.cjs} +3 -3
- package/dist/chunk-LY45VQ2E.cjs.map +1 -0
- package/dist/{chunk-RJAVAHBK.cjs → chunk-NVNT4PMS.cjs} +9 -6
- package/dist/chunk-NVNT4PMS.cjs.map +1 -0
- package/dist/{chunk-XFUHF75Z.cjs → chunk-OLKLIWBE.cjs} +213 -129
- package/dist/chunk-OLKLIWBE.cjs.map +1 -0
- package/dist/{chunk-337S7HUF.js → chunk-XVCKJE3P.js} +14 -12
- package/dist/{chunk-337S7HUF.js.map → chunk-XVCKJE3P.js.map} +1 -1
- package/dist/{chunk-VHEIRVBB.cjs → chunk-ZXGEK67F.cjs} +9 -6
- package/dist/chunk-ZXGEK67F.cjs.map +1 -0
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/index.cjs +15 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -17
- package/package.json +26 -20
- package/dist/Json-BbMeuEvE.d.cts +0 -18
- package/dist/Json-BbMeuEvE.d.ts +0 -18
- package/dist/chunk-37C63OKM.cjs.map +0 -1
- package/dist/chunk-5HEZFVFG.cjs.map +0 -1
- package/dist/chunk-C2BIHVLT.js.map +0 -1
- package/dist/chunk-DZUJEN5N.cjs +0 -31
- package/dist/chunk-DZUJEN5N.cjs.map +0 -1
- package/dist/chunk-JPALSO5E.cjs.map +0 -1
- package/dist/chunk-OP6ST4KB.cjs.map +0 -1
- package/dist/chunk-RJAVAHBK.cjs.map +0 -1
- package/dist/chunk-VHEIRVBB.cjs.map +0 -1
- package/dist/chunk-XFUHF75Z.cjs.map +0 -1
- /package/dist/{chunk-5WRI5ZAA.js.map → chunk-J7N2552D.js.map} +0 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
4
|
+
import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
|
|
7
|
+
declare const tableVariants: tailwind_variants.TVReturnType<{
|
|
8
|
+
separation: {
|
|
9
|
+
divider: {
|
|
10
|
+
tr: string;
|
|
11
|
+
};
|
|
12
|
+
'divider-x': {
|
|
13
|
+
tr: string;
|
|
14
|
+
};
|
|
15
|
+
'divider-y': {
|
|
16
|
+
tr: string;
|
|
17
|
+
};
|
|
18
|
+
'striped-divider-x': {
|
|
19
|
+
tr: string;
|
|
20
|
+
th: string;
|
|
21
|
+
td: string;
|
|
22
|
+
};
|
|
23
|
+
striped: {
|
|
24
|
+
tr: string;
|
|
25
|
+
td: string;
|
|
26
|
+
};
|
|
27
|
+
none: {};
|
|
28
|
+
};
|
|
29
|
+
}, {
|
|
30
|
+
base: string;
|
|
31
|
+
wrapper: string;
|
|
32
|
+
table: string;
|
|
33
|
+
thead: string;
|
|
34
|
+
tbody: string;
|
|
35
|
+
tr: string;
|
|
36
|
+
th: string;
|
|
37
|
+
td: string;
|
|
38
|
+
tfoot: string;
|
|
39
|
+
sortIcon: string;
|
|
40
|
+
emptyWrapper: string;
|
|
41
|
+
loadingWrapper: string;
|
|
42
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<{
|
|
43
|
+
separation: {
|
|
44
|
+
divider: {
|
|
45
|
+
tr: string;
|
|
46
|
+
};
|
|
47
|
+
'divider-x': {
|
|
48
|
+
tr: string;
|
|
49
|
+
};
|
|
50
|
+
'divider-y': {
|
|
51
|
+
tr: string;
|
|
52
|
+
};
|
|
53
|
+
'striped-divider-x': {
|
|
54
|
+
tr: string;
|
|
55
|
+
th: string;
|
|
56
|
+
td: string;
|
|
57
|
+
};
|
|
58
|
+
striped: {
|
|
59
|
+
tr: string;
|
|
60
|
+
td: string;
|
|
61
|
+
};
|
|
62
|
+
none: {};
|
|
63
|
+
};
|
|
64
|
+
}, {
|
|
65
|
+
separation: {
|
|
66
|
+
divider: {
|
|
67
|
+
tr: string;
|
|
68
|
+
};
|
|
69
|
+
'divider-x': {
|
|
70
|
+
tr: string;
|
|
71
|
+
};
|
|
72
|
+
'divider-y': {
|
|
73
|
+
tr: string;
|
|
74
|
+
};
|
|
75
|
+
'striped-divider-x': {
|
|
76
|
+
tr: string;
|
|
77
|
+
th: string;
|
|
78
|
+
td: string;
|
|
79
|
+
};
|
|
80
|
+
striped: {
|
|
81
|
+
tr: string;
|
|
82
|
+
td: string;
|
|
83
|
+
};
|
|
84
|
+
none: {};
|
|
85
|
+
};
|
|
86
|
+
}>, {
|
|
87
|
+
separation: {
|
|
88
|
+
divider: {
|
|
89
|
+
tr: string;
|
|
90
|
+
};
|
|
91
|
+
'divider-x': {
|
|
92
|
+
tr: string;
|
|
93
|
+
};
|
|
94
|
+
'divider-y': {
|
|
95
|
+
tr: string;
|
|
96
|
+
};
|
|
97
|
+
'striped-divider-x': {
|
|
98
|
+
tr: string;
|
|
99
|
+
th: string;
|
|
100
|
+
td: string;
|
|
101
|
+
};
|
|
102
|
+
striped: {
|
|
103
|
+
tr: string;
|
|
104
|
+
td: string;
|
|
105
|
+
};
|
|
106
|
+
none: {};
|
|
107
|
+
};
|
|
108
|
+
}, {
|
|
109
|
+
base: string;
|
|
110
|
+
wrapper: string;
|
|
111
|
+
table: string;
|
|
112
|
+
thead: string;
|
|
113
|
+
tbody: string;
|
|
114
|
+
tr: string;
|
|
115
|
+
th: string;
|
|
116
|
+
td: string;
|
|
117
|
+
tfoot: string;
|
|
118
|
+
sortIcon: string;
|
|
119
|
+
emptyWrapper: string;
|
|
120
|
+
loadingWrapper: string;
|
|
121
|
+
}, tailwind_variants.TVReturnType<{
|
|
122
|
+
separation: {
|
|
123
|
+
divider: {
|
|
124
|
+
tr: string;
|
|
125
|
+
};
|
|
126
|
+
'divider-x': {
|
|
127
|
+
tr: string;
|
|
128
|
+
};
|
|
129
|
+
'divider-y': {
|
|
130
|
+
tr: string;
|
|
131
|
+
};
|
|
132
|
+
'striped-divider-x': {
|
|
133
|
+
tr: string;
|
|
134
|
+
th: string;
|
|
135
|
+
td: string;
|
|
136
|
+
};
|
|
137
|
+
striped: {
|
|
138
|
+
tr: string;
|
|
139
|
+
td: string;
|
|
140
|
+
};
|
|
141
|
+
none: {};
|
|
142
|
+
};
|
|
143
|
+
}, {
|
|
144
|
+
base: string;
|
|
145
|
+
wrapper: string;
|
|
146
|
+
table: string;
|
|
147
|
+
thead: string;
|
|
148
|
+
tbody: string;
|
|
149
|
+
tr: string;
|
|
150
|
+
th: string;
|
|
151
|
+
td: string;
|
|
152
|
+
tfoot: string;
|
|
153
|
+
sortIcon: string;
|
|
154
|
+
emptyWrapper: string;
|
|
155
|
+
loadingWrapper: string;
|
|
156
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<{
|
|
157
|
+
separation: {
|
|
158
|
+
divider: {
|
|
159
|
+
tr: string;
|
|
160
|
+
};
|
|
161
|
+
'divider-x': {
|
|
162
|
+
tr: string;
|
|
163
|
+
};
|
|
164
|
+
'divider-y': {
|
|
165
|
+
tr: string;
|
|
166
|
+
};
|
|
167
|
+
'striped-divider-x': {
|
|
168
|
+
tr: string;
|
|
169
|
+
th: string;
|
|
170
|
+
td: string;
|
|
171
|
+
};
|
|
172
|
+
striped: {
|
|
173
|
+
tr: string;
|
|
174
|
+
td: string;
|
|
175
|
+
};
|
|
176
|
+
none: {};
|
|
177
|
+
};
|
|
178
|
+
}, {
|
|
179
|
+
separation: {
|
|
180
|
+
divider: {
|
|
181
|
+
tr: string;
|
|
182
|
+
};
|
|
183
|
+
'divider-x': {
|
|
184
|
+
tr: string;
|
|
185
|
+
};
|
|
186
|
+
'divider-y': {
|
|
187
|
+
tr: string;
|
|
188
|
+
};
|
|
189
|
+
'striped-divider-x': {
|
|
190
|
+
tr: string;
|
|
191
|
+
th: string;
|
|
192
|
+
td: string;
|
|
193
|
+
};
|
|
194
|
+
striped: {
|
|
195
|
+
tr: string;
|
|
196
|
+
td: string;
|
|
197
|
+
};
|
|
198
|
+
none: {};
|
|
199
|
+
};
|
|
200
|
+
}>, unknown, unknown, undefined>>;
|
|
201
|
+
type VariantProps = TVProps<typeof tableVariants>;
|
|
202
|
+
type ClassName = TVClassName<typeof tableVariants>;
|
|
203
|
+
interface TableColumnProps {
|
|
204
|
+
key: string;
|
|
205
|
+
label: ReactNode;
|
|
206
|
+
}
|
|
207
|
+
interface TableRowProps {
|
|
208
|
+
key: string | number;
|
|
209
|
+
[key: string | number]: ReactNode;
|
|
210
|
+
}
|
|
211
|
+
interface TableProps extends VariantProps {
|
|
212
|
+
/** Aria label for the Table. */
|
|
213
|
+
ariaLabel?: string;
|
|
214
|
+
/** Component to display at the bottom of the Table. */
|
|
215
|
+
bottomContent?: ReactNode;
|
|
216
|
+
/** CSS class name */
|
|
217
|
+
className?: ClassName;
|
|
218
|
+
/** Objects with table data */
|
|
219
|
+
columns: TableColumnProps[];
|
|
220
|
+
/** Component to display if there are no rows! */
|
|
221
|
+
emptyContent?: ReactNode;
|
|
222
|
+
/** Determine if the Table should have a card like wrapper. */
|
|
223
|
+
hasWrapper?: boolean;
|
|
224
|
+
/** remove header */
|
|
225
|
+
hideHeader?: boolean;
|
|
226
|
+
/** Tells the Table to show the loading component. */
|
|
227
|
+
loading?: boolean;
|
|
228
|
+
/** Loading animation component. */
|
|
229
|
+
loadingContent?: ReactNode;
|
|
230
|
+
/** Items displayed as rows in the Table. Should have key-value pair for each column. */
|
|
231
|
+
rows?: TableRowProps[];
|
|
232
|
+
/** Separation style for the rows & columns. */
|
|
233
|
+
separation?: 'none' | 'striped' | 'striped-divider-x' | 'divider-x' | 'divider-y' | 'divider';
|
|
234
|
+
/** Keeps the header of the Table in view while scrolling a height limited Table. */
|
|
235
|
+
stickyHeader?: boolean;
|
|
236
|
+
/** HTML data-testid attribute used in e2e tests */
|
|
237
|
+
testId?: string;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Table component based on [NextUI Table](https://nextui.org/docs/components/table)
|
|
241
|
+
*/
|
|
242
|
+
declare const Table: ({ ariaLabel, bottomContent, className, columns, emptyContent, hasWrapper, hideHeader, loading, loadingContent, rows, separation, stickyHeader, testId, }: TableProps) => react_jsx_runtime.JSX.Element;
|
|
243
|
+
|
|
244
|
+
export { Table as default };
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
+
import * as tailwind_variants_dist_config_js from 'tailwind-variants/dist/config.js';
|
|
4
|
+
import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
|
|
7
|
+
declare const tableVariants: tailwind_variants.TVReturnType<{
|
|
8
|
+
separation: {
|
|
9
|
+
divider: {
|
|
10
|
+
tr: string;
|
|
11
|
+
};
|
|
12
|
+
'divider-x': {
|
|
13
|
+
tr: string;
|
|
14
|
+
};
|
|
15
|
+
'divider-y': {
|
|
16
|
+
tr: string;
|
|
17
|
+
};
|
|
18
|
+
'striped-divider-x': {
|
|
19
|
+
tr: string;
|
|
20
|
+
th: string;
|
|
21
|
+
td: string;
|
|
22
|
+
};
|
|
23
|
+
striped: {
|
|
24
|
+
tr: string;
|
|
25
|
+
td: string;
|
|
26
|
+
};
|
|
27
|
+
none: {};
|
|
28
|
+
};
|
|
29
|
+
}, {
|
|
30
|
+
base: string;
|
|
31
|
+
wrapper: string;
|
|
32
|
+
table: string;
|
|
33
|
+
thead: string;
|
|
34
|
+
tbody: string;
|
|
35
|
+
tr: string;
|
|
36
|
+
th: string;
|
|
37
|
+
td: string;
|
|
38
|
+
tfoot: string;
|
|
39
|
+
sortIcon: string;
|
|
40
|
+
emptyWrapper: string;
|
|
41
|
+
loadingWrapper: string;
|
|
42
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<{
|
|
43
|
+
separation: {
|
|
44
|
+
divider: {
|
|
45
|
+
tr: string;
|
|
46
|
+
};
|
|
47
|
+
'divider-x': {
|
|
48
|
+
tr: string;
|
|
49
|
+
};
|
|
50
|
+
'divider-y': {
|
|
51
|
+
tr: string;
|
|
52
|
+
};
|
|
53
|
+
'striped-divider-x': {
|
|
54
|
+
tr: string;
|
|
55
|
+
th: string;
|
|
56
|
+
td: string;
|
|
57
|
+
};
|
|
58
|
+
striped: {
|
|
59
|
+
tr: string;
|
|
60
|
+
td: string;
|
|
61
|
+
};
|
|
62
|
+
none: {};
|
|
63
|
+
};
|
|
64
|
+
}, {
|
|
65
|
+
separation: {
|
|
66
|
+
divider: {
|
|
67
|
+
tr: string;
|
|
68
|
+
};
|
|
69
|
+
'divider-x': {
|
|
70
|
+
tr: string;
|
|
71
|
+
};
|
|
72
|
+
'divider-y': {
|
|
73
|
+
tr: string;
|
|
74
|
+
};
|
|
75
|
+
'striped-divider-x': {
|
|
76
|
+
tr: string;
|
|
77
|
+
th: string;
|
|
78
|
+
td: string;
|
|
79
|
+
};
|
|
80
|
+
striped: {
|
|
81
|
+
tr: string;
|
|
82
|
+
td: string;
|
|
83
|
+
};
|
|
84
|
+
none: {};
|
|
85
|
+
};
|
|
86
|
+
}>, {
|
|
87
|
+
separation: {
|
|
88
|
+
divider: {
|
|
89
|
+
tr: string;
|
|
90
|
+
};
|
|
91
|
+
'divider-x': {
|
|
92
|
+
tr: string;
|
|
93
|
+
};
|
|
94
|
+
'divider-y': {
|
|
95
|
+
tr: string;
|
|
96
|
+
};
|
|
97
|
+
'striped-divider-x': {
|
|
98
|
+
tr: string;
|
|
99
|
+
th: string;
|
|
100
|
+
td: string;
|
|
101
|
+
};
|
|
102
|
+
striped: {
|
|
103
|
+
tr: string;
|
|
104
|
+
td: string;
|
|
105
|
+
};
|
|
106
|
+
none: {};
|
|
107
|
+
};
|
|
108
|
+
}, {
|
|
109
|
+
base: string;
|
|
110
|
+
wrapper: string;
|
|
111
|
+
table: string;
|
|
112
|
+
thead: string;
|
|
113
|
+
tbody: string;
|
|
114
|
+
tr: string;
|
|
115
|
+
th: string;
|
|
116
|
+
td: string;
|
|
117
|
+
tfoot: string;
|
|
118
|
+
sortIcon: string;
|
|
119
|
+
emptyWrapper: string;
|
|
120
|
+
loadingWrapper: string;
|
|
121
|
+
}, tailwind_variants.TVReturnType<{
|
|
122
|
+
separation: {
|
|
123
|
+
divider: {
|
|
124
|
+
tr: string;
|
|
125
|
+
};
|
|
126
|
+
'divider-x': {
|
|
127
|
+
tr: string;
|
|
128
|
+
};
|
|
129
|
+
'divider-y': {
|
|
130
|
+
tr: string;
|
|
131
|
+
};
|
|
132
|
+
'striped-divider-x': {
|
|
133
|
+
tr: string;
|
|
134
|
+
th: string;
|
|
135
|
+
td: string;
|
|
136
|
+
};
|
|
137
|
+
striped: {
|
|
138
|
+
tr: string;
|
|
139
|
+
td: string;
|
|
140
|
+
};
|
|
141
|
+
none: {};
|
|
142
|
+
};
|
|
143
|
+
}, {
|
|
144
|
+
base: string;
|
|
145
|
+
wrapper: string;
|
|
146
|
+
table: string;
|
|
147
|
+
thead: string;
|
|
148
|
+
tbody: string;
|
|
149
|
+
tr: string;
|
|
150
|
+
th: string;
|
|
151
|
+
td: string;
|
|
152
|
+
tfoot: string;
|
|
153
|
+
sortIcon: string;
|
|
154
|
+
emptyWrapper: string;
|
|
155
|
+
loadingWrapper: string;
|
|
156
|
+
}, undefined, tailwind_variants_dist_config_js.TVConfig<{
|
|
157
|
+
separation: {
|
|
158
|
+
divider: {
|
|
159
|
+
tr: string;
|
|
160
|
+
};
|
|
161
|
+
'divider-x': {
|
|
162
|
+
tr: string;
|
|
163
|
+
};
|
|
164
|
+
'divider-y': {
|
|
165
|
+
tr: string;
|
|
166
|
+
};
|
|
167
|
+
'striped-divider-x': {
|
|
168
|
+
tr: string;
|
|
169
|
+
th: string;
|
|
170
|
+
td: string;
|
|
171
|
+
};
|
|
172
|
+
striped: {
|
|
173
|
+
tr: string;
|
|
174
|
+
td: string;
|
|
175
|
+
};
|
|
176
|
+
none: {};
|
|
177
|
+
};
|
|
178
|
+
}, {
|
|
179
|
+
separation: {
|
|
180
|
+
divider: {
|
|
181
|
+
tr: string;
|
|
182
|
+
};
|
|
183
|
+
'divider-x': {
|
|
184
|
+
tr: string;
|
|
185
|
+
};
|
|
186
|
+
'divider-y': {
|
|
187
|
+
tr: string;
|
|
188
|
+
};
|
|
189
|
+
'striped-divider-x': {
|
|
190
|
+
tr: string;
|
|
191
|
+
th: string;
|
|
192
|
+
td: string;
|
|
193
|
+
};
|
|
194
|
+
striped: {
|
|
195
|
+
tr: string;
|
|
196
|
+
td: string;
|
|
197
|
+
};
|
|
198
|
+
none: {};
|
|
199
|
+
};
|
|
200
|
+
}>, unknown, unknown, undefined>>;
|
|
201
|
+
type VariantProps = TVProps<typeof tableVariants>;
|
|
202
|
+
type ClassName = TVClassName<typeof tableVariants>;
|
|
203
|
+
interface TableColumnProps {
|
|
204
|
+
key: string;
|
|
205
|
+
label: ReactNode;
|
|
206
|
+
}
|
|
207
|
+
interface TableRowProps {
|
|
208
|
+
key: string | number;
|
|
209
|
+
[key: string | number]: ReactNode;
|
|
210
|
+
}
|
|
211
|
+
interface TableProps extends VariantProps {
|
|
212
|
+
/** Aria label for the Table. */
|
|
213
|
+
ariaLabel?: string;
|
|
214
|
+
/** Component to display at the bottom of the Table. */
|
|
215
|
+
bottomContent?: ReactNode;
|
|
216
|
+
/** CSS class name */
|
|
217
|
+
className?: ClassName;
|
|
218
|
+
/** Objects with table data */
|
|
219
|
+
columns: TableColumnProps[];
|
|
220
|
+
/** Component to display if there are no rows! */
|
|
221
|
+
emptyContent?: ReactNode;
|
|
222
|
+
/** Determine if the Table should have a card like wrapper. */
|
|
223
|
+
hasWrapper?: boolean;
|
|
224
|
+
/** remove header */
|
|
225
|
+
hideHeader?: boolean;
|
|
226
|
+
/** Tells the Table to show the loading component. */
|
|
227
|
+
loading?: boolean;
|
|
228
|
+
/** Loading animation component. */
|
|
229
|
+
loadingContent?: ReactNode;
|
|
230
|
+
/** Items displayed as rows in the Table. Should have key-value pair for each column. */
|
|
231
|
+
rows?: TableRowProps[];
|
|
232
|
+
/** Separation style for the rows & columns. */
|
|
233
|
+
separation?: 'none' | 'striped' | 'striped-divider-x' | 'divider-x' | 'divider-y' | 'divider';
|
|
234
|
+
/** Keeps the header of the Table in view while scrolling a height limited Table. */
|
|
235
|
+
stickyHeader?: boolean;
|
|
236
|
+
/** HTML data-testid attribute used in e2e tests */
|
|
237
|
+
testId?: string;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Table component based on [NextUI Table](https://nextui.org/docs/components/table)
|
|
241
|
+
*/
|
|
242
|
+
declare const Table: ({ ariaLabel, bottomContent, className, columns, emptyContent, hasWrapper, hideHeader, loading, loadingContent, rows, separation, stickyHeader, testId, }: TableProps) => react_jsx_runtime.JSX.Element;
|
|
243
|
+
|
|
244
|
+
export { Table as default };
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import "../chunk-J7N2552D.js";
|
|
2
|
+
|
|
3
|
+
// src/Table/Table.tsx
|
|
4
|
+
import {
|
|
5
|
+
getKeyValue,
|
|
6
|
+
Table as NextTable,
|
|
7
|
+
TableBody,
|
|
8
|
+
TableCell,
|
|
9
|
+
TableColumn,
|
|
10
|
+
TableHeader,
|
|
11
|
+
TableRow
|
|
12
|
+
} from "@nextui-org/table";
|
|
13
|
+
import { tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
14
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
|
+
var tableVariants = tv({
|
|
16
|
+
slots: {
|
|
17
|
+
base: "",
|
|
18
|
+
wrapper: "",
|
|
19
|
+
table: "",
|
|
20
|
+
thead: "",
|
|
21
|
+
tbody: "",
|
|
22
|
+
tr: "",
|
|
23
|
+
th: "bg-content2",
|
|
24
|
+
td: "",
|
|
25
|
+
tfoot: "",
|
|
26
|
+
sortIcon: "",
|
|
27
|
+
emptyWrapper: "",
|
|
28
|
+
loadingWrapper: ""
|
|
29
|
+
},
|
|
30
|
+
variants: {
|
|
31
|
+
separation: {
|
|
32
|
+
divider: {
|
|
33
|
+
tr: 'divide-x rounded-lg border-b data-[last=true]:border-none [&:first-child:not([data-first="true"])]:border-none'
|
|
34
|
+
},
|
|
35
|
+
"divider-x": {
|
|
36
|
+
tr: "divide-x"
|
|
37
|
+
},
|
|
38
|
+
"divider-y": {
|
|
39
|
+
tr: 'rounded-lg border-b data-[last=true]:border-none [&:first-child:not([data-first="true"])]:border-none'
|
|
40
|
+
},
|
|
41
|
+
"striped-divider-x": {
|
|
42
|
+
tr: "divide-x",
|
|
43
|
+
th: "border-divider",
|
|
44
|
+
td: "border-divider first:rounded-s-lg last:rounded-e-lg group-data-[odd=true]:bg-content2"
|
|
45
|
+
},
|
|
46
|
+
striped: {
|
|
47
|
+
tr: "",
|
|
48
|
+
td: "first:rounded-s-lg last:rounded-e-lg group-data-[odd=true]:bg-content2"
|
|
49
|
+
},
|
|
50
|
+
none: {}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
var Table = ({
|
|
55
|
+
ariaLabel = void 0,
|
|
56
|
+
bottomContent = void 0,
|
|
57
|
+
className = void 0,
|
|
58
|
+
columns,
|
|
59
|
+
emptyContent = "No rows to display.",
|
|
60
|
+
hasWrapper = false,
|
|
61
|
+
hideHeader = false,
|
|
62
|
+
loading = false,
|
|
63
|
+
loadingContent = void 0,
|
|
64
|
+
rows = [],
|
|
65
|
+
separation = "none",
|
|
66
|
+
stickyHeader = false,
|
|
67
|
+
testId = void 0
|
|
68
|
+
}) => {
|
|
69
|
+
const variants = tableVariants({ separation });
|
|
70
|
+
const classNames = variantsToClassNames(variants, className, "base");
|
|
71
|
+
return /* @__PURE__ */ jsxs(
|
|
72
|
+
NextTable,
|
|
73
|
+
{
|
|
74
|
+
"aria-label": ariaLabel,
|
|
75
|
+
bottomContent,
|
|
76
|
+
classNames,
|
|
77
|
+
"data-testid": testId,
|
|
78
|
+
hideHeader,
|
|
79
|
+
isHeaderSticky: stickyHeader,
|
|
80
|
+
isStriped: separation === "striped" || separation === "striped-divider-x",
|
|
81
|
+
removeWrapper: !hasWrapper,
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ jsx(TableHeader, { columns, children: (column) => /* @__PURE__ */ jsx(TableColumn, { children: column.label }, column.key) }),
|
|
84
|
+
/* @__PURE__ */ jsx(
|
|
85
|
+
TableBody,
|
|
86
|
+
{
|
|
87
|
+
isLoading: loading,
|
|
88
|
+
loadingContent: loadingContent || "...",
|
|
89
|
+
emptyContent,
|
|
90
|
+
items: rows,
|
|
91
|
+
children: (item) => /* @__PURE__ */ jsx(
|
|
92
|
+
TableRow,
|
|
93
|
+
{
|
|
94
|
+
"data-testid": testId && ((item == null ? void 0 : item.testId) || (item == null ? void 0 : item.key)) && `${testId || "table"}_item_${JSON.stringify(item.testId || item.key)}`,
|
|
95
|
+
children: (columnKey) => /* @__PURE__ */ jsx(TableCell, { children: getKeyValue(item, columnKey) })
|
|
96
|
+
},
|
|
97
|
+
item.key
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
};
|
|
105
|
+
var Table_default = Table;
|
|
106
|
+
|
|
107
|
+
// src/Table/index.ts
|
|
108
|
+
var Table_default2 = Table_default;
|
|
109
|
+
export {
|
|
110
|
+
Table_default2 as default
|
|
111
|
+
};
|
|
112
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Table/Table.tsx","../../src/Table/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport {\n getKeyValue,\n Table as NextTable,\n TableBody,\n TableCell,\n TableColumn,\n TableHeader,\n TableRow,\n} from '@nextui-org/table';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\n// import { slugify } from '../helpers';\n\n// table styling variants\nexport const tableVariants = tv({\n slots: {\n base: '',\n wrapper: '',\n table: '',\n thead: '',\n tbody: '',\n tr: '',\n th: 'bg-content2',\n td: '',\n tfoot: '',\n sortIcon: '',\n emptyWrapper: '',\n loadingWrapper: '',\n },\n variants: {\n separation: {\n divider: {\n tr: 'divide-x rounded-lg border-b data-[last=true]:border-none [&:first-child:not([data-first=\"true\"])]:border-none',\n },\n 'divider-x': {\n tr: 'divide-x',\n },\n 'divider-y': {\n tr: 'rounded-lg border-b data-[last=true]:border-none [&:first-child:not([data-first=\"true\"])]:border-none',\n },\n 'striped-divider-x': {\n tr: 'divide-x',\n th: 'border-divider',\n td: 'border-divider first:rounded-s-lg last:rounded-e-lg group-data-[odd=true]:bg-content2',\n },\n striped: {\n tr: '',\n td: 'first:rounded-s-lg last:rounded-e-lg group-data-[odd=true]:bg-content2',\n },\n none: {},\n },\n },\n});\n\ntype VariantProps = TVProps<typeof tableVariants>;\ntype ClassName = TVClassName<typeof tableVariants>;\n\nexport interface TableColumnProps {\n key: string;\n label: ReactNode;\n}\n\ninterface TableRowProps {\n key: string | number;\n [key: string | number]: ReactNode;\n}\n\nexport interface TableProps extends VariantProps {\n /** Aria label for the Table. */\n ariaLabel?: string;\n /** Component to display at the bottom of the Table. */\n bottomContent?: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Objects with table data */\n columns: TableColumnProps[];\n /** Component to display if there are no rows! */\n emptyContent?: ReactNode;\n /** Determine if the Table should have a card like wrapper. */\n hasWrapper?: boolean;\n /** remove header */\n hideHeader?: boolean;\n /** Tells the Table to show the loading component. */\n loading?: boolean;\n /** Loading animation component. */\n loadingContent?: ReactNode;\n /** Items displayed as rows in the Table. Should have key-value pair for each column. */\n rows?: TableRowProps[];\n /** Separation style for the rows & columns. */\n separation?:\n | 'none'\n | 'striped'\n | 'striped-divider-x'\n | 'divider-x'\n | 'divider-y'\n | 'divider';\n /** Keeps the header of the Table in view while scrolling a height limited Table. */\n stickyHeader?: boolean;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * Table component based on [NextUI Table](https://nextui.org/docs/components/table)\n */\nconst Table = ({\n ariaLabel = undefined,\n bottomContent = undefined,\n className = undefined,\n columns,\n emptyContent = 'No rows to display.',\n hasWrapper = false,\n hideHeader = false,\n loading = false,\n loadingContent = undefined,\n rows = [],\n separation = 'none',\n stickyHeader = false,\n testId = undefined,\n}: TableProps) => {\n const variants = tableVariants({ separation });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n return (\n <NextTable\n aria-label={ariaLabel}\n bottomContent={bottomContent}\n classNames={classNames}\n data-testid={testId} // TODO: should we use slugify here? && slugify(testId)\n hideHeader={hideHeader}\n isHeaderSticky={stickyHeader}\n isStriped={separation === 'striped' || separation === 'striped-divider-x'}\n removeWrapper={!hasWrapper}\n >\n <TableHeader columns={columns}>\n {(column: TableColumnProps) => (\n <TableColumn key={column.key}>{column.label}</TableColumn>\n )}\n </TableHeader>\n <TableBody\n isLoading={loading}\n loadingContent={loadingContent || '...'} // TODO: use future spinner/loading component\n emptyContent={emptyContent}\n items={rows}\n >\n {(item: TableRowProps) => (\n <TableRow\n key={item.key}\n data-testid={\n testId &&\n (item?.testId || item?.key) &&\n `${testId || 'table'}_item_${JSON.stringify(item.testId || item.key)}`\n }\n // TODO: sluggify? data-testid={`${slugify(testId || 'table')}_item_${slugify(JSON.stringify(item.testId || item.key))}`}\n >\n {(columnKey) => (\n <TableCell>{getKeyValue(item, columnKey)}</TableCell>\n )}\n </TableRow>\n )}\n </TableBody>\n </NextTable>\n );\n};\n\nexport default Table;\n","import Table from './Table';\n\nexport default Table;\n"],"mappings":";;;AAGA;AAAA,EACE;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,IAAI,4BAA4B;AAmHrC,SAYM,KAZN;AA9GG,IAAM,gBAAgB,GAAG;AAAA,EAC9B,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,UAAU;AAAA,IACV,cAAc;AAAA,IACd,gBAAgB;AAAA,EAClB;AAAA,EACA,UAAU;AAAA,IACR,YAAY;AAAA,MACV,SAAS;AAAA,QACP,IAAI;AAAA,MACN;AAAA,MACA,aAAa;AAAA,QACX,IAAI;AAAA,MACN;AAAA,MACA,aAAa;AAAA,QACX,IAAI;AAAA,MACN;AAAA,MACA,qBAAqB;AAAA,QACnB,IAAI;AAAA,QACJ,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,MACA,SAAS;AAAA,QACP,IAAI;AAAA,QACJ,IAAI;AAAA,MACN;AAAA,MACA,MAAM,CAAC;AAAA,IACT;AAAA,EACF;AACF,CAAC;AAqDD,IAAM,QAAQ,CAAC;AAAA,EACb,YAAY;AAAA,EACZ,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ;AAAA,EACA,eAAe;AAAA,EACf,aAAa;AAAA,EACb,aAAa;AAAA,EACb,UAAU;AAAA,EACV,iBAAiB;AAAA,EACjB,OAAO,CAAC;AAAA,EACR,aAAa;AAAA,EACb,eAAe;AAAA,EACf,SAAS;AACX,MAAkB;AAChB,QAAM,WAAW,cAAc,EAAE,WAAW,CAAC;AAC7C,QAAM,aAAa,qBAAqB,UAAU,WAAW,MAAM;AAEnE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAY;AAAA,MACZ;AAAA,MACA;AAAA,MACA,eAAa;AAAA,MACb;AAAA,MACA,gBAAgB;AAAA,MAChB,WAAW,eAAe,aAAa,eAAe;AAAA,MACtD,eAAe,CAAC;AAAA,MAEhB;AAAA,4BAAC,eAAY,SACV,WAAC,WACA,oBAAC,eAA8B,iBAAO,SAApB,OAAO,GAAmB,GAEhD;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACC,WAAW;AAAA,YACX,gBAAgB,kBAAkB;AAAA,YAClC;AAAA,YACA,OAAO;AAAA,YAEN,WAAC,SACA;AAAA,cAAC;AAAA;AAAA,gBAEC,eACE,YACC,6BAAM,YAAU,6BAAM,SACvB,GAAG,UAAU,OAAO,SAAS,KAAK,UAAU,KAAK,UAAU,KAAK,GAAG,CAAC;AAAA,gBAIrE,WAAC,cACA,oBAAC,aAAW,sBAAY,MAAM,SAAS,GAAE;AAAA;AAAA,cATtC,KAAK;AAAA,YAWZ;AAAA;AAAA,QAEJ;AAAA;AAAA;AAAA,EACF;AAEJ;AAEA,IAAO,gBAAQ;;;ACvKf,IAAOA,iBAAQ;","names":["Table_default"]}
|
package/dist/Tabs/index.cjs
CHANGED
package/dist/Tabs/index.js
CHANGED
package/dist/Tooltip/index.cjs
CHANGED
package/dist/Tooltip/index.js
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
var _chunkBXPBP3PCcjs = require('./chunk-BXPBP3PC.cjs');
|
|
4
4
|
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkD4TLDLEXcjs = require('./chunk-D4TLDLEX.cjs');
|
|
8
|
+
|
|
5
9
|
// src/Popover/Popover.tsx
|
|
6
10
|
var _popover = require('@nextui-org/popover');
|
|
7
11
|
var _pixelutils = require('@fuf-stack/pixel-utils');
|
|
@@ -32,14 +36,14 @@ var Popover_default = ({
|
|
|
32
36
|
const className = _pixelutils.variantsToClassNames.call(void 0, variants, _className, "trigger");
|
|
33
37
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
34
38
|
_popover.Popover,
|
|
35
|
-
{
|
|
39
|
+
_chunkD4TLDLEXcjs.__spreadProps.call(void 0, _chunkD4TLDLEXcjs.__spreadValues.call(void 0, {
|
|
36
40
|
classNames: className,
|
|
37
41
|
placement,
|
|
38
42
|
portalContainer,
|
|
39
43
|
radius: "sm",
|
|
40
44
|
shouldBlockScroll,
|
|
41
|
-
showArrow: true
|
|
42
|
-
|
|
45
|
+
showArrow: true
|
|
46
|
+
}, openControlled ? { isOpen: openControlled.open, onOpenChange: openControlled.setOpen } : {}), {
|
|
43
47
|
children: [
|
|
44
48
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _popover.PopoverTrigger, { "data-testid": testId, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { children }) }),
|
|
45
49
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _popover.PopoverContent, { "data-testid": contentTestId, children: [
|
|
@@ -54,7 +58,7 @@ var Popover_default = ({
|
|
|
54
58
|
] })
|
|
55
59
|
] })
|
|
56
60
|
]
|
|
57
|
-
}
|
|
61
|
+
})
|
|
58
62
|
);
|
|
59
63
|
};
|
|
60
64
|
|
|
@@ -65,4 +69,4 @@ var Popover_default2 = Popover_default;
|
|
|
65
69
|
|
|
66
70
|
|
|
67
71
|
exports.Popover_default = Popover_default; exports.Popover_default2 = Popover_default2;
|
|
68
|
-
//# sourceMappingURL=chunk-
|
|
72
|
+
//# sourceMappingURL=chunk-2WDAJ6ER.cjs.map
|