@oicl/openbridge-webcomponents 2.0.0-next.84 → 2.0.0-next.86

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.
@@ -61743,6 +61743,15 @@
61743
61743
  "description": "Shows a vertical divider on the left edge of the tab (except when checked).\nUseful for visually separating tabs.\n\nDefault: false",
61744
61744
  "attribute": "has-divider"
61745
61745
  },
61746
+ {
61747
+ "kind": "field",
61748
+ "name": "badges",
61749
+ "type": {
61750
+ "text": "TabItemBadge[]"
61751
+ },
61752
+ "default": "[]",
61753
+ "description": "One or more badges (count/status) to display on the tab.\n\nWhen this array is non-empty it takes precedence over the deprecated\nsingle-badge props (`hasBadge`, `badgeType`, `badgeSize`, `badgeCount`,\n`badgeShowNumber`, `showLeadingBadgeIcon`). When empty, the deprecated\nprops are used instead (gated by `hasBadge`).\n\nDefault: []"
61754
+ },
61746
61755
  {
61747
61756
  "kind": "field",
61748
61757
  "name": "hasBadge",
@@ -61750,7 +61759,7 @@
61750
61759
  "text": "boolean"
61751
61760
  },
61752
61761
  "default": "false",
61753
- "description": "Displays a badge (count/status) on the tab.\nConfigure badge appearance via `badgeCount`, `badgeType`, `badgeSize`, etc.\n\nDefault: false",
61762
+ "deprecated": "Use the `badges` array instead.\n\nDisplays a badge (count/status) on the tab.\nConfigure badge appearance via `badgeCount`, `badgeType`, `badgeSize`, etc.\n\nDefault: false",
61754
61763
  "attribute": "has-badge"
61755
61764
  },
61756
61765
  {
@@ -61809,7 +61818,7 @@
61809
61818
  "type": {
61810
61819
  "text": "string"
61811
61820
  },
61812
- "description": "Type of badge to display (e.g., 'regular', 'alarm', 'warning', etc.).\nSee `BadgeType` enum for available options.\n\nDefault: 'regular'",
61821
+ "deprecated": "Use the `badges` array instead.\n\nType of badge to display (e.g., 'regular', 'alarm', 'warning', etc.).\nSee `BadgeType` enum for available options.\n\nDefault: 'regular'",
61813
61822
  "attribute": "badgeType"
61814
61823
  },
61815
61824
  {
@@ -61818,7 +61827,7 @@
61818
61827
  "type": {
61819
61828
  "text": "string"
61820
61829
  },
61821
- "description": "Size of the badge ('regular' or 'large').\nSee `BadgeSize` enum for available options.\n\nDefault: 'regular'",
61830
+ "deprecated": "Use the `badges` array instead.\n\nSize of the badge ('regular' or 'large').\nSee `BadgeSize` enum for available options.\n\nDefault: 'regular'",
61822
61831
  "attribute": "badgeSize"
61823
61832
  },
61824
61833
  {
@@ -61828,7 +61837,7 @@
61828
61837
  "text": "boolean"
61829
61838
  },
61830
61839
  "default": "true",
61831
- "description": "Shows the badge's numeric value. When false, only the badge background is rendered (for status-only badges).\n\nDefault: true"
61840
+ "deprecated": "Use the `badges` array instead.\n\nShows the badge's numeric value. When false, only the badge background is rendered (for status-only badges).\n\nDefault: true"
61832
61841
  },
61833
61842
  {
61834
61843
  "kind": "field",
@@ -61837,7 +61846,7 @@
61837
61846
  "text": "number"
61838
61847
  },
61839
61848
  "default": "0",
61840
- "description": "The numeric value to display in the badge (e.g., count of notifications).\n\nDefault: 0",
61849
+ "deprecated": "Use the `badges` array instead.\n\nThe numeric value to display in the badge (e.g., count of notifications).\n\nDefault: 0",
61841
61850
  "attribute": "badgeCount"
61842
61851
  },
61843
61852
  {
@@ -61847,7 +61856,7 @@
61847
61856
  "text": "boolean"
61848
61857
  },
61849
61858
  "default": "false",
61850
- "description": "Shows an icon inside the badge.\nSupply icon content via the `badge-icon` slot.\n\nDefault: false",
61859
+ "deprecated": "Use the `badges` array instead.\n\nShows an icon inside the badge.\nSupply icon content via the `badge-icon` slot.\n\nDefault: false",
61851
61860
  "attribute": "showLeadingBadgeIcon"
61852
61861
  },
61853
61862
  {
@@ -61888,6 +61897,28 @@
61888
61897
  }
61889
61898
  }
61890
61899
  ]
61900
+ },
61901
+ {
61902
+ "kind": "field",
61903
+ "name": "effectiveBadges",
61904
+ "type": {
61905
+ "text": "TabItemBadge[]"
61906
+ },
61907
+ "privacy": "private",
61908
+ "readonly": true
61909
+ },
61910
+ {
61911
+ "kind": "method",
61912
+ "name": "renderBadge",
61913
+ "privacy": "private",
61914
+ "parameters": [
61915
+ {
61916
+ "name": "badge",
61917
+ "type": {
61918
+ "text": "TabItemBadge"
61919
+ }
61920
+ }
61921
+ ]
61891
61922
  }
61892
61923
  ],
61893
61924
  "events": [
@@ -61970,7 +62001,7 @@
61970
62001
  "text": "boolean"
61971
62002
  },
61972
62003
  "default": "false",
61973
- "description": "Displays a badge (count/status) on the tab.\nConfigure badge appearance via `badgeCount`, `badgeType`, `badgeSize`, etc.\n\nDefault: false",
62004
+ "deprecated": "Use the `badges` array instead.\n\nDisplays a badge (count/status) on the tab.\nConfigure badge appearance via `badgeCount`, `badgeType`, `badgeSize`, etc.\n\nDefault: false",
61974
62005
  "fieldName": "hasBadge"
61975
62006
  },
61976
62007
  {
@@ -62023,7 +62054,7 @@
62023
62054
  "type": {
62024
62055
  "text": "string"
62025
62056
  },
62026
- "description": "Type of badge to display (e.g., 'regular', 'alarm', 'warning', etc.).\nSee `BadgeType` enum for available options.\n\nDefault: 'regular'",
62057
+ "deprecated": "Use the `badges` array instead.\n\nType of badge to display (e.g., 'regular', 'alarm', 'warning', etc.).\nSee `BadgeType` enum for available options.\n\nDefault: 'regular'",
62027
62058
  "fieldName": "badgeType"
62028
62059
  },
62029
62060
  {
@@ -62031,7 +62062,7 @@
62031
62062
  "type": {
62032
62063
  "text": "string"
62033
62064
  },
62034
- "description": "Size of the badge ('regular' or 'large').\nSee `BadgeSize` enum for available options.\n\nDefault: 'regular'",
62065
+ "deprecated": "Use the `badges` array instead.\n\nSize of the badge ('regular' or 'large').\nSee `BadgeSize` enum for available options.\n\nDefault: 'regular'",
62035
62066
  "fieldName": "badgeSize"
62036
62067
  },
62037
62068
  {
@@ -62040,7 +62071,7 @@
62040
62071
  "text": "number"
62041
62072
  },
62042
62073
  "default": "0",
62043
- "description": "The numeric value to display in the badge (e.g., count of notifications).\n\nDefault: 0",
62074
+ "deprecated": "Use the `badges` array instead.\n\nThe numeric value to display in the badge (e.g., count of notifications).\n\nDefault: 0",
62044
62075
  "fieldName": "badgeCount"
62045
62076
  },
62046
62077
  {
@@ -62049,7 +62080,7 @@
62049
62080
  "text": "boolean"
62050
62081
  },
62051
62082
  "default": "false",
