musae 1.0.27-beta.21 → 1.0.27-beta.22
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.
|
@@ -76,13 +76,15 @@ var Tag = function Tag(_ref) {
|
|
|
76
76
|
_ref$closable = _ref.closable,
|
|
77
77
|
closable = _ref$closable === void 0 ? false : _ref$closable,
|
|
78
78
|
onClose = _ref.onClose,
|
|
79
|
+
onClick = _ref.onClick,
|
|
79
80
|
leading = _ref.leading;
|
|
80
81
|
var classNames = useClassNames.useClassNames(context.CLASS_NAMES);
|
|
81
82
|
var _themeColorVars = useThemeColorVars.useThemeColorVars(["primary-container", "on-primary-container", "surface", "on-surface-variant", "outline"]);
|
|
82
83
|
var styled = stylex.props(theme.$label[size], styles.tag["default"], styles.size[size], styles.variant[variant]);
|
|
83
84
|
return /*#__PURE__*/React.createElement("span", {
|
|
84
85
|
className: className.stringify(classNames.tag, className$1, styled.className),
|
|
85
|
-
style: _objectSpread(_objectSpread(_objectSpread({}, styled.style), _themeColorVars), style)
|
|
86
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, styled.style), _themeColorVars), style),
|
|
87
|
+
onClick: onClick
|
|
86
88
|
}, leading, children, closable && /*#__PURE__*/React.createElement(close.default, {
|
|
87
89
|
onClick: onClose
|
|
88
90
|
}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import type { TagProps } from "../../types/tag";
|
|
3
|
-
declare const Tag: ({ children, variant, size, className, style, closable, onClose, leading, }: TagProps) => React.JSX.Element;
|
|
3
|
+
declare const Tag: ({ children, variant, size, className, style, closable, onClose, onClick, leading, }: TagProps) => React.JSX.Element;
|
|
4
4
|
export default Tag;
|
|
@@ -72,13 +72,15 @@ var Tag = function Tag(_ref) {
|
|
|
72
72
|
_ref$closable = _ref.closable,
|
|
73
73
|
closable = _ref$closable === void 0 ? false : _ref$closable,
|
|
74
74
|
onClose = _ref.onClose,
|
|
75
|
+
onClick = _ref.onClick,
|
|
75
76
|
leading = _ref.leading;
|
|
76
77
|
var classNames = useClassNames(CLASS_NAMES);
|
|
77
78
|
var _themeColorVars = useThemeColorVars(["primary-container", "on-primary-container", "surface", "on-surface-variant", "outline"]);
|
|
78
79
|
var styled = props($label[size], styles.tag["default"], styles.size[size], styles.variant[variant]);
|
|
79
80
|
return /*#__PURE__*/React.createElement("span", {
|
|
80
81
|
className: stringify(classNames.tag, className, styled.className),
|
|
81
|
-
style: _objectSpread(_objectSpread(_objectSpread({}, styled.style), _themeColorVars), style)
|
|
82
|
+
style: _objectSpread(_objectSpread(_objectSpread({}, styled.style), _themeColorVars), style),
|
|
83
|
+
onClick: onClick
|
|
82
84
|
}, leading, children, closable && /*#__PURE__*/React.createElement(Close, {
|
|
83
85
|
onClick: onClose
|
|
84
86
|
}));
|
package/dist/types/tag.d.ts
CHANGED
|
@@ -3,41 +3,38 @@ import type { ComponentProps } from "./element";
|
|
|
3
3
|
type Size = "small" | "medium" | "large";
|
|
4
4
|
type Variant = "filled" | "outlined";
|
|
5
5
|
/**
|
|
6
|
-
* @description
|
|
7
6
|
* tag props
|
|
8
7
|
*/
|
|
9
8
|
export type TagProps = ComponentProps & {
|
|
10
9
|
/**
|
|
11
|
-
* @description
|
|
12
10
|
* variant
|
|
13
11
|
* @default "filled"
|
|
14
12
|
*/
|
|
15
13
|
variant?: Variant;
|
|
16
14
|
/**
|
|
17
|
-
* @description
|
|
18
15
|
* children
|
|
19
16
|
* @default void 0
|
|
20
17
|
*/
|
|
21
18
|
children?: ReactNode;
|
|
22
19
|
/**
|
|
23
|
-
* @description
|
|
24
20
|
* size
|
|
25
21
|
* @default "medium"
|
|
26
22
|
*/
|
|
27
23
|
size?: Size;
|
|
28
24
|
/**
|
|
29
|
-
* @description
|
|
30
25
|
* if current tag is closable
|
|
31
26
|
* @default false
|
|
32
27
|
*/
|
|
33
28
|
closable?: boolean;
|
|
34
29
|
/**
|
|
35
|
-
*
|
|
30
|
+
* click handler
|
|
31
|
+
*/
|
|
32
|
+
onClick?: (event: MouseEvent<HTMLSpanElement>) => void;
|
|
33
|
+
/**
|
|
36
34
|
* close handler
|
|
37
35
|
*/
|
|
38
36
|
onClose?: (event: MouseEvent<HTMLSpanElement>) => void;
|
|
39
37
|
/**
|
|
40
|
-
* @description
|
|
41
38
|
* leading node
|
|
42
39
|
* @default void 0
|
|
43
40
|
*/
|