bitboss-ui 3.0.0-beta.21 → 3.0.0-beta.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/README.md +55 -3
  2. package/bin/bitboss-ui-mcp.mjs +419 -9
  3. package/bin/bitboss-ui.mjs +293 -22
  4. package/dist/ai/BbAccordion.md +21 -23
  5. package/dist/ai/BbAlert.md +6 -12
  6. package/dist/ai/BbAvatar.md +60 -24
  7. package/dist/ai/BbBadge.md +12 -20
  8. package/dist/ai/BbBaseButton.md +14 -16
  9. package/dist/ai/BbBaseCheckboxIcon.md +6 -10
  10. package/dist/ai/BbBaseColorInput.md +1 -0
  11. package/dist/ai/BbBaseDatePickerInput.md +1 -0
  12. package/dist/ai/BbBaseNumberInput.md +1 -0
  13. package/dist/ai/BbBaseRadioIcon.md +6 -10
  14. package/dist/ai/BbBaseSelect.md +1 -0
  15. package/dist/ai/BbBaseSwitchIcon.md +5 -9
  16. package/dist/ai/BbBaseTag.md +1 -0
  17. package/dist/ai/BbBaseTextInput.md +2 -1
  18. package/dist/ai/BbBaseTextarea.md +1 -0
  19. package/dist/ai/BbBaseTimePickerInput.md +1 -0
  20. package/dist/ai/BbBreadcrumbs.md +23 -34
  21. package/dist/ai/BbButton.md +35 -47
  22. package/dist/ai/BbCheckbox.md +21 -37
  23. package/dist/ai/BbCheckboxGroup.md +13 -13
  24. package/dist/ai/BbCollapsible.md +14 -26
  25. package/dist/ai/BbColorInput.md +27 -23
  26. package/dist/ai/BbColorPalette.md +23 -35
  27. package/dist/ai/BbConfirm.md +17 -32
  28. package/dist/ai/BbDatePickerInput.md +29 -21
  29. package/dist/ai/BbDialog.md +159 -62
  30. package/dist/ai/BbDropdown.md +21 -25
  31. package/dist/ai/BbDropdownButton.md +13 -30
  32. package/dist/ai/BbDropzone.md +9 -11
  33. package/dist/ai/BbIcon.md +44 -33
  34. package/dist/ai/BbIndicator.md +2 -2
  35. package/dist/ai/BbNumberInput.md +32 -20
  36. package/dist/ai/BbOffCanvas.md +42 -42
  37. package/dist/ai/BbPagination.md +21 -23
  38. package/dist/ai/BbPopover.md +15 -17
  39. package/dist/ai/BbProgress.md +40 -51
  40. package/dist/ai/BbRadio.md +9 -9
  41. package/dist/ai/BbRadioGroup.md +7 -11
  42. package/dist/ai/BbRating.md +8 -12
  43. package/dist/ai/BbSelect.md +46 -36
  44. package/dist/ai/BbSelectPopover.md +19 -31
  45. package/dist/ai/BbSlider.md +15 -19
  46. package/dist/ai/BbSmoothHeight.md +16 -31
  47. package/dist/ai/BbSpinner.md +118 -74
  48. package/dist/ai/BbSwitch.md +25 -18
  49. package/dist/ai/BbSwitchGroup.md +9 -14
  50. package/dist/ai/BbTable.md +102 -55
  51. package/dist/ai/BbTabs.md +59 -82
  52. package/dist/ai/BbTag.md +26 -23
  53. package/dist/ai/BbTextInput.md +63 -27
  54. package/dist/ai/BbTextarea.md +42 -34
  55. package/dist/ai/BbTimePickerInput.md +14 -0
  56. package/dist/ai/BbToast.md +14 -34
  57. package/dist/ai/BbTooltip.md +22 -20
  58. package/dist/ai/BbTree.md +46 -72
  59. package/dist/ai/CommonInputWrapper.md +1 -0
  60. package/dist/ai/changelog.json +170 -62
  61. package/dist/ai/components.json +1678 -11
  62. package/dist/ai/composables/useConfirm.md +5 -2
  63. package/dist/ai/composables/useToast.md +4 -2
  64. package/dist/ai/guides/agent-contract.md +7 -4
  65. package/dist/ai/guides/ai-router.md +37 -22
  66. package/dist/ai/guides/component-picker.md +23 -18
  67. package/dist/ai/guides/design-language.md +151 -21
  68. package/dist/ai/guides/design-tokens.md +29 -4
  69. package/dist/ai/guides/icons-policy.md +46 -21
  70. package/dist/ai/guides/installation-and-plugin-setup.md +286 -17
  71. package/dist/ai/guides/migration/components/bb-rating.md +26 -1
  72. package/dist/ai/guides/migration/components/bb-tooltip.md +18 -0
  73. package/dist/ai/guides/migration/v2-to-v3.md +50 -23
  74. package/dist/ai/index.md +1 -1
  75. package/dist/ai/recipes/inertia/approvals-inbox.md +3 -3
  76. package/dist/ai/recipes/inertia/inline-edit-workspace.md +2 -2
  77. package/dist/ai/recipes/inertia/onboarding.md +2 -2
  78. package/dist/ai/recipes/inertia/ownership-atlas.md +6 -6
  79. package/dist/ai/recipes/inertia/record-form.md +5 -5
  80. package/dist/ai/recipes/inertia/records-workspace.md +4 -4
  81. package/dist/ai/recipes/inertia/upload-center.md +6 -6
  82. package/dist/ai/recipes/inertia/wizard-form.md +5 -5
  83. package/dist/ai/recipes/nuxt/approvals-inbox.md +3 -3
  84. package/dist/ai/recipes/nuxt/inline-edit-workspace.md +2 -2
  85. package/dist/ai/recipes/nuxt/onboarding.md +2 -2
  86. package/dist/ai/recipes/nuxt/record-form.md +5 -5
  87. package/dist/ai/recipes/nuxt/records-workspace.md +4 -4
  88. package/dist/ai/recipes/nuxt/upload-center.md +6 -6
  89. package/dist/ai/recipes/nuxt/wizard-form.md +5 -5
  90. package/dist/ai/recipes/vue/approvals-inbox.md +3 -3
  91. package/dist/ai/recipes/vue/inline-edit-workspace.md +2 -2
  92. package/dist/ai/recipes/vue/onboarding.md +2 -2
  93. package/dist/ai/recipes/vue/record-form.md +10 -10
  94. package/dist/ai/recipes/vue/records-workspace.md +4 -4
  95. package/dist/ai/recipes/vue/upload-center.md +6 -6
  96. package/dist/ai/recipes/vue/wizard-form.md +5 -5
  97. package/dist/ai/source/BbBadge.md +1 -1
  98. package/dist/ai/source/BbBaseCheckbox.md +1 -1
  99. package/dist/ai/source/BbBaseColorInput.md +7 -0
  100. package/dist/ai/source/BbBaseDatePicker.md +5 -5
  101. package/dist/ai/source/BbBaseDatePickerInput.md +9 -2
  102. package/dist/ai/source/BbBaseNumberInput.md +7 -0
  103. package/dist/ai/source/BbBaseRadio.md +1 -1
  104. package/dist/ai/source/BbBaseRating.md +5 -5
  105. package/dist/ai/source/BbBaseSelect.md +8 -1
  106. package/dist/ai/source/BbBaseSlider.md +5 -5
  107. package/dist/ai/source/BbBaseSwitch.md +1 -1
  108. package/dist/ai/source/BbBaseTag.md +7 -0
  109. package/dist/ai/source/BbBaseTextInput.md +7 -0
  110. package/dist/ai/source/BbBaseTextarea.md +7 -0
  111. package/dist/ai/source/BbBaseTimePickerInput.md +8 -1
  112. package/dist/ai/source/BbBreadcrumbs.md +20 -1
  113. package/dist/ai/source/BbButton.md +2 -2
  114. package/dist/ai/source/BbColorInput.md +14 -0
  115. package/dist/ai/source/BbDatePickerInput.md +14 -0
  116. package/dist/ai/source/BbDialog.md +39 -8
  117. package/dist/ai/source/BbDropdown.md +1 -1
  118. package/dist/ai/source/BbDropzone.md +5 -5
  119. package/dist/ai/source/BbIcon.md +23 -10
  120. package/dist/ai/source/BbNumberInput.md +14 -0
  121. package/dist/ai/source/BbOffCanvas.md +50 -28
  122. package/dist/ai/source/BbPagination.md +2 -2
  123. package/dist/ai/source/BbPopover.md +12 -1
  124. package/dist/ai/source/BbSelect.md +14 -0
  125. package/dist/ai/source/BbSelectPopover.md +45 -7
  126. package/dist/ai/source/BbSpinner.md +2 -2
  127. package/dist/ai/source/BbTable.md +11 -11
  128. package/dist/ai/source/BbTag.md +14 -0
  129. package/dist/ai/source/BbTextInput.md +14 -0
  130. package/dist/ai/source/BbTextarea.md +14 -0
  131. package/dist/ai/source/BbTimePickerInput.md +14 -0
  132. package/dist/ai/source/BbTooltip.md +57 -10
  133. package/dist/ai/source/ChipsBox.md +1 -1
  134. package/dist/ai/source/CommaBox.md +1 -1
  135. package/dist/ai/source/CommonInputWrapper.md +128 -33
  136. package/dist/ai/source/GuidesComponent.md +14 -7
  137. package/dist/ai/source/OptionsContainer.md +1 -1
  138. package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +1 -1
  139. package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +1 -1
  140. package/dist/components/BbBaseCheckbox/BbBaseCheckbox.vue_vue_type_script_setup_true_lang.js +1 -1
  141. package/dist/components/BbBaseColorInput/BbBaseColorInput.vue_vue_type_script_setup_true_lang.js +4 -1
  142. package/dist/components/BbBaseColorInput/types.d.ts +5 -0
  143. package/dist/components/BbBaseDatePicker/BbBaseDatePicker.vue_vue_type_script_setup_true_lang.js +4 -4
  144. package/dist/components/BbBaseDatePicker/BbBaseDatePickerInputDaySelector.vue_vue_type_script_setup_true_lang.js +1 -1
  145. package/dist/components/BbBaseDatePickerInput/BbBaseDatePickerInput.vue_vue_type_script_setup_true_lang.js +5 -2
  146. package/dist/components/BbBaseDatePickerInput/types.d.ts +5 -0
  147. package/dist/components/BbBaseInputContainer/BbBaseInputContainer.vue.d.ts +1 -1
  148. package/dist/components/BbBaseNumberInput/BbBaseNumberInput.vue_vue_type_script_setup_true_lang.js +4 -1
  149. package/dist/components/BbBaseNumberInput/types.d.ts +5 -0
  150. package/dist/components/BbBaseRadio/BbBaseRadio.vue_vue_type_script_setup_true_lang.js +1 -1
  151. package/dist/components/BbBaseRating/BbBaseRating.vue_vue_type_script_setup_true_lang.js +3 -3
  152. package/dist/components/BbBaseSelect/BbBaseSelect.vue_vue_type_script_setup_true_lang.js +4 -1
  153. package/dist/components/BbBaseSelect/types.d.ts +5 -0
  154. package/dist/components/BbBaseSlider/BbBaseSlider.vue_vue_type_script_setup_true_lang.js +3 -3
  155. package/dist/components/BbBaseSwitch/BbBaseSwitch.vue_vue_type_script_setup_true_lang.js +1 -1
  156. package/dist/components/BbBaseTag/BbBaseTag.vue_vue_type_script_setup_true_lang.js +4 -1
  157. package/dist/components/BbBaseTag/types.d.ts +5 -0
  158. package/dist/components/BbBaseTextInput/BbBaseTextInput.vue_vue_type_script_setup_true_lang.js +4 -1
  159. package/dist/components/BbBaseTextInput/types.d.ts +5 -0
  160. package/dist/components/BbBaseTextarea/BbBaseTextarea.vue_vue_type_script_setup_true_lang.js +4 -1
  161. package/dist/components/BbBaseTextarea/types.d.ts +5 -0
  162. package/dist/components/BbBaseTimePickerInput/BbBaseTimePickerInput.vue_vue_type_script_setup_true_lang.js +5 -2
  163. package/dist/components/BbBaseTimePickerInput/types.d.ts +5 -0
  164. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +71 -71
  165. package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +2 -2
  166. package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +5 -2
  167. package/dist/components/BbColorInput/types.d.ts +12 -0
  168. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +4 -2
  169. package/dist/components/BbDatePickerInput/types.d.ts +12 -0
  170. package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +102 -97
  171. package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +1 -1
  172. package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +58 -58
  173. package/dist/components/BbDropzone/BbDropzone.vue_vue_type_script_setup_true_lang.js +2 -2
  174. package/dist/components/BbIcon/BbIcon.vue_vue_type_script_setup_true_lang.js +33 -35
  175. package/dist/components/BbIcon/iconCache.d.ts +30 -0
  176. package/dist/components/BbIcon/iconCache.js +21 -3
  177. package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +5 -2
  178. package/dist/components/BbNumberInput/types.d.ts +12 -0
  179. package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +57 -56
  180. package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +2 -2
  181. package/dist/components/BbPopover/BbPopover.vue_vue_type_script_setup_true_lang.js +138 -138
  182. package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +4 -2
  183. package/dist/components/BbSelect/types.d.ts +12 -0
  184. package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +43 -43
  185. package/dist/components/BbSpinner/BbSpinner.vue_vue_type_script_setup_true_lang.js +1 -1
  186. package/dist/components/BbSpinner/types.d.ts +1 -1
  187. package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +8 -8
  188. package/dist/components/BbTable/BbTableDataRow.js +2 -2
  189. package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +5 -2
  190. package/dist/components/BbTag/types.d.ts +12 -0
  191. package/dist/components/BbTextInput/BbTextInput.vue_vue_type_script_setup_true_lang.js +5 -2
  192. package/dist/components/BbTextInput/types.d.ts +12 -0
  193. package/dist/components/BbTextarea/BbTextarea.vue_vue_type_script_setup_true_lang.js +5 -2
  194. package/dist/components/BbTextarea/types.d.ts +12 -0
  195. package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +4 -2
  196. package/dist/components/BbTimePickerInput/types.d.ts +12 -0
  197. package/dist/components/BbToast/BbToastRegion.vue_vue_type_script_setup_true_lang.js +62 -62
  198. package/dist/components/BbTooltip/BbTooltip.vue_vue_type_script_setup_true_lang.js +81 -78
  199. package/dist/components/BbTooltip/types.d.ts +8 -1
  200. package/dist/components/ChipsBox/ChipsBox.vue_vue_type_script_setup_true_lang.js +1 -1
  201. package/dist/components/CommaBox/CommaBox.vue_vue_type_script_setup_true_lang.js +1 -1
  202. package/dist/components/CommonInputWrapper/CommonInputWrapper.vue.d.ts +1 -0
  203. package/dist/components/CommonInputWrapper/CommonInputWrapper.vue_vue_type_script_setup_true_lang.js +4 -2
  204. package/dist/components/CommonInputWrapper/types.d.ts +10 -0
  205. package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +1 -1
  206. package/dist/composables/useConfirm.d.ts +22 -0
  207. package/dist/composables/useConfirm.js +43 -40
  208. package/dist/composables/useSafeAreaInternal.js +1 -1
  209. package/dist/composables/useToast.d.ts +16 -0
  210. package/dist/composables/useToast.js +20 -16
  211. package/dist/composables/useViewportWidth.d.ts +20 -6
  212. package/dist/composables/useViewportWidth.js +8 -7
  213. package/dist/icon-scan.d.ts +276 -0
  214. package/dist/icon-scan.js +485 -0
  215. package/dist/icons-whitelist.d.ts +5 -4
  216. package/dist/index.d.ts +2 -0
  217. package/dist/input-variants.d.ts +18 -0
  218. package/dist/llms-full.txt +2173 -1537
  219. package/dist/llms-medium.txt +504 -82
  220. package/dist/llms.txt +1 -1
  221. package/dist/nuxt-module.d.ts +1 -0
  222. package/dist/nuxt.js +10 -7
  223. package/dist/plugin.js +1 -0
  224. package/dist/runtime/nuxt-plugin.js +2 -1
  225. package/dist/styles.css +1 -1
  226. package/dist/types/Config.d.ts +18 -0
  227. package/dist/types/InputVariant.d.ts +22 -0
  228. package/dist/utils/cssLayers.d.ts +91 -0
  229. package/dist/utils/cssLayers.js +43 -0
  230. package/dist/utils/injectLibraryStyles.d.ts +3 -1
  231. package/dist/utils/injectLibraryStyles.js +24 -23
  232. package/dist/validated/BbColorInput.vue_vue_type_script_setup_true_lang.js +1 -0
  233. package/dist/validated/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +1 -0
  234. package/dist/validated/BbNumberInput.vue_vue_type_script_setup_true_lang.js +1 -0
  235. package/dist/validated/BbSelect.vue_vue_type_script_setup_true_lang.js +1 -0
  236. package/dist/validated/BbTag.vue_vue_type_script_setup_true_lang.js +1 -0
  237. package/dist/validated/BbTextInput.vue_vue_type_script_setup_true_lang.js +1 -0
  238. package/dist/validated/BbTextarea.vue_vue_type_script_setup_true_lang.js +1 -0
  239. package/dist/validated/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +1 -0
  240. package/dist/validated/index.d.ts +1 -0
  241. package/dist/vite-plugin.d.ts +89 -12
  242. package/dist/vite.js +331 -281
  243. package/llms.txt +1 -1
  244. package/package.json +7 -5
  245. package/scripts/lib/ensure-manifest.mjs +28 -5
  246. package/scripts/lib/eslint-plugin.d.ts +35 -0
  247. package/scripts/lib/eslint-plugin.mjs +299 -3
  248. package/scripts/lib/hand-roll-hints.mjs +50 -6
  249. package/scripts/lib/html-attributes.mjs +42 -0
  250. package/scripts/lib/mcp-config.mjs +38 -34
  251. package/scripts/lib/public-type-exports.mjs +246 -0
  252. package/scripts/lib/validate-bb-markup.mjs +205 -12
