@rootui/button 0.0.3 → 0.0.5
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/LICENSE +21 -0
- package/README.md +63 -5
- package/dist/{base-ui/Button.d.ts → Button.d.ts} +62 -30
- package/dist/Button.js +1 -0
- package/dist/chunk-W3ZTRXNP.js +141 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -2
- package/package.json +14 -16
- package/dist/base-ui/Button.js +0 -1
- package/dist/base-ui/index.d.ts +0 -4
- package/dist/base-ui/index.js +0 -2
- package/dist/chunk-R76X4JK7.js +0 -166
- package/dist/chunk-ZXORUS7M.js +0 -1
package/LICENSE
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) [2026] [Root UI]
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,15 +1,73 @@
|
|
|
1
1
|
# @rootui/button
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/rootui-org/root-ui) [](https://www.npmjs.com/package/@rootui/button) [](https://root-ui.com/primitives/button) [](https://x.com/rootui_)
|
|
4
4
|
|
|
5
|
+
Buttons allow users to perform actions with mouse, touch, and keyboard interactions.
|
|
6
|
+
|
|
7
|
+
- 📖 Docs: [Root UI button docs](https://root-ui.com/primitives/button)
|
|
8
|
+
- 📄 Source: [Github repository](https://github.com/rootui-org/root-ui)
|
|
9
|
+
- 🐛 Report an issue: [Open an issue](#)
|
|
10
|
+
- 📦 Package: [@rootui/button](https://www.npmjs.com/package/@rootui/button)
|
|
11
|
+
|
|
12
|
+
## 🧬 Anatomy
|
|
13
|
+
```tsx
|
|
14
|
+
<Button></Button>
|
|
15
|
+
```
|
|
16
|
+
## 🛠️ Installation
|
|
17
|
+
### 1. 📌 Prerequisite
|
|
18
|
+
#### 1.1. ⚙️ Install dependecies
|
|
19
|
+
Check the [getting started guide](https://root-ui.com/docs/getting-started) for more info.
|
|
20
|
+
If you haven't installed the dependecies yet, then run this command:
|
|
5
21
|
```bash
|
|
6
|
-
|
|
22
|
+
npm install react-aria-components tw-animate-css
|
|
23
|
+
# or
|
|
24
|
+
yarn add react-aria-components tw-animate-css
|
|
25
|
+
# or
|
|
26
|
+
pnpm add react-aria-components tw-animate-css
|
|
27
|
+
# or
|
|
28
|
+
bun add react-aria-components tw-animate-css
|
|
7
29
|
```
|
|
30
|
+
#### 1.2. 🎨 Choose a theme
|
|
31
|
+
You need to pick a theme from the [official Root UI website](https://root-ui.com/playground).
|
|
8
32
|
|
|
9
|
-
To run:
|
|
10
33
|
|
|
34
|
+
### 2. 🍉 Install component
|
|
35
|
+
#### Option 1: 📦 Package
|
|
11
36
|
```bash
|
|
12
|
-
|
|
37
|
+
npm install @rootui/button
|
|
38
|
+
# or
|
|
39
|
+
yarn add @rootui/button
|
|
40
|
+
# or
|
|
41
|
+
pnpm add @rootui/button
|
|
42
|
+
# or
|
|
43
|
+
bun add @rootui/button
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
#### Option 2: 🏗️ Manual
|
|
47
|
+
Check the [Root UI button docs](https://root-ui.com/docs/primitives/button#installation).
|
|
48
|
+
|
|
49
|
+
## 💻 Usage
|
|
50
|
+
```tsx
|
|
51
|
+
import { Button } from "@rootui/button";
|
|
52
|
+
|
|
53
|
+
export default function Page() {
|
|
54
|
+
return (
|
|
55
|
+
<Button>Click me</Button>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
13
58
|
```
|
|
59
|
+
## 📃 API Reference
|
|
60
|
+
Check the [Root UI button docs](https://root-ui.com/docs/primitives/button#api-reference).
|
|
61
|
+
|
|
62
|
+
## 🤝 Contributing
|
|
63
|
+
Contributions are welcome! If you have suggestions for improvements or encounter any issues, please open an issue or submit a pull request on the [GitHub repository](#).
|
|
64
|
+
|
|
65
|
+
Steps to Contribute:
|
|
66
|
+
|
|
67
|
+
1. Fork the repository. 🍴
|
|
68
|
+
2. Create a new branch for your feature or bugfix. 🌿
|
|
69
|
+
3. Commit your changes. 💾
|
|
70
|
+
4. Push your branch and submit a pull request. 🚀
|
|
14
71
|
|
|
15
|
-
|
|
72
|
+
## 📜 License
|
|
73
|
+
This project is licensed under the MIT License. See the [LICENSE](https://github.com/rootui-org/root-ui/blob/main/LICENSE.md) file for details.
|
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import * as tailwind_variants from 'tailwind-variants';
|
|
3
3
|
import { VariantProps } from 'tailwind-variants';
|
|
4
|
-
import { ButtonProps as ButtonProps$1 } from '
|
|
4
|
+
import { ButtonProps as ButtonProps$1 } from 'react-aria-components';
|
|
5
5
|
|
|
6
|
-
interface ButtonProps extends VariantProps<typeof button>,
|
|
6
|
+
interface ButtonProps extends VariantProps<typeof button>, ButtonProps$1 {
|
|
7
|
+
customLoadingIcon?: React.ReactElement;
|
|
8
|
+
loadingIconProps?: LoadingIconProps;
|
|
9
|
+
}
|
|
10
|
+
interface LoadingIconProps extends React.ComponentProps<'svg'>, VariantProps<typeof buttonLoadingIcon> {
|
|
7
11
|
}
|
|
8
12
|
declare const button: tailwind_variants.TVReturnType<{
|
|
9
|
-
|
|
10
|
-
false: string[];
|
|
13
|
+
isLoading: {
|
|
11
14
|
true: string;
|
|
12
15
|
};
|
|
13
16
|
isDisabled: {
|
|
14
17
|
true: string;
|
|
18
|
+
false: string;
|
|
15
19
|
};
|
|
16
20
|
size: {
|
|
17
21
|
sm: string;
|
|
18
22
|
md: string;
|
|
19
23
|
lg: string;
|
|
20
24
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
outlined: string;
|
|
24
|
-
subtle: string;
|
|
25
|
-
transparent: string;
|
|
25
|
+
isIconOnly: {
|
|
26
|
+
true: string;
|
|
26
27
|
};
|
|
27
|
-
|
|
28
|
+
color: {
|
|
28
29
|
neutral: string;
|
|
29
30
|
primary: string;
|
|
30
31
|
secondary: string;
|
|
@@ -34,26 +35,35 @@ declare const button: tailwind_variants.TVReturnType<{
|
|
|
34
35
|
danger: string;
|
|
35
36
|
magic: string;
|
|
36
37
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
variant: {
|
|
39
|
+
filled: string;
|
|
40
|
+
outlined: string;
|
|
41
|
+
subtle: string;
|
|
42
|
+
transparent: string;
|
|
43
|
+
};
|
|
44
|
+
isHovered: {
|
|
45
|
+
true: string;
|
|
46
|
+
};
|
|
47
|
+
isPressed: {
|
|
48
|
+
true: string;
|
|
49
|
+
};
|
|
50
|
+
}, undefined, "button-base", {
|
|
51
|
+
isLoading: {
|
|
40
52
|
true: string;
|
|
41
53
|
};
|
|
42
54
|
isDisabled: {
|
|
43
55
|
true: string;
|
|
56
|
+
false: string;
|
|
44
57
|
};
|
|
45
58
|
size: {
|
|
46
59
|
sm: string;
|
|
47
60
|
md: string;
|
|
48
61
|
lg: string;
|
|
49
62
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
outlined: string;
|
|
53
|
-
subtle: string;
|
|
54
|
-
transparent: string;
|
|
63
|
+
isIconOnly: {
|
|
64
|
+
true: string;
|
|
55
65
|
};
|
|
56
|
-
|
|
66
|
+
color: {
|
|
57
67
|
neutral: string;
|
|
58
68
|
primary: string;
|
|
59
69
|
secondary: string;
|
|
@@ -63,26 +73,35 @@ declare const button: tailwind_variants.TVReturnType<{
|
|
|
63
73
|
danger: string;
|
|
64
74
|
magic: string;
|
|
65
75
|
};
|
|
76
|
+
variant: {
|
|
77
|
+
filled: string;
|
|
78
|
+
outlined: string;
|
|
79
|
+
subtle: string;
|
|
80
|
+
transparent: string;
|
|
81
|
+
};
|
|
82
|
+
isHovered: {
|
|
83
|
+
true: string;
|
|
84
|
+
};
|
|
85
|
+
isPressed: {
|
|
86
|
+
true: string;
|
|
87
|
+
};
|
|
66
88
|
}, undefined, tailwind_variants.TVReturnType<{
|
|
67
|
-
|
|
68
|
-
false: string[];
|
|
89
|
+
isLoading: {
|
|
69
90
|
true: string;
|
|
70
91
|
};
|
|
71
92
|
isDisabled: {
|
|
72
93
|
true: string;
|
|
94
|
+
false: string;
|
|
73
95
|
};
|
|
74
96
|
size: {
|
|
75
97
|
sm: string;
|
|
76
98
|
md: string;
|
|
77
99
|
lg: string;
|
|
78
100
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
outlined: string;
|
|
82
|
-
subtle: string;
|
|
83
|
-
transparent: string;
|
|
101
|
+
isIconOnly: {
|
|
102
|
+
true: string;
|
|
84
103
|
};
|
|
85
|
-
|
|
104
|
+
color: {
|
|
86
105
|
neutral: string;
|
|
87
106
|
primary: string;
|
|
88
107
|
secondary: string;
|
|
@@ -92,7 +111,20 @@ declare const button: tailwind_variants.TVReturnType<{
|
|
|
92
111
|
danger: string;
|
|
93
112
|
magic: string;
|
|
94
113
|
};
|
|
95
|
-
|
|
96
|
-
|
|
114
|
+
variant: {
|
|
115
|
+
filled: string;
|
|
116
|
+
outlined: string;
|
|
117
|
+
subtle: string;
|
|
118
|
+
transparent: string;
|
|
119
|
+
};
|
|
120
|
+
isHovered: {
|
|
121
|
+
true: string;
|
|
122
|
+
};
|
|
123
|
+
isPressed: {
|
|
124
|
+
true: string;
|
|
125
|
+
};
|
|
126
|
+
}, undefined, "button-base", unknown, unknown, undefined>>;
|
|
127
|
+
declare const buttonLoadingIcon: tailwind_variants.TVReturnType<{} | {} | {}, undefined, "button-loading-icon-base", {} | {}, undefined, tailwind_variants.TVReturnType<unknown, undefined, "button-loading-icon-base", unknown, unknown, undefined>>;
|
|
128
|
+
declare function Button({ isIconOnly, color, variant, isLoading, size, isPending, loadingIconProps, customLoadingIcon, ...props }: ButtonProps): react_jsx_runtime.JSX.Element;
|
|
97
129
|
|
|
98
|
-
export { Button };
|
|
130
|
+
export { Button, type ButtonProps };
|
package/dist/Button.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Button } from './chunk-W3ZTRXNP.js';
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { tv } from 'tailwind-variants';
|
|
2
|
+
import { Button as Button$1, composeRenderProps } from 'react-aria-components';
|
|
3
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
// src/Button.tsx
|
|
6
|
+
var button = tv({
|
|
7
|
+
base: "button-base",
|
|
8
|
+
variants: {
|
|
9
|
+
isLoading: {
|
|
10
|
+
true: "button-loading"
|
|
11
|
+
},
|
|
12
|
+
isDisabled: {
|
|
13
|
+
true: "button-disabled",
|
|
14
|
+
false: "button-not-disabled"
|
|
15
|
+
},
|
|
16
|
+
size: {
|
|
17
|
+
sm: "button-sm",
|
|
18
|
+
md: "button-md",
|
|
19
|
+
lg: "button-lg"
|
|
20
|
+
},
|
|
21
|
+
isIconOnly: {
|
|
22
|
+
true: "button-icon-only"
|
|
23
|
+
},
|
|
24
|
+
color: {
|
|
25
|
+
neutral: "",
|
|
26
|
+
primary: "",
|
|
27
|
+
secondary: "",
|
|
28
|
+
info: "",
|
|
29
|
+
success: "",
|
|
30
|
+
warning: "",
|
|
31
|
+
danger: "",
|
|
32
|
+
magic: ""
|
|
33
|
+
},
|
|
34
|
+
variant: {
|
|
35
|
+
filled: "button-filled",
|
|
36
|
+
outlined: "button-outlined",
|
|
37
|
+
subtle: "button-subtle",
|
|
38
|
+
transparent: "button-transparent"
|
|
39
|
+
},
|
|
40
|
+
isHovered: {
|
|
41
|
+
true: "button-hovered"
|
|
42
|
+
},
|
|
43
|
+
isPressed: {
|
|
44
|
+
true: "button-pressed"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
compoundVariants: [
|
|
48
|
+
// Filled variants
|
|
49
|
+
{ variant: "filled", color: "neutral", className: "button-filled-neutral" },
|
|
50
|
+
{ variant: "filled", color: "primary", className: "button-filled-primary" },
|
|
51
|
+
{ variant: "filled", color: "secondary", className: "button-filled-secondary" },
|
|
52
|
+
{ variant: "filled", color: "info", className: "button-filled-info" },
|
|
53
|
+
{ variant: "filled", color: "success", className: "button-filled-success" },
|
|
54
|
+
{ variant: "filled", color: "warning", className: "button-filled-warning" },
|
|
55
|
+
{ variant: "filled", color: "danger", className: "button-filled-danger" },
|
|
56
|
+
{ variant: "filled", color: "magic", className: "button-filled-magic" },
|
|
57
|
+
// Outlined variants
|
|
58
|
+
{ variant: "outlined", color: "neutral", className: "button-outlined-neutral" },
|
|
59
|
+
{ variant: "outlined", color: "primary", className: "button-outlined-primary" },
|
|
60
|
+
{ variant: "outlined", color: "secondary", className: "button-outlined-secondary" },
|
|
61
|
+
{ variant: "outlined", color: "info", className: "button-outlined-info" },
|
|
62
|
+
{ variant: "outlined", color: "success", className: "button-outlined-success" },
|
|
63
|
+
{ variant: "outlined", color: "warning", className: "button-outlined-warning" },
|
|
64
|
+
{ variant: "outlined", color: "danger", className: "button-outlined-danger" },
|
|
65
|
+
{ variant: "outlined", color: "magic", className: "button-outlined-magic" },
|
|
66
|
+
// Subtle variants
|
|
67
|
+
{ variant: "subtle", color: "neutral", className: "button-subtle-neutral" },
|
|
68
|
+
{ variant: "subtle", color: "primary", className: "button-subtle-primary" },
|
|
69
|
+
{ variant: "subtle", color: "secondary", className: "button-subtle-secondary" },
|
|
70
|
+
{ variant: "subtle", color: "info", className: "button-subtle-info" },
|
|
71
|
+
{ variant: "subtle", color: "success", className: "button-subtle-success" },
|
|
72
|
+
{ variant: "subtle", color: "warning", className: "button-subtle-warning" },
|
|
73
|
+
{ variant: "subtle", color: "danger", className: "button-subtle-danger" },
|
|
74
|
+
{ variant: "subtle", color: "magic", className: "button-subtle-magic" },
|
|
75
|
+
// Transparent variants
|
|
76
|
+
{ variant: "transparent", color: "neutral", className: "button-transparent-neutral" },
|
|
77
|
+
{ variant: "transparent", color: "primary", className: "button-transparent-primary" },
|
|
78
|
+
{ variant: "transparent", color: "secondary", className: "button-transparent-secondary" },
|
|
79
|
+
{ variant: "transparent", color: "info", className: "button-transparent-info" },
|
|
80
|
+
{ variant: "transparent", color: "success", className: "button-transparent-success" },
|
|
81
|
+
{ variant: "transparent", color: "warning", className: "button-transparent-warning" },
|
|
82
|
+
{ variant: "transparent", color: "danger", className: "button-transparent-danger" },
|
|
83
|
+
{ variant: "transparent", color: "magic", className: "button-transparent-magic" }
|
|
84
|
+
],
|
|
85
|
+
defaultVariants: {
|
|
86
|
+
size: "md",
|
|
87
|
+
variant: "filled",
|
|
88
|
+
color: "neutral",
|
|
89
|
+
isDisabled: false,
|
|
90
|
+
isLoading: false
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
var buttonLoadingIcon = tv({
|
|
94
|
+
base: "button-loading-icon-base"
|
|
95
|
+
});
|
|
96
|
+
function LoadingIcon({
|
|
97
|
+
children,
|
|
98
|
+
className,
|
|
99
|
+
...props
|
|
100
|
+
}) {
|
|
101
|
+
return /* @__PURE__ */ jsx("span", { className: buttonLoadingIcon({ className }), children: children || /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", ...props, children: /* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) }) });
|
|
102
|
+
}
|
|
103
|
+
function Button({
|
|
104
|
+
isIconOnly,
|
|
105
|
+
color,
|
|
106
|
+
variant,
|
|
107
|
+
isLoading,
|
|
108
|
+
size,
|
|
109
|
+
isPending,
|
|
110
|
+
loadingIconProps,
|
|
111
|
+
customLoadingIcon,
|
|
112
|
+
...props
|
|
113
|
+
}) {
|
|
114
|
+
return /* @__PURE__ */ jsx(
|
|
115
|
+
Button$1,
|
|
116
|
+
{
|
|
117
|
+
...props,
|
|
118
|
+
isPending: isLoading || isPending,
|
|
119
|
+
className: composeRenderProps(
|
|
120
|
+
props.className,
|
|
121
|
+
(className, renderProps) => button({
|
|
122
|
+
...renderProps,
|
|
123
|
+
color,
|
|
124
|
+
variant,
|
|
125
|
+
isHovered: renderProps.isHovered,
|
|
126
|
+
isPressed: renderProps.isPressed,
|
|
127
|
+
size,
|
|
128
|
+
isLoading: isLoading || isPending,
|
|
129
|
+
isIconOnly,
|
|
130
|
+
className
|
|
131
|
+
})
|
|
132
|
+
),
|
|
133
|
+
children: composeRenderProps(props.children, (children, { isPending: isPending2 }) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
134
|
+
/* @__PURE__ */ jsx("span", { className: isLoading || isPending2 ? "text-transparent select-none" : "", children }),
|
|
135
|
+
(isLoading || isPending2) && /* @__PURE__ */ jsx(LoadingIcon, { ...loadingIconProps, children: customLoadingIcon })
|
|
136
|
+
] }))
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export { Button };
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { Button } from './chunk-R76X4JK7.js';
|
|
1
|
+
export { Button } from './chunk-W3ZTRXNP.js';
|
package/package.json
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rootui/button",
|
|
3
|
+
"description": "Buttons allow users to perform actions with mouse, touch, and keyboard interactions.",
|
|
3
4
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
5
|
-
"homepage": "https://root-ui.com",
|
|
5
|
+
"version": "0.0.5",
|
|
6
|
+
"homepage": "https://root-ui.com/docs/primitives/button",
|
|
6
7
|
"license": "MIT",
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"url": "https://x.com/souhail_dev",
|
|
10
|
-
"email": "souhail4dev@gmail.com"
|
|
11
|
-
},
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"author": "Root UI <support@root-ui.com>",
|
|
12
10
|
"main": "./dist/index.js",
|
|
13
11
|
"types": "./dist/index.d.ts",
|
|
14
12
|
"files": [
|
|
@@ -19,7 +17,7 @@
|
|
|
19
17
|
},
|
|
20
18
|
"repository": {
|
|
21
19
|
"type": "git",
|
|
22
|
-
"url": "git+https://github.com/
|
|
20
|
+
"url": "git+https://github.com/rootui-org/root-ui.git",
|
|
23
21
|
"directory": "packages/types"
|
|
24
22
|
},
|
|
25
23
|
"exports": {
|
|
@@ -32,21 +30,21 @@
|
|
|
32
30
|
},
|
|
33
31
|
"scripts": {
|
|
34
32
|
"build": "tsup src",
|
|
35
|
-
"dev": "tsup src --watch src"
|
|
33
|
+
"dev": "tsup src --watch src",
|
|
34
|
+
"link": "bun link",
|
|
35
|
+
"publish": "bun publish"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"tailwind-variants": "^3.2.2"
|
|
36
39
|
},
|
|
37
40
|
"devDependencies": {
|
|
38
41
|
"@types/react": "^19.2.9",
|
|
39
42
|
"tsup": "^8.5.1",
|
|
40
43
|
"typescript": "^5"
|
|
41
44
|
},
|
|
42
|
-
"dependencies": {
|
|
43
|
-
"@base-ui/react": "^1.1.0",
|
|
44
|
-
"lucide-react": "^0.562.0",
|
|
45
|
-
"tailwind-merge": "^3.4.0",
|
|
46
|
-
"tailwind-variants": "^3.2.2"
|
|
47
|
-
},
|
|
48
45
|
"peerDependencies": {
|
|
49
46
|
"react": "^18.0.0 || ^19.0.0",
|
|
50
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
47
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
48
|
+
"react-aria-components": "^1.14.0"
|
|
51
49
|
}
|
|
52
50
|
}
|
package/dist/base-ui/Button.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Button } from '../chunk-R76X4JK7.js';
|
package/dist/base-ui/index.d.ts
DELETED
package/dist/base-ui/index.js
DELETED
package/dist/chunk-R76X4JK7.js
DELETED
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { LoaderCircle } from 'lucide-react';
|
|
2
|
-
import { defaultConfig, tv } from 'tailwind-variants';
|
|
3
|
-
import { Button as Button$1 } from '@base-ui/react/button';
|
|
4
|
-
import { twMerge } from 'tailwind-merge';
|
|
5
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
// src/base-ui/Button.tsx
|
|
8
|
-
defaultConfig.twMerge = false;
|
|
9
|
-
var button = tv({
|
|
10
|
-
base: "button-base w-fit relative whitespace-nowrap inline-flex items-center justify-center text-center motion-safe:transition-button shrink-0",
|
|
11
|
-
variants: {
|
|
12
|
-
isPending: {
|
|
13
|
-
false: [
|
|
14
|
-
"cursor-pointer",
|
|
15
|
-
"will-change-transform",
|
|
16
|
-
"motion-safe:hover:animate-button-hover",
|
|
17
|
-
"motion-safe:active:animate-button-active"
|
|
18
|
-
],
|
|
19
|
-
true: "pointer-events-none opacity-80"
|
|
20
|
-
},
|
|
21
|
-
isDisabled: {
|
|
22
|
-
true: "pointer-events-none opacity-40"
|
|
23
|
-
},
|
|
24
|
-
size: {
|
|
25
|
-
sm: "button-size-sm",
|
|
26
|
-
md: "button-size-md",
|
|
27
|
-
lg: "button-size-lg"
|
|
28
|
-
},
|
|
29
|
-
variant: {
|
|
30
|
-
filled: "",
|
|
31
|
-
outlined: "",
|
|
32
|
-
subtle: "",
|
|
33
|
-
transparent: ""
|
|
34
|
-
},
|
|
35
|
-
severity: {
|
|
36
|
-
neutral: "",
|
|
37
|
-
primary: "",
|
|
38
|
-
secondary: "",
|
|
39
|
-
info: "",
|
|
40
|
-
success: "",
|
|
41
|
-
warning: "",
|
|
42
|
-
danger: "",
|
|
43
|
-
magic: ""
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
compoundVariants: [
|
|
47
|
-
{
|
|
48
|
-
variant: "filled",
|
|
49
|
-
severity: "primary",
|
|
50
|
-
className: "text-on-primary bg-primary hover:bg-primary-hover active:bg-primary-active"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
variant: "subtle",
|
|
54
|
-
severity: "primary",
|
|
55
|
-
className: "text-on-primary-subtle bg-primary-subtle hover:bg-primary-subtle-hover active:bg-primary-subtle-active"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
variant: "outlined",
|
|
59
|
-
severity: "primary",
|
|
60
|
-
className: "text-primary bg-transparent outline outline-primary hover:bg-primary/5 active:bg-primary/10"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
variant: "transparent",
|
|
64
|
-
severity: "primary",
|
|
65
|
-
className: "text-primary bg-transparent hover:bg-primary/10 active:bg-primary/15"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
variant: "filled",
|
|
69
|
-
severity: "neutral",
|
|
70
|
-
className: "text-on-neutral bg-neutral hover:bg-neutral-hover active:bg-neutral-active"
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
variant: "subtle",
|
|
74
|
-
severity: "neutral",
|
|
75
|
-
className: "text-on-neutral-subtle bg-neutral-subtle hover:bg-neutral-subtle-hover active:bg-neutral-subtle-active"
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
variant: "outlined",
|
|
79
|
-
severity: "neutral",
|
|
80
|
-
className: "text-neutral bg-transparent outline outline-default hover:bg-neutral/15 active:bg-neutral/20"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
variant: "transparent",
|
|
84
|
-
severity: "neutral",
|
|
85
|
-
className: "text-neutral bg-transparent hover:bg-neutral/20 active:bg-neutral/30"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
variant: "filled",
|
|
89
|
-
severity: "info",
|
|
90
|
-
className: "text-on-info bg-info hover:bg-info-hover active:bg-info-active"
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
variant: "subtle",
|
|
94
|
-
severity: "info",
|
|
95
|
-
className: "text-on-info-subtle bg-info-subtle hover:bg-info-subtle-hover active:bg-info-subtle-active"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
variant: "outlined",
|
|
99
|
-
severity: "info",
|
|
100
|
-
className: "text-info bg-transparent outline outline-info hover:bg-info/5 active:bg-info/10"
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
variant: "transparent",
|
|
104
|
-
severity: "info",
|
|
105
|
-
className: "text-info bg-transparent hover:bg-info/10 active:bg-info/15"
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
variant: "filled",
|
|
109
|
-
severity: "success",
|
|
110
|
-
className: "text-on-success bg-success hover:bg-success-hover active:bg-success-active"
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
variant: "subtle",
|
|
114
|
-
severity: "success",
|
|
115
|
-
className: "text-on-success-subtle bg-success-subtle hover:bg-success-subtle-hover active:bg-success-subtle-active"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
variant: "outlined",
|
|
119
|
-
severity: "success",
|
|
120
|
-
className: "text-success bg-transparent outline outline-success hover:bg-success/5 active:bg-success/10"
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
variant: "transparent",
|
|
124
|
-
severity: "success",
|
|
125
|
-
className: "text-success bg-transparent hover:bg-success/10 active:bg-success/15"
|
|
126
|
-
}
|
|
127
|
-
],
|
|
128
|
-
defaultVariants: {
|
|
129
|
-
size: "md",
|
|
130
|
-
variant: "filled",
|
|
131
|
-
severity: "primary",
|
|
132
|
-
isDisabled: false,
|
|
133
|
-
isPending: false
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
function Button({
|
|
137
|
-
children,
|
|
138
|
-
className,
|
|
139
|
-
isPending = false,
|
|
140
|
-
isDisabled = false,
|
|
141
|
-
size,
|
|
142
|
-
variant,
|
|
143
|
-
severity,
|
|
144
|
-
...props
|
|
145
|
-
}) {
|
|
146
|
-
return /* @__PURE__ */ jsx(
|
|
147
|
-
Button$1,
|
|
148
|
-
{
|
|
149
|
-
disabled: isDisabled,
|
|
150
|
-
...props,
|
|
151
|
-
className: twMerge(button({
|
|
152
|
-
size,
|
|
153
|
-
variant,
|
|
154
|
-
severity,
|
|
155
|
-
isDisabled,
|
|
156
|
-
isPending
|
|
157
|
-
}), className),
|
|
158
|
-
children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
159
|
-
/* @__PURE__ */ jsx("span", { className: isPending ? "text-transparent select-none" : "", children }),
|
|
160
|
-
isPending && /* @__PURE__ */ jsx("span", { className: "flex absolute inset-0 justify-center items-center", children: /* @__PURE__ */ jsx(LoaderCircle, { className: "animate-spin", size: 16 }) })
|
|
161
|
-
] })
|
|
162
|
-
}
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
export { Button };
|
package/dist/chunk-ZXORUS7M.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|