bitboss-ui 3.0.0-beta.75 → 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 (169) 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/BbBreadcrumbs.md +1 -1
  5. package/dist/ai/BbButton.md +2 -2
  6. package/dist/ai/BbColorInput.md +1 -1
  7. package/dist/ai/BbColorPalette.md +1 -1
  8. package/dist/ai/BbConfirm.md +1 -1
  9. package/dist/ai/BbDatePicker.md +1 -1
  10. package/dist/ai/BbDatePickerInput.md +1 -1
  11. package/dist/ai/BbDialog.md +3 -2
  12. package/dist/ai/BbDropdown.md +23 -21
  13. package/dist/ai/BbDropdownButton.md +13 -11
  14. package/dist/ai/BbGallery.md +3 -2
  15. package/dist/ai/BbIcon.md +10 -10
  16. package/dist/ai/BbOffCanvas.md +3 -2
  17. package/dist/ai/BbPopover.md +1 -1
  18. package/dist/ai/BbSelect.md +153 -43
  19. package/dist/ai/BbSelectPopover.md +115 -9
  20. package/dist/ai/BbTable.md +1 -1
  21. package/dist/ai/BbTimePicker.md +1 -1
  22. package/dist/ai/BbTimePickerInput.md +1 -1
  23. package/dist/ai/GroupedListBox.md +2 -2
  24. package/dist/ai/ListBox.md +3 -2
  25. package/dist/ai/changelog.json +153 -7
  26. package/dist/ai/components.json +12 -12
  27. package/dist/ai/guides/agent-contract.md +1 -1
  28. package/dist/ai/guides/calendars-and-digits.md +1 -1
  29. package/dist/ai/guides/eslint-rules.md +1 -1
  30. package/dist/ai/guides/icons-policy.md +32 -11
  31. package/dist/ai/guides/installation-and-plugin-setup.md +24 -23
  32. package/dist/ai/guides/migration/adoption-checklist.md +1 -1
  33. package/dist/ai/guides/migration/components/bb-icon.md +4 -4
  34. package/dist/ai/guides/migration/v2-to-v3.md +48 -19
  35. package/dist/ai/guides/migration/v3-beta-css-classes.md +18 -3
  36. package/dist/ai/guides/passthrough.md +58 -58
  37. package/dist/ai/helpers/inertia/manifest.json +1 -1
  38. package/dist/ai/manifest/components/BbDialog.tree.json +1 -1
  39. package/dist/ai/manifest/components/BbDropdown.json +19 -17
  40. package/dist/ai/manifest/components/BbDropdown.tree.json +9 -9
  41. package/dist/ai/manifest/components/BbDropdownButton.json +12 -10
  42. package/dist/ai/manifest/components/BbDropdownButton.tree.json +2 -0
  43. package/dist/ai/manifest/components/BbGallery.tree.json +1 -1
  44. package/dist/ai/manifest/components/BbOffCanvas.tree.json +1 -1
  45. package/dist/ai/manifest/components/BbSelect.json +44 -40
  46. package/dist/ai/manifest/components/BbSelect.tree.json +2 -1
  47. package/dist/ai/manifest/components/BbSelectPopover.json +10 -6
  48. package/dist/ai/manifest/components/BbSelectPopover.tree.json +4 -1
  49. package/dist/ai/manifest/components/BbTable.tree.json +5 -1
  50. package/dist/ai/manifest/components/GroupedListBox.json +1 -1
  51. package/dist/ai/manifest/components/GroupedListBox.tree.json +1 -0
  52. package/dist/ai/manifest/components/ListBox.json +1 -1
  53. package/dist/ai/manifest/components/ListBox.tree.json +1 -1
  54. package/dist/ai/manifest/index.json +2 -2
  55. package/dist/ai/recipes/inertia/inline-edit-workspace.md +1 -1
  56. package/dist/ai/recipes/inertia/onboarding.md +1 -1
  57. package/dist/ai/recipes/nuxt/inline-edit-workspace.md +1 -1
  58. package/dist/ai/recipes/nuxt/onboarding.md +1 -1
  59. package/dist/ai/recipes/vue/inline-edit-workspace.md +1 -1
  60. package/dist/ai/recipes/vue/onboarding.md +2 -2
  61. package/dist/ai/source/BbAccordion.md +4 -5
  62. package/dist/ai/source/BbAvatar.md +9 -2
  63. package/dist/ai/source/BbBadge.md +6 -2
  64. package/dist/ai/source/BbBreadcrumbs.md +5 -2
  65. package/dist/ai/source/BbCalendar.md +8 -6
  66. package/dist/ai/source/BbCarousel.md +10 -6
  67. package/dist/ai/source/BbColorPalette.md +5 -2
  68. package/dist/ai/source/BbDatePickerInput.md +7 -2
  69. package/dist/ai/source/BbDropdown.md +91 -66
  70. package/dist/ai/source/BbDropdownButton.md +36 -19
  71. package/dist/ai/source/BbDropdownGroup.md +91 -66
  72. package/dist/ai/source/BbGallery.md +6 -5
  73. package/dist/ai/source/BbPagination.md +12 -28
  74. package/dist/ai/source/BbRating.md +4 -4
  75. package/dist/ai/source/BbSelect.md +130 -106
  76. package/dist/ai/source/BbSelectPopover.md +128 -21
  77. package/dist/ai/source/BbTable.md +42 -9
  78. package/dist/ai/source/BbTimePickerInput.md +6 -2
  79. package/dist/ai/source/ClearableButton.md +4 -2
  80. package/dist/ai/source/ErrorIcon.md +4 -3
  81. package/dist/ai/source/FlatListBox.md +7 -2
  82. package/dist/ai/source/GroupedListBox.md +22 -3
  83. package/dist/ai/source/ListBox.md +7 -1
  84. package/dist/ai/source/WarningIcon.md +4 -3
  85. package/dist/assets/svgs/close.svg_raw.js +1 -1
  86. package/dist/components/BbAccordion/BbAccordion.vue.d.ts +1 -1
  87. package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +35 -34
  88. package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +48 -47
  89. package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +60 -59
  90. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +128 -127
  91. package/dist/components/BbCalendar/BbCalendar.vue.d.ts +1 -1
  92. package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +240 -239
  93. package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +500 -499
  94. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +4 -4
  95. package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +175 -174
  96. package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +1 -1
  97. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +2 -2
  98. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +263 -262
  99. package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +81 -80
  100. package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +4 -0
  101. package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +318 -312
  102. package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +47 -46
  103. package/dist/components/BbDropdown/ptKeys.generated.d.ts +36 -20
  104. package/dist/components/BbDropdown/types.d.ts +51 -53
  105. package/dist/components/BbDropdown/types.js +2 -0
  106. package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +1 -1
  107. package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +74 -59
  108. package/dist/components/BbDropdownButton/ptKeys.generated.d.ts +111 -63
  109. package/dist/components/BbDropdownButton/types.d.ts +12 -10
  110. package/dist/components/BbDropdownButton/types.js +2 -0
  111. package/dist/components/BbDropzone/BbDropzone.vue.d.ts +1 -1
  112. package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +204 -203
  113. package/dist/components/BbIcon/iconCache.js +1 -1
  114. package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +1 -1
  115. package/dist/components/BbPagination/BbPagination.vue.d.ts +2 -2
  116. package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +138 -136
  117. package/dist/components/BbProgress/BbProgress.vue.d.ts +1 -1
  118. package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +4 -4
  119. package/dist/components/BbRating/BbRating.vue.d.ts +1 -1
  120. package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +100 -99
  121. package/dist/components/BbSelect/BbSelect.vue.d.ts +30 -20
  122. package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +201 -184
  123. package/dist/components/BbSelect/ptKeys.generated.d.ts +128 -96
  124. package/dist/components/BbSelect/types.d.ts +101 -105
  125. package/dist/components/BbSelect/types.js +1 -27
  126. package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +6 -3
  127. package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +617 -585
  128. package/dist/components/BbSelectPopover/ptKeys.generated.d.ts +22 -10
  129. package/dist/components/BbSelectPopover/types.d.ts +22 -13
  130. package/dist/components/BbSelectPopover/types.js +3 -1
  131. package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +1 -1
  132. package/dist/components/BbTable/BbTable.vue.d.ts +1 -1
  133. package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1092 -1090
  134. package/dist/components/BbTable/BbTableDataRow.js +97 -90
  135. package/dist/components/BbTabs/BbTabs.vue.d.ts +3 -3
  136. package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +2 -2
  137. package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +2 -2
  138. package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +225 -224
  139. package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +76 -75
  140. package/dist/components/ClearableButton/ClearableButton.vue_vue_type_script_setup_true_lang.js +9 -8
  141. package/dist/components/CloseIcon/CloseButton.vue.js +1 -1
  142. package/dist/components/CloseIcon/CloseButton.vue_vue_type_script_setup_true_lang.js +9 -7
  143. package/dist/components/ErrorIcon/ErrorIcon.vue_vue_type_script_setup_true_lang.js +8 -6
  144. package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +69 -68
  145. package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +166 -165
  146. package/dist/components/WarningIcon/WarningIcon.vue_vue_type_script_setup_true_lang.js +8 -6
  147. package/dist/composables/useInternalIcon.js +25 -0
  148. package/dist/icon-scan.d.ts +1 -1
  149. package/dist/llms-full.txt +477 -187
  150. package/dist/llms-medium.txt +25 -24
  151. package/dist/llms.txt +1 -1
  152. package/dist/nuxt.js +1 -1
  153. package/dist/styles.css +2 -2
  154. package/dist/types/Config.d.ts +8 -1
  155. package/dist/types/ConfigDefaults.d.ts +10 -2
  156. package/dist/types/internalIcons.d.ts +89 -0
  157. package/dist/types/internalIcons.js +158 -0
  158. package/dist/types/ptComponentMap.d.ts +4 -4
  159. package/dist/utils/configDefaults.js +75 -64
  160. package/dist/utils/iconsOption.js +48 -0
  161. package/dist/utils/versionCheck.js +1 -1
  162. package/dist/vite-plugin.d.ts +10 -16
  163. package/dist/vite.js +319 -306
  164. package/llms.txt +1 -1
  165. package/package.json +1 -1
  166. package/scripts/lib/adoption-checklist.json +1 -1
  167. package/scripts/lib/update-install.mjs +48 -0
  168. package/scripts/lib/validate-bb-markup.mjs +73 -12
  169. package/dist/assets/svgs/caret_down.svg_raw.js +0 -3
