@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.117 → 2.0.0-next.119

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.
Files changed (251) hide show
  1. package/.storybook/manager.ts +18 -16
  2. package/bundle/openbridge-webcomponents.bundle.js +37 -33
  3. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  4. package/custom-elements.json +30 -24
  5. package/dist/ar/poi/poi-base.d.ts +6 -0
  6. package/dist/ar/poi/poi-base.d.ts.map +1 -1
  7. package/dist/ar/poi/poi-base.js.map +1 -1
  8. package/dist/ar/poi-button/poi-button.d.ts +2 -2
  9. package/dist/ar/poi-button/poi-button.js.map +1 -1
  10. package/dist/automation/vertical-line/vertical-line.d.ts +6 -0
  11. package/dist/automation/vertical-line/vertical-line.d.ts.map +1 -1
  12. package/dist/automation/vertical-line/vertical-line.js.map +1 -1
  13. package/dist/components/accordion-card/accordion-card.d.ts.map +1 -1
  14. package/dist/components/accordion-card/accordion-card.js.map +1 -1
  15. package/dist/components/advice-message-item/advice-message-item.d.ts +4 -2
  16. package/dist/components/advice-message-item/advice-message-item.d.ts.map +1 -1
  17. package/dist/components/advice-message-item/advice-message-item.js +4 -2
  18. package/dist/components/advice-message-item/advice-message-item.js.map +1 -1
  19. package/dist/components/app-menu/app-menu.d.ts +1 -1
  20. package/dist/components/app-menu/app-menu.js +1 -1
  21. package/dist/components/app-menu/app-menu.js.map +1 -1
  22. package/dist/components/brilliance-menu/brilliance-menu.d.ts +8 -4
  23. package/dist/components/brilliance-menu/brilliance-menu.d.ts.map +1 -1
  24. package/dist/components/brilliance-menu/brilliance-menu.js +8 -4
  25. package/dist/components/brilliance-menu/brilliance-menu.js.map +1 -1
  26. package/dist/components/check-button/check-button.js.map +1 -1
  27. package/dist/components/checkbox/checkbox.d.ts +2 -2
  28. package/dist/components/checkbox/checkbox.js.map +1 -1
  29. package/dist/components/command-menu/command-menu.d.ts +1 -1
  30. package/dist/components/command-menu/command-menu.js +1 -1
  31. package/dist/components/command-menu/command-menu.js.map +1 -1
  32. package/dist/components/dropdown-button/dropdown-button.d.ts +2 -2
  33. package/dist/components/dropdown-button/dropdown-button.js +2 -2
  34. package/dist/components/dropdown-button/dropdown-button.js.map +1 -1
  35. package/dist/components/menu-button/menu-button.d.ts.map +1 -1
  36. package/dist/components/menu-button/menu-button.js.map +1 -1
  37. package/dist/components/navigation-item/navigation-item.d.ts +1 -5
  38. package/dist/components/navigation-item/navigation-item.d.ts.map +1 -1
  39. package/dist/components/navigation-item/navigation-item.js +0 -8
  40. package/dist/components/navigation-item/navigation-item.js.map +1 -1
  41. package/dist/components/navigation-item-group/navigation-item-group.d.ts +2 -1
  42. package/dist/components/navigation-item-group/navigation-item-group.d.ts.map +1 -1
  43. package/dist/components/navigation-item-group/navigation-item-group.js +2 -1
  44. package/dist/components/navigation-item-group/navigation-item-group.js.map +1 -1
  45. package/dist/components/notification-button/notification-button.d.ts +1 -1
  46. package/dist/components/notification-button/notification-button.js +1 -1
  47. package/dist/components/notification-button/notification-button.js.map +1 -1
  48. package/dist/components/notification-message-item/notification-message-item.d.ts +4 -2
  49. package/dist/components/notification-message-item/notification-message-item.d.ts.map +1 -1
  50. package/dist/components/notification-message-item/notification-message-item.js +4 -2
  51. package/dist/components/notification-message-item/notification-message-item.js.map +1 -1
  52. package/dist/components/pivot-item/pivot-item.d.ts +1 -1
  53. package/dist/components/pivot-item/pivot-item.js +1 -1
  54. package/dist/components/pivot-item/pivot-item.js.map +1 -1
  55. package/dist/components/pivot-item-group/pivot-item-group.d.ts +1 -0
  56. package/dist/components/pivot-item-group/pivot-item-group.d.ts.map +1 -1
  57. package/dist/components/pivot-item-group/pivot-item-group.js.map +1 -1
  58. package/dist/components/slide-button/slide-button.d.ts.map +1 -1
  59. package/dist/components/slide-button/slide-button.js.map +1 -1
  60. package/dist/components/slider/slider.d.ts +2 -2
  61. package/dist/components/slider/slider.js +2 -2
  62. package/dist/components/slider/slider.js.map +1 -1
  63. package/dist/components/slider-double/slider-double.d.ts +2 -2
  64. package/dist/components/slider-double/slider-double.js +2 -2
  65. package/dist/components/slider-double/slider-double.js.map +1 -1
  66. package/dist/components/stepper-box/stepper-box.d.ts +4 -2
  67. package/dist/components/stepper-box/stepper-box.d.ts.map +1 -1
  68. package/dist/components/stepper-box/stepper-box.js +4 -2
  69. package/dist/components/stepper-box/stepper-box.js.map +1 -1
  70. package/dist/components/system-button/system-button.d.ts +1 -1
  71. package/dist/components/system-button/system-button.js +1 -1
  72. package/dist/components/system-button/system-button.js.map +1 -1
  73. package/dist/components/tabbed-card/tabbed-card.d.ts.map +1 -1
  74. package/dist/components/tabbed-card/tabbed-card.js.map +1 -1
  75. package/dist/components/toggle-button-option/toggle-button-option.d.ts +2 -1
  76. package/dist/components/toggle-button-option/toggle-button-option.d.ts.map +1 -1
  77. package/dist/components/toggle-button-option/toggle-button-option.js +2 -1
  78. package/dist/components/toggle-button-option/toggle-button-option.js.map +1 -1
  79. package/dist/components/toggle-button-vertical-group/toggle-button-vertical-group.js.map +1 -1
  80. package/dist/components/toggle-switch/toggle-switch.d.ts +1 -1
  81. package/dist/components/toggle-switch/toggle-switch.js +1 -1
  82. package/dist/components/toggle-switch/toggle-switch.js.map +1 -1
  83. package/dist/components/top-bar/top-bar.d.ts.map +1 -1
  84. package/dist/components/top-bar/top-bar.js.map +1 -1
  85. package/dist/components/topbar-message-item/topbar-message-item.js.map +1 -1
  86. package/dist/integration-systems/integration-dropdown-button/integration-dropdown-button.d.ts +1 -1
  87. package/dist/integration-systems/integration-dropdown-button/integration-dropdown-button.js +1 -1
  88. package/dist/integration-systems/integration-dropdown-button/integration-dropdown-button.js.map +1 -1
  89. package/eslint.config.mjs +355 -0
  90. package/package.json +3 -1
  91. package/script/check-slot-event-docs.ts +36 -3
  92. package/script/eslint-rules.test.ts +230 -0
  93. package/src/ar/building-blocks/poi-graphic-line/poi-graphic-line.stories.ts +1 -1
  94. package/src/ar/building-blocks/poi-header/poi-header.stories.ts +1 -1
  95. package/src/ar/building-blocks/poi-line/poi-line.stories.ts +1 -1
  96. package/src/ar/building-blocks/poi-pointer/poi-pointer.stories.ts +1 -1
  97. package/src/ar/building-blocks/poi-selection-frame/poi-selection-frame.stories.ts +1 -1
  98. package/src/ar/building-blocks/ruler-pointer/ruler-pointer.stories.ts +1 -1
  99. package/src/ar/chart-object-vessel-button/chart-object-vessel-button.stories.ts +1 -1
  100. package/src/ar/poi/poi-aton.stories.ts +1 -1
  101. package/src/ar/poi/poi-base.ts +6 -0
  102. package/src/ar/poi/poi-data.stories.ts +1 -1
  103. package/src/ar/poi/poi-vessel.stories.ts +1 -1
  104. package/src/ar/poi/poi.stories.ts +1 -1
  105. package/src/ar/poi-button/poi-button-aton.stories.ts +1 -1
  106. package/src/ar/poi-button/poi-button-data.stories.ts +1 -1
  107. package/src/ar/poi-button/poi-button-vessel.stories.ts +1 -1
  108. package/src/ar/poi-button/poi-button.stories.ts +1 -1
  109. package/src/ar/poi-button/poi-button.ts +2 -2
  110. package/src/ar/poi-card/poi-card.stories.ts +1 -1
  111. package/src/ar/poi-card-header/poi-card-header.stories.ts +1 -1
  112. package/src/ar/poi-controller/poi-controller.stories.ts +1 -1
  113. package/src/ar/poi-group/poi-group.stories.ts +1 -1
  114. package/src/ar/poi-layer/poi-layer.stories.ts +1 -1
  115. package/src/ar/poi-layer-stack/poi-layer-stack.stories.ts +1 -1
  116. package/src/ar/poi-object/poi-object-aton.stories.ts +1 -1
  117. package/src/ar/poi-object/poi-object-data.stories.ts +1 -1
  118. package/src/ar/poi-object/poi-object-vessel.stories.ts +1 -1
  119. package/src/ar/poi-object/poi-object.stories.ts +1 -1
  120. package/src/automation/automation-input-modal/automation-input-modal.stories.ts +1 -1
  121. package/src/automation/automation-readout/automation-readout.stories.ts +1 -1
  122. package/src/automation/automation-tank/automation-tank.stories.ts +1 -1
  123. package/src/automation/bus/bus.stories.ts +1 -1
  124. package/src/automation/corner-line/corner-line.stories.ts +1 -1
  125. package/src/automation/direction-line/direction-line.stories.ts +1 -1
  126. package/src/automation/end-point-line/end-point-line.stories.ts +1 -1
  127. package/src/automation/horizontal-line/horizontal-line.stories.ts +1 -1
  128. package/src/automation/line-cross/line-cross.stories.ts +1 -1
  129. package/src/automation/line-overlap/line-overlap.stories.ts +1 -1
  130. package/src/automation/three-way-line/three-way-line.stories.ts +1 -1
  131. package/src/automation/vertical-line/vertical-line.stories.ts +1 -1
  132. package/src/automation/vertical-line/vertical-line.ts +2 -1
  133. package/src/bars-graphs/area-graph/area-graph.stories.ts +1 -1
  134. package/src/bars-graphs/donut-chart/donut-chart.stories.ts +1 -1
  135. package/src/bars-graphs/line-graph/line-graph.stories.ts +1 -1
  136. package/src/bars-graphs/pie-chart/pie-chart.stories.ts +1 -1
  137. package/src/bars-graphs/polar-chart/polar-chart.stories.ts +1 -1
  138. package/src/bars-graphs/radial-bar-chart/radial-bar-chart.stories.ts +1 -1
  139. package/src/building-blocks/bar-horizontal/bar-horizontal.stories.ts +1 -1
  140. package/src/building-blocks/bar-vertical/bar-vertical.stories.ts +1 -1
  141. package/src/building-blocks/chart-line/chart-line-base.stories.ts +1 -1
  142. package/src/building-blocks/instrument-radial/instrument-radial.stories.ts +1 -1
  143. package/src/building-blocks/readout-block/readout-block.stories.ts +1 -1
  144. package/src/components/accordion-card/accordion-card.ts +2 -1
  145. package/src/components/advice-floating-item/advice-floating-item.stories.ts +1 -1
  146. package/src/components/advice-menu-item/advice-menu-item.stories.ts +1 -1
  147. package/src/components/advice-message-item/advice-message-item.stories.ts +1 -1
  148. package/src/components/advice-message-item/advice-message-item.ts +4 -2
  149. package/src/components/alert-frame/alert-frame.stories.ts +1 -1
  150. package/src/components/app-menu/app-menu.ts +1 -1
  151. package/src/components/attachment-list-item/attachment-list-item.stories.ts +1 -1
  152. package/src/components/audio-output/audio-output.stories.ts +1 -1
  153. package/src/components/audio-recording-item/audio-recording-item.stories.ts +1 -1
  154. package/src/components/automation-button-readout-stack/automation-button-readout-stack.stories.ts +1 -1
  155. package/src/components/badge/badge.stories.ts +1 -1
  156. package/src/components/brilliance-menu/brilliance-menu.ts +8 -4
  157. package/src/components/calendar/calendar.stories.ts +1 -1
  158. package/src/components/check-button/check-button.ts +1 -1
  159. package/src/components/checkbox/checkbox.ts +2 -2
  160. package/src/components/command-button/command-button.stories.ts +1 -1
  161. package/src/components/command-menu/command-menu.stories.ts +1 -1
  162. package/src/components/command-menu/command-menu.ts +1 -1
  163. package/src/components/communication-table/communication-table.stories.ts +1 -1
  164. package/src/components/context-menu-input/context-menu-input.stories.ts +1 -1
  165. package/src/components/date-item/date-item.stories.ts +1 -1
  166. package/src/components/dropdown-button/dropdown-button.ts +2 -2
  167. package/src/components/event-item/event-item.stories.ts +1 -1
  168. package/src/components/event-list/event-list.stories.ts +1 -1
  169. package/src/components/form-container/form-container.stories.ts +1 -0
  170. package/src/components/form-footer-container/form-footer-container.stories.ts +1 -0
  171. package/src/components/form-group/form-group.stories.ts +1 -0
  172. package/src/components/form-item/form-item.stories.ts +1 -1
  173. package/src/components/keyboard-full/keyboard-full.stories.ts +1 -1
  174. package/src/components/keyboard-numeric/keyboard-numeric.stories.ts +1 -1
  175. package/src/components/menu-button/menu-button.stories.ts +1 -1
  176. package/src/components/menu-button/menu-button.ts +8 -4
  177. package/src/components/message-menu-item/message-menu-item.stories.ts +1 -1
  178. package/src/components/navigation-item/navigation-item.ts +1 -10
  179. package/src/components/navigation-item-group/navigation-item-group.ts +2 -1
  180. package/src/components/notification-badge-button/notification-badge-button.stories.ts +1 -1
  181. package/src/components/notification-button/notification-button.ts +1 -1
  182. package/src/components/notification-floating-item/notification-floating-item.stories.ts +1 -1
  183. package/src/components/notification-menu-item/notification-menu-item.stories.ts +1 -1
  184. package/src/components/notification-message-item/notification-message-item.stories.ts +1 -1
  185. package/src/components/notification-message-item/notification-message-item.ts +4 -2
  186. package/src/components/pivot-item/pivot-item.ts +1 -1
  187. package/src/components/pivot-item-group/pivot-item-group.ts +1 -0
  188. package/src/components/rich-button/rich-button.stories.ts +1 -1
  189. package/src/components/sequence-card/sequence-card.stories.ts +1 -1
  190. package/src/components/sequence-connector/sequence-connector.stories.ts +1 -1
  191. package/src/components/sequence-item/sequence-item.stories.ts +1 -0
  192. package/src/components/sequence-loading-spinner/sequence-loading-spinner.stories.ts +1 -1
  193. package/src/components/sequence-modal/sequence-modal.stories.ts +1 -1
  194. package/src/components/sequence-step/sequence-step.stories.ts +1 -0
  195. package/src/components/sequence-toolbar/sequence-toolbar.stories.ts +1 -0
  196. package/src/components/slide-button/slide-button.stories.ts +1 -1
  197. package/src/components/slide-button/slide-button.ts +2 -1
  198. package/src/components/slider/slider.ts +2 -2
  199. package/src/components/slider-double/slider-double.ts +2 -2
  200. package/src/components/split-button/split-button.stories.ts +1 -1
  201. package/src/components/status-indicator/status-indicator.stories.ts +1 -1
  202. package/src/components/stepper-box/stepper-box.ts +4 -2
  203. package/src/components/system-button/system-button.ts +5 -5
  204. package/src/components/tabbed-card/tabbed-card.ts +2 -1
  205. package/src/components/table/table.stories.ts +1 -1
  206. package/src/components/table-header-item/table-header-item.stories.ts +1 -1
  207. package/src/components/textbox/textbox.stories.ts +1 -1
  208. package/src/components/title-container/title-container.stories.ts +1 -1
  209. package/src/components/toggle-button-option/toggle-button-option.ts +2 -1
  210. package/src/components/toggle-button-three-state/toggle-button-three-state.stories.ts +1 -1
  211. package/src/components/toggle-button-vertical-group/toggle-button-vertical-group.ts +2 -2
  212. package/src/components/toggle-switch/toggle-switch.ts +1 -1
  213. package/src/components/toggletip/toggletip.stories.ts +1 -1
  214. package/src/components/top-bar/top-bar.ts +8 -4
  215. package/src/components/topbar-message-item/topbar-message-item.ts +2 -2
  216. package/src/components/tree-navigation/tree-navigation.stories.ts +1 -1
  217. package/src/components/tree-navigation-item/tree-navigation-item.stories.ts +1 -1
  218. package/src/integration-systems/integration-app-bar/integration-app-bar.stories.ts +1 -1
  219. package/src/integration-systems/integration-bar/integration-bar.stories.ts +1 -1
  220. package/src/integration-systems/integration-bar-dropdown/integration-bar-dropdown.stories.ts +1 -1
  221. package/src/integration-systems/integration-button/integration-button.stories.ts +1 -1
  222. package/src/integration-systems/integration-dropdown-button/integration-dropdown-button.stories.ts +1 -1
  223. package/src/integration-systems/integration-dropdown-button/integration-dropdown-button.ts +1 -1
  224. package/src/integration-systems/integration-fleet-button/integration-fleet-button.stories.ts +1 -1
  225. package/src/integration-systems/integration-tabs/integration-tabs.stories.ts +1 -1
  226. package/src/integration-systems/integration-vessel-menu/integration-vessel-menu.stories.ts +1 -1
  227. package/src/integration-systems/integration-vessel-selector/integration-vessel-selector.stories.ts +1 -1
  228. package/src/navigation-instruments/azimuth-thruster-labeled/azimuth-thruster-labeled.stories.ts +1 -1
  229. package/src/navigation-instruments/current/current.stories.ts +1 -1
  230. package/src/navigation-instruments/draft-trim/draft-trim.stories.ts +1 -1
  231. package/src/navigation-instruments/gauge-radial-proportional/gauge-radial-proportional.stories.ts +1 -1
  232. package/src/navigation-instruments/graph-mini/graph-mini.stories.ts +1 -1
  233. package/src/navigation-instruments/indicator-graph/indicator-graph.stories.ts +1 -1
  234. package/src/navigation-instruments/instrument-field/instrument-field.stories.ts +1 -1
  235. package/src/navigation-instruments/pitch-roll-heave/pitch-roll-heave.stories.ts +1 -1
  236. package/src/navigation-instruments/pitch-roll-yaw/pitch-roll-yaw.stories.ts +1 -1
  237. package/src/navigation-instruments/position-deviation/position-deviation.stories.ts +1 -1
  238. package/src/navigation-instruments/readout/readout.stories.ts +1 -1
  239. package/src/navigation-instruments/readout-list/readout-list.stories.ts +1 -1
  240. package/src/navigation-instruments/readout-list-item/readout-list-item.stories.ts +1 -1
  241. package/src/navigation-instruments/speed-arrows/speed-arrows.stories.ts +1 -1
  242. package/src/navigation-instruments/speed-directions/speed-directions.stories.ts +1 -1
  243. package/src/navigation-instruments/top-view-propulsion/top-view-propulsion.stories.ts +1 -1
  244. package/src/navigation-instruments/velocity-projection-plot/velocity-projection-plot.stories.ts +1 -1
  245. package/src/navigation-instruments/watch/watch.stories.ts +1 -1
  246. package/src/navigation-instruments/watch-flat/watch-flat.stories.ts +1 -1
  247. package/src/navigation-instruments/wind-propulsion/wind-propulsion.stories.ts +1 -1
  248. package/src/pages/alert-detail-page/alert-detail-page.stories.ts +1 -1
  249. package/src/pages/alert-list-page-small/alert-list-page-small.stories.ts +1 -1
  250. package/vitest.browser.config.ts +4 -2
  251. package/vitest.config.ts +10 -0
