@oicl/openbridge-webcomponents 2.2.0-next.2 → 2.2.0-next.4

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.
@@ -59956,7 +59956,7 @@
59956
59956
  "declarations": [
59957
59957
  {
59958
59958
  "kind": "class",
59959
- "description": "`<obc-alert-button-item>` – The bell button that shows the alert state and count.\n\nShows the alert status as a bell in the style of the given alert type, with\nan optional counter, or as a global counter: one badge per severity, then\nthe bell and the total. `obc-alert-button` renders the item next to its\nsilence button; use the item on its own where no silence button is needed.\n\n---\n\n### Features\n- **Variants (`type`):** `flat` (icon only), `normal` (bordered, icon and\n counter) and `enhanced` (filled in the severity colour).\n- **Alert types:** `alarm`, `warning`, `caution` and the `level-*` family;\n `nAlerts` of 0 shows the idle bell.\n- **Counter:** `counter` shows `nAlerts` next to the bell, except in `flat`.\n- **Global counter:** `globalCounter` shows the per-severity `counts` as\n badges, then the bell and `nAlerts`, always in the normal style.\n- **Flashing:** `blinking` flashes the bell at the tempo `flashingSpeed`\n resolves (#1224).\n- **Fill height:** `fillHeight` stretches the visible button to the host\n height, as the tall `obc-alert-button` does.\n\n---\n\n### Usage Guidelines\n- Keep `nAlerts` and `counts` consistent; the item shows both as given.\n- The generated label reads e.g. \"Alerts, 12, 2 Alarm, 4 Warning,\n 6 Caution\"; an `aria-label` on the host replaces it. A visually hidden\n polite live region repeats that name, so a change of counts is announced\n without the button holding focus; the name attribute alone would change\n silently.\n- A native button, so Enter and Space activate it (APG button pattern).\n- A parent that joins another button to the item's end sets the\n `data-group-item-not-last` attribute on the host.\n- **TODO(designer):** the Figma file draws the flat item's hover, active and\n focused variants at 20 % opacity; the item uses the standard flat states.\n- **TODO(designer):** the Figma file defines no flashing for the global\n counter, so it never flashes.\n\n---\n\n### Example\n\n```html\n<obc-alert-button-item alertType=\"alarm\" nAlerts=\"3\" counter blinking></obc-alert-button-item>\n<obc-alert-button-item\n globalCounter\n nAlerts=\"12\"\n .counts=${{countAlarm: 2, countWarning: 4, countCaution: 6}}\n></obc-alert-button-item>\n```",
59959
+ "description": "`<obc-alert-button-item>` – The bell button that shows the alert state and count.\n\nShows the alert status as a bell in the style of the given alert type, with\nan optional counter, or as a global counter: one badge per severity, then\nthe bell and the total. `obc-alert-button` renders the item next to its\nsilence button; use the item on its own where no silence button is needed.\n\n---\n\n### Features\n- **Variants (`type`):** `flat` (icon only), `normal` (bordered, icon and\n counter) and `enhanced` (filled in the severity colour).\n- **Alert types:** `alarm`, `warning`, `caution` and the `level-*` family;\n `nAlerts` of 0 shows the idle bell.\n- **Counter:** `counter` shows `nAlerts` next to the bell, except in `flat`.\n- **Global counter:** `globalCounter` shows the per-severity `counts` as\n badges, then the bell and `nAlerts`, always in the normal style;\n `globalCounterType` picks filled badges or the severity shapes.\n- **Flashing:** `blinking` flashes the bell at the tempo `flashingSpeed`\n resolves (#1224).\n- **Fill height:** `fillHeight` stretches the visible button to the host\n height, as the tall `obc-alert-button` does.\n\n---\n\n### Usage Guidelines\n- Keep `nAlerts` and `counts` consistent; the item shows both as given.\n- The generated label reads e.g. \"Alerts, 12, 2 Alarm, 4 Warning,\n 6 Caution\"; an `aria-label` on the host replaces it. A visually hidden\n polite live region repeats that name, so a change of counts is announced\n without the button holding focus; the name attribute alone would change\n silently.\n- A native button, so Enter and Space activate it (APG button pattern).\n- A parent that joins another button to the item's end sets the\n `data-group-item-not-last` attribute on the host.\n- **TODO(designer):** the Figma file draws the flat item's hover, active and\n focused variants at 20 % opacity; the item uses the standard flat states.\n- **TODO(designer):** the Figma file defines no flashing for the global\n counter, so it never flashes.\n\n---\n\n### Example\n\n```html\n<obc-alert-button-item alertType=\"alarm\" nAlerts=\"3\" counter blinking></obc-alert-button-item>\n<obc-alert-button-item\n globalCounter\n nAlerts=\"12\"\n .counts=${{countAlarm: 2, countWarning: 4, countCaution: 6}}\n></obc-alert-button-item>\n```",
59960
59960
  "name": "ObcAlertButtonItem",
59961
59961
  "members": [
59962
59962
  {
@@ -60022,6 +60022,20 @@
60022
60022
  "description": "Shows the per-severity counts, the bell and the total instead of a single alert status.",
60023
60023
  "attribute": "globalCounter"
60024
60024
  },
60025
+ {
60026
+ "kind": "field",
60027
+ "name": "globalCounterType",
60028
+ "type": {
60029
+ "text": "ObcAlertCounterItemType"
60030
+ },
60031
+ "description": "How the global counter draws each count: `badges` (filled severity badges, default) or `alert-level` (the severity shape beside the count).\n\nAvailable when `globalCounter==true`.",
60032
+ "attribute": "globalCounterType",
60033
+ "availableWhen": "globalCounter==true",
60034
+ "availableWhenIf": {
60035
+ "arg": "globalCounter",
60036
+ "truthy": true
60037
+ }
60038
+ },
60025
60039
  {
60026
60040
  "kind": "field",
60027
60041
  "name": "counts",
@@ -60210,6 +60224,14 @@
60210
60224
  "description": "Shows the per-severity counts, the bell and the total instead of a single alert status.",
60211
60225
  "fieldName": "globalCounter"
60212
60226
  },
60227
+ {
60228
+ "name": "globalCounterType",
60229
+ "type": {
60230
+ "text": "ObcAlertCounterItemType"
60231
+ },
60232
+ "description": "How the global counter draws each count: `badges` (filled severity badges, default) or `alert-level` (the severity shape beside the count).\n\nAvailable when `globalCounter==true`.",
60233
+ "fieldName": "globalCounterType"
60234
+ },
60213
60235
  {
60214
60236
  "name": "shelvedCount",
60215
60237
  "type": {
@@ -60288,7 +60310,7 @@
60288
60310
  "declarations": [
60289
60311
  {
60290
60312
  "kind": "class",
60291
- "description": "`<obc-alert-button>` – A compact, icon-based button for displaying alert or notification status and count.\n\nThis component provides a visual indicator for active alerts or notifications, supporting different alert types (such as alarm, warning, or caution) and an optional counter badge. It can also include a secondary \"silence\" action button for muting alerts, adapting its layout responsively for different screen widths.\n\nAppears in toolbars or notification areas to give users a quick overview of alert status and provide direct access to alert-related actions. The bell itself is an `obc-alert-button-item`; use the item directly where no silence button or breakpoints are needed, or for its global counter.\n\n## Features\n\n- **Variants:**\n - **Flat:** Minimal, icon-only button for space-constrained layouts.\n - **Normal:** Standard button with icon and optional alert counter.\n - **Enhanced:** Visually prominent button for high-priority alerts, with accent styling.\n- **Alert Types:** Supports `alarm`, `warning`, `caution`, or no alert (idle). Icon and color adapt to the alert type.\n- **Alert Counter:** Optional badge displays the number of active alerts (except in flat mode).\n- **Global Counter:** `globalCounter` shows the per-severity `counts` and an optional `shelvedCount` before the bell and the total, as `obc-alert-button-item` draws them.\n- **Silence Button:** Optional secondary button to mute or silence alerts, shown when enabled and at sufficient width.\n- **Blinking Animation:** Can animate (blink) to draw attention to active alerts (except for caution type).\n- **Responsive Layout:** Automatically switches to flat mode below a configurable width, and hides the silence button below another configurable width.\n- **Large Size Option:** Increases button height and padding for touch-friendly or prominent use.\n\n## Usage Guidelines\n\nUse `<obc-alert-button>` to provide a persistent, easily accessible indicator of alert or notification status. Ideal for toolbars, headers, or notification panels where users need to be aware of active alerts and may need to silence them quickly.\n\n- Use the counter to show the number of active alerts when relevant.\n- Use the silence button to provide a quick mute action, but only when space allows.\n- Choose the variant (`flat`, `normal`, `enhanced`) based on available space and the importance of the alert.\n- The blinking feature should be reserved for urgent or high-priority alerts to avoid unnecessary distraction.\n\n**TODO(designer):** Confirm if there are recommended default behaviors for auto-blinking, and if there are any design constraints for when to use each variant.\n\n**TODO(designer):** The Figma Alert button has no flat Global counter, so below `flatMaxBreakpointPx` the button shows the flat bell without the counts.\n\n## Events\n\n- `click-alert` – Fired when the main alert button is clicked.\n- `click-silence` – Fired when the silence button is clicked.\n\n## Best Practices & Constraints\n\n- Only show the counter when there are active alerts and the button is not in flat mode.\n- The silence button is only visible if enabled, the width is above the minimum breakpoint, and the button is not flat.\n- Blinking should be used sparingly to avoid overwhelming the user.\n- Use the large variant for touch interfaces or when the button needs to stand out.\n\n## Example\n\n```html\n<obc-alert-button\n nAlerts=\"3\"\n alertType=\"alarm\"\n type=\"enhanced\"\n counter\n showSilenceButton\n blinking\n large\n flatMaxBreakpointPx=\"600\"\n silenceButtonMinBreakpointPx=\"600\"\n></obc-alert-button>\n```\n\nIn this example, the button shows an alarm icon, a counter badge with \"3\", is styled as enhanced, blinks to indicate urgency, and includes a silence button if the width allows.",
60313
+ "description": "`<obc-alert-button>` – A compact, icon-based button for displaying alert or notification status and count.\n\nThis component provides a visual indicator for active alerts or notifications, supporting different alert types (such as alarm, warning, or caution) and an optional counter badge. It can also include a secondary \"silence\" action button for muting alerts, adapting its layout responsively for different screen widths.\n\nAppears in toolbars or notification areas to give users a quick overview of alert status and provide direct access to alert-related actions. The bell itself is an `obc-alert-button-item`; use the item directly where no silence button or breakpoints are needed, or for its global counter.\n\n## Features\n\n- **Variants:**\n - **Flat:** Minimal, icon-only button for space-constrained layouts.\n - **Normal:** Standard button with icon and optional alert counter.\n - **Enhanced:** Visually prominent button for high-priority alerts, with accent styling.\n- **Alert Types:** Supports `alarm`, `warning`, `caution`, or no alert (idle). Icon and color adapt to the alert type.\n- **Alert Counter:** Optional badge displays the number of active alerts (except in flat mode).\n- **Global Counter:** `globalCounter` shows the per-severity `counts` and an optional `shelvedCount` before the bell and the total, as `obc-alert-button-item` draws them; `globalCounterType` picks filled badges or the severity shapes.\n- **Silence Button:** Optional secondary button to mute or silence alerts, shown when enabled and at sufficient width.\n- **Blinking Animation:** Can animate (blink) to draw attention to active alerts (except for caution type).\n- **Responsive Layout:** Automatically switches to flat mode below a configurable width, and hides the silence button below another configurable width.\n- **Large Size Option:** Increases button height and padding for touch-friendly or prominent use.\n\n## Usage Guidelines\n\nUse `<obc-alert-button>` to provide a persistent, easily accessible indicator of alert or notification status. Ideal for toolbars, headers, or notification panels where users need to be aware of active alerts and may need to silence them quickly.\n\n- Use the counter to show the number of active alerts when relevant.\n- Use the silence button to provide a quick mute action, but only when space allows.\n- Choose the variant (`flat`, `normal`, `enhanced`) based on available space and the importance of the alert.\n- The blinking feature should be reserved for urgent or high-priority alerts to avoid unnecessary distraction.\n\n**TODO(designer):** Confirm if there are recommended default behaviors for auto-blinking, and if there are any design constraints for when to use each variant.\n\n**TODO(designer):** The Figma Alert button has no flat Global counter, so below `flatMaxBreakpointPx` the button shows the flat bell without the counts.\n\n## Events\n\n- `click-alert` – Fired when the main alert button is clicked.\n- `click-silence` – Fired when the silence button is clicked.\n\n## Best Practices & Constraints\n\n- Only show the counter when there are active alerts and the button is not in flat mode.\n- The silence button is only visible if enabled, the width is above the minimum breakpoint, and the button is not flat.\n- Blinking should be used sparingly to avoid overwhelming the user.\n- Use the large variant for touch interfaces or when the button needs to stand out.\n\n## Example\n\n```html\n<obc-alert-button\n nAlerts=\"3\"\n alertType=\"alarm\"\n type=\"enhanced\"\n counter\n showSilenceButton\n blinking\n large\n flatMaxBreakpointPx=\"600\"\n silenceButtonMinBreakpointPx=\"600\"\n></obc-alert-button>\n```\n\nIn this example, the button shows an alarm icon, a counter badge with \"3\", is styled as enhanced, blinks to indicate urgency, and includes a silence button if the width allows.",
60292
60314
  "name": "ObcAlertButton",
60293
60315
  "members": [
60294
60316
  {
@@ -60371,6 +60393,20 @@
60371
60393
  "description": "Shows the per-severity counts and the shelved count before the bell and the total (the item's global counter); a flat button shows the plain bell.",
60372
60394
  "attribute": "globalCounter"
60373
60395
  },
60396
+ {
60397
+ "kind": "field",
60398
+ "name": "globalCounterType",
60399
+ "type": {
60400
+ "text": "ObcAlertCounterItemType"
60401
+ },
60402
+ "description": "How the global counter draws each count: `badges` (filled severity badges, default) or `alert-level` (the severity shape beside the count).\n\nAvailable when `globalCounter==true`.",
60403
+ "attribute": "globalCounterType",
60404
+ "availableWhen": "globalCounter==true",
60405
+ "availableWhenIf": {
60406
+ "arg": "globalCounter",
60407
+ "truthy": true
60408
+ }
60409
+ },
60374
60410
  {
60375
60411
  "kind": "field",
60376
60412
  "name": "counts",
@@ -60567,6 +60603,14 @@
60567
60603
  "description": "Shows the per-severity counts and the shelved count before the bell and the total (the item's global counter); a flat button shows the plain bell.",
60568
60604
  "fieldName": "globalCounter"
60569
60605
  },
60606
+ {
60607
+ "name": "globalCounterType",
60608
+ "type": {
60609
+ "text": "ObcAlertCounterItemType"
60610
+ },
60611
+ "description": "How the global counter draws each count: `badges` (filled severity badges, default) or `alert-level` (the severity shape beside the count).\n\nAvailable when `globalCounter==true`.",
60612
+ "fieldName": "globalCounterType"
60613
+ },
60570
60614
  {
60571
60615
  "name": "shelvedCount",
60572
60616
  "type": {
@@ -60629,6 +60673,14 @@
60629
60673
  "module": "src/components/alert-button/alert-button.ts"
60630
60674
  }
60631
60675
  },
60676
+ {
60677
+ "kind": "js",
60678
+ "name": "ObcAlertCounterItemType",
60679
+ "declaration": {
60680
+ "name": "ObcAlertCounterItemType",
60681
+ "module": "src/components/alert-button/alert-button.ts"
60682
+ }
60683
+ },
60632
60684
  {
60633
60685
  "kind": "js",
60634
60686
  "name": "ObcAlertButton",
@@ -60653,7 +60705,7 @@
60653
60705
  "declarations": [
60654
60706
  {
60655
60707
  "kind": "class",
60656
- "description": "`<obc-alert-counter-item>` – A row of alert counts, one badge per severity.\n\nRenders a large `obc-badge` for every severity with a count above zero, most\nsevere first, followed by an optional shelved count. Nothing renders when\nnothing is counted.\n\n---\n\n### Features\n- **Two types:** `badges` draws filled badges in the severity colour;\n `alert-level` draws flat badges with the severity glyph.\n- **Every severity:** `counts` takes the whole `AlertType` vocabulary,\n including the `level-*` family, ordered by `ALERT_SEVERITY_PRIORITY`.\n- **Shelved count:** `shelvedCount` adds a neutral badge at the end, with\n the shelf icon in `alert-level`.\n- **Accessible summary:** the row is announced as one image labelled with\n the counts, e.g. \"2 Alarm, 4 Warning, 6 Caution\".\n\n---\n\n### Usage Guidelines\n- Show how many alerts are outstanding per severity in a compact space;\n `obc-alert-button-item` nests the counter for its global counter.\n- Pass the counts as one object: `.counts=${{countAlarm: 2, countWarning: 4}}`.\n- The counter is display-only: it renders no button and fires no events.\n- For a framed per-subsystem summary with a label, see\n `obc-alert-subsystem-counter`.\n- **TODO(designer):** the Figma component also has an Unacked counter type;\n how its icons map to counts is not defined yet.\n\n---\n\n### Example\n\n```html\n<obc-alert-counter-item\n .counts=${{countAlarm: 2, countWarning: 4, countCaution: 6}}\n shelvedCount=\"9\"\n></obc-alert-counter-item>\n```",
60708
+ "description": "`<obc-alert-counter-item>` – A row of alert counts, one badge per severity.\n\nRenders a large `obc-badge` for every severity with a count above zero, most\nsevere first, followed by an optional shelved count. Nothing renders when\nnothing is counted.\n\n---\n\n### Features\n- **Two types:** `badges` draws filled badges in the severity colour;\n `alert-level` draws flat badges with the severity glyph.\n- **Every severity:** `counts` takes the whole `AlertType` vocabulary,\n including the `level-*` family, ordered by `ALERT_SEVERITY_PRIORITY`.\n- **Shelved count:** `shelvedCount` adds a neutral badge with the timer icon\n at the end, the icon the Figma counter swaps into its shelved badge.\n- **Accessible summary:** the row is announced as one image labelled with\n the counts, e.g. \"2 Alarm, 4 Warning, 6 Caution\".\n\n---\n\n### Usage Guidelines\n- Show how many alerts are outstanding per severity in a compact space;\n `obc-alert-button-item` nests the counter for its global counter.\n- Pass the counts as one object: `.counts=${{countAlarm: 2, countWarning: 4}}`.\n- The counter is display-only: it renders no button and fires no events.\n- For a framed per-subsystem summary with a label, see\n `obc-alert-subsystem-counter`.\n- **TODO(designer):** the Figma component also has an Unacked counter type;\n how its icons map to counts is not defined yet.\n- **TODO(designer):** the Figma component draws alarm, warning and caution;\n critical and diagnostic use the `level-critical` and `level-diagnostic`\n badges of `obc-badge` (#1389).\n\n---\n\n### Example\n\n```html\n<obc-alert-counter-item\n .counts=${{countAlarm: 2, countWarning: 4, countCaution: 6}}\n shelvedCount=\"9\"\n></obc-alert-counter-item>\n```",
60657
60709
  "name": "ObcAlertCounterItem",
60658
60710
  "members": [
60659
60711
  {
@@ -60681,7 +60733,7 @@
60681
60733
  "text": "number"
60682
60734
  },
60683
60735
  "default": "0",
60684
- "description": "Number of shelved alerts, shown as a neutral badge after the severities; hidden at zero.",
60736
+ "description": "Number of shelved alerts, shown as a neutral badge with the timer icon after the severities; hidden at zero.",
60685
60737
  "attribute": "shelvedCount"
60686
60738
  }
60687
60739
  ],
@@ -60700,7 +60752,7 @@
60700
60752
  "text": "number"
60701
60753
  },
60702
60754
  "default": "0",
60703
- "description": "Number of shelved alerts, shown as a neutral badge after the severities; hidden at zero.",
60755
+ "description": "Number of shelved alerts, shown as a neutral badge with the timer icon after the severities; hidden at zero.",
60704
60756
  "fieldName": "shelvedCount"
60705
60757
  }
60706
60758
  ],
@@ -1,12 +1,13 @@
1
1
  import { LitElement } from 'lit';
2
2
  import { ObcAlertButtonType } from '../alert-button-item/alert-button-item.js';
3
+ import { ObcAlertCounterItemType } from '../alert-counter-item/alert-counter-item.js';
3
4
  import { AlertType, FlashingSpeed, AlertCounts } from '../../types.js';
4
5
  import '../../icons/icon-notification.js';
5
6
  import '../../icons/icon-notification-advice.js';
6
7
  import '../../icons/icon-notification-advice-active.js';
7
8
  import '../../icons/icon-silence-iec.js';
8
9
  import '../alert-button-item/alert-button-item.js';
9
- export { ObcAlertButtonType };
10
+ export { ObcAlertButtonType, ObcAlertCounterItemType };
10
11
  /**
11
12
  * `<obc-alert-button>` – A compact, icon-based button for displaying alert or notification status and count.
12
13
  *
@@ -22,7 +23,7 @@ export { ObcAlertButtonType };
22
23
  * - **Enhanced:** Visually prominent button for high-priority alerts, with accent styling.
23
24
  * - **Alert Types:** Supports `alarm`, `warning`, `caution`, or no alert (idle). Icon and color adapt to the alert type.
24
25
  * - **Alert Counter:** Optional badge displays the number of active alerts (except in flat mode).
25
- * - **Global Counter:** `globalCounter` shows the per-severity `counts` and an optional `shelvedCount` before the bell and the total, as `obc-alert-button-item` draws them.
26
+ * - **Global Counter:** `globalCounter` shows the per-severity `counts` and an optional `shelvedCount` before the bell and the total, as `obc-alert-button-item` draws them; `globalCounterType` picks filled badges or the severity shapes.
26
27
  * - **Silence Button:** Optional secondary button to mute or silence alerts, shown when enabled and at sufficient width.
27
28
  * - **Blinking Animation:** Can animate (blink) to draw attention to active alerts (except for caution type).
28
29
  * - **Responsive Layout:** Automatically switches to flat mode below a configurable width, and hides the silence button below another configurable width.
@@ -80,6 +81,8 @@ export { ObcAlertButtonType };
80
81
  * @availableWhen silenceButtonDisabled showSilenceButton==true
81
82
  * @property counter - Shows the alert counter when there are active alerts and the button is not flat.
82
83
  * @property globalCounter - Shows the per-severity counts and the shelved count before the bell and the total (the item's global counter); a flat button shows the plain bell.
84
+ * @property globalCounterType - How the global counter draws each count: `badges` (filled severity badges, default) or `alert-level` (the severity shape beside the count).
85
+ * @availableWhen globalCounterType globalCounter==true
83
86
  * @property counts - Alert count per severity for the global counter badges (`countAlarm`, `countWarning`, `countCaution` and the `level-*` counts).
84
87
  * @availableWhen counts globalCounter==true
85
88
  * @property shelvedCount - Number of shelved alerts, shown after the global counter badges; hidden at zero.
@@ -116,6 +119,12 @@ export declare class ObcAlertButton extends LitElement {
116
119
  counter: boolean;
117
120
  /** Shows the per-severity counts and the shelved count before the bell and the total (the item's global counter); a flat button shows the plain bell. */
118
121
  globalCounter: boolean;
122
+ /**
123
+ * How the global counter draws each count: `badges` (filled severity badges, default) or `alert-level` (the severity shape beside the count).
124
+ *
125
+ * Available when `globalCounter==true`.
126
+ */
127
+ globalCounterType: ObcAlertCounterItemType;
119
128
  /**
120
129
  * Alert count per severity for the global counter badges (`countAlarm`, `countWarning`, `countCaution` and the `level-*` counts).
121
130
  *
@@ -1 +1 @@
1
- {"version":3,"file":"alert-button.d.ts","sourceRoot":"","sources":["../../../src/components/alert-button/alert-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAKzD,OAAO,kCAAkC,CAAC;AAC1C,OAAO,yCAAyC,CAAC;AACjD,OAAO,gDAAgD,CAAC;AACxD,OAAO,iCAAiC,CAAC;AACzC,OAAO,2CAA2C,CAAC;AACnD,OAAO,EAAC,kBAAkB,EAAC,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EAAC,SAAS,EAAE,aAAa,EAAE,KAAK,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAG1E,OAAO,EAAC,kBAAkB,EAAC,CAAC;AAE5B;;;;;;;;;;;;;;;;;;;;;;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CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyFG;AACH,qBAEa,cAAe,SAAQ,UAAU;IAClB,OAAO,SAAK;IACZ,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,qBAA6B;IAChC,KAAK,UAAS;IACd,iBAAiB,UAAS;IAC1B,qBAAqB,UAAS;IAC9B,OAAO,UAAS;IAChB,aAAa,UAAS;IACvB,iBAAiB,EAAE,uBAAuB,CACnC;IACW,MAAM,EAAE,WAAW,CAAM;IAC3C,YAAY,SAAK;IAChB,QAAQ,UAAS;IAClB,aAAa,EAAE,aAAa,CAC9B;IACE,mBAAmB,SAAK;IACxB,4BAA4B,SAAK;IAElD,OAAO,CAAC,KAAK,CAAqB;IAE3C,OAAO,CAAC,cAAc,CAEpB;IAEO,iBAAiB;IAKjB,oBAAoB;IAK7B,OAAO,KAAK,UAAU,GAQrB;IAED,OAAO,KAAK,wBAAwB,GAMnC;IAEQ,MAAM;IAgDf,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,kBAAkB,EAAE,cAAc,CAAC;KACpC;CACF"}
@@ -6,6 +6,7 @@ import "../../icons/icon-notification-advice.js";
6
6
  import "../../icons/icon-notification.js";
7
7
  import "../../icons/icon-silence-iec.js";
8
8
  import alert_button_default from "./alert-button.css.js";
9
+ import { ObcAlertCounterItemType } from "../alert-counter-item/alert-counter-item.js";
9
10
  import { ObcAlertButtonType } from "../alert-button-item/alert-button-item.js";
10
11
  import { localized, msg } from "@lit/localize";
11
12
  import { LitElement, html, nothing, unsafeCSS } from "lit";
@@ -22,6 +23,7 @@ var ObcAlertButton = class ObcAlertButton extends LitElement {
22
23
  this.silenceButtonDisabled = false;
23
24
  this.counter = false;
24
25
  this.globalCounter = false;
26
+ this.globalCounterType = ObcAlertCounterItemType.Badges;
25
27
  this.counts = {};
26
28
  this.shelvedCount = 0;
27
29
  this.blinking = false;
@@ -65,6 +67,7 @@ var ObcAlertButton = class ObcAlertButton extends LitElement {
65
67
  .nAlerts=${this.nAlerts}
66
68
  .counter=${this.counter}
67
69
  .globalCounter=${this.globalCounter && this.activeType !== ObcAlertButtonType.Flat}
70
+ .globalCounterType=${this.globalCounterType}
68
71
  .counts=${this.counts}
69
72
  .shelvedCount=${this.shelvedCount}
70
73
  .blinking=${this.blinking}
@@ -100,6 +103,7 @@ __decorate([property({ type: Boolean })], ObcAlertButton.prototype, "showSilence
100
103
  __decorate([property({ type: Boolean })], ObcAlertButton.prototype, "silenceButtonDisabled", void 0);
101
104
  __decorate([property({ type: Boolean })], ObcAlertButton.prototype, "counter", void 0);
102
105
  __decorate([property({ type: Boolean })], ObcAlertButton.prototype, "globalCounter", void 0);
106
+ __decorate([property({ type: String })], ObcAlertButton.prototype, "globalCounterType", void 0);
103
107
  __decorate([property({
104
108
  type: Object,
105
109
  attribute: false
@@ -112,6 +116,6 @@ __decorate([property({ type: Number })], ObcAlertButton.prototype, "silenceButto
112
116
  __decorate([state()], ObcAlertButton.prototype, "width", void 0);
113
117
  ObcAlertButton = __decorate([customElement("obc-alert-button"), localized()], ObcAlertButton);
114
118
  //#endregion
115
- export { ObcAlertButton, ObcAlertButtonType };
119
+ export { ObcAlertButton, ObcAlertButtonType, ObcAlertCounterItemType };
116
120
 
117
121
  //# sourceMappingURL=alert-button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert-button.js","names":[],"sources":["../../../src/components/alert-button/alert-button.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {localized, msg} from '@lit/localize';\nimport compentStyle from './alert-button.css?inline';\nimport '../../icons/icon-notification.js';\nimport '../../icons/icon-notification-advice.js';\nimport '../../icons/icon-notification-advice-active.js';\nimport '../../icons/icon-silence-iec.js';\nimport '../alert-button-item/alert-button-item.js';\nimport {ObcAlertButtonType} from '../alert-button-item/alert-button-item.js';\nimport {AlertType, FlashingSpeed, type AlertCounts} from '../../types.js';\nimport {customElement} from '../../decorator.js';\n\nexport {ObcAlertButtonType};\n\n/**\n * `<obc-alert-button>` – A compact, icon-based button for displaying alert or notification status and count.\n *\n * This component provides a visual indicator for active alerts or notifications, supporting different alert types (such as alarm, warning, or caution) and an optional counter badge. It can also include a secondary \"silence\" action button for muting alerts, adapting its layout responsively for different screen widths.\n *\n * Appears in toolbars or notification areas to give users a quick overview of alert status and provide direct access to alert-related actions. The bell itself is an `obc-alert-button-item`; use the item directly where no silence button or breakpoints are needed, or for its global counter.\n *\n * ## Features\n *\n * - **Variants:**\n * - **Flat:** Minimal, icon-only button for space-constrained layouts.\n * - **Normal:** Standard button with icon and optional alert counter.\n * - **Enhanced:** Visually prominent button for high-priority alerts, with accent styling.\n * - **Alert Types:** Supports `alarm`, `warning`, `caution`, or no alert (idle). Icon and color adapt to the alert type.\n * - **Alert Counter:** Optional badge displays the number of active alerts (except in flat mode).\n * - **Global Counter:** `globalCounter` shows the per-severity `counts` and an optional `shelvedCount` before the bell and the total, as `obc-alert-button-item` draws them.\n * - **Silence Button:** Optional secondary button to mute or silence alerts, shown when enabled and at sufficient width.\n * - **Blinking Animation:** Can animate (blink) to draw attention to active alerts (except for caution type).\n * - **Responsive Layout:** Automatically switches to flat mode below a configurable width, and hides the silence button below another configurable width.\n * - **Large Size Option:** Increases button height and padding for touch-friendly or prominent use.\n *\n * ## Usage Guidelines\n *\n * Use `<obc-alert-button>` to provide a persistent, easily accessible indicator of alert or notification status. Ideal for toolbars, headers, or notification panels where users need to be aware of active alerts and may need to silence them quickly.\n *\n * - Use the counter to show the number of active alerts when relevant.\n * - Use the silence button to provide a quick mute action, but only when space allows.\n * - Choose the variant (`flat`, `normal`, `enhanced`) based on available space and the importance of the alert.\n * - The blinking feature should be reserved for urgent or high-priority alerts to avoid unnecessary distraction.\n *\n * **TODO(designer):** Confirm if there are recommended default behaviors for auto-blinking, and if there are any design constraints for when to use each variant.\n *\n * **TODO(designer):** The Figma Alert button has no flat Global counter, so below `flatMaxBreakpointPx` the button shows the flat bell without the counts.\n *\n * ## Events\n *\n * - `click-alert` – Fired when the main alert button is clicked.\n * - `click-silence` – Fired when the silence button is clicked.\n *\n * ## Best Practices & Constraints\n *\n * - Only show the counter when there are active alerts and the button is not in flat mode.\n * - The silence button is only visible if enabled, the width is above the minimum breakpoint, and the button is not flat.\n * - Blinking should be used sparingly to avoid overwhelming the user.\n * - Use the large variant for touch interfaces or when the button needs to stand out.\n *\n * ## Example\n *\n * ```html\n * <obc-alert-button\n * nAlerts=\"3\"\n * alertType=\"alarm\"\n * type=\"enhanced\"\n * counter\n * showSilenceButton\n * blinking\n * large\n * flatMaxBreakpointPx=\"600\"\n * silenceButtonMinBreakpointPx=\"600\"\n * ></obc-alert-button>\n * ```\n *\n * In this example, the button shows an alarm icon, a counter badge with \"3\", is styled as enhanced, blinks to indicate urgency, and includes a silence button if the width allows.\n *\n * @property nAlerts - Number of active alerts shown in the counter; 0 shows the idle state.\n * @property alertType - Alert type that selects the icon and colours: `alarm`, `warning`, `caution`, a `level-*` severity, or unset for the idle state.\n * @property type - Visual variant: `flat` (icon only), `normal` (default, icon and optional counter) or `enhanced` (emphasized for high-priority alerts).\n * @property large - Increases the button height and padding for touch-friendly or prominent use.\n * @property showSilenceButton - Shows the silence button when the width is at least `silenceButtonMinBreakpointPx` and the button is not flat.\n * @property silenceButtonDisabled - Disables the silence button when true.\n * @availableWhen silenceButtonDisabled showSilenceButton==true\n * @property counter - Shows the alert counter when there are active alerts and the button is not flat.\n * @property globalCounter - Shows the per-severity counts and the shelved count before the bell and the total (the item's global counter); a flat button shows the plain bell.\n * @property counts - Alert count per severity for the global counter badges (`countAlarm`, `countWarning`, `countCaution` and the `level-*` counts).\n * @availableWhen counts globalCounter==true\n * @property shelvedCount - Number of shelved alerts, shown after the global counter badges; hidden at zero.\n * @availableWhen shelvedCount globalCounter==true\n * @property blinking - Flashes the bell for active alerts of a flashing alert type (never for caution).\n * @property flashingSpeed - Flash tempo while `blinking` is on: `default` resolves from `alertType`, `fast`, `slow`, `very-slow` force a tempo, `fixed` never flashes.\n * @availableWhen flashingSpeed blinking==true\n * @property flatMaxBreakpointPx - Window width in px below which a `normal` or `enhanced` button switches to flat mode.\n * @availableWhen flatMaxBreakpointPx type!=flat\n * @property silenceButtonMinBreakpointPx - Minimum window width in px for showing the silence button.\n * @availableWhen silenceButtonMinBreakpointPx showSilenceButton==true\n * @fires {CustomEvent<void>} click-alert - Fired when the main alert button is clicked.\n * @fires {CustomEvent<void>} click-silence - Fired when the silence button is clicked.\n * @stable\n */\n@customElement('obc-alert-button')\n@localized()\nexport class ObcAlertButton extends LitElement {\n @property({type: Number}) nAlerts = 0;\n @property({type: String}) alertType?: AlertType;\n @property({type: String}) type = ObcAlertButtonType.Normal;\n @property({type: Boolean}) large = false;\n @property({type: Boolean}) showSilenceButton = false;\n @property({type: Boolean}) silenceButtonDisabled = false;\n @property({type: Boolean}) counter = false;\n @property({type: Boolean}) globalCounter = false;\n @property({type: Object, attribute: false}) counts: AlertCounts = {};\n @property({type: Number}) shelvedCount = 0;\n @property({type: Boolean}) blinking = false;\n @property({type: String}) flashingSpeed: FlashingSpeed =\n FlashingSpeed.Default;\n @property({type: Number}) flatMaxBreakpointPx = 0;\n @property({type: Number}) silenceButtonMinBreakpointPx = 0;\n\n @state() private width = window.innerWidth;\n\n private resizeListener = () => {\n this.width = window.innerWidth;\n };\n\n override connectedCallback() {\n super.connectedCallback();\n window.addEventListener('resize', this.resizeListener);\n }\n\n override disconnectedCallback() {\n window.removeEventListener('resize', this.resizeListener);\n super.disconnectedCallback();\n }\n\n private get activeType(): ObcAlertButtonType {\n if (this.type === ObcAlertButtonType.Flat) {\n return ObcAlertButtonType.Flat;\n }\n if (this.width < this.flatMaxBreakpointPx) {\n return ObcAlertButtonType.Flat;\n }\n return this.type;\n }\n\n private get showSilenceButtonDynamic(): boolean {\n return (\n this.showSilenceButton &&\n this.width >= this.silenceButtonMinBreakpointPx &&\n this.activeType !== ObcAlertButtonType.Flat\n );\n }\n\n override render() {\n const showSilence = this.showSilenceButtonDynamic;\n return html`\n <div\n class=${classMap({\n wrapper: true,\n [`type-${this.activeType}`]: true,\n large: this.large,\n })}\n >\n <obc-alert-button-item\n .type=${this.activeType}\n .alertType=${this.alertType}\n .nAlerts=${this.nAlerts}\n .counter=${this.counter}\n .globalCounter=${\n this.globalCounter && this.activeType !== ObcAlertButtonType.Flat\n }\n .counts=${this.counts}\n .shelvedCount=${this.shelvedCount}\n .blinking=${this.blinking}\n .flashingSpeed=${this.flashingSpeed}\n .fillHeight=${this.large}\n ?data-group-item-not-last=${showSilence}\n @click=${() => this.dispatchEvent(new CustomEvent('click-alert'))}\n ></obc-alert-button-item>\n ${\n showSilence\n ? html`\n <button\n class=\"silence-button\"\n aria-label=${msg('Silence')}\n @click=${() =>\n this.dispatchEvent(new CustomEvent('click-silence'))}\n ?disabled=${this.silenceButtonDisabled}\n >\n <div class=\"visible-wrapper\">\n <obi-silence-iec class=\"icon\"></obi-silence-iec>\n </div>\n </button>\n `\n : nothing\n }\n </div>\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-button': ObcAlertButton;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AA0GO,IAAM,iBAAN,MAAM,uBAAuB,WAAW;;;EACT,KAAA,UAAA;EAEH,KAAA,OAAA,mBAAmB;EACjB,KAAA,QAAA;EACY,KAAA,oBAAA;EACI,KAAA,wBAAA;EACd,KAAA,UAAA;EACM,KAAA,gBAAA;EACuB,KAAA,SAAA,CAAC;EAC1B,KAAA,eAAA;EACH,KAAA,WAAA;EAEpC,KAAA,gBAAA,cAAc;EACgC,KAAA,sBAAA;EACS,KAAA,+BAAA;EAEhC,KAAA,QAAA,OAAO;EAED,K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B,GAChC,UAAU,CAAA,GAAA,cAAA"}
1
+ {"version":3,"file":"alert-button.js","names":[],"sources":["../../../src/components/alert-button/alert-button.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {localized, msg} from '@lit/localize';\nimport compentStyle from './alert-button.css?inline';\nimport '../../icons/icon-notification.js';\nimport '../../icons/icon-notification-advice.js';\nimport '../../icons/icon-notification-advice-active.js';\nimport '../../icons/icon-silence-iec.js';\nimport '../alert-button-item/alert-button-item.js';\nimport {ObcAlertButtonType} from '../alert-button-item/alert-button-item.js';\nimport {ObcAlertCounterItemType} from '../alert-counter-item/alert-counter-item.js';\nimport {AlertType, FlashingSpeed, type AlertCounts} from '../../types.js';\nimport {customElement} from '../../decorator.js';\n\nexport {ObcAlertButtonType, ObcAlertCounterItemType};\n\n/**\n * `<obc-alert-button>` – A compact, icon-based button for displaying alert or notification status and count.\n *\n * This component provides a visual indicator for active alerts or notifications, supporting different alert types (such as alarm, warning, or caution) and an optional counter badge. It can also include a secondary \"silence\" action button for muting alerts, adapting its layout responsively for different screen widths.\n *\n * Appears in toolbars or notification areas to give users a quick overview of alert status and provide direct access to alert-related actions. The bell itself is an `obc-alert-button-item`; use the item directly where no silence button or breakpoints are needed, or for its global counter.\n *\n * ## Features\n *\n * - **Variants:**\n * - **Flat:** Minimal, icon-only button for space-constrained layouts.\n * - **Normal:** Standard button with icon and optional alert counter.\n * - **Enhanced:** Visually prominent button for high-priority alerts, with accent styling.\n * - **Alert Types:** Supports `alarm`, `warning`, `caution`, or no alert (idle). Icon and color adapt to the alert type.\n * - **Alert Counter:** Optional badge displays the number of active alerts (except in flat mode).\n * - **Global Counter:** `globalCounter` shows the per-severity `counts` and an optional `shelvedCount` before the bell and the total, as `obc-alert-button-item` draws them; `globalCounterType` picks filled badges or the severity shapes.\n * - **Silence Button:** Optional secondary button to mute or silence alerts, shown when enabled and at sufficient width.\n * - **Blinking Animation:** Can animate (blink) to draw attention to active alerts (except for caution type).\n * - **Responsive Layout:** Automatically switches to flat mode below a configurable width, and hides the silence button below another configurable width.\n * - **Large Size Option:** Increases button height and padding for touch-friendly or prominent use.\n *\n * ## Usage Guidelines\n *\n * Use `<obc-alert-button>` to provide a persistent, easily accessible indicator of alert or notification status. Ideal for toolbars, headers, or notification panels where users need to be aware of active alerts and may need to silence them quickly.\n *\n * - Use the counter to show the number of active alerts when relevant.\n * - Use the silence button to provide a quick mute action, but only when space allows.\n * - Choose the variant (`flat`, `normal`, `enhanced`) based on available space and the importance of the alert.\n * - The blinking feature should be reserved for urgent or high-priority alerts to avoid unnecessary distraction.\n *\n * **TODO(designer):** Confirm if there are recommended default behaviors for auto-blinking, and if there are any design constraints for when to use each variant.\n *\n * **TODO(designer):** The Figma Alert button has no flat Global counter, so below `flatMaxBreakpointPx` the button shows the flat bell without the counts.\n *\n * ## Events\n *\n * - `click-alert` – Fired when the main alert button is clicked.\n * - `click-silence` – Fired when the silence button is clicked.\n *\n * ## Best Practices & Constraints\n *\n * - Only show the counter when there are active alerts and the button is not in flat mode.\n * - The silence button is only visible if enabled, the width is above the minimum breakpoint, and the button is not flat.\n * - Blinking should be used sparingly to avoid overwhelming the user.\n * - Use the large variant for touch interfaces or when the button needs to stand out.\n *\n * ## Example\n *\n * ```html\n * <obc-alert-button\n * nAlerts=\"3\"\n * alertType=\"alarm\"\n * type=\"enhanced\"\n * counter\n * showSilenceButton\n * blinking\n * large\n * flatMaxBreakpointPx=\"600\"\n * silenceButtonMinBreakpointPx=\"600\"\n * ></obc-alert-button>\n * ```\n *\n * In this example, the button shows an alarm icon, a counter badge with \"3\", is styled as enhanced, blinks to indicate urgency, and includes a silence button if the width allows.\n *\n * @property nAlerts - Number of active alerts shown in the counter; 0 shows the idle state.\n * @property alertType - Alert type that selects the icon and colours: `alarm`, `warning`, `caution`, a `level-*` severity, or unset for the idle state.\n * @property type - Visual variant: `flat` (icon only), `normal` (default, icon and optional counter) or `enhanced` (emphasized for high-priority alerts).\n * @property large - Increases the button height and padding for touch-friendly or prominent use.\n * @property showSilenceButton - Shows the silence button when the width is at least `silenceButtonMinBreakpointPx` and the button is not flat.\n * @property silenceButtonDisabled - Disables the silence button when true.\n * @availableWhen silenceButtonDisabled showSilenceButton==true\n * @property counter - Shows the alert counter when there are active alerts and the button is not flat.\n * @property globalCounter - Shows the per-severity counts and the shelved count before the bell and the total (the item's global counter); a flat button shows the plain bell.\n * @property globalCounterType - How the global counter draws each count: `badges` (filled severity badges, default) or `alert-level` (the severity shape beside the count).\n * @availableWhen globalCounterType globalCounter==true\n * @property counts - Alert count per severity for the global counter badges (`countAlarm`, `countWarning`, `countCaution` and the `level-*` counts).\n * @availableWhen counts globalCounter==true\n * @property shelvedCount - Number of shelved alerts, shown after the global counter badges; hidden at zero.\n * @availableWhen shelvedCount globalCounter==true\n * @property blinking - Flashes the bell for active alerts of a flashing alert type (never for caution).\n * @property flashingSpeed - Flash tempo while `blinking` is on: `default` resolves from `alertType`, `fast`, `slow`, `very-slow` force a tempo, `fixed` never flashes.\n * @availableWhen flashingSpeed blinking==true\n * @property flatMaxBreakpointPx - Window width in px below which a `normal` or `enhanced` button switches to flat mode.\n * @availableWhen flatMaxBreakpointPx type!=flat\n * @property silenceButtonMinBreakpointPx - Minimum window width in px for showing the silence button.\n * @availableWhen silenceButtonMinBreakpointPx showSilenceButton==true\n * @fires {CustomEvent<void>} click-alert - Fired when the main alert button is clicked.\n * @fires {CustomEvent<void>} click-silence - Fired when the silence button is clicked.\n * @stable\n */\n@customElement('obc-alert-button')\n@localized()\nexport class ObcAlertButton extends LitElement {\n @property({type: Number}) nAlerts = 0;\n @property({type: String}) alertType?: AlertType;\n @property({type: String}) type = ObcAlertButtonType.Normal;\n @property({type: Boolean}) large = false;\n @property({type: Boolean}) showSilenceButton = false;\n @property({type: Boolean}) silenceButtonDisabled = false;\n @property({type: Boolean}) counter = false;\n @property({type: Boolean}) globalCounter = false;\n @property({type: String}) globalCounterType: ObcAlertCounterItemType =\n ObcAlertCounterItemType.Badges;\n @property({type: Object, attribute: false}) counts: AlertCounts = {};\n @property({type: Number}) shelvedCount = 0;\n @property({type: Boolean}) blinking = false;\n @property({type: String}) flashingSpeed: FlashingSpeed =\n FlashingSpeed.Default;\n @property({type: Number}) flatMaxBreakpointPx = 0;\n @property({type: Number}) silenceButtonMinBreakpointPx = 0;\n\n @state() private width = window.innerWidth;\n\n private resizeListener = () => {\n this.width = window.innerWidth;\n };\n\n override connectedCallback() {\n super.connectedCallback();\n window.addEventListener('resize', this.resizeListener);\n }\n\n override disconnectedCallback() {\n window.removeEventListener('resize', this.resizeListener);\n super.disconnectedCallback();\n }\n\n private get activeType(): ObcAlertButtonType {\n if (this.type === ObcAlertButtonType.Flat) {\n return ObcAlertButtonType.Flat;\n }\n if (this.width < this.flatMaxBreakpointPx) {\n return ObcAlertButtonType.Flat;\n }\n return this.type;\n }\n\n private get showSilenceButtonDynamic(): boolean {\n return (\n this.showSilenceButton &&\n this.width >= this.silenceButtonMinBreakpointPx &&\n this.activeType !== ObcAlertButtonType.Flat\n );\n }\n\n override render() {\n const showSilence = this.showSilenceButtonDynamic;\n return html`\n <div\n class=${classMap({\n wrapper: true,\n [`type-${this.activeType}`]: true,\n large: this.large,\n })}\n >\n <obc-alert-button-item\n .type=${this.activeType}\n .alertType=${this.alertType}\n .nAlerts=${this.nAlerts}\n .counter=${this.counter}\n .globalCounter=${\n this.globalCounter && this.activeType !== ObcAlertButtonType.Flat\n }\n .globalCounterType=${this.globalCounterType}\n .counts=${this.counts}\n .shelvedCount=${this.shelvedCount}\n .blinking=${this.blinking}\n .flashingSpeed=${this.flashingSpeed}\n .fillHeight=${this.large}\n ?data-group-item-not-last=${showSilence}\n @click=${() => this.dispatchEvent(new CustomEvent('click-alert'))}\n ></obc-alert-button-item>\n ${\n showSilence\n ? html`\n <button\n class=\"silence-button\"\n aria-label=${msg('Silence')}\n @click=${() =>\n this.dispatchEvent(new CustomEvent('click-silence'))}\n ?disabled=${this.silenceButtonDisabled}\n >\n <div class=\"visible-wrapper\">\n <obi-silence-iec class=\"icon\"></obi-silence-iec>\n </div>\n </button>\n `\n : nothing\n }\n </div>\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-button': ObcAlertButton;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AA6GO,IAAM,iBAAN,MAAM,uBAAuB,WAAW;;;EACT,KAAA,UAAA;EAEH,KAAA,OAAA,mBAAmB;EACjB,KAAA,QAAA;EACY,KAAA,oBAAA;EACI,KAAA,wBAAA;EACd,KAAA,UAAA;EACM,KAAA,gBAAA;EAEzC,KAAA,oBAAA,wBAAwB;EACwC,KAAA,SAAA,CAAC;EAC1B,KAAA,eAAA;EACH,KAAA,WAAA;EAEpC,KAAA,gBAAA,cAAc;EACgC,KAAA,sBAAA;EACS,KAAA,+BAAA;EAEhC,KAAA,QAAA,OAAO;EAED,KAAA,uBAAA;GAC7B,KAAK,QAAQ,OAAO;EACtB;;CAEA,oBAA6B;EAC3B,MAAM,kBAAkB;EACxB,OAAO,iBAAiB,UAAU,KAAK,cAAc;CACvD;CAEA,uBAAgC;EAC9B,OAAO,oBAAoB,UAAU,KAAK,cAAc;EACxD,MAAM,qBAAqB;CAC7B;CAEA,IAAY,aAAiC;EAC3C,IAAI,KAAK,SAAS,mBAAmB,MACnC,OAAO,mBAAmB;EAE5B,IAAI,KAAK,QAAQ,KAAK,qBACpB,OAAO,mBAAmB;EAE5B,OAAO,KAAK;CACd;CAEA,IAAY,2BAAoC;EAC9C,OACE,KAAK,qBACL,KAAK,SAAS,KAAK,gCACnB,KAAK,eAAe,mBAAmB;CAE3C;CAEA,SAAkB;EAChB,MAAM,cAAc,KAAK;EACzB,OAAO,IAAI;;gBAEC,SAAS;GACf,SAAS;IACR,QAAQ,KAAK,eAAe;GAC7B,OAAO,KAAK;EACd,CAAC,EAAE;;;kBA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,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,qBAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS;CAAC,MAAM;CAAQ,WAAW;AAAK,CAAC,CAAA,GAAA,eAAA,WAAA,UAAA,KAAA,CAAA;AACzC,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,gBAAA,KAAA,CAAA;AACvB,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,eAAA,WAAA,YAAA,KAAA,CAAA;AACxB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,iBAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,uBAAA,KAAA,CAAA;AACvB,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,eAAA,WAAA,gCAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,MAAM,CAAA,GAAA,eAAA,WAAA,SAAA,KAAA,CAAA;AArBR,iBAAA,WAAA,CAAA,cAAc,kBAAkB,GAChC,UAAU,CAAA,GAAA,cAAA"}
@@ -1,4 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
+ import { ObcAlertCounterItemType } from '../alert-counter-item/alert-counter-item.js';
2
3
  import { AlertType, FlashingSpeed, AlertCounts, ResolvedFlashingSpeed } from '../../types.js';
3
4
  import { FlashingController } from '../../palettes/flashing-controller.js';
4
5
  import '../../icons/icon-alerts.js';
@@ -38,7 +39,8 @@ export declare enum ObcAlertButtonType {
38
39
  * `nAlerts` of 0 shows the idle bell.
39
40
  * - **Counter:** `counter` shows `nAlerts` next to the bell, except in `flat`.
40
41
  * - **Global counter:** `globalCounter` shows the per-severity `counts` as
41
- * badges, then the bell and `nAlerts`, always in the normal style.
42
+ * badges, then the bell and `nAlerts`, always in the normal style;
43
+ * `globalCounterType` picks filled badges or the severity shapes.
42
44
  * - **Flashing:** `blinking` flashes the bell at the tempo `flashingSpeed`
43
45
  * resolves (#1224).
44
46
  * - **Fill height:** `fillHeight` stretches the visible button to the host
@@ -82,6 +84,8 @@ export declare enum ObcAlertButtonType {
82
84
  * @property counter - Shows `nAlerts` next to the bell (not in `flat`).
83
85
  * @availableWhen counter globalCounter==false
84
86
  * @property globalCounter - Shows the per-severity counts, the bell and the total instead of a single alert status.
87
+ * @property globalCounterType - How the global counter draws each count: `badges` (filled severity badges, default) or `alert-level` (the severity shape beside the count).
88
+ * @availableWhen globalCounterType globalCounter==true
85
89
  * @property counts - Alert count per severity for the global counter badges.
86
90
  * @availableWhen counts globalCounter==true
87
91
  * @property shelvedCount - Number of shelved alerts, shown after the global counter badges.
@@ -118,6 +122,12 @@ export declare class ObcAlertButtonItem extends LitElement {
118
122
  counter: boolean;
119
123
  /** Shows the per-severity counts, the bell and the total instead of a single alert status. */
120
124
  globalCounter: boolean;
125
+ /**
126
+ * How the global counter draws each count: `badges` (filled severity badges, default) or `alert-level` (the severity shape beside the count).
127
+ *
128
+ * Available when `globalCounter==true`.
129
+ */
130
+ globalCounterType: ObcAlertCounterItemType;
121
131
  /**
122
132
  * Alert count per severity for the global counter badges.
123
133
  *
@@ -1 +1 @@
1
- {"version":3,"file":"alert-button-item.d.ts","sourceRoot":"","sources":["../../../src/components/alert-button-item/alert-button-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAMzD,OAAO,4BAA4B,CAAC;AACpC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,0CAA0C,CAAC;AAClD,OAAO,4CAA4C,CAAC;AACpD,OAAO,4CAA4C,CAAC;AACpD,OAAO,mDAAmD,CAAC;AAC3D,OAAO,qDAAqD,CAAC;AAC7D,OAAO,6CAA6C,CAAC;AAErD,OAAO,EACL,SAAS,EACT,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC3B,MAAM,gBAAgB,CAAC;AAUxB,OAAO,EAAC,kBAAkB,EAAC,MAAM,uCAAuC,CAAC;AAEzE;;;;;;GAMG;AACH,oBAAY,kBAAkB;IAC5B,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,qBAEa,kBAAmB,SAAQ,UAAU;IACtB,IAAI,EAAE,kBAAkB,CACtB;IACF,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,SAAK;IACX,OAAO,UAAS;IAChB,aAAa,UAAS;IACL,MAAM,EAAE,WAAW,CAAM;IAC3C,YAAY,SAAK;IAChB,QAAQ,UAAS;IAClB,aAAa,EAAE,aAAa,CAC9B;IACG,UAAU,UAAS;IAIrC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAQ;IAEzC,SAAS,CAAC,QAAQ,CAAC,QAAQ,qBAGzB;IAEF,IAAI,qBAAqB,IAAI,qBAAqB,CAcjD;IAED,OAAO,KAAK,cAAc,GAiBzB;IAED,OAAO,CAAC,iBAAiB;IAiCzB,4EAA4E;IAC5E,OAAO,CAAC,UAAU;IAelB,OAAO,CAAC,WAAW;IAInB,OAAO,CAAC,YAAY;IAWX,MAAM;IA8Cf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,uBAAuB,EAAE,kBAAkB,CAAC;KAC7C;CACF"}
1
+ {"version":3,"file":"alert-button-item.d.ts","sourceRoot":"","sources":["../../../src/components/alert-button-item/alert-button-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAA2B,MAAM,KAAK,CAAC;AAMzD,OAAO,4BAA4B,CAAC;AACpC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,0CAA0C,CAAC;AAClD,OAAO,4CAA4C,CAAC;AACpD,OA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C;CACF"}
@@ -37,6 +37,7 @@ var ObcAlertButtonItem = class ObcAlertButtonItem extends LitElement {
37
37
  this.nAlerts = 0;
38
38
  this.counter = false;
39
39
  this.globalCounter = false;
40
+ this.globalCounterType = ObcAlertCounterItemType.Badges;
40
41
  this.counts = {};
41
42
  this.shelvedCount = 0;
42
43
  this.blinking = false;
@@ -96,7 +97,7 @@ var ObcAlertButtonItem = class ObcAlertButtonItem extends LitElement {
96
97
  renderCounts() {
97
98
  if (rankAlertCounts(this.counts).length === 0 && this.shelvedCount <= 0) return nothing;
98
99
  return html`<obc-alert-counter-item
99
- .type=${ObcAlertCounterItemType.Badges}
100
+ .type=${this.globalCounterType}
100
101
  .counts=${this.counts}
101
102
  .shelvedCount=${this.shelvedCount}
102
103
  ></obc-alert-counter-item>`;
@@ -146,6 +147,7 @@ __decorate([property({ type: String })], ObcAlertButtonItem.prototype, "alertTyp
146
147
  __decorate([property({ type: Number })], ObcAlertButtonItem.prototype, "nAlerts", void 0);
147
148
  __decorate([property({ type: Boolean })], ObcAlertButtonItem.prototype, "counter", void 0);
148
149
  __decorate([property({ type: Boolean })], ObcAlertButtonItem.prototype, "globalCounter", void 0);
150
+ __decorate([property({ type: String })], ObcAlertButtonItem.prototype, "globalCounterType", void 0);
149
151
  __decorate([property({
150
152
  type: Object,
151
153
  attribute: false
@@ -1 +1 @@
1
- {"version":3,"file":"alert-button-item.js","names":[],"sources":["../../../src/components/alert-button-item/alert-button-item.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {localized, msg} from '@lit/localize';\nimport componentStyle from './alert-button-item.css?inline';\nimport {customElement} from '../../decorator.js';\nimport '../../icons/icon-alerts.js';\nimport '../../icons/icon-alerts-active.js';\nimport '../../icons/icon-alerts-alarm-twotone.js';\nimport '../../icons/icon-alerts-warning-twotone.js';\nimport '../../icons/icon-alerts-caution-twotone.js';\nimport '../../manual-icon/icon-alerts-critical-twotone.js';\nimport '../../manual-icon/icon-alerts-diagnostic-twotone.js';\nimport '../alert-counter-item/alert-counter-item.js';\nimport {ObcAlertCounterItemType} from '../alert-counter-item/alert-counter-item.js';\nimport {\n AlertType,\n FlashingSpeed,\n type AlertCounts,\n type ResolvedFlashingSpeed,\n} from '../../types.js';\nimport {\n AlertFlashPhase,\n AlertTwotoneComponent,\n alertCountsLabel,\n alertTypeLabel,\n getAlertTwotoneComponent,\n rankAlertCounts,\n resolveFlashingSpeed,\n} from '../../alert-severity.js';\nimport {FlashingController} from '../../palettes/flashing-controller.js';\n\n/**\n * `ObcAlertButtonType` – Enum for alert button visual and behavioral variants.\n *\n * - `flat`: Minimal, icon-only button for compact spaces.\n * - `normal`: Standard button with icon and optional counter.\n * - `enhanced`: Emphasized button with additional styling for high-priority alerts.\n */\nexport enum ObcAlertButtonType {\n Flat = 'flat',\n Normal = 'normal',\n Enhanced = 'enhanced',\n}\n\n/**\n * `<obc-alert-button-item>` – The bell button that shows the alert state and count.\n *\n * Shows the alert status as a bell in the style of the given alert type, with\n * an optional counter, or as a global counter: one badge per severity, then\n * the bell and the total. `obc-alert-button` renders the item next to its\n * silence button; use the item on its own where no silence button is needed.\n *\n * ---\n *\n * ### Features\n * - **Variants (`type`):** `flat` (icon only), `normal` (bordered, icon and\n * counter) and `enhanced` (filled in the severity colour).\n * - **Alert types:** `alarm`, `warning`, `caution` and the `level-*` family;\n * `nAlerts` of 0 shows the idle bell.\n * - **Counter:** `counter` shows `nAlerts` next to the bell, except in `flat`.\n * - **Global counter:** `globalCounter` shows the per-severity `counts` as\n * badges, then the bell and `nAlerts`, always in the normal style.\n * - **Flashing:** `blinking` flashes the bell at the tempo `flashingSpeed`\n * resolves (#1224).\n * - **Fill height:** `fillHeight` stretches the visible button to the host\n * height, as the tall `obc-alert-button` does.\n *\n * ---\n *\n * ### Usage Guidelines\n * - Keep `nAlerts` and `counts` consistent; the item shows both as given.\n * - The generated label reads e.g. \"Alerts, 12, 2 Alarm, 4 Warning,\n * 6 Caution\"; an `aria-label` on the host replaces it. A visually hidden\n * polite live region repeats that name, so a change of counts is announced\n * without the button holding focus; the name attribute alone would change\n * silently.\n * - A native button, so Enter and Space activate it (APG button pattern).\n * - A parent that joins another button to the item's end sets the\n * `data-group-item-not-last` attribute on the host.\n * - **TODO(designer):** the Figma file draws the flat item's hover, active and\n * focused variants at 20 % opacity; the item uses the standard flat states.\n * - **TODO(designer):** the Figma file defines no flashing for the global\n * counter, so it never flashes.\n *\n * ---\n *\n * ### Example\n *\n * ```html\n * <obc-alert-button-item alertType=\"alarm\" nAlerts=\"3\" counter blinking></obc-alert-button-item>\n * <obc-alert-button-item\n * globalCounter\n * nAlerts=\"12\"\n * .counts=${{countAlarm: 2, countWarning: 4, countCaution: 6}}\n * ></obc-alert-button-item>\n * ```\n *\n * @property type - Visual variant: `flat` (icon only), `normal` (default, bordered with the counter) or `enhanced` (filled in the severity colour).\n * @availableWhen type globalCounter==false\n * @property alertType - Alert type that selects the icon and colours: `alarm`, `warning`, `caution` or a `level-*` severity.\n * @availableWhen alertType globalCounter==false\n * @property nAlerts - Number of active alerts; 0 shows the idle bell and hides the counter.\n * @property counter - Shows `nAlerts` next to the bell (not in `flat`).\n * @availableWhen counter globalCounter==false\n * @property globalCounter - Shows the per-severity counts, the bell and the total instead of a single alert status.\n * @property counts - Alert count per severity for the global counter badges.\n * @availableWhen counts globalCounter==true\n * @property shelvedCount - Number of shelved alerts, shown after the global counter badges.\n * @availableWhen shelvedCount globalCounter==true\n * @property blinking - Flashes the bell while there are active alerts of a flashing alert type.\n * @availableWhen blinking globalCounter==false\n * @property flashingSpeed - Flash tempo while `blinking` is on: `default` resolves from `alertType`, `fast`, `slow`, `very-slow` force a tempo, `fixed` never flashes.\n * @availableWhen flashingSpeed blinking==true\n * @property fillHeight - Stretches the visible button to the host height instead of the 32 px visual target.\n * @property ariaLabel - Accessible name forwarded to the inner `<button>`, mapped to the `aria-label` attribute; replaces the generated label. `aria-labelledby` is not supported: ID references cannot cross the shadow boundary.\n * @fires click - Fired when the button is clicked.\n * @experimental\n */\n@customElement('obc-alert-button-item')\n@localized()\nexport class ObcAlertButtonItem extends LitElement {\n @property({type: String}) type: ObcAlertButtonType =\n ObcAlertButtonType.Normal;\n @property({type: String}) alertType?: AlertType;\n @property({type: Number}) nAlerts = 0;\n @property({type: Boolean}) counter = false;\n @property({type: Boolean}) globalCounter = false;\n @property({type: Object, attribute: false}) counts: AlertCounts = {};\n @property({type: Number}) shelvedCount = 0;\n @property({type: Boolean}) blinking = false;\n @property({type: String}) flashingSpeed: FlashingSpeed =\n FlashingSpeed.Default;\n @property({type: Boolean}) fillHeight = false;\n\n // Reactive so a consumer changing the name re-renders the shadow button.\n @property({type: String, attribute: 'aria-label'})\n override ariaLabel: string | null = null;\n\n protected readonly flashing = new FlashingController(\n this,\n () => this.resolvedFlashingSpeed\n );\n\n get resolvedFlashingSpeed(): ResolvedFlashingSpeed {\n if (\n this.globalCounter ||\n !this.blinking ||\n this.nAlerts <= 0 ||\n this.alertType === undefined\n ) {\n return FlashingSpeed.Fixed;\n }\n return resolveFlashingSpeed(\n this.flashingSpeed,\n this.alertType,\n AlertFlashPhase.Active\n );\n }\n\n private get accessibleName(): string {\n if (this.ariaLabel) {\n return this.ariaLabel;\n }\n const parts = [msg('Alerts')];\n if (this.nAlerts > 0) {\n parts.push(String(this.nAlerts));\n }\n if (this.globalCounter) {\n const breakdown = alertCountsLabel(this.counts, this.shelvedCount);\n if (breakdown) {\n parts.push(breakdown);\n }\n } else if (this.nAlerts > 0 && this.alertType) {\n parts.push(alertTypeLabel(this.alertType));\n }\n return parts.join(', ');\n }\n\n private renderTwotoneIcon() {\n const twotone = this.alertType\n ? getAlertTwotoneComponent(this.alertType)\n : AlertTwotoneComponent.Caution;\n switch (twotone) {\n case AlertTwotoneComponent.Critical:\n return html`<obi-alerts-critical-twotone\n useCssColor\n class=\"icon\"\n ></obi-alerts-critical-twotone>`;\n case AlertTwotoneComponent.Diagnostic:\n return html`<obi-alerts-diagnostic-twotone\n useCssColor\n class=\"icon\"\n ></obi-alerts-diagnostic-twotone>`;\n case AlertTwotoneComponent.Warning:\n return html`<obi-alerts-warning-twotone\n useCssColor\n class=\"icon\"\n ></obi-alerts-warning-twotone>`;\n case AlertTwotoneComponent.Caution:\n return html`<obi-alerts-caution-twotone\n useCssColor\n class=\"icon\"\n ></obi-alerts-caution-twotone>`;\n default:\n return html`<obi-alerts-alarm-twotone\n useCssColor\n class=\"icon\"\n ></obi-alerts-alarm-twotone>`;\n }\n }\n\n /** The blink layer shows the opposite of the steady layer in each flash. */\n private renderIcon(styleType: ObcAlertButtonType, blinkLayer: boolean) {\n if (this.nAlerts === 0) {\n return html`<obi-alerts class=\"icon\"></obi-alerts>`;\n }\n const enhanced = styleType === ObcAlertButtonType.Enhanced;\n if (blinkLayer) {\n return enhanced\n ? this.renderTwotoneIcon()\n : html`<obi-alerts class=\"icon\"></obi-alerts>`;\n }\n return enhanced || this.globalCounter\n ? html`<obi-alerts-active class=\"icon\"></obi-alerts-active>`\n : this.renderTwotoneIcon();\n }\n\n private renderCount() {\n return html`<span class=\"count\">${this.nAlerts}</span>`;\n }\n\n private renderCounts() {\n if (rankAlertCounts(this.counts).length === 0 && this.shelvedCount <= 0) {\n return nothing;\n }\n return html`<obc-alert-counter-item\n .type=${ObcAlertCounterItemType.Badges}\n .counts=${this.counts}\n .shelvedCount=${this.shelvedCount}\n ></obc-alert-counter-item>`;\n }\n\n override render() {\n const styleType = this.globalCounter\n ? ObcAlertButtonType.Normal\n : this.type;\n const showCount =\n this.nAlerts > 0 &&\n (this.globalCounter ||\n (this.counter && styleType !== ObcAlertButtonType.Flat));\n const tempo = this.resolvedFlashingSpeed;\n return html`\n <button\n class=${classMap({\n 'alert-button': true,\n [`type-${styleType}`]: true,\n [`alert-type-${this.alertType ?? 'none'}`]: true,\n counter: showCount && !this.globalCounter,\n 'global-counter': this.globalCounter,\n 'fill-height': this.fillHeight,\n [`flash-${tempo}`]: true,\n })}\n aria-label=${this.accessibleName}\n >\n ${\n tempo === FlashingSpeed.Fixed\n ? nothing\n : html`<div class=\"blink\" aria-hidden=\"true\">\n <div class=\"content\">\n ${this.renderIcon(styleType, true)}\n ${showCount ? this.renderCount() : nothing}\n </div>\n </div>`\n }\n <div class=\"visible-wrapper\">\n ${this.globalCounter ? this.renderCounts() : nothing}\n <div class=\"content\">\n ${this.renderIcon(styleType, false)}\n ${showCount ? this.renderCount() : nothing}\n </div>\n </div>\n </button>\n <span class=\"announcement\" aria-live=\"polite\" aria-atomic=\"true\"\n >${this.accessibleName}</span\n >\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-button-item': ObcAlertButtonItem;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAY,qBAAL,yBAAA,oBAAA;CACL,mBAAA,UAAA;CACA,mBAAA,YAAA;CACA,mBAAA,cAAA;;AACF,EAAA,CAAA,CAAA;AA8EO,IAAM,qBAAN,MAAM,2BAA2B,WAAW;;;;EAIb,KAAA,UAAA;EACC,KAAA,UAAA;EACM,KAAA,gBAAA;EACuB,KAAA,SAAA,CAAC;EAC1B,KAAA,eAAA;EACH,KAAA,WAAA;EAEpC,KAAA,gBAAA,cAAc;EACwB,KAAA,aAAA;EAIJ,KAAA,YAAA;EAEN,KAAA,WAAA,IAAI,mBAChC,YACM,KAAK,qBACb;;CAEA,IAAI,wBAA+C;EACjD,IACE,KAAK,iBACL,CAAC,KAAK,YACN,KAAK,WAAW,KAChB,KAAK,cAAc,KAAA,GAEnB,OAAO,cAAc;EAEvB,OAAO,qBACL,KAAK,eACL,KAAK,WACL,gBAAgB,MAClB;CACF;CAEA,IAAY,iBAAyB;EACnC,IAAI,KAAK,WACP,OAAO,KAAK;EAEd,MAAM,QAAQ,CAAC,IAAI,QAAQ,CAAC;EAC5B,IAAI,KAAK,UAAU,GACjB,M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SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,mBAAA,WAAA,iBAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS,EAAC,MAAM,QAAO,CAAC,CAAA,GAAA,mBAAA,WAAA,cAAA,KAAA,CAAA;AAGxB,WAAA,CAAA,SAAS;CAAC,MAAM;CAAQ,WAAW;AAAY,CAAC,CAAA,GAAA,mBAAA,WAAA,aAAA,KAAA,CAAA;AAjBlD,qBAAA,WAAA,CAAA,cAAc,uBAAuB,GACrC,UAAU,CAAA,GAAA,kBAAA"}
1
+ {"version":3,"file":"alert-button-item.js","names":[],"sources":["../../../src/components/alert-button-item/alert-button-item.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {localized, msg} from '@lit/localize';\nimport componentStyle from './alert-button-item.css?inline';\nimport {customElement} from '../../decorator.js';\nimport '../../icons/icon-alerts.js';\nimport '../../icons/icon-alerts-active.js';\nimport '../../icons/icon-alerts-alarm-twotone.js';\nimport '../../icons/icon-alerts-warning-twotone.js';\nimport '../../icons/icon-alerts-caution-twotone.js';\nimport '../../manual-icon/icon-alerts-critical-twotone.js';\nimport '../../manual-icon/icon-alerts-diagnostic-twotone.js';\nimport '../alert-counter-item/alert-counter-item.js';\nimport {ObcAlertCounterItemType} from '../alert-counter-item/alert-counter-item.js';\nimport {\n AlertType,\n FlashingSpeed,\n type AlertCounts,\n type ResolvedFlashingSpeed,\n} from '../../types.js';\nimport {\n AlertFlashPhase,\n AlertTwotoneComponent,\n alertCountsLabel,\n alertTypeLabel,\n getAlertTwotoneComponent,\n rankAlertCounts,\n resolveFlashingSpeed,\n} from '../../alert-severity.js';\nimport {FlashingController} from '../../palettes/flashing-controller.js';\n\n/**\n * `ObcAlertButtonType` – Enum for alert button visual and behavioral variants.\n *\n * - `flat`: Minimal, icon-only button for compact spaces.\n * - `normal`: Standard button with icon and optional counter.\n * - `enhanced`: Emphasized button with additional styling for high-priority alerts.\n */\nexport enum ObcAlertButtonType {\n Flat = 'flat',\n Normal = 'normal',\n Enhanced = 'enhanced',\n}\n\n/**\n * `<obc-alert-button-item>` – The bell button that shows the alert state and count.\n *\n * Shows the alert status as a bell in the style of the given alert type, with\n * an optional counter, or as a global counter: one badge per severity, then\n * the bell and the total. `obc-alert-button` renders the item next to its\n * silence button; use the item on its own where no silence button is needed.\n *\n * ---\n *\n * ### Features\n * - **Variants (`type`):** `flat` (icon only), `normal` (bordered, icon and\n * counter) and `enhanced` (filled in the severity colour).\n * - **Alert types:** `alarm`, `warning`, `caution` and the `level-*` family;\n * `nAlerts` of 0 shows the idle bell.\n * - **Counter:** `counter` shows `nAlerts` next to the bell, except in `flat`.\n * - **Global counter:** `globalCounter` shows the per-severity `counts` as\n * badges, then the bell and `nAlerts`, always in the normal style;\n * `globalCounterType` picks filled badges or the severity shapes.\n * - **Flashing:** `blinking` flashes the bell at the tempo `flashingSpeed`\n * resolves (#1224).\n * - **Fill height:** `fillHeight` stretches the visible button to the host\n * height, as the tall `obc-alert-button` does.\n *\n * ---\n *\n * ### Usage Guidelines\n * - Keep `nAlerts` and `counts` consistent; the item shows both as given.\n * - The generated label reads e.g. \"Alerts, 12, 2 Alarm, 4 Warning,\n * 6 Caution\"; an `aria-label` on the host replaces it. A visually hidden\n * polite live region repeats that name, so a change of counts is announced\n * without the button holding focus; the name attribute alone would change\n * silently.\n * - A native button, so Enter and Space activate it (APG button pattern).\n * - A parent that joins another button to the item's end sets the\n * `data-group-item-not-last` attribute on the host.\n * - **TODO(designer):** the Figma file draws the flat item's hover, active and\n * focused variants at 20 % opacity; the item uses the standard flat states.\n * - **TODO(designer):** the Figma file defines no flashing for the global\n * counter, so it never flashes.\n *\n * ---\n *\n * ### Example\n *\n * ```html\n * <obc-alert-button-item alertType=\"alarm\" nAlerts=\"3\" counter blinking></obc-alert-button-item>\n * <obc-alert-button-item\n * globalCounter\n * nAlerts=\"12\"\n * .counts=${{countAlarm: 2, countWarning: 4, countCaution: 6}}\n * ></obc-alert-button-item>\n * ```\n *\n * @property type - Visual variant: `flat` (icon only), `normal` (default, bordered with the counter) or `enhanced` (filled in the severity colour).\n * @availableWhen type globalCounter==false\n * @property alertType - Alert type that selects the icon and colours: `alarm`, `warning`, `caution` or a `level-*` severity.\n * @availableWhen alertType globalCounter==false\n * @property nAlerts - Number of active alerts; 0 shows the idle bell and hides the counter.\n * @property counter - Shows `nAlerts` next to the bell (not in `flat`).\n * @availableWhen counter globalCounter==false\n * @property globalCounter - Shows the per-severity counts, the bell and the total instead of a single alert status.\n * @property globalCounterType - How the global counter draws each count: `badges` (filled severity badges, default) or `alert-level` (the severity shape beside the count).\n * @availableWhen globalCounterType globalCounter==true\n * @property counts - Alert count per severity for the global counter badges.\n * @availableWhen counts globalCounter==true\n * @property shelvedCount - Number of shelved alerts, shown after the global counter badges.\n * @availableWhen shelvedCount globalCounter==true\n * @property blinking - Flashes the bell while there are active alerts of a flashing alert type.\n * @availableWhen blinking globalCounter==false\n * @property flashingSpeed - Flash tempo while `blinking` is on: `default` resolves from `alertType`, `fast`, `slow`, `very-slow` force a tempo, `fixed` never flashes.\n * @availableWhen flashingSpeed blinking==true\n * @property fillHeight - Stretches the visible button to the host height instead of the 32 px visual target.\n * @property ariaLabel - Accessible name forwarded to the inner `<button>`, mapped to the `aria-label` attribute; replaces the generated label. `aria-labelledby` is not supported: ID references cannot cross the shadow boundary.\n * @fires click - Fired when the button is clicked.\n * @experimental\n */\n@customElement('obc-alert-button-item')\n@localized()\nexport class ObcAlertButtonItem extends LitElement {\n @property({type: String}) type: ObcAlertButtonType =\n ObcAlertButtonType.Normal;\n @property({type: String}) alertType?: AlertType;\n @property({type: Number}) nAlerts = 0;\n @property({type: Boolean}) counter = false;\n @property({type: Boolean}) globalCounter = false;\n @property({type: String}) globalCounterType: ObcAlertCounterItemType =\n ObcAlertCounterItemType.Badges;\n @property({type: Object, attribute: false}) counts: AlertCounts = {};\n @property({type: Number}) shelvedCount = 0;\n @property({type: Boolean}) blinking = false;\n @property({type: String}) flashingSpeed: FlashingSpeed =\n FlashingSpeed.Default;\n @property({type: Boolean}) fillHeight = false;\n\n // Reactive so a consumer changing the name re-renders the shadow button.\n @property({type: String, attribute: 'aria-label'})\n override ariaLabel: string | null = null;\n\n protected readonly flashing = new FlashingController(\n this,\n () => this.resolvedFlashingSpeed\n );\n\n get resolvedFlashingSpeed(): ResolvedFlashingSpeed {\n if (\n this.globalCounter ||\n !this.blinking ||\n this.nAlerts <= 0 ||\n this.alertType === undefined\n ) {\n return FlashingSpeed.Fixed;\n }\n return resolveFlashingSpeed(\n this.flashingSpeed,\n this.alertType,\n AlertFlashPhase.Active\n );\n }\n\n private get accessibleName(): string {\n if (this.ariaLabel) {\n return this.ariaLabel;\n }\n const parts = [msg('Alerts')];\n if (this.nAlerts > 0) {\n parts.push(String(this.nAlerts));\n }\n if (this.globalCounter) {\n const breakdown = alertCountsLabel(this.counts, this.shelvedCount);\n if (breakdown) {\n parts.push(breakdown);\n }\n } else if (this.nAlerts > 0 && this.alertType) {\n parts.push(alertTypeLabel(this.alertType));\n }\n return parts.join(', ');\n }\n\n private renderTwotoneIcon() {\n const twotone = this.alertType\n ? getAlertTwotoneComponent(this.alertType)\n : AlertTwotoneComponent.Caution;\n switch (twotone) {\n case AlertTwotoneComponent.Critical:\n return html`<obi-alerts-critical-twotone\n useCssColor\n class=\"icon\"\n ></obi-alerts-critical-twotone>`;\n case AlertTwotoneComponent.Diagnostic:\n return html`<obi-alerts-diagnostic-twotone\n useCssColor\n class=\"icon\"\n ></obi-alerts-diagnostic-twotone>`;\n case AlertTwotoneComponent.Warning:\n return html`<obi-alerts-warning-twotone\n useCssColor\n class=\"icon\"\n ></obi-alerts-warning-twotone>`;\n case AlertTwotoneComponent.Caution:\n return html`<obi-alerts-caution-twotone\n useCssColor\n class=\"icon\"\n ></obi-alerts-caution-twotone>`;\n default:\n return html`<obi-alerts-alarm-twotone\n useCssColor\n class=\"icon\"\n ></obi-alerts-alarm-twotone>`;\n }\n }\n\n /** The blink layer shows the opposite of the steady layer in each flash. */\n private renderIcon(styleType: ObcAlertButtonType, blinkLayer: boolean) {\n if (this.nAlerts === 0) {\n return html`<obi-alerts class=\"icon\"></obi-alerts>`;\n }\n const enhanced = styleType === ObcAlertButtonType.Enhanced;\n if (blinkLayer) {\n return enhanced\n ? this.renderTwotoneIcon()\n : html`<obi-alerts class=\"icon\"></obi-alerts>`;\n }\n return enhanced || this.globalCounter\n ? html`<obi-alerts-active class=\"icon\"></obi-alerts-active>`\n : this.renderTwotoneIcon();\n }\n\n private renderCount() {\n return html`<span class=\"count\">${this.nAlerts}</span>`;\n }\n\n private renderCounts() {\n if (rankAlertCounts(this.counts).length === 0 && this.shelvedCount <= 0) {\n return nothing;\n }\n return html`<obc-alert-counter-item\n .type=${this.globalCounterType}\n .counts=${this.counts}\n .shelvedCount=${this.shelvedCount}\n ></obc-alert-counter-item>`;\n }\n\n override render() {\n const styleType = this.globalCounter\n ? ObcAlertButtonType.Normal\n : this.type;\n const showCount =\n this.nAlerts > 0 &&\n (this.globalCounter ||\n (this.counter && styleType !== ObcAlertButtonType.Flat));\n const tempo = this.resolvedFlashingSpeed;\n return html`\n <button\n class=${classMap({\n 'alert-button': true,\n [`type-${styleType}`]: true,\n [`alert-type-${this.alertType ?? 'none'}`]: true,\n counter: showCount && !this.globalCounter,\n 'global-counter': this.globalCounter,\n 'fill-height': this.fillHeight,\n [`flash-${tempo}`]: true,\n })}\n aria-label=${this.accessibleName}\n >\n ${\n tempo === FlashingSpeed.Fixed\n ? nothing\n : html`<div class=\"blink\" aria-hidden=\"true\">\n <div class=\"content\">\n ${this.renderIcon(styleType, true)}\n ${showCount ? this.renderCount() : nothing}\n </div>\n </div>`\n }\n <div class=\"visible-wrapper\">\n ${this.globalCounter ? this.renderCounts() : nothing}\n <div class=\"content\">\n ${this.renderIcon(styleType, false)}\n ${showCount ? this.renderCount() : nothing}\n </div>\n </div>\n </button>\n <span class=\"announcement\" aria-live=\"polite\" aria-atomic=\"true\"\n >${this.accessibleName}</span\n >\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-button-item': ObcAlertButtonItem;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,IAAY,qBAAL,yBAAA,oBAAA;CACL,mBAAA,UAAA;CACA,mBAAA,YAAA;CACA,mBAAA,cAAA;;AACF,EAAA,CAAA,CAAA;AAiFO,IAAM,qBAAN,MAAM,2BAA2B,WAAW;;;;EAIb,KAAA,UAAA;EACC,KAAA,UAAA;EACM,KAAA,gBAAA;EAEzC,KAAA,oBAAA,wBAAwB;EACwC,KAAA,SAAA,CAAC;EAC1B,KAAA,eAAA;EACH,KAAA,WAAA;EAEpC,KAAA,gBAAA,cAAc;EACwB,KAAA,aAAA;EAIJ,KAAA,YAAA;EAEN,KAAA,WAAA,IAAI,mBAChC,YACM,KAAK,qBACb;;CAEA,IAAI,wBAA+C;EACjD,IACE,KAAK,iBACL,CAAC,KAAK,YACN,KAAK,WAAW,KAChB,KAAK,cAAc,KAAA,GAEnB,OAAO,cAAc;EAEvB,OAAO,qBACL,KAAK,eACL,KAAK,WACL,gBAAgB,MAClB;CACF;CAEA,IAAY,iBAAyB;EACnC,IAAI,KAAK,WACP,OAAO,KAAK;EAEd,MAAM,QAAQ,CAAC,IAAI,QAAQ,CAAC;EAC5B,IAAI,KAAK,UAAU,GACjB,MAAM,KAAK,OAAO,KAAK,OAAO,CAAC;EAEjC,IAAI,KAAK,eAAe;GACtB,MAAM,YAAY,iBAAiB,KAAK,QAAQ,KAAK,YAAY;GACjE,IAAI,WACF,MAAM,KAAK,SAAS;EAExB,OAAO,IAAI,KAAK,UAAU,KAAK,KAAK,WAClC,MAAM,KAAK,eAAe,KAAK,SAAS,CAAC;EAE3C,OAAO,MAAM,KAAK,IAAI;CACxB;CAEA,oBAA4B;EAI1B,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,MAAM;CAAQ,WAAW;AAAY,CAAC,CAAA,GAAA,mBAAA,WAAA,aAAA,KAAA,CAAA;AAnBlD,qBAAA,WAAA,CAAA,cAAc,uBAAuB,GACrC,UAAU,CAAA,GAAA,kBAAA"}
@@ -14,7 +14,7 @@ var alert_counter_item_default = css`* {
14
14
  gap: var(--app-components-alert-counter-item-badge-spacing);
15
15
  }
16
16
 
17
- obi-alerts-shelf {
17
+ obi-timer-2 {
18
18
  display: block; /* fills the badge icon box that sizes the badge-icon slot */
19
19
  width: 100%;
20
20
  height: 100%;
@@ -1 +1 @@
1
- {"version":3,"file":"alert-counter-item.css.js","names":[],"sources":["../../../src/components/alert-counter-item/alert-counter-item.css?inline"],"sourcesContent":[":host {\n display: inline-block;\n}\n\n.row {\n display: flex;\n align-items: center;\n gap: var(--app-components-alert-counter-item-badge-spacing);\n}\n\nobi-alerts-shelf {\n display: block; /* fills the badge icon box that sizes the badge-icon slot */\n width: 100%;\n height: 100%;\n}\n"],"mappings":""}
1
+ {"version":3,"file":"alert-counter-item.css.js","names":[],"sources":["../../../src/components/alert-counter-item/alert-counter-item.css?inline"],"sourcesContent":[":host {\n display: inline-block;\n}\n\n.row {\n display: flex;\n align-items: center;\n gap: var(--app-components-alert-counter-item-badge-spacing);\n}\n\nobi-timer-2 {\n display: block; /* fills the badge icon box that sizes the badge-icon slot */\n width: 100%;\n height: 100%;\n}\n"],"mappings":""}
@@ -1,7 +1,7 @@
1
1
  import { LitElement, nothing } from 'lit';
2
2
  import { AlertCounts } from '../../types.js';
3
3
  import '../badge/badge.js';
4
- import '../../icons/icon-alerts-shelf.js';
4
+ import '../../icons/icon-timer-2.js';
5
5
  /**
6
6
  * `ObcAlertCounterItemType` – How each count is drawn (Figma `Type`).
7
7
  *
@@ -26,8 +26,8 @@ export declare enum ObcAlertCounterItemType {
26
26
  * `alert-level` draws flat badges with the severity glyph.
27
27
  * - **Every severity:** `counts` takes the whole `AlertType` vocabulary,
28
28
  * including the `level-*` family, ordered by `ALERT_SEVERITY_PRIORITY`.
29
- * - **Shelved count:** `shelvedCount` adds a neutral badge at the end, with
30
- * the shelf icon in `alert-level`.
29
+ * - **Shelved count:** `shelvedCount` adds a neutral badge with the timer icon
30
+ * at the end, the icon the Figma counter swaps into its shelved badge.
31
31
  * - **Accessible summary:** the row is announced as one image labelled with
32
32
  * the counts, e.g. "2 Alarm, 4 Warning, 6 Caution".
33
33
  *
@@ -42,6 +42,9 @@ export declare enum ObcAlertCounterItemType {
42
42
  * `obc-alert-subsystem-counter`.
43
43
  * - **TODO(designer):** the Figma component also has an Unacked counter type;
44
44
  * how its icons map to counts is not defined yet.
45
+ * - **TODO(designer):** the Figma component draws alarm, warning and caution;
46
+ * critical and diagnostic use the `level-critical` and `level-diagnostic`
47
+ * badges of `obc-badge` (#1389).
45
48
  *
46
49
  * ---
47
50
  *
@@ -56,7 +59,7 @@ export declare enum ObcAlertCounterItemType {
56
59
  *
57
60
  * @property type - How each count is drawn: `badges` (filled severity badges, default) or `alert-level` (flat badges with the severity glyph).
58
61
  * @property counts - Alert count per severity (`countAlarm`, `countWarning`, `countCaution` and the `level-*` counts); counts of zero or less are not shown.
59
- * @property shelvedCount - Number of shelved alerts, shown as a neutral badge after the severities; hidden at zero.
62
+ * @property shelvedCount - Number of shelved alerts, shown as a neutral badge with the timer icon after the severities; hidden at zero.
60
63
  * @experimental
61
64
  */
62
65
  export declare class ObcAlertCounterItem extends LitElement {
@@ -64,7 +67,7 @@ export declare class ObcAlertCounterItem extends LitElement {
64
67
  type: ObcAlertCounterItemType;
65
68
  /** Alert count per severity (`countAlarm`, `countWarning`, `countCaution` and the `level-*` counts); counts of zero or less are not shown. */
66
69
  counts: AlertCounts;
67
- /** Number of shelved alerts, shown as a neutral badge after the severities; hidden at zero. */
70
+ /** Number of shelved alerts, shown as a neutral badge with the timer icon after the severities; hidden at zero. */
68
71
  shelvedCount: number;
69
72
  render(): import('lit-html').TemplateResult<1> | typeof nothing;
70
73
  static styles: import('lit').CSSResult;
@@ -1 +1 @@
1
- {"version":3,"file":"alert-counter-item.d.ts","sourceRoot":"","sources":["../../../src/components/alert-counter-item/alert-counter-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAQ,OAAO,EAAY,MAAM,KAAK,CAAC;AAMzD,OAAO,mBAAmB,CAAC;AAE3B,OAAO,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAGhD;;;;;GAKG;AACH,oBAAY,uBAAuB;IACjC,MAAM,WAAW;IACjB,UAAU,gBAAgB;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,qBAEa,mBAAoB,SAAQ,UAAU;IACvB,IAAI,EAAE,uBAAuB,CACtB;IACW,MAAM,EAAE,WAAW,CAAM;IAC3C,YAAY,SAAK;IAElC,MAAM;IAgDf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,wBAAwB,EAAE,mBAAmB,CAAC;KAC/C;CACF"}
1
+ {"version":3,"file":"alert-counter-item.d.ts","sourceRoot":"","sources":["../../../src/components/alert-counter-item/alert-counter-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAQ,OAAO,EAAY,MAAM,KAAK,CAAC;AAMzD,OAAO,mBAAmB,CAAC;AAE3B,OAAO,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAGhD;;;;;GAKG;AACH,oBAAY,uBAAuB;IACjC,MAAM,WAAW;IACjB,UAAU,gBAAgB;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,qBAEa,mBAAoB,SAAQ,UAAU;IACvB,IAAI,EAAE,uBAAuB,CACtB;IACW,MAAM,EAAE,WAAW,CAAM;IAC3C,YAAY,SAAK;IAElC,MAAM;IA0Cf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,wBAAwB,EAAE,mBAAmB,CAAC;KAC/C;CACF"}
@@ -1,7 +1,7 @@
1
1
  import { alertCountsLabel, rankAlertCounts } from "../../alert-severity.js";
2
2
  import { customElement } from "../../decorator.js";
3
3
  import __decorate from "../../_virtual/_@oxc-project_runtime@0.150.0/helpers/esm/decorate.js";
4
- import "../../icons/icon-alerts-shelf.js";
4
+ import "../../icons/icon-timer-2.js";
5
5
  import { BadgeSize, BadgeType, BadgeVariant } from "../badge/badge.js";
6
6
  import alert_counter_item_default from "./alert-counter-item.css.js";
7
7
  import { localized } from "@lit/localize";
@@ -49,12 +49,10 @@ var ObcAlertCounterItem = class ObcAlertCounterItem extends LitElement {
49
49
  size=${BadgeSize.large}
50
50
  type=${BadgeType.regular}
51
51
  .variant=${variant}
52
- .showIcon=${alertLevel}
52
+ showIcon
53
53
  .number=${this.shelvedCount}
54
54
  >
55
- ${alertLevel ? html`<obi-alerts-shelf
56
- slot="badge-icon"
57
- ></obi-alerts-shelf>` : nothing}
55
+ <obi-timer-2 slot="badge-icon"></obi-timer-2>
58
56
  </obc-badge>` : nothing}
59
57
  </div>
60
58
  `;
@@ -1 +1 @@
1
- {"version":3,"file":"alert-counter-item.js","names":[],"sources":["../../../src/components/alert-counter-item/alert-counter-item.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {repeat} from 'lit/directives/repeat.js';\nimport {localized} from '@lit/localize';\nimport componentStyle from './alert-counter-item.css?inline';\nimport {customElement} from '../../decorator.js';\nimport '../badge/badge.js';\nimport {BadgeSize, BadgeType, BadgeVariant} from '../badge/badge.js';\nimport '../../icons/icon-alerts-shelf.js';\nimport type {AlertCounts} from '../../types.js';\nimport {alertCountsLabel, rankAlertCounts} from '../../alert-severity.js';\n\n/**\n * `ObcAlertCounterItemType` – How each count is drawn (Figma `Type`).\n *\n * - `badges`: filled badges in the severity colour (Figma Badges counter).\n * - `alert-level`: flat badges with the severity glyph (Figma Alert level counter).\n */\nexport enum ObcAlertCounterItemType {\n Badges = 'badges',\n AlertLevel = 'alert-level',\n}\n\n/**\n * `<obc-alert-counter-item>` – A row of alert counts, one badge per severity.\n *\n * Renders a large `obc-badge` for every severity with a count above zero, most\n * severe first, followed by an optional shelved count. Nothing renders when\n * nothing is counted.\n *\n * ---\n *\n * ### Features\n * - **Two types:** `badges` draws filled badges in the severity colour;\n * `alert-level` draws flat badges with the severity glyph.\n * - **Every severity:** `counts` takes the whole `AlertType` vocabulary,\n * including the `level-*` family, ordered by `ALERT_SEVERITY_PRIORITY`.\n * - **Shelved count:** `shelvedCount` adds a neutral badge at the end, with\n * the shelf icon in `alert-level`.\n * - **Accessible summary:** the row is announced as one image labelled with\n * the counts, e.g. \"2 Alarm, 4 Warning, 6 Caution\".\n *\n * ---\n *\n * ### Usage Guidelines\n * - Show how many alerts are outstanding per severity in a compact space;\n * `obc-alert-button-item` nests the counter for its global counter.\n * - Pass the counts as one object: `.counts=${{countAlarm: 2, countWarning: 4}}`.\n * - The counter is display-only: it renders no button and fires no events.\n * - For a framed per-subsystem summary with a label, see\n * `obc-alert-subsystem-counter`.\n * - **TODO(designer):** the Figma component also has an Unacked counter type;\n * how its icons map to counts is not defined yet.\n *\n * ---\n *\n * ### Example\n *\n * ```html\n * <obc-alert-counter-item\n * .counts=${{countAlarm: 2, countWarning: 4, countCaution: 6}}\n * shelvedCount=\"9\"\n * ></obc-alert-counter-item>\n * ```\n *\n * @property type - How each count is drawn: `badges` (filled severity badges, default) or `alert-level` (flat badges with the severity glyph).\n * @property counts - Alert count per severity (`countAlarm`, `countWarning`, `countCaution` and the `level-*` counts); counts of zero or less are not shown.\n * @property shelvedCount - Number of shelved alerts, shown as a neutral badge after the severities; hidden at zero.\n * @experimental\n */\n@customElement('obc-alert-counter-item')\n@localized()\nexport class ObcAlertCounterItem extends LitElement {\n @property({type: String}) type: ObcAlertCounterItemType =\n ObcAlertCounterItemType.Badges;\n @property({type: Object, attribute: false}) counts: AlertCounts = {};\n @property({type: Number}) shelvedCount = 0;\n\n override render() {\n const ranked = rankAlertCounts(this.counts);\n if (ranked.length === 0 && this.shelvedCount <= 0) {\n return nothing;\n }\n const alertLevel = this.type === ObcAlertCounterItemType.AlertLevel;\n const variant = alertLevel ? BadgeVariant.flat : BadgeVariant.default;\n return html`\n <div\n class=\"row\"\n role=\"img\"\n aria-label=${alertCountsLabel(this.counts, this.shelvedCount)}\n >\n ${repeat(\n ranked,\n (entry) => entry.type,\n (entry) =>\n html`<obc-badge\n size=${BadgeSize.large}\n type=${entry.type}\n .variant=${variant}\n .showIcon=${alertLevel}\n .number=${entry.count}\n ></obc-badge>`\n )}\n ${\n this.shelvedCount > 0\n ? html`<obc-badge\n size=${BadgeSize.large}\n type=${BadgeType.regular}\n .variant=${variant}\n .showIcon=${alertLevel}\n .number=${this.shelvedCount}\n >\n ${\n alertLevel\n ? html`<obi-alerts-shelf\n slot=\"badge-icon\"\n ></obi-alerts-shelf>`\n : nothing\n }\n </obc-badge>`\n : nothing\n }\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-counter-item': ObcAlertCounterItem;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,IAAY,0BAAL,yBAAA,yBAAA;CACL,wBAAA,YAAA;CACA,wBAAA,gBAAA;;AACF,EAAA,CAAA,CAAA;AAmDO,IAAM,sBAAN,MAAM,4BAA4B,WAAW;;;;EAGgB,KAAA,SAAA,CAAC;EAC1B,KAAA,eAAA;;CAEzC,SAAkB;EAChB,MAAM,SAAS,gBAAgB,KAAK,MAAM;EAC1C,IAAI,OAAO,WAAW,KAAK,KAAK,gBAAgB,GAC9C,OAAO;EAET,MAAM,aAAa,KAAK,SAAA;EACxB,MAAM,UAAU,aAAa,aAAa,OAAO,aAAa;EAC9D,OAAO,IAAI;;;;qBAIM,iBAAiB,KAAK,QAAQ,KAAK,YAAY,EAAE;;UAE5D,OACA,SACC,UAAU,MAAM,OAChB,UACC,IAAI;qBACK,UAAU,MAAM;qBAChB,MAAM,KAAK;yBACP,QAAQ;0BACP,WAAW;wBACb,MAAM,MAAM;0BAE5B,EAAE;UAEA,KAAK,eAAe,IAChB,IAAI;uBACK,UAAU,MAAM;uBAChB,UAAU,QAAQ;2BACd,QAAQ;4BACP,WAAW;0BACb,KAAK,aAAa;;kBAG1B,aACI,IAAI;;8CAGJ,QACL;8BAEH,QACL;;;CAGP;;EAEyB,KAAA,SAAA,UAAU,0BAAc;;AACnD;AAtDG,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,oBAAA,WAAA,QAAA,KAAA,CAAA;AAEvB,WAAA,CAAA,SAAS;CAAC,MAAM;CAAQ,WAAW;AAAK,CAAC,CAAA,GAAA,oBAAA,WAAA,UAAA,KAAA,CAAA;AACzC,WAAA,CAAA,SAAS,EAAC,MAAM,OAAM,CAAC,CAAA,GAAA,oBAAA,WAAA,gBAAA,KAAA,CAAA;AANzB,sBAAA,WAAA,CAAA,cAAc,wBAAwB,GACtC,UAAU,CAAA,GAAA,mBAAA"}
1
+ {"version":3,"file":"alert-counter-item.js","names":[],"sources":["../../../src/components/alert-counter-item/alert-counter-item.ts"],"sourcesContent":["import {LitElement, html, nothing, unsafeCSS} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {repeat} from 'lit/directives/repeat.js';\nimport {localized} from '@lit/localize';\nimport componentStyle from './alert-counter-item.css?inline';\nimport {customElement} from '../../decorator.js';\nimport '../badge/badge.js';\nimport {BadgeSize, BadgeType, BadgeVariant} from '../badge/badge.js';\nimport '../../icons/icon-timer-2.js';\nimport type {AlertCounts} from '../../types.js';\nimport {alertCountsLabel, rankAlertCounts} from '../../alert-severity.js';\n\n/**\n * `ObcAlertCounterItemType` – How each count is drawn (Figma `Type`).\n *\n * - `badges`: filled badges in the severity colour (Figma Badges counter).\n * - `alert-level`: flat badges with the severity glyph (Figma Alert level counter).\n */\nexport enum ObcAlertCounterItemType {\n Badges = 'badges',\n AlertLevel = 'alert-level',\n}\n\n/**\n * `<obc-alert-counter-item>` – A row of alert counts, one badge per severity.\n *\n * Renders a large `obc-badge` for every severity with a count above zero, most\n * severe first, followed by an optional shelved count. Nothing renders when\n * nothing is counted.\n *\n * ---\n *\n * ### Features\n * - **Two types:** `badges` draws filled badges in the severity colour;\n * `alert-level` draws flat badges with the severity glyph.\n * - **Every severity:** `counts` takes the whole `AlertType` vocabulary,\n * including the `level-*` family, ordered by `ALERT_SEVERITY_PRIORITY`.\n * - **Shelved count:** `shelvedCount` adds a neutral badge with the timer icon\n * at the end, the icon the Figma counter swaps into its shelved badge.\n * - **Accessible summary:** the row is announced as one image labelled with\n * the counts, e.g. \"2 Alarm, 4 Warning, 6 Caution\".\n *\n * ---\n *\n * ### Usage Guidelines\n * - Show how many alerts are outstanding per severity in a compact space;\n * `obc-alert-button-item` nests the counter for its global counter.\n * - Pass the counts as one object: `.counts=${{countAlarm: 2, countWarning: 4}}`.\n * - The counter is display-only: it renders no button and fires no events.\n * - For a framed per-subsystem summary with a label, see\n * `obc-alert-subsystem-counter`.\n * - **TODO(designer):** the Figma component also has an Unacked counter type;\n * how its icons map to counts is not defined yet.\n * - **TODO(designer):** the Figma component draws alarm, warning and caution;\n * critical and diagnostic use the `level-critical` and `level-diagnostic`\n * badges of `obc-badge` (#1389).\n *\n * ---\n *\n * ### Example\n *\n * ```html\n * <obc-alert-counter-item\n * .counts=${{countAlarm: 2, countWarning: 4, countCaution: 6}}\n * shelvedCount=\"9\"\n * ></obc-alert-counter-item>\n * ```\n *\n * @property type - How each count is drawn: `badges` (filled severity badges, default) or `alert-level` (flat badges with the severity glyph).\n * @property counts - Alert count per severity (`countAlarm`, `countWarning`, `countCaution` and the `level-*` counts); counts of zero or less are not shown.\n * @property shelvedCount - Number of shelved alerts, shown as a neutral badge with the timer icon after the severities; hidden at zero.\n * @experimental\n */\n@customElement('obc-alert-counter-item')\n@localized()\nexport class ObcAlertCounterItem extends LitElement {\n @property({type: String}) type: ObcAlertCounterItemType =\n ObcAlertCounterItemType.Badges;\n @property({type: Object, attribute: false}) counts: AlertCounts = {};\n @property({type: Number}) shelvedCount = 0;\n\n override render() {\n const ranked = rankAlertCounts(this.counts);\n if (ranked.length === 0 && this.shelvedCount <= 0) {\n return nothing;\n }\n const alertLevel = this.type === ObcAlertCounterItemType.AlertLevel;\n const variant = alertLevel ? BadgeVariant.flat : BadgeVariant.default;\n return html`\n <div\n class=\"row\"\n role=\"img\"\n aria-label=${alertCountsLabel(this.counts, this.shelvedCount)}\n >\n ${repeat(\n ranked,\n (entry) => entry.type,\n (entry) =>\n html`<obc-badge\n size=${BadgeSize.large}\n type=${entry.type}\n .variant=${variant}\n .showIcon=${alertLevel}\n .number=${entry.count}\n ></obc-badge>`\n )}\n ${\n this.shelvedCount > 0\n ? html`<obc-badge\n size=${BadgeSize.large}\n type=${BadgeType.regular}\n .variant=${variant}\n showIcon\n .number=${this.shelvedCount}\n >\n <obi-timer-2 slot=\"badge-icon\"></obi-timer-2>\n </obc-badge>`\n : nothing\n }\n </div>\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-alert-counter-item': ObcAlertCounterItem;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,IAAY,0BAAL,yBAAA,yBAAA;CACL,wBAAA,YAAA;CACA,wBAAA,gBAAA;;AACF,EAAA,CAAA,CAAA;AAsDO,IAAM,sBAAN,MAAM,4BAA4B,WAAW;;;;EAGgB,KAAA,SAAA,CAAC;EAC1B,KAAA,eAAA;;CAEzC,SAAkB;EAChB,MAAM,SAAS,gBAAgB,KAAK,MAAM;EAC1C,IAAI,OAAO,WAAW,KAAK,KAAK,gBAAgB,GAC9C,OAAO;EAET,MAA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