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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (249) hide show
  1. package/dist/ai/BbAvatar.md +86 -58
  2. package/dist/ai/BbBadge.md +1 -1
  3. package/dist/ai/BbBreadcrumbs.md +2 -2
  4. package/dist/ai/BbButton.md +2 -2
  5. package/dist/ai/BbCalendar.md +5 -2
  6. package/dist/ai/BbCheckboxGroup.md +5 -4
  7. package/dist/ai/BbColorInput.md +12 -0
  8. package/dist/ai/BbColorPalette.md +11 -6
  9. package/dist/ai/BbDatePicker.md +12 -0
  10. package/dist/ai/BbDatePickerInput.md +17 -1
  11. package/dist/ai/BbDialog.md +3 -1
  12. package/dist/ai/BbDropdown.md +155 -60
  13. package/dist/ai/BbDropdownButton.md +25 -6
  14. package/dist/ai/BbNumberInput.md +3 -1
  15. package/dist/ai/BbRadioGroup.md +4 -4
  16. package/dist/ai/BbSelect.md +79 -67
  17. package/dist/ai/BbSelectPopover.md +24 -5
  18. package/dist/ai/BbSwitchGroup.md +5 -4
  19. package/dist/ai/BbTable.md +17 -16
  20. package/dist/ai/BbTimePicker.md +12 -0
  21. package/dist/ai/BbTimePickerInput.md +15 -1
  22. package/dist/ai/BbToast.md +3 -2
  23. package/dist/ai/BbTree.md +5 -1
  24. package/dist/ai/CommonPopover.md +1 -0
  25. package/dist/ai/FlatListBox.md +1 -0
  26. package/dist/ai/GroupedListBox.md +1 -0
  27. package/dist/ai/ListBox.md +1 -0
  28. package/dist/ai/OptionsContainer.md +4 -4
  29. package/dist/ai/changelog.json +163 -6
  30. package/dist/ai/components.json +32 -34
  31. package/dist/ai/composables/useToast.md +2 -2
  32. package/dist/ai/design-tokens.json +60 -0
  33. package/dist/ai/guides/agent-contract.md +8 -4
  34. package/dist/ai/guides/design-tokens.md +13 -0
  35. package/dist/ai/guides/fetch-items-playbook.md +7 -11
  36. package/dist/ai/guides/migration/components/bb-color-palette.md +11 -11
  37. package/dist/ai/guides/migration/components/bb-dropdown-button.md +1 -0
  38. package/dist/ai/guides/migration/components/bb-dropdown.md +1 -0
  39. package/dist/ai/guides/migration/components/bb-table.md +2 -1
  40. package/dist/ai/guides/migration/components/bb-toast.md +2 -2
  41. package/dist/ai/guides/migration/v2-to-v3.md +22 -5
  42. package/dist/ai/guides/migration/v3-beta-tooling.md +1 -0
  43. package/dist/ai/guides/passthrough.md +3 -3
  44. package/dist/ai/helpers/inertia/manifest.json +1 -1
  45. package/dist/ai/index.md +1 -1
  46. package/dist/ai/manifest/common.json +1 -0
  47. package/dist/ai/manifest/components/BbAvatar.json +5 -2
  48. package/dist/ai/manifest/components/BbAvatar.tree.json +32 -2
  49. package/dist/ai/manifest/components/BbCarousel.json +0 -3
  50. package/dist/ai/manifest/components/BbCheckboxGroup.json +2 -2
  51. package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +2 -0
  52. package/dist/ai/manifest/components/BbColorInput.json +5 -2
  53. package/dist/ai/manifest/components/BbColorPalette.json +5 -2
  54. package/dist/ai/manifest/components/BbColorPalette.removed.json +1 -2
  55. package/dist/ai/manifest/components/BbDatePicker.json +3 -0
  56. package/dist/ai/manifest/components/BbDatePickerInput.json +3 -0
  57. package/dist/ai/manifest/components/BbDialog.tree.json +2 -0
  58. package/dist/ai/manifest/components/BbDropdown.json +20 -14
  59. package/dist/ai/manifest/components/BbDropdown.removed.json +2 -1
  60. package/dist/ai/manifest/components/BbDropdown.tree.json +13 -3
  61. package/dist/ai/manifest/components/BbDropdownButton.json +13 -7
  62. package/dist/ai/manifest/components/BbDropdownButton.removed.json +2 -1
  63. package/dist/ai/manifest/components/BbDropdownButton.tree.json +2 -0
  64. package/dist/ai/manifest/components/BbOffCanvas.tree.json +2 -0
  65. package/dist/ai/manifest/components/BbRadioGroup.json +2 -2
  66. package/dist/ai/manifest/components/BbRadioGroup.tree.json +2 -0
  67. package/dist/ai/manifest/components/BbSelect.json +10 -7
  68. package/dist/ai/manifest/components/BbSelectPopover.json +6 -3
  69. package/dist/ai/manifest/components/BbSelectPopover.tree.json +5 -1
  70. package/dist/ai/manifest/components/BbSwitchGroup.json +2 -2
  71. package/dist/ai/manifest/components/BbSwitchGroup.tree.json +2 -0
  72. package/dist/ai/manifest/components/BbTable.json +6 -6
  73. package/dist/ai/manifest/components/BbTable.tree.json +4 -0
  74. package/dist/ai/manifest/components/BbTimePicker.json +5 -2
  75. package/dist/ai/manifest/components/BbTimePickerInput.json +5 -2
  76. package/dist/ai/manifest/components/BbTree.json +1 -1
  77. package/dist/ai/manifest/components/CommonPopover.json +1 -0
  78. package/dist/ai/manifest/components/FlatListBox.json +2 -1
  79. package/dist/ai/manifest/components/GroupedListBox.json +2 -1
  80. package/dist/ai/manifest/components/ListBox.json +2 -1
  81. package/dist/ai/manifest/components/OptionsContainer.json +6 -4
  82. package/dist/ai/manifest/index.json +2 -2
  83. package/dist/ai/manifest/meta.json +0 -3
  84. package/dist/ai/manifest/types.advanced.json +6 -6
  85. package/dist/ai/manifest/types.api.json +1 -3
  86. package/dist/ai/source/BbAvatar.md +119 -9
  87. package/dist/ai/source/BbBadge.md +12 -5
  88. package/dist/ai/source/BbBreadcrumbs.md +52 -54
  89. package/dist/ai/source/BbButton.md +41 -25
  90. package/dist/ai/source/BbCarousel.md +31 -28
  91. package/dist/ai/source/BbCheckboxGroup.md +15 -9
  92. package/dist/ai/source/BbColorInput.md +19 -0
  93. package/dist/ai/source/BbColorPalette.md +18 -0
  94. package/dist/ai/source/BbDatePicker.md +18 -0
  95. package/dist/ai/source/BbDatePickerInput.md +40 -1
  96. package/dist/ai/source/BbDialog.md +14 -1
  97. package/dist/ai/source/BbDropdown.md +211 -39
  98. package/dist/ai/source/BbDropdownButton.md +27 -2
  99. package/dist/ai/source/BbDropdownGroup.md +104 -38
  100. package/dist/ai/source/BbGallery.md +76 -55
  101. package/dist/ai/source/BbHost.md +12 -0
  102. package/dist/ai/source/BbNumberInput.md +17 -10
  103. package/dist/ai/source/BbOffCanvas.md +14 -1
  104. package/dist/ai/source/BbRadioGroup.md +12 -5
  105. package/dist/ai/source/BbSelect.md +35 -20
  106. package/dist/ai/source/BbSelectPopover.md +116 -8
  107. package/dist/ai/source/BbSwitchGroup.md +11 -4
  108. package/dist/ai/source/BbTable.md +72 -26
  109. package/dist/ai/source/BbTimePicker.md +19 -0
  110. package/dist/ai/source/BbTimePickerInput.md +15 -0
  111. package/dist/ai/source/BbToast.md +2 -2
  112. package/dist/ai/source/BbToastPortal.md +2 -2
  113. package/dist/ai/source/BbTree.md +1 -1
  114. package/dist/ai/source/CommonPopover.md +24 -1
  115. package/dist/ai/source/FlatListBox.md +26 -5
  116. package/dist/ai/source/GroupedListBox.md +63 -11
  117. package/dist/ai/source/ListBox.md +4 -0
  118. package/dist/ai/source/OptionsContainer.md +29 -11
  119. package/dist/components/BbAvatar/BbAvatar.vue.d.ts +1 -0
  120. package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +61 -43
  121. package/dist/components/BbAvatar/avatarIdentity.js +25 -0
  122. package/dist/components/BbAvatar/ptKeys.generated.d.ts +5 -1
  123. package/dist/components/BbAvatar/types.d.ts +24 -5
  124. package/dist/components/BbAvatar/types.js +5 -1
  125. package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +24 -23
  126. package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +80 -79
  127. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +152 -158
  128. package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +100 -85
  129. package/dist/components/BbCalendar/useDayGrid.js +120 -123
  130. package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +7 -7
  131. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +126 -122
  132. package/dist/components/BbCheckboxGroup/types.d.ts +7 -11
  133. package/dist/components/BbColorInput/BbColorInput.vue.d.ts +2 -0
  134. package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +148 -141
  135. package/dist/components/BbColorInput/types.d.ts +7 -0
  136. package/dist/components/BbColorPalette/BbColorPalette.vue.d.ts +2 -0
  137. package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +213 -202
  138. package/dist/components/BbColorPalette/types.d.ts +7 -0
  139. package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +3 -1
  140. package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +84 -73
  141. package/dist/components/BbDatePicker/types.d.ts +7 -0
  142. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +3 -1
  143. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +495 -510
  144. package/dist/components/BbDatePickerInput/types.d.ts +7 -0
  145. package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +219 -211
  146. package/dist/components/BbDialog/leaveGhost.js +22 -17
  147. package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +92 -87
  148. package/dist/components/BbDropdown/BbDropdown.vue.d.ts +3 -0
  149. package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +412 -369
  150. package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +382 -338
  151. package/dist/components/BbDropdown/DropdownFailures.vue.js +4 -0
  152. package/dist/components/BbDropdown/DropdownFailures.vue_vue_type_script_setup_true_lang.js +24 -0
  153. package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +117 -102
  154. package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +73 -45
  155. package/dist/components/BbDropdown/normalizeGroups.js +6 -2
  156. package/dist/components/BbDropdown/ptKeys.generated.d.ts +8 -0
  157. package/dist/components/BbDropdown/types.d.ts +65 -41
  158. package/dist/components/BbDropdown/types.js +1 -0
  159. package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +2 -0
  160. package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +93 -72
  161. package/dist/components/BbDropdownButton/ptKeys.generated.d.ts +48 -0
  162. package/dist/components/BbDropdownButton/types.d.ts +13 -2
  163. package/dist/components/BbDropdownButton/types.js +2 -0
  164. package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +318 -296
  165. package/dist/components/BbHost/BbHost.vue_vue_type_script_setup_true_lang.js +7 -1
  166. package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +9 -5
  167. package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +152 -144
  168. package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +108 -104
  169. package/dist/components/BbRadioGroup/types.d.ts +4 -7
  170. package/dist/components/BbSelect/BbSelect.vue.d.ts +3 -1
  171. package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +167 -163
  172. package/dist/components/BbSelect/types.d.ts +23 -20
  173. package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +3 -1
  174. package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +680 -637
  175. package/dist/components/BbSelectPopover/types.d.ts +10 -4
  176. package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +159 -155
  177. package/dist/components/BbSwitchGroup/types.d.ts +3 -6
  178. package/dist/components/BbTable/BbTable.vue.d.ts +1 -3
  179. package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1086 -1069
  180. package/dist/components/BbTable/types.d.ts +11 -10
  181. package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +3 -1
  182. package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +145 -134
  183. package/dist/components/BbTimePicker/types.d.ts +7 -0
  184. package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +3 -1
  185. package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +268 -259
  186. package/dist/components/BbTimePickerInput/types.d.ts +7 -0
  187. package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +12 -12
  188. package/dist/components/BbToast/types.d.ts +2 -2
  189. package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +56 -46
  190. package/dist/components/BbTree/types.d.ts +1 -1
  191. package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +13 -1
  192. package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +115 -96
  193. package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +194 -166
  194. package/dist/components/ListBox/ListBox.vue_vue_type_script_setup_true_lang.js +7 -4
  195. package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +86 -77
  196. package/dist/composables/useItemsGetter.js +34 -32
  197. package/dist/composables/useOpenModel.js +20 -0
  198. package/dist/deprecation/ai-deprecations.json.js +1 -1
  199. package/dist/i18n/locales/ar.json +2 -0
  200. package/dist/i18n/locales/cs.json +2 -0
  201. package/dist/i18n/locales/da.json +2 -0
  202. package/dist/i18n/locales/de-CH.json +2 -0
  203. package/dist/i18n/locales/de.json +2 -0
  204. package/dist/i18n/locales/el.json +2 -0
  205. package/dist/i18n/locales/en-GB.json +2 -0
  206. package/dist/i18n/locales/en.json +2 -0
  207. package/dist/i18n/locales/es-MX.json +2 -0
  208. package/dist/i18n/locales/es.json +2 -0
  209. package/dist/i18n/locales/fa.json +2 -0
  210. package/dist/i18n/locales/fi.json +2 -0
  211. package/dist/i18n/locales/fr.json +2 -0
  212. package/dist/i18n/locales/he.json +2 -0
  213. package/dist/i18n/locales/hu.json +2 -0
  214. package/dist/i18n/locales/it.json +2 -0
  215. package/dist/i18n/locales/ja.json +2 -0
  216. package/dist/i18n/locales/ko.json +2 -0
  217. package/dist/i18n/locales/nb.json +2 -0
  218. package/dist/i18n/locales/nl.json +2 -0
  219. package/dist/i18n/locales/pl.json +2 -0
  220. package/dist/i18n/locales/pt-BR.json +2 -0
  221. package/dist/i18n/locales/pt-PT.json +2 -0
  222. package/dist/i18n/locales/ro.json +2 -0
  223. package/dist/i18n/locales/ru.json +2 -0
  224. package/dist/i18n/locales/sv.json +2 -0
  225. package/dist/i18n/locales/tr.json +2 -0
  226. package/dist/i18n/locales/uk.json +2 -0
  227. package/dist/i18n/locales/zh-CN.json +2 -0
  228. package/dist/i18n/locales/zh-HK.json +2 -0
  229. package/dist/i18n/locales/zh-TW.json +2 -0
  230. package/dist/icon-scan.js +68 -61
  231. package/dist/index.d.ts +2 -2
  232. package/dist/llms-full.txt +573 -276
  233. package/dist/llms-medium.txt +8 -4
  234. package/dist/llms.txt +1 -1
  235. package/dist/locale-blueprint.json +2 -0
  236. package/dist/styles.css +2 -2
  237. package/dist/types/ActionButton.d.ts +2 -3
  238. package/dist/types/Option.d.ts +10 -0
  239. package/dist/types/ptComponentMap.d.ts +3 -3
  240. package/dist/utilities/functions/slotContent.js +19 -0
  241. package/dist/utils/loadRetry.js +8 -0
  242. package/dist/utils/versionCheck.js +1 -1
  243. package/dist/vite.js +4 -1
  244. package/llms.txt +1 -1
  245. package/package.json +3 -1
  246. package/scripts/README.md +2 -0
  247. package/scripts/lib/agent-setup.mjs +44 -26
  248. package/scripts/lib/validate-bb-markup.mjs +20 -0
  249. package/dist/ai/manifest/components/BbAvatar.removed.json +0 -6
