@driveflux/beam 3.0.6 → 3.0.7
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.
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type VariantProps } from 'class-variance-authority';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
declare const textButtonVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "default" | "link" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
export interface TextButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof textButtonVariants> {
|
|
7
7
|
asChild?: boolean;
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
isLoading?: boolean;
|
|
8
10
|
}
|
|
9
11
|
declare const TextButton: React.ForwardRefExoticComponent<TextButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
10
12
|
export default TextButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextButton.d.ts","sourceRoot":"","sources":["../../src/button/TextButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"TextButton.d.ts","sourceRoot":"","sources":["../../src/button/TextButton.tsx"],"names":[],"mappings":"AACA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,QAAA,MAAM,kBAAkB;;8EAavB,CAAA;AAED,MAAM,WAAW,eAChB,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACpD,YAAY,CAAC,OAAO,kBAAkB,CAAC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,SAAS,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,QAAA,MAAM,UAAU,2FAyBf,CAAA;AAGD,eAAe,UAAU,CAAA"}
|
|
@@ -26,6 +26,30 @@ function _object_spread(target) {
|
|
|
26
26
|
}
|
|
27
27
|
return target;
|
|
28
28
|
}
|
|
29
|
+
function ownKeys(object, enumerableOnly) {
|
|
30
|
+
var keys = Object.keys(object);
|
|
31
|
+
if (Object.getOwnPropertySymbols) {
|
|
32
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
33
|
+
if (enumerableOnly) {
|
|
34
|
+
symbols = symbols.filter(function(sym) {
|
|
35
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
keys.push.apply(keys, symbols);
|
|
39
|
+
}
|
|
40
|
+
return keys;
|
|
41
|
+
}
|
|
42
|
+
function _object_spread_props(target, source) {
|
|
43
|
+
source = source != null ? source : {};
|
|
44
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
45
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
46
|
+
} else {
|
|
47
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
48
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return target;
|
|
52
|
+
}
|
|
29
53
|
function _object_without_properties(source, excluded) {
|
|
30
54
|
if (source == null) return {};
|
|
31
55
|
var target = _object_without_properties_loose(source, excluded);
|
|
@@ -53,10 +77,11 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
53
77
|
}
|
|
54
78
|
return target;
|
|
55
79
|
}
|
|
56
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
80
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
57
81
|
import { Slot } from '@radix-ui/react-slot';
|
|
58
82
|
import { cva } from 'class-variance-authority';
|
|
59
83
|
import * as React from 'react';
|
|
84
|
+
import LoadingAnimation from '../animations/LoadingAnimation.js';
|
|
60
85
|
import { cn } from '../utils.js';
|
|
61
86
|
var textButtonVariants = cva('inline cursor-pointer disabled:pointer-events-none disabled:opacity-30 text-base leading-[19.6px] bg-transparent border-0 p-0 m-0', {
|
|
62
87
|
variants: {
|
|
@@ -70,19 +95,29 @@ var textButtonVariants = cva('inline cursor-pointer disabled:pointer-events-none
|
|
|
70
95
|
}
|
|
71
96
|
});
|
|
72
97
|
var TextButton = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
73
|
-
var className = _param.className, variant = _param.variant, _param_asChild = _param.asChild, asChild = _param_asChild === void 0 ? false : _param_asChild, props = _object_without_properties(_param, [
|
|
98
|
+
var className = _param.className, variant = _param.variant, _param_asChild = _param.asChild, asChild = _param_asChild === void 0 ? false : _param_asChild, isDisabled = _param.isDisabled, isLoading = _param.isLoading, children = _param.children, props = _object_without_properties(_param, [
|
|
74
99
|
"className",
|
|
75
100
|
"variant",
|
|
76
|
-
"asChild"
|
|
101
|
+
"asChild",
|
|
102
|
+
"isDisabled",
|
|
103
|
+
"isLoading",
|
|
104
|
+
"children"
|
|
77
105
|
]);
|
|
78
106
|
var Comp = asChild ? Slot : 'button';
|
|
79
|
-
return /*#__PURE__*/
|
|
107
|
+
return /*#__PURE__*/ _jsxs(Comp, _object_spread_props(_object_spread({
|
|
80
108
|
className: cn(textButtonVariants({
|
|
81
109
|
variant: variant,
|
|
82
110
|
className: className
|
|
83
111
|
})),
|
|
84
|
-
ref: ref
|
|
85
|
-
|
|
112
|
+
ref: ref,
|
|
113
|
+
disabled: isDisabled || isLoading
|
|
114
|
+
}, props), {
|
|
115
|
+
children: [
|
|
116
|
+
children,
|
|
117
|
+
" ",
|
|
118
|
+
isLoading && /*#__PURE__*/ _jsx(LoadingAnimation, {})
|
|
119
|
+
]
|
|
120
|
+
}));
|
|
86
121
|
});
|
|
87
122
|
TextButton.displayName = 'TextButton';
|
|
88
123
|
export default TextButton;
|