@fuf-stack/pixels 1.1.2 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button/index.cjs +2 -2
- package/dist/Button/index.d.cts +2 -2
- package/dist/Button/index.d.ts +2 -2
- package/dist/Button/index.js +1 -1
- package/dist/{Button-rsBnawn1.d.cts → Button-CkMcZvji.d.cts} +12 -5
- package/dist/{Button-rsBnawn1.d.ts → Button-CkMcZvji.d.ts} +12 -5
- package/dist/Json/index.cjs +3 -3
- package/dist/Json/index.js +2 -2
- package/dist/Menu/index.cjs +2 -2
- package/dist/Menu/index.d.cts +5 -2
- package/dist/Menu/index.d.ts +5 -2
- package/dist/Menu/index.js +1 -1
- package/dist/Menu-DbeqxeL0.d.cts +98 -0
- package/dist/Menu-DbeqxeL0.d.ts +98 -0
- package/dist/Popover/index.cjs +2 -2
- package/dist/Popover/index.d.cts +3 -4
- package/dist/Popover/index.d.ts +3 -4
- package/dist/Popover/index.js +1 -1
- package/dist/{Popover-D6Qv56ms.d.ts → Popover-BsdcKPgm.d.cts} +2 -2
- package/dist/{Popover-BUKzm3MQ.d.cts → Popover-BsdcKPgm.d.ts} +2 -2
- package/dist/{chunk-WZZMB5CI.cjs → chunk-3Y7P46WT.cjs} +1 -1
- package/dist/chunk-3Y7P46WT.cjs.map +1 -0
- package/dist/{chunk-7QUYJEGU.js → chunk-HFW4JP5W.js} +1 -1
- package/dist/chunk-HFW4JP5W.js.map +1 -0
- package/dist/{chunk-4LMQVFV7.js → chunk-HOWDEBJG.js} +8 -4
- package/dist/chunk-HOWDEBJG.js.map +1 -0
- package/dist/{chunk-2OJHNNCU.cjs → chunk-IPALTJVF.cjs} +3 -3
- package/dist/{chunk-2OJHNNCU.cjs.map → chunk-IPALTJVF.cjs.map} +1 -1
- package/dist/{chunk-BTQB4EZC.js → chunk-N4U7OJOM.js} +2 -2
- package/dist/{chunk-PZL3LRGY.cjs → chunk-NNWXSPVB.cjs} +7 -3
- package/dist/chunk-NNWXSPVB.cjs.map +1 -0
- package/dist/chunk-WFPRB4JT.js +115 -0
- package/dist/chunk-WFPRB4JT.js.map +1 -0
- package/dist/chunk-WFR7OUY7.cjs +115 -0
- package/dist/chunk-WFR7OUY7.cjs.map +1 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/package.json +1 -1
- package/dist/Menu-DYi8oagz.d.cts +0 -56
- package/dist/Menu-DYi8oagz.d.ts +0 -56
- package/dist/chunk-4LMQVFV7.js.map +0 -1
- package/dist/chunk-7QUYJEGU.js.map +0 -1
- package/dist/chunk-OP5W7BXY.js +0 -81
- package/dist/chunk-OP5W7BXY.js.map +0 -1
- package/dist/chunk-PZL3LRGY.cjs.map +0 -1
- package/dist/chunk-WZZMB5CI.cjs.map +0 -1
- package/dist/chunk-XHOAZB2Z.cjs +0 -81
- package/dist/chunk-XHOAZB2Z.cjs.map +0 -1
- /package/dist/{chunk-BTQB4EZC.js.map → chunk-N4U7OJOM.js.map} +0 -0
package/dist/Button/index.cjs
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkNNWXSPVBcjs = require('../chunk-NNWXSPVB.cjs');
|
|
6
6
|
require('../chunk-D4TLDLEX.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
exports.Button =
|
|
11
|
+
exports.Button = _chunkNNWXSPVBcjs.Button_default; exports.buttonVariants = _chunkNNWXSPVBcjs.buttonVariants; exports.default = _chunkNNWXSPVBcjs.Button_default2;
|
|
12
12
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Button/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as Button } from '../Button-
|
|
2
|
-
export { a as ButtonProps, b as buttonVariants } from '../Button-
|
|
1
|
+
import { B as Button } from '../Button-CkMcZvji.cjs';
|
|
2
|
+
export { a as ButtonProps, b as buttonVariants } from '../Button-CkMcZvji.cjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'tailwind-variants';
|
|
5
5
|
import '@fuf-stack/pixel-utils';
|
package/dist/Button/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as Button } from '../Button-
|
|
2
|
-
export { a as ButtonProps, b as buttonVariants } from '../Button-
|
|
1
|
+
import { B as Button } from '../Button-CkMcZvji.js';
|
|
2
|
+
export { a as ButtonProps, b as buttonVariants } from '../Button-CkMcZvji.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'tailwind-variants';
|
|
5
5
|
import '@fuf-stack/pixel-utils';
|
package/dist/Button/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
-
import { TVProps } from '@fuf-stack/pixel-utils';
|
|
3
|
+
import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
|
|
4
4
|
import { ButtonProps as ButtonProps$1 } from '@heroui/button';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
|
|
@@ -28,7 +28,9 @@ declare const buttonVariants: tailwind_variants.TVReturnType<{
|
|
|
28
28
|
md: string;
|
|
29
29
|
lg: string;
|
|
30
30
|
};
|
|
31
|
-
},
|
|
31
|
+
}, {
|
|
32
|
+
base: string;
|
|
33
|
+
}, undefined, {
|
|
32
34
|
color: {
|
|
33
35
|
default: string;
|
|
34
36
|
primary: string;
|
|
@@ -52,7 +54,9 @@ declare const buttonVariants: tailwind_variants.TVReturnType<{
|
|
|
52
54
|
md: string;
|
|
53
55
|
lg: string;
|
|
54
56
|
};
|
|
55
|
-
},
|
|
57
|
+
}, {
|
|
58
|
+
base: string;
|
|
59
|
+
}, tailwind_variants.TVReturnType<{
|
|
56
60
|
color: {
|
|
57
61
|
default: string;
|
|
58
62
|
primary: string;
|
|
@@ -76,15 +80,18 @@ declare const buttonVariants: tailwind_variants.TVReturnType<{
|
|
|
76
80
|
md: string;
|
|
77
81
|
lg: string;
|
|
78
82
|
};
|
|
79
|
-
},
|
|
83
|
+
}, {
|
|
84
|
+
base: string;
|
|
85
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
80
86
|
type VariantProps = TVProps<typeof buttonVariants>;
|
|
87
|
+
type ClassName = TVClassName<typeof buttonVariants>;
|
|
81
88
|
interface ButtonProps extends VariantProps {
|
|
82
89
|
/** sets HTML aria-label attribute */
|
|
83
90
|
ariaLabel?: string;
|
|
84
91
|
/** content of the button */
|
|
85
92
|
children?: ReactNode;
|
|
86
93
|
/** CSS class name */
|
|
87
|
-
className?:
|
|
94
|
+
className?: ClassName;
|
|
88
95
|
/** color of the button */
|
|
89
96
|
color?: ButtonProps$1['color'];
|
|
90
97
|
/** disables the button */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
-
import { TVProps } from '@fuf-stack/pixel-utils';
|
|
3
|
+
import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
|
|
4
4
|
import { ButtonProps as ButtonProps$1 } from '@heroui/button';
|
|
5
5
|
import { ReactNode } from 'react';
|
|
6
6
|
|
|
@@ -28,7 +28,9 @@ declare const buttonVariants: tailwind_variants.TVReturnType<{
|
|
|
28
28
|
md: string;
|
|
29
29
|
lg: string;
|
|
30
30
|
};
|
|
31
|
-
},
|
|
31
|
+
}, {
|
|
32
|
+
base: string;
|
|
33
|
+
}, undefined, {
|
|
32
34
|
color: {
|
|
33
35
|
default: string;
|
|
34
36
|
primary: string;
|
|
@@ -52,7 +54,9 @@ declare const buttonVariants: tailwind_variants.TVReturnType<{
|
|
|
52
54
|
md: string;
|
|
53
55
|
lg: string;
|
|
54
56
|
};
|
|
55
|
-
},
|
|
57
|
+
}, {
|
|
58
|
+
base: string;
|
|
59
|
+
}, tailwind_variants.TVReturnType<{
|
|
56
60
|
color: {
|
|
57
61
|
default: string;
|
|
58
62
|
primary: string;
|
|
@@ -76,15 +80,18 @@ declare const buttonVariants: tailwind_variants.TVReturnType<{
|
|
|
76
80
|
md: string;
|
|
77
81
|
lg: string;
|
|
78
82
|
};
|
|
79
|
-
},
|
|
83
|
+
}, {
|
|
84
|
+
base: string;
|
|
85
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
80
86
|
type VariantProps = TVProps<typeof buttonVariants>;
|
|
87
|
+
type ClassName = TVClassName<typeof buttonVariants>;
|
|
81
88
|
interface ButtonProps extends VariantProps {
|
|
82
89
|
/** sets HTML aria-label attribute */
|
|
83
90
|
ariaLabel?: string;
|
|
84
91
|
/** content of the button */
|
|
85
92
|
children?: ReactNode;
|
|
86
93
|
/** CSS class name */
|
|
87
|
-
className?:
|
|
94
|
+
className?: ClassName;
|
|
88
95
|
/** color of the button */
|
|
89
96
|
color?: ButtonProps$1['color'];
|
|
90
97
|
/** disables the button */
|
package/dist/Json/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-
|
|
4
|
+
var _chunkIPALTJVFcjs = require('../chunk-IPALTJVF.cjs');
|
|
5
|
+
require('../chunk-NNWXSPVB.cjs');
|
|
6
6
|
require('../chunk-D4TLDLEX.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.Json =
|
|
10
|
+
exports.Json = _chunkIPALTJVFcjs.Json_default; exports.default = _chunkIPALTJVFcjs.Json_default2;
|
|
11
11
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Json/index.js
CHANGED
package/dist/Menu/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkWFR7OUY7cjs = require('../chunk-WFR7OUY7.cjs');
|
|
5
5
|
require('../chunk-D4TLDLEX.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.Menu =
|
|
9
|
+
exports.Menu = _chunkWFR7OUY7cjs.Menu_default; exports.default = _chunkWFR7OUY7cjs.Menu_default2;
|
|
10
10
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Menu/index.d.cts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { M as Menu } from '../Menu-
|
|
2
|
-
export { b as MenuItem, a as MenuProps, c as MenuSection } from '../Menu-
|
|
1
|
+
import { M as Menu } from '../Menu-DbeqxeL0.cjs';
|
|
2
|
+
export { b as MenuItem, a as MenuProps, c as MenuSection } from '../Menu-DbeqxeL0.cjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
|
+
import 'tailwind-variants';
|
|
5
|
+
import '@fuf-stack/pixel-utils';
|
|
6
|
+
import '@heroui/button';
|
|
4
7
|
import '@heroui/dropdown';
|
|
5
8
|
import 'react';
|
|
6
9
|
|
package/dist/Menu/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { M as Menu } from '../Menu-
|
|
2
|
-
export { b as MenuItem, a as MenuProps, c as MenuSection } from '../Menu-
|
|
1
|
+
import { M as Menu } from '../Menu-DbeqxeL0.js';
|
|
2
|
+
export { b as MenuItem, a as MenuProps, c as MenuSection } from '../Menu-DbeqxeL0.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
|
+
import 'tailwind-variants';
|
|
5
|
+
import '@fuf-stack/pixel-utils';
|
|
6
|
+
import '@heroui/button';
|
|
4
7
|
import '@heroui/dropdown';
|
|
5
8
|
import 'react';
|
|
6
9
|
|
package/dist/Menu/index.js
CHANGED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
+
import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
|
|
4
|
+
import { ButtonProps } from '@heroui/button';
|
|
5
|
+
import { DropdownItemProps, DropdownProps } from '@heroui/dropdown';
|
|
6
|
+
import { ReactNode, Key } from 'react';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Menu item type
|
|
10
|
+
*/
|
|
11
|
+
interface MenuItem {
|
|
12
|
+
/** unique identifier */
|
|
13
|
+
key: string;
|
|
14
|
+
/** CSS class name */
|
|
15
|
+
className?: string;
|
|
16
|
+
/** additional description shown under the label */
|
|
17
|
+
description?: string;
|
|
18
|
+
/** disables the menu item */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** menu item icon */
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
/** menu item name */
|
|
23
|
+
label: ReactNode;
|
|
24
|
+
/** click event handler */
|
|
25
|
+
onClick?: DropdownItemProps['onPress'];
|
|
26
|
+
/** e2e test identifier */
|
|
27
|
+
testId?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Menu section type
|
|
31
|
+
*/
|
|
32
|
+
interface MenuSection {
|
|
33
|
+
/** unique identifier */
|
|
34
|
+
key: string;
|
|
35
|
+
/** section label */
|
|
36
|
+
label: ReactNode;
|
|
37
|
+
/** section items (array of MenuItem) */
|
|
38
|
+
items: MenuItem[];
|
|
39
|
+
}
|
|
40
|
+
declare const menuVariants: tailwind_variants.TVReturnType<{
|
|
41
|
+
[key: string]: {
|
|
42
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
43
|
+
trigger?: tailwind_variants.ClassValue;
|
|
44
|
+
item?: tailwind_variants.ClassValue;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
} | {
|
|
48
|
+
[x: string]: {
|
|
49
|
+
[x: string]: tailwind_variants.ClassValue | {
|
|
50
|
+
trigger?: tailwind_variants.ClassValue;
|
|
51
|
+
item?: tailwind_variants.ClassValue;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
} | {}, {
|
|
55
|
+
item: string;
|
|
56
|
+
trigger: string;
|
|
57
|
+
}, undefined, {
|
|
58
|
+
[key: string]: {
|
|
59
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
60
|
+
trigger?: tailwind_variants.ClassValue;
|
|
61
|
+
item?: tailwind_variants.ClassValue;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
} | {}, {
|
|
65
|
+
item: string;
|
|
66
|
+
trigger: string;
|
|
67
|
+
}, tailwind_variants.TVReturnType<unknown, {
|
|
68
|
+
item: string;
|
|
69
|
+
trigger: string;
|
|
70
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
71
|
+
type VariantProps = TVProps<typeof menuVariants>;
|
|
72
|
+
type ClassName = TVClassName<typeof menuVariants>;
|
|
73
|
+
interface MenuProps extends VariantProps {
|
|
74
|
+
/** sets HTML aria-label attribute */
|
|
75
|
+
ariaLabel?: string;
|
|
76
|
+
/** child components */
|
|
77
|
+
children?: ReactNode;
|
|
78
|
+
/** CSS class name */
|
|
79
|
+
className?: ClassName;
|
|
80
|
+
/** menu item structure */
|
|
81
|
+
items: (MenuSection | MenuItem)[];
|
|
82
|
+
/** disable menu trigger */
|
|
83
|
+
isDisabled?: boolean;
|
|
84
|
+
/** placement of the menu */
|
|
85
|
+
placement?: DropdownProps['placement'];
|
|
86
|
+
/** called if item is selected */
|
|
87
|
+
onAction?: (key: Key) => void;
|
|
88
|
+
/** HTML data-testid attribute used in e2e tests */
|
|
89
|
+
testId?: string;
|
|
90
|
+
/** When defined a Button will be rendered as trigger (with provided props) instead of unstyled html button */
|
|
91
|
+
triggerButtonProps?: Pick<ButtonProps, 'aria-label' | 'className' | 'color' | 'disableAnimation' | 'disabled' | 'size' | 'variant'>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Dropdown menu component based on [HeroUI Dropdown](https://www.heroui.com//docs/components/dropdown)
|
|
95
|
+
*/
|
|
96
|
+
declare const Menu: ({ ariaLabel, children, className: _className, isDisabled, items, onAction, placement, testId, triggerButtonProps, }: MenuProps) => react_jsx_runtime.JSX.Element;
|
|
97
|
+
|
|
98
|
+
export { Menu as M, type MenuProps as a, type MenuItem as b, type MenuSection as c };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
3
|
+
import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
|
|
4
|
+
import { ButtonProps } from '@heroui/button';
|
|
5
|
+
import { DropdownItemProps, DropdownProps } from '@heroui/dropdown';
|
|
6
|
+
import { ReactNode, Key } from 'react';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Menu item type
|
|
10
|
+
*/
|
|
11
|
+
interface MenuItem {
|
|
12
|
+
/** unique identifier */
|
|
13
|
+
key: string;
|
|
14
|
+
/** CSS class name */
|
|
15
|
+
className?: string;
|
|
16
|
+
/** additional description shown under the label */
|
|
17
|
+
description?: string;
|
|
18
|
+
/** disables the menu item */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** menu item icon */
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
/** menu item name */
|
|
23
|
+
label: ReactNode;
|
|
24
|
+
/** click event handler */
|
|
25
|
+
onClick?: DropdownItemProps['onPress'];
|
|
26
|
+
/** e2e test identifier */
|
|
27
|
+
testId?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Menu section type
|
|
31
|
+
*/
|
|
32
|
+
interface MenuSection {
|
|
33
|
+
/** unique identifier */
|
|
34
|
+
key: string;
|
|
35
|
+
/** section label */
|
|
36
|
+
label: ReactNode;
|
|
37
|
+
/** section items (array of MenuItem) */
|
|
38
|
+
items: MenuItem[];
|
|
39
|
+
}
|
|
40
|
+
declare const menuVariants: tailwind_variants.TVReturnType<{
|
|
41
|
+
[key: string]: {
|
|
42
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
43
|
+
trigger?: tailwind_variants.ClassValue;
|
|
44
|
+
item?: tailwind_variants.ClassValue;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
} | {
|
|
48
|
+
[x: string]: {
|
|
49
|
+
[x: string]: tailwind_variants.ClassValue | {
|
|
50
|
+
trigger?: tailwind_variants.ClassValue;
|
|
51
|
+
item?: tailwind_variants.ClassValue;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
} | {}, {
|
|
55
|
+
item: string;
|
|
56
|
+
trigger: string;
|
|
57
|
+
}, undefined, {
|
|
58
|
+
[key: string]: {
|
|
59
|
+
[key: string]: tailwind_variants.ClassValue | {
|
|
60
|
+
trigger?: tailwind_variants.ClassValue;
|
|
61
|
+
item?: tailwind_variants.ClassValue;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
} | {}, {
|
|
65
|
+
item: string;
|
|
66
|
+
trigger: string;
|
|
67
|
+
}, tailwind_variants.TVReturnType<unknown, {
|
|
68
|
+
item: string;
|
|
69
|
+
trigger: string;
|
|
70
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
71
|
+
type VariantProps = TVProps<typeof menuVariants>;
|
|
72
|
+
type ClassName = TVClassName<typeof menuVariants>;
|
|
73
|
+
interface MenuProps extends VariantProps {
|
|
74
|
+
/** sets HTML aria-label attribute */
|
|
75
|
+
ariaLabel?: string;
|
|
76
|
+
/** child components */
|
|
77
|
+
children?: ReactNode;
|
|
78
|
+
/** CSS class name */
|
|
79
|
+
className?: ClassName;
|
|
80
|
+
/** menu item structure */
|
|
81
|
+
items: (MenuSection | MenuItem)[];
|
|
82
|
+
/** disable menu trigger */
|
|
83
|
+
isDisabled?: boolean;
|
|
84
|
+
/** placement of the menu */
|
|
85
|
+
placement?: DropdownProps['placement'];
|
|
86
|
+
/** called if item is selected */
|
|
87
|
+
onAction?: (key: Key) => void;
|
|
88
|
+
/** HTML data-testid attribute used in e2e tests */
|
|
89
|
+
testId?: string;
|
|
90
|
+
/** When defined a Button will be rendered as trigger (with provided props) instead of unstyled html button */
|
|
91
|
+
triggerButtonProps?: Pick<ButtonProps, 'aria-label' | 'className' | 'color' | 'disableAnimation' | 'disabled' | 'size' | 'variant'>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Dropdown menu component based on [HeroUI Dropdown](https://www.heroui.com//docs/components/dropdown)
|
|
95
|
+
*/
|
|
96
|
+
declare const Menu: ({ ariaLabel, children, className: _className, isDisabled, items, onAction, placement, testId, triggerButtonProps, }: MenuProps) => react_jsx_runtime.JSX.Element;
|
|
97
|
+
|
|
98
|
+
export { Menu as M, type MenuProps as a, type MenuItem as b, type MenuSection as c };
|
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 _chunk3Y7P46WTcjs = require('../chunk-3Y7P46WT.cjs');
|
|
5
5
|
require('../chunk-FUBGS3G4.cjs');
|
|
6
6
|
require('../chunk-D4TLDLEX.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.Popover =
|
|
10
|
+
exports.Popover = _chunk3Y7P46WTcjs.Popover_default; exports.default = _chunk3Y7P46WTcjs.Popover_default2;
|
|
11
11
|
//# sourceMappingURL=index.cjs.map
|
package/dist/Popover/index.d.cts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { _ as _default } from '../Popover-
|
|
2
|
-
export { P as PopoverProps } from '../Popover-
|
|
1
|
+
import { _ as _default } from '../Popover-BsdcKPgm.cjs';
|
|
2
|
+
export { P as PopoverProps } from '../Popover-BsdcKPgm.cjs';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'tailwind-variants';
|
|
5
5
|
import '@fuf-stack/pixel-utils';
|
|
6
|
+
import '@heroui/button';
|
|
6
7
|
import '@heroui/popover';
|
|
7
8
|
import 'react';
|
|
8
|
-
import '../Button-rsBnawn1.cjs';
|
|
9
|
-
import '@heroui/button';
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
|
package/dist/Popover/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { _ as _default } from '../Popover-
|
|
2
|
-
export { P as PopoverProps } from '../Popover-
|
|
1
|
+
import { _ as _default } from '../Popover-BsdcKPgm.js';
|
|
2
|
+
export { P as PopoverProps } from '../Popover-BsdcKPgm.js';
|
|
3
3
|
import 'react/jsx-runtime';
|
|
4
4
|
import 'tailwind-variants';
|
|
5
5
|
import '@fuf-stack/pixel-utils';
|
|
6
|
+
import '@heroui/button';
|
|
6
7
|
import '@heroui/popover';
|
|
7
8
|
import 'react';
|
|
8
|
-
import '../Button-rsBnawn1.js';
|
|
9
|
-
import '@heroui/button';
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
|
package/dist/Popover/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as tailwind_variants from 'tailwind-variants';
|
|
3
3
|
import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
|
|
4
|
+
import { ButtonProps } from '@heroui/button';
|
|
4
5
|
import { PopoverProps as PopoverProps$1 } from '@heroui/popover';
|
|
5
6
|
import { ReactNode } from 'react';
|
|
6
|
-
import { a as ButtonProps } from './Button-rsBnawn1.js';
|
|
7
7
|
|
|
8
8
|
declare const popoverVariants: tailwind_variants.TVReturnType<{
|
|
9
9
|
[key: string]: {
|
|
@@ -101,7 +101,7 @@ interface PopoverProps extends VariantProps {
|
|
|
101
101
|
/** HTML data-testid attribute used in e2e tests */
|
|
102
102
|
testId?: string;
|
|
103
103
|
/** When defined a Button will be rendered as trigger (with provided props) instead of unstyled html button */
|
|
104
|
-
triggerButtonProps?: Pick<ButtonProps, '
|
|
104
|
+
triggerButtonProps?: Pick<ButtonProps, 'aria-label' | 'className' | 'color' | 'disableAnimation' | 'disabled' | 'size' | 'variant'>;
|
|
105
105
|
}
|
|
106
106
|
/**
|
|
107
107
|
* Popover component based on [HeroUI Card](https://www.heroui.com//docs/components/popover)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as tailwind_variants from 'tailwind-variants';
|
|
3
3
|
import { TVProps, TVClassName } from '@fuf-stack/pixel-utils';
|
|
4
|
+
import { ButtonProps } from '@heroui/button';
|
|
4
5
|
import { PopoverProps as PopoverProps$1 } from '@heroui/popover';
|
|
5
6
|
import { ReactNode } from 'react';
|
|
6
|
-
import { a as ButtonProps } from './Button-rsBnawn1.cjs';
|
|
7
7
|
|
|
8
8
|
declare const popoverVariants: tailwind_variants.TVReturnType<{
|
|
9
9
|
[key: string]: {
|
|
@@ -101,7 +101,7 @@ interface PopoverProps extends VariantProps {
|
|
|
101
101
|
/** HTML data-testid attribute used in e2e tests */
|
|
102
102
|
testId?: string;
|
|
103
103
|
/** When defined a Button will be rendered as trigger (with provided props) instead of unstyled html button */
|
|
104
|
-
triggerButtonProps?: Pick<ButtonProps, '
|
|
104
|
+
triggerButtonProps?: Pick<ButtonProps, 'aria-label' | 'className' | 'color' | 'disableAnimation' | 'disabled' | 'size' | 'variant'>;
|
|
105
105
|
}
|
|
106
106
|
/**
|
|
107
107
|
* Popover component based on [HeroUI Card](https://www.heroui.com//docs/components/popover)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-3Y7P46WT.cjs","../src/Popover/Popover.tsx","../src/Popover/index.ts"],"names":["Popover_default"],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACE;AACA;AACF,wDAA6B;AAC7B;AACA;ACHA,wCAAuB;AACvB,0C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QAAA,EAAA,OAAA,CAAO;AAAA,UAAA,EAAA,CAC5C;AAAA,QAAA,EAAA,CAEJ;AAAA,MAAA;AAAA,IAAA,CAAA;AAAA,EACF,CAAA;AAEJ,CAAA;ADtDA;AACA;AEvEA,IAAOA,iBAAAA,EAAQ,eAAA;AFyEf;AACA;AACE;AACA;AACF,uFAAC","file":"/home/runner/work/pixels/pixels/packages/pixels/dist/chunk-3Y7P46WT.cjs","sourcesContent":[null,"import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ButtonProps } from '@heroui/button';\nimport type { PopoverProps as HeroPopoverProps } from '@heroui/popover';\nimport type { ReactNode } from 'react';\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-4 py-2',\n content: 'flex max-h-[80vh] flex-col p-0',\n divider: 'border-divider m-0 w-full p-0',\n footer: 'w-full px-4 py-2',\n footerWrapper: 'w-full',\n header: 'w-full px-4 pt-2 pb-1 font-semibold',\n headerWrapper: 'w-full',\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 /** Popover title */\n header?: 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 /** When defined a Button will be rendered as trigger (with provided props) instead of unstyled html button */\n triggerButtonProps?: Pick<\n ButtonProps,\n | 'aria-label'\n | 'className'\n | 'color'\n | 'disableAnimation'\n | 'disabled'\n | 'size'\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 header = undefined,\n openControlled = undefined,\n placement = 'top',\n portalContainer = undefined,\n shouldBlockScroll = undefined,\n testId = 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 {header && (\n <div className={className.headerWrapper}>\n <div className={className.header}>{header}</div>\n <hr className={className.divider} />\n </div>\n )}\n <ScrollShadow className={className.body}>{content}</ScrollShadow>\n {footer && (\n <div className={className.footerWrapper}>\n <hr className={className.divider} />\n <div className={className.footer}>{footer}</div>\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"]}
|
|
@@ -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 { ButtonProps } from '@heroui/button';\nimport type { PopoverProps as HeroPopoverProps } from '@heroui/popover';\nimport type { ReactNode } from 'react';\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-4 py-2',\n content: 'flex max-h-[80vh] flex-col p-0',\n divider: 'border-divider m-0 w-full p-0',\n footer: 'w-full px-4 py-2',\n footerWrapper: 'w-full',\n header: 'w-full px-4 pt-2 pb-1 font-semibold',\n headerWrapper: 'w-full',\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 /** Popover title */\n header?: 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 /** When defined a Button will be rendered as trigger (with provided props) instead of unstyled html button */\n triggerButtonProps?: Pick<\n ButtonProps,\n | 'aria-label'\n | 'className'\n | 'color'\n | 'disableAnimation'\n | 'disabled'\n | 'size'\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 header = undefined,\n openControlled = undefined,\n placement = 'top',\n portalContainer = undefined,\n shouldBlockScroll = undefined,\n testId = 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 {header && (\n <div className={className.headerWrapper}>\n <div className={className.header}>{header}</div>\n <hr className={className.divider} />\n </div>\n )}\n <ScrollShadow className={className.body}>{content}</ScrollShadow>\n {footer && (\n <div className={className.footerWrapper}>\n <hr className={className.divider} />\n <div className={className.footer}>{footer}</div>\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;AAiG/B,cAUA,YAVA;AA5FH,IAAM,kBAAkB,GAAG;AAAA,EAChC,OAAO;AAAA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AAW,UAAU,QAAS,kBAAO;AAAA,aAC5C;AAAA,WAEJ;AAAA;AAAA;AAAA,EACF;AAEJ;;;AC5HA,IAAOA,mBAAQ;","names":["Popover_default"]}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
// src/Button/Button.tsx
|
|
6
6
|
import { Button as HeroButton } from "@heroui/button";
|
|
7
7
|
import { button as heroButtonVariants } from "@heroui/theme";
|
|
8
|
-
import { tv } from "@fuf-stack/pixel-utils";
|
|
8
|
+
import { tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
9
9
|
|
|
10
10
|
// src/Button/subcomponents/LoadingSpinner.tsx
|
|
11
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -43,7 +43,9 @@ var LoadingSpinner_default = () => /* @__PURE__ */ jsxs(
|
|
|
43
43
|
// src/Button/Button.tsx
|
|
44
44
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
45
45
|
var buttonVariants = tv({
|
|
46
|
-
|
|
46
|
+
slots: {
|
|
47
|
+
base: ""
|
|
48
|
+
},
|
|
47
49
|
variants: {
|
|
48
50
|
color: __spreadValues({
|
|
49
51
|
// see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/button.ts
|
|
@@ -119,11 +121,13 @@ var Button = ({
|
|
|
119
121
|
type = void 0,
|
|
120
122
|
variant = "solid"
|
|
121
123
|
}) => {
|
|
124
|
+
const variants = buttonVariants({ color, variant, size });
|
|
125
|
+
const classNames = variantsToClassNames(variants, className, "base");
|
|
122
126
|
return /* @__PURE__ */ jsxs2(
|
|
123
127
|
HeroButton,
|
|
124
128
|
{
|
|
125
129
|
"aria-label": ariaLabel,
|
|
126
|
-
className:
|
|
130
|
+
className: classNames.base,
|
|
127
131
|
color,
|
|
128
132
|
"data-testid": testId,
|
|
129
133
|
disableAnimation,
|
|
@@ -154,4 +158,4 @@ export {
|
|
|
154
158
|
Button_default,
|
|
155
159
|
Button_default2
|
|
156
160
|
};
|
|
157
|
-
//# sourceMappingURL=chunk-
|
|
161
|
+
//# sourceMappingURL=chunk-HOWDEBJG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Button/Button.tsx","../src/Button/subcomponents/LoadingSpinner.tsx","../src/Button/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ButtonProps as HeroButtonProps } from '@heroui/button';\nimport type { ReactNode } from 'react';\n\nimport { Button as HeroButton } from '@heroui/button';\nimport { button as heroButtonVariants } from '@heroui/theme';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport LoadingSpinner from './subcomponents/LoadingSpinner';\n\nexport const buttonVariants = tv({\n slots: {\n base: '',\n },\n variants: {\n color: {\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/button.ts\n info: '',\n ...heroButtonVariants.variants.color,\n },\n variant: heroButtonVariants.variants.variant,\n size: heroButtonVariants.variants.size,\n },\n compoundVariants: [\n // white text on solid / shadow success button\n {\n color: 'success',\n variant: ['solid', 'shadow'],\n class: 'text-white',\n },\n // white text on solid / shadow warning button\n {\n color: 'warning',\n variant: ['solid', 'shadow'],\n class: 'text-white',\n },\n {\n color: 'info',\n variant: 'solid',\n class: 'bg-info text-info-foreground',\n },\n {\n color: 'info',\n variant: 'shadow',\n class: 'text-info-foreground\" bg-info shadow-info/40 shadow-lg',\n },\n {\n color: 'info',\n variant: 'bordered',\n class: 'border-medium border-info text-info bg-transparent',\n },\n {\n color: 'info',\n variant: 'flat',\n class: 'bg-info/20 text-info-600',\n },\n {\n color: 'info',\n variant: 'faded',\n class: 'border-default bg-default-100 text-info',\n },\n {\n color: 'info',\n variant: 'light',\n class: 'text-info data-[hover=true]:bg-info-100 bg-transparent',\n },\n {\n color: 'info',\n variant: 'ghost',\n class:\n 'border-info text-info data-[hover=true]:!bg-info data-[hover=true]:!text-info-foreground',\n },\n ],\n});\n\ntype VariantProps = TVProps<typeof buttonVariants>;\ntype ClassName = TVClassName<typeof buttonVariants>;\n\nexport interface ButtonProps extends VariantProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** content of the button */\n children?: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** color of the button */\n color?: HeroButtonProps['color'];\n /** disables the button */\n disabled?: boolean;\n /** disables all animations */\n disableAnimation?: boolean;\n /** shows loading animation */\n loading?: boolean;\n /** optional icon */\n icon?: ReactNode;\n /** click event handler */\n onClick?: HeroButtonProps['onPress'];\n /** border radius size */\n radius?: HeroButtonProps['radius'];\n /** enable ripple animation effect on click */\n ripple?: boolean;\n /** size options */\n size?: HeroButtonProps['size'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** HTML button type attribute */\n type?: 'button' | 'submit' | 'reset' | undefined;\n /** visual style variant */\n variant?: HeroButtonProps['variant'];\n}\n\n/**\n * Button component based on [HeroUI Button](https://www.heroui.com//docs/components/button)\n */\nconst Button = ({\n ariaLabel = undefined,\n children = undefined,\n className = undefined,\n color = 'default',\n disableAnimation = false,\n disabled = false,\n icon = undefined,\n loading = false,\n onClick = undefined,\n radius = undefined,\n ripple = false,\n size = undefined,\n testId = undefined,\n type = undefined,\n variant = 'solid',\n}: ButtonProps) => {\n // classNames from slots\n const variants = buttonVariants({ color, variant, size });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n return (\n <HeroButton\n aria-label={ariaLabel}\n className={classNames.base}\n color={color}\n data-testid={testId}\n disableAnimation={disableAnimation}\n disableRipple={disableAnimation || !ripple}\n isDisabled={disabled}\n isIconOnly={!!(icon && !children)}\n isLoading={loading}\n onPress={onClick}\n radius={radius}\n size={size}\n spinner={<LoadingSpinner />}\n type={type}\n variant={variant}\n >\n {icon}\n {children}\n </HeroButton>\n );\n};\n\nexport default Button;\n","/**\n * svg loading spinner for button\n * @see https://www.heroui.com//docs/components/button#loading\n * */\nexport default () => (\n <svg\n className=\"h-5 w-5 animate-spin text-current\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <circle\n className=\"opacity-25\"\n cx=\"12\"\n cy=\"12\"\n r=\"10\"\n stroke=\"currentColor\"\n strokeWidth=\"4\"\n />\n <path\n className=\"opacity-75\"\n d=\"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z\"\n fill=\"currentColor\"\n />\n </svg>\n);\n","import Button, { buttonVariants } from './Button';\n\nexport type { ButtonProps } from './Button';\n\nexport { Button, buttonVariants };\n\nexport default Button;\n"],"mappings":";;;;;AAIA,SAAS,UAAU,kBAAkB;AACrC,SAAS,UAAU,0BAA0B;AAE7C,SAAS,IAAI,4BAA4B;;;ACFvC,SAME,KANF;AADF,IAAO,yBAAQ,MACb;AAAA,EAAC;AAAA;AAAA,IACC,WAAU;AAAA,IACV,MAAK;AAAA,IACL,SAAQ;AAAA,IACR,OAAM;AAAA,IAEN;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,IAAG;AAAA,UACH,IAAG;AAAA,UACH,GAAE;AAAA,UACF,QAAO;AAAA,UACP,aAAY;AAAA;AAAA,MACd;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,WAAU;AAAA,UACV,GAAE;AAAA,UACF,MAAK;AAAA;AAAA,MACP;AAAA;AAAA;AACF;;;ADiHE,SAaW,OAAAA,MAbX,QAAAC,aAAA;AA9HG,IAAM,iBAAiB,GAAG;AAAA,EAC/B,OAAO;AAAA,IACL,MAAM;AAAA,EACR;AAAA,EACA,UAAU;AAAA,IACR,OAAO;AAAA;AAAA,MAEL,MAAM;AAAA,OACH,mBAAmB,SAAS;AAAA,IAEjC,SAAS,mBAAmB,SAAS;AAAA,IACrC,MAAM,mBAAmB,SAAS;AAAA,EACpC;AAAA,EACA,kBAAkB;AAAA;AAAA,IAEhB;AAAA,MACE,OAAO;AAAA,MACP,S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