diff --git a/packages/main/src/Tab.js b/packages/main/src/Tab.js index 2da89ef5f1e4..fd1984097c0e 100644 --- a/packages/main/src/Tab.js +++ b/packages/main/src/Tab.js @@ -1,6 +1,6 @@ import Bootstrap from "@ui5/webcomponents-base/src/Bootstrap.js"; import TabBase from "./TabBase.js"; -import IconColor from "./types/IconColor.js"; +import SemanticColor from "./types/SemanticColor.js"; import Icon from "./Icon.js"; import TabRenderer from "./build/compiled/TabRenderer.lit.js"; @@ -31,7 +31,7 @@ const metadata = { /** * The text to be displayed for the item. * @type {string} - * @defaultvalue: "" + * @defaultvalue "" * @public */ text: { @@ -51,7 +51,7 @@ const metadata = { /** * Represents the "additionalText" text, which is displayed in the tab filter. * @type {string} - * @defaultvalue: "" + * @defaultvalue "" * @public */ additionalText: { @@ -59,8 +59,12 @@ const metadata = { }, /** - * Specifies the icon to be displayed for the tab filter. + * Defines the icon source URI to be displayed as graphical element within the ui5-tab. + * The SAP-icons font provides numerous built-in icons. + * See all the available icons in the Icon Explorer. + * * @type {string} + * @defaultvalue "" * @public */ icon: { @@ -68,20 +72,24 @@ const metadata = { }, /** - * Specifies the icon color. - * - * If an icon font is used, the color can be chosen from the icon colors - * (sap.ui.core.IconColor). - * Possible semantic colors are: Neutral, Positive, Critical, Negative. - * Instead of the semantic icon color the brand color can be used, this is named Default. - * Semantic colors and brand colors should not be mixed up inside one IconTabBar. - * @type {IconColor} + * Defines the ui5-tab semantic color. + * The color is applied to: + * + *
+ * Available semantic colors are: "Default", "Neutral", "Positive", "Critical" and "Negative". + *

+ * Note: The color value depends on the current theme. + * @type {string} * @defaultvalue "Default" * @public */ - iconColor: { - type: IconColor, - defaultValue: IconColor.Default, + semanticColor: { + type: SemanticColor, + defaultValue: SemanticColor.Default, }, /** diff --git a/packages/main/src/TabContainer.js b/packages/main/src/TabContainer.js index f99b54a37513..b5c143acd37e 100644 --- a/packages/main/src/TabContainer.js +++ b/packages/main/src/TabContainer.js @@ -11,7 +11,7 @@ import Icon from "./Icon.js"; import List from "./List.js"; import Popover from "./Popover.js"; import TabBase from "./TabBase.js"; -import IconColor from "./types/IconColor.js"; +import SemanticColor from "./types/SemanticColor.js"; // Styles import tabContainerCss from "./themes/TabContainer.css.js"; @@ -504,8 +504,8 @@ const calculateHeaderItemClasses = (item, mixedMode) => { classes.push("ui5-tc__headerItem--mixedMode"); } - if (item.iconColor !== IconColor.Default) { - classes.push(`ui5-tc__headerItem--${item.iconColor.toLowerCase()}`); + if (item.semanticColor !== SemanticColor.Default) { + classes.push(`ui5-tc__headerItem--${item.semanticColor.toLowerCase()}`); } return classes.join(" "); @@ -526,8 +526,8 @@ const calculateHeaderItemIconClasses = item => { const calculateHeaderItemSemanticIconClasses = item => { const classes = ["ui5-tc-headerItemSemanticIcon"]; - if (item.iconColor !== IconColor.Default) { - classes.push(`ui5-tc-headerItemSemanticIcon--${item.iconColor.toLowerCase()}`); + if (item.semanticColor !== SemanticColor.Default) { + classes.push(`ui5-tc-headerItemSemanticIcon--${item.semanticColor.toLowerCase()}`); } return classes.join(" "); @@ -548,8 +548,8 @@ const calculateHeaderItemAdditionalTextClasses = item => { const calculateOverflowItemClasses = item => { const classes = ["ui5-tc__overflowItem"]; - if (item.iconColor !== IconColor.Default) { - classes.push(`ui5-tc__overflowItem--${item.iconColor.toLowerCase()}`); + if (item.semanticColor !== SemanticColor.Default) { + classes.push(`ui5-tc__overflowItem--${item.semanticColor.toLowerCase()}`); } if (item.disabled) { diff --git a/packages/main/src/types/IconColor.js b/packages/main/src/types/SemanticColor.js similarity index 71% rename from packages/main/src/types/IconColor.js rename to packages/main/src/types/SemanticColor.js index 3197cf9b19e3..e2295b93fbbe 100644 --- a/packages/main/src/types/IconColor.js +++ b/packages/main/src/types/SemanticColor.js @@ -1,6 +1,6 @@ import DataType from "@ui5/webcomponents-base/src/types/DataType.js"; -const IconColors = { +const SemanticColors = { /** * Default color (brand color) * @public @@ -33,12 +33,12 @@ const IconColors = { }; -class IconColor extends DataType { +class SemanticColor extends DataType { static isValid(value) { - return !!IconColors[value]; + return !!SemanticColors[value]; } } -IconColor.generataTypeAcessors(IconColors); +SemanticColor.generataTypeAcessors(SemanticColors); -export default IconColor; +export default SemanticColor;