@@ -22,6 +22,7 @@
22
22
  | `pt:footer` | `pt:footer` of `BbSelectPopover` | `BbSelectPopover` ([contract](./BbSelectPopover.md)) |
23
23
  | `pt:input` | `pt:input` of `BbSelectPopover` | `BbSelectPopover` ([contract](./BbSelectPopover.md)) |
24
24
  | `pt:list` | `pt:list` of `BbSelectPopover` | `BbSelectPopover` ([contract](./BbSelectPopover.md)) |
25
+ | `pt:groupHeader` | `pt:groupHeader` of `BbSelectPopover` | `BbSelectPopover` ([contract](./BbSelectPopover.md)) |
25
26
  | `pt:option` | `pt:option` of `BbSelectPopover` | `BbSelectPopover` ([contract](./BbSelectPopover.md)) |
26
27
  | `pt:itemText` | `pt:itemText` of `BbSelectPopover` | `BbSelectPopover` ([contract](./BbSelectPopover.md)) |
27
28
  | `pt:itemIcon` | `pt:itemIcon` of `BbSelectPopover` | `BbSelectPopover` ([contract](./BbSelectPopover.md)) |
@@ -1073,7 +1074,7 @@ much to type.
1073
1074
  />
1074
1075
  ```
1075
1076
 
1076
- Below the minimum (trimmed characters) the query counts as empty: no
1077
+ Below the minimum (characters after trimming; an emoji is one) the query counts as empty: no
1077
1078
  `'search'` call, no filtering of array items, the search-first hint says
1078
1079
  "Type at least 3 characters", and a prefilled list stays unfiltered. Loads for
1079
1080
  other reasons still run, so a seeded model resolves. Enter does not emit
@@ -2049,6 +2050,63 @@ const open = ref(false);
2049
2050
  </template>
2050
2051
  ```
2051
2052
 
2053
+ ### Reading and restoring the search: `v-model:query`
2054
+
2055
+ `v-model:query` is the search field's text. Bound, your ref reads it and sets
2056
+ it:
2057
+
2058
+ - **It mirrors the field, raw.** Every committed keystroke is written back as
2059
+ typed, spaces included (an IME composition once, when it ends), and `''`
2060
+ whenever the component empties the field itself: closing, a pick that
2061
+ closes, `option:add` (Enter or the create row), the ✕.
2062
+ - **A write is a search the user didn't type.** It runs at once, without
2063
+ the debounce, and supersedes a scheduled or in-flight search (its late
2064
+ answer never lands). Written while closed, it is held for the next open:
2065
+ `query = 'Rossi'; open = true` sends one request, for "Rossi". A write
2066
+ never opens the panel or moves focus, and is never echoed back.
2067
+ - **A write that can't land writes `''` back:** no search field
2068
+ (`disable-writing`), `disabled`, `readonly`, a refused open.
2069
+ - Unbound, a static `:query` seeds the next open.
2070
+
2071
+ The case it is for: bring a search back. The create row hands the query to
2072
+ `option:add` and empties the field; if the user cancels the dialog, put the
2073
+ query back and reopen, and "Create «Rossi»" is there again:
2074
+
2075
+ ```vue
2076
+ <script setup lang="ts">
2077
+ import { ref } from 'vue';
2078
+ import { BbSelect, useBbDialog } from 'bitboss-ui';
2079
+ import CreatePersonDialog from './CreatePersonDialog.vue';
2080
+
2081
+ const person = ref<number | null>(null);
2082
+ const open = ref(false);
2083
+ const query = ref('');
2084
+ const createPerson = useBbDialog(CreatePersonDialog);
2085
+
2086
+ const onAdd = async (text: string) => {
2087
+ const result = await createPerson.show({ name: text });
2088
+ if (result.completed) return void (person.value = result.value.id);
2089
+ query.value = text;
2090
+ open.value = true;
2091
+ };
2092
+ </script>
2093
+
2094
+ <template>
2095
+ <BbSelect
2096
+ v-model="person"
2097
+ v-model:open="open"
2098
+ v-model:query="query"
2099
+ item-text="name"
2100
+ item-value="id"
2101
+ :items="searchPeople"
2102
+ label="Person"
2103
+ @option:add="onAdd"
2104
+ />
2105
+ </template>
2106
+ ```
2107
+
2108
+ Every state, with its test: the BbSelectPopover guide, § Reading and restoring the search.
2109
+
2052
2110
  ### Events and v-model
