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

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 (321) hide show
  1. package/README.md +5 -5
  2. package/bin/cli.mjs +16 -10
  3. package/dist/ai/BbAlert.md +1 -1
  4. package/dist/ai/BbAvatar.md +86 -58
  5. package/dist/ai/BbBadge.md +1 -1
  6. package/dist/ai/BbBreadcrumbs.md +3 -3
  7. package/dist/ai/BbButton.md +4 -4
  8. package/dist/ai/BbCalendar.md +5 -2
  9. package/dist/ai/BbCheckboxGroup.md +5 -4
  10. package/dist/ai/BbColorInput.md +13 -1
  11. package/dist/ai/BbColorPalette.md +12 -7
  12. package/dist/ai/BbConfirm.md +1 -1
  13. package/dist/ai/BbDatePicker.md +13 -1
  14. package/dist/ai/BbDatePickerInput.md +18 -2
  15. package/dist/ai/BbDialog.md +6 -3
  16. package/dist/ai/BbDropdown.md +174 -77
  17. package/dist/ai/BbDropdownButton.md +37 -16
  18. package/dist/ai/BbGallery.md +3 -2
  19. package/dist/ai/BbIcon.md +10 -10
  20. package/dist/ai/BbNumberInput.md +3 -1
  21. package/dist/ai/BbOffCanvas.md +3 -2
  22. package/dist/ai/BbPopover.md +1 -1
  23. package/dist/ai/BbRadioGroup.md +4 -4
  24. package/dist/ai/BbSelect.md +227 -105
  25. package/dist/ai/BbSelectPopover.md +139 -14
  26. package/dist/ai/BbSwitchGroup.md +5 -4
  27. package/dist/ai/BbTable.md +18 -17
  28. package/dist/ai/BbTimePicker.md +13 -1
  29. package/dist/ai/BbTimePickerInput.md +16 -2
  30. package/dist/ai/BbToast.md +3 -2
  31. package/dist/ai/BbTree.md +5 -1
  32. package/dist/ai/CommonPopover.md +1 -0
  33. package/dist/ai/FlatListBox.md +1 -0
  34. package/dist/ai/GroupedListBox.md +3 -2
  35. package/dist/ai/ListBox.md +4 -2
  36. package/dist/ai/OptionsContainer.md +4 -4
  37. package/dist/ai/changelog.json +310 -7
  38. package/dist/ai/components.json +33 -35
  39. package/dist/ai/composables/useToast.md +2 -2
  40. package/dist/ai/design-tokens.json +60 -0
  41. package/dist/ai/guides/agent-contract.md +9 -5
  42. package/dist/ai/guides/calendars-and-digits.md +1 -1
  43. package/dist/ai/guides/design-tokens.md +13 -0
  44. package/dist/ai/guides/eslint-rules.md +1 -1
  45. package/dist/ai/guides/fetch-items-playbook.md +7 -11
  46. package/dist/ai/guides/icons-policy.md +32 -11
  47. package/dist/ai/guides/installation-and-plugin-setup.md +24 -23
  48. package/dist/ai/guides/migration/adoption-checklist.md +1 -1
  49. package/dist/ai/guides/migration/components/bb-color-palette.md +11 -11
  50. package/dist/ai/guides/migration/components/bb-dropdown-button.md +1 -0
  51. package/dist/ai/guides/migration/components/bb-dropdown.md +1 -0
  52. package/dist/ai/guides/migration/components/bb-icon.md +4 -4
  53. package/dist/ai/guides/migration/components/bb-table.md +2 -1
  54. package/dist/ai/guides/migration/components/bb-toast.md +2 -2
  55. package/dist/ai/guides/migration/v2-to-v3.md +70 -24
  56. package/dist/ai/guides/migration/v3-beta-css-classes.md +18 -3
  57. package/dist/ai/guides/migration/v3-beta-tooling.md +1 -0
  58. package/dist/ai/guides/passthrough.md +58 -58
  59. package/dist/ai/helpers/inertia/manifest.json +1 -1
  60. package/dist/ai/index.md +1 -1
  61. package/dist/ai/manifest/common.json +1 -0
  62. package/dist/ai/manifest/components/BbAvatar.json +5 -2
  63. package/dist/ai/manifest/components/BbAvatar.tree.json +32 -2
  64. package/dist/ai/manifest/components/BbCarousel.json +0 -3
  65. package/dist/ai/manifest/components/BbCheckboxGroup.json +2 -2
  66. package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +2 -0
  67. package/dist/ai/manifest/components/BbColorInput.json +5 -2
  68. package/dist/ai/manifest/components/BbColorPalette.json +5 -2
  69. package/dist/ai/manifest/components/BbColorPalette.removed.json +1 -2
  70. package/dist/ai/manifest/components/BbDatePicker.json +3 -0
  71. package/dist/ai/manifest/components/BbDatePickerInput.json +3 -0
  72. package/dist/ai/manifest/components/BbDialog.tree.json +3 -1
  73. package/dist/ai/manifest/components/BbDropdown.json +36 -28
  74. package/dist/ai/manifest/components/BbDropdown.removed.json +2 -1
  75. package/dist/ai/manifest/components/BbDropdown.tree.json +21 -11
  76. package/dist/ai/manifest/components/BbDropdownButton.json +24 -16
  77. package/dist/ai/manifest/components/BbDropdownButton.removed.json +2 -1
  78. package/dist/ai/manifest/components/BbDropdownButton.tree.json +4 -0
  79. package/dist/ai/manifest/components/BbGallery.tree.json +1 -1
  80. package/dist/ai/manifest/components/BbOffCanvas.tree.json +3 -1
  81. package/dist/ai/manifest/components/BbRadioGroup.json +2 -2
  82. package/dist/ai/manifest/components/BbRadioGroup.tree.json +2 -0
  83. package/dist/ai/manifest/components/BbSelect.json +47 -40
  84. package/dist/ai/manifest/components/BbSelect.tree.json +2 -1
  85. package/dist/ai/manifest/components/BbSelectPopover.json +14 -7
  86. package/dist/ai/manifest/components/BbSelectPopover.tree.json +9 -2
  87. package/dist/ai/manifest/components/BbSwitchGroup.json +2 -2
  88. package/dist/ai/manifest/components/BbSwitchGroup.tree.json +2 -0
  89. package/dist/ai/manifest/components/BbTable.json +6 -6
  90. package/dist/ai/manifest/components/BbTable.tree.json +9 -1
  91. package/dist/ai/manifest/components/BbTimePicker.json +5 -2
  92. package/dist/ai/manifest/components/BbTimePickerInput.json +5 -2
  93. package/dist/ai/manifest/components/BbTree.json +1 -1
  94. package/dist/ai/manifest/components/CommonPopover.json +1 -0
  95. package/dist/ai/manifest/components/FlatListBox.json +2 -1
  96. package/dist/ai/manifest/components/GroupedListBox.json +3 -2
  97. package/dist/ai/manifest/components/GroupedListBox.tree.json +1 -0
  98. package/dist/ai/manifest/components/ListBox.json +3 -2
  99. package/dist/ai/manifest/components/ListBox.tree.json +1 -1
  100. package/dist/ai/manifest/components/OptionsContainer.json +6 -4
  101. package/dist/ai/manifest/index.json +2 -2
  102. package/dist/ai/manifest/meta.json +0 -3
  103. package/dist/ai/manifest/types.advanced.json +6 -6
  104. package/dist/ai/manifest/types.api.json +1 -3
  105. package/dist/ai/recipes/inertia/inline-edit-workspace.md +1 -1
  106. package/dist/ai/recipes/inertia/onboarding.md +1 -1
  107. package/dist/ai/recipes/nuxt/inline-edit-workspace.md +1 -1
  108. package/dist/ai/recipes/nuxt/onboarding.md +1 -1
  109. package/dist/ai/recipes/vue/inline-edit-workspace.md +1 -1
  110. package/dist/ai/recipes/vue/onboarding.md +2 -2
  111. package/dist/ai/source/BbAccordion.md +4 -5
  112. package/dist/ai/source/BbAvatar.md +128 -11
  113. package/dist/ai/source/BbBadge.md +18 -7
  114. package/dist/ai/source/BbBreadcrumbs.md +57 -56
  115. package/dist/ai/source/BbButton.md +41 -25
  116. package/dist/ai/source/BbCalendar.md +8 -6
  117. package/dist/ai/source/BbCarousel.md +41 -34
  118. package/dist/ai/source/BbCheckboxGroup.md +15 -9
  119. package/dist/ai/source/BbColorInput.md +19 -0
  120. package/dist/ai/source/BbColorPalette.md +23 -2
  121. package/dist/ai/source/BbDatePicker.md +18 -0
  122. package/dist/ai/source/BbDatePickerInput.md +47 -3
  123. package/dist/ai/source/BbDialog.md +14 -1
  124. package/dist/ai/source/BbDropdown.md +296 -99
  125. package/dist/ai/source/BbDropdownButton.md +61 -19
  126. package/dist/ai/source/BbDropdownGroup.md +189 -98
  127. package/dist/ai/source/BbGallery.md +82 -60
  128. package/dist/ai/source/BbHost.md +12 -0
  129. package/dist/ai/source/BbNumberInput.md +17 -10
  130. package/dist/ai/source/BbOffCanvas.md +14 -1
  131. package/dist/ai/source/BbPagination.md +12 -28
  132. package/dist/ai/source/BbRadioGroup.md +12 -5
  133. package/dist/ai/source/BbRating.md +4 -4
  134. package/dist/ai/source/BbSelect.md +151 -112
  135. package/dist/ai/source/BbSelectPopover.md +244 -29
  136. package/dist/ai/source/BbSwitchGroup.md +11 -4
  137. package/dist/ai/source/BbTable.md +114 -35
  138. package/dist/ai/source/BbTimePicker.md +19 -0
  139. package/dist/ai/source/BbTimePickerInput.md +21 -2
  140. package/dist/ai/source/BbToast.md +2 -2
  141. package/dist/ai/source/BbToastPortal.md +2 -2
  142. package/dist/ai/source/BbTree.md +1 -1
  143. package/dist/ai/source/ClearableButton.md +4 -2
  144. package/dist/ai/source/CommonPopover.md +24 -1
  145. package/dist/ai/source/ErrorIcon.md +4 -3
  146. package/dist/ai/source/FlatListBox.md +33 -7
  147. package/dist/ai/source/GroupedListBox.md +85 -14
  148. package/dist/ai/source/ListBox.md +11 -1
  149. package/dist/ai/source/OptionsContainer.md +29 -11
  150. package/dist/ai/source/WarningIcon.md +4 -3
  151. package/dist/assets/svgs/close.svg_raw.js +1 -1
  152. package/dist/components/BbAccordion/BbAccordion.vue.d.ts +1 -1
  153. package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +35 -34
  154. package/dist/components/BbAvatar/BbAvatar.vue.d.ts +1 -0
  155. package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +62 -43
  156. package/dist/components/BbAvatar/avatarIdentity.js +25 -0
  157. package/dist/components/BbAvatar/ptKeys.generated.d.ts +5 -1
  158. package/dist/components/BbAvatar/types.d.ts +24 -5
  159. package/dist/components/BbAvatar/types.js +5 -1
  160. package/dist/components/BbBadge/BadgeBodyContent.vue_vue_type_script_setup_true_lang.js +24 -23
  161. package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +66 -64
  162. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +141 -146
  163. package/dist/components/BbButton/BbButton.vue_vue_type_script_setup_true_lang.js +100 -85
  164. package/dist/components/BbCalendar/BbCalendar.vue.d.ts +1 -1
  165. package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +240 -239
  166. package/dist/components/BbCalendar/useDayGrid.js +120 -123
  167. package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +503 -502
  168. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +4 -4
  169. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue_vue_type_script_setup_true_lang.js +126 -122
  170. package/dist/components/BbCheckboxGroup/types.d.ts +7 -11
  171. package/dist/components/BbColorInput/BbColorInput.vue.d.ts +2 -0
  172. package/dist/components/BbColorInput/BbColorInput.vue_vue_type_script_setup_true_lang.js +148 -141
  173. package/dist/components/BbColorInput/types.d.ts +7 -0
  174. package/dist/components/BbColorPalette/BbColorPalette.vue.d.ts +2 -0
  175. package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +208 -196
  176. package/dist/components/BbColorPalette/types.d.ts +7 -0
  177. package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +3 -1
  178. package/dist/components/BbDatePicker/BbDatePicker.vue_vue_type_script_setup_true_lang.js +84 -73
  179. package/dist/components/BbDatePicker/types.d.ts +7 -0
  180. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +4 -2
  181. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +496 -510
  182. package/dist/components/BbDatePickerInput/types.d.ts +7 -0
  183. package/dist/components/BbDialog/BbDialog.vue_vue_type_script_setup_true_lang.js +219 -211
  184. package/dist/components/BbDialog/leaveGhost.js +22 -17
  185. package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +106 -100
  186. package/dist/components/BbDropdown/BbDropdown.vue.d.ts +3 -0
  187. package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +416 -369
  188. package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +404 -354
  189. package/dist/components/BbDropdown/DropdownFailures.vue.js +4 -0
  190. package/dist/components/BbDropdown/DropdownFailures.vue_vue_type_script_setup_true_lang.js +24 -0
  191. package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +117 -102
  192. package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +67 -38
  193. package/dist/components/BbDropdown/normalizeGroups.js +6 -2
  194. package/dist/components/BbDropdown/ptKeys.generated.d.ts +44 -20
  195. package/dist/components/BbDropdown/types.d.ts +109 -87
  196. package/dist/components/BbDropdown/types.js +3 -0
  197. package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +3 -1
  198. package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +101 -65
  199. package/dist/components/BbDropdownButton/ptKeys.generated.d.ts +153 -57
  200. package/dist/components/BbDropdownButton/types.d.ts +23 -10
  201. package/dist/components/BbDropdownButton/types.js +4 -0
  202. package/dist/components/BbDropzone/BbDropzone.vue.d.ts +1 -1
  203. package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +335 -312
  204. package/dist/components/BbHost/BbHost.vue_vue_type_script_setup_true_lang.js +7 -1
  205. package/dist/components/BbIcon/iconCache.js +1 -1
  206. package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +1 -1
  207. package/dist/components/BbNumberInput/BbNumberInput.vue_vue_type_script_setup_true_lang.js +9 -5
  208. package/dist/components/BbOffCanvas/BbOffCanvas.vue_vue_type_script_setup_true_lang.js +152 -144
  209. package/dist/components/BbPagination/BbPagination.vue.d.ts +2 -2
  210. package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +138 -136
  211. package/dist/components/BbProgress/BbProgress.vue.d.ts +1 -1
  212. package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +4 -4
  213. package/dist/components/BbRadioGroup/BbRadioGroup.vue_vue_type_script_setup_true_lang.js +108 -104
  214. package/dist/components/BbRadioGroup/types.d.ts +4 -7
  215. package/dist/components/BbRating/BbRating.vue.d.ts +1 -1
  216. package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +100 -99
  217. package/dist/components/BbSelect/BbSelect.vue.d.ts +32 -20
  218. package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +217 -196
  219. package/dist/components/BbSelect/ptKeys.generated.d.ts +128 -96
  220. package/dist/components/BbSelect/types.d.ts +110 -111
  221. package/dist/components/BbSelect/types.js +1 -27
  222. package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +8 -3
  223. package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +728 -653
  224. package/dist/components/BbSelectPopover/ptKeys.generated.d.ts +22 -10
  225. package/dist/components/BbSelectPopover/types.d.ts +32 -17
  226. package/dist/components/BbSelectPopover/types.js +3 -1
  227. package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +1 -1
  228. package/dist/components/BbSwitchGroup/BbSwitchGroup.vue_vue_type_script_setup_true_lang.js +159 -155
  229. package/dist/components/BbSwitchGroup/types.d.ts +3 -6
  230. package/dist/components/BbTable/BbTable.vue.d.ts +2 -4
  231. package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1171 -1152
  232. package/dist/components/BbTable/BbTableDataRow.js +97 -90
  233. package/dist/components/BbTable/types.d.ts +11 -10
  234. package/dist/components/BbTabs/BbTabs.vue.d.ts +3 -3
  235. package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +4 -2
  236. package/dist/components/BbTimePicker/BbTimePicker.vue_vue_type_script_setup_true_lang.js +145 -134
  237. package/dist/components/BbTimePicker/types.d.ts +7 -0
  238. package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +4 -2
  239. package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +290 -280
  240. package/dist/components/BbTimePickerInput/types.d.ts +7 -0
  241. package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +79 -78
  242. package/dist/components/BbToast/types.d.ts +2 -2
  243. package/dist/components/BbTree/BbTreeLevel.vue_vue_type_script_setup_true_lang.js +56 -46
  244. package/dist/components/BbTree/types.d.ts +1 -1
  245. package/dist/components/ClearableButton/ClearableButton.vue_vue_type_script_setup_true_lang.js +9 -8
  246. package/dist/components/CloseIcon/CloseButton.vue.js +1 -1
  247. package/dist/components/CloseIcon/CloseButton.vue_vue_type_script_setup_true_lang.js +9 -7
  248. package/dist/components/CommonPopover/CommonPopover.vue_vue_type_script_setup_true_lang.js +13 -1
  249. package/dist/components/ErrorIcon/ErrorIcon.vue_vue_type_script_setup_true_lang.js +8 -6
  250. package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +122 -102
  251. package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +182 -153
  252. package/dist/components/ListBox/ListBox.vue_vue_type_script_setup_true_lang.js +7 -4
  253. package/dist/components/OptionsContainer/OptionsContainer.vue_vue_type_script_setup_true_lang.js +86 -77
  254. package/dist/components/WarningIcon/WarningIcon.vue_vue_type_script_setup_true_lang.js +8 -6
  255. package/dist/composables/useInternalIcon.js +25 -0
  256. package/dist/composables/useItemsGetter.js +34 -32
  257. package/dist/composables/useOpenModel.js +20 -0
  258. package/dist/deprecation/ai-deprecations.json.js +1 -1
  259. package/dist/i18n/locales/ar.json +2 -0
  260. package/dist/i18n/locales/cs.json +2 -0
  261. package/dist/i18n/locales/da.json +2 -0
  262. package/dist/i18n/locales/de-CH.json +2 -0
  263. package/dist/i18n/locales/de.json +2 -0
  264. package/dist/i18n/locales/el.json +2 -0
  265. package/dist/i18n/locales/en-GB.json +2 -0
  266. package/dist/i18n/locales/en.json +2 -0
  267. package/dist/i18n/locales/es-MX.json +2 -0
  268. package/dist/i18n/locales/es.json +2 -0
  269. package/dist/i18n/locales/fa.json +2 -0
  270. package/dist/i18n/locales/fi.json +2 -0
  271. package/dist/i18n/locales/fr.json +2 -0
  272. package/dist/i18n/locales/he.json +2 -0
  273. package/dist/i18n/locales/hu.json +2 -0
  274. package/dist/i18n/locales/it.json +2 -0
  275. package/dist/i18n/locales/ja.json +2 -0
  276. package/dist/i18n/locales/ko.json +2 -0
  277. package/dist/i18n/locales/nb.json +2 -0
  278. package/dist/i18n/locales/nl.json +2 -0
  279. package/dist/i18n/locales/pl.json +2 -0
  280. package/dist/i18n/locales/pt-BR.json +2 -0
  281. package/dist/i18n/locales/pt-PT.json +2 -0
  282. package/dist/i18n/locales/ro.json +2 -0
  283. package/dist/i18n/locales/ru.json +2 -0
  284. package/dist/i18n/locales/sv.json +2 -0
  285. package/dist/i18n/locales/tr.json +2 -0
  286. package/dist/i18n/locales/uk.json +2 -0
  287. package/dist/i18n/locales/zh-CN.json +2 -0
  288. package/dist/i18n/locales/zh-HK.json +2 -0
  289. package/dist/i18n/locales/zh-TW.json +2 -0
  290. package/dist/icon-scan.d.ts +1 -1
  291. package/dist/icon-scan.js +68 -61
  292. package/dist/index.d.ts +2 -2
  293. package/dist/llms-full.txt +1038 -451
  294. package/dist/llms-medium.txt +33 -28
  295. package/dist/llms.txt +2 -2
  296. package/dist/locale-blueprint.json +2 -0
  297. package/dist/nuxt.js +1 -1
  298. package/dist/styles.css +2 -2
  299. package/dist/types/ActionButton.d.ts +2 -3
  300. package/dist/types/Config.d.ts +8 -1
  301. package/dist/types/ConfigDefaults.d.ts +10 -2
  302. package/dist/types/Option.d.ts +10 -0
  303. package/dist/types/internalIcons.d.ts +89 -0
  304. package/dist/types/internalIcons.js +158 -0
  305. package/dist/types/ptComponentMap.d.ts +5 -5
  306. package/dist/utilities/functions/slotContent.js +19 -0
  307. package/dist/utils/configDefaults.js +75 -64
  308. package/dist/utils/iconsOption.js +48 -0
  309. package/dist/utils/loadRetry.js +8 -0
  310. package/dist/utils/versionCheck.js +1 -1
  311. package/dist/vite-plugin.d.ts +10 -16
  312. package/dist/vite.js +323 -307
  313. package/llms.txt +2 -2
  314. package/package.json +3 -1
  315. package/scripts/README.md +2 -0
  316. package/scripts/lib/adoption-checklist.json +1 -1
  317. package/scripts/lib/agent-setup.mjs +44 -26
  318. package/scripts/lib/update-install.mjs +48 -0
  319. package/scripts/lib/validate-bb-markup.mjs +93 -12
  320. package/dist/ai/manifest/components/BbAvatar.removed.json +0 -6
  321. package/dist/assets/svgs/caret_down.svg_raw.js +0 -3