@@ -16,12 +16,16 @@ Mandatory for AI-generated code.
16
16
  2. **`local:*` is for brand-specific art only** — logos, custom marks, one-off
17
17
  illustrations. They are SVG files in the configured `iconDir`.
18
18
  3. **Never invent icon names.** Use only names that exist in an installed
19
- `@iconify-json/*` set or as files in `iconDir`. A missing icon throws at
20
- mount (dev shows a Vite error overlay with the exact fix).
21
- 4. **Icon names must be static string literals.** Production builds scan source
22
- for `provider:name` literals and bundle only those — a name assembled at
23
- runtime (`` `lucide:${kind}` ``) will be missing in production. Map dynamic
24
- state to literals instead (e.g. a lookup object of full names).
19
+ `@iconify-json/*` set or as files in `iconDir`. A name that does not
20
+ resolve renders the built-in placeholder (a question mark in a circle,
21
+ tagged `data-bb-icon-missing="<name>"`) and logs one `console.error` with
22
+ the fix — in dev also as a Vite error overlay. It never throws.
23
+ 4. **Write icon names as literals, anywhere in the project.** The plugin
24
+ scans the whole project (PHP included) for `provider:name` literals and
25
+ bundles only those; `local:` ships everything. A name the scanner cannot
26
+ see as a literal — composed at runtime (`` `lucide:${kind}` ``), stored in a
27
+ database, chosen in an admin panel — goes in the plugin's `iconWhitelist`.
28
+ This holds in dev exactly as in production: dev registers the same set.
25
29
  5. **Never hand-place `BbIcon` where a component already accepts an icon** via
