bitboss-ui 3.0.0-beta.70 → 3.0.0-beta.71

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 (123) hide show
  1. package/dist/ai/BbBreadcrumbs.md +3 -0
  2. package/dist/ai/BbCheckbox.md +5 -6
  3. package/dist/ai/BbCheckboxGroup.md +25 -26
  4. package/dist/ai/BbColorInput.md +3 -4
  5. package/dist/ai/BbDatePickerInput.md +3 -4
  6. package/dist/ai/BbDropdown.md +35 -1
  7. package/dist/ai/BbDropdownButton.md +4 -3
  8. package/dist/ai/BbNumberInput.md +3 -4
  9. package/dist/ai/BbRadio.md +5 -6
  10. package/dist/ai/BbRadioGroup.md +24 -30
  11. package/dist/ai/BbRating.md +3 -9
  12. package/dist/ai/BbSelect.md +10 -11
  13. package/dist/ai/BbSlider.md +3 -9
  14. package/dist/ai/BbSwitch.md +6 -6
  15. package/dist/ai/BbSwitchGroup.md +4 -7
  16. package/dist/ai/BbTag.md +3 -4
  17. package/dist/ai/BbTextInput.md +11 -11
  18. package/dist/ai/BbTextarea.md +8 -8
  19. package/dist/ai/BbTimePickerInput.md +3 -4
  20. package/dist/ai/BbTooltip.md +17 -13
  21. package/dist/ai/CommonField.md +2 -10
  22. package/dist/ai/OptionsContainer.md +5 -13
  23. package/dist/ai/changelog.json +44 -5
  24. package/dist/ai/components.json +26 -26
  25. package/dist/ai/guides/migration/v2-to-v3.md +26 -2
  26. package/dist/ai/guides/preset-components.md +35 -10
  27. package/dist/ai/helpers/definePreset.json +8 -1
  28. package/dist/ai/helpers/definePreset.ts +35 -10
  29. package/dist/ai/helpers/inertia/manifest.json +1 -1
  30. package/dist/ai/manifest/common.json +2 -2
  31. package/dist/ai/manifest/components/BbBreadcrumbs.json +1 -1
  32. package/dist/ai/manifest/components/BbCheckbox.json +2 -2
  33. package/dist/ai/manifest/components/BbCheckbox.tree.json +1 -1
  34. package/dist/ai/manifest/components/BbCheckboxGroup.tree.json +9 -19
  35. package/dist/ai/manifest/components/BbColorInput.json +2 -2
  36. package/dist/ai/manifest/components/BbColorInput.tree.json +1 -1
  37. package/dist/ai/manifest/components/BbDatePickerInput.tree.json +1 -1
  38. package/dist/ai/manifest/components/BbDropdown.json +2 -2
  39. package/dist/ai/manifest/components/BbDropdownButton.json +2 -2
  40. package/dist/ai/manifest/components/BbNumberInput.tree.json +1 -1
  41. package/dist/ai/manifest/components/BbRadio.tree.json +1 -1
  42. package/dist/ai/manifest/components/BbRadioGroup.tree.json +8 -18
  43. package/dist/ai/manifest/components/BbRating.tree.json +1 -1
  44. package/dist/ai/manifest/components/BbSelect.json +15 -15
  45. package/dist/ai/manifest/components/BbSelect.tree.json +1 -1
  46. package/dist/ai/manifest/components/BbSlider.tree.json +1 -1
  47. package/dist/ai/manifest/components/BbSwitch.tree.json +1 -1
  48. package/dist/ai/manifest/components/BbSwitchGroup.tree.json +2 -2
  49. package/dist/ai/manifest/components/BbTag.tree.json +1 -1
  50. package/dist/ai/manifest/components/BbTextInput.tree.json +1 -1
  51. package/dist/ai/manifest/components/BbTextarea.tree.json +1 -1
  52. package/dist/ai/manifest/components/BbTimePickerInput.tree.json +1 -1
  53. package/dist/ai/manifest/components/BbTooltip.json +1 -1
  54. package/dist/ai/manifest/components/BbTooltip.tree.json +2 -2
  55. package/dist/ai/manifest/components/CommonField.tree.json +5 -10
  56. package/dist/ai/manifest/components/OptionsContainer.tree.json +5 -13
  57. package/dist/ai/manifest/index.json +2 -2
  58. package/dist/ai/manifest/types.advanced.json +1 -1
  59. package/dist/ai/manifest/types.api.json +2 -2
  60. package/dist/ai/source/BbBreadcrumbs.md +31 -12
  61. package/dist/ai/source/BbCheckbox.md +36 -42
  62. package/dist/ai/source/BbCheckboxGroup.md +2 -4
  63. package/dist/ai/source/BbColorInput.md +2 -4
  64. package/dist/ai/source/BbDatePickerInput.md +2 -4
  65. package/dist/ai/source/BbDropdown.md +11 -2
  66. package/dist/ai/source/BbDropdownButton.md +4 -1
  67. package/dist/ai/source/BbDropdownGroup.md +9 -2
  68. package/dist/ai/source/BbNumberInput.md +2 -4
  69. package/dist/ai/source/BbRadio.md +36 -42
  70. package/dist/ai/source/BbRadioGroup.md +2 -4
  71. package/dist/ai/source/BbRating.md +2 -14
  72. package/dist/ai/source/BbSelect.md +30 -13
  73. package/dist/ai/source/BbSlider.md +2 -4
  74. package/dist/ai/source/BbSwitch.md +34 -38
  75. package/dist/ai/source/BbTable.md +4 -1
  76. package/dist/ai/source/BbTag.md +2 -4
  77. package/dist/ai/source/BbTextInput.md +2 -4
  78. package/dist/ai/source/BbTextarea.md +2 -4
  79. package/dist/ai/source/BbTimePickerInput.md +2 -4
  80. package/dist/ai/source/BbTooltip.md +9 -3
  81. package/dist/ai/source/CommonField.md +17 -106
  82. package/dist/ai/source/GuidesComponent.md +3 -0
  83. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +106 -106
  84. package/dist/components/BbBreadcrumbs/types.d.ts +6 -0
  85. package/dist/components/BbCheckbox/types.d.ts +2 -4
  86. package/dist/components/BbCheckboxGroup/types.d.ts +2 -4
  87. package/dist/components/BbColorInput/types.d.ts +2 -4
  88. package/dist/components/BbDatePickerInput/types.d.ts +2 -4
  89. package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +2 -0
  90. package/dist/components/BbDropdown/DropdownPipelineResolver.vue_vue_type_script_setup_true_lang.js +121 -120
  91. package/dist/components/BbDropdown/normalizeGroups.js +37 -33
  92. package/dist/components/BbDropdown/types.d.ts +9 -2
  93. package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +95 -94
  94. package/dist/components/BbNumberInput/types.d.ts +2 -4
  95. package/dist/components/BbRadio/types.d.ts +2 -4
  96. package/dist/components/BbRadioGroup/types.d.ts +2 -4
  97. package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +116 -118
  98. package/dist/components/BbRating/types.d.ts +2 -4
  99. package/dist/components/BbSelect/BbSelect.vue.d.ts +10 -4
  100. package/dist/components/BbSelect/types.d.ts +4 -6
  101. package/dist/components/BbSlider/types.d.ts +2 -4
  102. package/dist/components/BbTable/types.d.ts +1 -1
  103. package/dist/components/BbTag/types.d.ts +2 -4
  104. package/dist/components/BbTextInput/types.d.ts +2 -4
  105. package/dist/components/BbTextarea/types.d.ts +2 -4
  106. package/dist/components/BbTimePickerInput/types.d.ts +2 -4
  107. package/dist/components/BbTooltip/ptKeys.generated.d.ts +4 -4
  108. package/dist/components/BbTooltip/types.d.ts +3 -1
  109. package/dist/components/CommonField/types.d.ts +2 -4
  110. package/dist/composables/useChoiceIndicator.js +67 -64
  111. package/dist/directives/bbDropdown.js +1 -1
  112. package/dist/llms-full.txt +246 -201
  113. package/dist/styles.css +2 -2
  114. package/dist/types/FieldLayout.d.ts +4 -1
  115. package/dist/types/ItemAccessor.d.ts +3 -1
  116. package/dist/types/ItemPath.d.ts +33 -0
  117. package/dist/utils/versionCheck.js +1 -1
  118. package/package.json +6 -4
  119. package/scripts/README.md +31 -29
  120. package/scripts/lib/define-preset-copy.mjs +1 -1
  121. package/scripts/lib/setup.mjs +8 -0
  122. package/scripts/lib/toolchain-check.mjs +125 -7
  123. package/scripts/lib/validate-bb-markup.mjs +1 -1
