bitboss-ui 3.0.0-beta.73 → 3.0.0-beta.75

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 (345) hide show
  1. package/README.md +4 -2
  2. package/bin/bitboss-ui-mcp.mjs +101 -3
  3. package/bin/bitboss-ui.mjs +6 -1
  4. package/bin/cli.mjs +31 -5
  5. package/dist/ai/BbAvatar.md +86 -58
  6. package/dist/ai/BbBadge.md +5 -5
  7. package/dist/ai/BbBreadcrumbs.md +2 -2
  8. package/dist/ai/BbButton.md +2 -2
  9. package/dist/ai/BbCalendar.md +9 -5
  10. package/dist/ai/BbCheckboxGroup.md +5 -4
  11. package/dist/ai/BbColorInput.md +12 -0
  12. package/dist/ai/BbColorPalette.md +19 -15
  13. package/dist/ai/BbConfirmPortal.md +1 -1
  14. package/dist/ai/BbDatePicker.md +16 -3
  15. package/dist/ai/BbDatePickerInput.md +17 -1
  16. package/dist/ai/BbDialog.md +16 -4
  17. package/dist/ai/BbDropdown.md +175 -67
  18. package/dist/ai/BbDropdownButton.md +27 -8
  19. package/dist/ai/BbForm.md +4 -1
  20. package/dist/ai/BbHoverCardPortal.md +1 -1
  21. package/dist/ai/BbNumberInput.md +8 -4
  22. package/dist/ai/BbPopoverPortal.md +1 -1
  23. package/dist/ai/BbRadioGroup.md +4 -4
  24. package/dist/ai/BbSelect.md +79 -67
  25. package/dist/ai/BbSelectPopover.md +24 -5
  26. package/dist/ai/BbSwitchGroup.md +5 -4
  27. package/dist/ai/BbTable.md +59 -34
  28. package/dist/ai/BbTimePicker.md +16 -3
  29. package/dist/ai/BbTimePickerInput.md +15 -1
  30. package/dist/ai/BbToast.md +3 -2
  31. package/dist/ai/BbToastPortal.md +1 -1
  32. package/dist/ai/BbTree.md +5 -1
  33. package/dist/ai/CommonPopover.md +1 -0
  34. package/dist/ai/FlatListBox.md +1 -0
  35. package/dist/ai/GroupedListBox.md +1 -0
  36. package/dist/ai/ListBox.md +1 -0
  37. package/dist/ai/OptionsContainer.md +4 -4
  38. package/dist/ai/changelog.json +215 -6
  39. package/dist/ai/components.json +77 -43
  40. package/dist/ai/composables/useToast.md +2 -2
  41. package/dist/ai/design-tokens.json +60 -0
  42. package/dist/ai/guides/agent-contract.md +8 -4
  43. package/dist/ai/guides/design-tokens.md +33 -0
  44. package/dist/ai/guides/eslint-rules.md +1 -1
  45. package/dist/ai/guides/fetch-items-playbook.md +7 -11
  46. package/dist/ai/guides/inertia-helpers.md +613 -53
  47. package/dist/ai/guides/migration/adoption-checklist.md +5 -5
  48. package/dist/ai/guides/migration/components/bb-color-palette.md +11 -11
  49. package/dist/ai/guides/migration/components/bb-dropdown-button.md +1 -0
  50. package/dist/ai/guides/migration/components/bb-dropdown.md +1 -0
  51. package/dist/ai/guides/migration/components/bb-table.md +2 -1
  52. package/dist/ai/guides/migration/components/bb-toast.md +2 -2
  53. package/dist/ai/guides/migration/v2-to-v3.md +46 -5
  54. package/dist/ai/guides/migration/v3-beta-tooling.md +4 -0
  55. package/dist/ai/guides/passthrough.md +3 -3
  56. package/dist/ai/guides/preset-components.md +15 -2
  57. package/dist/ai/guides/reporting.md +49 -0
  58. package/dist/ai/helpers/inertia/manifest.json +33 -38
  59. package/dist/ai/helpers/inertia/useHasChanged.ts +25 -37
  60. package/dist/ai/helpers/inertia/useQuery.ts +24 -6
  61. package/dist/ai/helpers/inertia/utils.ts +552 -3
  62. package/dist/ai/index.md +2 -1
  63. package/dist/ai/manifest/common.json +1 -0
  64. package/dist/ai/manifest/components/BbAlert.tree.json +1 -1
  65. package/dist/ai/manifest/components/BbAvatar.json +5 -2
  66. package/dist/ai/manifest/components/BbAvatar.tree.json +32 -2
  67. package/dist/ai/manifest/components/BbCalendar.json +2 -2
  68. package/dist/ai/manifest/components/BbCarousel.json +0 -3
  69. package/dist/ai/manifest/components/BbCheckboxGroup.json +2 -2
  70. package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +2 -0
  71. package/dist/ai/manifest/components/BbColorInput.json +5 -2
  72. package/dist/ai/manifest/components/BbColorPalette.json +7 -4
  73. package/dist/ai/manifest/components/BbColorPalette.removed.json +1 -2
  74. package/dist/ai/manifest/components/BbConfirmPortal.json +1 -1
  75. package/dist/ai/manifest/components/BbDatePicker.json +6 -3
  76. package/dist/ai/manifest/components/BbDatePickerInput.json +3 -0
  77. package/dist/ai/manifest/components/BbDialog.tree.json +7 -1
  78. package/dist/ai/manifest/components/BbDropdown.json +23 -17
  79. package/dist/ai/manifest/components/BbDropdown.removed.json +2 -1
  80. package/dist/ai/manifest/components/BbDropdown.tree.json +16 -5
  81. package/dist/ai/manifest/components/BbDropdownButton.json +15 -9
  82. package/dist/ai/manifest/components/BbDropdownButton.removed.json +2 -1
  83. package/dist/ai/manifest/components/BbDropdownButton.tree.json +2 -0
  84. package/dist/ai/manifest/components/BbForm.json +1 -1
  85. package/dist/ai/manifest/components/BbHoverCard.json +1 -1
  86. package/dist/ai/manifest/components/BbHoverCardPortal.json +1 -1
  87. package/dist/ai/manifest/components/BbNumberInput.json +1 -1
  88. package/dist/ai/manifest/components/BbOffCanvas.tree.json +2 -0
  89. package/dist/ai/manifest/components/BbPopover.json +1 -1
  90. package/dist/ai/manifest/components/BbPopoverPortal.json +1 -1
  91. package/dist/ai/manifest/components/BbRadioGroup.json +2 -2
  92. package/dist/ai/manifest/components/BbRadioGroup.tree.json +2 -0
  93. package/dist/ai/manifest/components/BbSelect.json +10 -7
  94. package/dist/ai/manifest/components/BbSelectPopover.json +7 -4
  95. package/dist/ai/manifest/components/BbSelectPopover.tree.json +5 -1
  96. package/dist/ai/manifest/components/BbSwitchGroup.json +2 -2
  97. package/dist/ai/manifest/components/BbSwitchGroup.tree.json +2 -0
  98. package/dist/ai/manifest/components/BbTable.json +6 -6
  99. package/dist/ai/manifest/components/BbTable.tree.json +16 -6
  100. package/dist/ai/manifest/components/BbTimePicker.json +7 -4
  101. package/dist/ai/manifest/components/BbTimePickerInput.json +5 -2
  102. package/dist/ai/manifest/components/BbToastPortal.json +1 -1
  103. package/dist/ai/manifest/components/BbTree.json +1 -1
  104. package/dist/ai/manifest/components/CommonPopover.json +2 -1
  105. package/dist/ai/manifest/components/FlatListBox.json +2 -1
  106. package/dist/ai/manifest/components/GroupedListBox.json +2 -1
  107. package/dist/ai/manifest/components/ListBox.json +2 -1
  108. package/dist/ai/manifest/components/OptionsContainer.json +6 -4
  109. package/dist/ai/manifest/index.json +2 -2
  110. package/dist/ai/manifest/meta.json +36 -3
  111. package/dist/ai/manifest/types.advanced.json +81 -80
  112. package/dist/ai/manifest/types.api.json +64 -65
  113. package/dist/ai/manifest/types.wrapper.json +155 -118
  114. package/dist/ai/recipes/inertia/layout-scaffold.md +3 -1
  115. package/dist/ai/recipes/nuxt/layout-scaffold.md +3 -1
  116. package/dist/ai/recipes/vue/layout-scaffold.md +3 -1
  117. package/dist/ai/source/BbAlert.md +16 -4
  118. package/dist/ai/source/BbAvatar.md +121 -9
  119. package/dist/ai/source/BbBadge.md +12 -5
  120. package/dist/ai/source/BbBreadcrumbs.md +56 -55
  121. package/dist/ai/source/BbButton.md +41 -25
  122. package/dist/ai/source/BbCalendar.md +22 -12
  123. package/dist/ai/source/BbCarousel.md +31 -28
  124. package/dist/ai/source/BbCheckboxGroup.md +15 -9
  125. package/dist/ai/source/BbColorInput.md +19 -0
  126. package/dist/ai/source/BbColorPalette.md +59 -12
  127. package/dist/ai/source/BbConfirm.md +7 -0
  128. package/dist/ai/source/BbConfirmPortal.md +9 -4
  129. package/dist/ai/source/BbDatePicker.md +71 -22
  130. package/dist/ai/source/BbDatePickerInput.md +72 -9
  131. package/dist/ai/source/BbDialog.md +45 -2
  132. package/dist/ai/source/BbDropdown.md +263 -63
  133. package/dist/ai/source/BbDropdownButton.md +27 -2
  134. package/dist/ai/source/BbDropdownGroup.md +121 -59
  135. package/dist/ai/source/BbForm.md +73 -6
  136. package/dist/ai/source/BbGallery.md +76 -55
  137. package/dist/ai/source/BbHost.md +12 -0
  138. package/dist/ai/source/BbHoverCard.md +7 -0
  139. package/dist/ai/source/BbHoverCardPortal.md +9 -5
  140. package/dist/ai/source/BbNumberInput.md +22 -16
  141. package/dist/ai/source/BbOffCanvas.md +48 -2
  142. package/dist/ai/source/BbPopover.md +7 -0
  143. package/dist/ai/source/BbPopoverPortal.md +9 -5
  144. package/dist/ai/source/BbRadio.md +4 -3
  145. package/dist/ai/source/BbRadioGroup.md +19 -10
  146. package/dist/ai/source/BbSelect.md +35 -20
  147. package/dist/ai/source/BbSelectPopover.md +116 -8
  148. package/dist/ai/source/BbSwitchGroup.md +11 -4
  149. package/dist/ai/source/BbTable.md +126 -32
  150. package/dist/ai/source/BbTag.md +10 -3
  151. package/dist/ai/source/BbTimePicker.md +69 -15
  152. package/dist/ai/source/BbTimePickerInput.md +45 -7
  153. package/dist/ai/source/BbToast.md +16 -2
  154. package/dist/ai/source/BbToastPortal.md +18 -6
  155. package/dist/ai/source/BbTree.md +1 -1
  156. package/dist/ai/source/CommonFieldInput.md +11 -5
  157. package/dist/ai/source/CommonPopover.md +28 -2
  158. package/dist/ai/source/FlatListBox.md +26 -5
  159. package/dist/ai/source/GroupedListBox.md +63 -11
  160. package/dist/ai/source/ListBox.md +4 -0
  161. package/dist/ai/source/OptionsContainer.md +29 -11
  162. package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +31 -26
  163. package/dist/components/BbAvatar/BbAvatar.vue.d.ts +1 -0
  164. package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +61 -43
  165. package/dist/components/BbAvatar/avatarIdentity.js +25 -0
  166. package/dist/components/BbAvatar/ptKeys.generated.d.ts +5 -1
  167. package/dist/components/BbAvatar/types.d.ts +24 -5
  168. package/dist/components/BbAvatar/types.js +5 -1
  169. package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +24 -23
  170. package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +80 -79
  171. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +152 -158
  172. package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +100 -85
  173. package/dist/components/BbCalendar/BbCalendar.vue.d.ts +1 -1
  174. package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +235 -234
  175. package/dist/components/BbCalendar/types.d.ts +2 -2
  176. package/dist/components/BbCalendar/useDayGrid.js +120 -123
  177. package/dist/components/BbCalendar/useDayjsLocale.js +11 -8
  178. package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +7 -7
  179. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +126 -122
  180. package/dist/components/BbCheckboxGroup/types.d.ts +7 -11
  181. package/dist/components/BbColorInput/BbColorInput.vue.d.ts +2 -0
  182. package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +148 -141
  183. package/dist/components/BbColorInput/types.d.ts +7 -0
  184. package/dist/components/BbColorPalette/BbColorPalette.vue.d.ts +2 -0
  185. package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +239 -223
  186. package/dist/components/BbColorPalette/types.d.ts +8 -1
  187. package/dist/components/BbConfirm/BbConfirmPortal.vue.d.ts +2 -4
  188. package/dist/components/BbConfirm/types.d.ts +5 -0
  189. package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +4 -2
  190. package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +160 -143
  191. package/dist/components/BbDatePicker/types.d.ts +9 -2
  192. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +3 -1
  193. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +483 -496
  194. package/dist/components/BbDatePickerInput/types.d.ts +7 -0
  195. package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +252 -236
  196. package/dist/components/BbDialog/leaveGhost.js +38 -0
  197. package/dist/components/BbDialog/overlayActions.js +34 -20
  198. package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +92 -87
  199. package/dist/components/BbDropdown/BbDropdown.vue.d.ts +3 -0
  200. package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +419 -368
  201. package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +384 -340
  202. package/dist/components/BbDropdown/DropdownFailures.vue.js +4 -0
  203. package/dist/components/BbDropdown/DropdownFailures.vue_vue_type_script_setup_true_lang.js +24 -0
  204. package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +133 -119
  205. package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +73 -45
  206. package/dist/components/BbDropdown/normalizeGroups.js +6 -2
  207. package/dist/components/BbDropdown/ptKeys.generated.d.ts +8 -0
  208. package/dist/components/BbDropdown/types.d.ts +73 -58
  209. package/dist/components/BbDropdown/types.js +1 -0
  210. package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +2 -0
  211. package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +93 -72
  212. package/dist/components/BbDropdownButton/ptKeys.generated.d.ts +48 -0
  213. package/dist/components/BbDropdownButton/types.d.ts +13 -2
  214. package/dist/components/BbDropdownButton/types.js +2 -0
  215. package/dist/components/BbForm/BbForm.vue.d.ts +2 -21
  216. package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +229 -227
  217. package/dist/components/BbForm/types.d.ts +31 -0
  218. package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +318 -296
  219. package/dist/components/BbHost/BbHost.vue_vue_type_script_setup_true_lang.js +7 -1
  220. package/dist/components/BbHoverCard/BbHoverCardPortal.vue.d.ts +2 -5
  221. package/dist/components/BbHoverCard/types.d.ts +5 -0
  222. package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +10 -6
  223. package/dist/components/BbNumberInput/numberDisplay.js +102 -106
  224. package/dist/components/BbNumberInput/types.d.ts +4 -3
  225. package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +425 -409
  226. package/dist/components/BbPopover/BbPopoverPortal.vue.d.ts +2 -5
  227. package/dist/components/BbPopover/types.d.ts +5 -0
  228. package/dist/components/BbRadio/types.d.ts +4 -3
  229. package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +108 -106
  230. package/dist/components/BbRadioGroup/types.d.ts +4 -7
  231. package/dist/components/BbSelect/BbSelect.vue.d.ts +3 -1
  232. package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +167 -163
  233. package/dist/components/BbSelect/types.d.ts +23 -20
  234. package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +3 -1
  235. package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +680 -637
  236. package/dist/components/BbSelectPopover/types.d.ts +10 -4
  237. package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +159 -155
  238. package/dist/components/BbSwitchGroup/types.d.ts +3 -6
  239. package/dist/components/BbTable/BbTable.vue.d.ts +1 -3
  240. package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1182 -1165
  241. package/dist/components/BbTable/BbTableDataRow.js +96 -96
  242. package/dist/components/BbTable/types.d.ts +11 -10
  243. package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +9 -3
  244. package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +4 -2
  245. package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +157 -140
  246. package/dist/components/BbTimePicker/types.d.ts +9 -2
  247. package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +3 -1
  248. package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +278 -268
  249. package/dist/components/BbTimePickerInput/types.d.ts +7 -0
  250. package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +12 -12
  251. package/dist/components/BbToast/BbToastPortal.vue.d.ts +2 -4
  252. package/dist/components/BbToast/types.d.ts +7 -2
  253. package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +56 -46
  254. package/dist/components/BbTree/types.d.ts +1 -1
  255. package/dist/components/CommonFieldInput/CommonFieldInput.vue_vue_type_script_setup_true_lang.js +36 -36
  256. package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +14 -2
  257. package/dist/components/CommonTimeSelector/useMeridiem.js +6 -6
  258. package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +115 -96
  259. package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +194 -166
  260. package/dist/components/ListBox/ListBox.vue_vue_type_script_setup_true_lang.js +7 -4
  261. package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +86 -77
  262. package/dist/composables/formSubmitLock.js +2 -1
  263. package/dist/composables/overlayRegistry.js +52 -42
  264. package/dist/composables/useActiveInactiveState.js +8 -4
  265. package/dist/composables/useBbDialog.js +5 -5
  266. package/dist/composables/useItemsGetter.js +34 -32
  267. package/dist/composables/useOpenModel.js +20 -0
  268. package/dist/composables/useOwnModel.js +16 -0
  269. package/dist/composables/useSegmentedFields.js +31 -20
  270. package/dist/deprecation/ai-deprecations.json.js +1 -1
  271. package/dist/i18n/currencyDigits.js +58 -0
  272. package/dist/i18n/locales/ar.json +2 -0
  273. package/dist/i18n/locales/cs.json +2 -0
  274. package/dist/i18n/locales/da.json +2 -0
  275. package/dist/i18n/locales/de-CH.json +2 -0
  276. package/dist/i18n/locales/de.json +2 -0
  277. package/dist/i18n/locales/el.json +2 -0
  278. package/dist/i18n/locales/en-GB.json +2 -0
  279. package/dist/i18n/locales/en.json +2 -0
  280. package/dist/i18n/locales/es-MX.json +2 -0
  281. package/dist/i18n/locales/es.json +2 -0
  282. package/dist/i18n/locales/fa.json +2 -0
  283. package/dist/i18n/locales/fi.json +2 -0
  284. package/dist/i18n/locales/fr.json +2 -0
  285. package/dist/i18n/locales/he.json +2 -0
  286. package/dist/i18n/locales/hu.json +2 -0
  287. package/dist/i18n/locales/it.json +2 -0
  288. package/dist/i18n/locales/ja.json +2 -0
  289. package/dist/i18n/locales/ko.json +2 -0
  290. package/dist/i18n/locales/nb.json +2 -0
  291. package/dist/i18n/locales/nl.json +2 -0
  292. package/dist/i18n/locales/pl.json +2 -0
  293. package/dist/i18n/locales/pt-BR.json +2 -0
  294. package/dist/i18n/locales/pt-PT.json +2 -0
  295. package/dist/i18n/locales/ro.json +2 -0
  296. package/dist/i18n/locales/ru.json +2 -0
  297. package/dist/i18n/locales/sv.json +2 -0
  298. package/dist/i18n/locales/tr.json +2 -0
  299. package/dist/i18n/locales/uk.json +2 -0
  300. package/dist/i18n/locales/zh-CN.json +2 -0
  301. package/dist/i18n/locales/zh-HK.json +2 -0
  302. package/dist/i18n/locales/zh-TW.json +2 -0
  303. package/dist/i18n/regionDates.js +250 -0
  304. package/dist/i18n/regionHints.js +30 -41
  305. package/dist/icon-scan.js +68 -61
  306. package/dist/index.d.ts +35 -31
  307. package/dist/llms-full.txt +1428 -400
  308. package/dist/llms-medium.txt +8 -4
  309. package/dist/llms.txt +4 -2
  310. package/dist/locale-blueprint.json +2 -0
  311. package/dist/styles.css +2 -2
  312. package/dist/types/ActionButton.d.ts +2 -1
  313. package/dist/types/CommonProps.d.ts +8 -0
  314. package/dist/types/Option.d.ts +10 -0
  315. package/dist/types/ptComponentMap.d.ts +3 -3
  316. package/dist/utilities/functions/hash.js +97 -64
  317. package/dist/utilities/functions/isEqual.js +33 -25
  318. package/dist/utilities/functions/slotContent.js +19 -0
  319. package/dist/utils/loadRetry.js +8 -0
  320. package/dist/utils/versionCheck.js +1 -1
  321. package/dist/vite-plugin.d.ts +2 -1
  322. package/dist/vite.js +11 -4
  323. package/llms.txt +4 -2
  324. package/package.json +3 -2
  325. package/scripts/README.md +3 -1
  326. package/scripts/lib/adoption-checklist.json +6 -5
  327. package/scripts/lib/agent-manifest.mjs +33 -6
  328. package/scripts/lib/agent-setup.mjs +90 -24
  329. package/scripts/lib/cldr-pins.ts +182 -0
  330. package/scripts/lib/engines-include.d.mts +5 -0
  331. package/scripts/lib/engines-include.mjs +40 -0
  332. package/scripts/lib/eslint-plugin.mjs +8 -2
  333. package/scripts/lib/hidden-label-placeholder.mjs +25 -5
  334. package/scripts/lib/idiom-scan.mjs +30 -3
  335. package/scripts/lib/legacy-agent-files.json +152 -0
  336. package/scripts/lib/mcp-config.mjs +74 -7
  337. package/scripts/lib/portal-names.mjs +78 -8
  338. package/scripts/lib/release-results.mjs +5 -2
  339. package/scripts/lib/report.mjs +340 -0
  340. package/scripts/lib/run-beat.mjs +14 -0
  341. package/scripts/lib/run-records.mjs +313 -0
  342. package/scripts/lib/selector-log.mjs +98 -0
  343. package/scripts/lib/ticket-beat.mjs +30 -0
  344. package/scripts/lib/validate-bb-markup.mjs +37 -2
  345. package/dist/ai/manifest/components/BbAvatar.removed.json +0 -6