26
30
  a prop, item field, or dedicated slot (catalog below).
27
31
 
@@ -35,19 +39,38 @@ The `bitbossUi` Vite plugin (`iconDir` option) — or the Nuxt module (config ke
35
39
  auto-discovered. Installing `@iconify-json/lucide` makes every valid
36
40
  `lucide:<name>` available; removing it makes them all errors. Nothing to
37
41
  configure.
38
- - **Dev**: all icons of installed sets are registered. Referencing an
39
- uninstalled prefix or a non-existent name fails loudly in the Vite error
40
- overlay with an actionable message. A typo inside an installed set reads
41
- "does not exist in the lucide icon set — did you mean `lucide:…`?"; a set
42
- that is not installed reads "no installed icon set has the prefix `mdi`
43
- (installed sets: lucide) … run: `npm install -D @iconify-json/mdi`". Read
44
- the message: a typo wants a different name, a missing set wants an install,
45
- never a guess.
46
- - **Build**: source files (`.vue`/`.ts`/`.js`/`.tsx`/`.jsx`; tests and stories
47
- excluded) are scanned for static `provider:name` literals; each referenced
48
- icon is emitted as its own lazy chunk. This is why rule 4 exists — and why an
49
- icon used only in a `.stories.ts`/`.test.ts` file must also appear as a
50
- literal in a scanned source file.
42
+ - **What ships — `local:` everything, providers only what is scanned or
43
+ whitelisted.** Every SVG in `iconDir` is bundled. For provider sets the
44
+ plugin reads the **whole project** as bytes — every file under the Vite
45
+ root, PHP, Blade, JSON, SQL seeders and Markdown included — looking for
46
+ `<prefix>:<name>` where `<prefix>` is an installed set; what resolves in the
47
+ set's `icons.json` (icons and aliases) becomes a lazy chunk. Skipped:
48
+ whatever `.gitignore` ignores (every level), `node_modules`, `vendor`,
49
+ `storage`, the build `outDir`, every hidden path (`.something`), binary
50
+ files, and paths listed in `iconsScanner.exclude`. Extra locations
51
+ (`iconsScanner.include`) are additive. No language is parsed, so a Laravel
52
+ enum returning `'tabler:user-share'` counts as a literal.
53
+ - **Dev is prod.** The same scan runs on dev start (once, cached by content
54
+ hash under `node_modules/.cache/bitboss-ui/`) and again per file on every
55
+ save, so the registry in dev is exactly the set the build emits. Typing a
56
+ new literal into a template renders it without a restart. An icon that is
57
+ neither scanned nor whitelisted therefore shows the placeholder and the
58
+ error on first render in dev — not after deploy.
59
+ - **Names the scanner cannot see** — composed at runtime, persisted in a
60
+ database, picked by an admin — go in `iconWhitelist`: exact names
61
+ (`'tabler:crown'`) or globs (`'tabler:calendar-*'`). An entry that resolves
62
+ in no installed set fails the build with the same message the overlay shows.
63
+ - **A missing name is loud, in both environments.** `BbIcon` renders the
64
+ built-in placeholder glyph with `data-bb-icon-missing="<requested name>"`
65
+ and logs one `console.error` per name per page load; dev adds the Vite
66
+ error overlay. A typo inside an installed set reads "does not exist in the
67
+ lucide icon set — did you mean `lucide:…`?"; a real icon nobody wrote as a
68
+ literal reads "exists in the lucide icon set but is not bundled … add it to
69
+ `iconWhitelist`"; a set that is not installed reads "no installed icon set
70
+ has the prefix `mdi` (installed sets: lucide) … run:
71
+ `npm install -D @iconify-json/mdi`". Read the message: a typo wants a
72
+ different name, an unscanned name wants the whitelist, a missing set wants
73
+ an install, never a guess.
51
74
  - **Local icons**: `iconDir` is scanned recursively; each `.svg` becomes
52
75
  `local:<basename-without-extension>`. A bare, unprefixed name normalizes to
53
76
  `local:`. Adding/removing files is picked up live in dev, and the plugin
@@ -256,8 +279,10 @@ markup) yourself:
256
279
  (slot content or `text`; `aria-label` only to override).