@@ -79,13 +79,20 @@
79
79
  :aria-labelledby="groupMetaIndexedByIndex[row.index].headerId"
80
80
  class="bb-listbox__group"
81
81
  role="group"
82
- :style="{ transform: `translateY(${row.start}px)` }"
82
+ :style="{ top: `${row.start}px` }"
83
83
  >
84
84
  <span
85
85
  v-if="groupMetaIndexedByIndex[row.index].headerId"
86
86
  :id="groupMetaIndexedByIndex[row.index].headerId"
87
87
  class="bb-listbox__group-header"
88
88
  role="presentation"
89
+ v-bind="
90
+ passthrough?.part?.('groupHeader', {
91
+ disabled:
92
+ groupMetaIndexedByIndex[row.index].allOptionsAreDisabled ||
93
+ undefined,
94
+ })
95
+ "
89
96
  >
90
97
  <slot
91
98
  :disabled="
@@ -168,7 +175,17 @@
168
175
  )
169
176
  "
170
177
  />
178
+ <span
179
+ v-if="optionsMetaByGroup[row.index][i].create"
180
+ class="bb-listbox__item-text bb-listbox__create"
181
+ >{{ optionsMetaByGroup[row.index][i].create!.before
182
+ }}<strong class="bb-listbox__create-query">{{
183
+ optionsMetaByGroup[row.index][i].create!.query
184
+ }}</strong
185
+ >{{ optionsMetaByGroup[row.index][i].create!.after }}</span
186
+ >
171
187
  <slot
