@oicl/openbridge-webcomponents-full-bundle 2.2.0-next.22 → 2.2.0-next.23
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.
- package/custom-elements-manifest.config.mjs +2 -1
- package/custom-elements.json +312 -17
- package/llms/components/obc-accordion-card.md +141 -0
- package/llms/components/obc-accordion-item.md +90 -0
- package/llms/components/obc-advice-button.md +87 -0
- package/llms/components/obc-advice-floating-item.md +113 -0
- package/llms/components/obc-advice-menu-item.md +87 -0
- package/llms/components/obc-advice-message-item.md +138 -0
- package/llms/components/obc-alert-button-item.md +117 -0
- package/llms/components/obc-alert-button.md +134 -0
- package/llms/components/obc-alert-counter-item.md +74 -0
- package/llms/components/obc-alert-detail-page.md +45 -0
- package/llms/components/obc-alert-floating-item.md +53 -0
- package/llms/components/obc-alert-frame.md +142 -0
- package/llms/components/obc-alert-icon.md +79 -0
- package/llms/components/obc-alert-list-details-experimental.md +89 -0
- package/llms/components/obc-alert-list-details.md +38 -0
- package/llms/components/obc-alert-list-page-small.md +39 -0
- package/llms/components/obc-alert-list.md +37 -0
- package/llms/components/obc-alert-menu-item.md +128 -0
- package/llms/components/obc-alert-menu.md +115 -0
- package/llms/components/obc-alert-subsystem-button.md +88 -0
- package/llms/components/obc-alert-subsystem-counter.md +110 -0
- package/llms/components/obc-analog-threeway-valve.md +106 -0
- package/llms/components/obc-analog-valve.md +74 -0
- package/llms/components/obc-app-button.md +83 -0
- package/llms/components/obc-app-menu.md +69 -0
- package/llms/components/obc-area-graph.md +333 -0
- package/llms/components/obc-attachment-list-item.md +49 -0
- package/llms/components/obc-audio-output.md +59 -0
- package/llms/components/obc-audio-recording-item.md +91 -0
- package/llms/components/obc-automation-badge.md +66 -0
- package/llms/components/obc-automation-button-readout-stack.md +71 -0
- package/llms/components/obc-automation-button.md +86 -0
- package/llms/components/obc-automation-input-modal.md +48 -0
- package/llms/components/obc-automation-readout.md +32 -0
- package/llms/components/obc-automation-tank.md +156 -0
- package/llms/components/obc-azimuth-thruster-labeled.md +56 -0
- package/llms/components/obc-azimuth-thruster.md +80 -0
- package/llms/components/obc-badge-command.md +26 -0
- package/llms/components/obc-badge.md +151 -0
- package/llms/components/obc-bar-horizontal.md +123 -0
- package/llms/components/obc-bar-vertical.md +125 -0
- package/llms/components/obc-battery-icon.md +38 -0
- package/llms/components/obc-bearing-indicator.md +27 -0
- package/llms/components/obc-bipolar-transistor.md +64 -0
- package/llms/components/obc-breadcrumb.md +58 -0
- package/llms/components/obc-brilliance-menu.md +115 -0
- package/llms/components/obc-bus.md +64 -0
- package/llms/components/obc-button.md +110 -0
- package/llms/components/obc-calendar.md +91 -0
- package/llms/components/obc-capacitor.md +64 -0
- package/llms/components/obc-card.md +103 -0
- package/llms/components/obc-chart-object-vessel-button.md +103 -0
- package/llms/components/obc-chat-message.md +35 -0
- package/llms/components/obc-check-button.md +104 -0
- package/llms/components/obc-checkbox-item.md +95 -0
- package/llms/components/obc-checkbox-list.md +73 -0
- package/llms/components/obc-checkbox.md +97 -0
- package/llms/components/obc-circular-progress.md +36 -0
- package/llms/components/obc-clock.md +86 -0
- package/llms/components/obc-command-button.md +56 -0
- package/llms/components/obc-command-menu.md +135 -0
- package/llms/components/obc-communication-table.md +31 -0
- package/llms/components/obc-compass-flat.md +79 -0
- package/llms/components/obc-compass-indicator.md +61 -0
- package/llms/components/obc-compass-sector.md +110 -0
- package/llms/components/obc-compass.md +157 -0
- package/llms/components/obc-context-menu-input.md +191 -0
- package/llms/components/obc-converter.md +64 -0
- package/llms/components/obc-corner-line.md +29 -0
- package/llms/components/obc-current.md +79 -0
- package/llms/components/obc-damper.md +62 -0
- package/llms/components/obc-date-item.md +66 -0
- package/llms/components/obc-depth-actual.md +69 -0
- package/llms/components/obc-depth-indicator.md +31 -0
- package/llms/components/obc-depth-top-band.md +43 -0
- package/llms/components/obc-depth.md +94 -0
- package/llms/components/obc-diagnostic-button.md +71 -0
- package/llms/components/obc-diagnostic-menu.md +88 -0
- package/llms/components/obc-digital-threeway-valve.md +112 -0
- package/llms/components/obc-digital-valve.md +78 -0
- package/llms/components/obc-diodes.md +64 -0
- package/llms/components/obc-direction-line.md +28 -0
- package/llms/components/obc-divider.md +44 -0
- package/llms/components/obc-donut-chart.md +116 -0
- package/llms/components/obc-draft-trim.md +67 -0
- package/llms/components/obc-dropdown-button.md +99 -0
- package/llms/components/obc-electricity-battery.md +83 -0
- package/llms/components/obc-elevated-card-radio-group.md +103 -0
- package/llms/components/obc-elevated-card-radio.md +104 -0
- package/llms/components/obc-elevated-card.md +146 -0
- package/llms/components/obc-end-point-line.md +29 -0
- package/llms/components/obc-event-item.md +47 -0
- package/llms/components/obc-event-list.md +37 -0
- package/llms/components/obc-fan.md +68 -0
- package/llms/components/obc-filter-chip.md +91 -0
- package/llms/components/obc-filter.md +64 -0
- package/llms/components/obc-floating-item.md +125 -0
- package/llms/components/obc-form-container.md +45 -0
- package/llms/components/obc-form-footer-container.md +34 -0
- package/llms/components/obc-form-group.md +80 -0
- package/llms/components/obc-form-item.md +95 -0
- package/llms/components/obc-gauge-bar-indicator.md +46 -0
- package/llms/components/obc-gauge-generator.md +102 -0
- package/llms/components/obc-gauge-horizontal.md +169 -0
- package/llms/components/obc-gauge-motors-and-pumps.md +110 -0
- package/llms/components/obc-gauge-proportional.md +134 -0
- package/llms/components/obc-gauge-radial-indicator.md +76 -0
- package/llms/components/obc-gauge-radial.md +163 -0
- package/llms/components/obc-gauge-trend-indicator.md +53 -0
- package/llms/components/obc-gauge-trend.md +271 -0
- package/llms/components/obc-gauge-valve.md +114 -0
- package/llms/components/obc-gauge-vertical.md +169 -0
- package/llms/components/obc-gnss-skyplot.md +80 -0
- package/llms/components/obc-graph-mini.md +28 -0
- package/llms/components/obc-ground.md +64 -0
- package/llms/components/obc-heading-indicator.md +42 -0
- package/llms/components/obc-heading.md +106 -0
- package/llms/components/obc-heat-exchanger.md +80 -0
- package/llms/components/obc-heat-pump.md +79 -0
- package/llms/components/obc-heave-indicator.md +38 -0
- package/llms/components/obc-heave.md +60 -0
- package/llms/components/obc-horizontal-line.md +29 -0
- package/llms/components/obc-hydraulic-check-valve.md +36 -0
- package/llms/components/obc-hydraulic-separator.md +80 -0
- package/llms/components/obc-hydraulic-valve-4-3.md +71 -0
- package/llms/components/obc-hydraulic-valve-x-2.md +68 -0
- package/llms/components/obc-icon-button.md +117 -0
- package/llms/components/obc-icon-check-button.md +85 -0
- package/llms/components/obc-indicator-battery.md +69 -0
- package/llms/components/obc-indicator-engine.md +39 -0
- package/llms/components/obc-indicator-generator.md +59 -0
- package/llms/components/obc-indicator-graph.md +33 -0
- package/llms/components/obc-indicator-tank-atmospheric.md +69 -0
- package/llms/components/obc-input-chip.md +96 -0
- package/llms/components/obc-instrument-field.md +172 -0
- package/llms/components/obc-instrument-radial.md +77 -0
- package/llms/components/obc-integration-app-bar.md +41 -0
- package/llms/components/obc-integration-bar-dropdown.md +71 -0
- package/llms/components/obc-integration-bar.md +72 -0
- package/llms/components/obc-integration-button.md +62 -0
- package/llms/components/obc-integration-dropdown-button.md +75 -0
- package/llms/components/obc-integration-fleet-button.md +41 -0
- package/llms/components/obc-integration-tabs.md +28 -0
- package/llms/components/obc-integration-vessel-menu.md +58 -0
- package/llms/components/obc-integration-vessel-selector.md +32 -0
- package/llms/components/obc-keyboard-full.md +175 -0
- package/llms/components/obc-keyboard-numeric.md +77 -0
- package/llms/components/obc-line-cross.md +28 -0
- package/llms/components/obc-line-graph.md +164 -0
- package/llms/components/obc-line-overlap.md +28 -0
- package/llms/components/obc-logic.md +64 -0
- package/llms/components/obc-main-engine-indicator.md +55 -0
- package/llms/components/obc-main-engine.md +54 -0
- package/llms/components/obc-menu-button.md +158 -0
- package/llms/components/obc-message-menu-item.md +165 -0
- package/llms/components/obc-modal-window.md +139 -0
- package/llms/components/obc-mosfet.md +64 -0
- package/llms/components/obc-motor.md +73 -0
- package/llms/components/obc-navigation-item-group.md +82 -0
- package/llms/components/obc-navigation-item.md +138 -0
- package/llms/components/obc-navigation-menu.md +135 -0
- package/llms/components/obc-non-return-valve.md +79 -0
- package/llms/components/obc-notification-badge-button.md +87 -0
- package/llms/components/obc-notification-button.md +92 -0
- package/llms/components/obc-notification-floating-item.md +121 -0
- package/llms/components/obc-notification-menu-item.md +87 -0
- package/llms/components/obc-notification-message-item.md +127 -0
- package/llms/components/obc-number-input-field.md +97 -0
- package/llms/components/obc-pagination.md +95 -0
- package/llms/components/obc-pie-chart.md +120 -0
- package/llms/components/obc-pitch-indicator.md +39 -0
- package/llms/components/obc-pitch-roll-heave.md +86 -0
- package/llms/components/obc-pitch-roll-yaw.md +72 -0
- package/llms/components/obc-pitch-roll.md +63 -0
- package/llms/components/obc-pitch.md +81 -0
- package/llms/components/obc-pivot-item-group.md +79 -0
- package/llms/components/obc-pivot-item.md +75 -0
- package/llms/components/obc-poi-aton.md +68 -0
- package/llms/components/obc-poi-button-aton.md +54 -0
- package/llms/components/obc-poi-button-data.md +53 -0
- package/llms/components/obc-poi-button-vessel.md +55 -0
- package/llms/components/obc-poi-button.md +94 -0
- package/llms/components/obc-poi-card-header.md +90 -0
- package/llms/components/obc-poi-card.md +110 -0
- package/llms/components/obc-poi-controller.md +151 -0
- package/llms/components/obc-poi-data.md +72 -0
- package/llms/components/obc-poi-graphic-line.md +70 -0
- package/llms/components/obc-poi-group.md +85 -0
- package/llms/components/obc-poi-header.md +71 -0
- package/llms/components/obc-poi-layer-stack.md +85 -0
- package/llms/components/obc-poi-layer.md +110 -0
- package/llms/components/obc-poi-line.md +70 -0
- package/llms/components/obc-poi-object-aton.md +45 -0
- package/llms/components/obc-poi-object-data.md +48 -0
- package/llms/components/obc-poi-object-vessel.md +95 -0
- package/llms/components/obc-poi-object.md +82 -0
- package/llms/components/obc-poi-pointer.md +70 -0
- package/llms/components/obc-poi-selection-frame.md +66 -0
- package/llms/components/obc-poi-vessel.md +70 -0
- package/llms/components/obc-poi.md +140 -0
- package/llms/components/obc-polar-chart.md +126 -0
- package/llms/components/obc-position-deviation.md +84 -0
- package/llms/components/obc-pressure-reduction-valve.md +88 -0
- package/llms/components/obc-pressure-sustain-valve.md +85 -0
- package/llms/components/obc-progress-bar.md +102 -0
- package/llms/components/obc-progress-button.md +111 -0
- package/llms/components/obc-progress-indicator-dots.md +57 -0
- package/llms/components/obc-propulsion-azimuth-indicator.md +48 -0
- package/llms/components/obc-pump.md +76 -0
- package/llms/components/obc-radial-bar-chart.md +103 -0
- package/llms/components/obc-radio.md +82 -0
- package/llms/components/obc-rate-of-turn.md +95 -0
- package/llms/components/obc-readout-block.md +137 -0
- package/llms/components/obc-readout-list-item.md +142 -0
- package/llms/components/obc-readout-list.md +85 -0
- package/llms/components/obc-readout.md +169 -0
- package/llms/components/obc-resistor.md +64 -0
- package/llms/components/obc-rich-button.md +92 -0
- package/llms/components/obc-roll-indicator.md +38 -0
- package/llms/components/obc-roll.md +56 -0
- package/llms/components/obc-rot-indicator.md +32 -0
- package/llms/components/obc-rot-linear.md +68 -0
- package/llms/components/obc-rot-sector.md +125 -0
- package/llms/components/obc-router.md +64 -0
- package/llms/components/obc-rudder-indicator.md +54 -0
- package/llms/components/obc-rudder.md +112 -0
- package/llms/components/obc-ruler-pointer.md +57 -0
- package/llms/components/obc-scrollbar.md +57 -0
- package/llms/components/obc-sequence-card.md +119 -0
- package/llms/components/obc-sequence-connector.md +70 -0
- package/llms/components/obc-sequence-item.md +64 -0
- package/llms/components/obc-sequence-loading-spinner.md +70 -0
- package/llms/components/obc-sequence-modal.md +89 -0
- package/llms/components/obc-sequence-step.md +48 -0
- package/llms/components/obc-sequence-toolbar.md +108 -0
- package/llms/components/obc-slide-button.md +111 -0
- package/llms/components/obc-slider-double.md +137 -0
- package/llms/components/obc-slider.md +143 -0
- package/llms/components/obc-source.md +64 -0
- package/llms/components/obc-speed-arrows.md +39 -0
- package/llms/components/obc-speed-directions.md +66 -0
- package/llms/components/obc-speed-gauge.md +124 -0
- package/llms/components/obc-speed-indicator.md +37 -0
- package/llms/components/obc-split-button.md +144 -0
- package/llms/components/obc-start-stop-switch.md +126 -0
- package/llms/components/obc-status-indicator.md +30 -0
- package/llms/components/obc-stepper-box.md +90 -0
- package/llms/components/obc-surge-sway-yaw.md +95 -0
- package/llms/components/obc-switch.md +69 -0
- package/llms/components/obc-system-button.md +112 -0
- package/llms/components/obc-system-menu.md +67 -0
- package/llms/components/obc-tab-item.md +161 -0
- package/llms/components/obc-tab-row.md +151 -0
- package/llms/components/obc-tabbed-card.md +148 -0
- package/llms/components/obc-table-header-item.md +42 -0
- package/llms/components/obc-table.md +124 -0
- package/llms/components/obc-tag.md +41 -0
- package/llms/components/obc-text-input-field.md +94 -0
- package/llms/components/obc-textarea-field.md +186 -0
- package/llms/components/obc-textbox.md +80 -0
- package/llms/components/obc-three-way-line.md +29 -0
- package/llms/components/obc-thruster.md +64 -0
- package/llms/components/obc-title-container.md +81 -0
- package/llms/components/obc-toggle-button-group.md +184 -0
- package/llms/components/obc-toggle-button-option.md +126 -0
- package/llms/components/obc-toggle-button-three-state.md +38 -0
- package/llms/components/obc-toggle-button-vertical-group.md +142 -0
- package/llms/components/obc-toggle-button-vertical-option.md +110 -0
- package/llms/components/obc-toggle-switch.md +126 -0
- package/llms/components/obc-toggletip.md +135 -0
- package/llms/components/obc-tooltip.md +106 -0
- package/llms/components/obc-top-bar.md +194 -0
- package/llms/components/obc-top-view-propulsion.md +84 -0
- package/llms/components/obc-topbar-message-item.md +150 -0
- package/llms/components/obc-transformer.md +64 -0
- package/llms/components/obc-transmitter-button.md +101 -0
- package/llms/components/obc-transmitter-stack.md +79 -0
- package/llms/components/obc-transmitter.md +114 -0
- package/llms/components/obc-tree-navigation-group.md +69 -0
- package/llms/components/obc-tree-navigation-item.md +110 -0
- package/llms/components/obc-tree-navigation.md +73 -0
- package/llms/components/obc-tunnel-thruster.md +59 -0
- package/llms/components/obc-user-button.md +107 -0
- package/llms/components/obc-user-menu.md +154 -0
- package/llms/components/obc-valve-analog-three-way-icon.md +69 -0
- package/llms/components/obc-valve-analog-two-way-icon.md +39 -0
- package/llms/components/obc-velocity-projection-plot.md +34 -0
- package/llms/components/obc-vendor-button.md +63 -0
- package/llms/components/obc-vertical-line.md +33 -0
- package/llms/components/obc-watch-flat.md +54 -0
- package/llms/components/obc-watch.md +206 -0
- package/llms/components/obc-wind-indicator.md +52 -0
- package/llms/components/obc-wind-propulsion.md +92 -0
- package/llms/components/obc-wind.md +46 -0
- package/llms/docs/ar-poi-projection.md +36 -0
- package/llms/docs/automation-sequence-step-diagram-playground.md +13 -0
- package/llms/docs/building-blocks-advice.md +31 -0
- package/llms/docs/building-blocks-external-scale.md +138 -0
- package/llms/docs/building-blocks-setpoint.md +119 -0
- package/llms/docs/introduction-advice-system.md +161 -0
- package/llms/docs/introduction-getting-started.md +94 -0
- package/llms/docs/introduction-introduction.md +27 -0
- package/llms/docs/introduction-join-the-project.md +11 -0
- package/llms/docs/introduction-migration-guide-2-0-to-2-1.md +126 -0
- package/llms/docs/introduction-migration-guide-2-1-to-2-2.md +106 -0
- package/llms/docs/introduction-migration-guide.md +1063 -0
- package/llms/docs/palettes-categorical-colour.md +9 -0
- package/llms/llms-full.txt +28380 -0
- package/llms/llms.txt +368 -0
- package/package.json +12 -2
- package/script/cem-plugins/lifecycle.d.mts +6 -0
- package/script/cem-plugins/lifecycle.mjs +48 -0
- package/script/cem-plugins.test.ts +52 -1
- package/script/generate-llms-txt.ts +34 -0
- package/script/llms/channel.test.ts +69 -0
- package/script/llms/channel.ts +63 -0
- package/script/llms/generate.test.ts +143 -0
- package/script/llms/generate.ts +229 -0
- package/script/llms/manifest.test.ts +160 -0
- package/script/llms/manifest.ts +109 -0
- package/script/llms/markdown.test.ts +22 -0
- package/script/llms/markdown.ts +37 -0
- package/script/llms/mdx.test.ts +172 -0
- package/script/llms/mdx.ts +171 -0
- package/script/llms/render-component.test.ts +290 -0
- package/script/llms/render-component.ts +208 -0
- package/script/llms/render-guides.test.ts +105 -0
- package/script/llms/render-guides.ts +51 -0
- package/script/llms/render-llms-txt.test.ts +222 -0
- package/script/llms/render-llms-txt.ts +185 -0
- package/script/llms/sources.test.ts +118 -0
- package/script/llms/sources.ts +89 -0
- package/script/llms/stories.test.ts +193 -0
- package/script/llms/stories.ts +256 -0
- package/script/llms/types.ts +95 -0
- package/script/prepare-full-bundle.ts +1 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# `<obc-accordion-card>`
|
|
2
|
+
|
|
3
|
+
Expandable/collapsible card component for grouping content in a compact, interactive section (accordion, expandable panel, disclosure).
|
|
4
|
+
|
|
5
|
+
Lifecycle: stable. [Storybook](https://openbridge-next-storybook.web.app/?path=/docs/ui-components-sections-accordion-card--docs) · [Source](https://raw.githubusercontent.com/Ocean-Industries-Concept-Lab/openbridge-webcomponents/develop/packages/openbridge-webcomponents/src/components/accordion-card/accordion-card.ts)
|
|
6
|
+
|
|
7
|
+
`<obc-accordion-card>` – Expandable/collapsible card component for grouping content in a compact, interactive section (accordion, expandable panel, disclosure).
|
|
8
|
+
|
|
9
|
+
Provides a summary row with optional icon, title, description, and status label. Expands to reveal additional content on click/tap, supporting both single-line and large layouts. Can display an alert overlay for contextual warnings or notifications.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
- **Expandable/collapsible:** Click/tap toggles between collapsed and expanded states, revealing or hiding additional content. The panel slides open and closed, and the chevron turns with it; `prefers-reduced-motion: reduce` switches instantly instead.
|
|
13
|
+
- **Variants:**
|
|
14
|
+
- **Single-line:** Compact header with only title (and optional icon/status).
|
|
15
|
+
- **Large:** Header includes a description beneath the title for more detail.
|
|
16
|
+
- **Positioning:** Supports `top`, `bottom`, `center`, or `regular` (default) border radius/edge styling for stacking multiple accordions.
|
|
17
|
+
- **Status label:** Optional status text displayed in the header (e.g., "Active", "Warning").
|
|
18
|
+
- **Leading icon:** Optional icon slot at the start of the header for visual context.
|
|
19
|
+
- **Alert overlay:** Can display an alert frame (with icon, label, timer) above the card for warnings or notifications.
|
|
20
|
+
- **Disabled state:** Prevents interaction and visually indicates non-interactive status.
|
|
21
|
+
- **Accessibility:** Uses button semantics and ARIA attributes for expand/collapse.
|
|
22
|
+
|
|
23
|
+
## Usage Guidelines
|
|
24
|
+
Use `obc-accordion-card` to organize related content in a collapsible section, especially when space is limited or when users may want to focus on one section at a time. Ideal for settings panels, grouped controls, or dashboards where expandable details are needed. Avoid using for persistent, always-visible content.
|
|
25
|
+
|
|
26
|
+
- Use the **single-line** variant for brief titles or when space is tight.
|
|
27
|
+
- Use the **large** variant when you need to provide a short description or supporting text under the title.
|
|
28
|
+
- The **status label** is useful for showing quick state info (e.g., "Active", "Error").
|
|
29
|
+
- The **alert overlay** is intended for contextual warnings or notifications related to the card's content.
|
|
30
|
+
- For stacking multiple accordions, adjust the `position` property to control border radii and visual grouping.
|
|
31
|
+
|
|
32
|
+
**TODO(designer):** Confirm if there are recommended limits on title/description length, and if only one accordion should be expanded at a time in a group.
|
|
33
|
+
|
|
34
|
+
## Slots
|
|
35
|
+
| Slot Name | Renders When... | Purpose |
|
|
36
|
+
|-------------------|------------------------|-------------------------------------------------------|
|
|
37
|
+
| leading-icon | `hasLeadingIcon` true | Icon at the start of the header (e.g., `<obi-placeholder></obi-placeholder>`). |
|
|
38
|
+
| expanded-content | Always | Content revealed when the accordion is expanded. |
|
|
39
|
+
| alert-icon | `hasAlert` and `showAlertIcon` true | Icon for the alert overlay (slot="icon" in alert frame). |
|
|
40
|
+
| alert-label | `hasAlert` true | Label text for the alert overlay (slot="label" in alert frame). |
|
|
41
|
+
| alert-timer | `hasAlert` true | Timer or duration text for the alert overlay (slot="timer" in alert frame). |
|
|
42
|
+
|
|
43
|
+
## Properties
|
|
44
|
+
- `expanded` (boolean): Whether the card is expanded (shows additional content). Toggled by user interaction.
|
|
45
|
+
- `disabled` (boolean): Disables interaction and visually dims the card.
|
|
46
|
+
- `cardTitle` (string): Main title text shown in the header.
|
|
47
|
+
- `description` (string): Supporting description (shown only in large size and if `hasDescription` is true).
|
|
48
|
+
- `statusLabel` (string): Optional status text in the header (shown if `hasStatusLabel` is true).
|
|
49
|
+
- `hasAlert` (boolean): Shows an alert overlay above the card when true.
|
|
50
|
+
- `hasDescription` (boolean): Enables description text in large variant.
|
|
51
|
+
- `hasStatusLabel` (boolean): Enables status label in header.
|
|
52
|
+
- `hasLeadingIcon` (boolean): Enables leading icon slot in header.
|
|
53
|
+
- `size` (`AccordionSize` enum): Layout variant, either `'single-line'` (default) or `'large'`.
|
|
54
|
+
- `position` (`Position` enum): Controls border radius for stacking (`'top'`, `'bottom'`, `'center'`, `'regular'`).
|
|
55
|
+
- `alertFrameType`, `alertFrameThickness`, `alertFrameStatus`, `alertFrameMode`, `showAlertCategoryIcon`, `showAlertIcon`: Configure the alert overlay's appearance (see `obc-alert-frame` for details).
|
|
56
|
+
|
|
57
|
+
## Events
|
|
58
|
+
- `accordion-toggle` – Fired when the accordion is expanded or collapsed. Event detail includes `{ expanded, cardTitle }`.
|
|
59
|
+
|
|
60
|
+
## Best Practices
|
|
61
|
+
- Only use the alert overlay for important, contextual notifications related to the card's content.
|
|
62
|
+
- For accessibility, ensure the card title is descriptive and unique within a group.
|
|
63
|
+
- Avoid nesting interactive elements (like buttons) directly in the header; place them in the expanded content if needed.
|
|
64
|
+
|
|
65
|
+
## Example:
|
|
66
|
+
```
|
|
67
|
+
<obc-accordion-card
|
|
68
|
+
cardTitle="Settings"
|
|
69
|
+
description="Configure your preferences"
|
|
70
|
+
size="large"
|
|
71
|
+
hasDescription
|
|
72
|
+
expanded
|
|
73
|
+
hasLeadingIcon
|
|
74
|
+
>
|
|
75
|
+
<span slot="leading-icon"><obi-placeholder></obi-placeholder></span>
|
|
76
|
+
<div slot="expanded-content">
|
|
77
|
+
<!-- Additional settings controls here -->
|
|
78
|
+
</div>
|
|
79
|
+
</obc-accordion-card>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Properties
|
|
83
|
+
|
|
84
|
+
| Property | Attribute | Type | Default | Description |
|
|
85
|
+
| --- | --- | --- | --- | --- |
|
|
86
|
+
| cardTitle | cardTitle | `string` | `''` | Main title text displayed in the accordion header. |
|
|
87
|
+
| description | description | `string` | `''` | Supporting description text shown under the title (only in large size and if `hasDescription` is true). Available when `size==large && hasDescription==true`. |
|
|
88
|
+
| statusLabel | statusLabel | `string` | `''` | Optional status label displayed in the header (shown if `hasStatusLabel` is true). Available when `hasStatusLabel==true`. |
|
|
89
|
+
| expanded | expanded | `boolean` | `false` | Whether the accordion card is expanded (shows additional content). |
|
|
90
|
+
| disabled | disabled | `boolean` | `false` | Disables the accordion card, preventing user interaction and dimming its appearance. |
|
|
91
|
+
| hasAlert | hasAlert | `boolean` | `false` | Shows an alert overlay above the card when true. Configure appearance with `alertFrameType`, `alertFrameThickness`, `alertFrameStatus` and `alertFrameMode`. |
|
|
92
|
+
| hasDescription | hasDescription | `boolean` | `false` | Enables the description text in the header (only in large size). |
|
|
93
|
+
| hasStatusLabel | hasStatusLabel | `boolean` | `false` | Enables the status label in the header. |
|
|
94
|
+
| hasLeadingIcon | hasLeadingIcon | `boolean` | `false` | Enables the leading icon slot in the header. |
|
|
95
|
+
| position | position | `Position` | | Border radius for stacking: `regular` (default) rounds every corner, `top` flattens the bottom edge, `bottom` flattens the top edge, and `center` flattens both for a card in the middle of a stack. |
|
|
96
|
+
| size | size | `AccordionSize` | | Layout variant: `single-line` (default) is a compact title-only header, `large` adds a description beneath the title. |
|
|
97
|
+
| alertFrameType | alertFrameType | `ObcAlertFrameType` | | Type of the alert frame overlay (used when `hasAlert` is true). See `obc-alert-frame` for available types. Available when `hasAlert==true`. |
|
|
98
|
+
| alertFrameThickness | alertFrameThickness | `ObcAlertFrameThickness` | | Thickness of the alert frame overlay (used when `hasAlert` is true). See `obc-alert-frame` for available thickness values. Available when `hasAlert==true`. |
|
|
99
|
+
| alertFrameStatus | alertFrameStatus | `AlertType` | | Status of the alert frame overlay (used when `hasAlert` is true). See `obc-alert-frame` for available statuses. Available when `hasAlert==true`. |
|
|
100
|
+
| alertFrameMode | alertFrameMode | `ObcAlertFrameMode` | | Acknowledgement state of the alert: `acked-active` (default) is steady, `unacked-active` flashes, `unacked-rectified` flashes a dashed frame. Available when `hasAlert==true`. |
|
|
101
|
+
| showAlertCategoryIcon | | `boolean` | `true` | Shows the alert category icon in the flap; a small side flap without it is not drawn. Available when `hasAlert==true && alertFrameType in [SmallSideFlip, LargeSideFlip, BottomFlip, TopFlip]`. |
|
|
102
|
+
| showAlertIcon | showAlertIcon | `boolean` | `false` | Shows the `alert-icon` slot in a large side, bottom or top flap. Available when `hasAlert==true && alertFrameType in [LargeSideFlip, BottomFlip, TopFlip]`. |
|
|
103
|
+
|
|
104
|
+
## Events
|
|
105
|
+
|
|
106
|
+
| Event | Type | Description |
|
|
107
|
+
| --- | --- | --- |
|
|
108
|
+
| accordion-toggle | `CustomEvent<{expanded: boolean, cardTitle: string}>` | Fired when the accordion is expanded or collapsed |
|
|
109
|
+
|
|
110
|
+
## Slots
|
|
111
|
+
|
|
112
|
+
| Slot | Description |
|
|
113
|
+
| --- | --- |
|
|
114
|
+
| leading-icon | Icon at the start of the header (shown when `hasLeadingIcon` is true) |
|
|
115
|
+
| expanded-content | Content revealed when the accordion is expanded |
|
|
116
|
+
| alert-icon | Icon for the alert overlay (used when `hasAlert` and `showAlertIcon` are true) |
|
|
117
|
+
| alert-label | Label text for the alert overlay (used when `hasAlert` is true) |
|
|
118
|
+
| alert-timer | Timer/duration text for the alert overlay (used when `hasAlert` is true) |
|
|
119
|
+
|
|
120
|
+
## CSS custom properties
|
|
121
|
+
|
|
122
|
+
| Property | Description |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| --obc-accordion-expand-duration | How long the panel takes to open and close. The chevron and the card's corners follow it. Ignored under `prefers-reduced-motion: reduce`. |
|
|
125
|
+
|
|
126
|
+
## Stories
|
|
127
|
+
|
|
128
|
+
- [Primary](https://openbridge-next-storybook.web.app/?path=/story/ui-components-sections-accordion-card--primary)
|
|
129
|
+
- [Single Line](https://openbridge-next-storybook.web.app/?path=/story/ui-components-sections-accordion-card--single-line)
|
|
130
|
+
- [Large](https://openbridge-next-storybook.web.app/?path=/story/ui-components-sections-accordion-card--large)
|
|
131
|
+
- [With Status](https://openbridge-next-storybook.web.app/?path=/story/ui-components-sections-accordion-card--with-status)
|
|
132
|
+
- [With Icon](https://openbridge-next-storybook.web.app/?path=/story/ui-components-sections-accordion-card--with-icon)
|
|
133
|
+
- [Expanded](https://openbridge-next-storybook.web.app/?path=/story/ui-components-sections-accordion-card--expanded)
|
|
134
|
+
- [With Custom Content](https://openbridge-next-storybook.web.app/?path=/story/ui-components-sections-accordion-card--with-custom-content)
|
|
135
|
+
- [With Alert](https://openbridge-next-storybook.web.app/?path=/story/ui-components-sections-accordion-card--with-alert)
|
|
136
|
+
- [Multiple](https://openbridge-next-storybook.web.app/?path=/story/ui-components-sections-accordion-card--multiple)
|
|
137
|
+
- [Disabled](https://openbridge-next-storybook.web.app/?path=/story/ui-components-sections-accordion-card--disabled)
|
|
138
|
+
|
|
139
|
+
## See also
|
|
140
|
+
|
|
141
|
+
- [Migration Guide](https://openbridge-next-storybook.web.app/docs/introduction-migration-guide.md)
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# `<obc-accordion-item>`
|
|
2
|
+
|
|
3
|
+
A collapsible section component for toggling the visibility of content panels (commonly known as an accordion item, expandable panel, or disclosure).
|
|
4
|
+
|
|
5
|
+
Lifecycle: stable. [Storybook](https://openbridge-next-storybook.web.app/?path=/docs/ui-components-sections-accordion-item--docs) · [Source](https://raw.githubusercontent.com/Ocean-Industries-Concept-Lab/openbridge-webcomponents/develop/packages/openbridge-webcomponents/src/components/accordion-item/accordion-item.ts)
|
|
6
|
+
|
|
7
|
+
`<obc-accordion-item>` – A collapsible section component for toggling the visibility of content panels (commonly known as an accordion item, expandable panel, or disclosure).
|
|
8
|
+
|
|
9
|
+
Provides a single expandable/collapsible section with a clickable header and an optional content area. Useful for organizing related information in a compact, vertically stacked layout, allowing users to reveal or hide details as needed.
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
- **Toggleable Expansion:** Click the header to expand or collapse the content area. The panel slides open and closed, and the chevron turns with it; `prefers-reduced-motion: reduce` switches instantly instead.
|
|
13
|
+
- **Disabled State:** Prevents user interaction and visually indicates non-interactivity.
|
|
14
|
+
- **Customizable Content:** Slot for custom expanded content (`expanded-content`), supporting any HTML or component.
|
|
15
|
+
- **Optional Divider:** Can display a divider line below the item for visual separation in lists.
|
|
16
|
+
- **Accessible:** Uses a button for the header with appropriate ARIA attributes for accessibility.
|
|
17
|
+
|
|
18
|
+
## Usage Guidelines
|
|
19
|
+
Use `obc-accordion-item` to organize content into expandable sections, such as FAQs, settings panels, or grouped lists. Ideal when you want to let users scan section titles and expand only those relevant to them. For multi-item accordions, stack several `obc-accordion-item` components vertically.
|
|
20
|
+
|
|
21
|
+
- Use the `title` property for the section label.
|
|
22
|
+
- Place any custom content (text, forms, components) in the `expanded-content` slot.
|
|
23
|
+
- Use the `disabled` property to prevent interaction for items that should not be toggled.
|
|
24
|
+
- Use the `showDivider` property to visually separate items in a list.
|
|
25
|
+
- If you need a persistent panel (not collapsible), use a different container component.
|
|
26
|
+
|
|
27
|
+
**TODO(designer):** Confirm if there are recommended patterns for managing open/close state in multi-item accordions (e.g., only one open at a time), or if this is left to the developer.
|
|
28
|
+
|
|
29
|
+
## Slots
|
|
30
|
+
| Slot Name | Renders When... | Purpose |
|
|
31
|
+
|-------------------|--------------------------|-------------------------------------------------|
|
|
32
|
+
| expanded-content | Always | Custom content revealed while the item is open |
|
|
33
|
+
|
|
34
|
+
## Events
|
|
35
|
+
- `accordion-item-toggle` – Fired when the item is toggled open or closed. Event detail: `{ open: boolean, title: string }`
|
|
36
|
+
|
|
37
|
+
## Best Practices
|
|
38
|
+
- Keep section titles concise for easy scanning.
|
|
39
|
+
- Avoid placing interactive controls in the header area to prevent accidental toggling.
|
|
40
|
+
- For accessibility, ensure each item’s title is unique within a group.
|
|
41
|
+
|
|
42
|
+
**Example:**
|
|
43
|
+
```
|
|
44
|
+
<obc-accordion-item title="Details" .open=${false}>
|
|
45
|
+
<div slot="expanded-content">
|
|
46
|
+
<p>Additional information goes here.</p>
|
|
47
|
+
</div>
|
|
48
|
+
</obc-accordion-item>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Properties
|
|
52
|
+
|
|
53
|
+
| Property | Attribute | Type | Default | Description |
|
|
54
|
+
| --- | --- | --- | --- | --- |
|
|
55
|
+
| title | title | `string` | `''` | The label displayed in the header of the accordion item. |
|
|
56
|
+
| open | open | `boolean` | `false` | Whether the item is expanded (shows the content area). Set to `true` to expand, `false` to collapse. |
|
|
57
|
+
| disabled | disabled | `boolean` | `false` | Disables the accordion item, preventing user interaction and dimming the appearance. |
|
|
58
|
+
| showDivider | showDivider | `boolean` | `false` | Displays a divider line below the item for visual separation. Useful when stacking multiple items in a list. |
|
|
59
|
+
|
|
60
|
+
## Events
|
|
61
|
+
|
|
62
|
+
| Event | Type | Description |
|
|
63
|
+
| --- | --- | --- |
|
|
64
|
+
| accordion-item-toggle | `CustomEvent<{open: boolean, title: string}>` | Fired when the item is toggled open or closed. |
|
|
65
|
+
|
|
66
|
+
## Slots
|
|
67
|
+
|
|
68
|
+
| Slot | Description |
|
|
69
|
+
| --- | --- |
|
|
70
|
+
| expanded-content | Content revealed while the item is open. |
|
|
71
|
+
|
|
72
|
+
## CSS custom properties
|
|
73
|
+
|
|
74
|
+
| Property | Description |
|
|
75
|
+
| --- | --- |
|
|
76
|
+
| --obc-accordion-expand-duration | How long the panel takes to open and close. The chevron and the header's corners follow it. Ignored under `prefers-reduced-motion: reduce`. |
|
|
77
|
+
|
|
78
|
+
## Stories
|
|
79
|
+
|
|
80
|
+
- [Primary](https://openbridge-next-storybook.web.app/?path=/story/ui-components-sections-accordion-item--primary)
|
|
81
|
+
- [Open](https://openbridge-next-storybook.web.app/?path=/story/ui-components-sections-accordion-item--open)
|
|
82
|
+
- [Disabled](https://openbridge-next-storybook.web.app/?path=/story/ui-components-sections-accordion-item--disabled)
|
|
83
|
+
- [Disabled Open](https://openbridge-next-storybook.web.app/?path=/story/ui-components-sections-accordion-item--disabled-open)
|
|
84
|
+
- [With Divider](https://openbridge-next-storybook.web.app/?path=/story/ui-components-sections-accordion-item--with-divider)
|
|
85
|
+
- [Custom Content](https://openbridge-next-storybook.web.app/?path=/story/ui-components-sections-accordion-item--custom-content)
|
|
86
|
+
- [Multiple](https://openbridge-next-storybook.web.app/?path=/story/ui-components-sections-accordion-item--multiple)
|
|
87
|
+
|
|
88
|
+
## See also
|
|
89
|
+
|
|
90
|
+
- [Migration Guide](https://openbridge-next-storybook.web.app/docs/introduction-migration-guide.md)
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# `<obc-advice-button>`
|
|
2
|
+
|
|
3
|
+
An icon button for surfacing advice, notifications, or contextual alerts, optionally with a counter badge.
|
|
4
|
+
|
|
5
|
+
Lifecycle: stable. [Storybook](https://openbridge-next-storybook.web.app/?path=/docs/application-components-notifications-advice-button--docs) · [Source](https://raw.githubusercontent.com/Ocean-Industries-Concept-Lab/openbridge-webcomponents/develop/packages/openbridge-webcomponents/src/components/advice-button/advice-button.ts)
|
|
6
|
+
|
|
7
|
+
`<obc-advice-button>` – An icon button for surfacing advice, notifications, or contextual alerts, optionally with a counter badge.
|
|
8
|
+
|
|
9
|
+
This component displays an advice or notification icon, with optional count badge and active state. It supports three visual styles (flat, normal, enhanced) and can be customized with a slot for a custom icon. The button toggles its active state on click and emits an event with the updated state and count.
|
|
10
|
+
|
|
11
|
+
Appears as a compact icon button, suitable for toolbars, notification areas, or anywhere a summary of advice/messages should be surfaced without interrupting the main workflow.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
- **Visual Styles:**
|
|
15
|
+
- `Flat` (default): Minimal, low-emphasis appearance.
|
|
16
|
+
- `Normal`: Standard, highlighted when active.
|
|
17
|
+
- `Enhanced`: Most prominent, with accent background and border when active.
|
|
18
|
+
- **Active State:**
|
|
19
|
+
- Indicates selection or focus; changes icon and style when `isActive` is true.
|
|
20
|
+
- **Advice Counter:**
|
|
21
|
+
- Optional badge showing the number of advice items (`count`), visible when `showCount` is true and style is `Normal` or `Enhanced`.
|
|
22
|
+
- **Custom Icon Support:**
|
|
23
|
+
- Replace the default icon by providing content in the `icon` slot.
|
|
24
|
+
- **Accessibility:**
|
|
25
|
+
- Configurable `aria-label` and `aria-pressed` for screen readers.
|
|
26
|
+
- **Event Emission:**
|
|
27
|
+
- Emits a custom `obc-click` event with the new state and count when clicked.
|
|
28
|
+
|
|
29
|
+
## Usage Guidelines
|
|
30
|
+
Use `<obc-advice-button>` to provide a compact, visually distinct entry point for advice, notifications, or contextual alerts. It is ideal for toolbars, notification panels, or as a summary indicator for advice/messages.
|
|
31
|
+
- Use the `count` and `showCount` properties to display the number of advice items or notifications.
|
|
32
|
+
- Choose the style (`buttonStyle`) based on the desired emphasis:
|
|
33
|
+
- Use `Flat` for low-priority or inactive states.
|
|
34
|
+
- Use `Normal` or `Enhanced` for active or high-priority states (set `isActive` to true for these styles to take effect).
|
|
35
|
+
- Replace the icon via the `icon` slot if a different symbol is needed.
|
|
36
|
+
- The button toggles its active state on click and notifies listeners via the `obc-click` event.
|
|
37
|
+
|
|
38
|
+
**TODO(designer):** Clarify recommended scenarios for using each style (Flat, Normal, Enhanced) and any specific guidance for when to show the counter.
|
|
39
|
+
|
|
40
|
+
## Slots
|
|
41
|
+
|
|
42
|
+
| Slot Name | Renders When... | Purpose |
|
|
43
|
+
|-----------|----------------|---------|
|
|
44
|
+
| `icon` | Always | Custom icon to replace the default advice/notification icon. |
|
|
45
|
+
|
|
46
|
+
## Events
|
|
47
|
+
- `obc-click` – Fired when the button is clicked. Event detail includes `{ count, isActive }` reflecting the new state.
|
|
48
|
+
|
|
49
|
+
## Example
|
|
50
|
+
```
|
|
51
|
+
<obc-advice-button
|
|
52
|
+
buttonStyle="normal"
|
|
53
|
+
count="3"
|
|
54
|
+
showCount
|
|
55
|
+
isActive
|
|
56
|
+
ariaLabel="Advice"
|
|
57
|
+
|
|
58
|
+
## Properties
|
|
59
|
+
|
|
60
|
+
| Property | Attribute | Type | Default | Description |
|
|
61
|
+
| --- | --- | --- | --- | --- |
|
|
62
|
+
| buttonStyle | buttonStyle | `AdviceButtonStyle` | `AdviceButtonStyle.Flat` | Visual style: `flat` (default) is minimal and low-emphasis, `normal` is standard and highlighted while active, `enhanced` is the most prominent with an accent background and border while active. Available when `isActive==true`. |
|
|
63
|
+
| count | count | `number` | `0` | Number of advice items or notifications to display in the badge. Only shown when `showCount` is true and style is `normal` or `enhanced`. |
|
|
64
|
+
| showCount | showCount | `boolean` | `false` | Whether to display the advice count badge. If false, the count is hidden even if `count` is set. Available when `isActive==true && buttonStyle in [Normal, Enhanced]`. |
|
|
65
|
+
| isActive | isActive | `boolean` | `false` | Whether the button is in the active/selected state. Changes the icon and style when true. |
|
|
66
|
+
| ariaLabel | ariaLabel | `string` | `'Advice'` | Accessibility label for the button. Used for screen readers via `aria-label`. |
|
|
67
|
+
|
|
68
|
+
## Events
|
|
69
|
+
|
|
70
|
+
| Event | Type | Description |
|
|
71
|
+
| --- | --- | --- |
|
|
72
|
+
| obc-click | `AdviceButtonClickEvent` | Fired when the button is clicked. |
|
|
73
|
+
|
|
74
|
+
## Slots
|
|
75
|
+
|
|
76
|
+
| Slot | Description |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| icon | Custom icon slot (replaces the default advice icon) |
|
|
79
|
+
|
|
80
|
+
## Stories
|
|
81
|
+
|
|
82
|
+
- [Advice Flat Inactive](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-button--advice-flat-inactive)
|
|
83
|
+
- [Advice Flat Active](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-button--advice-flat-active)
|
|
84
|
+
- [Advice Normal With Counter](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-button--advice-normal-with-counter)
|
|
85
|
+
- [Advice Normal Without Counter](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-button--advice-normal-without-counter)
|
|
86
|
+
- [Advice Enhanced With Counter](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-button--advice-enhanced-with-counter)
|
|
87
|
+
- [Advice Enhanced Without Counter](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-button--advice-enhanced-without-counter)
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# `<obc-advice-floating-item>`
|
|
2
|
+
|
|
3
|
+
A floating advice notification component for transient, context-sensitive messages.
|
|
4
|
+
|
|
5
|
+
Lifecycle: beta. [Storybook](https://openbridge-next-storybook.web.app/?path=/docs/application-components-notifications-advice-floating-item--docs) · [Source](https://raw.githubusercontent.com/Ocean-Industries-Concept-Lab/openbridge-webcomponents/develop/packages/openbridge-webcomponents/src/components/advice-floating-item/advice-floating-item.ts)
|
|
6
|
+
|
|
7
|
+
`<obc-advice-floating-item>` – A floating advice notification component for transient, context-sensitive messages.
|
|
8
|
+
|
|
9
|
+
Displays a brief advice or informational message that overlays the interface, typically used to provide non-blocking feedback, guidance, or status updates. This component is a specialized variant of a floating message (toast/snackbar) with a visual emphasis on advice or recommendations.
|
|
10
|
+
|
|
11
|
+
Appears temporarily above the UI and can include icons, timestamps, actions, and multi-line content. Designed for scenarios where users need timely, non-intrusive advice or suggestions without interrupting their workflow.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
- **Advice Notification Style:** Uses a distinct advice icon and color to visually differentiate advice messages from other notifications.
|
|
15
|
+
- **Variants (type):**
|
|
16
|
+
- `regular` (default): Standard advice message with a single advice icon.
|
|
17
|
+
- `application`: Enhanced advice message supporting an additional icon (e.g., to indicate application context or source).
|
|
18
|
+
- **Layout Directions:** Supports `horizontal` (side-by-side) or `vertical` (stacked) layouts to adapt to available space.
|
|
19
|
+
- **Line Type:** Choose between `singleLine` (compact, one-line message) or `multiLine` (for longer advice or descriptions).
|
|
20
|
+
- **Timestamp and Day Labels:** Optionally display a time and/or day label for context.
|
|
21
|
+
- **Action Buttons:** Supports up to two action buttons (primary and secondary) for user response or quick actions.
|
|
22
|
+
- **Slot-based Content:** Flexible content insertion for icons, title, description, time, day, and actions.
|
|
23
|
+
- **Automatic Icon Handling:** Advice icon is rendered automatically; developers can override or supplement with their own icons via slots.
|
|
24
|
+
|
|
25
|
+
## Usage Guidelines
|
|
26
|
+
Use `<obc-advice-floating-item>` to present brief, non-blocking advice, tips, or contextual guidance to users. Ideal for situations where you want to draw attention to a recommended action, best practice, or informational update without requiring immediate user intervention.
|
|
27
|
+
|
|
28
|
+
- Suitable for transient feedback, inline help, or system-generated suggestions.
|
|
29
|
+
- Not intended for critical alerts or persistent warnings—use a dialog or alert banner for those cases.
|
|
30
|
+
- For advice that requires user action, enable one or both action buttons.
|
|
31
|
+
- If the advice is related to a specific time or event, use the timestamp and day labels for clarity.
|
|
32
|
+
|
|
33
|
+
**TODO(designer):** Confirm if there are recommended durations for auto-dismiss, or if all advice messages require manual dismissal.
|
|
34
|
+
|
|
35
|
+
## Slots
|
|
36
|
+
| Slot Name | Renders When... | Purpose |
|
|
37
|
+
| -------------- | ------------------------------------ | ------------------------------------------------------------ |
|
|
38
|
+
| primary-icon | Only when `type="application"` | Custom main icon (the built-in advice icon is used otherwise). |
|
|
39
|
+
| title | Always | Title or heading of the advice message. |
|
|
40
|
+
| description | Always | Detailed advice or message text. |
|
|
41
|
+
| time | If `hasTimestamp` is true | Timestamp label (e.g., "09:12:46"). |
|
|
42
|
+
| day | If `hasTimestamp` and `hasDay` | Day label (e.g., "Yesterday"). |
|
|
43
|
+
| action | If `action` is true | Primary action button label/content. |
|
|
44
|
+
| action2 | If `action2` is true | Secondary action button label/content. |
|
|
45
|
+
|
|
46
|
+
## Events
|
|
47
|
+
- `action-click` – Fired when the primary action button is clicked.
|
|
48
|
+
- `action2-click` – Fired when the secondary action button is clicked.
|
|
49
|
+
- `dismiss-click` – Fired when the advice message is dismissed (e.g., close icon or auto-hide).
|
|
50
|
+
|
|
51
|
+
## Best Practices
|
|
52
|
+
- Use concise, actionable advice text to maximize clarity.
|
|
53
|
+
- Limit to one or two actions to avoid overwhelming the user.
|
|
54
|
+
- For longer advice, use the `multiLine` line type to improve readability.
|
|
55
|
+
- Only use the secondary action for supplementary or "undo" actions.
|
|
56
|
+
- Ensure advice messages do not overlap or stack excessively; only one should be visible at a time if possible.
|
|
57
|
+
|
|
58
|
+
## Example:
|
|
59
|
+
```html
|
|
60
|
+
<obc-advice-floating-item type="application" direction="vertical" hasTimestamp action>
|
|
61
|
+
<div slot="primary-icon"><obi-placeholder></obi-placeholder></div>
|
|
62
|
+
<span slot="title">Advice title</span>
|
|
63
|
+
<span slot="description">An advice message with meaningful content for the user.</span>
|
|
64
|
+
<span slot="time">09:12:46</span>
|
|
65
|
+
<span slot="action">Close</span>
|
|
66
|
+
</obc-advice-floating-item>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Properties
|
|
70
|
+
|
|
71
|
+
| Property | Attribute | Type | Default | Description |
|
|
72
|
+
| --- | --- | --- | --- | --- |
|
|
73
|
+
| type | type | | | Variant of the advice message: `regular` (default) shows a single advice icon, `application` adds a second application icon. |
|
|
74
|
+
| direction | direction | | | Layout direction: `horizontal` (default) puts content and icons side-by-side, `vertical` stacks them. |
|
|
75
|
+
| hasTimestamp | hasTimestamp | `boolean` | `false` | If true, displays a timestamp label (e.g., "09:12:46") in the advice message. Default: false. |
|
|
76
|
+
| hasDay | hasDay | `boolean` | `false` | If true (and `hasTimestamp` is also true), displays a day label (e.g., "Yesterday") in addition to the timestamp. Default: false. |
|
|
77
|
+
| action | action | `boolean` | `false` | If true, renders a primary action button in the advice message. Default: false. |
|
|
78
|
+
| action2 | action2 | `boolean` | `false` | If true, renders a secondary action button in the advice message. Note: The secondary action is only shown if the primary action (`action`) is also enabled. Default: false. |
|
|
79
|
+
| lineType | lineType | | | Content line type: `single-line` (default) is a compact one-line message, `multi-line` allows longer advice text to wrap. |
|
|
80
|
+
|
|
81
|
+
## Events
|
|
82
|
+
|
|
83
|
+
| Event | Type | Description |
|
|
84
|
+
| --- | --- | --- |
|
|
85
|
+
| action-click | `CustomEvent<void>` | When the primary action button is clicked. |
|
|
86
|
+
| action2-click | `CustomEvent<void>` | When the secondary action button is clicked. |
|
|
87
|
+
| dismiss-click | `CustomEvent<void>` | When the advice message is dismissed. |
|
|
88
|
+
|
|
89
|
+
## Slots
|
|
90
|
+
|
|
91
|
+
| Slot | Description |
|
|
92
|
+
| --- | --- |
|
|
93
|
+
| primary-icon | Custom main icon, projected into the child only when `type="application"` (the built-in advice icon is used otherwise). |
|
|
94
|
+
| title | Title or heading of the advice message. |
|
|
95
|
+
| description | Detailed advice or message text. |
|
|
96
|
+
| time | Timestamp label (e.g., "09:12:46"). |
|
|
97
|
+
| day | Day label (e.g., "Yesterday"). |
|
|
98
|
+
| action | Primary action button label/content. |
|
|
99
|
+
| action2 | Secondary action button label/content. |
|
|
100
|
+
|
|
101
|
+
## Stories
|
|
102
|
+
|
|
103
|
+
- [Advice Vertical Single Regular](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-floating-item--advice-vertical-single-regular)
|
|
104
|
+
- [Advice Vertical Multi Regular](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-floating-item--advice-vertical-multi-regular)
|
|
105
|
+
- [Advice Vertical Single Application](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-floating-item--advice-vertical-single-application)
|
|
106
|
+
- [Advice Vertical Multi Application](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-floating-item--advice-vertical-multi-application)
|
|
107
|
+
- [Advice Horizontal Single Regular](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-floating-item--advice-horizontal-single-regular)
|
|
108
|
+
- [Advice Horizontal Multi Regular](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-floating-item--advice-horizontal-multi-regular)
|
|
109
|
+
- [Advice Horizontal Single Application](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-floating-item--advice-horizontal-single-application)
|
|
110
|
+
- [Advice Horizontal Multi Application](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-floating-item--advice-horizontal-multi-application)
|
|
111
|
+
- [Advice All Props On](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-floating-item--advice-all-props-on)
|
|
112
|
+
- [Advice All Props Off](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-floating-item--advice-all-props-off)
|
|
113
|
+
- [Advice Long Message](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-floating-item--advice-long-message)
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# `<obc-advice-menu-item>`
|
|
2
|
+
|
|
3
|
+
An advice or recommendation list item with a distinctive green icon.
|
|
4
|
+
|
|
5
|
+
Lifecycle: beta. [Storybook](https://openbridge-next-storybook.web.app/?path=/docs/application-components-notifications-advice-menu-item--docs) · [Source](https://raw.githubusercontent.com/Ocean-Industries-Concept-Lab/openbridge-webcomponents/develop/packages/openbridge-webcomponents/src/components/advice-menu-item/advice-menu-item.ts)
|
|
6
|
+
|
|
7
|
+
`<obc-advice-menu-item>` – An advice or recommendation list item with a distinctive green icon.
|
|
8
|
+
|
|
9
|
+
Wraps `<obc-message-menu-item>` with a pre-configured advice icon (`obi-notification-advice-active`).
|
|
10
|
+
Displays a concise summary including title, description, timestamp, and action buttons.
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- **Advice Icon:** Displays the advice icon with starboard green color.
|
|
15
|
+
- **Secondary Icon Support:** Optional secondary icon via the `icon` slot.
|
|
16
|
+
- **Expandable:** Toggles open/closed on click to show additional details.
|
|
17
|
+
- **Action Buttons:** Supports primary and secondary action buttons.
|
|
18
|
+
- **Size Options:** Supports `single-line` or `double-line` layouts.
|
|
19
|
+
|
|
20
|
+
## Usage Guidelines
|
|
21
|
+
|
|
22
|
+
Use `obc-advice-menu-item` for advice or recommendation entries in a list.
|
|
23
|
+
|
|
24
|
+
- Use the `icon` slot for a secondary source/system icon if needed.
|
|
25
|
+
|
|
26
|
+
## Slots
|
|
27
|
+
|
|
28
|
+
| Slot Name | Renders When... | Purpose |
|
|
29
|
+
|-----------|----------------------|--------------------------------------|
|
|
30
|
+
| icon | `hasIcon` is true | Secondary icon (e.g., source/system) |
|
|
31
|
+
|
|
32
|
+
## Events
|
|
33
|
+
|
|
34
|
+
- `primary-action-click` – Fired when the primary action button is clicked.
|
|
35
|
+
- `secondary-action-click` – Fired when the secondary action button is clicked.
|
|
36
|
+
- `item-click` – Fired when the item is clicked. Detail includes `{ open: boolean }`.
|
|
37
|
+
|
|
38
|
+
## Example
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<obc-advice-menu-item
|
|
42
|
+
title="Route Optimization Available"
|
|
43
|
+
description="A more efficient route has been calculated."
|
|
44
|
+
time="14:30"
|
|
45
|
+
primaryActionLabel="Apply"
|
|
46
|
+
secondaryActionLabel="Dismiss"
|
|
47
|
+
hasIcon
|
|
48
|
+
>
|
|
49
|
+
<obi-placeholder slot="icon"></obi-placeholder>
|
|
50
|
+
</obc-advice-menu-item>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Properties
|
|
54
|
+
|
|
55
|
+
| Property | Attribute | Type | Default | Description |
|
|
56
|
+
| --- | --- | --- | --- | --- |
|
|
57
|
+
| hasIcon | hasIcon | `boolean` | `false` | When true, renders the `icon` slot for a secondary icon. |
|
|
58
|
+
| title | title | `string` | `''` | |
|
|
59
|
+
| description | description | `string` | `''` | |
|
|
60
|
+
| day | day | `string` | `''` | |
|
|
61
|
+
| time | time | `string` | `''` | |
|
|
62
|
+
| open | open | `boolean` | `false` | |
|
|
63
|
+
| size | size | `ObcMessageMenuItemSize` | | Layout size: `single-line` (default) or `double-line`. |
|
|
64
|
+
| primaryActionLabel | primaryActionLabel | `string` | `''` | |
|
|
65
|
+
| secondaryActionLabel | secondaryActionLabel | `string` | `''` | |
|
|
66
|
+
|
|
67
|
+
## Events
|
|
68
|
+
|
|
69
|
+
| Event | Type | Description |
|
|
70
|
+
| --- | --- | --- |
|
|
71
|
+
| item-click | `CustomEvent<{open: boolean}>` | Fired when the item is clicked. |
|
|
72
|
+
| primary-action-click | `CustomEvent<void>` | Fired when the primary action button is clicked. |
|
|
73
|
+
| secondary-action-click | `CustomEvent<void>` | Fired when the secondary action button is clicked. |
|
|
74
|
+
|
|
75
|
+
## Slots
|
|
76
|
+
|
|
77
|
+
| Slot | Description |
|
|
78
|
+
| --- | --- |
|
|
79
|
+
| icon | Secondary icon (shown when `hasIcon` is true). |
|
|
80
|
+
|
|
81
|
+
## Stories
|
|
82
|
+
|
|
83
|
+
- [Single Line](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-menu-item--single-line)
|
|
84
|
+
- [Double Line](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-menu-item--double-line)
|
|
85
|
+
- [Open](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-menu-item--open)
|
|
86
|
+
- [With One Action](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-menu-item--with-one-action)
|
|
87
|
+
- [No Actions](https://openbridge-next-storybook.web.app/?path=/story/application-components-notifications-advice-menu-item--no-actions)
|