257
280
  - Inventing or guessing icon names; assuming a set is installed without
258
281
  checking `package.json`.
259
- - Runtime-composed icon names (template strings / concatenation) — invisible to
260
- the build scanner, broken in production.
282
+ - Runtime-composed icon names (template strings / concatenation) without a
283
+ matching `iconWhitelist` entry — invisible to the scanner, so they render the
284
+ placeholder (in dev too). Prefer a lookup of full literals; whitelist what
285
+ must stay dynamic.
261
286
  - Setting `color`/`fill` on the icon element instead of the parent.
262
287
  - Falling back to random provider sets when a needed `local:` asset is missing —
263
288
  ask for the SVG (or approval to substitute) instead.
@@ -221,7 +221,7 @@ Two runtime options control CSS:
221
221
 
222
222
  Guaranteed order when injected: **reset → library styles → all other stylesheets**, so app-local CSS can always override the library.
223
223
 
224
- `resetCss` stays opt-in because Tailwind projects already ship Preflight — a second reset is usually unnecessary.
224
+ `resetCss` stays opt-in because Tailwind projects already ship Preflight — a second reset is usually unnecessary. A reset of SOME kind is a prerequisite of the components, not a nicety: every size in the component sheets is written for `border-box`, and native controls and fieldsets are expected to arrive without their browser chrome. Preflight provides all of that; on a page with neither Preflight nor this file, a selectable table's fieldset grows a groove border and a 36px cell renders 49px. `reset.css` is optional only in the sense that you may bring your own — the component test suite runs against this file, with no Tailwind on the page.
225
225
 
226
226
  **Tailwind v4 cascade layers vs. scoped `<style>`:** Tailwind v4's `@import