2053
2111
 
2054
2112
  - `update:modelValue` — the resolved value (single) or array (multiple), on
@@ -2183,7 +2241,7 @@ the `BbTextInput` guide.
2183
2241
 
2184
2242
  `pt` reaches a named part of the control with a class list — or, in the
2185
2243
  object form, a style and attributes — optionally only while a state is on.
2186
- Parts: `root` (the container), `label`, `description`, `message` (the errors / warnings region — one node each, only one ever shows), `hint` (the helper line — shown on focus, or always with `persistent-hint`), `box` (the bordered field box), `activator` (the button that opens the options — BbSelect's control; the text controls call theirs `input`), `input` (the search field in the options surface, when it shows one), `icon` (`prepend:icon` + `append:icon` — a broadcast; the state glyphs are chrome), `spinner` (the spinner shown while `loading`), `prefix`, `suffix`, `clear` (the ✕ that empties the field). Plus `panel` (the options surface you see — the popover's painted bubble on desktop, the sheet itself on a phone), `sheet` (the bottom sheet on a phone only), `option` (one listbox option, a broadcast), `itemText` (that option's label), `itemIcon` (its `itemProps` prepend / append icons — never the field's `icon`) and `itemDescription` (its muted second line from `itemProps.description` — never the field's `description`), and `check` (the tick on a chosen option, at the row's end), all with the option's `selected` / `disabled`; a custom `#option` slot replaces the label and description, never the tick. With `multiple`, the selected values are `badge` (each chip's `BbBadge` root, in the field and on the phone sheet — in the field, not rendered when the `#chip` slot replaces it; the sheet's chips are always badges) or `comma` (each entry in `comma` mode) — the same two words as `BbTag`. The chevron and the clear ✕ are chrome.
2244
+ Parts: `root` (the container), `label`, `description`, `message` (the errors / warnings region — one node each, only one ever shows), `hint` (the helper line — shown on focus, or always with `persistent-hint`), `box` (the bordered field box), `activator` (the button that opens the options — BbSelect's control; the text controls call theirs `input`), `input` (the search field in the options surface, when it shows one), `icon` (`prepend:icon` + `append:icon` — a broadcast; the state glyphs are chrome), `spinner` (the spinner shown while `loading`), `prefix`, `suffix`, `clear` (the ✕ that empties the field). Plus `panel` (the options surface you see — the popover's painted bubble on desktop, the sheet itself on a phone), `sheet` (the bottom sheet on a phone only), `option` (one listbox option, a broadcast), `itemText` (that option's label), `itemIcon` (its `itemProps` prepend / append icons — never the field's `icon`) and `itemDescription` (its muted second line from `itemProps.description` — never the field's `description`), and `check` (the tick on a chosen option, at the row's end), all with the option's `selected` / `disabled`; a custom `#option` slot replaces the label and description, never the tick. `groupHeader` is every `group-by` heading's box (sticky; `#group` replaces its content, never the box), `disabled` while every option of its group is. With `multiple`, the selected values are `badge` (each chip's `BbBadge` root, in the field and on the phone sheet — in the field, not rendered when the `#chip` slot replaces it; the sheet's chips are always badges) or `comma` (each entry in `comma` mode) — the same two words as `BbTag`. The chevron and the clear ✕ are chrome.
2187
2245
  States: `errors`, `warnings` (never beside errors), `loading`, `disabled`, `readonly`, `hasValue` (written `pt:box:has-value`). Plus `open` (the options surface is showing) and `selected`, resolved per option. A name outside that list is a type error and an
2188
2246
  ESLint error.
2189
2247
 
@@ -2254,6 +2312,54 @@ const assignee = ref<string | null>('ada');
2254
2312
  </script>
