@peculiar/react-components 0.3.10 → 0.3.11
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/cjs/IconButton/icon_button.js +2 -2
- package/dist/cjs/IconButton/icon_button.js.map +1 -1
- package/dist/esm/IconButton/icon_button.js +2 -2
- package/dist/esm/IconButton/icon_button.js.map +1 -1
- package/dist/esnext/IconButton/icon_button.js +2 -2
- package/dist/esnext/IconButton/icon_button.js.map +1 -1
- package/dist/types/IconButton/icon_button.d.ts +5 -0
- package/package.json +2 -2
|
@@ -65,7 +65,7 @@ var stylesBase = function () { return (0, styles_1.css)({
|
|
|
65
65
|
*/
|
|
66
66
|
exports.IconButton = React.forwardRef(function (props, ref) {
|
|
67
67
|
var _a;
|
|
68
|
-
var title = props.title, className = props.className, disabled = props.disabled, other = __rest(props, ["title", "className", "disabled"]);
|
|
68
|
+
var title = props.title, className = props.className, disabled = props.disabled, tooltipProps = props.tooltipProps, other = __rest(props, ["title", "className", "disabled", "tooltipProps"]);
|
|
69
69
|
var component = (React.createElement(Button_1.Button, __assign({ "aria-label": title, disabled: disabled }, other, { ref: ref, withoutPadding: true, className: (0, styles_1.cx)((_a = {},
|
|
70
70
|
_a[stylesBase()] = true,
|
|
71
71
|
_a[className] = !!className,
|
|
@@ -73,7 +73,7 @@ exports.IconButton = React.forwardRef(function (props, ref) {
|
|
|
73
73
|
if (!title || disabled) {
|
|
74
74
|
return component;
|
|
75
75
|
}
|
|
76
|
-
return (React.createElement(Tooltip_1.Tooltip, { title: title, color: "black", size: "small" }, component));
|
|
76
|
+
return (React.createElement(Tooltip_1.Tooltip, __assign({ title: title, color: "black", size: "small" }, tooltipProps), component));
|
|
77
77
|
});
|
|
78
78
|
exports.IconButton.displayName = 'IconButton';
|
|
79
79
|
exports.IconButton.defaultProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon_button.js","sourceRoot":"","sources":["../../../src/IconButton/icon_button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+B;AAE/B,oCAAoC;AACpC,oCAAmD;AACnD,
|
|
1
|
+
{"version":3,"file":"icon_button.js","sourceRoot":"","sources":["../../../src/IconButton/icon_button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+B;AAE/B,oCAAoC;AACpC,oCAAmD;AACnD,sCAAuD;AA0BvD;;GAEG;AAEH;;GAEG;AACH,IAAM,UAAU,GAAG,cAAM,OAAA,IAAA,YAAG,EAAC;IAC3B,kBAAkB,EAAE,wBAAwB;IAC5C,MAAM,EAAE,MAAM;CACf,CAAC,EAHuB,CAGvB,CAAC;AACH;;GAEG;AAEU,QAAA,UAAU,GAAG,KAAK,CAAC,UAAU,CAAuB,UAAC,KAAK,EAAE,GAAG;;IAExE,IAAA,KAAK,GAKH,KAAK,MALF,EACL,SAAS,GAIP,KAAK,UAJE,EACT,QAAQ,GAGN,KAAK,SAHC,EACR,YAAY,GAEV,KAAK,aAFK,EACT,KAAK,UACN,KAAK,EANH,kDAML,CADS,CACA;IAEV,IAAM,SAAS,GAAG,CAChB,oBAAC,eAAM,2BACO,KAAK,EACjB,QAAQ,EAAE,QAAQ,IACd,KAAK,IACT,GAAG,EAAE,GAAG,EACR,cAAc,QACd,SAAS,EAAE,IAAA,WAAE;YACX,GAAC,UAAU,EAAE,IAAG,IAAI;YACpB,GAAC,SAAS,IAAG,CAAC,CAAC,SAAS;gBACxB,IACF,CACH,CAAC;IAEF,IAAI,CAAC,KAAK,IAAI,QAAQ,EAAE;QACtB,OAAO,SAAS,CAAC;KAClB;IAED,OAAO,CACL,oBAAC,iBAAO,aACN,KAAK,EAAE,KAAK,EACZ,KAAK,EAAC,OAAO,EACb,IAAI,EAAC,OAAO,IACR,YAAY,GAEf,SAAS,CACF,CACX,CAAC;AACJ,CAAC,CAA4C,CAAC;AAE9C,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC;AAEtC,kBAAU,CAAC,YAAY,GAAG;IACxB,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,QAAQ;CACf,CAAC"}
|
|
@@ -39,7 +39,7 @@ var stylesBase = function () { return css({
|
|
|
39
39
|
*/
|
|
40
40
|
export var IconButton = React.forwardRef(function (props, ref) {
|
|
41
41
|
var _a;
|
|
42
|
-
var title = props.title, className = props.className, disabled = props.disabled, other = __rest(props, ["title", "className", "disabled"]);
|
|
42
|
+
var title = props.title, className = props.className, disabled = props.disabled, tooltipProps = props.tooltipProps, other = __rest(props, ["title", "className", "disabled", "tooltipProps"]);
|
|
43
43
|
var component = (React.createElement(Button, __assign({ "aria-label": title, disabled: disabled }, other, { ref: ref, withoutPadding: true, className: cx((_a = {},
|
|
44
44
|
_a[stylesBase()] = true,
|
|
45
45
|
_a[className] = !!className,
|
|
@@ -47,7 +47,7 @@ export var IconButton = React.forwardRef(function (props, ref) {
|
|
|
47
47
|
if (!title || disabled) {
|
|
48
48
|
return component;
|
|
49
49
|
}
|
|
50
|
-
return (React.createElement(Tooltip, { title: title, color: "black", size: "small" }, component));
|
|
50
|
+
return (React.createElement(Tooltip, __assign({ title: title, color: "black", size: "small" }, tooltipProps), component));
|
|
51
51
|
});
|
|
52
52
|
IconButton.displayName = 'IconButton';
|
|
53
53
|
IconButton.defaultProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon_button.js","sourceRoot":"","sources":["../../../src/IconButton/icon_button.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAkB,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,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AG,YAAY,CAAC;AAEtC,UAAU,CAAC,YAAY,GAAG;IACxB,QAAQ,EAAE,KAAK;IACf,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,QAAQ;CACf,CAAC"}
|
|
@@ -16,7 +16,7 @@ const stylesBase = () => css({
|
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
18
|
export const IconButton = React.forwardRef((props, ref) => {
|
|
19
|
-
const { title, className, disabled, ...other } = props;
|
|
19
|
+
const { title, className, disabled, tooltipProps, ...other } = props;
|
|
20
20
|
const component = (React.createElement(Button, { "aria-label": title, disabled: disabled, ...other, ref: ref, withoutPadding: true, className: cx({
|
|
21
21
|
[stylesBase()]: true,
|
|
22
22
|
[className]: !!className,
|
|
@@ -24,7 +24,7 @@ export const IconButton = React.forwardRef((props, ref) => {
|
|
|
24
24
|
if (!title || disabled) {
|
|
25
25
|
return component;
|
|
26
26
|
}
|
|
27
|
-
return (React.createElement(Tooltip, { title: title, color: "black", size: "small" }, component));
|
|
27
|
+
return (React.createElement(Tooltip, { title: title, color: "black", size: "small", ...tooltipProps }, component));
|
|
28
28
|
});
|
|
29
29
|
IconButton.displayName = 'IconButton';
|
|
30
30
|
IconButton.defaultProps = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon_button.js","sourceRoot":"","sources":["../../../src/IconButton/icon_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAkB,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"icon_button.js","sourceRoot":"","sources":["../../../src/IconButton/icon_button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,WAAW,CAAC;AACpC,OAA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import { ButtonOwnProps } from '../Button';
|
|
4
|
+
import { TooltipBaseProps } from '../Tooltip';
|
|
4
5
|
/**
|
|
5
6
|
* Types.
|
|
6
7
|
*/
|
|
@@ -9,6 +10,10 @@ export interface IconButtonOwnProps extends Omit<ButtonOwnProps, 'variant' | 'wi
|
|
|
9
10
|
* The text that applied to `aria-label` attribute and Tooltip content.
|
|
10
11
|
*/
|
|
11
12
|
title?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Props applied to the `Tooltip` element.
|
|
15
|
+
*/
|
|
16
|
+
tooltipProps?: Omit<TooltipBaseProps, 'open' | 'title' | 'children'>;
|
|
12
17
|
}
|
|
13
18
|
export interface IconButtonTypeMap<P = {}, D extends React.ElementType = 'button'> {
|
|
14
19
|
props: P & IconButtonOwnProps;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peculiar/react-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.11",
|
|
5
5
|
"author": "PeculiarVentures Team",
|
|
6
6
|
"description": "A simple and customizable component library to build faster, beautiful, and more accessible React applications.",
|
|
7
7
|
"keywords": [
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"node": ">=12.x"
|
|
94
94
|
},
|
|
95
95
|
"license": "MIT",
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "d8385b722ac2ce591a88de0fbbd3ab0e0612cdcd"
|
|
97
97
|
}
|