@linzjs/lui 23.4.0 → 23.5.0
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [23.5.0](https://github.com/linz/lui/compare/v23.4.0...v23.5.0) (2025-07-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* SRVTRI-4048 add ref to toolbar button ([#1234](https://github.com/linz/lui/issues/1234)) ([f477328](https://github.com/linz/lui/commit/f4773281b9c5477c8a3fa6058b0368badb33ef00))
|
|
7
|
+
|
|
1
8
|
# [23.4.0](https://github.com/linz/lui/compare/v23.3.0...v23.4.0) (2025-06-30)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import 'react-loading-skeleton/dist/skeleton.css';
|
|
3
1
|
import './ToolbarButton.scss';
|
|
2
|
+
import 'react-loading-skeleton/dist/skeleton.css';
|
|
3
|
+
import React from 'react';
|
|
4
4
|
export interface ToolbarButtonProps {
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
highlighted?: boolean;
|
|
@@ -18,4 +18,4 @@ export interface ToolbarButtonProps {
|
|
|
18
18
|
* @param props
|
|
19
19
|
* @returns
|
|
20
20
|
*/
|
|
21
|
-
export declare const ToolbarButton:
|
|
21
|
+
export declare const ToolbarButton: React.ForwardRefExoticComponent<ToolbarButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
package/dist/index.js
CHANGED
|
@@ -33716,6 +33716,9 @@ function LuiSideToolbar(props) {
|
|
|
33716
33716
|
return (React__default["default"].createElement("div", { className: clsx(['Toolbar', 'app--shadow-sm', props.direction]), "data-testid": "toolbar" }, props.children));
|
|
33717
33717
|
}
|
|
33718
33718
|
|
|
33719
|
+
var css_248z$c = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.ToolbarButton {\n height: 40px;\n width: 40px;\n line-height: 12px;\n margin: 2px;\n padding: 0.25rem;\n}\n\n.ToolbarButton-placement {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.ToolbarButton img {\n border-radius: 3px;\n margin: -0.25rem;\n}\n\n.ToolbarButton,\n.ToolbarButton:hover,\n.ToolbarButton:disabled,\n.ToolbarButton:active:enabled {\n border-radius: 5px;\n border: 2px #ffffff solid !important;\n}\n\n.ToolbarItem-separator {\n height: 2px;\n background-color: #eaeaea;\n width: 100%;\n}";
|
|
33720
|
+
styleInject(css_248z$c);
|
|
33721
|
+
|
|
33719
33722
|
/**
|
|
33720
33723
|
* Show LuiIcon or Image.
|
|
33721
33724
|
*
|
|
@@ -33727,24 +33730,21 @@ var ToolbarIcon = function (_a) {
|
|
|
33727
33730
|
return iconImage ? (React__default["default"].createElement("img", { className: "LuiIcon--lg", alt: iconName, src: iconImage })) : (React__default["default"].createElement(LuiIcon, { name: iconName, alt: iconName, size: 'md' }));
|
|
33728
33731
|
};
|
|
33729
33732
|
|
|
33730
|
-
var css_248z$c = "/**\n @deprecated\n */\n/**\n @deprecated\n */\n/**\n @deprecated\n */\n.ToolbarButton {\n height: 40px;\n width: 40px;\n line-height: 12px;\n margin: 2px;\n padding: 0.25rem;\n}\n\n.ToolbarButton-placement {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.ToolbarButton img {\n border-radius: 3px;\n margin: -0.25rem;\n}\n\n.ToolbarButton,\n.ToolbarButton:hover,\n.ToolbarButton:disabled,\n.ToolbarButton:active:enabled {\n border-radius: 5px;\n border: 2px #ffffff solid !important;\n}\n\n.ToolbarItem-separator {\n height: 2px;\n background-color: #eaeaea;\n width: 100%;\n}";
|
|
33731
|
-
styleInject(css_248z$c);
|
|
33732
|
-
|
|
33733
33733
|
/**
|
|
33734
33734
|
* Create button for using either LuiIcon or Image.
|
|
33735
33735
|
*
|
|
33736
33736
|
* @param props
|
|
33737
33737
|
* @returns
|
|
33738
33738
|
*/
|
|
33739
|
-
var ToolbarButton = function (_a) {
|
|
33739
|
+
var ToolbarButton = React.forwardRef(function ToolbarButton(_a, ref) {
|
|
33740
33740
|
var disabled = _a.disabled, highlighted = _a.highlighted, iconImage = _a.iconImage, iconName = _a.iconName, loading = _a.loading, onClick = _a.onClick, panelTitle = _a.panelTitle, panelKey = _a.panelKey, tooltip = _a.tooltip;
|
|
33741
33741
|
if (loading) {
|
|
33742
33742
|
return React__default["default"].createElement(Skeleton, { className: "ToolbarButton", height: 40, width: 40 });
|
|
33743
33743
|
}
|
|
33744
|
-
var button = (React__default["default"].createElement("button", { className: "".concat(highlighted ? 'lui-button-primary' : 'lui-button-secondary', " ToolbarButton ToolbarButton-placement"), "data-testid": "ToolbarButton-".concat(panelKey), disabled: disabled, onClick: onClick, title: panelTitle, type: "button" },
|
|
33744
|
+
var button = (React__default["default"].createElement("button", { ref: ref, className: "".concat(highlighted ? 'lui-button-primary' : 'lui-button-secondary', " ToolbarButton ToolbarButton-placement"), "data-testid": "ToolbarButton-".concat(panelKey), disabled: disabled, onClick: onClick, title: panelTitle, type: "button" },
|
|
33745
33745
|
React__default["default"].createElement(ToolbarIcon, { iconImage: iconImage, iconName: iconName })));
|
|
33746
|
-
return tooltip ? (React__default["default"].createElement(LuiTooltip, { placement: "auto",
|
|
33747
|
-
};
|
|
33746
|
+
return tooltip ? (React__default["default"].createElement(LuiTooltip, { placement: "auto", content: tooltip }, button)) : (React__default["default"].createElement(React__default["default"].Fragment, null, button));
|
|
33747
|
+
});
|
|
33748
33748
|
|
|
33749
33749
|
/**
|
|
33750
33750
|
* Allows any item to be added into the toolbar (with appropriate styles and size)
|