bitboss-ui 3.0.0-beta.63 → 3.0.0-beta.64

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 (377) hide show
  1. package/README.md +25 -20
  2. package/bin/bitboss-ui.mjs +73 -7
  3. package/dist/ai/BbAlert.md +10 -1
  4. package/dist/ai/BbBadge.md +35 -3
  5. package/dist/ai/BbBadgeButton.md +4 -2
  6. package/dist/ai/BbBaseButton.md +9 -3
  7. package/dist/ai/BbBreadcrumbs.md +2 -2
  8. package/dist/ai/BbButton.md +113 -8
  9. package/dist/ai/BbCheckbox.md +1 -1
  10. package/dist/ai/BbCheckboxGroup.md +94 -6
  11. package/dist/ai/BbColorInput.md +4 -1
  12. package/dist/ai/BbColorPalette.md +2 -1
  13. package/dist/ai/BbConfirm.md +7 -3
  14. package/dist/ai/BbDatePicker.md +2 -1
  15. package/dist/ai/BbDatePickerInput.md +4 -1
  16. package/dist/ai/BbDialog.md +12 -11
  17. package/dist/ai/BbDropdown.md +189 -38
  18. package/dist/ai/BbDropdownButton.md +27 -7
  19. package/dist/ai/BbForm.md +55 -22
  20. package/dist/ai/BbHost.md +2 -2
  21. package/dist/ai/BbHoverCard.md +7 -3
  22. package/dist/ai/BbIcon.md +12 -6
  23. package/dist/ai/BbIndicator.md +11 -1
  24. package/dist/ai/BbNumberInput.md +4 -1
  25. package/dist/ai/BbOffCanvas.md +37 -3
  26. package/dist/ai/BbPopover.md +2 -1
  27. package/dist/ai/BbRadio.md +1 -1
  28. package/dist/ai/BbRadioGroup.md +102 -10
  29. package/dist/ai/BbSelect.md +52 -17
  30. package/dist/ai/BbSelectPopover.md +93 -26
  31. package/dist/ai/BbSwitch.md +1 -1
  32. package/dist/ai/BbSwitchGroup.md +30 -3
  33. package/dist/ai/BbTable.md +17 -10
  34. package/dist/ai/BbTabs.md +8 -3
  35. package/dist/ai/BbTabsList.md +4 -1
  36. package/dist/ai/BbTag.md +5 -2
  37. package/dist/ai/BbTextInput.md +4 -1
  38. package/dist/ai/BbTextarea.md +4 -1
  39. package/dist/ai/BbTimePicker.md +2 -1
  40. package/dist/ai/BbTimePickerInput.md +4 -1
  41. package/dist/ai/BbToast.md +9 -3
  42. package/dist/ai/BbTooltip.md +71 -9
  43. package/dist/ai/ChipsBox.md +1 -1
  44. package/dist/ai/CommonField.md +1 -1
  45. package/dist/ai/OptionsContainer.md +42 -0
  46. package/dist/ai/changelog.json +416 -6
  47. package/dist/ai/components.json +50 -48
  48. package/dist/ai/composables/useConfirm.md +39 -1
  49. package/dist/ai/design-tokens.json +6 -6
  50. package/dist/ai/guides/agent-contract.md +2 -2
  51. package/dist/ai/guides/ai-router.md +24 -23
  52. package/dist/ai/guides/app-layout.md +5 -0
  53. package/dist/ai/guides/component-picker.md +9 -2
  54. package/dist/ai/guides/design-language.md +24 -24
  55. package/dist/ai/guides/design-tokens.md +15 -8
  56. package/dist/ai/guides/icons-policy.md +9 -2
  57. package/dist/ai/guides/inertia-helpers.md +79 -49
  58. package/dist/ai/guides/installation-and-plugin-setup.md +12 -2
  59. package/dist/ai/guides/migration/adoption-checklist.md +235 -0
  60. package/dist/ai/guides/migration/components/bb-checkbox-group.md +16 -15
  61. package/dist/ai/guides/migration/components/bb-dialog.md +9 -9
  62. package/dist/ai/guides/migration/components/bb-dropdown.md +7 -2
  63. package/dist/ai/guides/migration/components/bb-popover.md +4 -2
  64. package/dist/ai/guides/migration/components/bb-select.md +19 -0
  65. package/dist/ai/guides/migration/components/bb-table.md +1 -0
  66. package/dist/ai/guides/migration/components/bb-toast.md +4 -0
  67. package/dist/ai/guides/migration/components/bb-tooltip.md +15 -12
  68. package/dist/ai/guides/migration/components/use-confirm.md +25 -2
  69. package/dist/ai/guides/migration/v2-to-v3.md +163 -9
  70. package/dist/ai/guides/migration/v3-beta-css-classes.md +7 -3
  71. package/dist/ai/guides/options-items-playbook.md +2 -1
  72. package/dist/ai/guides/passthrough.md +147 -85
  73. package/dist/ai/guides/preset-components.md +140 -15
  74. package/dist/ai/helpers/definePreset.json +7 -0
  75. package/dist/ai/helpers/definePreset.ts +123 -11
  76. package/dist/ai/helpers/inertia/manifest.json +15 -9
  77. package/dist/ai/helpers/inertia/useConfirmOnRouteLeave.ts +4 -4
  78. package/dist/ai/helpers/inertia/usePaginatedResponseContext.ts +39 -24
  79. package/dist/ai/helpers/inertia/useRouteQuery.ts +10 -4
  80. package/dist/ai/index.md +1 -0
  81. package/dist/ai/manifest/common.json +0 -1
  82. package/dist/ai/manifest/components/BbAlert.json +7 -2
  83. package/dist/ai/manifest/components/BbBadge.json +13 -4
  84. package/dist/ai/manifest/components/BbBadge.tree.json +2 -0
  85. package/dist/ai/manifest/components/BbBadgeButton.json +4 -2
  86. package/dist/ai/manifest/components/BbBaseButton.json +4 -2
  87. package/dist/ai/manifest/components/BbBreadcrumbs.tree.json +1 -1
  88. package/dist/ai/manifest/components/BbButton.json +14 -3
  89. package/dist/ai/manifest/components/BbButton.tree.json +5 -1
  90. package/dist/ai/manifest/components/BbCheckboxGroup.json +13 -8
  91. package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +11 -1
  92. package/dist/ai/manifest/components/BbColorInput.json +18 -15
  93. package/dist/ai/manifest/components/BbColorPalette.json +1 -1
  94. package/dist/ai/manifest/components/BbConfirm.json +4 -2
  95. package/dist/ai/manifest/components/BbConfirm.tree.json +1 -1
  96. package/dist/ai/manifest/components/BbDatePicker.json +1 -1
  97. package/dist/ai/manifest/components/BbDatePickerInput.json +17 -14
  98. package/dist/ai/manifest/components/BbDialog.tree.json +2 -1
  99. package/dist/ai/manifest/components/BbDropdown.json +24 -19
  100. package/dist/ai/manifest/components/BbDropdown.tree.json +9 -2
  101. package/dist/ai/manifest/components/BbDropdownButton.json +33 -20
  102. package/dist/ai/manifest/components/BbDropdownButton.tree.json +2 -2
  103. package/dist/ai/manifest/components/BbForm.json +2 -2
  104. package/dist/ai/manifest/components/BbHost.tree.json +1 -1
  105. package/dist/ai/manifest/components/BbHoverCard.json +1 -1
  106. package/dist/ai/manifest/components/BbIndicator.json +8 -2
  107. package/dist/ai/manifest/components/BbNumberInput.json +5 -2
  108. package/dist/ai/manifest/components/BbOffCanvas.json +2 -2
  109. package/dist/ai/manifest/components/BbOffCanvas.tree.json +1 -1
  110. package/dist/ai/manifest/components/BbPopover.json +1 -1
  111. package/dist/ai/manifest/components/BbRadioGroup.json +17 -12
  112. package/dist/ai/manifest/components/BbRadioGroup.tree.json +8 -1
  113. package/dist/ai/manifest/components/BbSelect.json +21 -18
  114. package/dist/ai/manifest/components/BbSelect.tree.json +2 -2
  115. package/dist/ai/manifest/components/BbSelectPopover.json +10 -10
  116. package/dist/ai/manifest/components/BbSelectPopover.tree.json +3 -2
  117. package/dist/ai/manifest/components/BbSwitchGroup.json +1 -1
  118. package/dist/ai/manifest/components/BbSwitchGroup.tree.json +3 -1
  119. package/dist/ai/manifest/components/BbTable.tree.json +14 -1
  120. package/dist/ai/manifest/components/BbTabs.json +9 -6
  121. package/dist/ai/manifest/components/BbTabs.tree.json +1 -1
  122. package/dist/ai/manifest/components/BbTabsList.json +6 -3
  123. package/dist/ai/manifest/components/BbTag.json +19 -16
  124. package/dist/ai/manifest/components/BbTag.tree.json +1 -1
  125. package/dist/ai/manifest/components/BbTextInput.json +6 -3
  126. package/dist/ai/manifest/components/BbTextarea.json +6 -3
  127. package/dist/ai/manifest/components/BbTimePicker.json +1 -1
  128. package/dist/ai/manifest/components/BbTimePickerInput.json +10 -7
  129. package/dist/ai/manifest/components/BbToast.json +7 -2
  130. package/dist/ai/manifest/components/BbToast.tree.json +4 -2
  131. package/dist/ai/manifest/components/BbTooltip.json +6 -5
  132. package/dist/ai/manifest/components/ChipsBox.tree.json +1 -1
  133. package/dist/ai/manifest/components/CommonField.json +1 -1
  134. package/dist/ai/manifest/components/OptionsContainer.json +3 -1
  135. package/dist/ai/manifest/components/OptionsContainer.tree.json +38 -0
  136. package/dist/ai/manifest/index.json +3 -3
  137. package/dist/ai/manifest/meta.json +5 -3
  138. package/dist/ai/manifest/types.advanced.json +5 -2
  139. package/dist/ai/manifest/types.api.json +9 -7
  140. package/dist/ai/recipes/inertia/layout-scaffold.md +19 -6
  141. package/dist/ai/recipes/inertia/records-workspace.md +49 -13
  142. package/dist/ai/recipes/nuxt/layout-scaffold.md +19 -6
  143. package/dist/ai/recipes/nuxt/records-workspace.md +42 -12
  144. package/dist/ai/recipes/vue/layout-scaffold.md +19 -6
  145. package/dist/ai/recipes/vue/records-workspace.md +42 -12
  146. package/dist/ai/source/BbAlert.md +94 -76
  147. package/dist/ai/source/BbBadge.md +174 -72
  148. package/dist/ai/source/BbBadgeButton.md +130 -65
  149. package/dist/ai/source/BbBaseButton.md +46 -124
  150. package/dist/ai/source/BbBaseCheckboxIcon.md +38 -0
  151. package/dist/ai/source/BbBaseRadioIcon.md +18 -0
  152. package/dist/ai/source/BbBaseSwitchIcon.md +51 -0
  153. package/dist/ai/source/BbButton.md +153 -36
  154. package/dist/ai/source/BbCheckboxGroup.md +142 -18
  155. package/dist/ai/source/BbColorInput.md +240 -204
  156. package/dist/ai/source/BbColorPalette.md +7 -4
  157. package/dist/ai/source/BbConfirm.md +34 -11
  158. package/dist/ai/source/BbConfirmPortal.md +24 -9
  159. package/dist/ai/source/BbDatePicker.md +11 -7
  160. package/dist/ai/source/BbDatePickerInput.md +306 -269
  161. package/dist/ai/source/BbDialog.md +49 -14
  162. package/dist/ai/source/BbDropdown.md +314 -197
  163. package/dist/ai/source/BbDropdownButton.md +197 -31
  164. package/dist/ai/source/BbDropdownGroup.md +274 -176
  165. package/dist/ai/source/BbForm.md +50 -6
  166. package/dist/ai/source/BbHoverCard.md +12 -5
  167. package/dist/ai/source/BbIcon.md +4 -3
  168. package/dist/ai/source/BbIndicator.md +73 -52
  169. package/dist/ai/source/BbNumberInput.md +293 -257
  170. package/dist/ai/source/BbOffCanvas.md +55 -29
  171. package/dist/ai/source/BbPopover.md +14 -10
  172. package/dist/ai/source/BbRadioGroup.md +413 -297
  173. package/dist/ai/source/BbSelect.md +549 -435
  174. package/dist/ai/source/BbSelectPopover.md +128 -33
  175. package/dist/ai/source/BbSwitchGroup.md +70 -10
  176. package/dist/ai/source/BbTable.md +369 -37
  177. package/dist/ai/source/BbTabs.md +115 -39
  178. package/dist/ai/source/BbTabsList.md +106 -38
  179. package/dist/ai/source/BbTabsPanels.md +96 -36
  180. package/dist/ai/source/BbTabsRoot.md +96 -36
  181. package/dist/ai/source/BbTag.md +267 -233
  182. package/dist/ai/source/BbTextInput.md +261 -225
  183. package/dist/ai/source/BbTextarea.md +251 -215
  184. package/dist/ai/source/BbTimePicker.md +11 -7
  185. package/dist/ai/source/BbTimePickerInput.md +257 -220
  186. package/dist/ai/source/BbToast.md +73 -32
  187. package/dist/ai/source/BbToastPortal.md +65 -30
  188. package/dist/ai/source/BbTooltip.md +148 -113
  189. package/dist/ai/source/CommonPopover.md +6 -1
  190. package/dist/ai/source/FlatListBox.md +19 -9
  191. package/dist/ai/source/GroupedListBox.md +19 -9
  192. package/dist/ai/source/OptionsContainer.md +25 -9
  193. package/dist/components/BbAlert/BbAlert.vue_vue_type_script_setup_true_lang.js +61 -36
  194. package/dist/components/BbAlert/types.d.ts +9 -5
  195. package/dist/components/BbAlert/types.js +8 -3
  196. package/dist/components/BbBadge/BadgeBodyContent.vue.d.ts +3 -3
  197. package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +26 -17
  198. package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +103 -50
  199. package/dist/components/BbBadge/BbBadgeButton.vue_vue_type_script_setup_true_lang.js +20 -15
  200. package/dist/components/BbBadge/badgeButtonContext.d.ts +12 -1
  201. package/dist/components/BbBadge/types.d.ts +45 -15
  202. package/dist/components/BbBadge/types.js +12 -3
  203. package/dist/components/BbBaseButton/BbBaseButton.vue_vue_type_script_setup_true_lang.js +89 -126
  204. package/dist/components/BbBaseButton/types.d.ts +23 -4
  205. package/dist/components/BbBaseButton/types.js +7 -1
  206. package/dist/components/BbBaseButton/useLinkState.d.ts +41 -0
  207. package/dist/components/BbBaseButton/useLinkState.js +70 -0
  208. package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +130 -74
  209. package/dist/components/BbButton/types.d.ts +50 -13
  210. package/dist/components/BbButton/types.js +10 -3
  211. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +148 -95
  212. package/dist/components/BbCheckboxGroup/types.d.ts +34 -11
  213. package/dist/components/BbCheckboxGroup/types.js +9 -4
  214. package/dist/components/BbCollapsible/BbCollapsible.vue.d.ts +1 -1
  215. package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +134 -93
  216. package/dist/components/BbColorInput/types.d.ts +11 -4
  217. package/dist/components/BbColorInput/types.js +9 -3
  218. package/dist/components/BbConfirm/BbConfirm.vue_vue_type_script_setup_true_lang.js +82 -59
  219. package/dist/components/BbConfirm/types.d.ts +9 -4
  220. package/dist/components/BbConfirm/types.js +8 -3
  221. package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +1 -1
  222. package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +68 -67
  223. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +1 -1
  224. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +259 -215
  225. package/dist/components/BbDatePickerInput/types.d.ts +12 -5
  226. package/dist/components/BbDatePickerInput/types.js +9 -3
  227. package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +223 -219
  228. package/dist/components/BbDialog/useDialogStack.d.ts +1 -1
  229. package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +104 -89
  230. package/dist/components/BbDropdown/BbDropdown.vue.d.ts +1 -0
  231. package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +323 -285
  232. package/dist/components/BbDropdown/BbDropdownList.vue.d.ts +1 -0
  233. package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +411 -319
  234. package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +100 -98
  235. package/dist/components/BbDropdown/DropdownRow.vue.d.ts +4 -3
  236. package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +49 -28
  237. package/dist/components/BbDropdown/normalizeGroups.d.ts +6 -0
  238. package/dist/components/BbDropdown/normalizeGroups.js +21 -15
  239. package/dist/components/BbDropdown/types.d.ts +59 -12
  240. package/dist/components/BbDropdown/types.js +16 -3
  241. package/dist/components/BbDropdown/useDropdownContext.d.ts +6 -0
  242. package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +2 -1
  243. package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +179 -68
  244. package/dist/components/BbDropdownButton/types.d.ts +44 -16
  245. package/dist/components/BbDropdownButton/types.js +28 -3
  246. package/dist/components/BbForm/BbForm.vue_vue_type_script_setup_true_lang.js +111 -89
  247. package/dist/components/BbForm/formSchema.d.ts +13 -0
  248. package/dist/components/BbHoverCard/BbHoverCard.vue_vue_type_script_setup_true_lang.js +100 -100
  249. package/dist/components/BbIndicator/BbIndicator.vue_vue_type_script_setup_true_lang.js +40 -25
  250. package/dist/components/BbIndicator/types.d.ts +9 -5
  251. package/dist/components/BbIndicator/types.js +8 -3
  252. package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +243 -202
  253. package/dist/components/BbNumberInput/types.d.ts +12 -5
  254. package/dist/components/BbNumberInput/types.js +9 -3
  255. package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +1 -1
  256. package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +401 -399
  257. package/dist/components/BbOffCanvas/types.d.ts +6 -2
  258. package/dist/components/BbPopover/BbPopover.vue_vue_type_script_setup_true_lang.js +81 -80
  259. package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +158 -105
  260. package/dist/components/BbRadioGroup/types.d.ts +21 -7
  261. package/dist/components/BbRadioGroup/types.js +9 -4
  262. package/dist/components/BbSelect/BbSelect.vue.d.ts +4 -3
  263. package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +181 -137
  264. package/dist/components/BbSelect/types.d.ts +36 -22
  265. package/dist/components/BbSelect/types.js +22 -3
  266. package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +4 -4
  267. package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +543 -532
  268. package/dist/components/BbSelectPopover/knownItems.d.ts +5 -0
  269. package/dist/components/BbSelectPopover/types.d.ts +46 -12
  270. package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +1 -1
  271. package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +2 -2
  272. package/dist/components/BbSwitchGroup/types.d.ts +14 -4
  273. package/dist/components/BbSwitchGroup/types.js +8 -3
  274. package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1102 -995
  275. package/dist/components/BbTable/estimatedFloors.golden.d.ts +25 -0
  276. package/dist/components/BbTable/measuredFloors.d.ts +46 -0
  277. package/dist/components/BbTable/measuredFloors.js +322 -0
  278. package/dist/components/BbTable/measuredFloorsTestKit.d.ts +27 -0
  279. package/dist/components/BbTable/textRuler.d.ts +71 -0
  280. package/dist/components/BbTable/textRuler.js +121 -0
  281. package/dist/components/BbTable/utils.d.ts +113 -6
  282. package/dist/components/BbTable/utils.js +118 -65
  283. package/dist/components/BbTabs/BbTabs.vue_vue_type_script_setup_true_lang.js +53 -35
  284. package/dist/components/BbTabs/BbTabsList.vue_vue_type_script_setup_true_lang.js +62 -45
  285. package/dist/components/BbTabs/types.d.ts +26 -11
  286. package/dist/components/BbTabs/types.js +23 -8
  287. package/dist/components/BbTag/BbTag.vue_vue_type_script_setup_true_lang.js +205 -164
  288. package/dist/components/BbTag/types.d.ts +11 -4
  289. package/dist/components/BbTag/types.js +9 -3
  290. package/dist/components/BbTextInput/BbTextInput.vue_vue_type_script_setup_true_lang.js +98 -57
  291. package/dist/components/BbTextInput/types.d.ts +12 -5
  292. package/dist/components/BbTextInput/types.js +9 -3
  293. package/dist/components/BbTextarea/BbTextarea.vue_vue_type_script_setup_true_lang.js +137 -96
  294. package/dist/components/BbTextarea/types.d.ts +12 -5
  295. package/dist/components/BbTextarea/types.js +9 -3
  296. package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +105 -104
  297. package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +241 -197
  298. package/dist/components/BbTimePickerInput/types.d.ts +12 -5
  299. package/dist/components/BbTimePickerInput/types.js +9 -3
  300. package/dist/components/BbToast/BbToast.vue_vue_type_script_setup_true_lang.js +74 -32
  301. package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +47 -47
  302. package/dist/components/BbToast/types.d.ts +10 -5
  303. package/dist/components/BbToast/types.js +18 -3
  304. package/dist/components/BbTooltip/BbTooltip.vue_vue_type_script_setup_true_lang.js +85 -71
  305. package/dist/components/BbTooltip/types.d.ts +13 -8
  306. package/dist/components/BbTooltip/types.js +8 -3
  307. package/dist/components/CommonField/CommonField.vue.d.ts +1 -1
  308. package/dist/components/CommonPopover/CommonPopover.vue.d.ts +1 -1
  309. package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +69 -69
  310. package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +53 -50
  311. package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +146 -143
  312. package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +7 -2
  313. package/dist/components/OptionsContainer/types.d.ts +14 -3
  314. package/dist/composables/useBbFormContext.d.ts +4 -3
  315. package/dist/composables/useBbTabsContext.js +99 -85
  316. package/dist/composables/useChoiceIndicator.d.ts +58 -0
  317. package/dist/composables/useChoiceIndicator.js +197 -0
  318. package/dist/composables/useConfirm.d.ts +4 -4
  319. package/dist/composables/usePassthrough.d.ts +54 -1
  320. package/dist/composables/usePassthrough.js +100 -71
  321. package/dist/directives/bbTooltip.d.ts +12 -6
  322. package/dist/directives/createPopoverDirective.js +1 -1
  323. package/dist/index.d.ts +3 -1
  324. package/dist/llms-full.txt +2300 -543
  325. package/dist/llms-medium.txt +71 -53
  326. package/dist/llms.txt +2 -1
  327. package/dist/passthrough-deduper.js +6 -3
  328. package/dist/project-dts.d.ts +24 -0
  329. package/dist/project-dts.js +43 -17
  330. package/dist/styles.css +2 -2
  331. package/dist/types/AlertVariant.d.ts +14 -0
  332. package/dist/types/AlertVariant.js +9 -0
  333. package/dist/types/BadgeVariant.d.ts +14 -0
  334. package/dist/types/BadgeVariant.js +9 -0
  335. package/dist/types/ButtonVariant.d.ts +16 -0
  336. package/dist/types/ButtonVariant.js +11 -0
  337. package/dist/types/CheckboxVariant.d.ts +38 -0
  338. package/dist/types/CheckboxVariant.js +4 -0
  339. package/dist/types/CommonProps.d.ts +4 -3
  340. package/dist/types/Config.d.ts +7 -0
  341. package/dist/types/ConfirmVariant.d.ts +12 -0
  342. package/dist/types/ConfirmVariant.js +4 -0
  343. package/dist/types/DropdownItemVariant.d.ts +12 -0
  344. package/dist/types/DropdownItemVariant.js +4 -0
  345. package/dist/types/IndicatorVariant.d.ts +15 -0
  346. package/dist/types/IndicatorVariant.js +10 -0
  347. package/dist/types/InputVariant.d.ts +13 -0
  348. package/dist/types/InputVariant.js +8 -0
  349. package/dist/types/RadioVariant.d.ts +38 -0
  350. package/dist/types/RadioVariant.js +4 -0
  351. package/dist/types/TabsVariant.d.ts +13 -0
  352. package/dist/types/TabsVariant.js +8 -0
  353. package/dist/types/ToastVariant.d.ts +15 -0
  354. package/dist/types/ToastVariant.js +10 -0
  355. package/dist/types/TooltipVariant.d.ts +12 -0
  356. package/dist/types/TooltipVariant.js +4 -0
  357. package/dist/types/passthrough.d.ts +83 -15
  358. package/dist/types/passthrough.js +2 -2
  359. package/dist/types/ptComponentMap.d.ts +35 -23
  360. package/dist/utilities/functions/extractDomContainer.d.ts +20 -1
  361. package/dist/utilities/functions/extractDomContainer.js +8 -3
  362. package/dist/utils/focusVisibility.d.ts +6 -0
  363. package/dist/utils/focusVisibility.js +4 -1
  364. package/dist/utils/passthroughDeduper.d.ts +14 -0
  365. package/dist/utils/versionCheck.js +1 -1
  366. package/dist/vite-plugin.d.ts +64 -7
  367. package/dist/vite.js +385 -259
  368. package/llms.txt +2 -1
  369. package/package.json +3 -3
  370. package/scripts/lib/adoption-checklist.json +312 -0
  371. package/scripts/lib/eslint-plugin.d.ts +13 -0
  372. package/scripts/lib/eslint-plugin.mjs +75 -11
  373. package/scripts/lib/idiom-scan.mjs +65 -0
  374. package/scripts/lib/mcp-config.mjs +203 -9
  375. package/scripts/lib/migrate-fix.mjs +42 -1
  376. package/scripts/lib/project-variant-dts.mjs +18 -0
  377. package/scripts/lib/validate-bb-markup.mjs +99 -2