2255
2313
  ```
2256
2314
 
2315
+ **A heading that reads as a row.** `pt:group-header` styles the `group-by`
2316
+ heading's box; its label is the box's child, so `*:` reaches it: a hairline
2317
+ above each region, and the label in an option's colour, weight and size.
2318
+
2319
+ **pt:group-header — region headings that read as rows**
2320
+
2321
+ ```vue
2322
+ <template>
2323
+ <div
2324
+ class="grid max-w-sm gap-3 rounded-(--bb-radius) border border-(--bb-border) p-3"
2325
+ >
2326
+ <div>
2327
+ <h3 class="text-sm font-medium">Ship from</h3>
2328
+ <p class="text-xs text-(--bb-text-muted)">
2329
+ Warehouses by region; each region reads as a row.
2330
+ </p>
2331
+ </div>
2332
+ <BbSelect
2333
+ v-model="warehouse"
2334
+ compact
2335
+ group-by="region"
2336
+ :items="warehouses"
2337
+ label="Warehouse"
2338
+ placeholder="Pick a warehouse"
2339
+ pt:group-header="border-t border-(--bb-border) *:font-normal *:text-(--bb-text) *:text-[length:var(--bb-fs)]"
2340
+ />
2341
+ </div>
2342
+ </template>
2343
+
2344
+ <script setup lang="ts">
2345
+ import { ref } from 'vue';
2346
+ import { BbSelect } from 'bitboss-ui';
2347
+
2348
+ type Warehouse = { label: string; value: string; region: string };
2349
+
2350
+ // `pt:group-header` is the heading's box: a hairline above it, and through
2351
+ // `*:` its label takes an option's colour, weight and size.
2352
+ const warehouses: Warehouse[] = [
2353
+ { label: 'Milano Linate', value: 'lin', region: 'North' },
2354
+ { label: 'Torino Corso Francia', value: 'tor', region: 'North' },
2355
+ { label: 'Roma Tiburtina', value: 'rom', region: 'Centre' },
2356
+ { label: 'Firenze Osmannoro', value: 'fir', region: 'Centre' },
2357
+ ];
2358
+
2359
+ const warehouse = ref<string | null>(null);
2360
+ </script>
2361
+ ```
2362
+
2257
2363
  **Chips that look like your app's badges.** Each chip is a `BbBadge` (the
2258
2364
  `secondary` one), so `pt:badge` takes the same classes your badges use, or a
2259
2365
  badge variant's class: `pt:badge="bb-badge--destructive"`. Mind the cascade:
@@ -2432,44 +2538,45 @@ it: [passthrough guide § Typing `pt` in `<script>`](./guides/passthrough.md#typ
2432
2538
 
2433
2539
  - `v-model` — type: `any`
2434
2540
  - `v-model:open` — type: `boolean \| undefined`
2541
+ - `v-model:query` — type: `string \| undefined`
2435
2542
 
2436
2543
  ## Props
2437
2544
 
2438
2545
  | Prop | Type | Default | Required | Description |
2439
2546
  | --- | --- | --- | --- | --- |
2440
- | `pt:<part>`, `pt:<part>:<state>`, `pt` | `PtValue` | | | Passthrough — a class list, or `{ class, style, attrs }`, bound to one named part of the component; the state form applies only while that state is on. Parts: `activator`, `badge`, `box`, `check`, `clear`, `comma`, `description`, `footer`, `header`, `hint`, `icon`, `input`, `itemDescription`, `itemIcon`, `itemText`, `label`, `list`, `message`, `option`, `panel`, `prefix`, `root`, `sheet`, `spinner`, `suffix`. States: `disabled`, `errors`, `ghost`, `hasValue`, `loading`, `open`, `outline`, `readonly`, `secondary`, `warnings`, `selected`. What each one is: _Passthrough parts and states_ below. `pt` is the object form with the same keys minus the prefix (`{ icon: '…', 'icon:loading': '…' }`). See `guides/passthrough.md`. In `<script>` a `pt` value is typed `BbSelectProps<Row>['pt']` (`BbSelectProps<object>['pt']` for a preset that fits any row type, never `<any>`) (`PtValue` is not exported): § Typing `pt` in `<script>`. |
2441
- | `adaptive` | `boolean \| undefined` | ``all.adaptive` (`true`)` | | When `true`, the options panel opens as a bottom off-canvas sheet on mobile viewports instead of a floating popover; on desktop it stays a popover. When unset, falls back to the global `all.adaptive`. |
2547
+ | `pt:<part>`, `pt:<part>:<state>`, `pt` | `PtValue` | | | Passthrough — a class list, or `{ class, style, attrs }`, bound to one named part of the component; the state form applies only while that state is on. Parts: `activator`, `badge`, `box`, `check`, `clear`, `comma`, `description`, `footer`, `groupHeader`, `header`, `hint`, `icon`, `input`, `itemDescription`, `itemIcon`, `itemText`, `label`, `list`, `message`, `option`, `panel`, `prefix`, `root`, `sheet`, `spinner`, `suffix`. States: `disabled`, `errors`, `ghost`, `hasValue`, `loading`, `open`, `outline`, `readonly`, `secondary`, `warnings`, `selected`. What each one is: _Passthrough parts and states_ below. `pt` is the object form with the same keys minus the prefix (`{ icon: '…', 'icon:loading': '…' }`). See `guides/passthrough.md`. In `<script>` a `pt` value is typed `BbSelectProps<Row>['pt']` (`BbSelectProps<object>['pt']` for a preset that fits any row type, never `<any>`) (`PtValue` is not exported): § Typing `pt` in `<script>`. |
2548
+ | `adaptive` | `boolean \| undefined` | ``all.adaptive` (`true`)` | | `true`: on mobile viewports the options open in a bottom sheet, not a popover (desktop keeps the popover). Unset: the global `all.adaptive`. |
2442
2549
  | `append:icon` | `string \| undefined` | `the chevron-down glyph` | | Name of the icon to be added at the end of the input. |
2443
2550
  | `autocomplete` | `string \| undefined` | | | Guides to the browser as to the type of information expected in the field. |
2444
2551
  | `autofocus` | `Booleanish \| undefined` | | | Focuses the field when it mounts (a dialog already open included), unless the user is typing in another field. |
2445
- | `clearable` | `boolean \| undefined` | `false` | | Displays a clear button when the input has a value and is being interacted with. A single select also clears when the picked option is clicked again. |
2446
- | `comma` | `boolean \| undefined` | `false` | | Sets the display model for selected values to a list of comma separated string. In this mode the user cannot deselect an option by pressing the close button. |
2552
+ | `clearable` | `boolean \| undefined` | `false` | | A clear button while the field has a value and is interacted with; a single select also clears when its pick is clicked again. |
2553
+ | `comma` | `boolean \| undefined` | `false` | | Shows the picks as one comma-separated string; no close button to deselect one there. |
2447
2554
  | `compact` | `boolean \| undefined` | `undefined` | | Compact density: the field uses the `-compact` twins of `--bb-input-h`, `--bb-input-py` and `--bb-label-spacing-y`, so a `--bb-input-h` set on the component is ignored while it is on. Size a compact field with `--bb-input-h-compact` (and `--bb-input-py-compact`). |
2448
2555
  | `dependencies` | `unknown[] \| undefined` | | | Defines an array of dependencies that will trigger actions in the component upon change. |
2449
2556
  | `depsDebounceTime` | `number \| undefined` | `0` | | Timeout used to debounce response to changes to dependencies. |
2450
2557
  | `description` | `string \| undefined` | | | Text between the label and the input. Unlike the hint it is always visible; it joins the input's `aria-describedby` after any `errors` / `warnings`, before the `hint`. |
2451
2558
  | `disabled` | `boolean \| undefined` | `false` | | Disables the component. |
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. |
2559
+ | `disableWriting` | `boolean \| "auto" \| "mobile" \| "desktop" \| undefined` | `'auto'` | | Hides the panel's search field: `true` everywhere, `'mobile'` / `'desktop'` on that platform. `'auto'`, per open: for an array `items` shorter than the plugin's `autoDisableWritingThreshold` (6), never for a provider or with an `option:add` listener. |
2453
2560
  | `emptyText` | `string \| undefined` | | | String displayed when there are no items to display. |
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. |
2561
+ | `enforceCoherence` | `boolean \| undefined` | `false` | | After each successful non-search load, drops the picks the fetched rows lack (a single model goes `null`). A `stash` does not count; a `known-items` value stays until a parent change; a search or failed load never prunes. |
2455
2562
  | `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. |
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. |
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". |
2563
+ | `failedText` | `string \| undefined` | `the localized `common.failedText` ("Couldn't load items")` | | The empty state's text while the latest load FAILED (the provider threw): `emptyText`'s twin for that case. |
2564
+ | `filterBy` | `false \| string[] \| undefined` | `[]` | | What typing filters on: empty = display text and description; item paths = those fields (`['name', 'email']`); `false` = none. Ranked, case- and accent-blind (guide § Search). `false` when the provider matched on the server, or its email matches show "No results". |
2458
2565
  | `formless` | `boolean \| undefined` | `false` | | Keep this control out of the enclosing `BbForm` entirely: not submitted, not dirty, not reset, not validated. For a control that is not form data (a filter, a "show advanced" switch). |