@@ -0,0 +1,230 @@
1
+ import {describe, expect, it} from 'vitest';
2
+ import {RuleTester} from 'eslint';
3
+ import tsParser from '@typescript-eslint/parser';
4
+
5
+ // @ts-expect-error - eslint.config.mjs is untyped JavaScript.
6
+ import {__testables} from '../eslint.config.mjs';
7
+
8
+ const {openbridgePlugin, extractComponents, pinComponentIndex} = __testables;
9
+
10
+ // The story rule resolves meta.component through a cross-file index. Pin it so
11
+ // the tests describe the rule's behaviour rather than the current state of src/.
12
+ pinComponentIndex({
13
+ 'obc-stable-thing': ['stable'],
14
+ 'obc-beta-thing': ['beta'],
15
+ 'obc-experimental-thing': ['experimental'],
16
+ 'obc-deprecated-thing': ['deprecated'],
17
+ 'obc-untagged-thing': [],
18
+ 'obc-ambiguous-thing': ['beta', 'deprecated'],
19
+ });
20
+
21
+ const ruleTester = new RuleTester({
22
+ languageOptions: {
23
+ parser: tsParser,
24
+ ecmaVersion: 2020,
25
+ sourceType: 'module',
26
+ },
27
+ });
28
+
29
+ function story(body: string) {
30
+ return `const meta = {\n${body}\n} satisfies Meta;\nexport default meta;\n`;
31
+ }
32
+
33
+ describe('extractComponents', () => {
34
+ it('reads the lifecycle tag from a class JSDoc block', () => {
35
+ expect(
36
+ extractComponents(
37
+ `/**\n * Does a thing.\n * @stable\n */\n@customElement('obc-thing')\nexport class Thing {}`
38
+ )
39
+ ).toMatchObject([{tag: 'obc-thing', tags: ['stable']}]);
40
+ });
41
+
42
+ it('tolerates a blank line between the JSDoc and the decorator', () => {
43
+ expect(
44
+ extractComponents(
45
+ `/**\n * @beta\n */\n\n@customElement('obc-thing')\nexport class Thing {}`
46
+ )
47
+ ).toMatchObject([{tag: 'obc-thing', tags: ['beta']}]);
48
+ });
49
+
50
+ it('ignores a tag in a plain block comment, which is not JSDoc', () => {
51
+ expect(
52
+ extractComponents(
53
+ `/* Thing\n * @deprecated\n */\n@customElement('obc-thing')\nexport class Thing {}`
54
+ )
55
+ ).toMatchObject([{tag: 'obc-thing', tags: []}]);
56
+ });
57
+
58
+ it('does not stretch an earlier JSDoc block across intervening code', () => {
59
+ expect(
60
+ extractComponents(
61
+ `/**\n * @stable\n */\nexport enum Size {}\n\n/* Thing */\n@customElement('obc-thing')\nexport class Thing {}`
62
+ )
63
+ ).toMatchObject([{tag: 'obc-thing', tags: []}]);
64
+ });
65
+
66
+ it('ignores a decorator written inside a JSDoc code fence', () => {
67
+ expect(
68
+ extractComponents(
69
+ `/**\n * \`\`\`js\n * @customElement('my-element')\n * \`\`\`\n */\nexport const customElement = () => {};`
70
+ )
71
+ ).toEqual([]);
72
+ });
73
+
74
+ it('reports every lifecycle tag when a class declares more than one', () => {
75
+ expect(
76
+ extractComponents(
77
+ `/**\n * @beta\n * @deprecated\n */\n@customElement('obc-thing')\nexport class Thing {}`
78
+ )
79
+ ).toMatchObject([{tag: 'obc-thing', tags: ['beta', 'deprecated']}]);
80
+ });
81
+
82
+ it('finds several components in one file', () => {
83
+ expect(
84
+ extractComponents(
85
+ `/**\n * @stable\n */\n@customElement('obc-a')\nexport class A {}\n\n/**\n * @beta\n */\n@customElement('obc-b')\nexport class B {}`
86
+ ).map((component: {tag: string; tags: string[]}) => [
87
+ component.tag,
88
+ component.tags,
89
+ ])
90
+ ).toEqual([
91
+ ['obc-a', ['stable']],
92
+ ['obc-b', ['beta']],
93
+ ]);
94
+ });
95
+ });
96
+
97
+ describe('openbridge/component-lifecycle-tag', () => {
98
+ it('accepts and rejects the right shapes', () => {
99
+ ruleTester.run(
100
+ 'component-lifecycle-tag',
101
+ openbridgePlugin.rules['component-lifecycle-tag'],
102
+ {
103
+ valid: [
104
+ `/**\n * @stable\n */\n@customElement('obc-thing')\nexport class Thing {}`,
105
+ `/**\n * @deprecated\n */\n@customElement('obc-thing')\nexport class Thing {}`,
106
+ `export class NotAComponent {}`,
107
+ ],
108
+ invalid: [
109
+ {
110
+ code: `/**\n * Does a thing.\n */\n@customElement('obc-thing')\nexport class Thing {}`,
111
+ errors: [{message: /has no lifecycle tag/ as unknown as string}],
112
+ },
113
+ {
114
+ code: `@customElement('obc-thing')\nexport class Thing {}`,
115
+ errors: [{message: /has no lifecycle tag/ as unknown as string}],
116
+ },
117
+ {
118
+ code: `/**\n * @beta\n * @deprecated\n */\n@customElement('obc-thing')\nexport class Thing {}`,
119
+ errors: [
120
+ {
121
+ message:
122
+ /declares more than one lifecycle tag/ as unknown as string,
123
+ },
124
+ ],
125
+ },
126
+ ],
127
+ }
128
+ );
129
+ });
130
+ });
131
+
132
+ describe('openbridge/story-lifecycle-tags', () => {
133
+ it('accepts and fixes the right shapes', () => {
134
+ ruleTester.run(
135
+ 'story-lifecycle-tags',
136
+ openbridgePlugin.rules['story-lifecycle-tags'],
137
+ {
138
+ valid: [
139
+ // @stable emits no tag.
140
+ story(` title: 'A/B',\n component: 'obc-stable-thing',`),
141
+ story(
142
+ ` title: 'A/B',\n tags: ['autodocs', '6.0'],\n component: 'obc-stable-thing',`
143
+ ),
144
+ // Already correct.
145
+ story(
146
+ ` title: 'A/B',\n tags: ['autodocs', 'experimental'],\n component: 'obc-experimental-thing',`
147
+ ),
148
+ // No meta.component: the pure-function-module pattern.
149
+ story(` title: 'A/B',\n tags: ['autodocs'],`),
150
+ // Unresolvable, or ambiguous, components are the source rule's job.
151
+ story(` title: 'A/B',\n component: 'obc-untagged-thing',`),
152
+ story(` title: 'A/B',\n component: 'obc-ambiguous-thing',`),
153
+ story(` title: 'A/B',\n component: 'obc-unknown-thing',`),
154
+ // A story-level tags array is not meta.tags.
155
+ `const meta = {title: 'A/B', component: 'obc-stable-thing'} satisfies Meta;\nexport const Story = {tags: ['skip-test']};\n`,
156
+ ],
157
+ invalid: [
158
+ {
159
+ code: story(
160
+ ` title: 'A/B',\n tags: ['autodocs', '6.0'],\n component: 'obc-experimental-thing',`
161
+ ),
162
+ output: story(
163
+ ` title: 'A/B',\n tags: ['autodocs', '6.0', 'experimental'],\n component: 'obc-experimental-thing',`
164
+ ),
165
+ errors: 1,
166
+ },
167
+ {
168
+ // The retired `wip` / `alpha` names are replaced, order preserved.
169
+ code: story(
170
+ ` title: 'A/B',\n tags: ['autodocs', 'wip', '6.1'],\n component: 'obc-experimental-thing',`
171
+ ),
172
+ output: story(
173
+ ` title: 'A/B',\n tags: ['autodocs', '6.1', 'experimental'],\n component: 'obc-experimental-thing',`
174
+ ),
175
+ errors: 1,
176
+ },
177
+ {
178
+ code: story(
179
+ ` title: 'A/B',\n tags: ['alpha'],\n component: 'obc-beta-thing',`
180
+ ),
181
+ output: story(
182
+ ` title: 'A/B',\n tags: ['beta'],\n component: 'obc-beta-thing',`
183
+ ),
184
+ errors: 1,
185
+ },
186
+ {
187
+ // A @stable component must shed a stale lifecycle tag; the whole
188
+ // property goes when nothing else is left in it.
189
+ code: story(
190
+ ` title: 'A/B',\n tags: ['wip'],\n component: 'obc-stable-thing',`
191
+ ),
192
+ output: story(` title: 'A/B',\n component: 'obc-stable-thing',`),
193
+ errors: 1,
194
+ },
195
+ {
196
+ code: story(
197
+ ` title: 'A/B',\n tags: ['autodocs', 'wip'],\n component: 'obc-stable-thing',`
198
+ ),
199
+ output: story(
200
+ ` title: 'A/B',\n tags: ['autodocs'],\n component: 'obc-stable-thing',`
201
+ ),
202
+ errors: 1,
203
+ },
204
+ {
205
+ // No tags property at all: one is inserted after title.
206
+ code: story(` title: 'A/B',\n component: 'obc-beta-thing',`),
207
+ output: story(
208
+ ` title: 'A/B',\n tags: ['beta'],\n component: 'obc-beta-thing',`
209
+ ),
210
+ errors: 1,
211
+ },
212
+ {
213
+ // No title either: inserted as the first property.
214
+ code: story(` component: 'obc-deprecated-thing',`),
215
+ output: story(
216
+ ` tags: ['deprecated'],\n component: 'obc-deprecated-thing',`
217
+ ),
218
+ errors: 1,
219
+ },
220
+ {
221
+ // A plain `const meta = {…}` with no `satisfies` clause.
222
+ code: `const meta = {\n title: 'A/B',\n component: 'obc-deprecated-thing',\n};\nexport default meta;\n`,
223
+ output: `const meta = {\n title: 'A/B',\n tags: ['deprecated'],\n component: 'obc-deprecated-thing',\n};\nexport default meta;\n`,
224
+ errors: 1,
225
+ },
226
+ ],
227
+ }
228
+ );
229
+ });
230
+ });
@@ -12,7 +12,7 @@ import {
12
12
 
13
13
  const meta: Meta<ObcPoiGraphicLine> = {
14
14
  title: 'AR/Building Blocks/POI Graphic Line',
15
- tags: ['autodocs'],
15
+ tags: ['autodocs', 'experimental'],
16
16
  component: 'obc-poi-graphic-line',
17
17
  argTypes: {
18
18
  lineStyle: {
@@ -10,7 +10,7 @@ import './poi-header.js';
10
10
 
11
11
  const meta: Meta<ObcPoiHeader> = {
12
12
  title: 'AR/Building Blocks/POI Header',
13
- tags: ['autodocs'],
13
+ tags: ['autodocs', 'experimental'],
14
14
  component: 'obc-poi-header',
15
15
  args: {
16
16
  content: '1',
@@ -12,7 +12,7 @@ import {crossDecorator} from '../../../storybook-util.js';
12
12
  import {html} from 'lit';
13
13
  const meta: Meta<ObcPoiLine> = {
14
14
  title: 'AR/Building Blocks/POI Line',
15
- tags: ['autodocs'],
15
+ tags: ['autodocs', 'experimental'],
16
16
  decorators: [crossDecorator],
17
17
  component: 'obc-poi-line',
18
18
  argTypes: {
@@ -12,7 +12,7 @@ type PoiPointerArgs = {
12
12
 
13
13
  const meta: Meta<PoiPointerArgs> = {
14
14
  title: 'AR/Building Blocks/POI Pointer',
15
- tags: ['6.1'],
15
+ tags: ['6.1', 'experimental'],
16
16
  component: 'obc-poi-pointer',
17
17
  decorators: [
18
18
  (story) => html`
@@ -9,7 +9,7 @@ import './poi-selection-frame.js';
9
9
 
10
10
  const meta: Meta<ObcPoiSelectionFrame> = {
11
11
  title: 'AR/Building Blocks/POI Selection Frame',
12
- tags: ['autodocs', '6.1'],
12
+ tags: ['autodocs', '6.1', 'experimental'],
13
13
  component: 'obc-poi-selection-frame',
14
14
  args: {
15
15
  type: ObcPoiSelectionFrameType.Indicator,
@@ -9,7 +9,7 @@ type RulerPointerArgs = {
9
9
 
10
10
  const meta: Meta<RulerPointerArgs> = {
11
11
  title: 'AR/Building Blocks/Ruler Pointer',
12
- tags: ['6.1'],
12
+ tags: ['6.1', 'experimental'],
13
13
  component: 'obc-ruler-pointer',
14
14
  decorators: [
15
15
  (story) => html`
@@ -15,7 +15,7 @@ import {html} from 'lit';
15
15
 
16
16
  const meta: Meta<ObcChartObjectVesselButton> = {
17
17
  title: 'AR/Chart Object Vessel Button',
18
- tags: ['6.1'],
18
+ tags: ['6.1', 'experimental'],
19
19
  component: 'obc-chart-object-vessel-button',
20
20
  args: {
21
21
  number: 2,
@@ -101,7 +101,7 @@ const renderPoiAton = (args: ObcPoiAton) => html`
101
101
 
102
102
  const meta: Meta<ObcPoiAton> = {
103
103
  title: 'AR/POI/POI AtoN',
104
- tags: ['autodocs'],
104
+ tags: ['autodocs', 'experimental'],
105
105
  component: 'obc-poi-aton',
106
106
  args: {
107
107
  type: ObcPoiType.Line,
@@ -47,6 +47,12 @@ const VALID_POI_STATES = new Set(Object.values(ObcPoiState));
47
47
  * layout-change dispatch, and visual-query logic so that each variant
48
48
  * only needs to override `renderContent()` and `getVisualNodes()`.
49
49
  *
50
+ * The `@fires` tag below documents the dispatch site, which lives here rather
51
+ * than in the variants. It is deliberately duplicated on each concrete
52
+ * subclass — that is where `custom-elements.json` and the framework wrappers
53
+ * pick the event up, since this class is not registered. Do not remove it from
54
+ * the subclasses. `@ignore` keeps this class out of the generated docs.
55
+ *
50
56
  * @fires {CustomEvent<void>} obc-poi-data-layout-change - Fired when layout-driving properties change. Bubbles and is composed.
51
57
  * @ignore
52
58
  */
@@ -89,7 +89,7 @@ const renderPoiData = (args: ObcPoiData) => html`
89
89
 
90
90
  const meta: Meta<ObcPoiData> = {
91
91
  title: 'AR/POI/POI Data',
92
- tags: ['autodocs'],
92
+ tags: ['autodocs', 'experimental'],
93
93
  component: 'obc-poi-data',
94
94
  args: {
95
95
  type: ObcPoiType.Line,
@@ -103,7 +103,7 @@ const renderPoiVessel = (args: ObcPoiVessel) => html`
103
103
 
104
104
  const meta: Meta<ObcPoiVessel> = {
105
105
  title: 'AR/POI/POI Vessel',
106
- tags: ['autodocs'],
106
+ tags: ['autodocs', 'experimental'],
107
107
  component: 'obc-poi-vessel',
108
108
  args: {
109
109
  type: ObcPoiType.Line,
@@ -35,7 +35,7 @@ type PoiStoryArgs = {
35
35
 
36
36
  const meta: Meta<PoiStoryArgs> = {
37
37
  title: 'AR/POI/POI',
38
- tags: ['autodocs'],
38
+ tags: ['autodocs', 'experimental'],
39
39
  component: 'obc-poi',
40
40
  decorators: [crossDecorator],
41
41
  args: {
@@ -32,7 +32,7 @@ import {
32
32
 
33
33
  const meta: Meta<ObcPoiButtonAton> = {
34
34
  title: 'AR/POI Button/POI Button AtoN',
35
- tags: ['autodocs'],
35
+ tags: ['autodocs', 'experimental'],
36
36
  component: 'obc-poi-button-aton',
37
37
  decorators: [crossDecorator],
38
38
  args: {
@@ -15,7 +15,7 @@ import {crossDecorator} from '../../storybook-util.js';
15
15
 
16
16
  const meta: Meta<ObcPoiButtonData> = {
17
17
  title: 'AR/POI Button/POI Button Data',
18
- tags: ['autodocs'],
18
+ tags: ['autodocs', 'experimental'],
19
19
  component: 'obc-poi-button-data',
20
20
  decorators: [crossDecorator],
21
21
  args: {
@@ -32,7 +32,7 @@ import {
32
32
 
33
33
  const meta: Meta<ObcPoiButtonVessel> = {
34
34
  title: 'AR/POI Button/POI Button Vessel',
35
- tags: ['autodocs'],
35
+ tags: ['autodocs', 'experimental'],
36
36
  component: 'obc-poi-button-vessel',
37
37
  decorators: [crossDecorator],
38
38
  args: {
@@ -136,7 +136,7 @@ function startOverlappedDataButtonLoop(
136
136
 
137
137
  const meta: Meta<ObcPoiButton> = {
138
138
  title: 'AR/POI Button/POI Button',
139
- tags: ['autodocs'],
139
+ tags: ['autodocs', 'experimental'],
140
140
  component: 'obc-poi-button',
141
141
  decorators: [crossDecorator],
142
142
  args: {
@@ -116,8 +116,8 @@ export interface ObcPoiButtonDataItem {
116
116
  * - `relation`: Optional relation icon/content rendered when `hasRelation` is true in data mode.
117
117
  *
118
118
  * ## Events
119
- * This component does not emit custom events.
120
- * - Emits a standard `click` event (`onClick` handler in framework wrappers) when activated.
119
+ * This component emits no custom events. A standard `click` bubbles from the
120
+ * internal `<button>` (`onClick` in the framework wrappers).
121
121
  *
122
122
  * ## Best Practices
123
123
  * - Keep `value`, `state`, and `selected` synchronized to avoid conflicting visual states.
@@ -61,7 +61,7 @@ function renderFixedPlaceholder(text: string = 'Content') {
61
61
 
62
62
  const meta: Meta<PoiCardArgs> = {
63
63
  title: 'AR/POI Card',
64
- tags: ['autodocs'],
64
+ tags: ['autodocs', 'experimental'],
65
65
  component: 'obc-poi-card',
66
66
  args: {
67
67
  pointerDirection: PointerDirection.None,
@@ -18,7 +18,7 @@ interface PoiCardHeaderArgs {
18
18
 
19
19
  const meta: Meta<PoiCardHeaderArgs> = {
20
20
  title: 'AR/POI Card Header',
21
- tags: ['autodocs'],
21
+ tags: ['autodocs', 'experimental'],
22
22
  component: 'obc-poi-card-header',
23
23
  args: {
24
24
  variant: ObcPoiCardHeaderVariant.Regular,
@@ -78,7 +78,7 @@ const waitForStorySettle = async (
78
78
 
79
79
  const meta: Meta<PoiControllerArgs> = {
80
80
  title: 'AR/POI Controller',
81
- tags: ['autodocs'],
81
+ tags: ['autodocs', 'experimental'],
82
82
  component: 'obc-poi-controller',
83
83
  args: {
84
84
  fit: PoiFitMode.Contain,
@@ -36,7 +36,7 @@ type PoiGroupStoryArgs = {
36
36
 
37
37
  const meta: Meta<PoiGroupStoryArgs> = {
38
38
  title: 'AR/POI Group',
39
- tags: ['6.1'],
39
+ tags: ['6.1', 'experimental'],
40
40
  component: 'obc-poi-group',
41
41
  decorators: [crossDecorator, compactPreviewHeightDecorator],
42
42
  args: {
@@ -20,7 +20,7 @@ type PoiLayerArgs = {
20
20
 
21
21
  const meta: Meta<PoiLayerArgs> = {
22
22
  title: 'AR/POI Layer',
23
- tags: ['6.1'],
23
+ tags: ['6.1', 'experimental'],
24
24
  component: 'obc-poi-layer',
25
25
  decorators: [
26
26
  (story) => html`
@@ -22,7 +22,7 @@ type PoiLayerStackArgs = {
22
22
 
23
23
  const meta: Meta<PoiLayerStackArgs> = {
24
24
  title: 'AR/POI Layer Stack',
25
- tags: ['6.1'],
25
+ tags: ['6.1', 'experimental'],
26
26
  component: 'obc-poi-layer-stack',
27
27
  decorators: [
28
28
  (story) => html`
@@ -11,7 +11,7 @@ import '../../icons/icon-beacon-general-east.js';
11
11
  const meta: Meta = {
12
12
  title: 'AR/POI Object/POI Object AtoN',
13
13
  component: 'obc-poi-object-aton',
14
- tags: ['autodocs'],
14
+ tags: ['autodocs', 'experimental'],
15
15
  argTypes: {
16
16
  type: {
17
17
  control: 'select',
@@ -11,7 +11,7 @@ import '../../icons/icon-vessel-generic-default-filled.js';
11
11
  const meta: Meta = {
12
12
  title: 'AR/POI Object/POI Object Data',
13
13
  component: 'obc-poi-object-data',
14
- tags: ['autodocs'],
14
+ tags: ['autodocs', 'experimental'],
15
15
  argTypes: {
16
16
  type: {
17
17
  control: 'select',
@@ -12,7 +12,7 @@ import '../../icons/icon-vessel-type-psv-filled.js';
12
12
  const meta: Meta = {
13
13
  title: 'AR/POI Object/POI Object Vessel',
14
14
  component: 'obc-poi-object-vessel',
15
- tags: ['autodocs'],
15
+ tags: ['autodocs', 'experimental'],
16
16
  argTypes: {
17
17
  type: {
18
18
  control: 'select',
@@ -12,7 +12,7 @@ import '../../icons/icon-placeholder.js';
12
12
  const meta: Meta<ObcPoiObject> = {
13
13
  title: 'AR/POI Object/POI Object',
14
14
  component: 'obc-poi-object',
15
- tags: ['autodocs'],
15
+ tags: ['autodocs', 'experimental'],
16
16
  argTypes: {
17
17
  type: {
18
18
  control: 'select',
@@ -24,7 +24,7 @@ import {ObcNumberInputFieldTextAlign} from '../../components/number-input-field/
24
24
 
25
25
  const meta: Meta<typeof ObcAutomationInputModal> = {
26
26
  title: 'Automation/Automation Control',
27
- tags: ['autodocs'],
27
+ tags: ['autodocs', 'experimental'],
28
28
  component: 'obc-automation-input-modal',
29
29
  args: {},
30
30
  } satisfies Meta<ObcAutomationInputModal>;
@@ -10,7 +10,7 @@ import {crossDecorator} from '../../storybook-util.js';
10
10
 
11
11
  const meta: Meta<typeof ObcAutomationReadout> = {
12
12
  title: 'Automation/Readouts/Readout',
13
- tags: ['autodocs'],
13
+ tags: ['autodocs', 'experimental'],
14
14
  component: 'obc-automation-readout',
15
15
  decorators: [crossDecorator],
16
16
  args: {
@@ -130,7 +130,7 @@ const renderTank = (args: StoryArgs) => renderTankEl(args);
130
130
 
131
131
  const meta: Meta<StoryArgs> = {
132
132
  title: 'Automation/Tanks/Tank',
133
- tags: ['autodocs', '6.0'],
133
+ tags: ['autodocs', '6.0', 'beta'],
134
134
  component: 'obc-automation-tank',
135
135
  args: {
136
136
  value: 9_000,
@@ -5,7 +5,7 @@ import {html} from 'lit';
5
5
 
6
6
  const meta: Meta<typeof ObcBus> = {
7
7
  title: 'Automation/Automation Devices/Bus',
8
- tags: ['autodocs', '6.1', 'wip'],
8
+ tags: ['autodocs', '6.1', 'beta'],
9
9
  component: 'obc-bus',
10
10
  args: {
11
11
  label: 'Title',
@@ -5,7 +5,7 @@ import {crossDecorator} from '../../storybook-util.js';
5
5
 
6
6
  const meta: Meta<typeof ObcCornerLine> = {
7
7
  title: 'Automation/Line/Corner Line',
8
- tags: ['autodocs'],
8
+ tags: ['autodocs', 'deprecated'],
9
9
  decorators: [crossDecorator],
10
10
  component: 'obc-corner-line',
11
11
  args: {},
@@ -5,7 +5,7 @@ import {crossDecorator} from '../../storybook-util.js';
5
5
 
6
6
  const meta: Meta<typeof ObcDirectionLine> = {
7
7
  title: 'Automation/Line/Direction',
8
- tags: ['autodocs'],
8
+ tags: ['autodocs', 'deprecated'],
9
9
  component: 'obc-direction-line',
10
10
  decorators: [crossDecorator],
11
11
  args: {},
@@ -5,7 +5,7 @@ import {crossDecorator} from '../../storybook-util.js';
5
5
 
6
6
  const meta: Meta<typeof ObcEndPointLine> = {
7
7
  title: 'Automation/Line/End Point Line',
8
- tags: ['autodocs'],
8
+ tags: ['autodocs', 'deprecated'],
9
9
  component: 'obc-end-point-line',
10
10
  decorators: [crossDecorator],
11
11
  argTypes: {
@@ -5,7 +5,7 @@ import {crossDecorator} from '../../storybook-util.js';
5
5
 
6
6
  const meta: Meta<typeof ObcHorizontalLine> = {
7
7
  title: 'Automation/Line/Horizontal Line',
8
- tags: ['autodocs'],
8
+ tags: ['autodocs', 'deprecated'],
9
9
  component: 'obc-horizontal-line',
10
10
  decorators: [crossDecorator],
11
11
  argTypes: {
@@ -5,7 +5,7 @@ import {crossDecorator} from '../../storybook-util.js';
5
5
 
6
6
  const meta: Meta<typeof ObcLineCross> = {
7
7
  title: 'Automation/Line/Cross',
8
- tags: ['autodocs'],
8
+ tags: ['autodocs', 'deprecated'],
9
9
  component: 'obc-line-cross',
10
10
  decorators: [crossDecorator],
11
11
  argTypes: {
@@ -5,7 +5,7 @@ import {crossDecorator} from '../../storybook-util.js';
5
5
 
6
6
  const meta: Meta<typeof ObcLineOverlap> = {
7
7
  title: 'Automation/Line/Overlap',
8
- tags: ['autodocs'],
8
+ tags: ['autodocs', 'deprecated'],
9
9
  component: 'obc-line-overlap',
10
10
  args: {},
11
11
  decorators: [crossDecorator],
@@ -5,7 +5,7 @@ import {crossDecorator} from '../../storybook-util.js';
5
5
 
6
6
  const meta: Meta<typeof ObcThreeWayLine> = {
7
7
  title: 'Automation/Line/Three Way Line',
8
- tags: ['autodocs'],
8
+ tags: ['autodocs', 'deprecated'],
9
9
  component: 'obc-three-way-line',
10
10
  decorators: [crossDecorator],
11
11
  argTypes: {
@@ -6,7 +6,7 @@ import {crossDecorator} from '../../storybook-util.js';
6
6
 
7
7
  const meta: Meta<typeof ObcVerticalLine> = {
8
8
  title: 'Automation/Line/Vertical Line',
9
- tags: ['autodocs'],
9
+ tags: ['autodocs', 'deprecated'],
10
10
  component: 'obc-vertical-line',
11
11
  argTypes: {
12
12
  medium: {
@@ -3,7 +3,8 @@ import {property} from 'lit/decorators.js';
3
3
  import {LineMedium, lineColor, LineType, lineWidth} from '../index.js';
4
4
  import {customElement} from '../../decorator.js';
5
5
 
6
- /* Vertical line component
6
+ /**
7
+ * Vertical line component
7
8
  *
8
9
  * The vertical line is 24px * length + 1px. +1 px to make sure that connecting lines are overlapping, to hide the gap between them.
9
10
  * @deprecated