@@ -1,8 +1,8 @@
1
1
  import { IconType } from '../../types/Icon';
2
- import { PtMap, PtValue } from '../../types/passthrough';
2
+ import { PtMap, PtValue, PtVariantAttrs } from '../../types/passthrough';
3
3
  import { Sizes } from '../../types/SizeScale';
4
- import { BadgeVariantType } from '../../types/BadgeVariant';
5
- import { BbBaseButtonProps } from '../BbBaseButton/types';
4
+ import { BadgeVariantBuiltIn, BadgeVariantRegistry, BadgeVariantType } from '../../types/BadgeVariant';
5
+ import { BbBaseButtonProps, BbLinkSlotProps } from '../BbBaseButton/types';
6
6
  /**
7
7
  * Passthrough parts of `BbBadge` (plans/passthrough/BbBadge.md). `spinner` is
8
8
  * named for uniformity with `BbButton`. The `__body` wrapper is layout, not a
@@ -18,26 +18,37 @@ import { BbBaseButtonProps } from '../BbBaseButton/types';
18
18
  */
19
19
  export type BbBadgePtPart = 'root' | 'icon' | 'spinner' | 'text' | 'clear';
20
20
  /**
21
- * Passthrough states of `BbBadge`: true while `--loading`.
21
+ * Passthrough states of `BbBadge`: `loading` while `--loading`; the link
22
+ * states while a slotted `BbBadgeButton` link has its `activeClass` /
23
+ * `exactActiveClass` on — on every part, so the whole chip shows it.
22
24
  *
25
+ * @state activeLink - Component-wide: the badge's `BbBadgeButton` is a link to
26
+ * the current page or one of its ancestors. The weakest state.
27
+ * @state exactActiveLink - Component-wide: the badge's `BbBadgeButton` is a
28
+ * link to the current page itself (`activeLink` is on too).
23
29
  * @state loading - Component-wide: `loading` is on; the spinner takes an
24
30
  * icon's place.
25
31
  */