227
227
  'tailwindcss'` puts every utility class in `@layer utilities`. A Vue SFC's
@@ -290,23 +290,193 @@ Leave `resetCss` at `false` here — Preflight already reset everything.
290
290
  Nothing else about the plugin changes; `injectStyles` controls only whether the
291
291
  library injects its own `<style>`.
292
292
 
293
- **Tailwind v4 apps do not need this** — source order does not decide their ties
294
- at all. `@import 'tailwindcss'` puts Preflight in a real `@layer base` and
295
- utilities in `@layer utilities`, and layered rules lose to unlayered rules of
296
- equal specificity **regardless of source order**. `dist/styles.css` declares no
297
- `@layer`, so the library wins those ties wherever it is injected: leave
298
- auto-injection on. The same mechanic bites the other way, and silently — a
299
- utility cannot re-size a Bb component either. `<BbButton class="h-12 px-6">`
300
- loses to the library's own `.bb-button { height: var(--h); padding-left:
301
- var(--px); padding-right: var(--px) }` (equal specificity, unlayered), with no
302
- warning from anything. Size Bb components through their props and tokens, never
303
- utilities. (Same trap as the scoped-`<style>` case above, one level up.)
293
+ **Tailwind v4 apps do not need `injectStyles: false`** — source order does not
294
+ decide their ties at all. `@import 'tailwindcss'` puts Preflight in a real
295
+ `@layer base` and utilities in `@layer utilities`, and **a layered rule loses to
296
+ an unlayered one regardless of source order**. Leave auto-injection on and use
297
+ `cssLayers` below.
298
+
299
+ ### Cascade layers — the switch that decides who wins a tie
300
+
301
+ The cascade weighs **layer before specificity**. Unlayered CSS beats every
302
+ layered rule, however specific the layered one is. That one fact means there is
303
+ no single correct default, so the option is opt-in and you tell the library
304
+ where it sits:
305
+
306
+ | your CSS | `cssLayers` | who wins a tie |
307
+ | -------------------------------------------- | ----------------------------------- | ---------------------------------------------- |
308
+ | no layers (plain CSS, Tailwind v3) | unset (default) | source order — library first, so your CSS wins |
309
+ | Tailwind v4, or any layered CSS | your full order, ours in it (below) | exactly what your array says |
310
+ | no layers, and you want to override anything | `['bitboss-ui']` | you do, always |
311
+
312
+ The value is always an array: your complete layer order with `bitboss-ui` in
313
+ it, and `bitboss-ui-reset` immediately before it **when `resetCss` is on**.
314
+ With the reset off you may list `bitboss-ui-reset` anyway — an unused layer is
315
+ just empty — so the constant below works in every project, and you do not need
316
+ to know that Tailwind carries a reset of its own to use it.
317
+
318
+ **We do not ask you to add an `@layer` line to your stylesheet.** The plugin
319
+ injects the declaration ahead of its own rules, and a layer's position is fixed
320
+ by its first mention — so the order you configure is the order you get.
321
+
322
+ #### Tailwind v4
323
+
324
+ ```ts
325
+ // vite.config.ts — or the `bitboss` key in nuxt.config.ts
326
+ import { bitbossUi, TAILWIND_V4_LAYERS } from 'bitboss-ui/vite';
327
+
328
+ bitbossUi({
329
+ iconDir: './assets/icons',
330
+ cssLayers: TAILWIND_V4_LAYERS,
331
+ });
332
+ ```
333
+
334
+ `TAILWIND_V4_LAYERS` is
335
+ `['theme', 'base', 'bitboss-ui-reset', 'bitboss-ui', 'components', 'utilities']`:
336
+ Tailwind's own order with ours **after `base`**, so Preflight cannot outrank
337
+ the components, and **before `utilities`**, so `<BbButton class="px-6">`
338
+ works. Prefer the constant to the literal — a six-item array that has to be
339
+ exactly right is the kind of thing a typo turns into a silent loss of every
340
+ tie.
341
+
342
+ #### Tailwind v3, or plain CSS
343
+
344
+ Leave `cssLayers` unset. v3 emits unlayered CSS, and two unlayered stylesheets
345
+ are decided by source order — which auto-injection already puts in your favour.
346
+
347
+ #### Tailwind v3 — making utilities win anyway (opt-in)
348
+
349
+ v3 has no native layers of its own, but you can put its output into real ones
350
+ by wrapping the directives yourself. This is the shape PrimeVue documents, and
351
+ it is the only way to get v4's behaviour on v3:
352
+
353
+ ```css
354
+ /* your Tailwind entry, e.g. app.css */
355
+ @layer tailwind-base, bitboss-ui-reset, bitboss-ui, tailwind-utilities;
356
+
357
+ @layer tailwind-base {
358
+ @tailwind base;
359
+ }
360
+
361
+ @layer tailwind-utilities {
362
+ @tailwind components;
363
+ @tailwind utilities;
364
+ }
365
+ ```
366
+
367
+ ```ts
368
+ bitbossUi({
369
+ iconDir: './assets/icons',
370
+ cssLayers: [
371
+ 'tailwind-base',
372
+ 'bitboss-ui-reset',
373
+ 'bitboss-ui',
374
+ 'tailwind-utilities',
375
+ ],
376
+ });
377
+ ```
378
+
379
+ Both halves are required and they must agree: the CSS puts Tailwind's expanded
380
+ output INTO the layers, and `cssLayers` puts us between them. Verified against
381
+ a real v3 build — `.p-4` on a `Bb*` component wins, and Preflight no longer
382
+ outranks the components.
383
+
384
+ This is the one case where you write an `@layer` line yourself, because the
385
+ line has to wrap YOUR directives and we cannot reach them. Ours is emitted as
386
+ usual; the two declarations name the same order, and a layer's position is
387
+ fixed by its first mention, so they agree rather than fight.
388
+
389
+ #### "I just want to override things and not think about it"
390
+
391
+ ```ts
392
+ bitbossUi({
393
+ iconDir: './assets/icons',
394
+ cssLayers: ['bitboss-ui'], // ['bitboss-ui-reset', 'bitboss-ui'] with resetCss: true
395
+ });
396
+ ```
397
+
398
+ Declares our layer(s) and nothing else. All of your unlayered CSS then wins,
399
+ whatever its specificity.
400
+
401
+ > **Do not use this if your app loads a baseline stylesheet.** A reset is
402
+ > unlayered CSS made of element selectors, which is the exact combination this
403
+ > value inverts: `normalize.css`, your own `baseline.css`, or **Tailwind v3's
404
+ > Preflight** stop losing to our components on specificity and start outranking
405
+ > them outright. Measured on a real v3 build, a component rule of
406
+ > `margin: 5px` renders as `0px` — Preflight's `margin: 0` wins. The library
407
+ > does not look "overridable", it looks broken: controls lose their height,
408
+ > padding and borders, and nothing warns. If you want utilities to win on v3,
409
+ > use the layer hack above, which keeps the reset below us where it belongs.
410
+
411
+ Two further consequences: your global element rules (`button {}`, `input {}`)
412
+ now outrank component internals too — and this is the **wrong** value for a
413
+ layered app, because your own layers are declared later and land above ours,
414
+ Preflight included. A Tailwind v4 app uses the array above.
415
+
416
+ #### What "the utility loses" actually means
417
+
418
+ Not "utilities stop working on `Bb*` components". The cascade picks a winner
419
+ **per property**, so a layered utility loses only where we declare that exact
420
+ property on that element. Anything we leave alone is uncontested and simply
421
+ applies. Measured against the shipped sheet, v4 with `cssLayers` unset:
422
+
423
+ | on a `BbButton` | outcome | why |
424
+ | --------------- | ---------------- | ------------------------------------- |
425
+ | `w-20` | applies | we never declare `width` |
426
+ | `h-12` | applies | we declare `min-height`, not `height` |
427
+ | `m-4` | applies | we never declare `margin` |
428
+ | `p-4` | **half applies** | top/bottom land, left/right lose |
429
+ | `px-6` | no effect | we declare both padding longhands |
430
+ | `rounded-lg` | no effect | we declare `border-radius` |
431
+ | `text-lg` | no effect | we declare `font-size` |
432
+ | `gap-2` | no effect | we declare `gap` |
433
+
434
+ **The shorthand row is the one that hurts.** A clean loss is legible: you write
435
+ `px-6`, nothing moves, you go looking. `p-4` expands to four longhands, we
436
+ declare only the horizontal two, so their vertical padding applies while our
437
+ horizontal survives — a component nobody designed, with no signal that anything
438
+ was overridden.
439
+
440
+ So `cssLayers` does not turn utilities from broken into working. It turns them
441
+ from a per-property lottery into "always wins". **Predictability is the
442
+ feature, not capability** — and it is why the fix is worth taking even in an app
443
+ where the handful of utilities you tried happened to land.
444
+
445
+ #### Symptoms and what they mean
446
+
447
+ | what you see | cause | fix |
448
+ | --------------------------------------------------------------------- | ------------------------------------------------------------------------------- | --------------------------------------------------- |
449
+ | a Tailwind utility on a `Bb*` component does nothing, or half-applies | v4 utilities are layered, the library is not — see the per-property table above | `cssLayers: TAILWIND_V4_LAYERS` |
450
+ | every component lost its background / border | you listed only our two layers in a layered (v4) app | `cssLayers: TAILWIND_V4_LAYERS` |
451
+ | your global `button {}` reset suddenly restyles component internals | you listed only our two layers in an unlayered app | that is what it does — use the full order, or unset |
452
+ | components lost their height / padding / borders on **v3** | you listed only our layers while a reset or Preflight is unlayered | use the v3 layer hack, or leave `cssLayers` unset |
453
+ | nothing changed after setting `cssLayers` | the option lives in the **build plugin**, not in `app.use()` | set it in `vite.config.ts` / `nuxt.config.ts` |
454
+ | build fails naming a layer | your array omits `bitboss-ui` (or the reset layer with `resetCss: true`) | the error prints a working array — copy it |
455
+
456
+ A malformed value **fails the build**, never the browser: a wrong layer order is
457
+ invisible at runtime, because the CSS still parses and merely loses every tie.
458
+
459
+ #### The one thing layers do not fix
460
+
461
+ Layers decide ties between rules. They do not help when a component's own
462
+ inline `style` sets a property, because inline styles beat every layer. Where a
463
+ component needs to be positioned or sized by its parent, it exposes a CSS
464
+ variable, and that hook works in every configuration:
465
+
466
+ ```html
467
+ <!-- takes the row's slack; works on v3, v4, layered or not -->
468
+ <BbBreadcrumbs class="min-w-0" style="--flex-grow: 1" :items="crumbs" />
469
+ ```
470
+
471
+ Reach for the documented variable before reaching for a utility.
304
472
 
305
473
  ## 6) Icons
306
474
 
307
- - `iconDir` (required) is scanned recursively for `.svg` files; each file becomes `local:<basename>`.
308
- - Provider icons (`lucide:pencil`, `mdi:home`, …) require the matching `@iconify-json/<prefix>` package installed in the consumer app. In dev, every `prefix:name` the registry does not know produces a Vite error overlay with the fix: a mistyped name inside an installed set gets a "did you mean …?" hint, and an uninstalled prefix gets the list of installed sets plus the `npm install -D @iconify-json/<prefix>` command (the optional `@iconify/collections` peer only sharpens that wording, see [Install](#1-install)). A missing `local:` icon is a missing file in `iconDir` and surfaces as `BbIcon`'s runtime error naming it. Production builds report none of this — the scan simply drops what does not resolve, so a wrong name fails at runtime there.
309
- - Production builds bundle **only statically referenced** provider icons — write icon names as literal strings (`icon="lucide:trash-2"`), never assemble them dynamically.
475
+ - `iconDir` (required) is scanned recursively for `.svg` files; each file becomes `local:<basename>`. **`local:` ships everything.**
476
+ - Provider icons (`lucide:pencil`, `mdi:home`, …) require the matching `@iconify-json/<prefix>` package installed in the consumer app. **Providers ship only what is scanned or whitelisted**: the plugin reads the whole project as bytes — every file under the Vite root, PHP and Blade and JSON and SQL included — for `<prefix>:<name>` literals of the installed sets, and emits one lazy chunk per name that resolves. Skipped: gitignored paths (every `.gitignore` level), `node_modules`, `vendor`, `storage`, the build `outDir`, hidden paths, binaries, and `iconsScanner.exclude` globs; `iconsScanner.include` adds locations. The scan is cached by content hash under `node_modules/.cache/bitboss-ui/`, runs on 2–4 worker threads once a project passes ~1500 files (a cold scan is disk-bound, and the threads let a slow disk serve reads in parallel — roughly 0.2 s for 10k files on a laptop), prints one line (file count, elapsed, threads) after a cold scan, and stays silent when warm.
477
+ - **This holds in dev exactly as in prod.** Dev registers the same scanned-plus-whitelisted set, re-scans a file on every save, and hot-updates the registry — a new literal renders without a restart, and a name that is neither scanned nor whitelisted fails on first render in dev instead of after deploy.
478
+ - **Names the scanner cannot see** — composed at runtime, stored in a database, chosen in an admin UI — go in `iconWhitelist` (exact names or globs). An entry that resolves in no installed set fails the build with the actionable message.
479
+ - **A name that does not resolve renders the built-in placeholder** (a question mark in a circle, sized and coloured like the icon it replaces, with `data-bb-icon-missing="<name>"`) and logs one `console.error` per name per page load, in both environments; dev also raises the Vite error overlay. The message is the fix: a mistyped name inside an installed set gets a "did you mean …?" hint, a real icon nobody wrote as a literal is told to use `iconWhitelist`, and an uninstalled prefix gets the list of installed sets plus the `npm install -D @iconify-json/<prefix>` command (the optional `@iconify/collections` peer only sharpens that wording, see [Install](#1-install)). A missing `local:` icon names the `.svg` that is not in `iconDir`. `BbIcon` never throws for a missing name, so the surrounding tree stays mounted.
310
480
  - The plugin also writes `node_modules/.bitboss-ui/local-icons.json` and (in dev, unless `vscodeSettings: false`) wires `.vscode/settings.json` so the Iconify editor extension previews local icons.
311
481
 
312
482
  Policy for choosing icons: [Icons Policy](./icons-policy.md).
@@ -317,7 +487,37 @@ Options are the same for `bitboss-ui/vite` and the `bitboss` key in Nuxt.
317
487
 
318
488
  ### `iconDir: string` (required)
319
489
 
320
- Path to local SVG icons, absolute or relative to project root. Scanned recursively; file basename (without extension) becomes the icon name, addressable as `local:<name>`.
490
+ Path to local SVG icons, absolute or relative to project root. Scanned recursively; file basename (without extension) becomes the icon name, addressable as `local:<name>`. Every file in it ships.
491
+
492
+ ### `iconsScanner?: { include?: string[]; exclude?: string[]; maxFileSize?: number }`
493
+
494
+ Tunes the provider-icon source scan (see [Icons](#6-icons)). All three are optional and additive to the defaults; the root is always scanned.
495
+
496
+ - `include` — extra paths or globs scanned **in addition** to the Vite root: a vendor package that carries icon names, a directory outside the root (`'../shared/ui'`, `'vendor/acme/ui-kit/**/*.php'`). Relative entries resolve against the root. An entry is explicit, so the built-in skips (`vendor`, hidden segments, `.gitignore` files above it) do not apply to the entry itself — only to what lies beneath it. The Nuxt module adds the project `rootDir` here automatically, because Nuxt roots Vite at `app/`.
497
+ - `exclude` — globs removed from the scan on top of the defaults, in gitignore syntax, relative to the root (`['resources/legacy/**', '**/*.sql']`).
498
+ - `maxFileSize` — bytes. Exists only so a database dump is not read into memory; the default is 256 MiB, so a real source file is never skipped for its size.
499
+
500
+ ```ts
501
+ bitbossUi({
502
+ iconDir: './resources/icons',
503
+ iconsScanner: {
504
+ include: ['vendor/acme/ui-kit/src'],
505
+ exclude: ['database/dumps/**'],
506
+ },
507
+ });
508
+ ```
509
+
510
+ ### `iconWhitelist?: string[]`
511
+
512
+ Provider icons that **always** ship, scanned or not — exact names (`'tabler:crown'`) and globs (`'tabler:calendar-*'`, expanded against the installed set). This is the home of every name the scanner cannot see as a literal: composed at runtime, read from a database, picked by an admin. An entry that resolves in no installed set — a typo, an uninstalled prefix, a glob matching nothing — **fails the build** with the same actionable message the dev overlay shows for a missing icon. `local:` names never belong here (they all ship already).
513
+
514
+ ```ts
515
+ bitbossUi({
516
+ iconDir: './resources/icons',
517
+ // `icon` is stored per category in the database; the admin picks from these.
518
+ iconWhitelist: ['tabler:category', 'tabler:tag', 'tabler:calendar-*'],
519
+ });
520
+ ```
321
521
 
322
522
  ### `injectStyles?: boolean` (default: `true`)
323
523
 
@@ -327,6 +527,28 @@ Auto-inject the library stylesheet at runtime. If `false`, you must `import 'bit
327
527
 