62052
- "description": "Shows an icon inside the badge.\nSupply icon content via the `badge-icon` slot.\n\nDefault: false",
62083
+ "deprecated": "Use the `badges` array instead.\n\nShows an icon inside the badge.\nSupply icon content via the `badge-icon` slot.\n\nDefault: false",
62053
62084
  "fieldName": "showLeadingBadgeIcon"
62054
62085
  }
62055
62086
  ],
@@ -62086,7 +62117,7 @@
62086
62117
  "declarations": [
62087
62118
  {
62088
62119
  "kind": "class",
62089
- "description": "`<obc-tab-row>` – A horizontal tab navigation bar for switching between multiple content sections.\n\nDisplays a row of interactive tabs, each representing a distinct view or section. Supports subtitles, badges, icons, close buttons, and an optional \"add new tab\" action. Designed for use cases where users need to quickly switch between related content areas, such as dashboards, settings, or document editors.\n\n---\n\n### Features\n- **Tab Selection:** Only one tab can be selected at a time; selection is managed via the `selectedTabId` property.\n- **Closeable Tabs:** Optionally display a close button on each tab (`hasClose`), allowing users to remove tabs dynamically.\n- **Add New Tab:** Optionally show an \"add new tab\" button at the end of the row (`hasAddNewTab`), emitting an event when clicked.\n- **Subtitles:** Optionally show secondary contextual text below each tab title (`showSubtitle` and `subtitle`).\n- **Badges:** Tabs can display badges with counts and types (e.g., notification, alarm, enhance), supporting different badge sizes and optional hiding of the number.\n- **Icons:** Each tab can show a leading icon (customizable via slot), and optionally a badge icon.\n- **Disabled Tabs:** Individual tabs can be disabled to prevent user interaction.\n- **Hug Mode:** When `hug` is enabled, tabs use a compact layout with reduced padding.\n- **Responsive Layout:** Tabs are arranged horizontally and adapt to the available width.\n\n---\n\n### Usage Guidelines\nUse `<obc-tab-row>` to organize content into logical sections that users can switch between without leaving the current page. Ideal for navigation in multi-view interfaces, such as settings panels, dashboards, or editors. Each tab should represent a distinct, high-level section. Avoid using tabs for navigation between unrelated pages or for single-action toggles.\n\n- Use badges to highlight new activity or counts (e.g., unread messages).\n- Use the close button for tabs that represent removable or temporary content (e.g., documents, chat sessions).\n- The \"add new tab\" action is suitable for interfaces where users can create new sections dynamically.\n- For best accessibility, ensure each tab has a unique `id` and descriptive `title`.\n\n**TODO(designer):** Confirm if there are recommended limits on the number of tabs, or guidance for handling overflow (e.g., scrolling, collapsing).\n\n---\n\n### Example\n```html\n<obc-tab-row\n .tabs=${[\n {id: 'tab1', title: 'Inbox', subtitle: 'Monitoring', hasBadge: true, badgeCount: 5, badgeType: 'notification'},\n {id: 'tab2', title: 'Updates'},\n {id: 'tab3', title: 'Settings', hasLeadingIcon: true}\n ]}\n selectedTabId=\"tab1\"\n show-subtitle\n hasClose\n hasAddNewTab\n>\n <obi-placeholder slot=\"tab-tab1-icon\"></obi-placeholder>\n <obi-placeholder slot=\"tab-tab3-icon\"></obi-placeholder>\n</obc-tab-row>\n```\n\n---\n\n### Slots\n\n| Slot Name | Renders When... | Purpose |\n|--------------------------|------------------------------------|------------------------------------------------------|\n| `tab-<id>-icon` | If `hasLeadingIcon` is true | Leading icon for a specific tab (replaceable) |\n| `tab-<id>-badge-icon` | If `showLeadingBadgeIcon` is true | Badge icon for a specific tab (replaceable) |\n\n---\n\n### Events\n- `tab-selected` – Fired when a tab is selected. Detail: `{tab, id, index}`.\n- `tab-closed` – Fired when a tab's close button is clicked. Detail: `{tab, id, index}`.\n- `add-new-tab` – Fired when the \"add new tab\" button is clicked. No detail.\n\n---\n\n### Best Practices\n- Only one tab should be selected at a time.\n- Use badges sparingly to avoid overwhelming the user.\n- Avoid using the close button for tabs that should always be present.\n- For accessibility, ensure tab titles are clear and concise.\n- If using custom icons, provide them via the appropriate named slot for each tab.",
62120
+ "description": "`<obc-tab-row>` – A horizontal tab navigation bar for switching between multiple content sections.\n\nDisplays a row of interactive tabs, each representing a distinct view or section. Supports subtitles, badges, icons, close buttons, and an optional \"add new tab\" action. Designed for use cases where users need to quickly switch between related content areas, such as dashboards, settings, or document editors.\n\n---\n\n### Features\n- **Tab Selection:** Only one tab can be selected at a time; selection is managed via the `selectedTabId` property.\n- **Closeable Tabs:** Optionally display a close button on each tab (`hasClose`), allowing users to remove tabs dynamically.\n- **Add New Tab:** Optionally show an \"add new tab\" button at the end of the row (`hasAddNewTab`), emitting an event when clicked.\n- **Subtitles:** Optionally show secondary contextual text below each tab title (`showSubtitle` and `subtitle`).\n- **Badges:** Tabs can display badges with counts and types (e.g., notification, alarm, enhance), supporting different badge sizes and optional hiding of the number.\n- **Icons:** Each tab can show a leading icon (customizable via slot), and optionally a badge icon.\n- **Disabled Tabs:** Individual tabs can be disabled to prevent user interaction.\n- **Hug Mode:** When `hug` is enabled, tabs use a compact layout with reduced padding.\n- **Responsive Layout:** Tabs are arranged horizontally and adapt to the available width.\n\n---\n\n### Usage Guidelines\nUse `<obc-tab-row>` to organize content into logical sections that users can switch between without leaving the current page. Ideal for navigation in multi-view interfaces, such as settings panels, dashboards, or editors. Each tab should represent a distinct, high-level section. Avoid using tabs for navigation between unrelated pages or for single-action toggles.\n\n- Use badges to highlight new activity or counts (e.g., unread messages).\n- Use the close button for tabs that represent removable or temporary content (e.g., documents, chat sessions).\n- The \"add new tab\" action is suitable for interfaces where users can create new sections dynamically.\n- For best accessibility, ensure each tab has a unique `id` and descriptive `title`.\n\n**TODO(designer):** Confirm if there are recommended limits on the number of tabs, or guidance for handling overflow (e.g., scrolling, collapsing).\n\n---\n\n### Example\n```html\n<obc-tab-row\n .tabs=${[\n {id: 'tab1', title: 'Inbox', subtitle: 'Monitoring', hasBadge: true, badgeCount: 5, badgeType: 'notification'},\n {id: 'tab2', title: 'Updates'},\n {id: 'tab3', title: 'Settings', hasLeadingIcon: true}\n ]}\n selectedTabId=\"tab1\"\n show-subtitle\n hasClose\n hasAddNewTab\n>\n <obi-placeholder slot=\"tab-tab1-icon\"></obi-placeholder>\n <obi-placeholder slot=\"tab-tab3-icon\"></obi-placeholder>\n</obc-tab-row>\n```\n\n---\n\n### Slots\n\n| Slot Name | Renders When... | Purpose |\n|--------------------------|------------------------------------|------------------------------------------------------|\n| `tab-<id>-icon` | If `hasLeadingIcon` is true | Leading icon for a specific tab (replaceable) |\n| `tab-<id>-<iconSlotName>` | For each badge that declares an `iconSlotName` | Custom icon for a specific tab's badge (replaceable). The deprecated single-badge path uses `tab-<id>-badge-icon`. |\n\n---\n\n### Events\n- `tab-selected` – Fired when a tab is selected. Detail: `{tab, id, index}`.\n- `tab-closed` – Fired when a tab's close button is clicked. Detail: `{tab, id, index}`.\n- `add-new-tab` – Fired when the \"add new tab\" button is clicked. No detail.\n\n---\n\n### Best Practices\n- Only one tab should be selected at a time.\n- Use badges sparingly to avoid overwhelming the user.\n- Avoid using the close button for tabs that should always be present.\n- For accessibility, ensure tab titles are clear and concise.\n- If using custom icons, provide them via the appropriate named slot for each tab.",
62090
62121
  "name": "ObcTabRow",
62091
62122
  "slots": [
62092
62123
  {
@@ -62094,8 +62125,8 @@
62094
62125
  "name": "tab-<id>-icon"
62095
62126
  },
62096
62127
  {
62097
- "description": "Badge icon slot for each tab (shown when `showLeadingBadgeIcon` is true for that tab)",
62098
- "name": "tab-<id>-badge-icon"
62128
+ "description": "Custom badge icon slot for each tab, one per badge that declares an `iconSlotName`. The deprecated single-badge path uses `tab-<id>-badge-icon`.",
62129
+ "name": "tab-<id>-<iconSlotName>"
62099
62130
  }
62100
62131
  ],
62101
62132
  "members": [
@@ -62106,7 +62137,7 @@
62106
62137
  "text": "TabData[]"
62107
62138
  },
62108
62139
  "default": "[]",
62109
- "description": "The list of tabs to display. Each tab is defined by an object with properties such as `id`, `title`, `subtitle`, `showSubtitle`, `hasLeadingIcon`, `hasBadge`, `badgeCount`, `badgeType`, `badgeSize`, `badgeShowNumber`, `showLeadingBadgeIcon`, and `disabled`.\n\n- `id` (string): Unique identifier for the tab.\n- `title` (string): Display label for the tab.\n- `subtitle` (string): Contextual text shown below the title when subtitle display is enabled.\n- `showSubtitle` (boolean): Optional per-tab override for displaying the subtitle.\n- `hasLeadingIcon` (boolean): Whether to show a leading icon (default: true).\n- `hasBadge` (boolean): Whether to show a badge on the tab.\n- `badgeCount` (number): Number to display in the badge.\n- `badgeType` (BadgeType): Visual style of the badge (e.g., notification, alarm, enhance).\n- `badgeSize` (BadgeSize): Size of the badge (e.g., regular, large).\n- `badgeShowNumber` (boolean): If true, shows the badge number.\n- `showLeadingBadgeIcon` (boolean): If true, shows a badge icon.\n- `disabled` (boolean): If true, disables the tab.",
62140
+ "description": "The list of tabs to display. Each tab is defined by an object with properties such as `id`, `title`, `subtitle`, `showSubtitle`, `hasLeadingIcon`, `hasBadge`, `badgeCount`, `badgeType`, `badgeSize`, `badgeShowNumber`, `showLeadingBadgeIcon`, and `disabled`.\n\n- `id` (string): Unique identifier for the tab.\n- `title` (string): Display label for the tab.\n- `subtitle` (string): Contextual text shown below the title when subtitle display is enabled.\n- `showSubtitle` (boolean): Optional per-tab override for displaying the subtitle.\n- `hasLeadingIcon` (boolean): Whether to show a leading icon (default: true).\n- `badges` (TabItemBadge[]): One or more badges to display on the tab. Takes precedence over the deprecated single-badge fields below.\n- `hasBadge` (boolean, deprecated): Whether to show a badge on the tab.\n- `badgeCount` (number, deprecated): Number to display in the badge.\n- `badgeType` (BadgeType, deprecated): Visual style of the badge (e.g., notification, alarm, enhance).\n- `badgeSize` (BadgeSize, deprecated): Size of the badge (e.g., regular, large).\n- `badgeShowNumber` (boolean, deprecated): If true, shows the badge number.\n- `showLeadingBadgeIcon` (boolean, deprecated): If true, shows a badge icon.\n- `disabled` (boolean): If true, disables the tab.",
62110
62141
  "attribute": "tabs"
62111
62142
  },
62112
62143
  {
@@ -62129,6 +62160,15 @@
62129
62160
  "description": "Whether to display a close button on each tab. When enabled, users can remove tabs individually.\n\nDefault: `false`.",
62130
62161
  "attribute": "has-close"
62131
62162
  },
62163
+ {
62164
+ "kind": "field",
62165
+ "name": "centerContent",
62166
+ "type": {
62167
+ "text": "boolean"
62168
+ },
62169
+ "default": "false",
62170
+ "attribute": "centerContent"
62171
+ },
62132
62172
  {
62133
62173
  "kind": "field",
62134
62174
  "name": "hug",
@@ -62252,7 +62292,7 @@
62252
62292
  "text": "TabData[]"
62253
62293
  },
62254
62294
  "default": "[]",
62255
- "description": "The list of tabs to display. Each tab is defined by an object with properties such as `id`, `title`, `subtitle`, `showSubtitle`, `hasLeadingIcon`, `hasBadge`, `badgeCount`, `badgeType`, `badgeSize`, `badgeShowNumber`, `showLeadingBadgeIcon`, and `disabled`.\n\n- `id` (string): Unique identifier for the tab.\n- `title` (string): Display label for the tab.\n- `subtitle` (string): Contextual text shown below the title when subtitle display is enabled.\n- `showSubtitle` (boolean): Optional per-tab override for displaying the subtitle.\n- `hasLeadingIcon` (boolean): Whether to show a leading icon (default: true).\n- `hasBadge` (boolean): Whether to show a badge on the tab.\n- `badgeCount` (number): Number to display in the badge.\n- `badgeType` (BadgeType): Visual style of the badge (e.g., notification, alarm, enhance).\n- `badgeSize` (BadgeSize): Size of the badge (e.g., regular, large).\n- `badgeShowNumber` (boolean): If true, shows the badge number.\n- `showLeadingBadgeIcon` (boolean): If true, shows a badge icon.\n- `disabled` (boolean): If true, disables the tab.",
62295
+ "description": "The list of tabs to display. Each tab is defined by an object with properties such as `id`, `title`, `subtitle`, `showSubtitle`, `hasLeadingIcon`, `hasBadge`, `badgeCount`, `badgeType`, `badgeSize`, `badgeShowNumber`, `showLeadingBadgeIcon`, and `disabled`.\n\n- `id` (string): Unique identifier for the tab.\n- `title` (string): Display label for the tab.\n- `subtitle` (string): Contextual text shown below the title when subtitle display is enabled.\n- `showSubtitle` (boolean): Optional per-tab override for displaying the subtitle.\n- `hasLeadingIcon` (boolean): Whether to show a leading icon (default: true).\n- `badges` (TabItemBadge[]): One or more badges to display on the tab. Takes precedence over the deprecated single-badge fields below.\n- `hasBadge` (boolean, deprecated): Whether to show a badge on the tab.\n- `badgeCount` (number, deprecated): Number to display in the badge.\n- `badgeType` (BadgeType, deprecated): Visual style of the badge (e.g., notification, alarm, enhance).\n- `badgeSize` (BadgeSize, deprecated): Size of the badge (e.g., regular, large).\n- `badgeShowNumber` (boolean, deprecated): If true, shows the badge number.\n- `showLeadingBadgeIcon` (boolean, deprecated): If true, shows a badge icon.\n- `disabled` (boolean): If true, disables the tab.",
62256
62296
  "fieldName": "tabs"
62257
62297
  },