@@ -20,7 +20,8 @@
20
20
  * (`tree`, `css`, `cssProps`);
21
21
  * - `components/<Name>.removed.json`: its `removed` rows, the old names a
22
22
  * migration reads (`renamed` is rebuilt from them, see `renamedFrom`);
23
- * - `types.<usage>.json`: the public types no component's API names;
23
+ * - `types.<usage>.json`: the public types no component's API names, by
24
+ * usage tier (the file's top-level `usage`; its rows leave it out);
24
25
  * - `meta.json`: the directives, composables and the global `css` section.
25
26
  *
26
27
  * Lossless by construction and by test: `rebuildManifest` puts every file back
@@ -471,6 +472,24 @@ function dropDefaults(type) {
471
472
  return out;
472
473
  }
473
474
 
475
+ /**
476
+ * Every row of a `types.<usage>.json` file has that file's usage: said once,
477
+ * at the top, and put back as each row's second key by `restoreUsage`.
478
+ */
479
+ function dropUsage(type, usage) {
480
+ const [first, second] = Object.keys(type);
481
+ if (first !== 'name' || second !== 'usage' || type.usage !== usage)
482
+ return type;
483
+ const { usage: _usage, ...rest } = type;
484
+ return rest;
485
+ }
486
+
487
+ function restoreUsage(stored, usage) {
488
+ if (usage === undefined || 'usage' in stored) return stored;
489
+ const { name, ...rest } = stored;
490
+ return { name, usage, ...rest };
491
+ }
492
+
474
493
  function restoreDefaults(stored) {
475
494
  if ('component' in stored && 'usedBy' in stored) return stored;
476
495
  const { name, usage, component = null, usedBy = [], ...rest } = stored;
@@ -704,8 +723,15 @@ export function buildAgentTier(manifest) {
704
723
  const file = `types.${type.usage ?? 'other'}.json`;
705
724
  (typeFiles[file] ??= []).push(type);
706
725
  }
707
- for (const [file, types] of Object.entries(typeFiles))
708
- files.set(file, { types: types.map(compactUsedBy) });
726
+ for (const [file, types] of Object.entries(typeFiles)) {
727
+ const usage = types[0].usage;
728
+ files.set(
729
+ file,
730
+ typeof usage === 'string'
731
+ ? { usage, types: types.map((t) => dropUsage(compactUsedBy(t), usage)) }
732
+ : { types: types.map(compactUsedBy) }
733
+ );
734
+ }
709
735
  files.set(COMMON_FILE, {
710
736
  props: [...common.props.values()].map(optionalType),
711
737
  ptParts: [...common.parts].map(([name, description]) => ({
@@ -771,9 +797,10 @@ export function buildAgentTier(manifest) {
771
797
  export function rebuildManifest(read) {
772
798
  const index = read('index.json');
773
799
  const meta = read(index.files.meta);
774
- const types = index.files.types.flatMap((file) =>
775
- read(file).types.map(expandUsedBy)
776
- );
800
+ const types = index.files.types.flatMap((file) => {
801
+ const { usage, types: rows } = read(file);
802
+ return rows.map((row) => expandUsedBy(restoreUsage(row, usage)));
803
+ });
777
804
  const common = index.files.common ? read(index.files.common) : null;
778
805
  const asIs = new Set(meta.order.typeAsIs ?? []);
779
806
  const withHistory = new Set(meta.order.removed ?? []);
@@ -38,11 +38,18 @@ import {
38
38
  rmSync,
39
39
  } from 'node:fs';
40
40
  import { writeFileAtomicSync } from './atomic-write.mjs';
41
+ import { createHash } from 'node:crypto';
41
42
  import { homedir } from 'node:os';
42
43
  import { dirname, join } from 'node:path';
43
44
  import { fileURLToPath } from 'node:url';
44
45
  import { agentPaths, findYarnPnpRoot } from './pnp.mjs';
45
46
  import { refuseLinkedTarget } from './linked-target.mjs';
47
+ import {
48
+ KIND_DEFINITIONS,
49
+ REPORT_CURL,
50
+ REPORT_KINDS,
51
+ reportingEnabled,
52
+ } from './report.mjs';
46
53
  import {
47
54
  ensureEntry,
48
55
  mcpLaunch,
@@ -97,6 +104,7 @@ export function coreRules({
97
104
  knowledgeBase: KNOWLEDGE_BASE,
98
105
  cli: CLI,
99
106
  mcp: MCP = DEFAULT_MCP,
107
+ report = true,
100
108
  } = DEFAULT_PATHS) {
101
109
  const ROUTER = `${KNOWLEDGE_BASE}/guides/ai-router.md`;
102
110
  const CONTRACT = `${KNOWLEDGE_BASE}/guides/agent-contract.md`;
@@ -119,13 +127,27 @@ export function coreRules({
119
127
  13. **Never name your own components \`Bb…\`** — that prefix is bitboss-ui's. Use your app's prefix (\`App…\`, \`Acme…\`). \`check\` leaves an app's own \`Bb*\` component alone but warns: a future bitboss-ui component could take the name.
120
128
  14. **Set \`locale\` explicitly** in the build plugin (\`bitbossUi({ locale: 'it' })\` / nuxt \`bitboss: { locale: 'it' }\`) for any app that is not English: the built-in strings default to English.
121
129
  15. **After writing bitboss-ui markup**, run \`${CLI} check\` — validates \`Bb*\` usage against the installed \`components.json\` and catches invented/removed props before review. In an edit loop, \`${CLI} check --changed\` checks only the files git sees changed; run the full check before you finish.
122
- 16. **Inertia apps: install the app-side helpers with \`${CLI} add <name>\`** (\`useQueryObject\`, \`usePromiseForm\`, \`useTableContext\`, …; \`${CLI} helpers list\` names them). Never paste them from the guide. If \`add\` or \`helpers update\` refuses, stop and show the user its output and \`${CLI} helpers diff <name>\`; never edit \`bitboss-ui.lock.json\`, and never delete a helper file to get past a refusal.
130
+ 16. **Inertia apps: install the app-side helpers with \`${CLI} add <name>\`** (\`useQueryObject\`, \`usePromiseForm\`, \`useTableContext\`, …; \`${CLI} helpers list\` names them). Never paste them from the guide. If \`add\` or \`helpers update\` refuses, the file holds an edit: show the user its output and \`${CLI} helpers diff <name>\`. To take bitboss-ui's copy, delete the file and run \`${CLI} add <name>\` again, only with the user's OK (their edit is lost). Never edit \`bitboss-ui.lock.json\`.
123
131
 
124
132
  **MCP in a harness with no project config file** (Cline, Muse, JetBrains AI Assistant, the GitHub Copilot coding agent): if the \`bitboss-ui\` tools are not available, ask the user before registering the server in that harness's own settings: name \`${MCP_SERVER_NAME}\`, ${MCP} (the same launch this project's \`.mcp.json\` entry carries when it has one). Cline: \`~/.cline/data/settings/cline_mcp_settings.json\` (\`mcpServers\`). Muse: \`~/.config/muse/settings.json\`. JetBrains AI Assistant: Settings → Tools → AI Assistant → Model Context Protocol. Copilot coding agent: the repository's Settings → Copilot → Coding agent → MCP configuration (\`mcpServers\`, with \`"tools": ["*"]\`).
125
133
 
126
- Never upgrade bitboss-ui on your own. When the user asks for it, run \`${CLI} update\`: it installs the newest release on the app's channel, refreshes these files and lists the breaking changes to fix. Installs refresh these files too (the app's \`postinstall\`).`;
134
+ ${report ? reportingRules(CLI) : ''}Never upgrade bitboss-ui on your own. When the user asks for it, run \`${CLI} update\`: it installs the newest release on the app's channel, refreshes these files and lists the breaking changes to fix. Installs refresh these files too (the app's \`postinstall\`).`;
127
135
  }
128
136
 
137
+ /**
138
+ * The reporting section of the rules, left out when the app turned reporting
139
+ * off (`"bitboss-ui": { "report": false }` in its package.json).
140
+ */
141
+ const reportingRules = (
142
+ CLI
143
+ ) => `**Report what you hit, and keep your workaround.** Whenever you work around bitboss-ui, or hit one of these, report it, then carry on with your workaround (never wait on a fix):
144
+
145
+ ${REPORT_KINDS.map((k) => `- \`${k}\`: ${KIND_DEFINITIONS[k]}`).join('\n')}
146
+
147
+ MCP: \`report_issue\`. CLI: \`${CLI} report --kind <kind> --component <BbName> --expected "…" --actual "…"\` (optional \`--workaround\`, \`--snippet\`; prints the report id and status URL). No install: \`${REPORT_CURL}\`. A minimal repro only: never app data, customer data, secrets or proprietary code.
148
+
149
+ `;
150
+
129
151
  export function agentsFragment(paths) {
130
152
  // A blank line after the start marker and before the end marker: an HTML
131
153
  // comment butting against a heading or a paragraph is not Prettier-stable
@@ -281,12 +303,28 @@ export const HARNESSES = [
281
303
  },
282
304
  ];
283
305
 
284
- /** Files the retired `ai-init` wrote that AGENTS.md now covers. */
306
+ /**
307
+ * Files the retired `ai-init` wrote that AGENTS.md now covers.
308
+ * Deleted only when byte-for-byte a text `ai-init` wrote (the hashes
309
+ * of every shipped one, scripts/lib/legacy-agent-files.json): a copy the team
310
+ * edited still carries our heading but is theirs, so it is kept, with a
311
+ * warning naming it.
312
+ */
285
313
  const LEGACY_FILES = [
286
- // Whole files, ours when they carry our heading.
287
314
  { path: '.cursor/rules/bitboss-ui.mdc', ours: /^# bitboss-ui \(v/m },
288
315
  { path: '.windsurf/rules/bitboss-ui.md', ours: /^# bitboss-ui \(v/m },
289
316
  ];
317
+ const LEGACY_HASHES = JSON.parse(
318
+ readFileSync(new URL('./legacy-agent-files.json', import.meta.url), 'utf-8')
319
+ );
320
+ /** Whether `text` is exactly a file `ai-init` wrote at `path` (CRLF aside). */
321
+ export const isUneditedLegacy = (path, text) =>
322
+ (LEGACY_HASHES[path] ?? []).includes(
323
+ createHash('sha256')
324
+ .update(text.replace(/\r\n/g, '\n'))
325
+ .digest('hex')
326
+ .slice(0, 32)
327
+ );
290
328
  /** Zed reads only the first instruction file it finds, and this one comes before AGENTS.md. */
291
329
  const LEGACY_BLOCKS = [
292
330
  { path: '.github/copilot-instructions.md', header: '# Copilot instructions' },
@@ -410,7 +448,7 @@ const TOML_START = '# bitboss-ui:mcp:start';
410
448
  const TOML_END = '# bitboss-ui:mcp:end';
411
449
  const tomlBlock = (root) => {
412
450
  const { command, args } = mcpLaunch(root);
413
- return `${TOML_START}\n[mcp_servers.${MCP_SERVER_NAME}]\ncommand = ${JSON.stringify(command)}\nargs = ${JSON.stringify(args)}\n${TOML_END}`;
451
+ return `${TOML_START}\n[mcp_servers.${MCP_SERVER_NAME}]\ncommand = ${JSON.stringify(command)}\nargs = [${args.map((a) => JSON.stringify(a)).join(', ')}]\n${TOML_END}`;
414
452
  };
415
453
 
416
454
  const tomlRange = (text) => markedRange(text, TOML_START, TOML_END);
@@ -534,9 +572,18 @@ export function skipReason(root, { env = process.env, automatic = true } = {}) {
534
572
 
535
573
  /**
536
574
  * Bring the project's agent setup in line with `ai`.
575
+ *
576
+ * `cleanup: false` is the dev server's run (the Vite plugin, on dev, build and
577
+ * test starts): it only creates or updates our own marked blocks and files.
578
+ * Everything that deletes or edits a file the team owns — the legacy
579
+ * `ai-init` files, the Copilot block, CLAUDE.md (its `@AGENTS.md` import, or
580
+ * our block when AGENTS.md links to it), and the `ai: false` teardown — runs
581
+ * only on install (the app's postinstall) and `bitboss-ui update` / `setup`.
582
+ *
537
583
  * @param {string} root project root
538
- * @param {{ ai?: boolean, env?: NodeJS.ProcessEnv, home?: string, automatic?: boolean, all?: boolean }} [options]
539
- * `ai: false` removes what we own; `all` sets up every harness, detected or not.
584
+ * @param {{ ai?: boolean, env?: NodeJS.ProcessEnv, home?: string, automatic?: boolean, all?: boolean, cleanup?: boolean }} [options]
585
+ * `ai: false` removes what we own; `all` sets up every harness, detected or
586
+ * not; `cleanup: false` skips every destructive step (default `true`).
540
587
  * @returns {{ skipped?: string, results: { path: string, action: string, reason?: string }[], notes: string[], harnesses: string[] }}
541
588
  */
542
589
  export function syncAgentSetup(root, options = {}) {
@@ -546,6 +593,7 @@ export function syncAgentSetup(root, options = {}) {
546
593
  home = homedir(),
547
594
  automatic = true,
548
595
  all = false,
596
+ cleanup = true,
549
597
  } = options;
550
598
  const skipped = skipReason(root, { env, automatic });
551
599
  if (skipped) return { skipped, results: [], notes: [], harnesses: [] };
@@ -568,21 +616,34 @@ export function syncAgentSetup(root, options = {}) {
568
616
  };
569
617
  const at = (p) => join(root, p);
570
618
 
571
- // Legacy files are dropped either way: AGENTS.md covers them.
572
- for (const { path, ours } of LEGACY_FILES)
573
- if (existsSync(at(path)))
574
- record(path, () => {
575
- refuseLinkedTarget(at(path), root);
576
- if (!ours.test(readFileSync(at(path), 'utf-8'))) return 'unchanged';
577
- rmSync(at(path));
578
- return 'deleted';
579
- });
580
- for (const { path, header } of LEGACY_BLOCKS)
581
- if (existsSync(at(path))) record(path, () => removeBlock(at(path), header));
619
+ // Legacy files are dropped either way (AGENTS.md covers them), but only by
620
+ // an install or an explicit command, never by a dev server start.
621
+ if (cleanup)
622
+ for (const { path, ours } of LEGACY_FILES)
623
+ if (existsSync(at(path)))
624
+ record(path, () => {
625
+ refuseLinkedTarget(at(path), root);
626
+ const text = readFileSync(at(path), 'utf-8');
627
+ if (!ours.test(text)) return 'unchanged';
628
+ if (!isUneditedLegacy(path, text))
629
+ return {
630
+ action: 'kept',
631
+ reason:
632
+ 'edited since bitboss-ui wrote it; AGENTS.md now carries these rules, so delete the bitboss-ui part yourself',
633
+ };
634
+ rmSync(at(path));
635
+ return 'deleted';
636
+ });
637
+ if (cleanup)
638
+ for (const { path, header } of LEGACY_BLOCKS)
639
+ if (existsSync(at(path)))
640
+ record(path, () => removeBlock(at(path), header));
582
641
 
583
642
  // AGENTS.md is a link to CLAUDE.md: the rules live in CLAUDE.md itself.
584
643
  const agentsInClaude = linksTo(root, 'AGENTS.md', 'CLAUDE.md');
585
644
 
645
+ // The `ai: false` teardown deletes and edits files: install and `update` only.
646
+ if (!ai && !cleanup) return { results, notes: [], harnesses: [] };
586
647
  if (!ai) {
587
648
  if (agentsInClaude)
588
649
  record('AGENTS.md', () => ({
@@ -631,17 +692,21 @@ export function syncAgentSetup(root, options = {}) {
631
692
  const paths = {
632
693
  ...agentPaths(root, PACKAGE_ROOT),
633
694
  mcp: globalMcpRegistration(root),
695
+ // `"bitboss-ui": { "report": false }` in the app's package.json: no
696
+ // reporting section, so the next refresh drops it.
697
+ report: reportingEnabled(root),
634
698
  };
635
699
  if (agentsInClaude) {
636
700
  // One file, two names: the whole block goes in it, never an import of
637
- // itself.
701
+ // itself. It is CLAUDE.md, so a dev server start leaves it alone.
638
702
  record('AGENTS.md', () => ({
639
703
  action: 'unchanged',
640
704
  reason: 'links to CLAUDE.md',
641
705
  }));
642
- record('CLAUDE.md', () =>
643
- upsertBlock(at('CLAUDE.md'), agentsFragment(paths))
644
- );
706
+ if (cleanup)
707
+ record('CLAUDE.md', () =>
708
+ upsertBlock(at('CLAUDE.md'), agentsFragment(paths))
709
+ );
645
710
  } else
646
711
  record('AGENTS.md', () =>
647
712
  upsertBlock(
@@ -650,8 +715,9 @@ export function syncAgentSetup(root, options = {}) {
650
715
  '# Agent Instructions'
651
716
  )
652
717
  );
653
- // CLAUDE.md that imports AGENTS.md itself keeps its own import.
654
- if (!agentsInClaude)
718
+ // CLAUDE.md that imports AGENTS.md itself keeps its own import. Adding the
719
+ // import edits the team's CLAUDE.md: install and `update` only.
720
+ if (!agentsInClaude && cleanup)
655
721
  record('CLAUDE.md', () => {
656
722
  const path = at('CLAUDE.md');
657
723
  // `CLAUDE.md -> AGENTS.md`: Claude Code already reads our block.
@@ -0,0 +1,182 @@
1
+ /**
2
+ * The CLDR data the library pins at ITS release, derived from the
3
+ * running Node's `Intl` (run the generator on the newest Node: its CLDR is
4
+ * stamped into the output). Pure functions, shared by
5
+ * `scripts/generate-cldr-pins.ts` and the tests that check the committed
6
+ * tables against the CLDR that wrote them.
7
+ */
8
+
9
+ /** The running CLDR version (`'48.0'`). */
10
+ export const runningCldr = (): string => process.versions.cldr ?? '0';
11
+
12
+ /** `'47.0'` < `'48.0'`, numerically. */
13
+ export const compareCldr = (a: string, b: string): number => {
14
+ const [aMajor = 0, aMinor = 0] = a.split('.').map(Number);
15
+ const [bMajor = 0, bMinor = 0] = b.split('.').map(Number);
16
+ return aMajor - bMajor || aMinor - bMinor;
17
+ };
18
+
19
+ /**
20
+ * Every currency code whose fraction digits are not 2, with its digits. All
21
+ * 17,576 three-letter codes are asked, not only `supportedValuesOf`, which
22
+ * leaves out codes ICU still knows (CLF: 4).
23
+ */
24
+ export const currencyDigitsTable = (): Record<string, number> => {
25
+ const table: Record<string, number> = {};
26
+ const A = 'A'.charCodeAt(0);
27
+ for (let i = 0; i < 26 ** 3; i++) {
28
+ const code = String.fromCharCode(
29
+ A + Math.floor(i / 676),
30
+ A + (Math.floor(i / 26) % 26),
31
+ A + (i % 26)
32
+ );
33
+ const { maximumFractionDigits: digits = 2 } = new Intl.NumberFormat('en', {
34
+ style: 'currency',
35
+ currency: code,
36
+ }).resolvedOptions();
37
+ if (digits !== 2) table[code] = digits;
38
+ }
39
+ return table;
40
+ };
41
+
42
+ /** LRM, RLM and the Arabic letter mark. */
43
+ const BIDI_MARKS = /[‎‏؜]/g;
44
+ const FIELD_LETTER = { day: 'D', month: 'M', year: 'Y' } as const;
45
+
46
+ /**
47
+ * A tag's numeric field order and separator as a pattern (`D/M/Y`, `Y-M`),
48
+ * or `null` when `Intl` writes no short separator between the fields.
49
+ */
50
+ const intlPattern = (
51
+ tag: string,
52
+ options: Intl.DateTimeFormatOptions
53
+ ): string | null => {
54
+ const parts = new Intl.DateTimeFormat(tag, {
55
+ ...options,
56
+ timeZone: 'UTC',
57
+ }).formatToParts(new Date(Date.UTC(2026, 9, 7)));
58
+ const letters: string[] = [];
59
+ let separator: string | undefined;
60
+ for (const part of parts) {
61
+ if (part.type === 'day' || part.type === 'month' || part.type === 'year')
62
+ letters.push(FIELD_LETTER[part.type]);
63
+ else if (part.type === 'literal' && letters.length === 1)
64
+ separator ??= part.value;
65
+ }
66
+ // Right-to-left tags put bidi marks around the separator (`ar-EG` writes
67
+ // `07‏/10‏/2026`); a hint is plain text, so they go.
68
+ const trimmed = separator?.replace(BIDI_MARKS, '').trim();
69
+ return trimmed && trimmed.length <= 2 && !/[DMY]/.test(trimmed)
70
+ ? letters.join(trimmed)
71
+ : null;
72
+ };
73
+
74
+ /** The tag's abbreviated day period at 03:00 or 15:00. */
75
+ const dayPeriod = (tag: string, hour: number) =>
76
+ new Intl.DateTimeFormat(tag, {
77
+ hour: 'numeric',
78
+ hourCycle: 'h12',
79
+ timeZone: 'UTC',
80
+ })
81
+ .formatToParts(new Date(Date.UTC(2026, 9, 7, hour)))
82
+ .find((part) => part.type === 'dayPeriod')?.value;
83
+
84
+ /**
85
+ * The date-entry facts of each tag, as the running CLDR writes them: numeric
86
+ * date and month patterns and the AM / PM words. Tags whose facts cannot be
87
+ * read are left out (the plugin then keeps the dictionary's hints).
88
+ */
89
+ export const regionDatesTable = (
90
+ tags: readonly string[]
91
+ ): Record<string, { date: string; month: string; am: string; pm: string }> => {
92
+ const table: Record<
93
+ string,
94
+ { date: string; month: string; am: string; pm: string }
95
+ > = {};
96
+ for (const tag of [...new Set(tags)].sort()) {
97
+ const date = intlPattern(tag, {
98
+ day: '2-digit',
99
+ month: '2-digit',
100
+ year: 'numeric',
101
+ });
102
+ const month = intlPattern(tag, { month: '2-digit', year: 'numeric' });
103
+ const am = dayPeriod(tag, 3);
104
+ const pm = dayPeriod(tag, 15);
105
+ if (date && month && am && pm) table[tag] = { date, month, am, pm };
106
+ }
107
+ return table;
108
+ };
109
+
110
+ /** One pinned entry that the running CLDR writes differently. */
111
+ export interface PinChange {
112
+ table: 'currency digits' | 'region dates';
113
+ key: string;
114
+ was: string;
115
+ now: string;
116
+ }
117
+
118
+ /**
119
+ * What changed between the committed pins and the running CLDR's, sorted by
120
+ * table and key. A currency missing from its table has 2 digits; a tag
121
+ * missing from the region table is `not pinned`.
122
+ */
123
+ export const diffPins = (
124
+ committed: {
125
+ currency: Readonly<Record<string, number>>;
126
+ regions: Readonly<Record<string, object>>;
127
+ },
128
+ live: {
129
+ currency: Readonly<Record<string, number>>;
130
+ regions: Readonly<Record<string, object>>;
131
+ }
132
+ ): PinChange[] => {
133
+ const changes: PinChange[] = [];
134
+ const keys = (a: object, b: object) =>
135
+ [...new Set([...Object.keys(a), ...Object.keys(b)])].sort();
136
+ for (const code of keys(committed.currency, live.currency)) {
137
+ const was = committed.currency[code] ?? 2;
138
+ const now = live.currency[code] ?? 2;
139
+ if (was !== now)
140
+ changes.push({
141
+ table: 'currency digits',
142
+ key: code,
143
+ was: String(was),
144
+ now: String(now),
145
+ });
146
+ }
147
+ const show = (row: object | undefined) =>
148
+ row ? JSON.stringify(row) : 'not pinned';
149
+ for (const tag of keys(committed.regions, live.regions)) {
150
+ const was = show(committed.regions[tag]);
151
+ const now = show(live.regions[tag]);
152
+ if (was !== now)
153
+ changes.push({ table: 'region dates', key: tag, was, now });
154
+ }
155
+ return changes;
156
+ };
157
+
158
+ /** The drift report, as Markdown (a CI step summary reads it as is). */
159
+ export const driftReport = (
160
+ changes: readonly PinChange[],
161
+ pinned: string,
162
+ running: string
163
+ ): string => {
164
+ if (!changes.length)
165
+ return `### CLDR drift: none\n\nCLDR ${running} writes every pinned value as the committed tables (CLDR ${pinned}) do.\n`;
166
+ const rows = changes.map(
167
+ ({ table, key, was, now }) =>
168
+ `| ${table} | \`${key}\` | \`${was}\` | \`${now}\` |`
169
+ );
170
+ return [
171
+ `### CLDR drift: ${changes.length} pinned value(s) changed`,
172
+ '',
173
+ `The committed tables come from CLDR ${pinned}; this Node runs CLDR ${running}.`,
174
+ 'Review each row, then regenerate on this Node:',
175
+ '`node --experimental-strip-types scripts/generate-cldr-pins.ts`, and release.',
176
+ '',
177
+ '| table | key | pinned | now |',
178
+ '| --- | --- | --- | --- |',
179
+ ...rows,
180
+ '',
181
+ ].join('\n');
182
+ };
@@ -0,0 +1,5 @@
1
+ /** Types for `engines-include.mjs`, which `vitest.engines-gate.config.ts` imports. */
2
+ export function readEnginesInclude(
3
+ value: string | undefined,
4
+ root?: string
5
+ ): string[] | null;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * BB_ENGINES_INCLUDE: the path of a file listing the test files (or test
3
+ * globs) the engines gate runs instead of its own list, one per line
4
+ * (scripts/spotlight.mjs writes one). Anything else is refused loudly: a test
5
+ * file passed by mistake reads its comment lines (` * …` → `*`) as globs and
6
+ * starts a full engine run.
7
+ */
8
+ import { existsSync, readFileSync } from 'node:fs';
9
+ import path from 'node:path';
10
+
11
+ const TEST = /\.test\.(?:ts|tsx|mjs|js)$/;
12
+
13
+ /** The listed patterns, `null` when unset; throws on anything not a list. */
14
+ export function readEnginesInclude(value, root = process.cwd()) {
15
+ if (!value) return null;
16
+ const fail = (why) => {
17
+ throw new Error(
18
+ `BB_ENGINES_INCLUDE=${value}: ${why}. It names a file listing test files or test globs, one per line.`
19
+ );
20
+ };
21
+ let text;
22
+ try {
23
+ text = readFileSync(path.resolve(root, value), 'utf8');
24
+ } catch {
25
+ fail('not a readable list file');
26
+ }
27
+ const lines = text.split('\n').map((line) => line.trim());
28
+ const entries = [];
29
+ lines.forEach((line, index) => {
30
+ if (!line) return;
31
+ const at = `line ${index + 1} (${JSON.stringify(line.slice(0, 60))})`;
32
+ if (!TEST.test(line) || line.startsWith('/') || line.includes('..'))
33
+ fail(`${at} is not a test file or test glob`);
34
+ if (!/[*?{[]/.test(line) && !existsSync(path.join(root, line)))
35
+ fail(`${at}: no such test file`);
36
+ entries.push(line);
37
+ });
38
+ if (!entries.length) fail('the list is empty');
39
+ return entries;
40
+ }
@@ -181,6 +181,7 @@ import {
181
181
  import {
182
182
  HIDDEN_LABEL_PLACEHOLDER_MESSAGE,
183
183
  hidesLabelIllegibly,
184
+ valueOnlyAffixOf,
184
185
  isLabellingHost,
185
186
  judgedFieldOf,
186
187
  } from './hidden-label-placeholder.mjs';
@@ -3914,7 +3915,7 @@ const noUnregisteredRule = {
3914
3915
  /**
3915
3916
  * Lanterna OURS-F — the twin of `check`'s `hidden-label-placeholder`: a
3916
3917
  * library field or select with a static `hide-label` and no `placeholder`,
3917
- * `aria-labelledby`, `#prefix` slot or object `v-bind`, outside a BbTable /
3918
+ * `aria-labelledby`, `#prefix` / `#suffix` slot or object `v-bind`, outside a BbTable /
3918
3919
  * BbTree slot and below the template's root; not a `ghost` cell editor, nor
3919
3920
  * a single select that cannot be cleared (it always shows its pick). Sighted users see an
3920
3921
  * empty box with nothing saying what it is for. `warn`: the markup works,
@@ -3989,7 +3990,12 @@ const hiddenLabelPlaceholder = {
3989
3990
  context.report({
3990
3991
  node: node.startTag,
3991
3992
  messageId: 'noPlaceholder',
3992
- data: { message: HIDDEN_LABEL_PLACEHOLDER_MESSAGE(node.rawName) },
3993
+ data: {
3994
+ message: HIDDEN_LABEL_PLACEHOLDER_MESSAGE(
3995
+ node.rawName,
3996
+ valueOnlyAffixOf(attributes)
3997
+ ),
3998
+ },
3993
3999
  });
3994
4000
  },
3995
4001
  });
@@ -9,12 +9,16 @@
9
9
  * `hide-label="true"`, `:hide-label="true"`); a bound condition is not read.
10
10
  * Legible, so not reported: a `placeholder` (static or bound), an
11
11
  * `aria-labelledby` (static or bound: it points at text the page shows), a
12
- * `#prefix` slot (inline text in the box), and an object `v-bind` (it may
12
+ * `#prefix` or `#suffix` slot (inline text in the box), and an object `v-bind` (it may
13
13
  * carry a placeholder). A value the field may hold is not one: a field can be
14
14
  * emptied, a `clearable` or `multiple` select cleared. A single select that is
15
15
  * neither always shows its pick (clicking the pick again re-picks it), so a
16
16
  * placeholder would never show: not reported.
17
17
  *
18
+ * A BbNumberInput `unit` / `currency` is NOT legible: it is painted beside the
19
+ * number, so an empty field shows nothing. Still reported; the message says
20
+ * why (the unit shows only once there is a number).
21
+ *
18
22
  * Not judged either: `variant="ghost"` (static), the guides' inline-edit
19
23
  * table cell (`compact hide-label variant="ghost"`). Its column header labels
20
24
  * it, and a placeholder in a narrow cell is cut anyway.
@@ -42,8 +46,19 @@ export const JUDGED = new Set([
42
46
  'BbTimePickerInput',
43
47
  ]);
44
48
 
45
- export const HIDDEN_LABEL_PLACEHOLDER_MESSAGE = (tag) =>
46
- `\`<${tag}>\` hides its label and has no \`placeholder\`: a screen reader still hears the label, but a sighted user sees an empty box with nothing saying what it is for — add a \`placeholder\` (the label's words will do), or drop \`hide-label\``;
49
+ export const HIDDEN_LABEL_PLACEHOLDER_MESSAGE = (tag, affix = null) =>
50
+ affix
51
+ ? `\`<${tag}>\` hides its label and has no \`placeholder\`: its \`${affix}\` shows only once there is a number, so an empty field is a blank box with nothing saying what it is for — add a \`placeholder\` (the label's words will do) or show the label (drop \`hide-label\`)`
52
+ : `\`<${tag}>\` hides its label and has no \`placeholder\`: a screen reader still hears the label, but a sighted user sees an empty box with nothing saying what it is for — add a \`placeholder\` (the label's words will do), or drop \`hide-label\``;
53
+
54
+ /**
55
+ * The number affix a field paints only beside a value (`unit` / `currency`,
56
+ * static or bound), named in the message; `null` when it has none.
57
+ * @param {Array<{ name: string }>} attributes
58
+ */
59
+ export const valueOnlyAffixOf = (attributes) =>
60
+ attributes.find(({ name }) => name === 'unit' || name === 'currency')?.name ??
61
+ null;
47
62
 
48
63
  const HIDE_LABEL = new Set(['hide-label', 'hideLabel']);
49
64
  const LEGIBLE = new Set(['placeholder', 'aria-labelledby', 'ariaLabelledby']);
@@ -70,7 +85,9 @@ export function hidesLabelIllegibly(attributes, slots, component) {
70
85
  if (!HIDE_LABEL.has(name)) continue;
71
86
  hidden = bound ? text === 'true' : text === '' || text === 'true';
72
87
  }
73
- return hidden && emptiable && !slots.has('prefix');
88
+ // a `#suffix` captions the box as well as a `#prefix`
89
+ // ("days after"): the fields take no prefix / suffix prop, only the slots.
90
+ return hidden && emptiable && !slots.has('prefix') && !slots.has('suffix');
74
91
  }
75
92
 
76
93
  const EMPTIES_A_SELECT = new Set(['clearable', 'multiple']);
@@ -130,7 +147,10 @@ export function hiddenLabelPlaceholderFindings(ast, scope = {}) {
130
147
  kind: 'hidden-label-placeholder',
131
148
  severity: 'warning',
132
149
  line: node.loc?.start?.line,
133
- message: HIDDEN_LABEL_PLACEHOLDER_MESSAGE(node.tag),
150
+ message: HIDDEN_LABEL_PLACEHOLDER_MESSAGE(
151
+ node.tag,
152
+ valueOnlyAffixOf(attributes)
153
+ ),
134
154
  });
135
155
  };
136
156
  // The SFC's own `<template>` sits at the top of the parsed snippet; its
@@ -12,7 +12,7 @@
12
12
  import { readFileSync } from 'node:fs';
13
13
 
14
14
  /**
15
- * @typedef {{ find: string, inFile?: string, notInFile?: string, notInLine?: string, notNear?: string }} Probe
15
+ * @typedef {{ find: string, inFile?: string, notInFile?: string, notInLine?: string, notNear?: string, notAdopted?: boolean }} Probe
16
16
  * @typedef {{ id: string, pattern: string, ext: string[], probes: Probe[], use: string, example: string, note?: string }} Row
17
17
  * @typedef {{ line: number, id: string, use: string }} IdiomHit
18
18
  */
@@ -49,6 +49,26 @@ const joinOpenTags = (lines) =>
49
49
  return joined;
50
50
  });
51
51
 
52
+ /** The library's group controls an app wrapper may render. */
53
+ const LIBRARY_GROUP =
54
+ /<(?:Bb(?:RadioGroup|CheckboxGroup|Tabs)|bb-(?:radio-group|checkbox-group|tabs))[\s/>]/;
55
+
56
+ /**
57
+ * the app's own `.vue` components, by file name, that
58
+ * already render BbRadioGroup / BbCheckboxGroup / BbTabs: a `<SegmentedControl>`
59
+ * built on them is adopted, not hand-rolled.
60
+ * @param {Iterable<[string, string]>} files path, source
61
+ * @returns {Set<string>}
62
+ */
63
+ export function adoptedComponents(files) {
64
+ const out = new Set();
65
+ for (const [path, source] of files) {
66
+ const name = /([^/\\]+)\.vue$/.exec(path)?.[1];
67
+ if (name && LIBRARY_GROUP.test(blankHtmlComments(source))) out.add(name);
68
+ }
69
+ return out;
70
+ }
71
+
52
72
  /** How far below a hit `notNear` looks: the element's first lines. */
53
73
  export const NEAR_LINES = 3;
54
74
 
@@ -62,9 +82,12 @@ export const rowGlob = (row) =>
62
82
  * @param {string} source
63
83
  * @param {string} ext file extension, without the dot
64
84
  * @param {Row[]} rows
85
+ * @param {{ adopted?: Set<string> }} [options] `adopted`: the app components
86
+ * that already render the library's control (`adoptedComponents`); a
87
+ * `notAdopted` probe skips a tag named in it
65
88
  * @returns {IdiomHit[]}
66
89
  */
67
- export function scanIdioms(source, ext, rows) {
90
+ export function scanIdioms(source, ext, rows, { adopted } = {}) {
68
91
  const text = ext === 'vue' ? blankHtmlComments(source) : source;
69
92
  const raw = text.split('\n');
70
93
  const lines = ext === 'vue' ? joinOpenTags(raw) : raw;
@@ -81,7 +104,11 @@ export function scanIdioms(source, ext, rows) {
81
104
  // own loading pattern, not a notice (37 such hits in two apps).
82
105
  const notNear = probe.notNear && new RegExp(probe.notNear);
83
106
  lines.forEach((content, index) => {
84
- if (seen.has(index) || !find.test(content)) return;
107
+ if (seen.has(index)) return;
108
+ const found = find.exec(content);
109
+ if (!found) return;
110
+ // `<SegmentedControl>` that renders BbRadioGroup.
111
+ if (probe.notAdopted && adopted?.has(found[1])) return;
85
112
  if (notInLine && notInLine.test(content)) return;
86
113
  if (
87
114
  notNear &&