328
528
  Inject the reset stylesheet (always ordered before the library stylesheet). Keep `false` and import `bitboss-ui/reset.css` if you prefer explicit control.
329
529
 
530
+ ### `cssLayers?: string[]` (default: unset)
531
+
532
+ Wraps the library's stylesheets in CSS cascade layers and declares where they
533
+ sit. Opt-in. Full guide with copy-paste blocks in §5 → _Cascade layers_.
534
+
535
+ The value is your app's **complete** layer order with `bitboss-ui` in it, and
536
+ `bitboss-ui-reset` before it when `resetCss` is on (listing it anyway is fine).
537
+ Unset means unlayered, today's behaviour, right for plain CSS and Tailwind v3.
538
+
539
+ ```ts
540
+ import { bitbossUi, TAILWIND_V4_LAYERS } from 'bitboss-ui/vite';
541
+
542
+ // Tailwind v4 — ['theme', 'base', 'bitboss-ui-reset', 'bitboss-ui', 'components', 'utilities']
543
+ cssLayers: TAILWIND_V4_LAYERS;
544
+ // no layers of your own, and you want to override anything
545
+ cssLayers: ['bitboss-ui']; // ['bitboss-ui-reset', 'bitboss-ui'] with resetCss: true
546
+ ```
547
+
548
+ You do not add an `@layer` line to your own CSS — the plugin emits the
549
+ declaration ahead of its rules. An invalid array, or a boolean, fails the build
550
+ with a message containing a working replacement.
551
+
330
552
  ### `injectDirectives?: boolean` (default: `true`)
331
553
 