26
- export type BbBadgePtState = 'loading';
32
+ export type BbBadgePtState = 'activeLink' | 'exactActiveLink' | 'loading';
27
33
  /** The runtime lists the resolver is wired with — kept next to the types so the two cannot drift. */
28
34
  export declare const BB_BADGE_PT: {
29
35
  readonly parts: readonly ["root", "icon", "spinner", "text", "clear"];
30
- readonly states: readonly ["loading"];
36
+ readonly states: readonly ["activeLink", "exactActiveLink", "loading"];
37
+ readonly variant: {
38
+ readonly names: readonly ["primary", "secondary", "destructive", "outline"];
39
+ readonly option: "badgeVariants";
40
+ };
31
41
  };
32
42
  export type BbBadgeProps = {
33
- [K in `pt:${BbBadgePtPart}` | `pt:${BbBadgePtPart}:${BbBadgePtState}`]?: PtValue;
34
- } & {
43
+ [K in `pt:${BbBadgePtPart}` | `pt:${BbBadgePtPart}:${BbBadgePtState}` | `pt:${BbBadgePtPart}:${BadgeVariantBuiltIn}`]?: PtValue;
44
+ } & /* @vue-ignore */ PtVariantAttrs<BbBadgePtPart, keyof BadgeVariantRegistry> & {
35
45
  /**
36
46
  * Passthrough, object form: `{ icon: '…', 'icon:loading': '…' }` — the same
37
47
  * keys as the `pt:*` attributes without the prefix. Parts: `root`, `icon`,
38
- * `spinner`, `text`, `clear`. State: `loading`.
48
+ * `spinner`, `text`, `clear`. States: `loading` and the registered
49
+ * variants (an app's own included).
39
50
  */
40
- pt?: PtMap<BbBadgePtPart, BbBadgePtState>;
51
+ pt?: PtMap<BbBadgePtPart, BbBadgePtState | BadgeVariantBuiltIn | keyof BadgeVariantRegistry>;
41
52
  /**
42
53
  * Renders an icon-only badge. When set, `prepend:icon` / `append:icon` are
43
54
  * ignored and the default slot becomes the badge's visually hidden accessible
@@ -66,9 +77,10 @@ export type BbBadgeProps = {
66
77
  */
67
78
  clearable?: boolean;
68
79
  /**
69
- * Accessible name of the clear button. Rarely needed: unset, it is composed
70
- * from the localized `badge.clearLabel` verb and the badge text ("Remove
71
- * Italy"), or the verb alone when a `BbBadgeButton` owns the body.
80
+ * Accessible name of the clear button, whole: set, it is the name on any
81
+ * body ("Remove the filter Deleted"). Rarely needed: unset, the name is
82
+ * composed from the localized `badge.clearLabel` verb and the badge text
83
+ * ("Remove Italy"), or the verb alone when a `BbBadgeButton` owns the body.
72
84
  */
73
85
  clearableLabel?: string;
74
86
  /**
@@ -88,6 +100,14 @@ export type BbBadgeProps = {
88
100
  export type BbBadgeEvents =
89
101
  /** Emitted when the clear button is pressed (only rendered when `clearable`). */
90
102
  (e: 'click:clear', event: MouseEvent) => void;
103
+ /**
104
+ * What `#icon` / `#prepend:icon` / `#append:icon` see: the badge's `pt` states.
105
+ * The link state comes from a slotted `BbBadgeButton` link, after hydration.
106
+ */
107
+ export type BbBadgeIconSlotProps = BbLinkSlotProps & {
108
+ /** The `loading` prop. While it is on, the spinner takes the icon's place. */
109
+ loading: boolean;
110
+ };
91
111
  export type BbBadgeSlots = {
92
112
  /**
93
113
  * The badge's label content. When `icon` is set this becomes the visually
@@ -95,6 +115,15 @@ export type BbBadgeSlots = {
95
115
  * body interactive (the wrapper stays a passive `<span>`).
96
116
  */
97
117
  default?: (props: object) => any;
118
+ /**
119
+ * The glyph of an icon-only badge, replacing the `icon` prop. Renders inside
120
+ * the `icon` part: `pt:icon`, `--icon-size` and the loading spinner apply.
121
+ */
122
+ icon?: (props: BbBadgeIconSlotProps) => any;
123
+ /** The leading icon, replacing `prepend:icon`; inside the `icon` part. */
124
+ 'prepend:icon'?: (props: BbBadgeIconSlotProps) => any;
125
+ /** The trailing icon, replacing `append:icon`; inside the `icon` part. */
126
+ 'append:icon'?: (props: BbBadgeIconSlotProps) => any;
98
127
  };
99
128
  /**
100
129
  * `BbBadgeButton` has full `BbBaseButton` parity: the badge body can do
@@ -107,7 +136,8 @@ export type BbBadgeSlots = {
107
136
  export type BbBadgeButtonProps = Omit<BbBaseButtonProps, 'block' | 'text'>;
108
137
  export type BbBadgeButtonSlots = {
109
138
  /**
110
- * The action's label — what the badge displays as its body.
139
+ * The action's label — what the badge displays as its body. A link's slot
140
+ * gets `{ activeLink, exactActiveLink }`, as on `BbBaseButton`.
111
141
  */
112
- default?: (props: object) => any;
142
+ default?: (props: BbLinkSlotProps) => any;
113
143
  };