62258
62298
  {
@@ -62273,6 +62313,14 @@
62273
62313
  "description": "Whether to display a close button on each tab. When enabled, users can remove tabs individually.\n\nDefault: `false`.",
62274
62314
  "fieldName": "hasClose"
62275
62315
  },
62316
+ {
62317
+ "name": "centerContent",
62318
+ "type": {
62319
+ "text": "boolean"
62320
+ },
62321
+ "default": "false",
62322
+ "fieldName": "centerContent"
62323
+ },
62276
62324
  {
62277
62325
  "name": "hug",
62278
62326
  "type": {
@@ -119,11 +119,18 @@ const compentStyle = css`* {
119
119
  color: var(--on-flat-disabled-color);
120
120
  }
121
121
 
122
+ .wrapper .badges {
123
+ display: flex;
124
+ align-items: center;
125
+ gap: 4px;
126
+ position: relative;
127
+ }
128
+
122
129
  .wrapper .badge {
123
130
  position: relative;
124
131
  }
125
132
 
126
- .wrapper:not(.hug) .badge {
133
+ .wrapper:not(.hug) .badges {
127
134
  right: 0;
128
135
  }
129
136
 
@@ -1 +1 @@
1
- {"version":3,"file":"tab-item.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"tab-item.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,26 @@
1
1
  import { LitElement } from 'lit';
2
+ import { BadgeSize, BadgeType } from '../badge/badge.js';
2
3
  import '../icon-button/icon-button.js';
3
4
  import '../../icons/icon-close-google.js';
4
5
  import '../badge/badge.js';
6
+ /**
7
+ * Configuration for a single badge rendered by `<obc-tab-item>` via the `badges` property.
8
+ */
9
+ export interface TabItemBadge {
10
+ /** Visual style/type of the badge. See `BadgeType` for available options. */
11
+ type: BadgeType;
12
+ /** Size of the badge. See `BadgeSize` for available options. */
13
+ size: BadgeSize;
14
+ /** The numeric value to display in the badge. */
15
+ count?: number;
16
+ /** Whether to show an icon inside the badge. Default: false. */
17
+ showIcon?: boolean;
18
+ /**
19
+ * When set, a `<slot>` with this name is rendered inside the badge so a custom
20
+ * icon can be projected (used for badge types without a built-in icon).
21
+ */
22
+ iconSlotName?: string;
23
+ }
5
24
  /**
6
25
  * `<obc-tab-item>` – A selectable tab component for navigation menus and tabbed interfaces.
7
26
  *
@@ -135,6 +154,19 @@ export declare class ObcTabItem extends LitElement {
135
154
  */
136
155
  hasDivider: boolean;
137
156
  /**
157
+ * One or more badges (count/status) to display on the tab.
158
+ *
159
+ * When this array is non-empty it takes precedence over the deprecated
160
+ * single-badge props (`hasBadge`, `badgeType`, `badgeSize`, `badgeCount`,
161
+ * `badgeShowNumber`, `showLeadingBadgeIcon`). When empty, the deprecated
162
+ * props are used instead (gated by `hasBadge`).
163
+ *
164
+ * Default: []
165
+ */
166
+ badges: TabItemBadge[];
167
+ /**
168
+ * @deprecated Use the `badges` array instead.
169
+ *
138
170
  * Displays a badge (count/status) on the tab.
139
171
  * Configure badge appearance via `badgeCount`, `badgeType`, `badgeSize`, etc.
140
172
  *
@@ -174,6 +206,8 @@ export declare class ObcTabItem extends LitElement {
174
206
  */
175
207
  disabled: boolean;
176
208
  /**
209
+ * @deprecated Use the `badges` array instead.
210
+ *
177
211
  * Type of badge to display (e.g., 'regular', 'alarm', 'warning', etc.).
178
212
  * See `BadgeType` enum for available options.
179
213
  *
@@ -182,6 +216,8 @@ export declare class ObcTabItem extends LitElement {
182
216
  */
183
217
  badgeType: string;
184
218
  /**
219
+ * @deprecated Use the `badges` array instead.
220
+ *
185
221
  * Size of the badge ('regular' or 'large').
186
222
  * See `BadgeSize` enum for available options.
187
223
  *
@@ -190,6 +226,8 @@ export declare class ObcTabItem extends LitElement {
190
226
  */
191
227
  badgeSize: string;
192
228
  /**
229
+ * @deprecated Use the `badges` array instead.
230
+ *
193
231
  * Shows the badge's numeric value. When false, only the badge background is rendered (for status-only badges).
194
232
  *
195
233
  * Default: true
@@ -197,6 +235,8 @@ export declare class ObcTabItem extends LitElement {
197
235
  */
198
236
  badgeShowNumber: boolean;
199
237
  /**
238
+ * @deprecated Use the `badges` array instead.
239
+ *
200
240
  * The numeric value to display in the badge (e.g., count of notifications).
201
241
  *
202
242
  * Default: 0
@@ -204,6 +244,8 @@ export declare class ObcTabItem extends LitElement {
204
244
  */
205
245
  badgeCount: number;
206
246
  /**
247
+ * @deprecated Use the `badges` array instead.
248
+ *
207
249
  * Shows an icon inside the badge.
208
250
  * Supply icon content via the `badge-icon` slot.
209
251
  *
@@ -214,6 +256,8 @@ export declare class ObcTabItem extends LitElement {
214
256
  private handleClick;
215
257
  private handleClose;
216
258
  private handleKeyDown;
259
+ private get effectiveBadges();
260
+ private renderBadge;
217
261
  render(): import('lit-html').TemplateResult<1>;
218
262
  static styles: import('lit').CSSResult;
219
263
  }
@@ -1 +1 @@
1
- {"version":3,"file":"tab-item.d.ts","sourceRoot":"","sources":["../../../src/components/tab-item/tab-item.ts"],"names":[],"mappings":"AAAA,OAAO,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;;;;;OAQG;IACuB,SAAS,EAAE,MAAM,CAAqB;IAEhE;;;;;;;OAOG;IAC0C,eAAe,EAAE,OAAO,CAAQ;IAE7E;;;;;;;OAOG;IACuB,UAAU,SAAK;IAEzC;;;;;;;;OAQG;IACwB,oBAAoB,UAAS;IAExD,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,aAAa;IAOrB,OAAO,KAAK,eAAe,GAgB1B;IAED,OAAO,CAAC,WAAW;IAiBV,MAAM;IAuEf,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,UAAU,CAAC;KAC5B;CACF"}
@@ -26,6 +26,7 @@ let ObcTabItem = class extends LitElement {
26
26
  this.hasLeadingIcon = false;
27
27
  this.hasTitle = false;
28
28
  this.hasDivider = false;
29
+ this.badges = [];
29
30
  this.hasBadge = false;
30
31
  this.icon = "placeholder";
31
32
  this.title = "Tab title";
@@ -65,7 +66,40 @@ let ObcTabItem = class extends LitElement {
65
66
  this.handleClick(event);
66
67
  }
67
68
  }
69
+ get effectiveBadges() {
70
+ if (this.badges.length > 0) {
71
+ return this.badges;
72
+ }
73
+ if (!this.hasBadge) {
74
+ return [];
75
+ }
76
+ return [
77
+ {
78
+ type: this.badgeType || BadgeType.regular,
79
+ size: this.badgeSize || BadgeSize.regular,
80
+ count: this.badgeShowNumber ? this.badgeCount : void 0,
81
+ showIcon: this.showLeadingBadgeIcon,
82
+ iconSlotName: this.showLeadingBadgeIcon ? "badge-icon" : void 0
83
+ }
84
+ ];
85
+ }
86
+ renderBadge(badge) {
87
+ return html`
88
+ <obc-badge
89
+ class="badge"
90
+ .number=${badge.count ?? 0}
91
+ .type=${badge.type || BadgeType.regular}
92
+ .size=${badge.size || BadgeSize.regular}
93
+ .showNumber=${badge.count !== void 0}
94
+ .showIcon=${badge.showIcon ?? false}
95
+ >
96
+ ${badge.iconSlotName ? html`<slot name=${badge.iconSlotName} slot="badge-icon"></slot>` : nothing}
97
+ </obc-badge>
98
+ `;
99
+ }
68
100
  render() {
101
+ const badges = this.effectiveBadges;
102
+ const hasBadge = badges.length > 0;
69
103
  const wrapperClasses = {
70
104
  wrapper: true,
71
105
  hug: this.hug,
@@ -73,7 +107,7 @@ let ObcTabItem = class extends LitElement {
73
107
  "has-leading-icon": this.hasLeadingIcon,
74
108
  "has-title": this.hasTitle,
75
109
  "has-divider": this.hasDivider && !this.checked,
76
- "has-badge": this.hasBadge,
110
+ "has-badge": hasBadge,
77
111
  "has-subtitle": this.showSubtitle,
78
112
  disabled: this.disabled,
79
113
  "center-content": this.centerContent
@@ -100,31 +134,13 @@ let ObcTabItem = class extends LitElement {
100
134
  ${this.showSubtitle && this.subtitle ? html`<div class="subtitle">${this.subtitle}</div>` : nothing}
101
135
  </div>
102
136
  ` : nothing}
103
- ${this.centerContent && this.hasBadge ? html`
104
- <obc-badge
105
- class="badge"
106
- .number=${this.badgeCount}
107
- .type=${this.badgeType || BadgeType.regular}
108
- .size=${this.badgeSize || BadgeSize.regular}
109
- .showNumber=${this.badgeShowNumber}
110
- .showIcon=${this.showLeadingBadgeIcon}
111
- >
112
- ${this.showLeadingBadgeIcon ? html`<slot name="badge-icon" slot="badge-icon"></slot>` : nothing}
113
- </obc-badge>
114
- ` : nothing}
137
+ ${this.centerContent && hasBadge ? html`<div class="badges">
138
+ ${badges.map((badge) => this.renderBadge(badge))}
139
+ </div>` : nothing}
115
140
  </div>
116
- ${!this.centerContent && this.hasBadge ? html`
117
- <obc-badge
118
- class="badge"
119
- .number=${this.badgeCount}
120
- .type=${this.badgeType || BadgeType.regular}
121
- .size=${this.badgeSize || BadgeSize.regular}
122
- .showNumber=${this.badgeShowNumber}
123
- .showIcon=${this.showLeadingBadgeIcon}
124
- >
125
- ${this.showLeadingBadgeIcon ? html`<slot name="badge-icon" slot="badge-icon"></slot>` : nothing}
126
- </obc-badge>
127
- ` : nothing}
141
+ ${!this.centerContent && hasBadge ? html`<div class="badges">
142
+ ${badges.map((badge) => this.renderBadge(badge))}
143
+ </div>` : nothing}
128
144
  ${this.hasClose ? html`
129
145
  <obc-icon-button
130
146
  class="close-button"
@@ -161,6 +177,9 @@ __decorateClass([
161
177
  __decorateClass([
162
178
  property({ type: Boolean, attribute: "has-divider" })
163
179
  ], ObcTabItem.prototype, "hasDivider", 2);
180
+ __decorateClass([
181
+ property({ type: Array, attribute: false })
182
+ ], ObcTabItem.prototype, "badges", 2);
164
183
  __decorateClass([
165
184
  property({ type: Boolean, attribute: "has-badge" })
166
185
  ], ObcTabItem.prototype, "hasBadge", 2);
@@ -1 +1 @@
1
- {"version":3,"file":"tab-item.js","sources":["../../../src/components/tab-item/tab-item.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {customElement} from '../../decorator.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport compentStyle from './tab-item.css?inline';\nimport '../icon-button/icon-button.js';\nimport {property} from 'lit/decorators.js';\nimport '../../icons/icon-close-google.js';\nimport '../badge/badge.js';\nimport {BadgeSize, BadgeType} from '../badge/badge.js';\n\n/**\n * `<obc-tab-item>` – A selectable tab component for navigation menus and tabbed interfaces.\n *\n * Represents a single tab within a tab bar or navigation group, supporting optional icons, subtitles, badges, close actions, and various layout modes. Designed for use in horizontal or vertical tab sets, allowing users to switch between different views or content panels.\n *\n * Appears as a button-like element that can display a leading icon, a title, an optional subtitle, a badge (for counts or status), and an optional close button. Supports both fixed-width and \"hug\" (fit-content) layouts, and can be styled as checked (active/selected) or disabled.\n *\n * ### Features\n * - **Selectable State:** Indicates active/selected tab via the `checked` property.\n * - **Leading Icon:** Optionally displays a leading icon via the `leading-icon` slot.\n * - **Title:** Supports a title label, either via property or slot.\n * - **Subtitle:** Optionally displays secondary contextual text below the title.\n * - **Badge Support:** Can show a badge (count/status) with configurable type, size, and icon.\n * - **Close Button:** Optional close action via a trailing icon button.\n * - **Layout Modes:**\n * - **Hug:** Shrinks to fit content width (`hug` property).\n * - **Center Content:** Centers content within the tab (`centerContent` property).\n * - **Divider:** Optional divider line for visual separation.\n * - **Disabled State:** Prevents interaction and visually indicates non-interactive state.\n * - **Keyboard Accessible:** Supports activation via Enter/Space keys.\n *\n * ### Variants and Configuration\n * - **Badge Types:** Supports all badge types from `obc-badge` (e.g., `alarm`, `warning`, `notification`, etc.).\n * - **Badge Sizes:** Regular and large badge sizes.\n * - **Badge Number Toggle:** Optionally hide the badge number via `badgeShowNumber` for status-only badges.\n * - **Show Leading Badge Icon:** Optionally display an icon within the badge.\n * - **Subtitle Toggle:** Optionally display a subtitle line using `showSubtitle`.\n *\n * ### Usage Guidelines\n * Use `obc-tab-item` within a tab bar or navigation group to represent a single selectable view or section. Ideal for switching between content panels, dashboards, or grouped settings. Use the `checked` property to indicate the active tab, and `disabled` to prevent selection. Use `subtitle` for short contextual information that helps distinguish similarly named tabs. The close button is suitable for user-removable tabs (e.g., in dynamic tab sets).\n *\n * - Use the badge for counts (e.g., notifications, alarms) or status indicators.\n * - Use the leading icon for visual context or to reinforce the tab's purpose.\n * - Avoid using the close button on non-removable tabs.\n * - For best accessibility, ensure each tab has a unique label/title.\n *\n * **TODO(designer):** Confirm if there are recommended maximum title lengths or truncation guidelines for tab labels.\n *\n * ### Slots\n *\n * | Slot Name | Renders When... | Purpose |\n * | -------------- | ---------------------- | -------------------------------------------------------- |\n * | leading-icon | `hasLeadingIcon` true | Leading icon representing the tab's category or purpose. |\n * | title | `hasTitle` true | Tab label or heading text. |\n * | badge-icon | `hasBadge` & `showLeadingBadgeIcon` true | Icon inside the badge (e.g., status symbol). |\n *\n * ### Events\n * - `tab-click` – Fired when the tab is clicked or activated via keyboard.\n * - `tab-close` – Fired when the close button is clicked.\n *\n * ### Best Practices\n * - Only one tab in a group should have `checked` set to true.\n * - Use the badge for concise status/counts; avoid long text in badges.\n * - The close button should only be used for tabs that users can remove.\n * - For accessibility, ensure tabs are focusable and have clear labels.\n *\n * **Example:**\n * ```\n * <obc-tab-item\n * checked\n * has-leading-icon\n * has-title\n * show-subtitle\n * subtitle=\"Context\"\n * has-badge\n * badgeCount=\"3\"\n * badgeType=\"alarm\"\n * has-close\n * title=\"Alarms\"\n * >\n * <obi-placeholder slot=\"leading-icon\"></obi-placeholder>\n * <obi-placeholder slot=\"badge-icon\"></obi-placeholder>\n * </obc-tab-item>\n * ```\n *\n * @slot leading-icon - Slot for the leading icon (shown when `hasLeadingIcon` is true)\n * @slot title - Slot for the tab's label/title (shown when `hasTitle` is true)\n * @slot badge-icon - Slot for an icon inside the badge (shown when `hasBadge` and `showLeadingBadgeIcon` are true)\n * @fires tab-click {CustomEvent<{title: string}>} When the tab is clicked or activated via keyboard\n * @fires tab-close {CustomEvent<{title: string}>} When the close button is clicked\n */\n@customElement('obc-tab-item')\nexport class ObcTabItem extends LitElement {\n /**\n * Shrinks the tab width to fit its content instead of using the default fixed width.\n * When enabled, the tab will use `width: fit-content` and a minimum width.\n *\n * Default: false\n */\n @property({type: Boolean, reflect: true}) hug = false;\n\n /**\n * Centers the content (icon, title, badge) horizontally within the tab.\n * When enabled, content is centered rather than left-aligned.\n *\n * Default: false\n */\n @property({type: Boolean}) centerContent = false;\n\n /**\n * Marks the tab as selected/active.\n * Only one tab in a group should have `checked` set to true.\n *\n * Default: false\n */\n @property({type: Boolean, reflect: true}) checked = false;\n\n /**\n * Displays a close button at the end of the tab.\n * Use for tabs that can be removed by the user.\n *\n * Default: false\n */\n @property({type: Boolean, attribute: 'has-close'}) hasClose = false;\n\n /**\n * Shows a leading icon at the start of the tab.\n * Supply icon content via the `leading-icon` slot.\n *\n * Default: false\n */\n @property({type: Boolean, attribute: 'has-leading-icon'}) hasLeadingIcon =\n false;\n\n /**\n * Displays the tab's title/label.\n * Content can be provided via the `title` slot or the `title` property.\n *\n * Default: false\n */\n @property({type: Boolean, attribute: 'has-title'}) hasTitle = false;\n\n /**\n * Shows a vertical divider on the left edge of the tab (except when checked).\n * Useful for visually separating tabs.\n *\n * Default: false\n * @availableWhen checked==false\n */\n @property({type: Boolean, attribute: 'has-divider'}) hasDivider = false;\n\n /**\n * Displays a badge (count/status) on the tab.\n * Configure badge appearance via `badgeCount`, `badgeType`, `badgeSize`, etc.\n *\n * Default: false\n */\n @property({type: Boolean, attribute: 'has-badge'}) hasBadge = false;\n\n /**\n * (Deprecated/Unused) Icon name for the tab.\n * Icon content should be provided via the `leading-icon` slot.\n *\n * Default: 'placeholder'\n */\n @property({type: String}) icon = 'placeholder';\n\n /**\n * The tab's title/label text.\n * Can be overridden by slotting content into the `title` slot.\n *\n * Default: 'Tab title'\n */\n @property({type: String}) override title = 'Tab title';\n\n /**\n * Shows contextual text below the tab title.\n *\n * Default: false\n */\n @property({type: Boolean, attribute: 'show-subtitle'}) showSubtitle = false;\n\n /**\n * Contextual text shown below the tab title when `showSubtitle` is true.\n *\n * Default: ''\n */\n @property({type: String}) subtitle = '';\n\n /**\n * Disables the tab, preventing user interaction and applying disabled styles.\n *\n * Default: false\n */\n @property({type: Boolean}) disabled = false;\n\n /**\n * Type of badge to display (e.g., 'regular', 'alarm', 'warning', etc.).\n * See `BadgeType` enum for available options.\n *\n * Default: 'regular'\n * @availableWhen hasBadge==true\n */\n @property({type: String}) badgeType: string = BadgeType.regular;\n\n /**\n * Size of the badge ('regular' or 'large').\n * See `BadgeSize` enum for available options.\n *\n * Default: 'regular'\n * @availableWhen hasBadge==true\n */\n @property({type: String}) badgeSize: string = BadgeSize.regular;\n\n /**\n * Shows the badge's numeric value. When false, only the badge background is rendered (for status-only badges).\n *\n * Default: true\n * @availableWhen hasBadge==true\n */\n @property({type: Boolean, attribute: false}) badgeShowNumber: boolean = true;\n\n /**\n * The numeric value to display in the badge (e.g., count of notifications).\n *\n * Default: 0\n * @availableWhen hasBadge==true\n */\n @property({type: Number}) badgeCount = 0;\n\n /**\n * Shows an icon inside the badge.\n * Supply icon content via the `badge-icon` slot.\n *\n * Default: false\n * @availableWhen hasBadge==true\n */\n @property({type: Boolean}) showLeadingBadgeIcon = false;\n\n private handleClick(event: Event) {\n if (this.disabled) {\n event.preventDefault();\n return;\n }\n const clickEvent = new CustomEvent('tab-click', {\n detail: {title: this.title},\n bubbles: true,\n composed: true,\n });\n this.dispatchEvent(clickEvent);\n }\n\n private handleClose(event: Event) {\n event.stopPropagation();\n const closeEvent = new CustomEvent('tab-close', {\n detail: {title: this.title},\n bubbles: true,\n composed: true,\n });\n this.dispatchEvent(closeEvent);\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.handleClick(event);\n }\n }\n\n override render() {\n const wrapperClasses = {\n wrapper: true,\n hug: this.hug,\n 'has-close': this.hasClose,\n 'has-leading-icon': this.hasLeadingIcon,\n 'has-title': this.hasTitle,\n 'has-divider': this.hasDivider && !this.checked,\n 'has-badge': this.hasBadge,\n 'has-subtitle': this.showSubtitle,\n disabled: this.disabled,\n 'center-content': this.centerContent,\n };\n\n return html`\n <div\n class=${classMap(wrapperClasses)}\n role=\"tab\"\n tabindex=${this.disabled ? '-1' : '0'}\n @click=${this.handleClick}\n @keydown=${this.handleKeyDown}\n >\n <div class=\"content\">\n ${this.hasLeadingIcon\n ? html`\n <div class=\"leading-icon\">\n <slot name=\"leading-icon\"></slot>\n </div>\n `\n : nothing}\n ${this.hasTitle\n ? html`\n <div class=\"text-content\">\n <div class=\"title\">\n <slot name=\"title\">${this.title}</slot>\n </div>\n ${this.showSubtitle && this.subtitle\n ? html`<div class=\"subtitle\">${this.subtitle}</div>`\n : nothing}\n </div>\n `\n : nothing}\n ${this.centerContent && this.hasBadge\n ? html`\n <obc-badge\n class=\"badge\"\n .number=${this.badgeCount}\n .type=${this.badgeType || BadgeType.regular}\n .size=${this.badgeSize || BadgeSize.regular}\n .showNumber=${this.badgeShowNumber}\n .showIcon=${this.showLeadingBadgeIcon}\n >\n ${this.showLeadingBadgeIcon\n ? html`<slot name=\"badge-icon\" slot=\"badge-icon\"></slot>`\n : nothing}\n </obc-badge>\n `\n : nothing}\n </div>\n ${!this.centerContent && this.hasBadge\n ? html`\n <obc-badge\n class=\"badge\"\n .number=${this.badgeCount}\n .type=${this.badgeType || BadgeType.regular}\n .size=${this.badgeSize || BadgeSize.regular}\n .showNumber=${this.badgeShowNumber}\n .showIcon=${this.showLeadingBadgeIcon}\n >\n ${this.showLeadingBadgeIcon\n ? html`<slot name=\"badge-icon\" slot=\"badge-icon\"></slot>`\n : nothing}\n </obc-badge>\n `\n : nothing}\n ${this.hasClose\n ? html`\n <obc-icon-button\n class=\"close-button\"\n variant=\"flat\"\n @click=${this.handleClose}\n aria-label=\"Close tab\"\n .disabled=${this.disabled}\n ><obi-close-google></obi-close-google\n ></obc-icon-button>\n `\n : nothing}\n </div>\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-tab-item': ObcTabItem;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA4FO,IAAM,aAAN,cAAyB,WAAW;AAAA,EAApC,cAAA;AAAA,UAAA,GAAA,SAAA;AAOqC,SAAA,MAAM;AAQrB,SAAA,gBAAgB;AAQD,SAAA,UAAU;AAQD,SAAA,WAAW;AAQJ,SAAA,iBACxD;AAQiD,SAAA,WAAW;AAST,SAAA,aAAa;AAQf,SAAA,WAAW;AAQpC,SAAA,OAAO;AAQP,SAAS,QAAQ;AAOY,SAAA,eAAe;AAO5C,SAAA,WAAW;AAOV,SAAA,WAAW;AASZ,SAAA,YAAoB,UAAU;AAS9B,SAAA,YAAoB,UAAU;AAQX,SAAA,kBAA2B;AAQ9C,SAAA,aAAa;AASZ,SAAA,uBAAuB;AAAA,EAAA;AAAA,EAE1C,YAAY,OAAc;AAChC,QAAI,KAAK,UAAU;AACjB,YAAM,eAAA;AACN;AAAA,IACF;AACA,UAAM,aAAa,IAAI,YAAY,aAAa;AAAA,MAC9C,QAAQ,EAAC,OAAO,KAAK,MAAA;AAAA,MACrB,SAAS;A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AAAA,EADN,cAAc,cAAc;AAAA,GAChB,UAAA;"}
1
+ {"version":3,"file":"tab-item.js","sources":["../../../src/components/tab-item/tab-item.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {customElement} from '../../decorator.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport compentStyle from './tab-item.css?inline';\nimport '../icon-button/icon-button.js';\nimport {property} from 'lit/decorators.js';\nimport '../../icons/icon-close-google.js';\nimport '../badge/badge.js';\nimport {BadgeSize, BadgeType} from '../badge/badge.js';\n\n/**\n * Configuration for a single badge rendered by `<obc-tab-item>` via the `badges` property.\n */\nexport interface TabItemBadge {\n /** Visual style/type of the badge. See `BadgeType` for available options. */\n type: BadgeType;\n /** Size of the badge. See `BadgeSize` for available options. */\n size: BadgeSize;\n /** The numeric value to display in the badge. */\n count?: number;\n /** Whether to show an icon inside the badge. Default: false. */\n showIcon?: boolean;\n /**\n * When set, a `<slot>` with this name is rendered inside the badge so a custom\n * icon can be projected (used for badge types without a built-in icon).\n */\n iconSlotName?: string;\n}\n\n/**\n * `<obc-tab-item>` – A selectable tab component for navigation menus and tabbed interfaces.\n *\n * Represents a single tab within a tab bar or navigation group, supporting optional icons, subtitles, badges, close actions, and various layout modes. Designed for use in horizontal or vertical tab sets, allowing users to switch between different views or content panels.\n *\n * Appears as a button-like element that can display a leading icon, a title, an optional subtitle, a badge (for counts or status), and an optional close button. Supports both fixed-width and \"hug\" (fit-content) layouts, and can be styled as checked (active/selected) or disabled.\n *\n * ### Features\n * - **Selectable State:** Indicates active/selected tab via the `checked` property.\n * - **Leading Icon:** Optionally displays a leading icon via the `leading-icon` slot.\n * - **Title:** Supports a title label, either via property or slot.\n * - **Subtitle:** Optionally displays secondary contextual text below the title.\n * - **Badge Support:** Can show a badge (count/status) with configurable type, size, and icon.\n * - **Close Button:** Optional close action via a trailing icon button.\n * - **Layout Modes:**\n * - **Hug:** Shrinks to fit content width (`hug` property).\n * - **Center Content:** Centers content within the tab (`centerContent` property).\n * - **Divider:** Optional divider line for visual separation.\n * - **Disabled State:** Prevents interaction and visually indicates non-interactive state.\n * - **Keyboard Accessible:** Supports activation via Enter/Space keys.\n *\n * ### Variants and Configuration\n * - **Badge Types:** Supports all badge types from `obc-badge` (e.g., `alarm`, `warning`, `notification`, etc.).\n * - **Badge Sizes:** Regular and large badge sizes.\n * - **Badge Number Toggle:** Optionally hide the badge number via `badgeShowNumber` for status-only badges.\n * - **Show Leading Badge Icon:** Optionally display an icon within the badge.\n * - **Subtitle Toggle:** Optionally display a subtitle line using `showSubtitle`.\n *\n * ### Usage Guidelines\n * Use `obc-tab-item` within a tab bar or navigation group to represent a single selectable view or section. Ideal for switching between content panels, dashboards, or grouped settings. Use the `checked` property to indicate the active tab, and `disabled` to prevent selection. Use `subtitle` for short contextual information that helps distinguish similarly named tabs. The close button is suitable for user-removable tabs (e.g., in dynamic tab sets).\n *\n * - Use the badge for counts (e.g., notifications, alarms) or status indicators.\n * - Use the leading icon for visual context or to reinforce the tab's purpose.\n * - Avoid using the close button on non-removable tabs.\n * - For best accessibility, ensure each tab has a unique label/title.\n *\n * **TODO(designer):** Confirm if there are recommended maximum title lengths or truncation guidelines for tab labels.\n *\n * ### Slots\n *\n * | Slot Name | Renders When... | Purpose |\n * | -------------- | ---------------------- | -------------------------------------------------------- |\n * | leading-icon | `hasLeadingIcon` true | Leading icon representing the tab's category or purpose. |\n * | title | `hasTitle` true | Tab label or heading text. |\n * | badge-icon | `hasBadge` & `showLeadingBadgeIcon` true | Icon inside the badge (e.g., status symbol). |\n *\n * ### Events\n * - `tab-click` – Fired when the tab is clicked or activated via keyboard.\n * - `tab-close` – Fired when the close button is clicked.\n *\n * ### Best Practices\n * - Only one tab in a group should have `checked` set to true.\n * - Use the badge for concise status/counts; avoid long text in badges.\n * - The close button should only be used for tabs that users can remove.\n * - For accessibility, ensure tabs are focusable and have clear labels.\n *\n * **Example:**\n * ```\n * <obc-tab-item\n * checked\n * has-leading-icon\n * has-title\n * show-subtitle\n * subtitle=\"Context\"\n * has-badge\n * badgeCount=\"3\"\n * badgeType=\"alarm\"\n * has-close\n * title=\"Alarms\"\n * >\n * <obi-placeholder slot=\"leading-icon\"></obi-placeholder>\n * <obi-placeholder slot=\"badge-icon\"></obi-placeholder>\n * </obc-tab-item>\n * ```\n *\n * @slot leading-icon - Slot for the leading icon (shown when `hasLeadingIcon` is true)\n * @slot title - Slot for the tab's label/title (shown when `hasTitle` is true)\n * @slot badge-icon - Slot for an icon inside the badge (shown when `hasBadge` and `showLeadingBadgeIcon` are true)\n * @fires tab-click {CustomEvent<{title: string}>} When the tab is clicked or activated via keyboard\n * @fires tab-close {CustomEvent<{title: string}>} When the close button is clicked\n */\n@customElement('obc-tab-item')\nexport class ObcTabItem extends LitElement {\n /**\n * Shrinks the tab width to fit its content instead of using the default fixed width.\n * When enabled, the tab will use `width: fit-content` and a minimum width.\n *\n * Default: false\n */\n @property({type: Boolean, reflect: true}) hug = false;\n\n /**\n * Centers the content (icon, title, badge) horizontally within the tab.\n * When enabled, content is centered rather than left-aligned.\n *\n * Default: false\n */\n @property({type: Boolean}) centerContent = false;\n\n /**\n * Marks the tab as selected/active.\n * Only one tab in a group should have `checked` set to true.\n *\n * Default: false\n */\n @property({type: Boolean, reflect: true}) checked = false;\n\n /**\n * Displays a close button at the end of the tab.\n * Use for tabs that can be removed by the user.\n *\n * Default: false\n */\n @property({type: Boolean, attribute: 'has-close'}) hasClose = false;\n\n /**\n * Shows a leading icon at the start of the tab.\n * Supply icon content via the `leading-icon` slot.\n *\n * Default: false\n */\n @property({type: Boolean, attribute: 'has-leading-icon'}) hasLeadingIcon =\n false;\n\n /**\n * Displays the tab's title/label.\n * Content can be provided via the `title` slot or the `title` property.\n *\n * Default: false\n */\n @property({type: Boolean, attribute: 'has-title'}) hasTitle = false;\n\n /**\n * Shows a vertical divider on the left edge of the tab (except when checked).\n * Useful for visually separating tabs.\n *\n * Default: false\n * @availableWhen checked==false\n */\n @property({type: Boolean, attribute: 'has-divider'}) hasDivider = false;\n\n /**\n * One or more badges (count/status) to display on the tab.\n *\n * When this array is non-empty it takes precedence over the deprecated\n * single-badge props (`hasBadge`, `badgeType`, `badgeSize`, `badgeCount`,\n * `badgeShowNumber`, `showLeadingBadgeIcon`). When empty, the deprecated\n * props are used instead (gated by `hasBadge`).\n *\n * Default: []\n */\n @property({type: Array, attribute: false}) badges: TabItemBadge[] = [];\n\n /**\n * @deprecated Use the `badges` array instead.\n *\n * Displays a badge (count/status) on the tab.\n * Configure badge appearance via `badgeCount`, `badgeType`, `badgeSize`, etc.\n *\n * Default: false\n */\n @property({type: Boolean, attribute: 'has-badge'}) hasBadge = false;\n\n /**\n * (Deprecated/Unused) Icon name for the tab.\n * Icon content should be provided via the `leading-icon` slot.\n *\n * Default: 'placeholder'\n */\n @property({type: String}) icon = 'placeholder';\n\n /**\n * The tab's title/label text.\n * Can be overridden by slotting content into the `title` slot.\n *\n * Default: 'Tab title'\n */\n @property({type: String}) override title = 'Tab title';\n\n /**\n * Shows contextual text below the tab title.\n *\n * Default: false\n */\n @property({type: Boolean, attribute: 'show-subtitle'}) showSubtitle = false;\n\n /**\n * Contextual text shown below the tab title when `showSubtitle` is true.\n *\n * Default: ''\n */\n @property({type: String}) subtitle = '';\n\n /**\n * Disables the tab, preventing user interaction and applying disabled styles.\n *\n * Default: false\n */\n @property({type: Boolean}) disabled = false;\n\n /**\n * @deprecated Use the `badges` array instead.\n *\n * Type of badge to display (e.g., 'regular', 'alarm', 'warning', etc.).\n * See `BadgeType` enum for available options.\n *\n * Default: 'regular'\n * @availableWhen hasBadge==true\n */\n @property({type: String}) badgeType: string = BadgeType.regular;\n\n /**\n * @deprecated Use the `badges` array instead.\n *\n * Size of the badge ('regular' or 'large').\n * See `BadgeSize` enum for available options.\n *\n * Default: 'regular'\n * @availableWhen hasBadge==true\n */\n @property({type: String}) badgeSize: string = BadgeSize.regular;\n\n /**\n * @deprecated Use the `badges` array instead.\n *\n * Shows the badge's numeric value. When false, only the badge background is rendered (for status-only badges).\n *\n * Default: true\n * @availableWhen hasBadge==true\n */\n @property({type: Boolean, attribute: false}) badgeShowNumber: boolean = true;\n\n /**\n * @deprecated Use the `badges` array instead.\n *\n * The numeric value to display in the badge (e.g., count of notifications).\n *\n * Default: 0\n * @availableWhen hasBadge==true\n */\n @property({type: Number}) badgeCount = 0;\n\n /**\n * @deprecated Use the `badges` array instead.\n *\n * Shows an icon inside the badge.\n * Supply icon content via the `badge-icon` slot.\n *\n * Default: false\n * @availableWhen hasBadge==true\n */\n @property({type: Boolean}) showLeadingBadgeIcon = false;\n\n private handleClick(event: Event) {\n if (this.disabled) {\n event.preventDefault();\n return;\n }\n const clickEvent = new CustomEvent('tab-click', {\n detail: {title: this.title},\n bubbles: true,\n composed: true,\n });\n this.dispatchEvent(clickEvent);\n }\n\n private handleClose(event: Event) {\n event.stopPropagation();\n const closeEvent = new CustomEvent('tab-close', {\n detail: {title: this.title},\n bubbles: true,\n composed: true,\n });\n this.dispatchEvent(closeEvent);\n }\n\n private handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n this.handleClick(event);\n }\n }\n\n private get effectiveBadges(): TabItemBadge[] {\n if (this.badges.length > 0) {\n return this.badges;\n }\n if (!this.hasBadge) {\n return [];\n }\n return [\n {\n type: (this.badgeType as BadgeType) || BadgeType.regular,\n size: (this.badgeSize as BadgeSize) || BadgeSize.regular,\n count: this.badgeShowNumber ? this.badgeCount : undefined,\n showIcon: this.showLeadingBadgeIcon,\n iconSlotName: this.showLeadingBadgeIcon ? 'badge-icon' : undefined,\n },\n ];\n }\n\n private renderBadge(badge: TabItemBadge) {\n return html`\n <obc-badge\n class=\"badge\"\n .number=${badge.count ?? 0}\n .type=${badge.type || BadgeType.regular}\n .size=${badge.size || BadgeSize.regular}\n .showNumber=${badge.count !== undefined}\n .showIcon=${badge.showIcon ?? false}\n >\n ${badge.iconSlotName\n ? html`<slot name=${badge.iconSlotName} slot=\"badge-icon\"></slot>`\n : nothing}\n </obc-badge>\n `;\n }\n\n override render() {\n const badges = this.effectiveBadges;\n const hasBadge = badges.length > 0;\n const wrapperClasses = {\n wrapper: true,\n hug: this.hug,\n 'has-close': this.hasClose,\n 'has-leading-icon': this.hasLeadingIcon,\n 'has-title': this.hasTitle,\n 'has-divider': this.hasDivider && !this.checked,\n 'has-badge': hasBadge,\n 'has-subtitle': this.showSubtitle,\n disabled: this.disabled,\n 'center-content': this.centerContent,\n };\n\n return html`\n <div\n class=${classMap(wrapperClasses)}\n role=\"tab\"\n tabindex=${this.disabled ? '-1' : '0'}\n @click=${this.handleClick}\n @keydown=${this.handleKeyDown}\n >\n <div class=\"content\">\n ${this.hasLeadingIcon\n ? html`\n <div class=\"leading-icon\">\n <slot name=\"leading-icon\"></slot>\n </div>\n `\n : nothing}\n ${this.hasTitle\n ? html`\n <div class=\"text-content\">\n <div class=\"title\">\n <slot name=\"title\">${this.title}</slot>\n </div>\n ${this.showSubtitle && this.subtitle\n ? html`<div class=\"subtitle\">${this.subtitle}</div>`\n : nothing}\n </div>\n `\n : nothing}\n ${this.centerContent && hasBadge\n ? html`<div class=\"badges\">\n ${badges.map((badge) => this.renderBadge(badge))}\n </div>`\n : nothing}\n </div>\n ${!this.centerContent && hasBadge\n ? html`<div class=\"badges\">\n ${badges.map((badge) => this.renderBadge(badge))}\n </div>`\n : nothing}\n ${this.hasClose\n ? html`\n <obc-icon-button\n class=\"close-button\"\n variant=\"flat\"\n @click=${this.handleClose}\n aria-label=\"Close tab\"\n .disabled=${this.disabled}\n ><obi-close-google></obi-close-google\n ></obc-icon-button>\n `\n : nothing}\n </div>\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-tab-item': ObcTabItem;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA+GO,IAAM,aAAN,cAAyB,WAAW;AAAA,EAApC,cAAA;AAAA,UAAA,GAAA,SA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