332
554
  Registers the global `v-bb-tooltip`, `v-bb-dropdown`, `v-bb-color`, `v-bb-date` and `v-bb-time` directives when the runtime plugin installs — all five, on both the Vue and the Nuxt runtime. Each registration is skipped if the app already declared a directive under that name, so disable the option only if you want none of them.
@@ -534,6 +756,39 @@ says this in its header.
534
756
  | `dropdownItemVariants` | `default, destructive` | `bb-dropdown__item--variant-<name>` |
535
757
  | `tooltipVariants` | `default, destructive` | `bb-tooltip--<name>` |
536
758
  | `toastVariants` | `default, success, info, warning, destructive` | `bb-toast-message--<name>` |
759
+ | `inputVariants` | `outline, secondary, ghost` | `common-input-wrapper--<name>` |
760
+
761
+ `inputVariants` is the `variant` prop of the eight text-like controls
762
+ (`BbTextInput`, `BbTextarea`, `BbNumberInput`, `BbSelect`, `BbTag`,
763
+ `BbDatePickerInput`, `BbTimePickerInput`, `BbColorInput`). Its class hook is
764
+ the shared field box, and a custom entry is a **token block, not a rule set**:
765
+ the box's geometry (height, padding, border width) never changes with the
766
+ variant, so a variant only assigns the look variables the box reads —
767
+
768
+ ```css
769
+ /* a registered `inputVariants: ['brand']` */
770
+ .common-input-wrapper--brand {
771
+ --bg: color-mix(in oklab, var(--bb-primary) 8%, var(--bb-panel));
772
+ --bg-hover: color-mix(in oklab, var(--bb-primary) 12%, var(--bb-panel));
773
+ --bg-disabled: var(--bb-muted);
774
+ /* read `--state-border` to tint under errors/warnings like `outline`;
775
+ leave it out to stay untinted like `ghost` */
776
+ --border-color: var(
777
+ --state-border,
778
+ color-mix(in oklab, var(--bb-primary) 40%, var(--bb-border))
779
+ );
780
+ --border-focus: var(--state-border, var(--bb-primary));
781
+ /* the focus ring: leave this out and the variant has none, like `none` */
782
+ --ring-size: var(--bb-ring-size);
783
+ /* what the box paints under the ring (ghost/secondary use their hover wash) */
784
+ --bg-focus: var(--bg-hover);
785
+ }
786
+ ```
787
+
788
+ The ring's **colour** is state-owned (primary, danger under errors, warn under
789
+ warnings) and never a variant's business; whether a ring is **drawn** is the
790
+ variant's call through `--ring-size` — the three built-ins draw it, `none` does
791
+ not, and a custom variant chooses.
537
792
 
538
793
  Variant props are locked to the registered set (`keyof <X>VariantRegistry`):
539
794
  an unregistered name is a compile error, not a silently unstyled render.
@@ -564,10 +819,12 @@ when the contract cannot answer the question — the usual case is rebuilding
564
819
  chrome around a control the library does not ship, since the class names such a
565
820
  template emits are already styled by the public `bitboss-ui/styles.css`.
566
821
 
567
- Add `--mcp` to also register a live MCP server (`npx bitboss-ui@<installed version> mcp`, pinned so npx can never fetch a different version from the registry) the harness launches on demand — it merges the entry (never overwriting other servers) into `.mcp.json` (Claude Code), `.cursor/mcp.json` (Cursor), `.vscode/mcp.json` (VS Code / Copilot), and `~/.codeium/windsurf/mcp_config.json` (Windsurf). **Windsurf's config is global** — it has no per-project scope, so registering it affects every project on the machine; that is why only the explicit `ai-init --mcp` command writes it, while the plugin's `mcp: true` dev-server flag (§7) auto-registers the project-scoped harnesses only. Install the server's optional peers first — `npm i -D @modelcontextprotocol/sdk zod` — they are not dependencies of the library (~12 MB used only by the MCP server); the command warns if they are absent. **`--mcp` is optional and skipping it loses you nothing but the transport** — the server only reads the `dist/ai/` files listed above, so run plain `ai-init` and let the agent read that directory if you cannot add the peers (see `mcp?: boolean` in §7).
822
+ Add `--mcp` to also register a live MCP server (`node node_modules/bitboss-ui/bin/bitboss-ui.mjs mcp` — the installed binary, not `npx`, so it can never fetch from the registry, its optional peers resolve in your project rather than in an npx cache, and it cannot drift behind an upgrade) the harness launches on demand — it merges the entry (never overwriting other servers) into `.mcp.json` (Claude Code), `.cursor/mcp.json` (Cursor), `.vscode/mcp.json` (VS Code / Copilot), and `~/.codeium/windsurf/mcp_config.json` (Windsurf). **Windsurf's config is global** — it has no per-project scope, so registering it affects every project on the machine; that is why only the explicit `ai-init --mcp` command writes it, while the plugin's `mcp: true` dev-server flag (§7) auto-registers the project-scoped harnesses only. Install the server's optional peers first — `npm i -D @modelcontextprotocol/sdk zod` — they are not dependencies of the library (~12 MB used only by the MCP server); the command warns if they are absent. **`--mcp` is optional and skipping it loses you nothing but the transport** — the server only reads the `dist/ai/` files listed above, so run plain `ai-init` and let the agent read that directory if you cannot add the peers (see `mcp?: boolean` in §7).
568
823
 
569
824
  For a human-in-the-loop (and agent) safety net, add the `bitboss-ui/eslint-plugin` flat-config plugin (`...bitbossUi.configs.recommended`) so unknown/removed `Bb*` props surface as ESLint errors in the editor and CI — the same manifest checks as `bitboss-ui check`, reusing your `eslint-plugin-vue` parser. Real HTML attributes fall through untouched; escape hatches are the standard `<!-- eslint-disable-next-line bitboss-ui/no-unknown-attributes -->` and the rule's `allowAttributes` / `allowComponents` options. **`eslint --fix` also auto-migrates deprecated v2 props** (renames, boolean-polarity inversions like `allowWriting`→`disableWriting`, value remaps like BbToast `placement`→`position`, and deletion of inert removed props); structural migrations that need a slot/directive/CSS are reported but left by hand. One deliberate boundary: the rule's "did you mean `<prop>`?" hints for a mistyped/unknown attribute are advisory message text, not fixes — `eslint --fix` (including an unattended run in a pre-commit hook) never applies them; only the registered v2→v3 migrations above are auto-fixed. A guess applied blind across a codebase would be a silent behavior change, so acting on a hint is always a per-site decision. **This library is TS-first (recipes ship `<script setup lang="ts">`, some with `generic="T"`), so wire `@typescript-eslint/parser` for both `.ts` and `.vue` files** — without it `vue-eslint-parser` throws a `Parsing error` on those files, which means no rule (including `no-unknown-attributes`) runs on them at all. See the README "ESLint plugin" section for the full config snippet (both parser blocks + the `npm i -D @typescript-eslint/parser` line) and the fix table. `recommended` also enables `bitboss-ui/no-active-class-on-root-link`: `active-class` on a link-capable `Bb*` component (`BbButton`/`BbBaseButton`/`BbBadgeButton`) matches by path PREFIX, so a link whose target is the literal root (`href="/"` / `to="/"`) reads as "active" on every URL — the rule flags that combination and points you at `exact-active-class` instead.
570
825
 