@@ -1,5 +1,6 @@
1
+ import { BADGE_VARIANTS as e } from "../../types/BadgeVariant.js";
1
2
  //#region src/components/BbBadge/types.ts
2
- var e = {
3
+ var t = {
3
4
  parts: [
4
5
  "root",
5
6
  "icon",
@@ -7,7 +8,15 @@ var e = {
7
8
  "text",
8
9
  "clear"
9
10
  ],
10
- states: ["loading"]
11
+ states: [
12
+ "activeLink",
13
+ "exactActiveLink",
14
+ "loading"
15
+ ],
16
+ variant: {
17
+ names: e,
18
+ option: "badgeVariants"
19
+ }
11
20
  };
12
21
  //#endregion
13
- export { e as BB_BADGE_PT };
22
+ export { t as BB_BADGE_PT };
@@ -1,17 +1,18 @@
1
1
  import { usePassthrough as e } from "../../composables/usePassthrough.js";
2
2
  import { useConfig as t } from "../../composables/useConfig.js";
3
- import { useHydrated as n } from "../../composables/useHydrated.js";
4
- import { useFrameworkDetection as r } from "../../composables/useFrameworkDetection.js";
5
- import { BB_BASE_BUTTON_PT as i } from "./types.js";
6
- import a from "./RouterComponent.vue.js";
7
- import { useInertiaPage as o } from "../../composables/useInertiaPage.js";
8
- import { computed as s, createBlock as c, createElementBlock as l, createTextVNode as u, defineComponent as d, mergeProps as f, openBlock as p, renderSlot as m, resolveDynamicComponent as h, toDisplayString as g, unref as _, useAttrs as v, withCtx as y } from "vue";
3
+ import { useFrameworkDetection as n } from "../../composables/useFrameworkDetection.js";
4
+ import { BB_BASE_BUTTON_PT as r } from "./types.js";
5
+ import i from "./RouterComponent.vue.js";
6
+ import { currentOrigin as a, isNonRoutable as o, useBaseLinkState as s } from "./useLinkState.js";
7
+ import { computed as c, createBlock as l, createElementBlock as u, createTextVNode as d, defineComponent as f, guardReactiveProps as p, mergeProps as m, normalizeProps as h, openBlock as g, renderSlot as _, resolveDynamicComponent as v, toDisplayString as y, unref as b, useAttrs as x, withCtx as S } from "vue";
9
8
  //#region src/components/BbBaseButton/BbBaseButton.vue?vue&type=script&setup=true&lang.ts
10
- var b = "http://localhost", x = /*@__PURE__*/ d({
9
+ var C = /*@__PURE__*/ f({
11
10
  inheritAttrs: !1,
12
11
  __name: "BbBaseButton",
13
12
  props: {
14
13
  "pt:root": {},
14
+ "pt:root:activeLink": {},
15
+ "pt:root:exactActiveLink": {},
15
16
  "pt:root:disabled": {},
16
17
  pt: {},
17
18
  activeClass: {},
@@ -65,143 +66,105 @@ var b = "http://localhost", x = /*@__PURE__*/ d({
65
66
  preserveUrl: { type: Boolean },
66
67
  viewTransition: { type: Boolean }
67
68
  },
68
- setup(d) {
69
- let x = d, S = e({
69
+ setup(f) {
70
+ let C = f, w = s(C), T = e({
70
71
  component: "BbBaseButton",
71
- attrs: v(),
72
- props: x,
73
- parts: i.parts,
74
- states: i.states,
75
- active: { disabled: () => !!x.disabled }
76
- }), C = t(), { isInertia: w, isNuxt: T } = r(), { isHydrated: E } = n(), { getPageUrl: D } = o(), O = typeof window < "u", k = O ? window.location.origin : null, A = (e, t) => {
77
- let n = e.trim();
78
- if (!n) return !1;
79
- if (n.startsWith("#") || n.startsWith("//")) return !0;
80
- if (!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)) return !1;
81
- if (!t) return !0;
82
- try {
83
- return new URL(n).origin !== t;
84
- } catch {
85
- return !0;
72
+ attrs: x(),
73
+ props: C,
74
+ parts: r.parts,
75
+ states: r.states,
76
+ active: {
77
+ disabled: () => !!C.disabled,
78
+ activeLink: () => w.value.activeLink,
79
+ exactActiveLink: () => w.value.exactActiveLink
86
80
  }
87
- }, j = (e) => e === "/" ? e : e.replace(/\/+$/, ""), M = s(() => {
88
- let e = D();
89
- if (e) try {
90
- return j(new URL(e, b).pathname);
91
- } catch {
92
- return;
93
- }
94
- }), N = s(() => !!(x.href && !A(x.href, k))), P = s(() => {
95
- if (!N.value || !x.href) return;
96
- let e = M.value ?? "/";
97
- try {
98
- return j(new URL(x.href, `${b}${e}`).pathname);
99
- } catch {
100
- return;
101
- }
102
- }), F = s(() => O && E.value ? j(window.location.pathname) : void 0), I = s(() => {
103
- if (!x.href || A(x.href, k)) return;
104
- let e = F.value ?? "/";
105
- try {
106
- return j(new URL(x.href, `${b}${e}`).pathname);
107
- } catch {
108
- return;
109
- }
110
- }), L = s(() => w ? M.value : F.value), R = s(() => w ? P.value : I.value), z = s(() => {
111
- if (x.to) return !1;
112
- let e = L.value, t = R.value;
113
- return !e || !t ? !1 : t === e;
114
- }), B = s(() => {
115
- if (x.to) return !1;
116
- let e = L.value, t = R.value;
117
- return !e || !t ? !1 : t === "/" ? e.startsWith("/") : e === t || e.startsWith(`${t}/`);
118
- }), V = s(() => !!(x.href && w && N.value && !x.disabled && !x.target && !x.download && !x.external || x.to && !x.disabled)), H = s(() => !!(x.href || x.to && x.disabled)), U = s(() => x.activeClass ?? C.linkActiveClass), W = s(() => x.exactActiveClass ?? C.linkExactActiveClass), G = s(() => ({
81
+ }), E = t(), { isInertia: D, isNuxt: O } = n(), k = c(() => !C.to && w.value.activeLink), A = c(() => !C.to && w.value.exactActiveLink), j = c(() => !!(C.href && !o(C.href, a))), M = c(() => !!(C.href && D && j.value && !C.disabled && !C.target && !C.download && !C.external || C.to && !C.disabled)), N = c(() => !!(C.href || C.to && C.disabled)), P = c(() => C.activeClass ?? E.linkActiveClass), F = c(() => C.exactActiveClass ?? E.linkExactActiveClass), I = c(() => ({
119
82
  "bb-base-button": !0,
120
- "bb-base-button--block": x.block,
121
- "bb-base-button--disabled": x.disabled,
122
- [U.value]: B.value,
123
- [W.value]: z.value
124
- })), K = s(() => {
125
- let e = x.rel?.trim() ?? "";
126
- if (!x.target || x.target === "_self") return e || void 0;
83
+ "bb-base-button--block": C.block,
84
+ "bb-base-button--disabled": C.disabled,
85
+ [P.value]: k.value,
86
+ [F.value]: A.value
87
+ })), L = c(() => {
88
+ let e = C.rel?.trim() ?? "";
89
+ if (!C.target || C.target === "_self") return e || void 0;
127
90
  let t = new Set(e.split(/\s+/).filter(Boolean));
128
91
  return t.add("noopener"), t.add("noreferrer"), Array.from(t).join(" ");
129
- }), q = () => ({
130
- disabled: x.disabled,
131
- type: x.type
132
- }), J = () => {
133
- if (x.disabled) return {
92
+ }), R = () => ({
93
+ disabled: C.disabled,
94
+ type: C.type
95
+ }), z = () => {
96
+ if (C.disabled) return {
134
97
  "aria-disabled": !0,
135
98
  role: "link",
136
99
  href: void 0,
137
100
  tabindex: -1
138
101
  };
139
102
  let e = {
140
- href: x.href,
141
- rel: K.value,
142
- target: x.target,
143
- download: x.download === !0 ? "" : (x.download ?? void 0) || void 0
103
+ href: C.href,
104
+ rel: L.value,
105
+ target: C.target,
106
+ download: C.download === !0 ? "" : (C.download ?? void 0) || void 0
144
107
  };
145
- return z.value && (e["aria-current"] = x.ariaCurrentValue ?? "page"), e;
146
- }, Y = () => ({
147
- data: x.data,
148
- async: x.async,
149
- cacheFor: x.cacheFor,
150
- cacheTags: x.cacheTags,
151
- component: x.component,
152
- except: x.except,
153
- instant: x.instant,
154
- onError: x.onError,
155
- onPrefetched: x.onPrefetched,
156
- onPrefetching: x.onPrefetching,
157
- pageProps: x.pageProps,
158
- prefetch: x.prefetch,
159
- preserveUrl: x.preserveUrl,
160
- viewTransition: x.viewTransition,
161
- headers: x.headers,
162
- method: x.method,
163
- onBefore: x.onBefore,
164
- onCancel: x.onCancel,
165
- onCancelToken: x.onCancelToken,
166
- onFinish: x.onFinish,
167
- only: x.only,
168
- onProgress: x.onProgress,
169
- onStart: x.onStart,
170
- onSuccess: x.onSuccess,
171
- preserveScroll: x.preserveScroll,
172
- preserveState: x.preserveState,
173
- queryStringArrayFormat: x.queryStringArrayFormat,
174
- replace: x.replace
175
- }), X = () => ({
176
- activeClass: U.value,
177
- ariaCurrentValue: x.ariaCurrentValue,
178
- exactActiveClass: W.value,
179
- ...T ? { external: x.external } : {},
180
- rel: K.value,
181
- replace: x.replace,
182
- target: x.target,
183
- to: x.to
184
- }), Z = s(() => x.tag ?? "button"), Q = s(() => Z.value === "button" ? q() : {}), $ = s(() => J()), ee = s(() => X()), te = s(() => w ? {
185
- ...$.value,
186
- ...Y()
187
- } : ee.value);
188
- return (e, t) => V.value ? (p(), c(a, f({
108
+ return A.value && (e["aria-current"] = C.ariaCurrentValue ?? "page"), e;
109
+ }, B = () => ({
110
+ data: C.data,
111
+ async: C.async,
112
+ cacheFor: C.cacheFor,
113
+ cacheTags: C.cacheTags,
114
+ component: C.component,
115
+ except: C.except,
116
+ instant: C.instant,
117
+ onError: C.onError,
118
+ onPrefetched: C.onPrefetched,
119
+ onPrefetching: C.onPrefetching,
120
+ pageProps: C.pageProps,
121
+ prefetch: C.prefetch,
122
+ preserveUrl: C.preserveUrl,
123
+ viewTransition: C.viewTransition,
124
+ headers: C.headers,
125
+ method: C.method,
126
+ onBefore: C.onBefore,
127
+ onCancel: C.onCancel,
128
+ onCancelToken: C.onCancelToken,
129
+ onFinish: C.onFinish,
130
+ only: C.only,
131
+ onProgress: C.onProgress,
132
+ onStart: C.onStart,
133
+ onSuccess: C.onSuccess,
134
+ preserveScroll: C.preserveScroll,
135
+ preserveState: C.preserveState,
136
+ queryStringArrayFormat: C.queryStringArrayFormat,
137
+ replace: C.replace
138
+ }), V = () => ({
139
+ activeClass: P.value,
140
+ ariaCurrentValue: C.ariaCurrentValue,
141
+ exactActiveClass: F.value,
142
+ ...O ? { external: C.external } : {},
143
+ rel: L.value,
144
+ replace: C.replace,
145
+ target: C.target,
146
+ to: C.to
147
+ }), H = c(() => C.tag ?? "button"), U = c(() => H.value === "button" ? R() : {}), W = c(() => z()), G = c(() => V()), K = c(() => D ? {
148
+ ...W.value,
149
+ ...B()
150
+ } : G.value);
151
+ return (e, t) => M.value ? (g(), l(i, m({
189
152
  key: 0,
190
- class: G.value
191
- }, f(te.value, _(S).forwardAttrs, _(S).root)), {
192
- default: y(() => [m(e.$slots, "default", {}, () => [u(g(e.text), 1)])]),
153
+ class: I.value
154
+ }, m(K.value, b(T).forwardAttrs, b(T).root)), {
155
+ default: S(() => [_(e.$slots, "default", h(p(b(w))), () => [d(y(e.text), 1)])]),
193
156
  _: 3
194
- }, 16, ["class"])) : H.value ? (p(), l("a", f({
157
+ }, 16, ["class"])) : N.value ? (g(), u("a", m({
195
158
  key: 1,
196
- class: G.value
197
- }, f($.value, _(S).forwardAttrs, _(S).root)), [m(e.$slots, "default", {}, () => [u(g(e.text), 1)])], 16)) : (p(), c(h(Z.value), f({
159
+ class: I.value
160
+ }, m(W.value, b(T).forwardAttrs, b(T).root)), [_(e.$slots, "default", h(p(b(w))), () => [d(y(e.text), 1)])], 16)) : (g(), l(v(H.value), m({
198
161
  key: 2,
199
- class: G.value
200
- }, f(Q.value, _(S).forwardAttrs, _(S).root)), {
201
- default: y(() => [m(e.$slots, "default", {}, () => [u(g(e.text), 1)])]),
162
+ class: I.value
163
+ }, m(U.value, b(T).forwardAttrs, b(T).root)), {
164
+ default: S(() => [_(e.$slots, "default", h(p(b(w))), () => [d(y(e.text), 1)])]),
202
165
  _: 3
203
166
  }, 16, ["class"]));
204
167
  }
205
168
  });
206
169
  //#endregion
207
- export { x as default };
170
+ export { C as default };
@@ -11,15 +11,23 @@ import { RouteLocationRaw } from 'vue-router';
11
11
  */
12
12
  export type BbBaseButtonPtPart = 'root';
13
13
  /**
14
- * Passthrough states of `BbBaseButton`, true while the matching `--` modifier is on.
14
+ * Passthrough states of `BbBaseButton`: `disabled` while `--disabled` is on,
15
+ * the link states while `activeClass` / `exactActiveClass` are. Order =
16
+ * precedence, last wins: `disabled` outranks the link states.
15
17
  *
18
+ * @state activeLink - Component-wide: a link to the current page or one of its
19
+ * ancestors (`/users` on `/users/5`) — exactly when `activeClass` is on.
20
+ * The default slot gets it too, as `activeLink`.
21
+ * @state exactActiveLink - Component-wide: a link to the current page itself —
22
+ * exactly when `exactActiveClass` is on (`activeLink` is on too). The default
23
+ * slot gets it as `exactActiveLink`.
16
24
  * @state disabled - Component-wide: the button is `disabled`.
17
25
  */
18
- export type BbBaseButtonPtState = 'disabled';
26
+ export type BbBaseButtonPtState = 'activeLink' | 'exactActiveLink' | 'disabled';
19
27
  /** The runtime lists the resolver is wired with — kept next to the types so the two cannot drift. */
20
28
  export declare const BB_BASE_BUTTON_PT: {
21
29
  readonly parts: readonly ["root"];
22
- readonly states: readonly ["disabled"];
30
+ readonly states: readonly ["activeLink", "exactActiveLink", "disabled"];
23
31
  };
24
32
  export type BbBaseButtonProps = {
25
33
  [K in `pt:${BbBaseButtonPtPart}` | `pt:${BbBaseButtonPtPart}:${BbBaseButtonPtState}`]?: PtValue;
@@ -273,11 +281,22 @@ export type BbBaseButtonProps = {
273
281
  */
274
282
  viewTransition?: boolean;
275
283
  };
284
+ /**
285
+ * The default slot's props: whether the link points at the current page, the
286
+ * same facts as its `activeClass` / `exactActiveClass` and its
287
+ * `activeLink` / `exactActiveLink` `pt` states. Always `false` on a button.
288
+ */
289
+ export type BbLinkSlotProps = {
290
+ /** A link to the current page or one of its ancestors: `activeClass` is on. */
291
+ activeLink: boolean;
292
+ /** A link to the current page itself: `exactActiveClass` is on. */
293
+ exactActiveLink: boolean;
294
+ };
276
295
  export type BbBaseButtonSlots = {
277
296
  /**
278
297
  * Primary content rendered inside the button element. Falls back to the `text` prop when empty.
279
298
  */
280
- default?: (props: object) => any;
299
+ default?: (props: BbLinkSlotProps) => any;
281
300
  };
282
301
  /** Runtime list of every {@link BbBaseButtonProps} key (kept exhaustive by the map above). */
283
302
  export declare const BB_BASE_BUTTON_PROP_KEYS: Array<keyof BbBaseButtonProps>;
@@ -1,10 +1,16 @@
1
1
  //#region src/components/BbBaseButton/types.ts
2
2
  var e = {
3
3
  parts: ["root"],
4
- states: ["disabled"]
4
+ states: [
5
+ "activeLink",
6
+ "exactActiveLink",
7
+ "disabled"
8
+ ]
5
9
  }, t = Object.keys({
6
10
  pt: !0,
7
11
  "pt:root": !0,
12
+ "pt:root:activeLink": !0,
13
+ "pt:root:exactActiveLink": !0,
8
14
  "pt:root:disabled": !0,
9
15
  activeClass: !0,
10
16
  async: !0,
@@ -0,0 +1,41 @@
1
+ import { ComputedRef } from 'vue';
2
+ import { BbBaseButtonProps } from './types';
3
+ /** What a link knows about the current page: the `activeClass` / `exactActiveClass` facts. */
4
+ export type LinkState = {
5
+ /** The link's target is the current page or one of its ancestors. */
6
+ activeLink: boolean;
7
+ /** The link's target is the current page. */
8
+ exactActiveLink: boolean;
9
+ };
10
+ /** The props a link reads to place itself against the current page. */
11
+ export type LinkStateSource = Pick<BbBaseButtonProps, 'to' | 'href' | 'disabled' | 'external' | 'target' | 'replace'>;
12
+ export declare const currentOrigin: string | null;
13
+ export declare const isNonRoutable: (href: string, originToMatch?: string | null) => boolean;
14
+ /**
15
+ * Whether a link points at the current page — the one fact behind its
16
+ * `activeClass` / `exactActiveClass`, its `activeLink` / `exactActiveLink`
17
+ * `pt` states and its default-slot props, so the three always agree.
18
+ *
19
+ * - `to` links take the router's own answer (`useLink`, see `findUseLink`).
20
+ * An external NuxtLink is never active, as NuxtLink itself reports.
21
+ * - `href` links match the path against Inertia's `$page.url` when present,
22
+ * otherwise the browser URL: a prefix match for `activeLink`, the same path
23
+ * for `exactActiveLink`.
24
+ *
25
+ * A disabled `to` link renders a plain `<a>` without RouterLink, so it is not
26
+ * active; a disabled `href` link keeps its classes (and so its state).
27
+ */
28
+ export declare function useLinkState(props: LinkStateSource): ComputedRef<LinkState>;
29
+ /**
30
+ * A wrapper that renders a `BbBaseButton` as its root (BbButton, BbBadgeButton,
31
+ * a dropdown row) computes the link state for its own `pt` and slot, then hands
32
+ * it down so the base button does not compute it a second time. Only for a
33
+ * wrapper whose root IS the base button, bound with the same `to` / `href`.
34
+ */
35
+ export declare const provideLinkState: (state: ComputedRef<LinkState>) => void;
36
+ /**
37
+ * The base button's side: its wrapper's state when there is one, else its own.
38
+ * A handed-down state is shielded from the slot content, so a base button
39
+ * nested inside never takes its parent's.
40
+ */
41
+ export declare const useBaseLinkState: (props: LinkStateSource) => ComputedRef<LinkState>;
@@ -0,0 +1,70 @@
1
+ import { useConfig as e } from "../../composables/useConfig.js";
2
+ import { useHydrated as t } from "../../composables/useHydrated.js";
3
+ import { useFrameworkDetection as n } from "../../composables/useFrameworkDetection.js";
4
+ import { useInertiaPage as r } from "../../composables/useInertiaPage.js";
5
+ import { computed as i, getCurrentInstance as a, inject as o, provide as s, reactive as c } from "vue";
6
+ //#region src/components/BbBaseButton/useLinkState.ts
7
+ var l = "http://localhost", u = typeof window < "u", d = u ? window.location.origin : null, f = (e, t) => {
8
+ let n = e.trim();
9
+ if (!n) return !1;
10
+ if (n.startsWith("#") || n.startsWith("//")) return !0;
11
+ if (!/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)) return !1;
12
+ if (!t) return !0;
13
+ try {
14
+ return new URL(n).origin !== t;
15
+ } catch {
16
+ return !0;
17
+ }
18
+ }, p = (e) => e === "/" ? e : e.replace(/\/+$/, ""), m = (e, t) => {
19
+ try {
20
+ return p(new URL(e, `${l}${t}`).pathname);
21
+ } catch {
22
+ return;
23
+ }
24
+ }, h = (e, t) => {
25
+ let n = a()?.appContext.components ?? {}, r = (e) => {
26
+ let t = n[e]?.useLink;
27
+ return typeof t == "function" ? t : void 0;
28
+ };
29
+ return (e ? r(t) : void 0) ?? r("RouterLink");
30
+ };
31
+ function g(o) {
32
+ let s = e(), { isInertia: g, isNuxt: _ } = n(), { isHydrated: v } = t(), { getPageUrl: y } = r(), b = g ? void 0 : h(_, s.nuxtLinkName), x = b ? a()?.appContext.config.globalProperties.$router : void 0, S = x ? b(c({
33
+ to: i(() => o.to ?? x.currentRoute.value.fullPath),
34
+ replace: i(() => o.replace),
35
+ target: i(() => o.target),
36
+ external: i(() => o.external)
37
+ })) : void 0, C = i(() => {
38
+ let e = y();
39
+ if (e) try {
40
+ return p(new URL(e, l).pathname);
41
+ } catch {
42
+ return;
43
+ }
44
+ }), w = i(() => u && v.value ? p(window.location.pathname) : void 0), T = i(() => g ? C.value : w.value), E = i(() => {
45
+ if (!(!o.href || f(o.href, d))) return m(o.href, T.value ?? "/");
46
+ });
47
+ return i(() => {
48
+ if (o.to) {
49
+ let e = !!S && !o.disabled && !S.isExternal?.value;
50
+ return {
51
+ activeLink: e && S.isActive.value,
52
+ exactActiveLink: e && S.isExactActive.value
53
+ };
54
+ }
55
+ let e = T.value, t = E.value;
56
+ return !e || !t ? {
57
+ activeLink: !1,
58
+ exactActiveLink: !1
59
+ } : {
60
+ activeLink: t === "/" || e === t || e.startsWith(`${t}/`),
61
+ exactActiveLink: t === e
62
+ };
63
+ });
64
+ }
65
+ var _ = Symbol("bitboss-ui:link-state"), v = (e) => s(_, e), y = (e) => {
66
+ let t = o(_, null);
67
+ return t ? (s(_, null), t) : g(e);
68
+ };
69
+ //#endregion
70
+ export { d as currentOrigin, f as isNonRoutable, v as provideLinkState, y as useBaseLinkState, g as useLinkState };