@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.130 → 2.0.0-next.131

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.
@@ -5,6 +5,7 @@ import {
5
5
  ProgressBarMode,
6
6
  ProgressBarType,
7
7
  CircularProgressState,
8
+ Priority,
8
9
  } from './progress-bar.js';
9
10
  import './progress-bar.js';
10
11
 
@@ -19,6 +20,7 @@ const meta: Meta<typeof ObcProgressBar> = {
19
20
  args: {
20
21
  type: ProgressBarType.linear,
21
22
  mode: ProgressBarMode.determinate,
23
+ priority: Priority.enhanced,
22
24
  circularState: CircularProgressState.determinate,
23
25
  value: 40,
24
26
  showValue: false,
@@ -48,6 +50,16 @@ const meta: Meta<typeof ObcProgressBar> = {
48
50
  },
49
51
  if: {arg: 'type', eq: ProgressBarType.linear},
50
52
  },
53
+ priority: {
54
+ control: {type: 'select'},
55
+ options: Object.values(Priority),
56
+ description:
57
+ 'Color emphasis of the bar fill: enhanced (blue) or regular (gray)',
58
+ table: {
59
+ defaultValue: {summary: Priority.enhanced},
60
+ },
61
+ if: {arg: 'type', eq: ProgressBarType.linear},
62
+ },
51
63
  circularState: {
52
64
  control: {type: 'select'},
53
65
  options: Object.values(CircularProgressState),
@@ -172,6 +184,17 @@ export const LinearPrimary: Story = {
172
184
  },
173
185
  };
174
186
 
187
+ export const LinearRegular: Story = {
188
+ name: 'Linear - Regular Priority',
189
+ args: {
190
+ type: ProgressBarType.linear,
191
+ mode: ProgressBarMode.determinate,
192
+ priority: Priority.regular,
193
+ value: 40,
194
+ showValue: true,
195
+ },
196
+ };
197
+
175
198
  export const LinearIndeterminateSimple: Story = {
176
199
  name: 'Linear - Indeterminate Simple',
177
200
  args: {
@@ -1,10 +1,14 @@
1
1
  import {LitElement, html, nothing, unsafeCSS} from 'lit';
2
2
  import {property} from 'lit/decorators.js';
3
+ import {classMap} from 'lit/directives/class-map.js';
3
4
  import {styleMap} from 'lit/directives/style-map.js';
4
5
  import componentStyle from './progress-bar.css?inline';
5
6
  import {customElement} from '../../decorator.js';
6
7
  import '../../icons/icon-placeholder.js';
7
8
  import {CircularProgressMode} from '../../building-blocks/circular-progress/circular-progress.js';
9
+ import {Priority} from '../../navigation-instruments/types.js';
10
+
11
+ export {Priority};
8
12
 
9
13
  export enum ProgressBarType {
10
14
  linear = 'linear',
@@ -44,6 +48,10 @@ export enum CircularProgressState {
44
48
  * - **Indeterminate**: Animated, looping fill for work of unknown duration; the label shows
45
49
  * "Loading".
46
50
  *
51
+ * **Color priority (`priority`)**
52
+ * - **Enhanced** (default): Blue fill, for a bar that reads as the primary value.
53
+ * - **Regular**: Neutral gray fill, for a bar that should recede as ancillary status.
54
+ *
47
55
  * **Circular states (`circularState`)**
48
56
  * - **Determinate**: Ring fills to `value`, with the rounded number (and optional `%` unit) centered.
49
57
  * - **Indeterminate**: Animated ring with the `icon` slot centered.
@@ -98,6 +106,11 @@ export class ObcProgressBar extends LitElement {
98
106
  */
99
107
  @property({type: String}) circularState: CircularProgressState =
100
108
  CircularProgressState.determinate;
109
+ /**
110
+ * Color emphasis of the bar fill: `regular` (gray) or `enhanced` (blue).
111
+ * @availableWhen type==linear
112
+ */
113
+ @property({type: String}) priority: Priority = Priority.enhanced;
101
114
  /** Progress percentage (0–100); clamped when rendered. */
102
115
  @property({type: Number}) value = 0;
103
116
  /**
@@ -222,12 +235,16 @@ export class ObcProgressBar extends LitElement {
222
235
  private renderLinearProgress() {
223
236
  const clampedValue = Math.max(0, Math.min(100, this.value));
224
237
  const progressWidth = `${clampedValue}%`;
238
+ const barClasses = {
239
+ bar: true,
240
+ 'priority-regular': this.priority === Priority.regular,
241
+ };
225
242
 
226
243
  return html`
227
244
  <div class="wrapper">
228
245
  ${this.showValue ? this.renderLabel() : ''}
229
246
 
230
- <div class="bar">
247
+ <div class=${classMap(barClasses)}>
231
248
  ${this.mode === ProgressBarMode.determinate
232
249
  ? html`
233
250
  <div