2459
2566
  | `groupBy` | `string \| ((item: T) => string \| number \| symbol) \| undefined` | | | Path to item property for grouping options. |
2460
2567
  | `hasErrors` | `boolean \| undefined` | `false` | | Define if the component should be in an error state. It usually attaches a CSS class for styling purposes. |
2461
2568
  | `hasWarnings` | `boolean \| undefined` | `false` | | Define if the component should be in a warning state. Same chrome as errors with `--bb-warn`; errors take priority. |
2462
- | `headerHeight` | `number \| undefined` | | | Height of group headers in the listbox (px). Defaults to 32px (24px compact; 36px / 32px on mobile viewports). Only applies when `groupBy` is set. An explicit value wins on every viewport. |
2569
+ | `headerHeight` | `number \| undefined` | | | Group header height (px), with `groupBy`: 32 (24 compact; 36 / 32 on mobile viewports). An explicit value wins on every viewport. |
2463
2570
  | `hideLabel` | `boolean \| undefined` | `false` | | Visually hides the label of the input while maintaining accessibility. Pair it with a `placeholder`: an empty field otherwise shows nothing saying what it is for. |
2464
2571
  | `hint` | `string \| undefined` | | | Text box to be displayed near the input, usually to indicate instructions. |
2465
2572
  | `id` | `string \| undefined` | | | The `id` of the native control; the label's `for` and the description and message ids derive from it. Generated when omitted. |
2466
2573
  | `inputAlign` | `'center'` \| `'top'` \| `'bottom'` | | | Vertical position of the control in a side-by-side row; not `inputPosition`, the horizontal one. Omitted, `'top'`. |
2467
- | `itemHeight` | `number \| undefined` | `28` | | Height of the options in the listbox (px). Defaults to 28px (24px compact; 44px / 36px on mobile viewports). An explicit value wins on every viewport. |
2468
- | `itemProps` | `BbSelectItemProps<T> \| undefined` | | | ADDITIONAL row fields, never the text or value: `description` (a muted line under the label), `prepend:icon`, `append:icon`. An object of paths or getters per field, or a function of the item. Nothing is read implicitly; none shows in the trigger or the chips. |
2469
- | `items` | `T[] \| ((context: BbSelectItemsContext) => T[] \| Promise<T[]>)` | | yes | The options: an array, or a provider called with a `BbSelectItemsContext` (`query`, `reason`, `modelValue`, `signal`), sync or async. Branch on `reason !== 'search'` to resolve the selection by id. A provider fails by THROWING, never by returning `[]`. |
2574
+ | `itemHeight` | `number \| undefined` | `28` | | Option height (px): 28 (24 compact; 44 / 36 on mobile viewports). An explicit value wins on every viewport. |
2575
+ | `itemProps` | `BbSelectItemProps<T> \| undefined` | | | EXTRA row fields, never text or value: `description` (a muted line under the label), `prepend:icon`, `append:icon`. Paths or getters per field, or a function of the item. Nothing is read implicitly; none shows in the trigger or chips. |
2576
+ | `items` | `T[] \| ((context: BbSelectItemsContext) => T[] \| Promise<T[]>)` | | yes | The options: an array, or a provider (sync or async) called with a `BbSelectItemsContext` (`query`, `reason`, `modelValue`, `signal`). Branch on `reason !== 'search'` to resolve the selection by id. It fails by THROWING, never by returning `[]`. |
2470
2577
  | `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). |
2471
2578
  | `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`. |
2472
- | `knownItems` | `([Known] extends [undefined] ? BbSelectKnownItems : Known) \| undefined` | | | `{ value, label }` rows naming the value the app already holds, whatever the options' shape: no request until the first open (`prefill: true` still loads). Not options; the options' accessors never run on them; slots get the row as `item`, with `known: true`, until the list brings its own. |
2579
+ | `knownItems` | `([Known] extends [undefined] ? BbSelectKnownItems : Known) \| undefined` | | | `{ value, label }` rows naming the value the app already holds, whatever the options' shape: no request until the first open (`prefill: true` still loads). Not options, so no accessor runs on them; slots get the row as `item`, `known: true`, until the list brings its own. |
2473
2580
  | `label` | `string` | | yes | Text content of the label of the element. |
2474
2581
  | `labelAlign` | `'center'` \| `'top'` \| `'bottom'` | | | Vertical position of the label block in a side-by-side row; not `labelPosition`, the horizontal one. Omitted, `'top'`. |
2475
2582
  | `labelMode` | `"outside" \| "floating" \| "inside" \| undefined` | | | Label rendering mode. |
@@ -2478,30 +2585,31 @@ it: [passthrough guide § Typing `pt` in `<script>`](./guides/passthrough.md#typ
2478
2585
  | `loading` | `boolean \| undefined` | `false` | | Sets the component in a loading state, usually triggering some visual styles. |
2479
2586
  | `loadingText` | `string \| undefined` | | | String displayed while items are being loaded. |
2480
2587
  | `max` | `number \| undefined` | | | Maximum number of selectable items when the multiple flag is set. |
2481
- | `maxSelectedLabels` | `number \| undefined` | `Infinity` | | Maximum number of labels shown before collapsing to a count summary. Unset, the labels collapse only when they overflow the field. |
2482
- | `minQueryLength` | `number \| undefined` | `0` | | Characters to type (trimmed) before the query searches. Below it the query counts as empty: no `'search'` call, no filtering, and the panel says how many characters to type. Slots still get the typed `query`. |
2588
+ | `maxSelectedLabels` | `number \| undefined` | `Infinity` | | Labels shown before collapsing to a count summary. Unset, they collapse only when they overflow the field. |
2589
+ | `minQueryLength` | `number \| undefined` | `0` | | Characters to type (trimmed) before the query searches. Below it the query counts as empty: no `'search'` call, no filtering; the panel says how many to type. Slots still get the typed `query`. |
2483
2590
  | `modelValue` | `any` | | | Used by v-model. Can be any serializable type. |
2484
2591
  | `modelValueDebounceTime` | `number \| undefined` | `0` | | Timeout used to debounce response to changes to modelValue. |
2485
2592
  | `multiple` | `boolean \| undefined` | `false` | | Allows the selection of multiple items. |
2486
2593
  | `name` | `string \| undefined` | | | Defines the name of the input. |
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). |
2594
+ | `offCanvasProps` | `Partial<BbOffCanvasProps> \| undefined` | | | Props for the phone sheet (the `BbOffCanvas` `adaptive` renders), over its defaults. A `pt` inside styles only the sheet (passthrough guide § Inside the sheet). |
2488
2595
  | `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. |
2489
2596
  | `persistentHint` | `boolean \| undefined` | `false` | | Keeps the hint displayed. |