@@ -31,7 +31,6 @@
31
31
  :reverse="configDefaults.reverse"
32
32
  :show-asterisk="showAsterisk"
33
33
  :show-hint="showHint"
34
- :style="rootStyle"
35
34
  tag="fieldset"
36
35
  :warnings="warnings"
37
36
  v-bind="passthrough.forwardAttrs"
@@ -440,15 +439,6 @@ const options = computed(() => {
440
439
  );
441
440
  });
442
441
 
443
- /**
444
- * The star size again on the field root, as `--star`: the label lines its
445
- * first line up with the stars from there, and the label cannot read
446
- * a variable declared further down, on `__stars`.
447
- */
448
- const rootStyle = computed(() =>
449
- parsedSize.value ? { '--star': parsedSize.value } : undefined
450
- );
451
-
452
442
  /** `--size` from the `size` prop, on the `__stars` span that declares it. */
453
443
  const starsStyle = computed(() => {
454
444
  const style: Record<string, string> = {};
@@ -608,15 +598,13 @@ export type BbRatingProps = BbRatingPtProps & {
608
598
 
609
599
  /**
610
600
  * Vertical position of the label block in a side-by-side row; not
611
- * `labelPosition`, the horizontal one. Omitted, the label's first line
612
- * meets the control's.
601
+ * `labelPosition`, the horizontal one. Omitted, `'top'`.
613
602
  */
614
603
  labelAlign?: FieldCrossAlign;
615
604
 
616
605
  /**
617
606
  * Vertical position of the control in a side-by-side row; not
618
- * `inputPosition`, the horizontal one. Omitted, the control's first line
619
- * meets the label's.
607
+ * `inputPosition`, the horizontal one. Omitted, `'top'`.
620
608
  */
621
609
  inputAlign?: FieldCrossAlign;
622
610
 
@@ -325,7 +325,13 @@
325
325
  <script
326
326
  setup
327
327
  lang="ts"
328
- generic="T = any, Known extends BbSelectKnownItems | undefined = undefined"
328
+ generic="
329
+ T = any,
330
+ Known extends BbSelectKnownItems | undefined = undefined,
331
+ A extends string | ((...args: never[]) => unknown) | undefined = undefined,
332
+ Tx extends string | undefined = undefined,
333
+ M extends boolean = false
334
+ "
329
335
  >
330
336
  import type { ControlAttrs, FallthroughAttrs } from '@/types/fallthrough';
331
337
  import { vAutofocus } from '@/utilities/misc/autofocus';
@@ -344,6 +350,13 @@ import CommonField from '../CommonField/CommonField.vue';
344
350
  import CommonFieldInput from '../CommonFieldInput/CommonFieldInput.vue';
345
351
  import BbBadge from '../BbBadge/BbBadge.vue';
346
352
  import BbSelectPopover from '../BbSelectPopover/BbSelectPopover.vue';
353
+ import type { ItemGetter } from '@/types/ItemAccessor';
354
+ import type {
355
+ ItemKeyInput,
356
+ MultipleInput,
357
+ OptionValueOf,
358
+ SelectModelOf,
359
+ } from '@/types/ItemPath';
347
360
  import {
348
361
  BB_SELECT_POPOVER_PT,
349
362
  type BbSelectKnownItems,
@@ -391,8 +404,12 @@ defineOptions({
391
404
  });
392
405
  const declaredProps = withDefaults(
393
406
  defineProps<
394
- BbSelectProps<T, Known> &
395
- /* @vue-ignore */ FallthroughAttrs<
407
+ BbSelectProps<T, Known> & /* @vue-ignore */ {
408
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- a getter returns any value; `A` reads which
409
+ itemValue?: ItemKeyInput<T, A> | ItemGetter<T, any>;
410
+ itemText?: ItemKeyInput<T, Tx> | ItemGetter<T, string>;
411
+ multiple?: MultipleInput<M>;
412
+ } & /* @vue-ignore */ FallthroughAttrs<
396
413
  'div',
397
414
  BbSelectProps<T, Known>,
398
415
  BbSelectEvents
@@ -432,7 +449,8 @@ const declaredProps = withDefaults(
432
449
  }
433
450
  );
434
451
 
435
- const declaredEmit = defineEmits<BbSelectEvents>();
452
+ const declaredEmit =
453
+ defineEmits<BbSelectEvents<SelectModelOf<OptionValueOf<T, A>, M>>>();
436
454
 
437
455
  defineSlots<BbSelectSlots<T, Known>>();
438
456
  // Inside a BbForm the field joins it: `props` / `emit` are bound.
@@ -640,9 +658,9 @@ const onChipUnselected = (option: BbSelectResolvedOption) => {
640
658
  knownItemsSource.userUnpick?.([option.value]);
641
659
  if (props.multiple) {
642
660
  const valueToEmit = reject(props.modelValue, option.value);
643
- emit('update:modelValue', valueToEmit);
661
+ emit('update:modelValue', valueToEmit as never);
644
662
  } else {
645
- emit('update:modelValue', null);
663
+ emit('update:modelValue', null as never);
646
664
  }
647
665
  };
648
666
 
@@ -1294,15 +1312,13 @@ export type BbSelectProps<
1294
1312
 
1295
1313
  /**
1296
1314
  * Vertical position of the label block in a side-by-side row; not
1297
- * `labelPosition`, the horizontal one. Omitted, the label's first line
1298
- * meets the control's.
1315
+ * `labelPosition`, the horizontal one. Omitted, `'top'`.
1299
1316
  */
1300
1317
  labelAlign?: FieldCrossAlign;
1301
1318
 
1302
1319
  /**
1303
1320
  * Vertical position of the control in a side-by-side row; not
1304
- * `inputPosition`, the horizontal one. Omitted, the control's first line
1305
- * meets the label's.
1321
+ * `inputPosition`, the horizontal one. Omitted, `'top'`.
1306
1322
  */
1307
1323
  inputAlign?: FieldCrossAlign;
1308
1324
 
@@ -1601,7 +1617,8 @@ export type BbSelectProps<
1601
1617
  } & FormFieldProps<any>;
1602
1618
 
1603
1619
  /** Re-export for consumers importing events type from BbSelect. */
1604
- export type BbSelectEvents = {
1620
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- untyped unless the component supplies the value
1621
+ export type BbSelectEvents<V = any> = {
1605
1622
  /** Emitted as soon as the options surface starts to open (the popover, or the sheet on a phone). */
1606
1623
  (e: 'show'): void;
1607
1624
  /** Emitted once the options surface is open and its open transition has finished. */
@@ -1624,8 +1641,8 @@ export type BbSelectEvents = {
1624
1641
  (e: 'inactive'): void;
1625
1642
  /** Emitted on native `input` events from the search field. Forwards the DOM `Event`. */
1626
1643
  (e: 'input', event: Event): void;
1627
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- an option's value is read through `item-value` (a key, a dot path or a function), which the select does not resolve at the type level: typing it per path is the nested-key cost the types avoid; `unknown` would reject a handler annotated `(id: number)`
1628
- (e: 'update:modelValue', value: any): void;
1644
+
1645
+ (e: 'update:modelValue', value: V): void;
1629
1646
  /**
1630
1647
  * Emitted with the typed text when the user confirms a value that is not in
1631
1648
  * the list (Enter in the search field). Binding it keeps the search field
@@ -1452,15 +1452,13 @@ export type BbSliderBaseProps = BbSliderPtProps & {
1452
1452
 
1453
1453
  /**
1454
1454
  * Vertical position of the label block in a side-by-side row; not
1455
- * `labelPosition`, the horizontal one. Omitted, the label's first line
1456
- * meets the control's.
1455
+ * `labelPosition`, the horizontal one. Omitted, `'top'`.
1457
1456
  */
1458
1457
  labelAlign?: FieldCrossAlign;
1459
1458
 
1460
1459
  /**
1461
1460
  * Vertical position of the control in a side-by-side row; not
1462
- * `inputPosition`, the horizontal one. Omitted, the control's first line
1463
- * meets the label's.
1461
+ * `inputPosition`, the horizontal one. Omitted, `'top'`.
1464
1462
  */
1465
1463
  inputAlign?: FieldCrossAlign;
1466
1464
 
@@ -452,54 +452,50 @@ export type BbSwitchSlots = {
452
452
  cursor: pointer;
453
453
 
454
454
  &--horizontal {
455
- align-items: center;
455
+ align-items: flex-start;
456
456
  display: flex;
457
457
  }
458
458
 
459
459
  /* A per-breakpoint `layout`, on its side-by-side tiers. */
460
460
  &--responsive {
461
- align-items: var(--ly-x, center);
461
+ align-items: var(--ly-x, flex-start);
462
462
  }
463
463
  }
464
464
 
465
- /* With a description the label block spans two lines: align the switch with
466
- the first line (the label text) instead of centering on the block. */
467
- &.bb-field--description {
468
- /* Only while neither `labelAlign` nor `inputAlign` is set:
469
- either prop aims the columns itself, and the pin would hold the
470
- control on the first line against it. */
471
- .bb-field__layout--horizontal:not(.bb-field__layout--aligned) {
472
- align-items: flex-start;
473
-
474
- /*
475
- * `align-items` + `min-height` are what pin the control to the
476
- * LABEL'S FIRST LINE instead of the block centre — measured: with a
477
- * 4-line label the control's mid sits exactly on the first line's
478
- * mid, and 28px above the block centre.
479
- *
480
- * There used to be a `display: inline-flex` here too, and it was
481
- * doing none of that vertical work — but it silently killed
482
- * `input-position`, whose only lever is `justify-items` (a grid
483
- * property, inert on a flex container). So a described row with
484
- * `input-position="right"` painted its control at the START of the
485
- * column: 166px out on a 198px column. Removing the one
486
- * declaration restores left/center/right and leaves the vertical
487
- * geometry byte-identical.
488
- */
489
- .bb-field__input-wrapper {
490
- align-items: center;
491
- min-height: var(--bb-label-lh);
492
- }
465
+ /* Side by side the switch centres on the label's FIRST line, described
466
+ or not: the label column itself
467
+ stays at the top of the row (in CommonField), and this pin
468
+ centres the glyph inside its own column on that first line. Only
469
+ while neither `labelAlign` nor `inputAlign` is set:
470
+ either prop aims the columns itself (`input-align="top"` is flush
471
+ with the top, `"center"` the middle of the label block). */
472
+ .bb-field__layout--horizontal:not(.bb-field__layout--aligned) {
473
+ /*
474
+ * `align-items` + `min-height` are what pin the control to the
475
+ * LABEL'S FIRST LINE instead of the block centre — measured: with a
476
+ * 4-line label the control's mid sits exactly on the first line's
477
+ * mid, and 28px above the block centre.
478
+ *
479
+ * There used to be a `display: inline-flex` here too, and it was
480
+ * doing none of that vertical work — but it silently killed
481
+ * `input-position`, whose only lever is `justify-items` (a grid
482
+ * property, inert on a flex container). So a described row with
483
+ * `input-position="right"` painted its control at the START of the
484
+ * column: 166px out on a 198px column. Removing the one
485
+ * declaration restores left/center/right and leaves the vertical
486
+ * geometry byte-identical.
487
+ */
488
+ .bb-field__input-wrapper {
489
+ align-items: center;
490
+ min-height: var(--bb-label-lh);
493
491
  }
492
+ }
494
493
 
495
- /* The same pin on a per-breakpoint `layout`'s side-by-side tiers. */
496
- .bb-field__layout--responsive:not(.bb-field__layout--aligned) {
497
- align-items: var(--ly-x, flex-start);
498
-
499
- .bb-field__input-wrapper {
500
- align-items: var(--ly-x, center);
501
- min-height: var(--ly-x, var(--bb-label-lh));
502
- }
494
+ /* The same pin on a per-breakpoint `layout`'s side-by-side tiers. */
495
+ .bb-field__layout--responsive:not(.bb-field__layout--aligned) {
496
+ .bb-field__input-wrapper {
497
+ align-items: var(--ly-x, center);
498
+ min-height: var(--ly-x, var(--bb-label-lh));
503
499
  }
504
500
  }
505
501
  }
@@ -7865,7 +7865,10 @@ import type { BbTablePtKeys } from './ptKeys.generated';
7865
7865
  * Recursively builds dot-notation paths from a type's keys.
7866
7866
  * Depth-limited to 3 levels to avoid compiler performance issues.
7867
7867
  */
7868
- type NestedPaths<T, Depth extends unknown[] = []> = Depth['length'] extends 3
7868
+ export type NestedPaths<
7869
+ T,
7870
+ Depth extends unknown[] = [],
7871
+ > = Depth['length'] extends 3
7869
7872
  ? never
7870
7873
  : 0 extends 1 & T
7871
7874
  ? string
@@ -892,15 +892,13 @@ export type BbTagProps = BbTagPtProps & {
892
892
 
893
893
  /**
894
894
  * Vertical position of the label block in a side-by-side row; not
895
- * `labelPosition`, the horizontal one. Omitted, the label's first line
896
- * meets the control's.
895
+ * `labelPosition`, the horizontal one. Omitted, `'top'`.
897
896
  */
898
897
  labelAlign?: FieldCrossAlign;
899
898
 
900
899
  /**
901
900
  * Vertical position of the control in a side-by-side row; not
902
- * `inputPosition`, the horizontal one. Omitted, the control's first line
903
- * meets the label's.
901
+ * `inputPosition`, the horizontal one. Omitted, `'top'`.
904
902
  */
905
903
  inputAlign?: FieldCrossAlign;
906
904
 
@@ -670,15 +670,13 @@ export type BbTextInputProps<E extends NullValuePolicy = AppPolicy> =
670
670
 
671
671
  /**
672
672
  * Vertical position of the label block in a side-by-side row; not
673
- * `labelPosition`, the horizontal one. Omitted, the label's first line
674
- * meets the control's.
673
+ * `labelPosition`, the horizontal one. Omitted, `'top'`.
675
674
  */
676
675
  labelAlign?: FieldCrossAlign;
677
676
 
678
677
  /**
679
678
  * Vertical position of the control in a side-by-side row; not
680
- * `inputPosition`, the horizontal one. Omitted, the control's first line
681
- * meets the label's.
679
+ * `inputPosition`, the horizontal one. Omitted, `'top'`.
682
680
  */
683
681
  inputAlign?: FieldCrossAlign;
684
682
 
@@ -621,15 +621,13 @@ export type BbTextareaProps<E extends NullValuePolicy = AppPolicy> =
621
621
 
622
622
  /**
623
623
  * Vertical position of the label block in a side-by-side row; not
624
- * `labelPosition`, the horizontal one. Omitted, the label's first line
625
- * meets the control's.
624
+ * `labelPosition`, the horizontal one. Omitted, `'top'`.
626
625
  */
627
626
  labelAlign?: FieldCrossAlign;
628
627
 
629
628
  /**
630
629
  * Vertical position of the control in a side-by-side row; not
631
- * `inputPosition`, the horizontal one. Omitted, the control's first line
632
- * meets the label's.
630
+ * `inputPosition`, the horizontal one. Omitted, `'top'`.
633
631
  */
634
632
  inputAlign?: FieldCrossAlign;
635
633
 
@@ -1529,15 +1529,13 @@ export type BbTimePickerInputBaseProps = BbTimePickerInputPtProps & {
1529
1529
 
1530
1530
  /**
1531
1531
  * Vertical position of the label block in a side-by-side row; not
1532
- * `labelPosition`, the horizontal one. Omitted, the label's first line
1533
- * meets the control's.
1532
+ * `labelPosition`, the horizontal one. Omitted, `'top'`.
1534
1533
  */
1535
1534
  labelAlign?: FieldCrossAlign;
1536
1535
 
1537
1536
  /**
1538
1537
  * Vertical position of the control in a side-by-side row; not
1539
- * `inputPosition`, the horizontal one. Omitted, the control's first line
1540
- * meets the label's.
1538
+ * `inputPosition`, the horizontal one. Omitted, `'top'`.
1541
1539
  */
1542
1540
  inputAlign?: FieldCrossAlign;
1543
1541
 
@@ -618,7 +618,9 @@ export type BbTooltipVariant = TooltipVariantType;
618
618
  *
619
619
  * @part root - The floating element, arrow included; a `class` on the
620
620
  * component lands here.
621
- * @part panel - The bubble that holds the text.
621
+ * @part panel - The text box inside the bubble: spacing and type. The
622
+ * bubble's and arrow's paint come from `--bg` / `--border-color` / `--fg`
623
+ * on root.
622
624
  */
623
625
  export type BbTooltipPtPart = 'root' | 'panel';
624
626
  /**
@@ -823,8 +825,8 @@ export type BbTooltipSlots = {
823
825
  * this root.
824
826
  */
825
827
  --max-w: 40ch;
826
- --px: 12px;
827
- --py: 6px;
828
+ --px: 8px;
829
+ --py: 2px;
828
830
 
829
831
  overflow: visible;
830
832
 
@@ -873,6 +875,10 @@ export type BbTooltipSlots = {
873
875
  ordinary prose still shrink-wraps to its natural width. */
874
876
  overflow-wrap: anywhere;
875
877
  padding: var(--py) var(--px);
878
+ /* Optical nudge: the text reads low in the bubble (font metrics are
879
+ bottom-heavy). The bubble paints the surface, so this moves only
880
+ the content, not the box or its layout. */
881
+ translate: 0 -1.5px;
876
882
  }
877
883
  }
878
884
  ```
@@ -351,8 +351,8 @@ const resolvedInputPosition = computed(
351
351
  /**
352
352
  * `labelAlign` / `inputAlign`, in effect only side by side: the
353
353
  * resolved layout is `vertical` for a floating / inside label too. An
354
- * unrecognized value is unset. Unset, the columns keep the first-line
355
- * offset.
354
+ * unrecognized value is unset. Unset, a column sits at the top of the
355
+ * row — the stylesheet's `flex-start`, no class needed.
356
356
  */
357
357
  const crossAlign = (value: string | undefined) =>
358
358
  // A map keeps them on every tier; its stacked tiers void them in CSS.
@@ -403,7 +403,7 @@ const containerAttributes = () => {
403
403
  // the axis, so it only ever sets it true).
404
404
  [`bb-field__layout--${layoutKeyword.value}`]: true,
405
405
  'bb-field__layout--reverse': props.reverse,
406
- // Either align prop set: both first-line offsets are off.
406
+ // Either align prop set (the unset columns stay at the top).
407
407
  'bb-field__layout--aligned': !!(
408
408
  resolvedLabelAlign.value || resolvedInputAlign.value
409
409
  ),
@@ -801,8 +801,7 @@ export type CommonFieldProps = {
801
801
 
802
802
  /**
803
803
  * Vertical position of the control in a side-by-side row; not
804
- * `inputPosition`, the horizontal one. Omitted, the control's first line
805
- * meets the label's.
804
+ * `inputPosition`, the horizontal one. Omitted, `'top'`.
806
805
  */
807
806
  inputAlign?: FieldCrossAlign;
808
807
 
@@ -822,8 +821,7 @@ export type CommonFieldProps = {
822
821
 
823
822
  /**
824
823
  * Vertical position of the label block in a side-by-side row; not
825
- * `labelPosition`, the horizontal one. Omitted, the label's first line
826
- * meets the control's.
824
+ * `labelPosition`, the horizontal one. Omitted, `'top'`.
827
825
  */
828
826
  labelAlign?: FieldCrossAlign;
829
827
 
@@ -1114,8 +1112,6 @@ export type CommonFieldSlots = {
1114
1112
  would reference this same property on the same element — a CSS custom-
1115
1113
  property cycle that resolves to invalid, silently killing the tweak. */
1116
1114
  --bb-label-spacing-y: var(--bb-label-spacing-y-compact);
1117
- /* the compact box's first line (see the first-line block). */
1118
- --ctrl-line: calc(var(--bb-input-h-compact) / 2);
1119
1115
  }
1120
1116
 
1121
1117
  &.bb-field--inside-label {
@@ -1391,96 +1387,27 @@ export type CommonFieldSlots = {
1391
1387
  }
1392
1388
 
1393
1389
  /*
1394
- * First-line alignment of side-by-side fields
1390
+ * Cross-axis alignment of side-by-side fields
1395
1391
  * -----------------------------------------------------------------
1396
- * In a side-by-side layout the label's FIRST line sits on the control's
1397
- * first line: the text line of a box, the glyph of a toggle, the first
1398
- * option of a group. Both sides are anchored to the top of the row, so a
1399
- * taller label column (a description, a wrapped label) never pulls the
1400
- * control down to its middle; then whichever side's first line is higher
1401
- * is pushed down by the difference.
1402
- *
1403
- * `--ctrl-line` is where the control's first line is centred, from the
1404
- * top of the control column: half the box height here, and each control
1405
- * whose first line sits elsewhere (a textarea, a toggle, a group, the
1406
- * stars) declares its own on the field root. The label's is half its
1407
- * line box, `--bb-label-lh`. All of it is tokens, so compact and a
1408
- * custom scale follow.
1392
+ * Both columns sit at the TOP of the row by default: the label's top
1393
+ * meets the control column's top, whatever the control (a box, a
1394
+ * toggle, the stars) and whatever the label line height. There is no
1395
+ * computed first-line offset between the columns (the old
1396
+ * `--ctrl-line` padding is gone); inside its own column a single
1397
+ * toggle still centres its glyph on the label's first line (its own
1398
+ * stylesheet), as a group row does. The only other alignments are
1399
+ * `labelAlign` / `inputAlign` `center` and `bottom`, aimed per column
1400
+ * below.
1409
1401
  */
1410
- /* Where the control's first line is centred, from the top of the control column (half the box height by default); the label's first line aligns to it in side-by-side layouts. */
1411
- --ctrl-line: calc(var(--bb-input-h) / 2);
1412
-
1413
- /* A textarea with fixed `rows`: the centre of its first text row, from the
1414
- shell's border and padding, the textarea's own top padding and the text
1415
- line box. Auto-grow centres its first line like an input: the default. */
1416
- &.bb-textarea:not(:has(.bb-textarea__field--auto-grow)) {
1417
- /* a + max(0, x) + c written as max(a + c, a + x + c): postcss-calc 10
1418
- (inside Nuxt's cssnano) cannot parse max() within calc(). */
1419
- --ctrl-line: max(
1420
- calc(var(--bb-border-w) + var(--bb-input-py) + var(--bb-leading) / 2),
1421
- calc(
1422
- var(--bb-border-w) + var(--bb-input-py) +
1423
- (var(--bb-input-h) - var(--bb-input-fs) * 2.35) / 2 +
1424
- var(--bb-leading) / 2
1425
- )
1426
- );
1427
-
1428
- &.bb-field--compact {
1429
- --ctrl-line: max(
1430
- calc(
1431
- var(--bb-border-w) + var(--bb-input-py-compact) + var(--bb-leading) /
1432
- 2
1433
- ),
1434
- calc(
1435
- var(--bb-border-w) + var(--bb-input-py-compact) +
1436
- (var(--bb-input-h) - var(--bb-input-fs) * 2.35) / 2 +
1437
- var(--bb-leading) / 2
1438
- )
1439
- );
1440
- }
1441
- }
1442
-
1443
- /* A single toggle: the centre of its glyph (16px box, 18px switch track). */
1444
- &:is(.bb-checkbox, .bb-radio) {
1445
- --ctrl-line: 8px;
1446
- }
1447
-
1448
- &.bb-switch {
1449
- --ctrl-line: 9px;
1450
- }
1451
-
1452
- /* A group: its first option row shares the legend's line box, so the two
1453
- first lines coincide with no offset on either side. */
1454
- &:is(.bb-checkbox-group, .bb-radio-group, .bb-switch-group) {
1455
- --ctrl-line: calc(var(--bb-label-lh) / 2);
1456
- }
1457
-
1458
- /* The stars: half a star, below the star row's 2px top inset. `--star` is
1459
- the `size` prop, published on the root by BbRating (24px by default). */
1460
- &.bb-rating {
1461
- --ctrl-line: calc(var(--star, 24px) / 2 + 2px);
1462
- }
1463
1402
 
1464
1403
  &:not(.bb-field--floating-label, .bb-field--inside-label)
1465
1404
  .bb-field__layout--horizontal {
1466
1405
  align-items: flex-start;
1467
1406
 
1468
- /* The first-line offset, while neither `labelAlign` nor `inputAlign`
1469
- is set: either one turns it off on both columns (a leftover pad
1470
- would make the row taller than its text and drop a centre). */
1471
- &:not(.bb-field__layout--aligned) {
1472
- > .bb-field__label {
1473
- padding-top: max(0px, calc(var(--ctrl-line) - var(--bb-label-lh) / 2));
1474
- }
1475
-
1476
- > .bb-field__input-wrapper {
1477
- padding-top: max(0px, calc(var(--bb-label-lh) / 2 - var(--ctrl-line)));
1478
- }
1479
- }
1480
-
1481
1407
  /* a column aimed on the cross axis. Only the shorter one
1482
1408
  visibly moves; the taller one sets the row's height. The unset
1483
- column stays on the row's `flex-start`. */
1409
+ column stays on the row's `flex-start`: `top`, the default.
1410
+ */
1484
1411
  > .bb-field__label--align-top,
1485
1412
  > .bb-field__input-wrapper--align-top {
1486
1413
  align-self: flex-start;
@@ -1504,22 +1431,6 @@ export type CommonFieldSlots = {
1504
1431
  .bb-field__layout--responsive {
1505
1432
  align-items: var(--ly-x, flex-start);
1506
1433
 
1507
- &:not(.bb-field__layout--aligned) {
1508
- > .bb-field__label {
1509
- padding-top: var(
1510
- --ly-x,
1511
- max(0px, calc(var(--ctrl-line) - var(--bb-label-lh) / 2))
1512
- );
1513
- }
1514
-
1515
- > .bb-field__input-wrapper {
1516
- padding-top: var(
1517
- --ly-x,
1518
- max(0px, calc(var(--bb-label-lh) / 2 - var(--ctrl-line)))
1519
- );
1520
- }
1521
- }
1522
-
1523
1434
  > .bb-field__label--align-top,
1524
1435
  > .bb-field__input-wrapper--align-top {
1525
1436
  align-self: var(--ly-x, flex-start);
@@ -373,6 +373,9 @@ watch(selectedExamplePath, (examplePath) => {
373
373
  background: var(--bb-panel);
374
374
  border: var(--bb-border-w) solid var(--bb-border);
375
375
  border-radius: var(--bb-radius-surface);
376
+ /* The preview box is the example's page: a `bleed` carousel runs to the
377
+ edges of what clips it, so clip here or it spills over the source. */
378
+ overflow: clip;
376
379
  }
377
380
 
378
381
  .guides-component__source {