@foxriver76/iob-component-lib
Advanced tools
Comparing version 0.1.6 to 0.2.0
@@ -8,2 +8,6 @@ import React from 'react'; | ||
type: 'warning' | 'info' | 'error'; | ||
/** If the Box is closeable */ | ||
closeable?: boolean; | ||
/** Use together with `closeable: true`, listener called if close button clicked */ | ||
onClose?: () => void; | ||
} | ||
@@ -10,0 +14,0 @@ /** |
@@ -37,3 +37,8 @@ "use strict"; | ||
this.props.type === 'info' ? react_1["default"].createElement(icons_material_1.Info, { color: 'primary' }) : react_1["default"].createElement(icons_material_1.Warning, { color: this.props.type }), | ||
react_1["default"].createElement(material_1.Typography, null, this.props.children))); | ||
react_1["default"].createElement(material_1.Typography, null, this.props.children), | ||
this.props.closeable ? (react_1["default"].createElement(icons_material_1.Close, { sx: { | ||
color: function (theme) { return (theme.palette.mode === 'dark' ? 'lightgray' : 'gray'); }, | ||
alignSelf: 'flex-start', | ||
cursor: 'pointer' | ||
}, onClick: this.props.onClose })) : null)); | ||
}; | ||
@@ -40,0 +45,0 @@ return InfoBox; |
@@ -11,2 +11,4 @@ import type { StoryObj } from '@storybook/react'; | ||
type: "info"; | ||
closeable: false; | ||
onClose: import("@vitest/spy").Mock<(...args: any[]) => any>; | ||
}; | ||
@@ -19,1 +21,2 @@ argTypes: {}; | ||
export declare const Error: Story; | ||
export declare const Closeable: Story; |
@@ -6,4 +6,5 @@ "use strict"; | ||
exports.__esModule = true; | ||
exports.Error = exports.Warning = exports.Default = void 0; | ||
exports.Closeable = exports.Error = exports.Warning = exports.Default = void 0; | ||
var InfoBox_1 = __importDefault(require("../../../components/molecules/InfoBox/InfoBox")); | ||
var test_1 = require("@storybook/test"); | ||
exports["default"] = { | ||
@@ -15,3 +16,5 @@ title: 'Molecules/Info Box', | ||
children: 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam', | ||
type: 'info' | ||
type: 'info', | ||
closeable: false, | ||
onClose: (0, test_1.fn)() | ||
}, | ||
@@ -31,2 +34,7 @@ argTypes: {} | ||
}; | ||
exports.Closeable = { | ||
args: { | ||
closeable: true | ||
} | ||
}; | ||
//# sourceMappingURL=InfoBox.stories.js.map |
@@ -6,3 +6,3 @@ { | ||
}, | ||
"version": "0.1.6", | ||
"version": "0.2.0", | ||
"scripts": { | ||
@@ -9,0 +9,0 @@ "release": "release-script --noPush -y", |
@@ -9,2 +9,5 @@ # ioBroker React Component Library | ||
--> | ||
### 0.2.0 (2024-12-05) | ||
* (foxriver76) allow to make `InfoText` closeable | ||
### 0.1.6 (2024-09-30) | ||
@@ -11,0 +14,0 @@ * (@foxriver76) fixed source maps |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
43038
530
30