2490
2597
  | `placeholder` | `string \| undefined` | | | Text shown in the field while nothing is picked (an empty list has `emptyText`). |
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. |
2598
+ | `prefill` | `boolean \| "interaction" \| undefined` | `'interaction'` | | When the options first load: `'interaction'` on first open, `true` on mount, `false` once the user types (on open with `disable-writing`). An array `items` or a seeded model loads at once. |
2492
2599
  | `prepend:icon` | `string \| undefined` | | | Name of the icon to be added at the start of the input. |
2600
+ | `query` | `string \| undefined` | | | The search field's text (`v-model:query`): raw per keystroke, `''` when the component empties it; a write searches at once (guide § Reading and restoring the search). |
2493
2601
  | `queryDebounceTime` | `number \| undefined` | `500` | | Time to wait when the user stops writing in the input before querying data. |
2494
2602
  | `readonly` | `boolean \| undefined` | `false` | | Sets the input in a readonly state. |
2495
2603
  | `required` | `boolean \| undefined` | `false` | | Sets the input as required. |
2496
2604
  | `reverse` | `boolean \| undefined` | `undefined` | | Reverses the layout. Applicable in every direction the order of the label and the input is swapped. |
2497
2605
  | `rules` | `RuleExpression<any>` | | | vee-validate rules for this field. Only inside a `BbForm`. |
2498
2606
  | `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. |
2499
- | `selectedLabelsFn` | `((count: number) => string) \| undefined` | | | Function that returns a string to be displayed when the number of selected labels is greater than `maxSelectedLabels`. |
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). |
2607
+ | `selectedLabelsFn` | `((count: number) => string) \| undefined` | | | The text shown when the selected labels outnumber `maxSelectedLabels`. |
2608
+ | `stash` | `boolean \| undefined` | `false` | | Keeps picks named (chips keep their text) when a later search or failed load stops returning them. It follows the model; it does not keep a pick valid (`enforce-coherence` still prunes it). |
2501
2609
  | `transitionDuration` | `number \| undefined` | `250` | | How long the transition has to last in milliseconds. |
2502
2610
  | `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. |
2503
2611
  | `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. |
2504
- | `variant` | `'outline'` \| `'secondary'` \| `'none'` \| `'ghost'` | `'outline'` | | The field box's look, with `BbButton`'s names and tokens. Colours only, so a form never reflows; `'ghost'` has no border in any state, `'none'` no look at all (you own hover, focus and the states). Register more with the plugin's `components.BbSelect.variants`. |
2612
+ | `variant` | `'outline'` \| `'secondary'` \| `'none'` \| `'ghost'` | `'outline'` | | The field box's look: `BbButton`'s names and tokens, colours only (a form never reflows). `'ghost'` has no border in any state; `'none'` no look at all (you own hover, focus, states). More via the plugin's `components.BbSelect.variants`. |
2505
2613
  | `warnings` | `string \| string[] \| undefined` | | | Warning messages under the field, a string or array: amber, in their own `aria-live` region and in the control's `aria-describedby` after the errors. Non-empty turns on the warning state; errors win when both are set. |
2506
2614
 
2507
2615
  ## Passthrough parts and states
@@ -2510,30 +2618,31 @@ it: [passthrough guide § Typing `pt` in `<script>`](./guides/passthrough.md#typ
2510
2618
 
2511
2619
  | Part | What it is |
2512
2620
  | --- | --- |
2513
- | `root` | The field's outer container: the label, the box and the lines under it; a `class` on the component lands here. (The options surface is `panel`.) |
2621
+ | `root` | The field's outer container (label, box, the lines under it); a `class` on the component lands here. The options surface is `panel`. |
2514
2622
  | `label` | The label text above the box (the `label` prop). |
2515
2623
  | `description` | The muted line under the label (the `description` prop). |
2516
2624
  | `message` | The errors / warnings line under the box. A node of its own: it can show at the same time as `hint`. |
2517
2625
  | `hint` | The helper line (the `hint` prop), shown on focus, or always with `persistent-hint`. |
2518
2626
  | `box` | The bordered box around the input — border, background and radius; the `variant` paints here. |
2519
- | `activator` | The button you act on to open the options — the field's control (not a text field: `data-test` fits here, `autocomplete` does not). The chevron is chrome. It is `activator`, not the family's `input`: the field itself is a button (the date / time inputs' trigger is the same word). |
2520
- | `input` | The search field inside the options surface, when it shows one (see `disable-writing`) — handed to the `BbSelectPopover` as its own `pt:input`. Its ✕ is chrome. |
2627
+ | `activator` | The button that opens the options: the field's control, not a text field (`data-test` fits, `autocomplete` does not). The chevron is chrome. `activator`, not the family's `input`: the field is a button, as the date / time inputs' trigger. |
2628
+ | `input` | The options surface's search field, when shown (see `disable-writing`): the `BbSelectPopover`'s `pt:input`. Its ✕ is chrome. |
2521
2629
  | `icon` | The content icons, prepend and append — a broadcast. Chrome (the clear ✕, a chevron, the error / warning glyph) is never in it. |
2522
2630
  | `spinner` | The spinner inside the box while `loading`. |
2523
2631
  | `prefix` | The `#prefix` slot's wrapper, inside the box before the input. |
2524
2632
  | `suffix` | The `#suffix` slot's wrapper, inside the box after the input. |
2525
- | `clear` | The ✕ in the field that empties the selection (`clearable`) — one node, never a chip's own ✕. |
2633
+ | `clear` | The field's ✕ that empties the selection (`clearable`): one node, never a chip's ✕. |
2526
2634
  | `panel` | The options surface — the popover's painted bubble on desktop, the sheet itself on a phone. |
2527
2635
  | `sheet` | The bottom sheet the options open in on a phone only. |
2528
- | `header` | The band around your `#header` slot: at the top of the flyout on desktop, the sheet's header on a phone. |
2529
- | `footer` | The band around your `#footer` slot: at the bottom of the flyout on desktop, the sheet's footer on a phone. |
2530
- | `list` | The `role="listbox"` node that holds the options. Virtualised: its height is written inline and its rows are positioned by the list, which limits what a layout utility can do there. The listbox's groups and the chips are not parts. |
2636
+ | `header` | The band around your `#header` slot: atop the flyout, the sheet's header on a phone. |
2637
+ | `footer` | The band around your `#footer` slot: under the flyout's list, the sheet's footer on a phone. |
2638
+ | `list` | The `role="listbox"` node holding the options. Virtualised: the list writes its height and places its rows, which limits layout utilities there. A group's box and the chips are not parts. |
2639
+ | `groupHeader` | Every `groupBy` heading (sticky). `#group` replaces its content. |
2531
2640
  | `option` | One listbox option — a broadcast resolved per option. Also takes a per-item function, called with the option's raw item. |
2532
2641
  | `itemText` | An option's label — resolved with that option's states. A custom `#option` slot replaces it. Also takes a per-item function. |
2533
2642
  | `itemIcon` | An option's prepend / append icons (`itemProps`) — resolved with that option's states. Also takes a per-item function. |
