@fuf-stack/pixels 0.37.1 → 0.39.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/Alert/index.cjs +2 -2
- package/dist/Alert/index.d.cts +2 -2
- package/dist/Alert/index.d.ts +2 -2
- package/dist/Alert/index.js +1 -1
- package/dist/{Alert-Bz_lJ_YE.d.cts → Alert-DELD9ZWe.d.cts} +80 -1
- package/dist/{Alert-Bz_lJ_YE.d.ts → Alert-DELD9ZWe.d.ts} +80 -1
- package/dist/Popover/index.cjs +2 -2
- package/dist/Popover/index.d.cts +4 -2
- package/dist/Popover/index.d.ts +4 -2
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-Db9vCWrz.d.cts → Popover-BHPrdRy6.d.ts} +5 -2
- package/dist/{Popover-Db9vCWrz.d.ts → Popover-BXyk9y8I.d.cts} +5 -2
- package/dist/Table/index.cjs +2 -2
- package/dist/Table/index.js +1 -1
- package/dist/{chunk-7H67WTTJ.js → chunk-5TOE75VE.js} +13 -3
- package/dist/chunk-5TOE75VE.js.map +1 -0
- package/dist/{chunk-QMYSCJEJ.js → chunk-AFGRLKHU.js} +2 -2
- package/dist/{chunk-QMYSCJEJ.js.map → chunk-AFGRLKHU.js.map} +1 -1
- package/dist/{chunk-A4MJ5V64.cjs → chunk-AJCAIA6H.cjs} +2 -2
- package/dist/chunk-AJCAIA6H.cjs.map +1 -0
- package/dist/{chunk-C4H5ZCTV.cjs → chunk-EAX5J2I2.cjs} +13 -3
- package/dist/chunk-EAX5J2I2.cjs.map +1 -0
- package/dist/{chunk-V2WKZH63.js → chunk-MG3PTEMK.js} +16 -3
- package/dist/chunk-MG3PTEMK.js.map +1 -0
- package/dist/{chunk-33S6NRVI.cjs → chunk-YVPRFCWI.cjs} +16 -3
- package/dist/chunk-YVPRFCWI.cjs.map +1 -0
- package/dist/index.cjs +170 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +282 -7
- package/dist/index.d.ts +282 -7
- package/dist/index.js +169 -4
- package/dist/index.js.map +1 -1
- package/package.json +24 -23
- package/dist/chunk-33S6NRVI.cjs.map +0 -1
- package/dist/chunk-7H67WTTJ.js.map +0 -1
- package/dist/chunk-A4MJ5V64.cjs.map +0 -1
- package/dist/chunk-C4H5ZCTV.cjs.map +0 -1
- package/dist/chunk-V2WKZH63.js.map +0 -1
package/dist/Alert/index.cjs
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkYVPRFCWIcjs = require('../chunk-YVPRFCWI.cjs');
|
|
6
6
|
require('../chunk-D4TLDLEX.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.Alert =
|
|
11
|
+
exports.Alert = _chunkYVPRFCWIcjs.Alert_default; exports.alertVariants = _chunkYVPRFCWIcjs.alertVariants; exports.default = _chunkYVPRFCWIcjs.Alert_default2;
|
|
12
12
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Alert/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Alert } from '../Alert-
|
|
2
|
-
export { b as AlertProps, a as alertVariants } from '../Alert-
|
|
1
|
+
import { A as Alert } from '../Alert-DELD9ZWe.cjs';
|
|
2
|
+
export { b as AlertProps, a as alertVariants } from '../Alert-DELD9ZWe.cjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'tailwind-variants';
|
|
5
5
|
import 'tailwind-variants/dist/config.js';
|
package/dist/Alert/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as Alert } from '../Alert-
|
|
2
|
-
export { b as AlertProps, a as alertVariants } from '../Alert-
|
|
1
|
+
import { A as Alert } from '../Alert-DELD9ZWe.js';
|
|
2
|
+
export { b as AlertProps, a as alertVariants } from '../Alert-DELD9ZWe.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'tailwind-variants';
|
|
5
5
|
import 'tailwind-variants/dist/config.js';
|
package/dist/Alert/index.js
CHANGED
|
@@ -28,6 +28,17 @@ declare const alertVariants: tailwind_variants.TVReturnType<{
|
|
|
28
28
|
base: string;
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
+
sizeLimit: {
|
|
32
|
+
height: {
|
|
33
|
+
base: string;
|
|
34
|
+
};
|
|
35
|
+
width: {
|
|
36
|
+
base: string;
|
|
37
|
+
};
|
|
38
|
+
both: {
|
|
39
|
+
base: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
31
42
|
}, {
|
|
32
43
|
base: string;
|
|
33
44
|
title: string;
|
|
@@ -60,6 +71,17 @@ declare const alertVariants: tailwind_variants.TVReturnType<{
|
|
|
60
71
|
base: string;
|
|
61
72
|
};
|
|
62
73
|
};
|
|
74
|
+
sizeLimit: {
|
|
75
|
+
height: {
|
|
76
|
+
base: string;
|
|
77
|
+
};
|
|
78
|
+
width: {
|
|
79
|
+
base: string;
|
|
80
|
+
};
|
|
81
|
+
both: {
|
|
82
|
+
base: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
63
85
|
}, {
|
|
64
86
|
color: {
|
|
65
87
|
default: {};
|
|
@@ -84,6 +106,17 @@ declare const alertVariants: tailwind_variants.TVReturnType<{
|
|
|
84
106
|
base: string;
|
|
85
107
|
};
|
|
86
108
|
};
|
|
109
|
+
sizeLimit: {
|
|
110
|
+
height: {
|
|
111
|
+
base: string;
|
|
112
|
+
};
|
|
113
|
+
width: {
|
|
114
|
+
base: string;
|
|
115
|
+
};
|
|
116
|
+
both: {
|
|
117
|
+
base: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
87
120
|
}>, {
|
|
88
121
|
color: {
|
|
89
122
|
default: {};
|
|
@@ -108,6 +141,17 @@ declare const alertVariants: tailwind_variants.TVReturnType<{
|
|
|
108
141
|
base: string;
|
|
109
142
|
};
|
|
110
143
|
};
|
|
144
|
+
sizeLimit: {
|
|
145
|
+
height: {
|
|
146
|
+
base: string;
|
|
147
|
+
};
|
|
148
|
+
width: {
|
|
149
|
+
base: string;
|
|
150
|
+
};
|
|
151
|
+
both: {
|
|
152
|
+
base: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
111
155
|
}, {
|
|
112
156
|
base: string;
|
|
113
157
|
title: string;
|
|
@@ -140,6 +184,17 @@ declare const alertVariants: tailwind_variants.TVReturnType<{
|
|
|
140
184
|
base: string;
|
|
141
185
|
};
|
|
142
186
|
};
|
|
187
|
+
sizeLimit: {
|
|
188
|
+
height: {
|
|
189
|
+
base: string;
|
|
190
|
+
};
|
|
191
|
+
width: {
|
|
192
|
+
base: string;
|
|
193
|
+
};
|
|
194
|
+
both: {
|
|
195
|
+
base: string;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
143
198
|
}, {
|
|
144
199
|
base: string;
|
|
145
200
|
title: string;
|
|
@@ -172,6 +227,17 @@ declare const alertVariants: tailwind_variants.TVReturnType<{
|
|
|
172
227
|
base: string;
|
|
173
228
|
};
|
|
174
229
|
};
|
|
230
|
+
sizeLimit: {
|
|
231
|
+
height: {
|
|
232
|
+
base: string;
|
|
233
|
+
};
|
|
234
|
+
width: {
|
|
235
|
+
base: string;
|
|
236
|
+
};
|
|
237
|
+
both: {
|
|
238
|
+
base: string;
|
|
239
|
+
};
|
|
240
|
+
};
|
|
175
241
|
}, {
|
|
176
242
|
color: {
|
|
177
243
|
default: {};
|
|
@@ -196,6 +262,17 @@ declare const alertVariants: tailwind_variants.TVReturnType<{
|
|
|
196
262
|
base: string;
|
|
197
263
|
};
|
|
198
264
|
};
|
|
265
|
+
sizeLimit: {
|
|
266
|
+
height: {
|
|
267
|
+
base: string;
|
|
268
|
+
};
|
|
269
|
+
width: {
|
|
270
|
+
base: string;
|
|
271
|
+
};
|
|
272
|
+
both: {
|
|
273
|
+
base: string;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
199
276
|
}>, unknown, unknown, undefined>>;
|
|
200
277
|
type VariantProps = TVProps<typeof alertVariants>;
|
|
201
278
|
type ClassName = TVClassName<typeof alertVariants>;
|
|
@@ -216,6 +293,8 @@ interface AlertProps extends VariantProps {
|
|
|
216
293
|
onClose?: () => void | undefined;
|
|
217
294
|
/** Whether to show the icon at the start */
|
|
218
295
|
showIcon?: boolean;
|
|
296
|
+
/** limit height to 150px or width to 480px or both */
|
|
297
|
+
sizeLimit?: VariantProps['sizeLimit'];
|
|
219
298
|
/** HTML data-testid attribute used in e2e tests */
|
|
220
299
|
testId?: string;
|
|
221
300
|
/** Title displayed in the Alert above the content */
|
|
@@ -226,6 +305,6 @@ interface AlertProps extends VariantProps {
|
|
|
226
305
|
/**
|
|
227
306
|
* Alert component based on [HeroUI Alert](https://www.heroui.com//docs/components/alert)
|
|
228
307
|
*/
|
|
229
|
-
declare const Alert: ({ children, className, color, endContent, icon, isClosable, onClose, showIcon, testId, title, variant, }: AlertProps) => react_jsx_runtime.JSX.Element;
|
|
308
|
+
declare const Alert: ({ children, className, color, endContent, icon, isClosable, onClose, sizeLimit, showIcon, testId, title, variant, }: AlertProps) => react_jsx_runtime.JSX.Element;
|
|
230
309
|
|
|
231
310
|
export { Alert as A, alertVariants as a, type AlertProps as b };
|
|
@@ -28,6 +28,17 @@ declare const alertVariants: tailwind_variants.TVReturnType<{
|
|
|
28
28
|
base: string;
|
|
29
29
|
};
|
|
30
30
|
};
|
|
31
|
+
sizeLimit: {
|
|
32
|
+
height: {
|
|
33
|
+
base: string;
|
|
34
|
+
};
|
|
35
|
+
width: {
|
|
36
|
+
base: string;
|
|
37
|
+
};
|
|
38
|
+
both: {
|
|
39
|
+
base: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
31
42
|
}, {
|
|
32
43
|
base: string;
|
|
33
44
|
title: string;
|
|
@@ -60,6 +71,17 @@ declare const alertVariants: tailwind_variants.TVReturnType<{
|
|
|
60
71
|
base: string;
|
|
61
72
|
};
|
|
62
73
|
};
|
|
74
|
+
sizeLimit: {
|
|
75
|
+
height: {
|
|
76
|
+
base: string;
|
|
77
|
+
};
|
|
78
|
+
width: {
|
|
79
|
+
base: string;
|
|
80
|
+
};
|
|
81
|
+
both: {
|
|
82
|
+
base: string;
|
|
83
|
+
};
|
|
84
|
+
};
|
|
63
85
|
}, {
|
|
64
86
|
color: {
|
|
65
87
|
default: {};
|
|
@@ -84,6 +106,17 @@ declare const alertVariants: tailwind_variants.TVReturnType<{
|
|
|
84
106
|
base: string;
|
|
85
107
|
};
|
|
86
108
|
};
|
|
109
|
+
sizeLimit: {
|
|
110
|
+
height: {
|
|
111
|
+
base: string;
|
|
112
|
+
};
|
|
113
|
+
width: {
|
|
114
|
+
base: string;
|
|
115
|
+
};
|
|
116
|
+
both: {
|
|
117
|
+
base: string;
|
|
118
|
+
};
|
|
119
|
+
};
|
|
87
120
|
}>, {
|
|
88
121
|
color: {
|
|
89
122
|
default: {};
|
|
@@ -108,6 +141,17 @@ declare const alertVariants: tailwind_variants.TVReturnType<{
|
|
|
108
141
|
base: string;
|
|
109
142
|
};
|
|
110
143
|
};
|
|
144
|
+
sizeLimit: {
|
|
145
|
+
height: {
|
|
146
|
+
base: string;
|
|
147
|
+
};
|
|
148
|
+
width: {
|
|
149
|
+
base: string;
|
|
150
|
+
};
|
|
151
|
+
both: {
|
|
152
|
+
base: string;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
111
155
|
}, {
|
|
112
156
|
base: string;
|
|
113
157
|
title: string;
|
|
@@ -140,6 +184,17 @@ declare const alertVariants: tailwind_variants.TVReturnType<{
|
|
|
140
184
|
base: string;
|
|
141
185
|
};
|
|
142
186
|
};
|
|
187
|
+
sizeLimit: {
|
|
188
|
+
height: {
|
|
189
|
+
base: string;
|
|
190
|
+
};
|
|
191
|
+
width: {
|
|
192
|
+
base: string;
|
|
193
|
+
};
|
|
194
|
+
both: {
|
|
195
|
+
base: string;
|
|
196
|
+
};
|
|
197
|
+
};
|
|
143
198
|
}, {
|
|
144
199
|
base: string;
|
|
145
200
|
title: string;
|
|
@@ -172,6 +227,17 @@ declare const alertVariants: tailwind_variants.TVReturnType<{
|
|
|
172
227
|
base: string;
|
|
173
228
|
};
|
|
174
229
|
};
|
|
230
|
+
sizeLimit: {
|
|
231
|
+
height: {
|
|
232
|
+
base: string;
|
|
233
|
+
};
|
|
234
|
+
width: {
|
|
235
|
+
base: string;
|
|
236
|
+
};
|
|
237
|
+
both: {
|
|
238
|
+
base: string;
|
|
239
|
+
};
|
|
240
|
+
};
|
|
175
241
|
}, {
|
|
176
242
|
color: {
|
|
177
243
|
default: {};
|
|
@@ -196,6 +262,17 @@ declare const alertVariants: tailwind_variants.TVReturnType<{
|
|
|
196
262
|
base: string;
|
|
197
263
|
};
|
|
198
264
|
};
|
|
265
|
+
sizeLimit: {
|
|
266
|
+
height: {
|
|
267
|
+
base: string;
|
|
268
|
+
};
|
|
269
|
+
width: {
|
|
270
|
+
base: string;
|
|
271
|
+
};
|
|
272
|
+
both: {
|
|
273
|
+
base: string;
|
|
274
|
+
};
|
|
275
|
+
};
|
|
199
276
|
}>, unknown, unknown, undefined>>;
|
|
200
277
|
type VariantProps = TVProps<typeof alertVariants>;
|
|
201
278
|
type ClassName = TVClassName<typeof alertVariants>;
|
|
@@ -216,6 +293,8 @@ interface AlertProps extends VariantProps {
|
|
|
216
293
|
onClose?: () => void | undefined;
|
|
217
294
|
/** Whether to show the icon at the start */
|
|
218
295
|
showIcon?: boolean;
|
|
296
|
+
/** limit height to 150px or width to 480px or both */
|
|
297
|
+
sizeLimit?: VariantProps['sizeLimit'];
|
|
219
298
|
/** HTML data-testid attribute used in e2e tests */
|
|
220
299
|
testId?: string;
|
|
221
300
|
/** Title displayed in the Alert above the content */
|
|
@@ -226,6 +305,6 @@ interface AlertProps extends VariantProps {
|
|
|
226
305
|
/**
|
|
227
306
|
* Alert component based on [HeroUI Alert](https://www.heroui.com//docs/components/alert)
|
|
228
307
|
*/
|
|
229
|
-
declare const Alert: ({ children, className, color, endContent, icon, isClosable, onClose, showIcon, testId, title, variant, }: AlertProps) => react_jsx_runtime.JSX.Element;
|
|
308
|
+
declare const Alert: ({ children, className, color, endContent, icon, isClosable, onClose, sizeLimit, showIcon, testId, title, variant, }: AlertProps) => react_jsx_runtime.JSX.Element;
|
|
230
309
|
|
|
231
310
|
export { Alert as A, alertVariants as a, type AlertProps as b };
|
package/dist/Popover/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkEAX5J2I2cjs = require('../chunk-EAX5J2I2.cjs');
|
|
5
5
|
require('../chunk-TX2VP4J7.cjs');
|
|
6
6
|
require('../chunk-D4TLDLEX.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.Popover =
|
|
10
|
+
exports.Popover = _chunkEAX5J2I2cjs.Popover_default; exports.default = _chunkEAX5J2I2cjs.Popover_default2;
|
|
11
11
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Popover/index.d.cts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { _ as _default } from '../Popover-
|
|
2
|
-
export { P as PopoverProps } from '../Popover-
|
|
1
|
+
import { _ as _default } from '../Popover-BXyk9y8I.cjs';
|
|
2
|
+
export { P as PopoverProps } from '../Popover-BXyk9y8I.cjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'tailwind-variants/dist/config.js';
|
|
5
5
|
import 'tailwind-variants';
|
|
6
6
|
import '@fuf-stack/pixel-utils';
|
|
7
7
|
import '@heroui/popover';
|
|
8
8
|
import 'react';
|
|
9
|
+
import '../Button-BGekDPvO.cjs';
|
|
10
|
+
import '@heroui/button';
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
|
package/dist/Popover/index.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { _ as _default } from '../Popover-
|
|
2
|
-
export { P as PopoverProps } from '../Popover-
|
|
1
|
+
import { _ as _default } from '../Popover-BHPrdRy6.js';
|
|
2
|
+
export { P as PopoverProps } from '../Popover-BHPrdRy6.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'tailwind-variants/dist/config.js';
|
|
5
5
|
import 'tailwind-variants';
|
|
6
6
|
import '@fuf-stack/pixel-utils';
|
|
7
7
|
import '@heroui/popover';
|
|
8
8
|
import 'react';
|
|
9
|
+
import '../Button-BGekDPvO.js';
|
|
10
|
+
import '@heroui/button';
|
|
9
11
|
|
|
10
12
|
|
|
11
13
|
|
package/dist/Popover/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import * as tailwind_variants from 'tailwind-variants';
|
|
|
4
4
|
import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
|
|
5
5
|
import { PopoverProps as PopoverProps$1 } from '@heroui/popover';
|
|
6
6
|
import { ReactNode } from 'react';
|
|
7
|
+
import { a as ButtonProps } from './Button-BGekDPvO.js';
|
|
7
8
|
|
|
8
9
|
declare const popoverVariants: tailwind_variants.TVReturnType<{
|
|
9
10
|
[key: string]: {
|
|
@@ -100,12 +101,14 @@ interface PopoverProps extends VariantProps {
|
|
|
100
101
|
shouldBlockScroll?: boolean;
|
|
101
102
|
/** HTML data-testid attribute used in e2e tests */
|
|
102
103
|
testId?: string;
|
|
103
|
-
/**
|
|
104
|
+
/** Popover title */
|
|
104
105
|
title?: ReactNode;
|
|
106
|
+
/** When defined a Button will be rendered as trigger (with provided props) instead of unstyled html button */
|
|
107
|
+
triggerButtonProps?: Pick<ButtonProps, 'ariaLabel' | 'className' | 'color' | 'disableAnimation' | 'disabled' | 'size' | 'testId' | 'variant'>;
|
|
105
108
|
}
|
|
106
109
|
/**
|
|
107
110
|
* Popover component based on [HeroUI Card](https://www.heroui.com//docs/components/popover)
|
|
108
111
|
*/
|
|
109
|
-
declare const _default: ({ children, className: _className, content, contentTestId, footer, openControlled, placement, portalContainer, shouldBlockScroll, testId, title, }: PopoverProps) => react_jsx_runtime.JSX.Element;
|
|
112
|
+
declare const _default: ({ children, className: _className, content, contentTestId, footer, openControlled, placement, portalContainer, shouldBlockScroll, testId, title, triggerButtonProps, }: PopoverProps) => react_jsx_runtime.JSX.Element;
|
|
110
113
|
|
|
111
114
|
export { type PopoverProps as P, _default as _ };
|
|
@@ -4,6 +4,7 @@ import * as tailwind_variants from 'tailwind-variants';
|
|
|
4
4
|
import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
|
|
5
5
|
import { PopoverProps as PopoverProps$1 } from '@heroui/popover';
|
|
6
6
|
import { ReactNode } from 'react';
|
|
7
|
+
import { a as ButtonProps } from './Button-BGekDPvO.cjs';
|
|
7
8
|
|
|
8
9
|
declare const popoverVariants: tailwind_variants.TVReturnType<{
|
|
9
10
|
[key: string]: {
|
|
@@ -100,12 +101,14 @@ interface PopoverProps extends VariantProps {
|
|
|
100
101
|
shouldBlockScroll?: boolean;
|
|
101
102
|
/** HTML data-testid attribute used in e2e tests */
|
|
102
103
|
testId?: string;
|
|
103
|
-
/**
|
|
104
|
+
/** Popover title */
|
|
104
105
|
title?: ReactNode;
|
|
106
|
+
/** When defined a Button will be rendered as trigger (with provided props) instead of unstyled html button */
|
|
107
|
+
triggerButtonProps?: Pick<ButtonProps, 'ariaLabel' | 'className' | 'color' | 'disableAnimation' | 'disabled' | 'size' | 'testId' | 'variant'>;
|
|
105
108
|
}
|
|
106
109
|
/**
|
|
107
110
|
* Popover component based on [HeroUI Card](https://www.heroui.com//docs/components/popover)
|
|
108
111
|
*/
|
|
109
|
-
declare const _default: ({ children, className: _className, content, contentTestId, footer, openControlled, placement, portalContainer, shouldBlockScroll, testId, title, }: PopoverProps) => react_jsx_runtime.JSX.Element;
|
|
112
|
+
declare const _default: ({ children, className: _className, content, contentTestId, footer, openControlled, placement, portalContainer, shouldBlockScroll, testId, title, triggerButtonProps, }: PopoverProps) => react_jsx_runtime.JSX.Element;
|
|
110
113
|
|
|
111
114
|
export { type PopoverProps as P, _default as _ };
|
package/dist/Table/index.cjs
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkAJCAIA6Hcjs = require('../chunk-AJCAIA6H.cjs');
|
|
6
6
|
require('../chunk-D4TLDLEX.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.Table =
|
|
11
|
+
exports.Table = _chunkAJCAIA6Hcjs.Table_default; exports.default = _chunkAJCAIA6Hcjs.Table_default2; exports.tableVariants = _chunkAJCAIA6Hcjs.tableVariants;
|
|
12
12
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Table/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
} from "./chunk-J7N2552D.js";
|
|
8
8
|
|
|
9
9
|
// src/Popover/Popover.tsx
|
|
10
|
+
import { Button } from "@heroui/button";
|
|
10
11
|
import { Popover, PopoverContent, PopoverTrigger } from "@heroui/popover";
|
|
11
12
|
import { tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
12
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -30,7 +31,8 @@ var Popover_default = ({
|
|
|
30
31
|
portalContainer = void 0,
|
|
31
32
|
shouldBlockScroll = void 0,
|
|
32
33
|
testId = void 0,
|
|
33
|
-
title = void 0
|
|
34
|
+
title = void 0,
|
|
35
|
+
triggerButtonProps = void 0
|
|
34
36
|
}) => {
|
|
35
37
|
const variants = popoverVariants();
|
|
36
38
|
const className = variantsToClassNames(variants, _className, "trigger");
|
|
@@ -45,7 +47,15 @@ var Popover_default = ({
|
|
|
45
47
|
showArrow: true
|
|
46
48
|
}, openControlled ? { isOpen: openControlled.open, onOpenChange: openControlled.setOpen } : {}), {
|
|
47
49
|
children: [
|
|
48
|
-
/* @__PURE__ */ jsx(PopoverTrigger, { "data-testid": testId, children:
|
|
50
|
+
/* @__PURE__ */ jsx(PopoverTrigger, { "data-testid": testId, children: triggerButtonProps ? (
|
|
51
|
+
// TODO: currently we have to use @heroui/button because
|
|
52
|
+
// passing ref does not work (even with forwardRef in Button)
|
|
53
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
54
|
+
/* @__PURE__ */ jsx(Button, __spreadProps(__spreadValues({ className: className.trigger }, triggerButtonProps), { children }))
|
|
55
|
+
) : (
|
|
56
|
+
// eslint-disable-next-line react/button-has-type
|
|
57
|
+
/* @__PURE__ */ jsx("button", { className: className.trigger, children })
|
|
58
|
+
) }),
|
|
49
59
|
/* @__PURE__ */ jsxs(PopoverContent, { "data-testid": contentTestId, children: [
|
|
50
60
|
title && /* @__PURE__ */ jsxs("div", { className: className.header, children: [
|
|
51
61
|
title,
|
|
@@ -69,4 +79,4 @@ export {
|
|
|
69
79
|
Popover_default,
|
|
70
80
|
Popover_default2
|
|
71
81
|
};
|
|
72
|
-
//# sourceMappingURL=chunk-
|
|
82
|
+
//# sourceMappingURL=chunk-5TOE75VE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Popover/Popover.tsx","../src/Popover/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { PopoverProps as HeroPopoverProps } from '@heroui/popover';\nimport type { ReactNode } from 'react';\nimport type { ButtonProps } from '../Button';\n\nimport { Button } from '@heroui/button';\nimport { Popover, PopoverContent, PopoverTrigger } from '@heroui/popover';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport ScrollShadow from '../ScrollShadow/ScrollShadow';\n\n// popover styling variants\nexport const popoverVariants = tv({\n slots: {\n body: 'w-full px-2.5 py-1',\n content: 'flex max-h-[80vh] flex-col p-0',\n footer: 'w-full px-2.5 py-1',\n header: 'w-full px-2.5 py-1',\n trigger: '',\n },\n});\n\ntype VariantProps = TVProps<typeof popoverVariants>;\ntype ClassName = TVClassName<typeof popoverVariants>;\n\nexport interface PopoverProps extends VariantProps {\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** content of the popover */\n content: ReactNode;\n /** HTML data-testid attribute used in e2e tests */\n contentTestId?: string;\n /** popover footer */\n footer?: ReactNode;\n /** use as controlled component */\n openControlled?: { open: boolean; setOpen: (open: boolean) => void };\n /** placement of the popover relative to its trigger reference */\n placement?: HeroPopoverProps['placement'];\n /** The container element in which the overlay portal will be placed. */\n portalContainer?: HeroPopoverProps['portalContainer'];\n /** Whether to block scrolling outside the popover */\n shouldBlockScroll?: boolean;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Popover title */\n title?: ReactNode;\n /** When defined a Button will be rendered as trigger (with provided props) instead of unstyled html button */\n triggerButtonProps?: Pick<\n ButtonProps,\n | 'ariaLabel'\n | 'className'\n | 'color'\n | 'disableAnimation'\n | 'disabled'\n | 'size'\n | 'testId'\n | 'variant'\n >;\n}\n\n/**\n * Popover component based on [HeroUI Card](https://www.heroui.com//docs/components/popover)\n */\nexport default ({\n children = null,\n className: _className = undefined,\n content,\n contentTestId = undefined,\n footer = undefined,\n openControlled = undefined,\n placement = 'top',\n portalContainer = undefined,\n shouldBlockScroll = undefined,\n testId = undefined,\n title = undefined,\n triggerButtonProps = undefined,\n}: PopoverProps) => {\n // className from slots\n const variants = popoverVariants();\n const className = variantsToClassNames(variants, _className, 'trigger');\n\n return (\n <Popover\n classNames={className}\n placement={placement}\n portalContainer={portalContainer}\n radius=\"sm\"\n shouldBlockScroll={shouldBlockScroll}\n showArrow\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...(openControlled\n ? { isOpen: openControlled.open, onOpenChange: openControlled.setOpen }\n : {})}\n >\n <PopoverTrigger data-testid={testId}>\n {/* NOTE: type and aria properties are injected by PopoverTrigger */}\n {triggerButtonProps ? (\n // TODO: currently we have to use @heroui/button because\n // passing ref does not work (even with forwardRef in Button)\n // eslint-disable-next-line react/jsx-props-no-spreading\n <Button className={className.trigger} {...triggerButtonProps}>\n {children}\n </Button>\n ) : (\n // eslint-disable-next-line react/button-has-type\n <button className={className.trigger}>{children}</button>\n )}\n </PopoverTrigger>\n <PopoverContent data-testid={contentTestId}>\n {title && (\n <div className={className.header}>\n {title}\n <hr />\n </div>\n )}\n <ScrollShadow className={className.body}>{content}</ScrollShadow>\n {footer && (\n <div className={className.footer}>\n <hr />\n {footer}\n </div>\n )}\n </PopoverContent>\n </Popover>\n );\n};\n","import Popover from './Popover';\n\nexport type { PopoverProps } from './Popover';\n\nexport { Popover };\n\nexport default Popover;\n"],"mappings":";;;;;;;;;AAKA,SAAS,cAAc;AACvB,SAAS,SAAS,gBAAgB,sBAAsB;AAExD,SAAS,IAAI,4BAA4B;AA+F/B,cAUA,YAVA;AA1FH,IAAM,kBAAkB,GAAG;AAAA,EAChC,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AACF,CAAC;AA6CD,IAAO,kBAAQ,CAAC;AAAA,EACd,WAAW;AAAA,EACX,WAAW,aAAa;AAAA,EACxB;AAAA,EACA,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,kBAAkB;AAAA,EAClB,oBAAoB;AAAA,EACpB,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,qBAAqB;AACvB,MAAoB;AAElB,QAAM,WAAW,gBAAgB;AACjC,QAAM,YAAY,qBAAqB,UAAU,YAAY,SAAS;AAEtE,SACE;AAAA,IAAC;AAAA;AAAA,MACC,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,MACA,QAAO;AAAA,MACP;AAAA,MACA,WAAS;AAAA,OAEJ,iBACD,EAAE,QAAQ,eAAe,MAAM,cAAc,eAAe,QAAQ,IACpE,CAAC,IAVN;AAAA,MAYC;AAAA,4BAAC,kBAAe,eAAa,QAE1B;AAAA;AAAA;AAAA;AAAA,UAIC,oBAAC,uCAAO,WAAW,UAAU,WAAa,qBAAzC,EACE,WACH;AAAA;AAAA;AAAA,UAGA,oBAAC,YAAO,WAAW,UAAU,SAAU,UAAS;AAAA,WAEpD;AAAA,QACA,qBAAC,kBAAe,eAAa,eAC1B;AAAA,mBACC,qBAAC,SAAI,WAAW,UAAU,QACvB;AAAA;AAAA,YACD,oBAAC,QAAG;AAAA,aACN;AAAA,UAEF,oBAAC,wBAAa,WAAW,UAAU,MAAO,mBAAQ;AAAA,UACjD,UACC,qBAAC,SAAI,WAAW,UAAU,QACxB;AAAA,gCAAC,QAAG;AAAA,YACH;AAAA,aACH;AAAA,WAEJ;AAAA;AAAA;AAAA,EACF;AAEJ;;;AC1HA,IAAOA,mBAAQ;","names":["Popover_default"]}
|
|
@@ -81,7 +81,7 @@ var Table = ({
|
|
|
81
81
|
isStriped: separation === "striped" || separation === "striped-divider-x",
|
|
82
82
|
isVirtualized: virtualized,
|
|
83
83
|
maxTableHeight,
|
|
84
|
-
removeWrapper: !hasWrapper,
|
|
84
|
+
removeWrapper: virtualized ? false : !hasWrapper,
|
|
85
85
|
rowHeight,
|
|
86
86
|
children: [
|
|
87
87
|
/* @__PURE__ */ jsx(TableHeader, { columns, children: (column) => /* @__PURE__ */ jsx(TableColumn, { children: column.label }, column.key) }),
|
|
@@ -115,4 +115,4 @@ export {
|
|
|
115
115
|
Table_default,
|
|
116
116
|
Table_default2
|
|
117
117
|
};
|
|
118
|
-
//# sourceMappingURL=chunk-
|
|
118
|
+
//# sourceMappingURL=chunk-AFGRLKHU.js.map
|
|
@@ -1 +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 HeroTable,\n TableBody,\n TableCell,\n TableColumn,\n TableHeader,\n TableRow,\n} from '@heroui/table';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\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\nexport type VariantProps = TVProps<typeof tableVariants>;\ntype ClassName = TVClassName<typeof tableVariants>;\n\nexport interface TableColumnProps {\n key: string;\n label: ReactNode;\n}\n\nexport interface 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 /** The maximum height of the table in pixels. Required when using virtualization. */\n maxTableHeight?: number;\n /** The fixed height of each row item in pixels. Required when using virtualization. */\n rowHeight?: number;\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 /** Virtualize allows efficient rendering of large lists by only rendering items that are visible in the viewport. */\n virtualized?: boolean;\n}\n\n/**\n * Table component based on [HeroUI Table](https://www.heroui.com//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 maxTableHeight = undefined,\n rowHeight = undefined,\n rows = [],\n separation = 'none',\n stickyHeader = false,\n testId = undefined,\n virtualized = false,\n}: TableProps) => {\n const variants = tableVariants({ separation });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n return (\n <HeroTable\n aria-label={ariaLabel}\n bottomContent={bottomContent}\n classNames={classNames}\n data-testid={testId && slugify(testId)}\n hideHeader={hideHeader}\n isHeaderSticky={stickyHeader}\n isStriped={separation === 'striped' || separation === 'striped-divider-x'}\n isVirtualized={virtualized}\n maxTableHeight={maxTableHeight}\n removeWrapper={!hasWrapper}\n rowHeight={rowHeight}\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={`${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 </HeroTable>\n );\n};\n\nexport default Table;\n","import Table, { tableVariants } from './Table';\n\nexport type {\n TableProps,\n TableRowProps,\n TableColumnProps,\n VariantProps,\n} from './Table';\n\nexport { Table, tableVariants };\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,SAAS,IAAI,4BAA4B;AA0H9C,SAeM,KAfN;AAvHG,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;AA2DD,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,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,OAAO,CAAC;AAAA,EACR,aAAa;AAAA,EACb,eAAe;AAAA,EACf,SAAS;AAAA,EACT,cAAc;AAChB,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,UAAU,QAAQ,MAAM;AAAA,MACrC;AAAA,MACA,gBAAgB;AAAA,MAChB,WAAW,eAAe,aAAa,eAAe;AAAA,MACtD,eAAe;AAAA,MACf;AAAA,MACA,eAAe,CAAC;AAAA,
|
|
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 HeroTable,\n TableBody,\n TableCell,\n TableColumn,\n TableHeader,\n TableRow,\n} from '@heroui/table';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\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\nexport type VariantProps = TVProps<typeof tableVariants>;\ntype ClassName = TVClassName<typeof tableVariants>;\n\nexport interface TableColumnProps {\n key: string;\n label: ReactNode;\n}\n\nexport interface 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 /** The maximum height of the table in pixels. Required when using virtualization. */\n maxTableHeight?: number;\n /** The fixed height of each row item in pixels. Required when using virtualization. */\n rowHeight?: number;\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 /** Virtualize allows efficient rendering of large lists by only rendering items that are visible in the viewport. */\n virtualized?: boolean;\n}\n\n/**\n * Table component based on [HeroUI Table](https://www.heroui.com//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 maxTableHeight = undefined,\n rowHeight = undefined,\n rows = [],\n separation = 'none',\n stickyHeader = false,\n testId = undefined,\n virtualized = false,\n}: TableProps) => {\n const variants = tableVariants({ separation });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n return (\n <HeroTable\n aria-label={ariaLabel}\n bottomContent={bottomContent}\n classNames={classNames}\n data-testid={testId && slugify(testId)}\n hideHeader={hideHeader}\n isHeaderSticky={stickyHeader}\n isStriped={separation === 'striped' || separation === 'striped-divider-x'}\n isVirtualized={virtualized}\n maxTableHeight={maxTableHeight}\n removeWrapper={virtualized ? false : !hasWrapper} // always show wrapper if virtualized\n rowHeight={rowHeight}\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={`${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 </HeroTable>\n );\n};\n\nexport default Table;\n","import Table, { tableVariants } from './Table';\n\nexport type {\n TableProps,\n TableRowProps,\n TableColumnProps,\n VariantProps,\n} from './Table';\n\nexport { Table, tableVariants };\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,SAAS,IAAI,4BAA4B;AA0H9C,SAeM,KAfN;AAvHG,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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","names":["Table_default"]}
|
|
@@ -81,7 +81,7 @@ var Table = ({
|
|
|
81
81
|
isStriped: separation === "striped" || separation === "striped-divider-x",
|
|
82
82
|
isVirtualized: virtualized,
|
|
83
83
|
maxTableHeight,
|
|
84
|
-
removeWrapper: !hasWrapper,
|
|
84
|
+
removeWrapper: virtualized ? false : !hasWrapper,
|
|
85
85
|
rowHeight,
|
|
86
86
|
children: [
|
|
87
87
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _table.TableHeader, { columns, children: (column) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _table.TableColumn, { children: column.label }, column.key) }),
|
|
@@ -115,4 +115,4 @@ var Table_default2 = Table_default;
|
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
exports.tableVariants = tableVariants; exports.Table_default = Table_default; exports.Table_default2 = Table_default2;
|
|
118
|
-
//# sourceMappingURL=chunk-
|
|
118
|
+
//# sourceMappingURL=chunk-AJCAIA6H.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-AJCAIA6H.cjs","../src/Table/Table.tsx","../src/Table/index.ts"],"names":["Table_default"],"mappings":"AAAA;ACGA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,sCACK;AAEP,oDAAkD;AA0H9C,+CAAA;AAvHG,IAAM,cAAA,EAAgB,4BAAA;AAAG,EAC9B,KAAA,EAAO;AAAA,IACL,IAAA,EAAM,EAAA;AAAA,IACN,OAAA,EAAS,EAAA;AAAA,IACT,KAAA,EAAO,EAAA;AAAA,IACP,KAAA,EAAO,EAAA;AAAA,IACP,KAAA,EAAO,EAAA;AAAA,IACP,EAAA,EAAI,EAAA;AAAA,IACJ,EAAA,EAAI,aAAA;AAAA,IACJ,EAAA,EAAI,EAAA;AAAA,IACJ,KAAA,EAAO,EAAA;AAAA,IACP,QAAA,EAAU,EAAA;AAAA,IACV,YAAA,EAAc,EAAA;AAAA,IACd,cAA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A,EAAQ,aAAA;AFoGf;AACA;AACE;AACA;AACA;AACF,sHAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-AJCAIA6H.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport {\n getKeyValue,\n Table as HeroTable,\n TableBody,\n TableCell,\n TableColumn,\n TableHeader,\n TableRow,\n} from '@heroui/table';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\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\nexport type VariantProps = TVProps<typeof tableVariants>;\ntype ClassName = TVClassName<typeof tableVariants>;\n\nexport interface TableColumnProps {\n key: string;\n label: ReactNode;\n}\n\nexport interface 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 /** The maximum height of the table in pixels. Required when using virtualization. */\n maxTableHeight?: number;\n /** The fixed height of each row item in pixels. Required when using virtualization. */\n rowHeight?: number;\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 /** Virtualize allows efficient rendering of large lists by only rendering items that are visible in the viewport. */\n virtualized?: boolean;\n}\n\n/**\n * Table component based on [HeroUI Table](https://www.heroui.com//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 maxTableHeight = undefined,\n rowHeight = undefined,\n rows = [],\n separation = 'none',\n stickyHeader = false,\n testId = undefined,\n virtualized = false,\n}: TableProps) => {\n const variants = tableVariants({ separation });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n return (\n <HeroTable\n aria-label={ariaLabel}\n bottomContent={bottomContent}\n classNames={classNames}\n data-testid={testId && slugify(testId)}\n hideHeader={hideHeader}\n isHeaderSticky={stickyHeader}\n isStriped={separation === 'striped' || separation === 'striped-divider-x'}\n isVirtualized={virtualized}\n maxTableHeight={maxTableHeight}\n removeWrapper={virtualized ? false : !hasWrapper} // always show wrapper if virtualized\n rowHeight={rowHeight}\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={`${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 </HeroTable>\n );\n};\n\nexport default Table;\n","import Table, { tableVariants } from './Table';\n\nexport type {\n TableProps,\n TableRowProps,\n TableColumnProps,\n VariantProps,\n} from './Table';\n\nexport { Table, tableVariants };\n\nexport default Table;\n"]}
|
|
@@ -7,6 +7,7 @@ var _chunkTX2VP4J7cjs = require('./chunk-TX2VP4J7.cjs');
|
|
|
7
7
|
var _chunkD4TLDLEXcjs = require('./chunk-D4TLDLEX.cjs');
|
|
8
8
|
|
|
9
9
|
// src/Popover/Popover.tsx
|
|
10
|
+
var _button = require('@heroui/button');
|
|
10
11
|
var _popover = require('@heroui/popover');
|
|
11
12
|
var _pixelutils = require('@fuf-stack/pixel-utils');
|
|
12
13
|
var _jsxruntime = require('react/jsx-runtime');
|
|
@@ -30,7 +31,8 @@ var Popover_default = ({
|
|
|
30
31
|
portalContainer = void 0,
|
|
31
32
|
shouldBlockScroll = void 0,
|
|
32
33
|
testId = void 0,
|
|
33
|
-
title = void 0
|
|
34
|
+
title = void 0,
|
|
35
|
+
triggerButtonProps = void 0
|
|
34
36
|
}) => {
|
|
35
37
|
const variants = popoverVariants();
|
|
36
38
|
const className = _pixelutils.variantsToClassNames.call(void 0, variants, _className, "trigger");
|
|
@@ -45,7 +47,15 @@ var Popover_default = ({
|
|
|
45
47
|
showArrow: true
|
|
46
48
|
}, openControlled ? { isOpen: openControlled.open, onOpenChange: openControlled.setOpen } : {}), {
|
|
47
49
|
children: [
|
|
48
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _popover.PopoverTrigger, { "data-testid": testId, children:
|
|
50
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _popover.PopoverTrigger, { "data-testid": testId, children: triggerButtonProps ? (
|
|
51
|
+
// TODO: currently we have to use @heroui/button because
|
|
52
|
+
// passing ref does not work (even with forwardRef in Button)
|
|
53
|
+
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
54
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _button.Button, _chunkD4TLDLEXcjs.__spreadProps.call(void 0, _chunkD4TLDLEXcjs.__spreadValues.call(void 0, { className: className.trigger }, triggerButtonProps), { children }))
|
|
55
|
+
) : (
|
|
56
|
+
// eslint-disable-next-line react/button-has-type
|
|
57
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "button", { className: className.trigger, children })
|
|
58
|
+
) }),
|
|
49
59
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _popover.PopoverContent, { "data-testid": contentTestId, children: [
|
|
50
60
|
title && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: className.header, children: [
|
|
51
61
|
title,
|
|
@@ -69,4 +79,4 @@ var Popover_default2 = Popover_default;
|
|
|
69
79
|
|
|
70
80
|
|
|
71
81
|
exports.Popover_default = Popover_default; exports.Popover_default2 = Popover_default2;
|
|
72
|
-
//# sourceMappingURL=chunk-
|
|
82
|
+
//# sourceMappingURL=chunk-EAX5J2I2.cjs.map
|