@@ -810,8 +810,8 @@ picked someone:
810
810
  v-model="reviewers"
811
811
  clearable
812
812
  compact
813
- :dependencies="[retry]"
814
813
  empty-text="No members match your search"
814
+ failed-text="Couldn't load members."
815
815
  :filter-by="false"
816
816
  hint="Type a name to search"
817
817
  item-text="name"
@@ -824,21 +824,13 @@ picked someone:
824
824
  :query-debounce-time="300"
825
825
  stash
826
826
  >
827
- <template #empty="{ error, query }">
828
- <template v-if="error">
829
- Couldn't load members.
830
- <BbButton size="sm" variant="ghost" @click="retry++">
831
- Try again
832
- </BbButton>
833
- </template>
834
- <template v-else>No members match “{{ query }}”</template>
835
- </template>
827
+ <template #empty="{ query }">No members match “{{ query }}”</template>
836
828
  </BbSelect>
837
829
  </div>
838
830
  </template>
839
831
  <script setup lang="ts">
840
832
  import { ref } from 'vue';
841
- import { BbButton, BbSelect } from 'bitboss-ui';
833
+ import { BbSelect } from 'bitboss-ui';
842
834
  import type { BbSelectItemsContext } from 'bitboss-ui';
843
835
 
844
836
  type Member = {
@@ -906,8 +898,6 @@ const searchMembers = async ({
906
898
  };
907
899
 
908
900
  const reviewers = ref<string[]>([]);
909
- // The retry: bumping a dependency reloads with `reason: 'dependencies'`.
910
- const retry = ref(0);
911
901
  </script>
912
902
  ```
913
903
 
@@ -1113,24 +1103,17 @@ nothing to catch.
1113
1103
 
1114
1104
  A provider signals a failure by **throwing** — never by returning `[]`, which is
1115
1105
  a real, applied result. On a failed call the select clears the rows (stale rows
1116
- never sit under a new filter), prunes nothing, and shows `failed-text` (locale
1117
- default "Couldn't load items") in the empty state; with `stash` the failure row
1118
- sits below the picks the stash still names. The `#empty` slot receives
1119
- `error` — what you threw, untouched (a nullish rejection becomes an `Error`);
1120
- `null` when nothing failed — next to
1121
- `query` and `focus()`. There is no built-in retry: bump a counter you list in
1122
- `dependencies`, which reloads with `reason: 'dependencies'` inside the select's
1123
- own flow (debounced, aborting the call in flight):
1106
+ never sit under a new filter), prunes nothing, and shows its own failure row
1107
+ under the list: `failed-text` (locale default "Couldn't load items"),
1108
+ announced, then a "Try again" button. With `stash` the row sits below the picks
1109
+ the stash still names. "Try again" runs the failed call again with the same
1110
+ query, on click only, and hands focus back to the search field. `#empty` means
1111
+ empty: it never renders for a failure, so write empty copy there and word the
1112
+ failure with `failed-text`:
1124
1113
 
1125
1114
  ```vue
1126
- <BbSelect :items="searchMembers" :dependencies="[retry]" …>
1127
- <template #empty="{ error, query }">
1128
- <template v-if="error">
1129
- Couldn't load members.
1130
- <BbButton size="sm" variant="ghost" @click="retry++">Try again</BbButton>
1131
- </template>
1132
- <template v-else>No members match “{{ query }}”</template>
1133
- </template>
1115
+ <BbSelect :items="searchMembers" failed-text="Couldn't load members." …>
1116
+ <template #empty="{ query }">No members match “{{ query }}”</template>
1134
1117
  </BbSelect>
1135
1118
  ```
1136
1119
 
@@ -1146,8 +1129,9 @@ own flow (debounced, aborting the call in flight):
1146
1129
  - **Panel states**: `loading-text` / `empty-text` / `failed-text` (locale
1147
1130
  defaults "Loading..." / "No data to display" / "Couldn't load items") or the
1148
1131
  `#loading` / `#empty` slots — both receive `{ query }`, `#empty` also
1149
- `focus()`, `close()` (for an action that keeps focus in the panel) and
1150
- `error`.
1132
+ `focus()` and `close()` (for an action that keeps focus in the panel). A
1133
+ failed load has its own row (`failed-text` and "Try again"), never
1134
+ `#empty`.
1151
1135
 
1152
1136
  `stash` accumulates picked options across searches: a pick stays named (chips
1153
1137
  keep their text) when a later search or a failed load no longer returns it. It
@@ -1620,6 +1604,13 @@ Pressing Enter in the search field with **no option highlighted** emits
1620
1604
  does not create anything itself: append the new item to `items` and select it.
1621
1605
  This is the idiomatic pattern for closed-but-growable vocabularies.
1622
1606
 
1607
+ While you listen to `option:add`, a typed query that no option matches
1608
+ exactly (case aside) also gets a **"Create «query»" row**: the last row after
1609
+ the matches, or the only one when nothing matches (in place of the
1610
+ no-results text and `#empty`). It is a real option, clickable and reached
1611
+ with the arrow keys, and activating it does what Enter does. It is not shown
1612
+ while the list loads or after a failed load.
1613
+
1623
1614
  **Create a label by pressing Enter**
1624
1615
 
1625
1616
  ```vue
@@ -1677,14 +1668,12 @@ const createLabel = (text: string) => {
1677
1668
  </script>
1678
1669
  ```
1679
1670
 
1680
- #### A record that needs its own form: open its dialog from `#empty`
1671
+ #### A record that needs its own form: open its dialog from `option:add`
1681
1672
 
1682
1673
  When creating the missing row takes a real form (a person, a company), the
1683
- select doesn't create it: its dialog does. Offer the action where the search
1684
- came up empty, as one line in `#empty` with an inline `BbBaseButton` (not a
1685
- `BbButton` in `#footer`), and wire Enter to the same call through
1686
- `option:add`. Open the dialog from code, seed it with the query, and on
1687
- `completed` add the row and select it:
1674
+ select doesn't create it: its dialog does. Handle `option:add` (the create
1675
+ row's click and Enter both land there): open the dialog from code, seed it
1676
+ with the query, and on `completed` add the row and select it:
1688
1677
 
1689
1678
  **No results? Create the person in a dialog**
1690
1679
 
@@ -1705,17 +1694,7 @@ came up empty, as one line in `#empty` with an inline `BbBaseButton` (not a
1705
1694
  :items="people"
1706
1695
  label="Contact"
1707
1696
  @option:add="(query) => query && create(query)"
1708
- >
1709
- <template #empty="{ query }">
1710
- No results for “{{ query }}”.
1711
- <BbBaseButton
1712
- class="font-medium text-(--bb-primary) hover:underline"
1713
- @click="create(query)"
1714
- >
1715
- Create {{ query }}
1716
- </BbBaseButton>
1717
- </template>
1718
- </BbSelect>
1697
+ />
1719
1698
 
1720
1699
  <!-- In an app this is its own CreatePersonDialog.vue: pass the component
1721
1700
  to useBbDialog instead of the id. -->
@@ -1734,7 +1713,6 @@ came up empty, as one line in `#empty` with an inline `BbBaseButton` (not a
1734
1713
  <script setup lang="ts">
1735
1714
  import { ref } from 'vue';
1736
1715
  import {
1737
- BbBaseButton,
1738
1716
  BbButton,
1739
1717
  BbDialog,
1740
1718
  BbForm,
@@ -1757,8 +1735,8 @@ const save = async (values: Record<string, unknown>): Promise<Person> => ({
1757
1735
  name: String(values.name),
1758
1736
  });
1759
1737
 
1760
- // The handle lives in setup, not on a button inside `#empty`: the panel closes
1761
- // as the dialog takes focus, and the slot unmounts with it.
1738
+ // The handle lives in setup: the panel closes as the dialog takes focus, and
1739
+ // the create row goes with it.
1762
1740
  const personDialog = useBbDialog<{ name: string }, Person>('person-create');
1763
1741
  const create = async (name: string) => {
1764
1742
  const result = await personDialog.show({ name });
@@ -1770,13 +1748,11 @@ const create = async (name: string) => {
1770
1748
  ```
1771
1749
 
1772
1750
  - **Open it with a handle from setup**, `useBbDialog(CreatePersonDialog)`
1773
- (or an id), never `v-bb-dialog` on the button inside `#empty`. The panel
1774
- closes as the dialog takes focus and `#empty` unmounts with it: an
1775
- on-demand opening (`v-bb-dialog="{ component }"`) is dismissed with its
1776
- trigger and nothing opens. A literal id of a placed `BbDialog` does open
1777
- (the dialog outlives the button), but the handle is the one shape that
1778
- works either way. The ESLint rule `bitboss-ui/no-dialog-in-panel` reports
1779
- the on-demand form ([ESLint rules](./guides/eslint-rules.md)).
1751
+ (or an id), never `v-bb-dialog` on a button inside the panel: the panel
1752
+ closes as the dialog takes focus, and an on-demand opening
1753
+ (`v-bb-dialog="{ component }"`) is dismissed with its trigger. The ESLint
1754
+ rule `bitboss-ui/no-dialog-in-panel` reports the on-demand form
1755
+ ([ESLint rules](./guides/eslint-rules.md)).
1780
1756
  - **Inside another dialog it just stacks.** The create dialog opens above the
1781
1757
  one holding the select, and on close focus comes back to the select, closed,
1782
1758
  showing the new pick. Nothing to wire.
@@ -1784,7 +1760,7 @@ const create = async (name: string) => {
1784
1760
  `known-items` (`{ value: person.id, label: person.name }`): the provider
1785
1761
  returns it on the next load.
1786
1762
  - **Keyboard**: Enter in the search field fires `option:add` (no option is
1787
- highlighted when nothing matched), and Tab reaches the button.
1763
+ highlighted when nothing matched), and the arrow keys reach the create row.
1788
1764
 
1789
1765
  ### Group related options
1790
1766
 
@@ -1797,6 +1773,11 @@ no group: those rows are listed **first**, before every header, and `#group` is
1797
1773
  not called for them (a known row is listed the same way). `BbDropdown`'s
1798
1774
  `groupBy` follows the same rule.
1799
1775
 
1776
+ Headers are sticky: the header of the group you are scrolling through stays
1777
+ pinned at the top of the list, and leaves with its group's last option. A list
1778
+ that opens on a selection shows its group's header right above it, and a row
1779
+ reached with the arrow keys always stops below the pinned header.
1780
+
1800
1781
  A grouped list virtualizes **whole groups, not rows**: a group mounts only
1801
1782
  when it scrolls into range, but all of its rows mount together. Many
1802
1783
  small-to-medium groups window just as well as a flat list; one very large
@@ -2040,11 +2021,39 @@ is all you need.
2040
2021
  - `clearable` — clear affix when a value exists; emits `null` / `[]`. Single: re-clicking the pick clears too.
2041
2022
  - Empty panel — `empty-text` or `#empty`.
2042
2023
 
2024
+ ### Opening from code: `v-model:open`
2025
+
2026
+ `v-model` is the value; `v-model:open` is whether the options panel is open. Bound,
2027
+ your ref opens and closes it, and every open and close the user makes is
2028
+ written back: a pick, Escape, a click outside, the phone sheet's own dismiss. A static `:open` with no
2029
+ listener is only the initial state. An open from code is the same open a
2030
+ click makes (focus moves into the panel), and `disabled` / `readonly` refuse it (the ref is set back
2031
+ to `false`).
2032
+
2033
+ ```vue
2034
+ <script setup lang="ts">
2035
+ import { ref } from 'vue';
2036
+
2037
+ const city = ref<string | null>(null);
2038
+ const open = ref(false);
2039
+ </script>
2040
+
2041
+ <template>
2042
+ <BbButton text="Choose a city" @click="open = true" />
2043
+ <BbSelect
2044
+ v-model="city"
2045
+ v-model:open="open"
2046
+ label="City"
2047
+ :items="['Milan', 'Rome', 'Turin']"
2048
+ />
2049
+ </template>
2050
+ ```
2051
+
2043
2052
  ### Events and v-model
2044
2053
 
2045
2054
  - `update:modelValue` — the resolved value (single) or array (multiple), on
2046
2055
  pick, chip removal, clear and coherence enforcement.
2047
- - `option:add` — Enter on a query with no highlighted option (see above).
2056
+ - `option:add` — Enter on a query with no highlighted option, or the create row (see above).
2048
2057
  - `focus` / `blur` — the control gaining/losing focus; `input` / `change` —
2049
2058
  native events from the panel search field.
2050
2059
  - `inactive` — focus has fully left the component (control **and** panel).
@@ -2381,8 +2390,8 @@ it: [passthrough guide § Typing `pt` in `<script>`](./guides/passthrough.md#typ
2381
2390
  - **A failed load is not an empty one.** A provider throws to fail; returning
2382
2391
  `[]` is applied as a real empty result and, with `enforce-coherence`, prunes
2383
2392
  every pick. On a failure the rows are cleared, nothing is pruned, and the
2384
- panel shows `failed-text` (with `stash`, below the picks the stash still
2385
- names); `#empty` gets `error`.
2393
+ panel shows its failure row, `failed-text` and "Try again" (with `stash`,
2394
+ below the picks the stash still names); `#empty` stays for empty results.
2386
2395
  - `option:add` can fire with an empty string — trim and guard in the handler.
2387
2396
 
2388
2397
  ### Anti-patterns
@@ -2422,6 +2431,7 @@ it: [passthrough guide § Typing `pt` in `<script>`](./guides/passthrough.md#typ
2422
2431
  ## v-model
2423
2432
 
2424
2433
  - `v-model` — type: `any`
2434
+ - `v-model:open` — type: `boolean \| undefined`
2425
2435
 
2426
2436
  ## Props
2427
2437
 
@@ -2441,7 +2451,7 @@ it: [passthrough guide § Typing `pt` in `<script>`](./guides/passthrough.md#typ
2441
2451
  | `disabled` | `boolean \| undefined` | `false` | | Disables the component. |
2442
2452
  | `disableWriting` | `boolean \| "auto" \| "mobile" \| "desktop" \| undefined` | `'auto'` | | Hides the panel's search field: `true` everywhere, `'mobile'` / `'desktop'` on that platform only. `'auto'` hides it, per open, for an array `items` shorter than the plugin's `autoDisableWritingThreshold` (6); never for a provider or with an `option:add` listener. |
2443
2453
  | `emptyText` | `string \| undefined` | | | String displayed when there are no items to display. |
2444
- | `enforceCoherence` | `boolean \| undefined` | `false` | | After every successful load that is not a search, removes the picks the fetched rows do not contain (a single model resets to `null`). A `stash` does not count, a value a `known-items` row names is kept until a parent change; a search or a failed load never prunes. |
2454
+ | `enforceCoherence` | `boolean \| undefined` | `false` | | After each successful non-search load, removes the picks the fetched rows lack (a single model resets to `null`). A `stash` does not count; a `known-items` value stays until a parent change; a search or a failed load never prunes. |
2445
2455
  | `errors` | `string \| string[] \| undefined` | | | Error messages under the field, a string or array, in an `aria-live="polite"` region and first in the control's `aria-describedby`, so they are re-read when it regains focus. |
2446
2456
  | `failedText` | `string \| undefined` | `the localized `common.failedText` ("Couldn't load items")` | | String displayed in the empty state while the latest load FAILED (the provider threw): the twin of `emptyText` for that case. |
2447
2457
  | `filterBy` | `false \| string[] \| undefined` | `[]` | | What typing filters on: empty = the display text and description; item paths = those fields (`['name', 'email']`); `false` = no filtering. Ranked, case and accents ignored (guide § Search). Use `false` when the provider matched the query on the server, or its email matches show as "No results". |
@@ -2475,6 +2485,7 @@ it: [passthrough guide § Typing `pt` in `<script>`](./guides/passthrough.md#typ
2475
2485
  | `multiple` | `boolean \| undefined` | `false` | | Allows the selection of multiple items. |
2476
2486
  | `name` | `string \| undefined` | | | Defines the name of the input. |
2477
2487
  | `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on mobile), spread over its defaults. A `pt` inside it styles only the sheet (passthrough guide § Inside the sheet). |
2488
+ | `open` | `boolean \| undefined` | `false` | | Whether the panel is open (`v-model:open`; `v-model` stays the value). Bound, the app opens and closes it; unbound, the initial state. |
2478
2489
  | `persistentHint` | `boolean \| undefined` | `false` | | Keeps the hint displayed. |
2479
2490
  | `placeholder` | `string \| undefined` | | | Text shown in the field while nothing is picked (an empty list has `emptyText`). |
2480
2491
  | `prefill` | `boolean \| "interaction" \| undefined` | `'interaction'` | | When the options first load: `'interaction'` on first open, `true` on mount, `false` only once the user types (on open with `disable-writing`). An array `items` or a seeded model always loads at once. |
@@ -2486,7 +2497,7 @@ it: [passthrough guide § Typing `pt` in `<script>`](./guides/passthrough.md#typ
2486
2497
  | `rules` | `RuleExpression<any>` | | | vee-validate rules for this field. Only inside a `BbForm`. |
2487
2498
  | `selectable` | `boolean \| ((item: T) => boolean) \| undefined` | `true` | | Defines whether options are selectable. Can be a global boolean that affects all options or a function that accepts an item and returns a boolean that only affects that item. Non-selectable options are rendered disabled. |
2488
2499
  | `selectedLabelsFn` | `((count: number) => string) \| undefined` | | | Function that returns a string to be displayed when the number of selected labels is greater than `maxSelectedLabels`. |
2489
- | `stash` | `boolean \| undefined` | `false` | | Keeps picked options named across searches: a pick stays resolvable (its chip keeps its text) when a later search or a failed load no longer returns it. It follows the model, and does not keep a pick valid: `enforce-coherence` still prunes it. |
2500
+ | `stash` | `boolean \| undefined` | `false` | | Keeps picks named (their chips keep their text) when a later search or a failed load no longer returns them. It follows the model; it does not keep a pick valid (`enforce-coherence` still prunes it). |
2490
2501
  | `transitionDuration` | `number \| undefined` | `250` | | How long the transition has to last in milliseconds. |
2491
2502
  | `validationLabel` | `string \| undefined` | | | The field's name in validation messages (`{field}`): "Email is not valid". Defaults to the `label` (or `legend`), then "This field"; never the `name`. Set it when the label is hidden or reads badly in a sentence (icon-only, a question). `BbForm` only. |
2492
2503
  | `validationMode` | `'aggressive'` \| `'balanced'` \| `'lazy'` \| `'submit-only'` \| `'submit-live'` | | | When the field validates: `aggressive` (each change), `balanced` (on leave, then live while in error), `lazy` (on leave), `submit-only`, `submit-live`. Unset: the `BbForm`'s `validation-mode`, then `all.validationMode` (`'balanced'`). `BbForm` only. |
@@ -2556,20 +2567,21 @@ States are listed in precedence order: when two are on at once and their entries
2556
2567
  - `show` — `(): void` — Emitted as soon as the options surface starts to open (the popover, or the sheet on a phone).
2557
2568
  - `shown` — `(): void` — Emitted once the options surface is open and its open transition has finished.
2558
2569
  - `update:modelValue` — `(value: any): void` — Emitted with the new value whenever `v-model` changes.
2570
+ - `update:open` — `(value: boolean): void` — The panel opened or closed (`v-model:open`).
2559
2571
 
2560
2572
  ## Slots
2561
2573
 
2562
2574
  - `append` — scope: `{ query: string; focus: () => void; close: () => Promise<void>; }` — Content appended inside the input field, after the value area.
2563
2575
  - `append:outer` — scope: `{ query: string; close: () => Promise<void>; }` — Content appended outside the input field wrapper.
2564
- - `chip` — scope: `BbSelectChipSlotProps<T, Known>` `{ known: boolean; item: BbSelectKnownItem \| T; text: string; value: any; disabled: boolean; deselect: () => void }` — Replaces the default badge rendered for each selection in `multiple` mode. Not called in `comma` mode, nor for the collapsed "+N" summary. With `known-items` bound, `item` is the known `{ value, label }` row (`known: true`) until the list brings the real one.
2576
+ - `chip` — scope: `BbSelectChipSlotProps<T, Known>` `{ known: boolean; item: BbSelectKnownItem \| T; text: string; value: any; disabled: boolean; deselect: () => void }` — Each selection's badge with `multiple` (not in `comma` mode, nor the "+N" summary). With `known-items` bound, `item` is the known `{ value, label }` row (`known: true`) until the list brings the real one.
2565
2577
  - `description` — scope: `BbSelectDescriptionSlotProps` `{ text: string; hasErrors: boolean; hasWarnings: boolean }` — Replaces the description text. Provided alone (no `description` prop) it still renders the description region and wires it into `aria-describedby`.
2566
- - `empty` — scope: `{ query: string; focus: () => void; close: () => Promise<void>; error: unknown; }` — Content shown when no options match the query or the list is empty. `error` is what the latest failed load threw, untouched (`null` when none). `close()` closes the panel, for an action that does not move focus out of it.
2578
+ - `empty` — scope: `{ query: string; focus: () => void; close: () => Promise<void>; }` — Content shown when no options match the query or the list is empty. Empty only: a failed load shows the failure row (`failed-text`, then "Try again"). `close()` closes the panel, for an action that does not move focus out of it.
2567
2579
  - `footer` — scope: `BbSelectPanelSlotProps` `{ close: () => Promise<void>; clear: () => void; empty: boolean; focus: () => void; query: string; selectedOptions: BbSelectResolvedOption[] }` — Content pinned to the bottom of the options panel, below the options list. Rendered in both the desktop popover and the adaptive sheet.
2568
2580
  - `group` — scope: `BbSelectGroupSlotProps<T>` `{ text: string; item: T; index: number; length: number; disabled: boolean }` — Replaces the default group header rendered above grouped options. Not called for rows with no group (`group-by` gives `null`/`undefined`, known rows): they are listed without a header.
2569
2581
  - `header` — scope: `BbSelectPanelSlotProps` `{ close: () => Promise<void>; clear: () => void; empty: boolean; focus: () => void; query: string; selectedOptions: BbSelectResolvedOption[] }` — Content pinned to the top of the options panel, above the search field. Rendered in both the desktop popover and the adaptive sheet.
2570
2582
  - `label` — scope: `BbSelectLabelSlotProps` `{ showAsterisk?: boolean; text: string; hasErrors: boolean; hasWarnings: boolean }` — Replaces the default label text rendered above the input.
2571
2583
  - `loading` — scope: `{ query: string; }` — Content shown inside the options dropdown while items are loading.
2572
- - `option` — scope: `BbSelectOptionSlotProps<T, Known>` `{ known: boolean; item: BbSelectKnownItem \| T; disabled: boolean; focused: boolean; index: number; hasErrors?: boolean; loading: boolean; selected: boolean; text: string; value: any; description: string }` — Replaces the default rendering of each option row in the dropdown. With `known-items` bound, a row the list has not brought yet is the known `{ value, label }` row, `known: true`: check `known` before reading an option field off `item`.
2584
+ - `option` — scope: `BbSelectOptionSlotProps<T, Known>` `{ known: boolean; item: BbSelectKnownItem \| T; disabled: boolean; focused: boolean; index: number; hasErrors?: boolean; loading: boolean; selected: boolean; text: string; value: any; description: string }` — Each option row's content. With `known-items` bound, a row the list has not brought yet is the known `{ value, label }` row (`known: true`): check `known` before reading an option field off `item`.
2573
2585
  - `prefix` — scope: `object` — Content rendered as an inline prefix inside the input field.
2574
2586
  - `prepend` — scope: `{ query: string; focus: () => void; close: () => Promise<void>; }` — Content prepended inside the input field, before the value area.
2575
2587
  - `prepend:outer` — scope: `{ query: string; close: () => Promise<void>; }` — Content prepended outside the input field wrapper.
@@ -436,8 +436,9 @@ Items playbook. The essentials:
436
436
  chips stay accurate; `modelValue` is your v-model as-is (typed `any`);
437
437
  `signal` is an `AbortSignal` to pass to every request.
438
438
  - A provider **throws** to fail (never `return []`, an applied empty result):
439
- the rows are cleared, nothing is pruned, `failed-text` shows and `#empty`
440
- gets `error`; retry by bumping a `dependencies` counter. A pick no row has
439
+ the rows are cleared, nothing is pruned, and the failure row shows
440
+ `failed-text` with a built-in "Try again" (`#empty` is for empty results
441
+ only). A pick no row has
441
442
  named yet still shows (trigger text, phone-sheet chip): its value as given
442
443
  when it is a string or a number, else no text.
443
444
 
@@ -1074,6 +1075,12 @@ closed-but-growable vocabularies — the same as `BbSelect`. The behaviour is ga
1074
1075
  by the search field existing; `disable-writing` (which removes the field) also
1075
1076
  disables it.
1076
1077
 
1078
+ While you listen to `option:add`, a typed query that no option matches
1079
+ exactly (case aside) also gets a **"Create «query»" row**: last after the
1080
+ matches, or the only row when nothing matches (in place of the no-results
1081
+ text and `#empty`). It is a real option (click, arrow keys, announced) and
1082
+ does what Enter does; not while the list loads or after a failed load.
1083
+
1077
1084
  ```ts
1078
1085
  const roles = ref<string[]>(['Reviewer', 'Approver']);
1079
1086
  const role = ref<string | null>(null);
@@ -1639,12 +1646,21 @@ popover ↔ sheet. `off-canvas-props` forwards extra `BbOffCanvas` props to the
1639
1646
  sheet (`size`, `draggable`, `fullscreen`, `stack`); `:adaptive="false"` keeps a
1640
1647
  floating popover everywhere.
1641
1648
 
1649
+ ### Opening from code: `v-model:open`
1650
+
1651
+ `v-model` is the value; `v-model:open` is whether the options panel is open. Bound,
1652
+ your ref opens and closes it, and every open and close the user makes is
1653
+ written back: a pick, Escape, a click outside, the phone sheet's own dismiss. A static `:open` with no
1654
+ listener is only the initial state. An open from code is the same open a
1655
+ click makes (focus moves into the panel), and `disabled` / `readonly` refuse it (the ref is set back
1656
+ to `false`).
1657
+
1642
1658
  ### Events and v-model
1643
1659
 
1644
1660
  - `update:modelValue` — the resolved value (single) or array (multiple), on pick,
1645
1661
  `clear`, coherence enforcement, and — in `multiple` mode only — deselect.
1646
1662
  A second click on the current option in single mode emits nothing.
1647
- - `option:add` — Enter on a non-matching query with nothing highlighted (above).
1663
+ - `option:add` — Enter on a non-matching query with nothing highlighted, or the create row (above).
1648
1664
  - `focus` / `blur` — the activator gaining/losing focus.
1649
1665
  - `input` / `change` — native events from the panel search field.
1650
1666
  - `click` — the activator was clicked.
@@ -1806,7 +1822,7 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
1806
1822
  it does not keep them valid.
1807
1823
  - A provider **throws** to fail; `return []` is an applied empty result that
1808
1824
  prunes every pick. On a failure the rows are cleared, nothing is pruned,
1809
- `failed-text` shows and `#empty` receives `error`.
1825
+ and the failure row shows `failed-text` with "Try again", never `#empty`.
1810
1826
  - `enforce-coherence` opts **each instance** into its own load. One field, one
1811
1827
  request; N provider-backed rows, N requests.
1812
1828
  - `option:add` can fire with an empty string — trim and guard.
@@ -1890,6 +1906,7 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
1890
1906
  ## v-model
1891
1907
 
1892
1908
  - `v-model` — type: `any`
1909
+ - `v-model:open` — type: `boolean \| undefined`
1893
1910
 
1894
1911
  ## Props
1895
1912
 
@@ -1934,6 +1951,7 @@ A `pt` value written in `<script>` (a constant, a preset, a wrapper's
1934
1951
  | `multiple` | `boolean \| undefined` | `false` | | Enable multiple item selection. When true, modelValue must be an array. |
1935
1952
  | `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on mobile), spread over its defaults. A `pt` inside it styles only the sheet (passthrough guide § Inside the sheet). |
1936
1953
  | `offset` | `number \| undefined` | `4` | | Distance (px) between the activator and the popover. |
1954
+ | `open` | `boolean \| undefined` | `false` | | Whether the panel is open (`v-model:open`; `v-model` stays the value). Bound, the app opens and closes it; unbound, the initial state. |
1937
1955
  | `padding` | `number \| undefined` | `10` | | Minimum page padding used by floating shift middleware. |
1938
1956
  | `placement` | `'start'` \| `'end'` \| `'top'` \| `'bottom'` \| `'left'` \| `'right'` \| `'top-start'` \| `'top-end'` \| `'right-start'` \| `'right-end'` \| `'bottom-start'` \| `'bottom-end'` \| `'left-start'` \| `'left-end'` \| `'start-start'` \| `'start-end'` \| `'end-start'` \| `'end-end'` | `"bottom"` | | Floating placement of the popover. |
1939
1957
  | `prefill` | `boolean \| "interaction" \| undefined` | `"interaction"` | | When the options first load: `'interaction'` on first open, `true` on mount (and in SSR), `false` once the user types (on open with `disable-writing` or a non-empty model). An array `items` always resolves on mount; else a seeded model's text waits for the first open. |
@@ -1988,11 +2006,12 @@ States are listed in precedence order: when two are on at once and their entries
1988
2006
  - `show` — `(): void` — Emitted as soon as the options surface starts to open (the popover, or the sheet on a phone).
1989
2007
  - `shown` — `(): void` — Emitted once the options surface is open and its open transition has finished.
1990
2008
  - `update:modelValue` — `(value: any): void` — Emitted with the next selection value whenever selection changes.
2009
+ - `update:open` — `(value: boolean): void` — The panel opened or closed (`v-model:open`).
1991
2010
 
1992
2011
  ## Slots
1993
2012
 
1994
2013
  - `activator` — scope: `BbSelectPopoverActivatorSlotProps` `{ clear: () => void; close: () => Promise<void>; focus: () => void; disabled: boolean; loading: boolean; open: () => Promise<void>; props: { ref: (reference: unknown) => void; }; query: string; readonly: boolean; selectedOptions: BbSelectResolvedOption<any>[]; shown: boolean; text: string; toggle: () => Promise<void> }` — Replaces the default trigger element that opens the select popover.
1995
- - `empty` — scope: `{ query: string; focus: () => void; close: () => Promise<void>; error: unknown; }` — Content shown when no options match the query or the list is empty. `error` is what the latest failed load threw, untouched (`null` when none). `close()` closes the panel, for an action that does not move focus out of it.
2014
+ - `empty` — scope: `{ query: string; focus: () => void; close: () => Promise<void>; }` — Content shown when no options match the query or the list is empty. Empty only: a failed load shows the library's failure row instead (its message is `failed-text`, and it ends with "Try again"). `close()` closes the panel, for an action that does not move focus out of it.
1996
2015
  - `footer` — scope: `BbSelectPopoverPanelSlotProps` `{ close: () => Promise<void>; clear: () => void; empty: boolean; focus: () => void; query: string; selectedOptions: BbSelectResolvedOption<any>[]; titleId: string }` — Content pinned to the bottom of the panel, below the options list. Rendered in both the desktop popover and the adaptive sheet.
1997
2016
  - `group` — scope: `BbSelectPopoverGroupSlotProps<Item>` `{ disabled: boolean; index: number; item: Item; length: number; text: string }` — Replaces the default group header rendered above grouped options. Not called for rows with no group (`group-by` gives `null`/`undefined`, known rows): they are listed without a header.
1998
2017
  - `header` — scope: `BbSelectPopoverPanelSlotProps` `{ close: () => Promise<void>; clear: () => void; empty: boolean; focus: () => void; query: string; selectedOptions: BbSelectResolvedOption<any>[]; titleId: string }` — Content pinned to the top of the panel, above the search field. Rendered in both the desktop popover and the adaptive sheet.
@@ -504,8 +504,9 @@ called with one context object — `BbSwitchGroupItemsContext`: `reason`
504
504
  `'model'` when the model changed from outside and the options cannot resolve
505
505
  it), `modelValue` and `signal`; a group has no search field, so no `query`.
506
506
  While it resolves, `loading-text` (or the `#loading` slot) shows; `empty-text`
507
- (or `#empty`) covers the empty result, and `failed-text` (or `#empty` with its
508
- `error` prop) a load that threw. Loading, cancellation and race protection are
507
+ (or `#empty`) covers the empty result, and `failed-text` words the failure
508
+ row of a load that threw (it ends with a built-in "Try again"; `#empty` never
509
+ renders for a failure). Loading, cancellation and race protection are
509
510
  built in — don't wrap the provider in your own `loading` ref or debounce.
510
511
 
511
512
  Tie the option set to external state with `dependencies` (debounced by
@@ -798,7 +799,7 @@ for a preset that fits any row type (never `<any>`), not an imported
798
799
  | `itemLayout` | `FieldLayout \| undefined` | `'auto'` | | How each row's input and label sit together, in the `layout` keywords: `'auto'`, `'vertical'`, `'horizontal'`, `'label-fill'`, `'input-fill'`, or a two-word ratio pattern like `'xx xxxxx'`. |
799
800
  | `itemProps` | `BbOptionGroupItemProps<T> \| undefined` | | | ADDITIONAL row fields, never the text or value: `description`, a muted line under the label (it may wrap; announced as the option's description). An object of paths or getters, or a function of the item; nothing is read implicitly. |
800
801
  | `itemReverse` | `boolean \| undefined` | `undefined` | | Swaps each row's input and label from their natural order (input first), in every `item-layout`. `reverse` swaps the legend and the options instead. |
801
- | `items` | `T[] \| ((context: BbCheckboxGroupItemsContext) => T[] \| Promise<T[]>)` | | yes | The options: an array, or a provider called with a `BbCheckboxGroupItemsContext` (`BbSwitchGroupItemsContext` on a switch group) (`reason`, `modelValue`, `signal`), sync or async. A provider fails by THROWING, never by returning `[]`: the rows clear and `#empty` gets the `error`. |
802
+ | `items` | `T[] \| ((context: BbCheckboxGroupItemsContext) => T[] \| Promise<T[]>)` | | yes | The options: an array, or a provider called with `{ reason, modelValue, signal }`, sync or async. A provider fails by THROWING, never by returning `[]`: the rows clear and the failure row shows `failed-text` with "Try again". |
802
803
  | `itemText` | `ItemAccessor<T, string> \| undefined` | `own `label`, else `text`, else `JSON.stringify(item)`` | | Defines a path that returns a property of the object to use as text or a function that returns a string. Unset: own `label`, else `text` (`{ label, value }` needs no accessor). |
803
804
  | `itemValue` | `ItemAccessor<T> \| undefined` | `own `value`, else the whole item` | | Defines a path that returns a property of the object to use as value or a function that returns any value. Unset: own `value`, even `null`. |
804
805
  | `labelAlign` | `'center'` \| `'top'` \| `'bottom'` | | | Vertical position of the label block in a side-by-side row; not `labelPosition`, the horizontal one. Omitted, `'top'`. |
@@ -871,7 +872,7 @@ States are listed in precedence order: when two are on at once and their entries
871
872
 
872
873
  - `append` — scope: `object` — Content rendered after the last option, inside the options container.
873
874
  - `description` — scope: `BbSwitchGroupDescriptionSlotProps` `{ text: string; hasErrors: boolean; hasWarnings: boolean }` — Replaces the description text. Provided alone (no `description` prop) it still renders the description region and wires it into `aria-describedby`.
874
- - `empty` — scope: `{ error: unknown; }` — Content shown when no options are available (replaces the default "no data" text). `error` is what the latest failed load rejected with, untouched, and `null` when nothing failed — a failed load clears the rows, so this slot is where it shows.
875
+ - `empty` — scope: `object` — Content shown when no options are available (replaces the default "no data" text). Empty only: a failed load shows the library's failure row instead (its message is `failed-text`, and it ends with "Try again").
875
876
  - `icon` — scope: `BbSwitchGroupIconSlotProps<T>` `{ disabled: boolean; readonly: boolean; checked: boolean; indeterminate?: boolean; focused: boolean; focusVisible: boolean; id: string; name: string; falseValue: any; hasErrors: boolean; hasWarnings: boolean; parsedValue: string; trueValue: any; value: any; item: T; text: string }` — Replaces the default switch track visual for each option. Receives the switch state plus the source item and its display text.
876
877
  - `label` — scope: `BbSwitchGroupLabelSlotProps<T>` `{ item: T; text: string; checked: boolean; description: string }` — Replaces the default label text for each option.
877
878
  - `legend` — scope: `BbSwitchGroupLegendSlotProps` `{ showAsterisk?: boolean; text: string; hasErrors: boolean; hasWarnings: boolean }` — Replaces the default fieldset legend text for the group.
@@ -398,7 +398,8 @@ warns on a loop over keys it cannot see (`#[column.key]` over a prop) until
398
398
  the name goes through `slotKey`. Keep the column in `columns`
399
399
  even when you fully slot it: label, alignment and width still come from there.
400
400
  A `#<key>` slot owns its cell: when it renders nothing (a `v-if` that is
401
- false), the cell is empty, never the raw value.
401
+ false), the cell is empty, never the raw value (the one exception to the
402
+ empty-slot rule).
402
403
 
403
404
  Body cell scope: `content` (this cell, formatted), `item` (raw row), `value`
404
405
  (the row's `item-value`, e.g. its id — not this cell), `classes`, plus the row's interaction surface —
@@ -426,7 +427,8 @@ costs you the built-in sort button. The table-wide pair `#header:prepend` /
426
427
  structural select/actions cells); both forms receive the header scope above
427
428
  plus `columnKey` (the raw column key) so a table-wide template can branch per
428
429
  column. When both a per-column and the table-wide slot are provided for the
429
- same side, the per-column one wins for that column — they never stack. Affixes
430
+ same side, the per-column one wins for that column — they never stack; one
431
+ that renders nothing for its column falls back to the table-wide one. Affixes
430
432
  render even beside a full `#<key>:header` replacement (the same rule as
431
433
  BbDropdown's `#<value>:prepend/append`). The key always comes first, so a
432
434
  column keyed `prepend` still owns `#prepend:header`, and `#header:prepend`
@@ -753,9 +755,10 @@ There is no `error-text` prop and no `empty-text` alias — don't guess either
753
755
  by analogy with `loading-text`. A failed _server_ visit (Inertia, a full-page
754
756
  load) is a full error page, not something the table renders inline. A failed
755
757
  _client-side_ fetch is the table's own: an `items` provider function that
756
- throws clears the rows and the empty state shows `failed-text` ("Couldn't
757
- load items"), and the `#empty` slot receives the rejection as `error` (see §
758
- Async items and filters) — don't catch it yourself.
758
+ throws clears the rows and the table shows its failure row: `failed-text`
759
+ ("Couldn't load items"), announced, then a "Try again" button that runs the
760
+ failed call again (see § Async items and filters). `#empty` is for an empty
761
+ result only — don't catch the error yourself.
759
762
 
760
763
  **Skeletons and a custom empty state**
761
764
 
@@ -847,11 +850,9 @@ type BbTableItemsContext = {
847
850
  - A newer call aborts the one in flight and its late answer is dropped. A
848
851
  provider **throws** to fail — never `return []`, an applied empty result:
849
852
  the rows are cleared (stale rows never sit under a new filter), nothing is
850
- pruned, and the empty state shows `failed-text` ("Couldn't load items") —
851
- the `#empty` slot receives `error`: what the provider rejected with,
852
- untouched (an `Error`, a `Response`, anything thrown; a nullish rejection
853
- becomes an `Error`), and `null` when nothing failed. Retry by bumping a
854
- counter you list in `dependencies`.
853
+ pruned, and the failure row shows `failed-text` ("Couldn't load items")
854
+ with a built-in "Try again" (on click only; focus then moves to the table).
855
+ `#empty` never renders for a failure.
855
856
  - Return the page as it is: the table never merges the selection into it.
856
857
  - A plain array bypasses the provider machinery entirely.
857
858
 
@@ -4438,7 +4439,7 @@ for a preset that fits any row type (never `<any>`), not an imported
4438
4439
  | `id` | `string \| undefined` | | | Stable id for this table's width context. When omitted a unique id is generated. Nested tables use the nearest ancestor id to inherit widths. |
4439
4440
  | `inheritColumnWidths` | `string \| boolean \| undefined` | | | Snaps a nested table's columns to an ancestor table's tracks: `true` = the nearest one, a table `id` = that one (when a table in between has a different column count). Off by default: a nested table sizes itself. |
4440
4441
  | `interactiveWhileLoading` | `boolean \| undefined` | `false` | | Keeps the header and rows interactive while loading (by default they are `inert`: a refetch is about to replace them). For background refreshes that must not interrupt an open editor. |
4441
- | `items` | `Item[] \| ((context: BbTableItemsContext) => Item[] \| Promise<Item[]>)` | `[]` | yes | Rows to render: an array, or a provider called with a `BbTableItemsContext` (`reason`, `modelValue`, `signal`), sync or async. A provider fails by THROWING, never by returning `[]`: the rows clear and `#empty` gets the `error`. Return the page as it is. |
4442
+ | `items` | `Item[] \| ((context: BbTableItemsContext) => Item[] \| Promise<Item[]>)` | `[]` | yes | Rows to render: an array, or a provider called with a `BbTableItemsContext` (`reason`, `modelValue`, `signal`), sync or async. A provider fails by THROWING, never by returning `[]`: the rows clear and the failure row shows `failed-text` with "Try again". Return the page as it is. |
4442
4443
  | `itemValue` | `ItemAccessor<Item> \| undefined` | | | The row's value, as a property path or a function returning any value; the selection, `expandedItems` and row keys compare by it. |
4443
4444
  | `keyboardNavigation` | `boolean \| undefined` | `false` | | Opt-in keyboard navigation: the table becomes an ARIA `grid` (`treegrid` with an `#expand` slot) with ONE tab stop and roving focus over its cells. Controls in cells leave the tab order (Enter/F2 go in). Ignored with a `#tbody` slot. |
4444
4445
  | `legend` | `string \| undefined` | | | The `<legend>` of a `selectable` table (it renders as a `<fieldset>`): the selection's accessible name. Falls back to `caption`, then to a localized default. |
@@ -4532,10 +4533,10 @@ States are listed in precedence order: when two are on at once and their entries
4532
4533
 
4533
4534
  - `actions` — scope: `{ expanded?: boolean \| undefined; expandProps?: ExpandControllerProps \| undefined; toggleExpanded?: (() => void) \| undefined; highlighted?: boolean \| undefi…` — Content of each row's actions cell; this slot CREATES the actions column (there is no prop). The header cell (labelled by `actions-text`, replaceable through `#actions:header`) and one cell per row come and go with it. Pin it with `fixed-actions`.
4534
4535
  - `actions:header` — scope: `{ text: string; }` — Replaces the default actions header cell content.
4535
- - `empty` — scope: `{ error: unknown; }` — Content shown when there are no rows and nothing is loading, inside the table's own full-width cell: pass content, never a row. `error` is what the latest failed load threw (`null` when none).
4536
+ - `empty` — scope: `object` — Content shown when there are no rows and nothing is loading, inside the table's own full-width cell: pass content, never a row. Empty only: a failed load shows the table's failure row instead (its message is `failed-text`, and it ends with "Try again").
4536
4537
  - `expand` — scope: `{ expanded: boolean; expandProps?: ExpandControllerProps \| undefined; toggleExpanded: () => void; highlighted?: boolean \| undefined; toggleHighlighted?: (() =…` — Full-width expandable content row rendered below each main row when expanded.
4537
- - `header:append` — scope: `BbTableHeaderAffixSlotProps<Item>` `{ classes?: Classes; columnKey: string; items?: Item[]; label?: string; sortable?: boolean; sortOrder?: "asc" \| "desc" \| null; toggleSort?: ((event?: MouseEvent \| KeyboardEvent \| undefined) => void); hideColumn?: (() => void) }` — Content after every data column's header content (the label + sort control, or its own `<key>:header` replacement). A column's `<key>:header:append` wins over this for that column; they never stack. Branch on `columnKey` for per-column output.
4538
- - `header:prepend` — scope: `BbTableHeaderAffixSlotProps<Item>` `{ classes?: Classes; columnKey: string; items?: Item[]; label?: string; sortable?: boolean; sortOrder?: "asc" \| "desc" \| null; toggleSort?: ((event?: MouseEvent \| KeyboardEvent \| undefined) => void); hideColumn?: (() => void) }` — Content before every data column's header content (the label + sort control, or its own `<key>:header` replacement). A column's `<key>:header:prepend` wins over this for that column; they never stack. Branch on `columnKey` for per-column output.
4538
+ - `header:append` — scope: `BbTableHeaderAffixSlotProps<Item>` `{ classes?: Classes; columnKey: string; items?: Item[]; label?: string; sortable?: boolean; sortOrder?: "asc" \| "desc" \| null; toggleSort?: ((event?: MouseEvent \| KeyboardEvent \| undefined) => void); hideColumn?: (() => void) }` — Content after every data column's header content (the label + sort control, or its own `<key>:header` replacement). A column's `<key>:header:append` wins over this for that column; they never stack, unless it renders nothing there. Branch on `columnKey` for per-column output.
4539
+ - `header:prepend` — scope: `BbTableHeaderAffixSlotProps<Item>` `{ classes?: Classes; columnKey: string; items?: Item[]; label?: string; sortable?: boolean; sortOrder?: "asc" \| "desc" \| null; toggleSort?: ((event?: MouseEvent \| KeyboardEvent \| undefined) => void); hideColumn?: (() => void) }` — Content before every data column's header content (the label + sort control, or its own `<key>:header` replacement). A column's `<key>:header:prepend` wins over this for that column; they never stack, unless it renders nothing there. Branch on `columnKey` for per-column output.
4539
4540
  - `loading` — scope: `{ items: Item[]; }` — Content shown while table rows are loading (replaces the skeleton rows).
4540
4541
  - `select` — scope: `{ item: Item; value: TableValueOf<Item, A>; checked: boolean; disabled: boolean; inputName: string; readonly: boolean; toggleSelected?: (() => void) \| undefine…` — Replaces the default checkbox/radio in the selection cell for each row.
4541
4542
  - `select:header` — scope: `{ multiple: boolean; selectAll: boolean; text: string; }` — Replaces the default selection header cell content (checkbox or radio label).
@@ -4544,8 +4545,8 @@ States are listed in precedence order: when two are on at once and their entries
4544
4545
  - `thead` — scope: `{ empty: boolean; }` — Replaces the header row group's content (`.bb-table__head`). The table is a CSS grid: provide `<div role="row">` rows of `<div role="columnheader">` cells, never `<tr>` / `<th>`.
4545
4546
  - `#<key>` (named from data) — scope: `object` — One column's body cell in every row, by the column `key` through `slotKey`. Scope: `{ item, value, content, selected, expanded, highlighted, classes, sortOrder, toggleSelected, toggleExpanded, toggleHighlighted, expandProps }`; `content` is this cell, `value` the row's `item-value`. Reserved names (their slot is one of this component's own, so an item value or column key spelled like them is an error): `actions`, `empty`, `expand`, `loading`, `select`, `tbody`, `tfoot`, `thead`.
4546
4547
  - `#<key>:header` (named from data) — scope: `object` — One column's header content, replacing its label and the built-in sort button. Scope: `{ label, items, sortable, sortOrder, toggleSort, hideColumn, classes }`.
4547
- - `#<key>:header:prepend` (named from data) — scope: `BbTableHeaderAffixSlotProps<Item>` — Content before one column's header, keeping the sort button; beats `header:prepend` (they never stack).
4548
- - `#<key>:header:append` (named from data) — scope: `BbTableHeaderAffixSlotProps<Item>` — Content after one column's header, keeping the sort button; beats `header:append` (they never stack).
4548
+ - `#<key>:header:prepend` (named from data) — scope: `BbTableHeaderAffixSlotProps<Item>` — Content before one column's header, keeping the sort button; beats `header:prepend` (they never stack) unless it renders nothing.
4549
+ - `#<key>:header:append` (named from data) — scope: `BbTableHeaderAffixSlotProps<Item>` — Content after one column's header, keeping the sort button; beats `header:append` (they never stack) unless it renders nothing.
4549
4550
  - `#<key>:first` (named from data) — scope: `BbTableEdgeCellSlotProps<Item>` — One column's cell in a row before the data rows; any such slot creates the row, aligned with the columns. Only over rows.
4550
4551
  - `#<key>:last` (named from data) — scope: `BbTableEdgeCellSlotProps<Item>` — One column's cell in a row after the data rows (a totals row); any such slot creates that row, aligned like `<key>:first`.
4551
4552
 
@@ -212,6 +212,15 @@ Reach for the **component** (slot or `activator` prop) when you want the
212
212
  the directive is the shortcut for the bare-trigger cell case, not a replacement
213
213
  for the component's `v-model` in a form.
214
214
 
215
+ ### Opening from code: `v-model:open`
216
+
217
+ `v-model` is the value; `v-model:open` is whether the time panel is open. Bound,
218
+ your ref opens and closes it, and every open and close the user makes is
219
+ written back: a pick, Escape, a click outside, the phone sheet's own dismiss. A static `:open` with no
220
+ listener is only the initial state. An open from code is the same open a
221
+ click makes, and `disabled` / `readonly` refuse it (the ref is set back
222
+ to `false`).
223
+
215
224
  ### Relationship to BbTimePickerInput
216
225
 
217
226
  `BbTimePickerInput` _is_ these columns with a segmented text field wrapped around
@@ -296,6 +305,7 @@ typeahead. Always pass a `label` when the trigger is an unlabelled cell or icon.
296
305
 
297
306
  - `v-model:activeSegment` — type: `BbTimePickerSegment \| undefined`
298
307
  - `v-model` — type: `string \| string[] \| null \| undefined`
308
+ - `v-model:open` — type: `boolean \| undefined`
299
309
 
300
310
  ## Props
301
311
 
@@ -317,6 +327,7 @@ typeahead. Always pass a `label` when the trigger is an unlabelled cell or icon.
317
327
  | `modelValue` | `string \| string[] \| null \| undefined` | | | v-model value: `null` for empty, a 24-hour `HH:mm` (or `HH:mm:ss` with `seconds`) string, or a two-element `[start, end]` array when `range` is true. |
318
328
  | `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas` that `adaptive` renders on mobile), spread over its defaults. A `pt` inside it styles only the sheet (passthrough guide § Inside the sheet). The sheet hides its ✕; `{ hideClose: false }` brings it back. |
319
329
  | `offset` | `number \| undefined` | `4` | | Space the popover keeps from the activator. |
330
+ | `open` | `boolean \| undefined` | `false` | | Whether the panel is open (`v-model:open`; `v-model` stays the value). Bound, the app opens and closes it; unbound, the initial state. |
320
331
  | `padding` | `number \| undefined` | | | Minimum empty space to keep from the edge of the page. |
321
332
  | `placement` | `'start'` \| `'end'` \| `'top'` \| `'bottom'` \| `'left'` \| `'right'` \| `'top-start'` \| `'top-end'` \| `'right-start'` \| `'right-end'` \| `'bottom-start'` \| `'bottom-end'` \| `'left-start'` \| `'left-end'` \| `'start-start'` \| `'start-end'` \| `'end-start'` \| `'end-end'` | | | Position of the popover relative to the activator/anchor. |
322
333
  | `range` | `boolean` | `false` | | Range selection: the value is a two-element `[start, end]` array. |
@@ -356,6 +367,7 @@ States are listed in precedence order: when two are on at once and their entries
356
367
  - `time-pick` — `(payload: { unit: TimeUnit; value: string; }): void` — Relay of the raw column pick, before this component combines it into the value. A host binds this to run its own engine; clean consumers ignore it.
357
368
  - `update:activeSegment` — `(value: BbTimePickerSegment): void` — The active range end changed (range only).
358
369
  - `update:modelValue` — `(value: string \| string[] \| null): void` — Emitted when the selected time changes (single/range/null).
370
+ - `update:open` — `(value: boolean): void` — The panel opened or closed (`v-model:open`).
359
371
 
360
372
  ## Slots
361
373