2534
2643
  | `itemDescription` | An option's second line (its description) — resolved with that option's states. A custom `#option` slot replaces it. Also takes a per-item function. |
2535
- | `check` | The tick on the chosen option, at the row's end — mounted on every option and drawn on the chosen ones; a custom `#option` slot keeps it. `pt:check="hidden"` removes it and leaves a glyph your slot draws alone. Also takes a per-item function. |
2536
- | `badge` | Each selected value's `BbBadge` root with `multiple` — a broadcast resolved per value, on the field's chips and on the phone sheet's. The badge's own ✕ is chrome, never `clear`. In the field, not rendered when the `#chip` slot replaces it, nor in `comma` mode; the sheet's chips are always badges. |
2644
+ | `check` | The tick at a chosen option's end (on every option, drawn on the chosen). A custom `#option` slot keeps it; `pt:check="hidden"` removes it, sparing your slot's glyph. Also takes a per-item function. |
2645
+ | `badge` | Each selected value's `BbBadge` root with `multiple`, per value, in the field and on the phone sheet. Its ✕ is chrome, never `clear`. The field has none under `#chip` or `comma`; the sheet's chips are always badges. |
2537
2646
  | `comma` | Each selected value with `multiple` and `comma` — a broadcast resolved per value. |
2538
2647
 
2539
2648
  States are listed in precedence order: when two are on at once and their entries conflict, the later one wins.
@@ -2543,7 +2652,7 @@ States are listed in precedence order: when two are on at once and their entries
2543
2652
  | `hasValue` | Component-wide: the control holds a value, by its own rule (`0` counts on `BbNumberInput`, `''` on `BbColorInput`). |
2544
2653
  | `selected` | Per node, on `option`, its `item-*` parts and `check`: a chosen option. |
2545
2654
  | `readonly` | Component-wide: the control is `readonly` — shown, focusable, not editable. |
2546
- | `disabled` | Component-wide while the select is `disabled`; also per node, on `option`, its `item-*` parts and `check`: an option that is disabled. |
2655
+ | `disabled` | Component-wide while the select is `disabled`; also per node, on `option`, its `item-*` parts and `check`: an option that is disabled; on `groupHeader`: all its group's options are. |
2547
2656
  | `warnings` | Component-wide: the control is in its warning state (`warnings` / `has-warnings`) and not in an error state — errors win, so the two are never on together. |
2548
2657
  | `errors` | Component-wide: the control is in its error state (`errors` / `has-errors`, or its validation) — the message line and the box turn red. |
2549
2658
  | `open` | Component-wide: the options surface is showing. |
@@ -2563,25 +2672,26 @@ States are listed in precedence order: when two are on at once and their entries
2563
2672
  - `hide` — `(): void` — Emitted as soon as the options surface starts to close.
2564
2673
  - `inactive` — `(): void` — Emitted when focus moves outside the whole select after it was active.
2565
2674
  - `input` — `(event: Event): void` — Emitted on native `input` events from the search field. Forwards the DOM `Event`.
2566
- - `option:add` — `(text: string): void` — Emitted with the typed text when the user confirms a value that is not in the list (Enter in the search field). Binding it keeps the search field writable, which makes the select creatable.
2675
+ - `option:add` — `(text: string): void` — The typed text, when the user confirms a value not in the list (Enter in the search field). Binding it keeps the field writable: the select is creatable.
2567
2676
  - `show` — `(): void` — Emitted as soon as the options surface starts to open (the popover, or the sheet on a phone).
2568
2677
  - `shown` — `(): void` — Emitted once the options surface is open and its open transition has finished.
2569
2678
  - `update:modelValue` — `(value: any): void` — Emitted with the new value whenever `v-model` changes.
2570
2679
  - `update:open` — `(value: boolean): void` — The panel opened or closed (`v-model:open`).
2680
+ - `update:query` — `(value: string): void` — `v-model:query`: the search field's text.
2571
2681
 
2572
2682
  ## Slots
2573
2683
 
2574
2684
  - `append` — scope: `{ query: string; focus: () => void; close: () => Promise<void>; }` — Content appended inside the input field, after the value area.