188
+ v-else
172
189
  :description="optionsMetaByGroup[row.index][i].description"
173
190
  :disabled="!!optionsMetaByGroup[row.index][i].disabled"
174
191
  :focused="
@@ -268,6 +285,10 @@
268
285
  <BbIcon
269
286
  aria-hidden="true"
270
287
  class="bb-listbox__option-check"
288
+ :class="{
289
+ 'bb-listbox__option-check--own':
290
+ checkIcon !== checkIconBuiltin,
291
+ }"
271
292
  :icon="checkIcon"
272
293
  v-bind="
273
294
  passthrough?.part?.(
@@ -299,20 +320,28 @@
299
320
  under whatever is still listed (a `stash` keeps the picks' rows), in the
300
321
  destructive alert's voice. It sits OUTSIDE the scroll area and the
301
322
  listbox: a reader meets it as a status, never as an option, and the
302
- combobox is described by it while it lasts. The divider is its own only
323
+ combobox is described by its message while it lasts. It ends with "Try
324
+ again", which the host runs; `#empty`
325
+ never replaces it (empty means empty). The divider is its own only
303
326
  when rows sit above it; with nothing listed the search field's is the
304
327
  one divider. -->
305
328
  <span
306
- v-if="failedText"
307
- :id="`${id}_failed`"
329
+ v-if="failedText && !loading"
308
330
  class="bb-listbox__failed"
309
331
  :class="{ 'bb-listbox__failed--divided': hasOptions }"
310
332
  role="status"
311
333
  >
312
334
  <ErrorIcon class="bb-listbox__failed-icon" />
313
- <span class="bb-listbox__failed-text"
314
- ><slot name="empty">{{ failedText }}</slot></span
335
+ <span :id="`${id}_failed`" class="bb-listbox__failed-text">{{
336
+ failedText
337
+ }}</span>
338
+ <button
339
+ class="bb-load-retry"
340
+ type="button"
341
+ @click="emit('retry', $event)"
315
342
  >
343
+ {{ t('common.retryLabel').value }}
344
+ </button>
316
345
  </span>
317
346
  </span>
318
347
  </template>
@@ -340,9 +369,9 @@ import {
340
369
  import { indexBy } from '@/utilities/functions/indexBy';
341
370
  import BbIcon from '../BbIcon/BbIcon.vue';
342
371
  import ErrorIcon from '../ErrorIcon/ErrorIcon.vue';
343
- import checkIcon from '@/assets/svgs/check_stroke.svg?raw';
372
+ import checkIconBuiltin from '@/assets/svgs/check_stroke.svg?raw';
344
373
  import { transitions } from '@/utilities/misc/transitions';
345
-
374
+ import { useInternalIcon } from '@/composables/useInternalIcon';
346
375
  const props = withDefaults(defineProps<GroupedListBoxProps>(), {
347
376
  transitionDuration: transitions.medium,
348
377
  });
@@ -351,6 +380,8 @@ const emit = defineEmits<GroupedListBoxEvents>();
351
380
 
352
381
  const slots = defineSlots<GroupedListBoxSlots<Item>>();
353
382
 
383
+ const checkIcon = useInternalIcon('check', checkIconBuiltin);
384
+
354
385
  const { t } = useLocale();
355
386
 
356
387
  const innerRef = useTemplateRef('inner');
@@ -474,6 +505,7 @@ const optionsMeta = computed(() => {
474
505
  value: value,
475
506
  valueHash: o.valueHash,
476
507
  domId,
508
+ create: o.create,
477
509
  };
478
510
  })
479
511
  );
@@ -574,17 +606,42 @@ const scrollToFocused = async () => {
574
606
  // Drive the virtualizer to the option's GROUP first (FlatListBox already
575
607
  // does the equivalent), then refine to the exact row once it has mounted.
576
608
  // Direct indexing: optionsMeta[i].globalIndex === i (see the note above).
609
+ // A mounted row needs no group scroll first: an `auto` scroll to a group
610
+ // taller than the list jumps to its start, and back.
611
+ const rowEl = () =>
612
+ innerRef.value?.querySelector<HTMLElement>(
613
+ `[data-index="${focusedIndex.value}"]`
614
+ );
577
615
  const groupIndex = optionsMeta.value[focusedIndex.value]?.groupIndex;
578
- if (isNotNil(groupIndex)) {
616
+ if (!rowEl() && isNotNil(groupIndex)) {
579
617
  rowVirtualizer.value.scrollToIndex(groupIndex, { align: 'auto' });
580
618
  await nextTick();
581
619
  }
582
620
 
583
- const el = innerRef.value.querySelector<HTMLElement>(
584
- `[data-index="${focusedIndex.value}"]`
585
- );
621
+ const el = rowEl();
586
622
  if (el) {
587
623
  el.scrollIntoView({ block: 'nearest' });
624
+ uncoverFromHeader(el);
625
+ }
626
+ };
627
+
628
+ /**
629
+ * Group headers are sticky: a row brought in from above
630
+ * lands at the top edge, under its group's pinned header. Scroll it down to
631
+ * sit just below the header instead.
632
+ */
633
+ const uncoverFromHeader = (el: HTMLElement) => {
634
+ const header = el
635
+ .closest('.bb-listbox__group')
636
+ ?.querySelector<HTMLElement>('.bb-listbox__group-header');
637
+ if (!header || !innerRef.value) return;
638
+ // Measured again after each step: a row at its group's end holds the
639
+ // header up with it, so the header only settles once the row moves.
640
+ for (let step = 0; step < 3; step++) {
641
+ const covered =
642
+ header.getBoundingClientRect().bottom - el.getBoundingClientRect().top;
643
+ if (covered <= 0) return;
644
+ innerRef.value.scrollTop -= covered;
588
645
  }
589
646
  };
590
647
 
@@ -610,9 +667,15 @@ const scrollToSelected = () => {
610
667
  rowVirtualizer.value.getTotalSize();
611
668
  const group = rowVirtualizer.value.measurementsCache[selected.groupIndex];
612
669
  if (!group) return;
670
+ // Its group's header shows above it: the header is
671
+ // sticky, so the row sits one header lower than its own offset, as long
672
+ // as the two fit the list together.
673
+ const header = headerOf(selected.groupIndex);
674
+ const fits =
675
+ (innerRef.value?.clientHeight ?? 0) >= header + resolvedOptionHeight.value;
613
676
  rowVirtualizer.value.scrollToOffset(
614
677
  group.start +
615
- headerOf(selected.groupIndex) +
678
+ (fits ? 0 : header) +
616
679
  selected.indexInGroup * resolvedOptionHeight.value
617
680
  );
618
681
  };
@@ -756,7 +819,13 @@ export type GroupedListBoxProps = {
756
819
  * node with its own `selected` / `disabled`. Internal.
757
820
  */
758
821
  passthrough?: PtBindings<
759
- 'list' | 'option' | 'itemText' | 'itemIcon' | 'itemDescription' | 'check',
822
+ | 'list'
823
+ | 'groupHeader'
824
+ | 'option'
825
+ | 'itemText'
826
+ | 'itemIcon'
827
+ | 'itemDescription'
828
+ | 'check',
760
829
  'selected' | 'disabled'
761
830
  >;
762
831
 
@@ -840,6 +909,8 @@ export type GroupedListBoxProps = {
840
909
  };
841
910
 
842
911
  export type GroupedListBoxEvents = {
912
+ /** The failure footer's "Try again" was pressed: the host runs the failed load again. */
913
+ (e: 'retry', event: MouseEvent): void;
843
914
  /**
844
915
  * Emitted when an option is selected by the user.
845
916
  * @param option - The selected option.
@@ -31,6 +31,7 @@
31
31
  @focused:change="$emit('focused:change', $event)"
32
32
  @option:selected="$emit('option:selected', $event)"
33
33
  @option:unselected="$emit('option:unselected', $event)"
34
+ @retry="$emit('retry', $event)"
34
35
  >
35
36
  <template #options:prepend><slot name="options:prepend" /></template>
36
37
  <template #loading><slot name="loading" /></template>
@@ -63,6 +64,7 @@
63
64
  @focused:change="$emit('focused:change', $event)"
64
65
  @option:selected="$emit('option:selected', $event)"
65
66
  @option:unselected="$emit('option:unselected', $event)"
67
+ @retry="$emit('retry', $event)"
66
68
  >
67
69
  <template #options:prepend><slot name="options:prepend" /></template>
68
70
  <template #loading><slot name="loading" /></template>
@@ -152,7 +154,13 @@ export type ListBoxProps<Item> = {
152
154
  * node with its own `selected` / `disabled`. Internal.
153
155
  */
154
156
  passthrough?: PtBindings<
155
- 'list' | 'option' | 'itemText' | 'itemIcon' | 'itemDescription' | 'check',
157
+ | 'list'
158
+ | 'groupHeader'
159
+ | 'option'
160
+ | 'itemText'
161
+ | 'itemIcon'
162
+ | 'itemDescription'
163
+ | 'check',
156
164
  'selected' | 'disabled'
157
165
  >;
158
166
 
@@ -237,6 +245,8 @@ export type ListBoxProps<Item> = {
237
245
  };
238
246
 
239
247
  export type ListBoxEvents = {
248
+ /** The failure footer's "Try again" was pressed: the host runs the failed load again. */
249
+ (e: 'retry', event: MouseEvent): void;
240
250
  /**
241
251
  * Emitted when an option is selected by the user.
242
252
  * @param option - The selected option.
@@ -31,11 +31,25 @@
31
31
  loadingText || t('common.loadingText').value
32
32
  }}</slot></span
33
33
  >
34
+ <!-- A failed load is the library's row, never `#empty` (empty means
35
+ empty): its message, announced, and "Try again", which the group runs.
36
+ -->
37
+ <span
38
+ v-else-if="!options.length && error != null"
39
+ :class="[classes.empty, `${classes.empty}--failed`]"
40
+ role="status"
41
+ ><span>{{ failedText || t('common.failedText').value }}</span>
42
+ <button
43
+ class="bb-load-retry"
44
+ type="button"
45
+ @click="emit('retry', $event)"
46
+ >
47
+ {{ t('common.retryLabel').value }}
48
+ </button></span
49
+ >
34
50
  <span v-else-if="!options.length" :class="classes.empty"
35
- ><slot :error="error ?? null" name="empty">{{
36
- error != null
37
- ? failedText || t('common.failedText').value
38
- : emptyText || t('common.emptyText').value
51
+ ><slot name="empty">{{
52
+ emptyText || t('common.emptyText').value
39
53
  }}</slot></span
40
54
  >
41
55
  <template
@@ -129,6 +143,7 @@ import {
129
143
  import { useLocale } from '@/composables/useLocale';
130
144
  import { useId } from '@/composables/useId';
131
145
  import type {
146
+ OptionsContainerEvents,
132
147
  OptionsContainerProps,
133
148
  OptionsContainerSlots,
134
149
  RowPtState,
@@ -142,6 +157,8 @@ const props = defineProps<
142
157
  /* @vue-ignore */ FallthroughAttrs<'span', OptionsContainerProps<T>>
143
158
  >();
144
159
 
160
+ const emit = defineEmits<OptionsContainerEvents>();
161
+
145
162
  defineSlots<OptionsContainerSlots<T>>();
146
163
 
147
164
  /** Warning chrome only when no error is claiming the same modifier. */
@@ -466,13 +483,13 @@ export type OptionsContainerProps<T> = {
466
483
 
467
484
  /**
468
485
  * What the owning group's latest failed `items` load rejected with; `null`
469
- * (or unset) when nothing failed. While set, the empty state shows
470
- * `failedText` and hands the value to the `empty` slot. Internal.
486
+ * (or unset) when nothing failed. While set, the list shows the failure
487
+ * row (`failedText` and "Try again"), never the `empty` slot. Internal.
471
488
  */
472
489
  error?: unknown;
473
490
 
474
491
  /**
475
- * String displayed in the empty state while `error` is set.
492
+ * The failure row's message while `error` is set.
476
493
  */
477
494
  failedText?: string;
478
495
 
@@ -493,7 +510,9 @@ export type OptionsContainerProps<T> = {
493
510
  options: Array<Option<T>>;
494
511
  };
495
512
 
496
- export type OptionsContainerEvents = Record<never, never>;
513
+ export type OptionsContainerEvents =
514
+ /** The failure row's "Try again" was pressed: the group runs the failed load again. */
515
+ (e: 'retry', event: MouseEvent) => void;
497
516
 
498
517
  /** The states one row resolves its parts with. */
499
518
  export type RowPtState =
@@ -551,10 +570,9 @@ export type OptionsContainerSlots<T> = {
551
570
  loading?: (props: object) => any;
552
571
  /**
553
572
  * Content shown when no options are available (replaces the default "no
554
- * data" text). `error` is the owning group's latest load failure, `null`
555
- * when none.
573
+ * data" text). Empty only: a failed load shows the failure row.
556
574
  */
557
- empty?: (props: { error: unknown }) => any;
575
+ empty?: (props: object) => any;
558
576
  /**
559
577
  * The actual input element for each option (e.g. radio or checkbox).
560
578
  */
@@ -14,16 +14,17 @@
14
14
  <script setup lang="ts">
15
15
  import BbIcon from '../BbIcon/BbIcon.vue';
16
16
  import type { FallthroughAttrs } from '@/types/fallthrough';
17
- import alertIcon from '@/assets/svgs/alert.svg?raw';
17
+ import alertIconBuiltin from '@/assets/svgs/alert.svg?raw';
18
18
  import type {
19
19
  WarningIconProps,
20
20
  WarningIconEvents,
21
21
  WarningIconSlots,
22
22
  } from './types';
23
- export type { WarningIconProps, WarningIconEvents, WarningIconSlots };
24
-
23
+ import { useInternalIcon } from '@/composables/useInternalIcon';
25
24
  // Type only (`Record<never, never>` has no runtime props to resolve).
26
25
  defineProps</* @vue-ignore */ FallthroughAttrs<'svg', WarningIconProps>>();
26
+ const alertIcon = useInternalIcon('warning', alertIconBuiltin);
27
+ export type { WarningIconProps, WarningIconEvents, WarningIconSlots };
27
28
  </script>
28
29
 
29
30
  <style lang="postcss">
@@ -1,3 +1,3 @@
1
1
  // src/assets/svgs/close.svg?raw
2
- var e = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path d=\"M23 23L1 1M23 1L1 23\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"3\" />\n</svg>\n";
2
+ var e = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path d=\"M18 6L6 18M6 6l12 12\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-width=\"1.636\" />\n</svg>\n";
3
3
  export { e as default };
@@ -1,8 +1,8 @@
1
1
  import { FallthroughAttrs } from '../../types/fallthrough.js';
2
2
  import { BbAccordionProps, BbAccordionEvents, BbAccordionSlots } from './types.js';
3
- export type { BbAccordionProps, BbAccordionEvents, BbAccordionSlots };
4
3
  type __VLS_Props = BbAccordionProps & FallthroughAttrs<'div', BbAccordionProps>;
5
4
  type __VLS_Slots = BbAccordionSlots;
5
+ export type { BbAccordionProps, BbAccordionEvents, BbAccordionSlots };
6
6
  type __VLS_ModelProps = {
7
7
  /**
8
8
  * Open / closed, or with `value` the key a group of accordions shares: open
@@ -6,12 +6,13 @@ import i from "../BbCollapsible/BbCollapsible.vue.js";
6
6
  import { BB_ACCORDION_PT as a } from "./types.js";
7
7
  import { usePassthrough as o } from "../../composables/usePassthrough.js";
8
8
  import { transitions as s } from "../../utilities/misc/transitions.js";
9
- import { computed as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, h as m, mergeModels as h, mergeProps as g, openBlock as _, renderSlot as v, toDisplayString as y, unref as b, useAttrs as x, useModel as S, withCtx as C } from "vue";
9
+ import { useInternalIcon as c } from "../../composables/useInternalIcon.js";
10
+ import { computed as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, h, mergeModels as g, mergeProps as _, openBlock as v, renderSlot as y, toDisplayString as b, unref as x, useAttrs as S, useModel as C, withCtx as w } from "vue";
10
11
  // src/components/BbAccordion/BbAccordion.vue?vue&type=script&setup=true&lang.ts
11
- var w = /*@__PURE__*/ p({
12
+ var T = /*@__PURE__*/ m({
12
13
  inheritAttrs: !1,
13
14
  __name: "BbAccordion",
14
- props: /*@__PURE__*/ h({
15
+ props: /*@__PURE__*/ g({
15
16
  "pt:root": {},
16
17
  "pt:root:disabled": {},
17
18
  "pt:root:open": {},
@@ -47,39 +48,39 @@ var w = /*@__PURE__*/ p({
47
48
  }),
48
49
  emits: ["update:modelValue"],
49
50
  setup(s) {
50
- let p = S(s, "modelValue"), h = s, w = o({
51
+ let m = C(s, "modelValue"), g = s, T = c("expandChevron", t), E = o({
51
52
  component: "BbAccordion",
52
- attrs: x(),
53
- props: h,
53
+ attrs: S(),
54
+ props: g,
54
55
  parts: a.parts,
55
56
  states: a.states,
56
57
  active: {
57
- open: () => O.value,
58
- disabled: () => !!h.disabled
58
+ open: () => A.value,
59
+ disabled: () => !!g.disabled
59
60
  }
60
- }), T = e().id.value, E = h.id || `bba_${T}`, D = (e, { slots: t }) => h.headingLevel ? m(`h${h.headingLevel}`, { class: "bb-accordion__heading" }, t.default?.()) : t.default?.(), O = c(() => h.value === void 0 ? !!p.value : p.value === h.value), k = () => {
61
- h.disabled || (h.value === void 0 ? p.value = !p.value : p.value = O.value ? null : h.value);
61
+ }), D = e().id.value, O = g.id || `bba_${D}`, k = (e, { slots: t }) => g.headingLevel ? h(`h${g.headingLevel}`, { class: "bb-accordion__heading" }, t.default?.()) : t.default?.(), A = l(() => g.value === void 0 ? !!m.value : m.value === g.value), j = () => {
62
+ g.disabled || (g.value === void 0 ? m.value = !m.value : m.value = A.value ? null : g.value);
62
63
  };
63
- return (e, a) => (_(), l("div", g({ class: ["bb-accordion", { "bb-accordion--titled": !e.$slots.header }] }, b(w).rootAttrs), [f(D, null, {
64
- default: C(() => [f(n, g({
65
- id: `${b(E)}_header`,
66
- "aria-controls": b(E),
64
+ return (e, t) => (v(), u("div", _({ class: ["bb-accordion", { "bb-accordion--titled": !e.$slots.header }] }, x(E).rootAttrs), [p(k, null, {
65
+ default: w(() => [p(n, _({
66
+ id: `${x(O)}_header`,
67
+ "aria-controls": x(O),
67
68
  "aria-disabled": s.disabled || void 0,
68
- "aria-expanded": O.value,
69
+ "aria-expanded": A.value,
69
70
  class: "bb-accordion__header",
70
- onClick: k
71
- }, b(w).header), {
72
- default: C(() => [v(e.$slots, "header", {
73
- toggle: k,
74
- open: O.value
75
- }, () => [u("span", g({ class: "bb-accordion__title" }, b(w).title), [v(e.$slots, "title", {
76
- open: O.value,
77
- toggle: k
78
- }, () => [d(y(s.title), 1)])], 16), f(r, g({
71
+ onClick: j
72
+ }, x(E).header), {
73
+ default: w(() => [y(e.$slots, "header", {
74
+ toggle: j,
75
+ open: A.value
76
+ }, () => [d("span", _({ class: "bb-accordion__title" }, x(E).title), [y(e.$slots, "title", {
77
+ open: A.value,
78
+ toggle: j
79
+ }, () => [f(b(s.title), 1)])], 16), p(r, _({
79
80
  class: "bb-accordion__icon",
80
- icon: b(t),
81
+ icon: x(T),
81
82
  size: "16"
82
- }, b(w).icon), null, 16, ["icon"])])]),
83
+ }, x(E).icon), null, 16, ["icon"])])]),
83
84
  _: 3
84
85
  }, 16, [
85
86
  "id",
@@ -88,18 +89,18 @@ var w = /*@__PURE__*/ p({
88
89
  "aria-expanded"
89
90
  ])]),
90
91
  _: 3
91
- }), f(i, {
92
- id: b(E),
93
- "aria-labelledby": `${b(E)}_header`,
92
+ }), p(i, {
93
+ id: x(O),
94
+ "aria-labelledby": `${x(O)}_header`,
94
95
  eager: s.eager,
95
- "model-value": O.value,
96
+ "model-value": A.value,
96
97
  role: "region",
97
98
  tag: "div",
98
99
  "transition-duration": s.transitionDuration
99
100
  }, {
100
- default: C(() => [u("div", g({ class: "bb-accordion__panel" }, b(w).panel), [v(e.$slots, "default", {
101
- open: O.value,
102
- toggle: k
101
+ default: w(() => [d("div", _({ class: "bb-accordion__panel" }, x(E).panel), [y(e.$slots, "default", {
102
+ open: A.value,
103
+ toggle: j
103
104
  })], 16)]),
104
105
  _: 3
105
106
  }, 8, [
@@ -111,4 +112,4 @@ var w = /*@__PURE__*/ p({
111
112
  ])], 16));
112
113
  }
113
114
  });
114
- export { w as default };
115
+ export { T as default };
@@ -5,6 +5,7 @@ type __VLS_Slots = BbAvatarSlots;
5
5
  export type { BbAvatarProps, BbAvatarSlots };
6
6
  declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
7
7
  size: number | import('../../types/CommonProps.js').CssSize | keyof import('../../types/SizeScale.js').Sizes;
8
+ color: boolean | string;
8
9
  timeout: number;
9
10
  alt: string;
10
11
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -9,83 +9,102 @@ import s from "../BbIcon/BbIcon.vue.js";
9
9
  import c from "../../assets/svgs/user.svg_raw.js";
10
10
  import { BB_AVATAR_PT as l } from "./types.js";
11
11
  import { usePassthrough as u } from "../../composables/usePassthrough.js";
12
- import { computed as d, createCommentVNode as f, createElementBlock as p, createVNode as m, defineComponent as h, mergeProps as g, normalizeClass as _, onMounted as v, openBlock as y, ref as b, renderSlot as x, unref as S, useAttrs as C, watch as w } from "vue";
12
+ import { useConfig as d } from "../../composables/useConfig.js";
13
+ import { LOCALE_TABLE as f, localeKeyOf as p } from "../../i18n/regions.js";
14
+ import { avatarHue as m, initialsOf as h } from "./avatarIdentity.js";
15
+ import { useInternalIcon as g } from "../../composables/useInternalIcon.js";
16
+ import { computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, defineComponent as x, mergeProps as S, normalizeClass as C, onMounted as w, openBlock as T, ref as E, renderSlot as D, toDisplayString as O, unref as k, useAttrs as A, watch as j } from "vue";
13
17
  // src/components/BbAvatar/BbAvatar.vue?vue&type=script&setup=true&lang.ts
14
- var T = [
18
+ var M = [
15
19
  "alt",
16
20
  "aria-hidden",
17
21
  "sizes",
18
22
  "src",
19
23
  "srcset"
20
- ], E = /*@__PURE__*/ h({
24
+ ], N = /*@__PURE__*/ x({
21
25
  inheritAttrs: !1,
22
26
  __name: "BbAvatar",
23
27
  props: {
24
28
  size: { default: "md" },
25
29
  "pt:root": {},
26
30
  "pt:icon": {},
31
+ "pt:initials": {},
27
32
  pt: {},
28
33
  alt: { default: "" },
34
+ name: {},
35
+ color: {
36
+ type: [Boolean, String],
37
+ default: !1
38
+ },
29
39
  src: {},
30
40
  srcset: {},
31
41
  sizes: {},
32
42
  timeout: { default: 400 }
33
43
  },
34
- setup(h) {
35
- let E = h, D = u({
44
+ setup(x) {
45
+ let N = x, P = g("avatar", c), F = u({
36
46
  component: "BbAvatar",
37
- attrs: C(),
38
- props: E,
47
+ attrs: A(),
48
+ props: N,
39
49
  parts: l.parts,
40
50
  states: l.states,
41
51
  active: {}
42
- }), O = n("BbAvatar", r);
52
+ }), I = n("BbAvatar", r);
43
53
  process.env.NODE_ENV !== "production" && o("BbAvatar", a("BbAvatar"));
44
- let k = i(), A = d(() => {
45
- if (E.size != null) try {
46
- return e(E.size, O.value);
54
+ let L = i(), R = _(() => {
55
+ if (N.size != null) try {
56
+ return e(N.size, I.value);
47
57
  } catch {
48
- return k.warn(`Invalid size: "${E.size}" in BbAvatar. Falling back to "md".`), `${O.value.md}px`;
58
+ return L.warn(`Invalid size: "${N.size}" in BbAvatar. Falling back to "md".`), `${I.value.md}px`;
49
59
  }
50
- }), j = d(() => {
60
+ }), z = d(), B = _(() => h(N.name, f[p(z.locale) ?? "en"].tag)), V = _(() => N.alt?.trim() || N.name?.trim() || ""), H = _(() => {
61
+ if (typeof N.color == "string" && N.color) return "bb-avatar--custom";
62
+ let e = N.color === !0 ? m(N.name) : void 0;
63
+ return e ? ["bb-avatar--colored", `bb-avatar--${e}`] : void 0;
64
+ }), U = _(() => {
51
65
  let e = {};
52
- return A.value && (e["--size"] = A.value), e;
53
- }), M = d(() => !!(E.src || E.srcset) && !z.value), N = d(() => M.value && B.value && !R.value), P = d(() => !M.value || N.value), F = d(() => !P.value || !E.alt?.trim() ? {} : {
66
+ return R.value && (e["--size"] = R.value), typeof N.color == "string" && N.color && (e["--bg"] = N.color), e;
67
+ }), W = _(() => !!(N.src || N.srcset) && !Z.value), G = _(() => W.value && Q.value && !X.value), K = _(() => !W.value || G.value), q = _(() => !K.value || !V.value ? {} : {
54
68
  role: "img",
55
- "aria-label": E.alt.trim()
56
- }), I = (e) => !(!e || !e.complete || e.naturalWidth === 0), L = b(null), R = b(!1), z = b(!1), B = b(!1);
57
- v(async () => {
58
- M.value && !z.value && !R.value && L.value && (await t(E.timeout), B.value = !I(L.value));
69
+ "aria-label": V.value
70
+ }), J = (e) => !(!e || !e.complete || e.naturalWidth === 0), Y = E(null), X = E(!1), Z = E(!1), Q = E(!1);
71
+ w(async () => {
72
+ W.value && !Z.value && !X.value && Y.value && (await t(N.timeout), Q.value = !J(Y.value));
59
73
  });
60
- let V = () => {
61
- R.value = !0, z.value = !1, B.value = !1;
62
- }, H = () => {
63
- z.value = !0;
74
+ let $ = () => {
75
+ X.value = !0, Z.value = !1, Q.value = !1;
76
+ }, ee = () => {
77
+ Z.value = !0;
64
78
  };
65
- return w(() => [E.src, E.srcset], () => {
66
- R.value = !1, z.value = !1, B.value = !1;
67
- }), (e, t) => (y(), p("span", g({
68
- class: "bb-avatar",
69
- style: j.value
70
- }, S(D).rootAttrs), [M.value ? (y(), p("img", {
79
+ return j(() => [N.src, N.srcset], () => {
80
+ X.value = !1, Z.value = !1, Q.value = !1;
81
+ }), (e, t) => (T(), b("span", S({
82
+ class: ["bb-avatar", H.value],
83
+ style: U.value
84
+ }, k(F).rootAttrs), [W.value ? (T(), b("img", {
71
85
  key: 0,
72
86
  ref_key: "image",
73
- ref: L,
74
- alt: h.alt,
75
- "aria-hidden": N.value || void 0,
76
- class: _(["bb-avatar__img", { "bb-avatar__img--hidden": N.value }]),
77
- sizes: h.sizes,
78
- src: h.src,
79
- srcset: h.srcset,
80
- onError: H,
81
- onLoad: V
82
- }, null, 42, T)) : f("", !0), P.value ? (y(), p("span", g({
87
+ ref: Y,
88
+ alt: V.value,
89
+ "aria-hidden": G.value || void 0,
90
+ class: C(["bb-avatar__img", { "bb-avatar__img--hidden": G.value }]),
91
+ sizes: x.sizes,
92
+ src: x.src,
93
+ srcset: x.srcset,
94
+ onError: ee,
95
+ onLoad: $
96
+ }, null, 42, M)) : y("", !0), K.value ? (T(), b("span", S({
83
97
  key: 1,
84
98
  class: "bb-avatar__fallback"
85
- }, F.value), [x(e.$slots, "default", {}, () => [m(s, g({
99
+ }, q.value), [D(e.$slots, "default", {}, () => [B.value ? (T(), b("span", S({
100
+ key: 0,
101
+ "aria-hidden": "true",
102
+ class: "bb-avatar__initials"
103
+ }, k(F).initials), O(B.value), 17)) : (T(), v(s, S({
104
+ key: 1,
86
105
  class: "bb-avatar__default-icon",
87
- icon: S(c)
88
- }, S(D).icon), null, 16, ["icon"])])], 16)) : f("", !0)], 16));
106
+ icon: k(P)
107
+ }, k(F).icon), null, 16, ["icon"]))])], 16)) : y("", !0)], 16));
89
108
  }
90
109
  });
91
- export { E as default };
110
+ export { N as default };
@@ -0,0 +1,25 @@
1
+ // src/components/BbAvatar/avatarIdentity.ts
2
+ var e = [
3
+ "coral",
4
+ "tangerine",
5
+ "sunflower",
6
+ "mint",
7
+ "teal",
8
+ "sky",
9
+ "blue",
10
+ "violet",
11
+ "orchid",
12
+ "rose"
13
+ ], t = /^\p{L}\p{M}*/u, n = (e, n) => {
14
+ let r = (e ?? "").trim().split(/\s+/).filter((e) => t.test(e));
15
+ if (!r.length) return "";
16
+ let i = (e) => e.match(t)[0];
17
+ return (r.length > 1 ? i(r[0]) + i(r[r.length - 1]) : i(r[0])).toLocaleUpperCase(n);
18
+ }, r = (t) => {
19
+ let n = (t ?? "").trim().replace(/\s+/g, " ").toLowerCase();
20
+ if (!n) return;
21
+ let r = 2166136261;
22
+ for (let e = 0; e < n.length; e++) r ^= n.charCodeAt(e), r = Math.imul(r, 16777619) >>> 0;
23
+ return e[r % e.length];
24
+ };
25
+ export { e as AVATAR_HUES, r as avatarHue, n as initialsOf };