826
+ Two rules in `recommended` are `warn` rather than `error`, because each describes markup that may be deliberate. `bitboss-ui/no-unknown-event` flags an `@event` the component does not emit (it falls through to the root element, so it may be a considered native listener). `bitboss-ui/no-unknown-token` flags a bare `var(--bb-…)` naming a token the installed package does not declare, in a `<style>` block or a static `style="…"` attribute — an undefined custom property is invalid-at-computed-value-time, so CSS discards the **entire declaration** and the rule silently does nothing at runtime. Supplying a fallback (`var(--bb-canvas, #f8fafc)`) is defined behaviour and is never reported; `allowTokens` exempts names you define yourself. The token list is read from the `dist/styles.css` you installed, so it cannot claim a token is invented when your version declares it, and with no stylesheet present the rule stays silent. Before reaching for a `--bb-*` name at all, re-read the two tiers above: a name the library does not declare usually means the knob you want is a **component** token, not a gap in the global set. `bitboss-ui check` carries two further advisory hints that are deliberately not ESLint rules — the hand-rolled avatar and spinner detectors — because both are guesses, and a lint rule that fires on correct code teaches people to ignore all of them.
827
+
571
828
  **The manifest ships with the package** — `dist/ai/components.json` is inside
572
829
  the tarball, and the rules resolve it relative to their own file, so a normal
573
830
  install needs no configuration. If it ever cannot be read (a broken install, a
@@ -576,6 +833,18 @@ nothing), the rules cannot check anything: they now **warn once** saying they
576
833
  are inactive rather than passing silently. Pass `failClosed: true` to a rule's
577
834
  options if you would rather CI stop than under-check.
578
835
 
836
+ Alongside `components` the manifest carries a `types` array: the public TYPE
837
+ exports (`BbTableColumn`, `BbDropdownItem`, …), each with the component and prop
838
+ it is written on. That is how `check`, the ESLint rules and the MCP server tell
839
+ a type used as a tag from a typo and from a component your app owns — three
840
+ cases that used to share one message and one (usually wrong) remedy.
841
+
842
+ **`allowComponents` is a per-tag off switch, not the suppression of one
843
+ message.** An allowlisted name is skipped whole: no unknown-component finding,
844
+ and no prop, event, v-model or slot check on that tag, permanently. Right for an
845
+ app-owned `<BbRichEditor>`; wrong for everything else — never reach for it to
846
+ quieten a `Bb*` name the library itself exports.
847
+
579
848
  `recommended` also enables **`bitboss-ui/no-reverse-false`**, which covers the one v2 break a rename table cannot: `reverse` on `BbCheckbox` / `BbRadio` / `BbSwitch` kept its NAME and inverted its MEANING in v3, so the v2 spelling `:reverse="false"` (control on the right) is now a no-op that renders the control on the LEFT. Nothing else catches it — it is a declared prop, correctly typed, holding its own default value — and it cannot be expressed as a rename, because a rename entry is keyed by prop name and would rewrite the legitimate v3 spellings too. The rule flags only a LITERAL `:reverse="false"` (a dynamic `:reverse="isRtl"` that evaluates false is left alone) and offers both corrections as editor suggestions; pass `{ assumeV2: true }` to promote the v2-intent rewrite to a real `--fix` for a bulk sweep, then remove it — the two readings produce opposite layouts, so it must never be on by default. See [the migration guide](../guides/migration/components/bb-checkbox.md).
580
849
 
581
850
  It also enables `bitboss-ui/require-partner-prop`: an opt-in prop set without its documented required partner — BbTable `keyboard-navigation` / `v-model:highlighted` without `row-class` (the shipped tint says "current row"; `row-class` says why, and is how you override it), or `loading-text` without `:loading` bound — compiles and mounts clean and just does nothing; the rule names the missing partner and quotes why.
@@ -76,6 +76,31 @@ override off `:root` and onto the block — the value itself is yours to keep:
76
76
 
77
77
  Set it on `.bb-base-rating` itself (or on a rule that also matches it) — the
78
78
  local is declared on that block, so a value inherited from an ancestor is
79
- overridden before it is read. `--spacing` (star gap) is the companion local;
79
+ overridden before it is read. `--space` (star gap) is the companion local;
80
80
  v2's `--bb-base-rating-spacing` was referenced but never declared anywhere in
81
81
  the shipped sheet, so it never worked.
82
+
83
+ ### `--spacing` → `--space` (hard rename, no alias)
84
+
85
+ The star-gap local was called `--spacing` until 2026-09-09. **Tailwind v4 built
86
+ its entire spacing scale on a variable of that exact name** — `p-4` compiles to
87
+ `padding: calc(var(--spacing) * 4)`, where v3 emitted a literal `1rem`. Custom
88
+ properties inherit, so `--spacing: 0px` on `.bb-base-rating` silently zeroed
89
+ **every** spacing utility a Tailwind v4 app used inside the component's slots:
90
+
91
+ ```html
92
+ <!-- on Tailwind v4, before the rename: padding, gap and size all resolved to 0 -->
93
+ <BbRating>
94
+ <template #icon><Icon class="size-5 p-1" /></template>
95
+ </BbRating>
96
+ ```
97
+
98
+ If you overrode the gap, rename the property. The value is unchanged:
99
+
100
+ ```diff
101
+ - .bb-base-rating { --spacing: 4px; }
102
+ + .bb-base-rating { --space: 4px; }
103
+ ```
104
+
105
+ Nothing else changes. `--space` is not a Tailwind theme namespace, so it cannot
106
+ collide the same way.
@@ -15,6 +15,7 @@ summary: timeout renamed to delay; theme replaced by typed variant; hideArrow is
15
15
  | `activator` / `boundary` loose types | `ElementOrComponentRef*` | transparent in templates |
16
16
  | `showClose?: boolean` (default `true`) | removed | **the tooltip has no close button.** ⚠ Do **not** rewrite to `hide-close` — that prop does not exist here. Delete it. |
17
17
  | `block` | removed | dead prop — it styled nothing (same as `BbPopover.block`) |
18
+ | `width` = a fixed bubble width | `width` = a **maximum** width (default cap `40ch`) | behavior change — same prop name, see below |
18
19
  | — | `modelValue` + `update:modelValue` | additive — a tooltip can now be opened/closed programmatically |
19
20
 
20
21
  The tooltip is the **only** surface that kept its arrow — popovers, selects,
@@ -43,6 +44,23 @@ If you were passing `:show-close="false"` you already had the v3 behaviour —
43
44
  deleting the prop changes nothing visually. `npx bitboss-ui check` flags both
44
45
  spellings and names this file.
45
46
 
47
+ ### `width` caps the bubble instead of fixing it
48
+
49
+ In v2 `width` set the bubble's width outright, so `:width="300"` on a 150px
50
+ hint left half the bubble empty. In v3 it compiles to `max-width`: the bubble
51
+ wraps at that measure but still shrinks to its text. Nothing to rewrite — the
52
+ prop keeps its name and its values, and long hints look the same. Short ones
53
+ get narrower, which is the point.
54
+
55
+ Two consequences worth knowing:
56
+
57
+ - A tooltip with **no** `width` is now capped at `40ch` rather than running the
58
+ full width of the viewport. Override it in CSS with `--max-w` on
59
+ `.bb-tooltip` (or per instance with the prop).
60
+ - Values v2 mis-parsed now work. `'20rem'` used to render a 20**px** bubble;
61
+ `'auto'` and `calc()`/`min()` values threw during render. All of them are
62
+ passed to CSS as written.
63
+
46
64
  ## Edits
47
65
 
48
66
  ```diff