2575
2685
  - `append:outer` — scope: `{ query: string; close: () => Promise<void>; }` — Content appended outside the input field wrapper.
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.
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`.
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.
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.
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.
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.
2686
+ - `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`, `item` is the known `{ value, label }` row (`known: true`) until the list brings the real one.
2687
+ - `description` — scope: `BbSelectDescriptionSlotProps` `{ text: string; hasErrors: boolean; hasWarnings: boolean }` — Replaces the description text; alone (no `description` prop) it still renders the region, wired into `aria-describedby`.
2688
+ - `empty` — scope: `{ query: string; focus: () => void; close: () => Promise<void>; }` — Shown when no option matches the query or the list is empty; a failed load shows the failure row instead (`failed-text`, "Try again"). `close()` closes the panel, for an action that keeps focus in it.
2689
+ - `footer` — scope: `BbSelectPanelSlotProps` `{ close: () => Promise<void>; clear: () => void; empty: boolean; focus: () => void; query: string; selectedOptions: BbSelectResolvedOption[] }` — Pinned under the options list, on the popover and the phone sheet alike.
2690
+ - `group` — scope: `BbSelectGroupSlotProps<T>` `{ text: string; item: T; index: number; length: number; disabled: boolean }` — Each group heading's content (`pt:group-header` styles its box). Not called for rows with no group (`group-by` gives `null`/`undefined`, known rows): they are listed without one.
2691
+ - `header` — scope: `BbSelectPanelSlotProps` `{ close: () => Promise<void>; clear: () => void; empty: boolean; focus: () => void; query: string; selectedOptions: BbSelectResolvedOption[] }` — Pinned atop the options panel, above the search field, on the popover and the phone sheet alike.
2582
2692
  - `label` — scope: `BbSelectLabelSlotProps` `{ showAsterisk?: boolean; text: string; hasErrors: boolean; hasWarnings: boolean }` — Replaces the default label text rendered above the input.
2583
2693
  - `loading` — scope: `{ query: string; }` — Content shown inside the options dropdown while items are loading.
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`.
2694
+ - `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`, 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`.
2585
2695
  - `prefix` — scope: `object` — Content rendered as an inline prefix inside the input field.
2586
2696
  - `prepend` — scope: `{ query: string; focus: () => void; close: () => Promise<void>; }` — Content prepended inside the input field, before the value area.
2587
2697
  - `prepend:outer` — scope: `{ query: string; close: () => Promise<void>; }` — Content prepended outside the input field wrapper.
@@ -2606,16 +2716,16 @@ Set these on the element, or on a class you put on it, to retune this component
2606
2716
  - **CSS custom properties** listed on a node are declared on THAT node's root and read by elements inside it. Set one on that node's root or on the element inside it that reads it — the pt part that lands there is how you reach it (`pt:box="[--border-color:…]"` on a text input) — never on `BbSelect`'s root, where the node's own declaration masks it (design-tokens guide, _Overriding one from a consumer app_, rule 0).
2607
2717
  - Listed nodes are the ones `BbSelect`'s API reaches or that declare a documented CSS variable; the rest fold into "also mounts". The complete tree, undocumented locals included, is `manifest/components/BbSelect.tree.json` (a public component in it is a name: its own tree file has the rest).
2608
2718
 
2609
- - `BbSelect` _(this component)_ — its own template binds: `badge` → `CommonField`, `activator` → `input.bb-select__activator`, `badge` → `input.bb-select__activator`, `comma` → `span.bb-select__comma`, `badge` → `span.bb-select__comma`, `badge` → `BbBadge`, `controlAttrs` → `input`, `badge` → `input`; hands `BbSelectPopover` the pt map `{ panel: 'panel', sheet: 'sheet', header: 'header', footer: 'footer', input: 'input', list: 'list', option: 'option', itemText: 'itemText', itemIcon: 'itemIcon', itemDescription: 'itemDescription', check: 'check' }` (ours → theirs)
2719
+ - `BbSelect` _(this component)_ — its own template binds: `badge` → `CommonField`, `activator` → `input.bb-select__activator`, `badge` → `input.bb-select__activator`, `comma` → `span.bb-select__comma`, `badge` → `span.bb-select__comma`, `badge` → `BbBadge`, `controlAttrs` → `input`, `badge` → `input`; hands `BbSelectPopover` the pt map `{ panel: 'panel', sheet: 'sheet', header: 'header', footer: 'footer', input: 'input', list: 'list', groupHeader: 'groupHeader', option: 'option', itemText: 'itemText', itemIcon: 'itemIcon', itemDescription: 'itemDescription', check: 'check' }` (ours → theirs)
2610
2720
  - `CommonField` _(internal — not importable, reach it through `BbSelect`)_ — `BbSelect`'s pt parts land here: `root` → `div.bb-field`, `label` → `component`, `description` → `span.bb-field__description`, `hint` → `span.bb-field__hint`, `counter` → `span.bb-field__counter`, `message` → `div.bb-field__message`; also mounts `BbAsterisk`
2611
2721
  - `CommonFieldInput` _(internal — not importable, reach it through `BbSelect`)_ — `BbSelect`'s pt parts land here: `box` → `span.bb-field-input__box`, `prefix` → `span.bb-field-input__prefix`, `icon` → `BbIcon`, `clear` → `ClearableButton`, `spinner` → `BbSpinner`, `suffix` → `span.bb-field-input__suffix`; documented CSS variables: `--bg`, `--bg-hover`, `--bg-focus`, `--bg-disabled`, `--fg-disabled`, `--border-color`, `--border-focus`, `--ring-size`, `--ring-color`, `--elev`, `--frost`, `--ph`, `--inside-label-clearance`; also mounts `BbIcon`, `BbSpinner`, `ErrorIcon`, `WarningIcon`, `ClearableButton`
2612
2722
  - `BbBadge` _(public — [contract](./BbBadge.md))_ — its own pt parts (`BbBadge`): `spinner` → `BbSpinner`, `icon` → `span.bb-badge__append-icon`, `icon` → `BbIcon`, `clear` → `button.bb-badge__clear`; documented CSS variables: `--bg`, `--fg`, `--bw`, `--ring-color`, `--ring-size`, `--min-size-md`, `--min-size`, `--elev`, `--r`, `--fs`, `--icon-size`, `--gap`, `--px`, `--clear-size`, `--bg-disabled`, `--fg-disabled`, `--border-disabled`, `--pad-left`; also mounts `BbIcon`, `BbSpinner`, `BadgeBodyContent`
2613
2723
  - `BbSelectPopover` _(public — [contract](./BbSelectPopover.md))_ — its own pt parts (`BbSelectPopover`): `input` → `input.bb-select-popover__input`, `clear` → `ClearableButton`, `panel` → `CommonPopover`, `root` → `CommonPopover`, `header` → `div.bb-select-popover__header`, `footer` → `div.bb-select-popover__footer`; hands `BbOffCanvas` the pt map `{ header: 'header', footer: 'footer', panel: 'root', sheet: 'root' }` (ours → theirs); also mounts `BbBadge`, `BbIcon`, `ClearableButton`, `CommonPopover`, `ErrorIcon`, `WarningIcon`, `BbSmoothHeight`
2614
2724
  - `BbOffCanvas` _(public — [contract](./BbOffCanvas.md))_ — its own pt parts (`BbOffCanvas`): `header` → `div.bb-offcanvas__header`, `title` → `span.bb-offcanvas__title`, `description` → `p.bb-offcanvas__description`, `close` → `CloseButton`, `content` → `div.bb-offcanvas__content`, `footer` → `div.bb-offcanvas__footer`; documented CSS variables: `--stack-x`, `--snap-y`, `--stack-fill`, `--stack-transition-duration`, `--px`, `--handle-w`, `--handle-h`, `--handle-bg`, `--safe-top`, `--close-size`
2615
- - `CloseButton` _(internal — not importable, reach it through `BbOffCanvas`)_ — documented CSS variables: `--size`, `--p`, `--icon-size`; also mounts `BbIcon`
2725
+ - `CloseButton` _(internal — not importable, reach it through `BbOffCanvas`)_ — documented CSS variables: `--size`, `--p`, `--icon-size`, `--icon-inset`; also mounts `BbIcon`
2616
2726
  - `ListBox` _(internal — not importable, reach it through `BbSelectPopover`)_
2617
2727
  - `FlatListBox` _(internal — not importable, reach it through `BbSelectPopover`)_ — its own pt parts (`BbSelectPopover`): `list` → `span.bb-listbox__list`, `option` → `span.bb-listbox__option`, `itemIcon` → `BbIcon`, `itemText` → `span.bb-listbox__item-text`, `itemDescription` → `span.bb-listbox__item-description`, `check` → `BbIcon`; also mounts `BbIcon`, `ErrorIcon`
2618
- - `GroupedListBox` _(internal — not importable, reach it through `BbSelectPopover`)_ — its own pt parts (`BbSelectPopover`): `list` → `span.bb-listbox__list`, `option` → `span.bb-listbox__option`, `itemIcon` → `BbIcon`, `itemText` → `span.bb-listbox__item-text`, `itemDescription` → `span.bb-listbox__item-description`, `check` → `BbIcon`; also mounts `BbIcon`, `ErrorIcon`
2728
+ - `GroupedListBox` _(internal — not importable, reach it through `BbSelectPopover`)_ — its own pt parts (`BbSelectPopover`): `list` → `span.bb-listbox__list`, `groupHeader` → `span.bb-listbox__group-header`, `option` → `span.bb-listbox__option`, `itemIcon` → `BbIcon`, `itemText` → `span.bb-listbox__item-text`, `itemDescription` → `span.bb-listbox__item-description`, `check` → `BbIcon`; also mounts `BbIcon`, `ErrorIcon`
2619
2729
 
2620
2730
  ## See Also
2621
2731