@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,186 @@
|
|
|
1
|
+
# `<obc-textarea-field>`
|
|
2
|
+
|
|
3
|
+
A multi-line text input component with toolbar, voice recording, and attachments for composing messages or notes.
|
|
4
|
+
|
|
5
|
+
Lifecycle: stable. [Storybook](https://openbridge-next-storybook.web.app/?path=/docs/ui-components-input-controls-textarea-field--docs) · [Source](https://raw.githubusercontent.com/Ocean-Industries-Concept-Lab/openbridge-webcomponents/develop/packages/openbridge-webcomponents/src/components/textarea-field/textarea-field.ts)
|
|
6
|
+
|
|
7
|
+
`<obc-textarea-field>` – A multi-line text input component with toolbar, voice recording, and attachments for composing messages or notes.
|
|
8
|
+
|
|
9
|
+
Provides a flexible textarea for composing extended text content, with optional toolbar actions (screenshot, image, attachment), voice recording UI, file attachment chips, and form features like labels and validation. Use the `type` property to switch between rich text mode (for forms/notes) and message mode (for chat-style messaging with a send button).
|
|
10
|
+
|
|
11
|
+
## Features
|
|
12
|
+
|
|
13
|
+
- **Field types:**
|
|
14
|
+
- `rich` (default): Multi-line input without a send button, suitable for forms or note-taking.
|
|
15
|
+
- `message`: Includes a send button for chat-style messaging interfaces.
|
|
16
|
+
- **Toolbar actions:**
|
|
17
|
+
- Add (+): Generic action for adding content.
|
|
18
|
+
- Screenshot: Capture and attach a screenshot.
|
|
19
|
+
- Image: Attach an image file.
|
|
20
|
+
- Attachment: Attach any file type.
|
|
21
|
+
- Toolbar visibility is controlled by `showToolbar`.
|
|
22
|
+
- **Voice recording:**
|
|
23
|
+
- Microphone button to start voice recording (UI only—parent handles audio capture).
|
|
24
|
+
- Displays `<obc-audio-recording-item>` waveform during recording.
|
|
25
|
+
- Different controls for Rich vs Message types (see Voice Recording Flow below).
|
|
26
|
+
- Visibility is controlled by `showVoiceRecording`.
|
|
27
|
+
- **Attachments:**
|
|
28
|
+
- Display file attachments as removable chips below the input.
|
|
29
|
+
- Each chip can be removed, firing `attachment-remove`.
|
|
30
|
+
- **Form features:**
|
|
31
|
+
- Optional label with required indicator.
|
|
32
|
+
- Error state with error message display.
|
|
33
|
+
- Disabled state prevents all interaction.
|
|
34
|
+
- Optional leading icon slot.
|
|
35
|
+
- **Keyboard support:**
|
|
36
|
+
- Ctrl/Cmd + Enter sends the message (Message type only).
|
|
37
|
+
|
|
38
|
+
## Voice Recording Flow
|
|
39
|
+
|
|
40
|
+
The component provides UI for voice recording but does NOT handle actual audio capture.
|
|
41
|
+
The parent application is responsible for managing the recording state, audio levels, and duration.
|
|
42
|
+
|
|
43
|
+
**Recording status states:**
|
|
44
|
+
- `recording`: Active recording with live waveform visualization.
|
|
45
|
+
- `playback`: Recording is paused/stopped and user can preview the recorded audio with a slider and play/pause button.
|
|
46
|
+
Use this state when the user pauses recording to allow them to review before confirming/sending.
|
|
47
|
+
|
|
48
|
+
**Rich type recording controls:**
|
|
49
|
+
- Cancel (X): Fires `voice-action` with `action: 'cancel'` — parent should set `recording=false`.
|
|
50
|
+
- Pause/Mic: Fires `voice-action` with `action: 'pause'` or `action: 'resume'`.
|
|
51
|
+
- Confirm (checkmark): Fires `voice-action` with `action: 'confirm'` — parent should transcribe and append to `value`.
|
|
52
|
+
|
|
53
|
+
**Message type recording controls:**
|
|
54
|
+
- Delete (trash): Fires `voice-action` with `action: 'delete'` — parent should set `recording=false`.
|
|
55
|
+
- Transcribe button: Fires `voice-action` with `action: 'transcribe'` — parent should convert audio to text.
|
|
56
|
+
- Pause/Mic: Fires `voice-action` with `action: 'pause'` or `action: 'resume'`.
|
|
57
|
+
- Send: Fires `voice-action` with `action: 'send'` — parent should send as voice message.
|
|
58
|
+
|
|
59
|
+
**Playback mode:**
|
|
60
|
+
When `recordingStatus="playback"`, the component shows a progress slider instead of the waveform.
|
|
61
|
+
The parent should update `playbackPosition` (0-1) as audio plays and handle `voice-action`
|
|
62
|
+
with `action: 'playback-toggle'` and `playing: boolean` to control playback.
|
|
63
|
+
|
|
64
|
+
## Usage Guidelines
|
|
65
|
+
|
|
66
|
+
Use `<obc-textarea-field>` for composing messages, notes, or any multi-line text input that benefits from media attachments or voice recording. Choose `type="message"` for chat interfaces where users expect a send button, or `type="rich"` for forms and note-taking where submission is handled separately.
|
|
67
|
+
|
|
68
|
+
For voice recording, the parent application must:
|
|
69
|
+
1. Listen for `voice-action` with `action: 'start'` and begin audio capture.
|
|
70
|
+
2. Set `recording=true` and update `audioLevels` and `recordingDuration` as recording progresses.
|
|
71
|
+
3. Handle other `voice-action` events (pause/resume/cancel/confirm/send/transcribe) appropriately.
|
|
72
|
+
4. For playback preview, set `recordingStatus="playback"` and update `playbackPosition`.
|
|
73
|
+
5. Handle `voice-action` with `action: 'playback-toggle'` and use `event.detail.playing` to control audio playback.
|
|
74
|
+
6. Set `recording=false` when recording ends (the component automatically resets `recordingStatus` and `playbackPosition`).
|
|
75
|
+
|
|
76
|
+
**Keywords:** textarea, text input, message composer, chat input, voice message, file attachment, multi-line input, form field
|
|
77
|
+
|
|
78
|
+
## Slots
|
|
79
|
+
|
|
80
|
+
| Name | Rendered when… | Purpose |
|
|
81
|
+
| -------------- | ---------------------- | --------------------------------------------- |
|
|
82
|
+
| `leading-icon` | `hasLeadingIcon=true` | Displays a contextual icon before the input. |
|
|
83
|
+
|
|
84
|
+
## Events
|
|
85
|
+
- `input` – Fired when the textarea value changes.
|
|
86
|
+
- `change` – Fired when the textarea value changes and loses focus (blur).
|
|
87
|
+
- `blur` – Fired when the textarea loses focus (blur).
|
|
88
|
+
- `send-click` – Fired when the send button is clicked (Message type only), with the current value.
|
|
89
|
+
- `add-click` – Fired when the add (+) button is clicked.
|
|
90
|
+
- `screenshot-click` – Fired when the screenshot button is clicked.
|
|
91
|
+
- `image-click` – Fired when the image button is clicked.
|
|
92
|
+
- `attachment-click` – Fired when the attachment button is clicked.
|
|
93
|
+
- `voice-action` – Fired for all voice recording actions. The `detail.action` specifies the action type:
|
|
94
|
+
- `start`: Microphone button clicked to start recording.
|
|
95
|
+
- `cancel`: Cancel (X) clicked during recording (Rich type).
|
|
96
|
+
- `confirm`: Confirm (checkmark) clicked after recording (Rich type).
|
|
97
|
+
- `delete`: Delete (trash) clicked during recording (Message type).
|
|
98
|
+
- `pause`: Pause clicked during recording.
|
|
99
|
+
- `resume`: Resume/mic clicked to continue recording.
|
|
100
|
+
- `transcribe`: Transcribe clicked (Message type).
|
|
101
|
+
- `send`: Send clicked during recording (Message type).
|
|
102
|
+
- `playback-toggle`: Play/pause toggled on recorded audio preview. Includes `detail.playing` boolean.
|
|
103
|
+
- `attachment-remove` – Fired when an attachment chip's remove button is clicked.
|
|
104
|
+
|
|
105
|
+
## Example
|
|
106
|
+
|
|
107
|
+
```html
|
|
108
|
+
<obc-textarea-field
|
|
109
|
+
type="message"
|
|
110
|
+
label="Message"
|
|
111
|
+
placeholder="Type a message..."
|
|
112
|
+
.attachments=${[{id: '1', label: 'document.pdf', showIcon: true}]}
|
|
113
|
+
hasLeadingIcon
|
|
114
|
+
|
|
115
|
+
## Properties
|
|
116
|
+
|
|
117
|
+
| Property | Attribute | Type | Default | Description |
|
|
118
|
+
| --- | --- | --- | --- | --- |
|
|
119
|
+
| type | type | `TextareaFieldType` | | Field type: 'rich' (no send button) or 'message' (with send button). |
|
|
120
|
+
| value | value | `string` | `''` | The current text value of the input field. |
|
|
121
|
+
| rejectUpdatesOnFocus | rejectUpdatesOnFocus | `boolean` | `false` | If true, the textarea will not update its value from external changes while focused. |
|
|
122
|
+
| rejectUpdates | rejectUpdates | `boolean` | `false` | If true, the value will only be initially set from the external model and not updated on subsequent changes. |
|
|
123
|
+
| rejectDuplicateUpdates | rejectDuplicateUpdates | `boolean` | `false` | If true, the textarea will not update its value if the value is the same as the previous value. Useful to avoid React re-rendering resetting the value. |
|
|
124
|
+
| placeholder | placeholder | `string` | `''` | Placeholder text shown when the input is empty. |
|
|
125
|
+
| label | label | `string` | `''` | Label text displayed above the input field. |
|
|
126
|
+
| errorText | errorText | `string` | `''` | Error text displayed below the field when `error` is true. Available when `error==true`. |
|
|
127
|
+
| maxlength | maxlength | `number \| undefined` | | Maximum number of characters allowed in the textarea. |
|
|
128
|
+
| disabled | disabled | `boolean` | `false` | Disables the input field and all actions. |
|
|
129
|
+
| error | error | `boolean` | `false` | Shows error state with visual highlight. |
|
|
130
|
+
| required | required | `boolean` | `false` | Shows a required indicator next to the label. |
|
|
131
|
+
| showLabel | | `boolean` | `true` | Shows the label above the input field. |
|
|
132
|
+
| showToolbar | | `boolean` | `true` | Shows the toolbar with action buttons. |
|
|
133
|
+
| showVoiceRecording | | `boolean` | `true` | Shows the voice recording button. |
|
|
134
|
+
| hasLeadingIcon | hasLeadingIcon | `boolean` | `false` | Shows a leading icon before the input field. |
|
|
135
|
+
| recording | recording | `boolean` | `false` | Whether voice recording is currently active. When true, shows the audio-recording-item instead of textarea. |
|
|
136
|
+
| recordingDuration | recordingDuration | `number` | `0` | Current recording duration in seconds. Available when `recording==true`. |
|
|
137
|
+
| audioLevels | audioLevels | `number[]` | `[]` | Array of audio level values (0-1) for waveform visualization. New values should be added to the end (right side) and old values shift left. Available when `recording==true`. |
|
|
138
|
+
| recordingStatus | recordingStatus | `AudioRecordingStatus` | | Recording status passed to audio-recording-item. Use 'recording' during active recording, and 'playback' when paused to allow the user to preview the recorded audio with a slider. Automatically reset to 'recording' when `recording` becomes false. Available when `recording==true`. |
|
|
139
|
+
| playbackPosition | playbackPosition | `number` | `0` | Current playback position (0-1) for playback mode. Only relevant when recordingStatus is 'playback'. Available when `recording==true`. |
|
|
140
|
+
| attachments | attachments | `Attachment[]` | `[]` | Array of file attachments displayed as removable chips. |
|
|
141
|
+
|
|
142
|
+
## Events
|
|
143
|
+
|
|
144
|
+
| Event | Type | Description |
|
|
145
|
+
| --- | --- | --- |
|
|
146
|
+
| eventName | `CustomEvent` | |
|
|
147
|
+
| input | `CustomEvent<{value: string}>` | Fired on input when value changes. |
|
|
148
|
+
| change | `CustomEvent<{value: string}>` | Fired on change when value has changed. |
|
|
149
|
+
| blur | `CustomEvent<void>` | Fired on blur. |
|
|
150
|
+
| send-click | `CustomEvent<{value: string}>` | Fired when the send button is clicked (Message type only). |
|
|
151
|
+
| add-click | `CustomEvent<void>` | Fired when the add (+) button is clicked. |
|
|
152
|
+
| screenshot-click | `CustomEvent<void>` | Fired when the screenshot button is clicked. |
|
|
153
|
+
| image-click | `CustomEvent<void>` | Fired when the image button is clicked. |
|
|
154
|
+
| attachment-click | `CustomEvent<void>` | Fired when the attachment button is clicked. |
|
|
155
|
+
| voice-action | `CustomEvent<VoiceActionDetail>` | Fired for all voice recording actions. Check detail.action for the action type. |
|
|
156
|
+
| attachment-remove | `CustomEvent<{id: string}>` | Fired when an attachment chip is removed. |
|
|
157
|
+
|
|
158
|
+
## Slots
|
|
159
|
+
|
|
160
|
+
| Slot | Description |
|
|
161
|
+
| --- | --- |
|
|
162
|
+
| leading-icon | Displays a contextual icon before the input when `hasLeadingIcon` is true. |
|
|
163
|
+
|
|
164
|
+
## Stories
|
|
165
|
+
|
|
166
|
+
- [Default](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--default)
|
|
167
|
+
- [Empty](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--empty)
|
|
168
|
+
- [Filled](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--filled)
|
|
169
|
+
- [With Label](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--with-label)
|
|
170
|
+
- [With Label Required](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--with-label-required)
|
|
171
|
+
- [With Toolbar](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--with-toolbar)
|
|
172
|
+
- [Error State](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--error-state)
|
|
173
|
+
- [Disabled](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--disabled)
|
|
174
|
+
- [Recording](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--recording)
|
|
175
|
+
- [Recording Paused](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--recording-paused)
|
|
176
|
+
- [Message Default](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--message-default)
|
|
177
|
+
- [Message Empty](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--message-empty)
|
|
178
|
+
- [Message Filled](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--message-filled)
|
|
179
|
+
- [Message With Label](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--message-with-label)
|
|
180
|
+
- [Message Error](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--message-error)
|
|
181
|
+
- [Message Disabled](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--message-disabled)
|
|
182
|
+
- [Message With Attachments](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--message-with-attachments)
|
|
183
|
+
- [Message Recording](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--message-recording)
|
|
184
|
+
- [Message Recording Paused](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--message-recording-paused)
|
|
185
|
+
- [Interactive Demo Message](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--interactive-demo-message)
|
|
186
|
+
- [Interactive Demo Rich](https://openbridge-next-storybook.web.app/?path=/story/ui-components-input-controls-textarea-field--interactive-demo-rich)
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# `<obc-textbox>`
|
|
2
|
+
|
|
3
|
+
A text container that renders inline text at a precise, cap-height-trimmed size with configurable alignment and reservable width.
|
|
4
|
+
|
|
5
|
+
Lifecycle: stable. [Storybook](https://openbridge-next-storybook.web.app/?path=/docs/building-blocks-textbox--docs) · [Source](https://raw.githubusercontent.com/Ocean-Industries-Concept-Lab/openbridge-webcomponents/develop/packages/openbridge-webcomponents/src/components/textbox/textbox.ts)
|
|
6
|
+
|
|
7
|
+
`<obc-textbox>` – A text container that renders inline text at a
|
|
8
|
+
precise, cap-height-trimmed size with configurable alignment and reservable
|
|
9
|
+
width.
|
|
10
|
+
|
|
11
|
+
Use it to present short, read-only strings – such as values, labels, or
|
|
12
|
+
units – where vertical metrics must line up exactly across rows and the
|
|
13
|
+
horizontal footprint should stay stable while the text changes (for example
|
|
14
|
+
a numeric value that updates frequently). Synonyms: text container, value
|
|
15
|
+
box, label box.
|
|
16
|
+
|
|
17
|
+
## Features / Variants
|
|
18
|
+
- **Size:** `xs`, `s`, `m` (default), `l`, `xl` – each maps to a fixed box
|
|
19
|
+
height (16 / 20 / 24 / 32 / 40 px) with 4px padding above and below, giving
|
|
20
|
+
cap heights of 8 / 12 / 16 / 24 / 32 px so text aligns to a predictable
|
|
21
|
+
grid.
|
|
22
|
+
- **Font weight:** `regular` (default), `semibold`, `bold`.
|
|
23
|
+
- **Tabular numbers:** `tabularNums` (default off) renders digits as
|
|
24
|
+
fixed-width, lining numerals (`tabular-nums lining-nums` + the `ss04`/`tnum`/
|
|
25
|
+
`lnum` features) so numeric values stay column-aligned and stable in width
|
|
26
|
+
as they update – use it for readouts and other live numeric displays.
|
|
27
|
+
- **Alignment:** `left`, `center`, `right` (default) – positions the text
|
|
28
|
+
within the box's width when the box is wider than the content.
|
|
29
|
+
- **Reserved width:** content placed in the `length` slot reserves a minimum
|
|
30
|
+
width invisibly, so the box does not resize as the visible text changes.
|
|
31
|
+
The box always shows all content – it never crops.
|
|
32
|
+
- **Cap-to-baseline frame:** the box spans the cap top to the baseline plus
|
|
33
|
+
the padding; descenders and diacritics paint past its edges, so an
|
|
34
|
+
ancestor that clips must leave room for them.
|
|
35
|
+
|
|
36
|
+
## Usage Guidelines
|
|
37
|
+
- Pass the longest expected string to the `length` slot (e.g. `"888.8"` or
|
|
38
|
+
`"Wind speed"`) so the box reserves space and does not jump in width as the
|
|
39
|
+
visible value updates.
|
|
40
|
+
- This is a display primitive for static text – use an input component for
|
|
41
|
+
editable values.
|
|
42
|
+
|
|
43
|
+
## Slots
|
|
44
|
+
| Slot | Renders when… | Purpose |
|
|
45
|
+
|-----------|--------------------|------------------------------------------------------|
|
|
46
|
+
| (default) | Always | The visible text content. |
|
|
47
|
+
| `length` | Always (invisible) | Reserves a minimum width based on its content width. |
|
|
48
|
+
|
|
49
|
+
## Properties
|
|
50
|
+
|
|
51
|
+
| Property | Attribute | Type | Default | Description |
|
|
52
|
+
| --- | --- | --- | --- | --- |
|
|
53
|
+
| alignment | alignment | `ObcTextboxAlignment` | | |
|
|
54
|
+
| size | size | `ObcTextboxSize` | | |
|
|
55
|
+
| fontWeight | fontWeight | `ObcTextboxFontWeight` | | |
|
|
56
|
+
| tabularNums | tabularNums | `boolean` | `false` | |
|
|
57
|
+
|
|
58
|
+
## Events
|
|
59
|
+
|
|
60
|
+
None.
|
|
61
|
+
|
|
62
|
+
## Slots
|
|
63
|
+
|
|
64
|
+
| Slot | Description |
|
|
65
|
+
| --- | --- |
|
|
66
|
+
| (default) | The visible text content. |
|
|
67
|
+
| length | Reserves a minimum width based on its content width. |
|
|
68
|
+
|
|
69
|
+
## Stories
|
|
70
|
+
|
|
71
|
+
- [Default](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-textbox--default)
|
|
72
|
+
- [Sizes](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-textbox--sizes)
|
|
73
|
+
- [Font Weights](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-textbox--font-weights)
|
|
74
|
+
- [Alignments](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-textbox--alignments)
|
|
75
|
+
- [Reserve Space](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-textbox--reserve-space)
|
|
76
|
+
- [Descenders And Diacritics](https://openbridge-next-storybook.web.app/?path=/story/building-blocks-textbox--descenders-and-diacritics): The box is a cap-to-baseline frame, not a clip: descenders (g, j, p) and diacritics (Å) paint past its edges at every size. An ancestor that clips must leave room for them.
|
|
77
|
+
|
|
78
|
+
## See also
|
|
79
|
+
|
|
80
|
+
- [Migration Guide 2.0 to 2.1](https://openbridge-next-storybook.web.app/docs/introduction-migration-guide-2-0-to-2-1.md)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# `<obc-three-way-line>`
|
|
2
|
+
|
|
3
|
+
No summary yet.
|
|
4
|
+
|
|
5
|
+
Lifecycle: deprecated. [Storybook](https://openbridge-next-storybook.web.app/?path=/docs/automation-line-three-way-line--docs) · [Source](https://raw.githubusercontent.com/Ocean-Industries-Concept-Lab/openbridge-webcomponents/develop/packages/openbridge-webcomponents/src/automation/three-way-line/three-way-line.ts)
|
|
6
|
+
|
|
7
|
+
## Properties
|
|
8
|
+
|
|
9
|
+
| Property | Attribute | Type | Default | Description |
|
|
10
|
+
| --- | --- | --- | --- | --- |
|
|
11
|
+
| medium | medium | `LineMedium` | | |
|
|
12
|
+
| direction | direction | `ThreeWayLineDirection` | | |
|
|
13
|
+
| lineType | lineType | `LineType` | | |
|
|
14
|
+
|
|
15
|
+
## Events
|
|
16
|
+
|
|
17
|
+
None.
|
|
18
|
+
|
|
19
|
+
## Slots
|
|
20
|
+
|
|
21
|
+
None.
|
|
22
|
+
|
|
23
|
+
## Stories
|
|
24
|
+
|
|
25
|
+
- [Primary](https://openbridge-next-storybook.web.app/?path=/story/automation-line-three-way-line--primary)
|
|
26
|
+
|
|
27
|
+
## See also
|
|
28
|
+
|
|
29
|
+
- [Migration Guide](https://openbridge-next-storybook.web.app/docs/introduction-migration-guide.md)
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# `<obc-thruster>`
|
|
2
|
+
|
|
3
|
+
No summary yet.
|
|
4
|
+
|
|
5
|
+
Lifecycle: stable. [Storybook](https://openbridge-next-storybook.web.app/?path=/docs/instruments-thruster--docs) · [Source](https://raw.githubusercontent.com/Ocean-Industries-Concept-Lab/openbridge-webcomponents/develop/packages/openbridge-webcomponents/src/navigation-instruments/thruster/thruster.ts)
|
|
6
|
+
|
|
7
|
+
## Properties
|
|
8
|
+
|
|
9
|
+
| Property | Attribute | Type | Default | Description |
|
|
10
|
+
| --- | --- | --- | --- | --- |
|
|
11
|
+
| thrust | thrust | `number` | `0` | The thrust of the thruster in percent (-100 - +100) |
|
|
12
|
+
| state | state | `InstrumentState` | | |
|
|
13
|
+
| priority | priority | `Priority` | | Color priority: `Priority.enhanced` uses the blue/enhanced color palette, `Priority.regular` (default) uses the standard palette. |
|
|
14
|
+
| tunnel | tunnel | `boolean` | `false` | |
|
|
15
|
+
| singleSided | singleSided | `boolean` | `false` | |
|
|
16
|
+
| singleDirection | singleDirection | `boolean` | `false` | |
|
|
17
|
+
| singleDirectionHalfSize | singleDirectionHalfSize | `boolean` | `false` | |
|
|
18
|
+
| topPropeller | topPropeller | `PropellerType` | | |
|
|
19
|
+
| bottomPropeller | bottomPropeller | `PropellerType` | | |
|
|
20
|
+
| touching | touching | `boolean` | `false` | Highlight the thruster when the lever is being touched |
|
|
21
|
+
| advices | advices | `AdviceInput[]` | `[]` | Advice ranges and points in the instrument's unit; see `svghelpers/advice.ts`. |
|
|
22
|
+
| adviceTrigger | adviceTrigger | `AdviceTrigger` | | Which readings trigger an advice: the value, the setpoint, or either. Available when `adviceTrigger advices!=[]`. |
|
|
23
|
+
| adviceEmphasis | adviceEmphasis | `boolean` | `false` | The design's go-to / no-go emphasis rules. Available when `adviceEmphasis advices!=[]`. |
|
|
24
|
+
| setpoint | setpoint | `number \| undefined` | | Target setpoint value. `undefined` = no setpoint marker shown. |
|
|
25
|
+
| newSetpoint | newSetpoint | `number \| undefined` | | Adjustment preview for 2-step interface. When defined, two markers are shown: original (dimmed) + new (focus). Available when `setpoint!=undefined`. |
|
|
26
|
+
| atSetpoint | | `boolean` | `false` | Manual at-setpoint override (used when `autoAtSetpoint` is false). Available when `setpoint!=undefined && autoAtSetpoint==false`. |
|
|
27
|
+
| autoAtSetpoint | | `boolean` | `true` | When false, uses manual `atSetpoint` boolean instead of auto-calculation. Available when `setpoint!=undefined`. |
|
|
28
|
+
| autoAtSetpointDeadband | autoAtSetpointDeadband | `number` | `defaultDeadband` | Tolerance for auto at-setpoint detection. Available when `setpoint!=undefined && autoAtSetpoint==true`. |
|
|
29
|
+
| setpointAtZeroDeadband | setpointAtZeroDeadband | `number` | `defaultZeroDeadband` | Tolerance for zero-snap visual state. Available when `setpoint!=undefined`. |
|
|
30
|
+
| setpointOverride | setpointOverride | `boolean` | `false` | Override to derive the setpoint color from the instrument's `priority` regardless of instrument state. Available when `setpoint!=undefined`. |
|
|
31
|
+
| animateSetpoint | animateSetpoint | `boolean` | `false` | Enable CSS-animated confirm transition. Available when `setpoint!=undefined`. |
|
|
32
|
+
| departingNewSetpoint | | `number \| undefined` | | Public getter for renderers/wrappers to access the departing value. |
|
|
33
|
+
|
|
34
|
+
## Events
|
|
35
|
+
|
|
36
|
+
None.
|
|
37
|
+
|
|
38
|
+
## Slots
|
|
39
|
+
|
|
40
|
+
None.
|
|
41
|
+
|
|
42
|
+
## Stories
|
|
43
|
+
|
|
44
|
+
- [In Command](https://openbridge-next-storybook.web.app/?path=/story/instruments-thruster--in-command)
|
|
45
|
+
- [Single Sided](https://openbridge-next-storybook.web.app/?path=/story/instruments-thruster--single-sided)
|
|
46
|
+
- [Pulling Pod](https://openbridge-next-storybook.web.app/?path=/story/instruments-thruster--pulling-pod)
|
|
47
|
+
- [Pushing Pod](https://openbridge-next-storybook.web.app/?path=/story/instruments-thruster--pushing-pod)
|
|
48
|
+
- [Single Sided With Advice](https://openbridge-next-storybook.web.app/?path=/story/instruments-thruster--single-sided-with-advice)
|
|
49
|
+
- [Single Direction](https://openbridge-next-storybook.web.app/?path=/story/instruments-thruster--single-direction)
|
|
50
|
+
- [Single Direction Single Sided With Advice](https://openbridge-next-storybook.web.app/?path=/story/instruments-thruster--single-direction-single-sided-with-advice)
|
|
51
|
+
- [No Setpoint](https://openbridge-next-storybook.web.app/?path=/story/instruments-thruster--no-setpoint): Set setpoint to undefined to hide the setpoint
|
|
52
|
+
- [Tunnel](https://openbridge-next-storybook.web.app/?path=/story/instruments-thruster--tunnel)
|
|
53
|
+
- [Tunnel Single Sided](https://openbridge-next-storybook.web.app/?path=/story/instruments-thruster--tunnel-single-sided)
|
|
54
|
+
- [In Command At Setpoint](https://openbridge-next-storybook.web.app/?path=/story/instruments-thruster--in-command-at-setpoint)
|
|
55
|
+
- [In Command Touching](https://openbridge-next-storybook.web.app/?path=/story/instruments-thruster--in-command-touching): Mode is used to highlight that the controller (lever) is being touched by the operator This is used to make it easy for the operator to see which thruster is connected to the controller.
|
|
56
|
+
- [In Command At Setpoint Manual](https://openbridge-next-storybook.web.app/?path=/story/instruments-thruster--in-command-at-setpoint-manual)
|
|
57
|
+
- [Not In Command](https://openbridge-next-storybook.web.app/?path=/story/instruments-thruster--not-in-command)
|
|
58
|
+
- [Not In Command At Setpoint](https://openbridge-next-storybook.web.app/?path=/story/instruments-thruster--not-in-command-at-setpoint)
|
|
59
|
+
- [Loading](https://openbridge-next-storybook.web.app/?path=/story/instruments-thruster--loading)
|
|
60
|
+
- [Off](https://openbridge-next-storybook.web.app/?path=/story/instruments-thruster--off)
|
|
61
|
+
|
|
62
|
+
## See also
|
|
63
|
+
|
|
64
|
+
- [Advice System](https://openbridge-next-storybook.web.app/docs/introduction-advice-system.md)
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# `<obc-title-container>`
|
|
2
|
+
|
|
3
|
+
renders the header row for form sections.
|
|
4
|
+
|
|
5
|
+
Lifecycle: beta. [Storybook](https://openbridge-next-storybook.web.app/?path=/story/ui-components-forms-title-container--playground) · [Source](https://raw.githubusercontent.com/Ocean-Industries-Concept-Lab/openbridge-webcomponents/develop/packages/openbridge-webcomponents/src/components/title-container/title-container.ts)
|
|
6
|
+
|
|
7
|
+
`<obc-title-container>` renders the header row for form sections.
|
|
8
|
+
|
|
9
|
+
**Overview**
|
|
10
|
+
Use this component as a title bar, header row, heading strip, or toolbar-like
|
|
11
|
+
top section in form containers.
|
|
12
|
+
|
|
13
|
+
**Features / Variants**
|
|
14
|
+
- Visual state via `state`: `enabled` or `inactive`.
|
|
15
|
+
- Title fallback via `titleValue` when the `title` slot is empty.
|
|
16
|
+
- Label fallback via `label` when the `label` slot is empty.
|
|
17
|
+
- Arbitrary slotted actions in `actions` slot with indexed click events.
|
|
18
|
+
|
|
19
|
+
**Usage Guidelines**
|
|
20
|
+
- Provide text through slots when possible for maximum composition control.
|
|
21
|
+
- Use `state="inactive"` to visually mute text and actions.
|
|
22
|
+
- Pass one or more `obc-icon-button` elements in `actions` for custom
|
|
23
|
+
command sets.
|
|
24
|
+
|
|
25
|
+
**Slots / Content**
|
|
26
|
+
- `icon`: leading icon content.
|
|
27
|
+
- `title`: main heading text.
|
|
28
|
+
- `label`: secondary heading label text.
|
|
29
|
+
- `actions`: one or more action elements (typically `obc-icon-button`).
|
|
30
|
+
|
|
31
|
+
**Events**
|
|
32
|
+
- Emits `action-click` with 1-based `action` index based on the slotted
|
|
33
|
+
action order.
|
|
34
|
+
|
|
35
|
+
**Best Practices**
|
|
36
|
+
- Keep actions deterministic to preserve stable event indexing.
|
|
37
|
+
- Keep title and label concise to avoid truncation in narrow layouts.
|
|
38
|
+
- Use this component as a header boundary and keep business logic in parent
|
|
39
|
+
containers.
|
|
40
|
+
|
|
41
|
+
**Example**
|
|
42
|
+
```html
|
|
43
|
+
<obc-title-container state="enabled" title-value="Title" label="Label">
|
|
44
|
+
<obi-placeholder slot="icon"></obi-placeholder>
|
|
45
|
+
<obc-icon-button slot="actions" variant="flat" aria-label="Action 1">
|
|
46
|
+
<obi-placeholder></obi-placeholder>
|
|
47
|
+
</obc-icon-button>
|
|
48
|
+
<obc-icon-button slot="actions" variant="flat" aria-label="Action 2">
|
|
49
|
+
<obi-placeholder></obi-placeholder>
|
|
50
|
+
</obc-icon-button>
|
|
51
|
+
</obc-title-container>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Properties
|
|
55
|
+
|
|
56
|
+
| Property | Attribute | Type | Default | Description |
|
|
57
|
+
| --- | --- | --- | --- | --- |
|
|
58
|
+
| state | state | `ObcTitleContainerState` | | |
|
|
59
|
+
| titleValue | title-value | `string` | `''` | |
|
|
60
|
+
| label | label | `string` | `''` | |
|
|
61
|
+
|
|
62
|
+
## Events
|
|
63
|
+
|
|
64
|
+
| Event | Type | Description |
|
|
65
|
+
| --- | --- | --- |
|
|
66
|
+
| action-click | `CustomEvent<{action: number}>` | Fired when a slotted action element is clicked. |
|
|
67
|
+
|
|
68
|
+
## Slots
|
|
69
|
+
|
|
70
|
+
| Slot | Description |
|
|
71
|
+
| --- | --- |
|
|
72
|
+
| icon | Leading icon content. |
|
|
73
|
+
| title | Title text (overrides `titleValue` fallback). |
|
|
74
|
+
| label | Label text (overrides `label` fallback). |
|
|
75
|
+
| actions | Action elements rendered in the right section. |
|
|
76
|
+
|
|
77
|
+
## Stories
|
|
78
|
+
|
|
79
|
+
- [📌 Playground](https://openbridge-next-storybook.web.app/?path=/story/ui-components-forms-title-container--playground)
|
|
80
|
+
- [Enabled](https://openbridge-next-storybook.web.app/?path=/story/ui-components-forms-title-container--enabled)
|
|
81
|
+
- [Inactive](https://openbridge-next-storybook.web.app/?path=/story/ui-components-forms-title-container--inactive)
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# `<obc-toggle-button-group>`
|
|
2
|
+
|
|
3
|
+
A segmented control for selecting a single option from a set (also known as a button group or segmented button).
|
|
4
|
+
|
|
5
|
+
Lifecycle: stable. [Storybook](https://openbridge-next-storybook.web.app/?path=/docs/ui-components-selection-controls-and-switches-toggle-button-horizontal--docs) · [Source](https://raw.githubusercontent.com/Ocean-Industries-Concept-Lab/openbridge-webcomponents/develop/packages/openbridge-webcomponents/src/components/toggle-button-group/toggle-button-group.ts)
|
|
6
|
+
|
|
7
|
+
`<obc-toggle-button-group>` – A segmented control for selecting a single option from a set (also known as a button group or segmented button).
|
|
8
|
+
|
|
9
|
+
Provides a horizontal group of connected toggle buttons where only one option can be selected at a time.
|
|
10
|
+
Each option is represented by an `<obc-toggle-button-option>` child element. The group manages selection
|
|
11
|
+
state automatically, deselecting the previous option when a new one is chosen.
|
|
12
|
+
|
|
13
|
+
Appears as a visually unified set of buttons with clear selection indicators. Commonly used for switching
|
|
14
|
+
between views, modes, or categories in a compact, space-efficient way. Ideal for toolbar controls,
|
|
15
|
+
filtering options, or layout toggles (e.g., list vs. grid view).
|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
- **Single selection mode:** Only one option can be active at a time; selecting a new option automatically
|
|
20
|
+
deselects the previous one. Similar to radio button behavior but with a button-like appearance.
|
|
21
|
+
- **Visual variants:**
|
|
22
|
+
- `regular` (default): Standard appearance with full background and border styling.
|
|
23
|
+
- `flat`: Minimal style with reduced visual weight, no prominent background or border.
|
|
24
|
+
- `normal`: **TODO(designer)** – Clarify the visual difference and intended use case for the `normal` variant compared to `regular` and `flat`.
|
|
25
|
+
- **Content type options:**
|
|
26
|
+
- `text` (default): Options display text labels only.
|
|
27
|
+
- `icon`: Options display only an icon (compact, suitable for limited space).
|
|
28
|
+
- `iconText`: Options display an icon and text side-by-side.
|
|
29
|
+
- `iconTextUnder`: Options display an icon above the text label (vertical layout within each button).
|
|
30
|
+
- **Size control:**
|
|
31
|
+
- Standard size (default): Regular button dimensions.
|
|
32
|
+
- Large size (`large`): Increased touch target and visual prominence for accessibility or emphasis.
|
|
33
|
+
- **Layout behavior:**
|
|
34
|
+
- By default, the group stretches to fill available container width, distributing space equally among options.
|
|
35
|
+
- When `hugText` is true, the group shrinks to fit its content width instead of expanding.
|
|
36
|
+
- **External control mode:** When `externalControl` is true, the group emits selection events but does not
|
|
37
|
+
update its own `value` property, allowing parent components to manage state (useful for form libraries or
|
|
38
|
+
custom state management).
|
|
39
|
+
- **Empty selection mode:** When `allowEmptySelection` is true, a `value` that does not match any enabled
|
|
40
|
+
option leaves the group with no option selected, instead of defaulting to the first enabled option. Use
|
|
41
|
+
this when a selection may legitimately be absent (e.g. unset, loading, or error states) so the UI does not
|
|
42
|
+
imply a choice the user has not made.
|
|
43
|
+
- **Disabled state:** Setting `disabled` on the group disables all contained options at once. Individual
|
|
44
|
+
options can also be disabled independently while the group remains enabled.
|
|
45
|
+
- **Divider management:** Automatically shows visual dividers between options and hides the divider after
|
|
46
|
+
the selected option, so the group reads as one control.
|
|
47
|
+
- **Property propagation:** The group automatically synchronizes `type`, `variant`, `hugText`, and `large`
|
|
48
|
+
properties to all child `<obc-toggle-button-option>` elements for consistent styling.
|
|
49
|
+
- **Automatic fallback selection:** If the current value is set to a disabled or non-existent option, the
|
|
50
|
+
group automatically selects the first enabled option to ensure a valid state.
|
|
51
|
+
|
|
52
|
+
## Usage Guidelines
|
|
53
|
+
|
|
54
|
+
Use `<obc-toggle-button-group>` when you need users to choose exactly one option from a small set of
|
|
55
|
+
mutually exclusive choices (typically 2-5 options). It provides a more compact and visually integrated
|
|
56
|
+
alternative to radio buttons.
|
|
57
|
+
|
|
58
|
+
**Ideal use cases:**
|
|
59
|
+
- View mode toggles (e.g., list vs. grid, map vs. chart)
|
|
60
|
+
- Filter options (e.g., all/active/completed tasks)
|
|
61
|
+
- Alignment or layout controls (e.g., left/center/right alignment)
|
|
62
|
+
- Time range selectors (e.g., day/week/month)
|
|
63
|
+
- Toolbar mode switches (e.g., edit/preview modes)
|
|
64
|
+
|
|
65
|
+
**When not to use:**
|
|
66
|
+
- For binary on/off choices, use a switch or checkbox instead.
|
|
67
|
+
- For multiple selections from a set, use checkboxes or chips.
|
|
68
|
+
- For many options (6+), consider a dropdown/select or radio button list for better scannability.
|
|
69
|
+
- For navigation between pages or sections, use tabs or a navigation menu.
|
|
70
|
+
|
|
71
|
+
**Best Practices:**
|
|
72
|
+
- Each option must have a unique `value` property to prevent selection conflicts.
|
|
73
|
+
- Provide clear, concise labels for each option. Keep text short (1-2 words ideal).
|
|
74
|
+
- For icon-only buttons (`type="icon"`), ensure icons are universally recognizable or provide tooltips.
|
|
75
|
+
- Set an initial `value` to indicate the default selection, or the first enabled option will be selected automatically.
|
|
76
|
+
- Avoid disabling the currently selected option; if an option becomes unavailable, selection will shift to the first enabled option.
|
|
77
|
+
- Use `variant="flat"` in dense UIs or when the toggle is secondary to other content.
|
|
78
|
+
- Use `large` size for touch interfaces or when the control is a primary interaction element.
|
|
79
|
+
|
|
80
|
+
**TODO(designer):** Confirm if vertical orientation is supported or planned for future releases. Also clarify recommended maximum number of options for optimal usability (currently assumes 2-5 options).
|
|
81
|
+
|
|
82
|
+
## Slots
|
|
83
|
+
|
|
84
|
+
| Slot Name | Renders When... | Purpose |
|
|
85
|
+
|-----------|-----------------|---------|
|
|
86
|
+
| (default) | Always | Place one or more `<obc-toggle-button-option>` elements here to define the selectable options in the group. |
|
|
87
|
+
|
|
88
|
+
## Events
|
|
89
|
+
|
|
90
|
+
- `value` – Fired when the selected value changes, either through user interaction or programmatic change.
|
|
91
|
+
Event detail: `{ value: string, previousValue: string }`. Listen to this event to react to selection changes.
|
|
92
|
+
|
|
93
|
+
## Keyboard
|
|
94
|
+
A single-select group is a radio group to the keyboard
|
|
95
|
+
([APG Radio Group](https://www.w3.org/WAI/ARIA/apg/patterns/radio/)): one
|
|
96
|
+
tab stop on the selected option, and the arrow keys move focus and selection
|
|
97
|
+
together, wrapping and skipping disabled options. `Enter` and `Space` on an
|
|
98
|
+
option select it through its button. Under `externalControl` an arrow key
|
|
99
|
+
emits `value` and `change` for the next option the way a click does, and
|
|
100
|
+
the selection waits for the host.
|
|
101
|
+
|
|
102
|
+
Left out: nothing.
|
|
103
|
+
|
|
104
|
+
## Example
|
|
105
|
+
|
|
106
|
+
```html
|
|
107
|
+
<obc-toggle-button-group value="list" type="iconText">
|
|
108
|
+
<obc-toggle-button-option value="list">
|
|
109
|
+
<obi-placeholder slot="icon"></obi-placeholder>
|
|
110
|
+
List
|
|
111
|
+
</obc-toggle-button-option>
|
|
112
|
+
<obc-toggle-button-option value="grid">
|
|
113
|
+
<obi-placeholder slot="icon"></obi-placeholder>
|
|
114
|
+
Grid
|
|
115
|
+
</obc-toggle-button-option>
|
|
116
|
+
<obc-toggle-button-option value="table">
|
|
117
|
+
<obi-placeholder slot="icon"></obi-placeholder>
|
|
118
|
+
Table
|
|
119
|
+
</obc-toggle-button-option>
|
|
120
|
+
</obc-toggle-button-group>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Properties
|
|
124
|
+
|
|
125
|
+
| Property | Attribute | Type | Default | Description |
|
|
126
|
+
| --- | --- | --- | --- | --- |
|
|
127
|
+
| value | value | `string` | `''` | The currently selected option's value. Set this property to programmatically select an option. When the user selects a different option, this property updates and a `value` event is fired. If set to a value that does not match any enabled option, the first enabled option is selected by default. |
|
|
128
|
+
| activated | activated | `string \| undefined` | | The value of the option that is activated. When the group is controlled by an external source, this property is used to set the value of the option that is activated. This is a visual indication that the option is clicked but not yet stored. |
|
|
129
|
+
| type | type | | | Visual type of the options, propagated to every child `<obc-toggle-button-option>`: `text` (default) is text only, `icon` an icon only, `iconText` an icon beside the text, `iconTextUnder` an icon above it. |
|
|
130
|
+
| variant | variant | | | Visual variant, propagated to every child `<obc-toggle-button-option>`: `regular` (default) has a background and border, `flat` has neither, and `normal` is the alternative style. |
|
|
131
|
+
| hugText | hugText | `boolean` | `false` | If true, the group shrinks to fit its content ("hug" the text) instead of stretching to fill the container. This setting is propagated to all child `<obc-toggle-button-option>` elements. |
|
|
132
|
+
| externalControl | externalControl | `boolean` | `false` | Makes a click emit `selected` without moving the selection, so the parent decides by setting `value`. Setting `value` programmatically always updates the selection, with or without this flag. When true, the group will not update its selection when the `value` property changes. Defaults to false. |
|
|
133
|
+
| allowEmptySelection | allowEmptySelection | `boolean` | `false` | Lets the group hold no selection: a `value` matching no enabled option, or a selected option that becomes disabled, clears the selection instead of falling back to the first enabled option. |
|
|
134
|
+
| disabled | disabled | `boolean` | `false` | Disables the entire toggle button group and all contained options when true. When disabled, no option can be selected or interacted with. |
|
|
135
|
+
| large | large | `boolean` | `false` | If true, the group and all contained options use a larger size. This setting is propagated to all child `<obc-toggle-button-option>` elements. |
|
|
136
|
+
| ariaLabel | aria-label | `string \| null` | `null` | Accessible name of the group, mapped to the `aria-label` attribute; the options are its radios. `aria-labelledby` is not supported: ID references cannot cross the shadow boundary. |
|
|
137
|
+
| options | | `NodeListOf<ObcToggleButtonOption>` | | |
|
|
138
|
+
|
|
139
|
+
## Events
|
|
140
|
+
|
|
141
|
+
| Event | Type | Description |
|
|
142
|
+
| --- | --- | --- |
|
|
143
|
+
| value | `CustomEvent<{value: string, previousValue: string}>` | Fired when the selected value changes. |
|
|
144
|
+
| change | `CustomEvent<{value: string}>` | Fired when the selected value changes by user interaction. |
|
|
145
|
+
|
|
146
|
+
## Slots
|
|
147
|
+
|
|
148
|
+
| Slot | Description |
|
|
149
|
+
| --- | --- |
|
|
150
|
+
| (default) | Place one or more `<obc-toggle-button-option>` elements here to define the selectable options. |
|
|
151
|
+
|
|
152
|
+
## Stories
|
|
153
|
+
|
|
154
|
+
- [Icon Text](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--icon-text)
|
|
155
|
+
- [Icon Text Regular Disabled](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--icon-text-regular-disabled)
|
|
156
|
+
- [Icon Text Under](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--icon-text-under)
|
|
157
|
+
- [Icon Text Under Regular Disabled](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--icon-text-under-regular-disabled)
|
|
158
|
+
- [Icon](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--icon)
|
|
159
|
+
- [Icon Regular Disabled](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--icon-regular-disabled)
|
|
160
|
+
- [Text](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--text)
|
|
161
|
+
- [Text Regular Disabled](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--text-regular-disabled)
|
|
162
|
+
- [Icon Text Under Flat](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--icon-text-under-flat)
|
|
163
|
+
- [Icon Text Under Flat Disabled](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--icon-text-under-flat-disabled)
|
|
164
|
+
- [Icon Text Flat](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--icon-text-flat)
|
|
165
|
+
- [Icon Text Flat Disabled](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--icon-text-flat-disabled)
|
|
166
|
+
- [Icon Flat](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--icon-flat)
|
|
167
|
+
- [Icon Flat Disabled](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--icon-flat-disabled)
|
|
168
|
+
- [Text Flat](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--text-flat)
|
|
169
|
+
- [Text Flat Disabled](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--text-flat-disabled)
|
|
170
|
+
- [Text Normal](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--text-normal)
|
|
171
|
+
- [Text Large](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--text-large)
|
|
172
|
+
- [External Control](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--external-control)
|
|
173
|
+
- [External Control Activated](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--external-control-activated)
|
|
174
|
+
- [Different Text Length](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--different-text-length)
|
|
175
|
+
- [Selection Behavior](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--selection-behavior)
|
|
176
|
+
- [Mixed Disabled States](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--mixed-disabled-states)
|
|
177
|
+
- [All Options Disabled - Selection Preserved](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--all-options-disabled)
|
|
178
|
+
- [Initially Disabled Selection Falls Back](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--initially-disabled-selected)
|
|
179
|
+
- [External Control Activated Demo](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--external-control-activated-demo)
|
|
180
|
+
- [Empty Selection When Unmatched](https://openbridge-next-storybook.web.app/?path=/story/ui-components-selection-controls-and-switches-toggle-button-horizontal--empty-selection-when-unmatched)
|
|
181
|
+
|
|
182
|
+
## See also
|
|
183
|
+
|
|
184
|
+
- [Migration Guide](https://openbridge-next-storybook.web.app/docs/introduction-migration-guide.md)
|