@bridge-ui/vue 0.7.0 → 0.8.0

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 (82) hide show
  1. package/ai/skills/bridge-ui-forms/SKILL.md +1 -1
  2. package/dist/Components/Alert/Alert.vue_vue_type_script_setup_true_lang.js +13 -13
  3. package/dist/Components/Alert/alert.types.d.ts +7 -4
  4. package/dist/Components/Alert/composables/useAlert.d.ts +1 -0
  5. package/dist/Components/Alert/composables/useAlert.js +60 -57
  6. package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +1 -1
  7. package/dist/Components/Autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js +1 -0
  8. package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +4 -2
  9. package/dist/Components/BaseField/BaseField.vue_vue_type_script_setup_true_lang.js +9 -9
  10. package/dist/Components/BaseField/baseField.types.d.ts +15 -4
  11. package/dist/Components/BaseField/composables/useBaseField.d.ts +6 -2
  12. package/dist/Components/BaseField/composables/useBaseField.js +67 -67
  13. package/dist/Components/Button/Button.vue_vue_type_script_setup_true_lang.js +24 -25
  14. package/dist/Components/Button/composables/useButton.d.ts +3 -1
  15. package/dist/Components/Button/composables/useButton.js +46 -40
  16. package/dist/Components/Calendar/composables/useCalendar.d.ts +1 -1
  17. package/dist/Components/CalendarDate/composables/useCalendarDate.d.ts +1 -1
  18. package/dist/Components/CalendarMonth/composables/useCalendarMonth.d.ts +1 -1
  19. package/dist/Components/CalendarRange/composables/useCalendarRange.d.ts +1 -1
  20. package/dist/Components/CalendarYear/composables/useCalendarYear.d.ts +1 -1
  21. package/dist/Components/ColorField/ColorField.vue.d.ts +1 -1
  22. package/dist/Components/ColorField/ColorField.vue_vue_type_script_setup_true_lang.js +1 -0
  23. package/dist/Components/ColorField/composables/useColorField.d.ts +5 -3
  24. package/dist/Components/ColorPicker/composables/useColorPicker.d.ts +1 -1
  25. package/dist/Components/DataTable/composables/useDataTable.d.ts +1 -1
  26. package/dist/Components/DateField/DateField.vue_vue_type_script_setup_true_lang.js +1 -0
  27. package/dist/Components/DateField/composables/useDateField.d.ts +5 -3
  28. package/dist/Components/DatePicker/composables/useDatePicker.d.ts +1 -1
  29. package/dist/Components/DateRangeField/DateRangeField.vue_vue_type_script_setup_true_lang.js +1 -0
  30. package/dist/Components/DateRangeField/composables/useDateRangeField.d.ts +5 -3
  31. package/dist/Components/DateRangePicker/composables/useDateRangePicker.d.ts +1 -1
  32. package/dist/Components/DateTimeField/DateTimeField.vue_vue_type_script_setup_true_lang.js +1 -0
  33. package/dist/Components/DateTimeField/composables/useDateTimeField.d.ts +5 -3
  34. package/dist/Components/DateTimePicker/composables/useDateTimePicker.d.ts +1 -1
  35. package/dist/Components/DateTimeRangeField/DateTimeRangeField.vue_vue_type_script_setup_true_lang.js +1 -0
  36. package/dist/Components/DateTimeRangeField/composables/useDateTimeRangeField.d.ts +5 -3
  37. package/dist/Components/DateTimeRangePicker/composables/useDateTimeRangePicker.d.ts +1 -1
  38. package/dist/Components/FormControl/composables/useFormControl.d.ts +3 -1
  39. package/dist/Components/FormControl/composables/useFormControl.js +39 -38
  40. package/dist/Components/FormField/FilledFormField.vue_vue_type_script_setup_true_lang.js +3 -3
  41. package/dist/Components/FormField/NotchedFormField.vue_vue_type_script_setup_true_lang.js +31 -31
  42. package/dist/Components/FormField/OutlinedFormField.vue_vue_type_script_setup_true_lang.js +3 -3
  43. package/dist/Components/FormField/StackedFormField.vue_vue_type_script_setup_true_lang.js +34 -34
  44. package/dist/Components/FormField/UnderlinedFormField.vue_vue_type_script_setup_true_lang.js +3 -3
  45. package/dist/Components/FormField/composables/useFormField.d.ts +7 -3
  46. package/dist/Components/FormField/composables/useFormField.js +148 -144
  47. package/dist/Components/FormField/formField.types.d.ts +14 -4
  48. package/dist/Components/Listbox/Listbox.vue.d.ts +1 -1
  49. package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +1 -0
  50. package/dist/Components/NumberField/composables/useNumberField.d.ts +4 -2
  51. package/dist/Components/OtpField/OtpField.vue.d.ts +1 -8
  52. package/dist/Components/OtpField/OtpField.vue_vue_type_script_setup_true_lang.js +7 -6
  53. package/dist/Components/OtpField/composables/useOtpField.d.ts +3 -1
  54. package/dist/Components/PasswordField/PasswordField.vue_vue_type_script_setup_true_lang.js +1 -0
  55. package/dist/Components/PasswordField/composables/usePasswordField.d.ts +4 -2
  56. package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +1 -0
  57. package/dist/Components/Select/composables/useSelect.d.ts +4 -2
  58. package/dist/Components/Sidebar/composables/useSidebarList.js +1 -1
  59. package/dist/Components/Sidebar/composables/useSidebarShell.js +1 -1
  60. package/dist/Components/Slider/Slider.vue_vue_type_script_setup_true_lang.js +1 -0
  61. package/dist/Components/Slider/composables/useSlider.d.ts +4 -2
  62. package/dist/Components/TextField/TextField.vue_vue_type_script_setup_true_lang.js +1 -0
  63. package/dist/Components/TextField/composables/useTextField.d.ts +4 -2
  64. package/dist/Components/Textarea/Textarea.vue_vue_type_script_setup_true_lang.js +1 -0
  65. package/dist/Components/Textarea/composables/useTextarea.d.ts +4 -2
  66. package/dist/Components/TimeField/TimeField.vue_vue_type_script_setup_true_lang.js +1 -0
  67. package/dist/Components/TimeField/composables/useTimeField.d.ts +5 -3
  68. package/dist/Components/TimePanel/composables/useTimePanel.d.ts +1 -1
  69. package/dist/Components/TimePicker/composables/useTimePicker.d.ts +1 -1
  70. package/dist/Components/TimeRangeField/TimeRangeField.vue_vue_type_script_setup_true_lang.js +1 -0
  71. package/dist/Components/TimeRangeField/composables/useTimeRangeField.d.ts +5 -3
  72. package/dist/Components/TimeRangePicker/composables/useTimeRangePicker.d.ts +1 -1
  73. package/dist/Components/Tooltip/composables/useTooltip.d.ts +1 -1
  74. package/dist/Utils/index.d.ts +11 -2
  75. package/dist/Utils/index.js +31 -27
  76. package/dist/augments.d.ts +8 -8
  77. package/docs/components/Alert.md +4 -2
  78. package/docs/components/BaseField.md +19 -18
  79. package/docs/components/BridgeUIProvider.md +14 -7
  80. package/docs/components/FormControl.md +1 -1
  81. package/docs/components/FormField.md +28 -27
  82. package/package.json +2 -2
@@ -45,4 +45,4 @@ Controlled fields: **`v-model` / `modelValue`**. Never React `value`/`onChange`.
45
45
  1. Map validation to `error`, `error-message`, `description`, `disabled`, `readOnly`.
46
46
  2. Native input attrs often go through `:custom-props` → `input` — see TextField docs.
47
47
  3. Use only documented option shapes for Select/Autocomplete.
48
- 4. Prefer public fields/controls in apps. `FormField`, `FormControl`, and `BaseField` are exported building blocks for advanced composition they are **not** registry keys. Theme via the public parent (`components.TextField`, `tokens.baseField`, `tokens.formControl`). Dropdown tokens live on `components.Listbox`. Shared form density: `global.formDefaults: { size, rounded }` (Radio/Switch ignore `rounded`).
48
+ 4. Prefer public fields/controls in apps. `FormField`, `FormControl`, and `BaseField` are exported building blocks for advanced composition. Theme shared chrome via `components.FormField` / `FormControl` / `BaseField` (a public entry such as `components.TextField` still overrides `defaultProps`). Chrome tokens live on those shared keys. Dropdown tokens live on `components.Listbox`. Time overlay chrome: `components.TimePanel` (`TimePicker` / `TimeRangePicker` override). Shared form density: `global.formDefaults: { size, rounded }` (Radio/Switch/BaseField/FormControl ignore `rounded`).
@@ -1,12 +1,12 @@
1
- import { hasNamedSlot as e, hasSlotOrProp as t, isPropPresent as n } from "../../Utils/slotOrProp.js";
2
- import r from "../Icon/Icon.js";
3
- import { useAlert as i } from "./composables/useAlert.js";
4
- import { Fragment as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, defineComponent as d, guardReactiveProps as f, mergeProps as p, normalizeProps as m, openBlock as h, renderSlot as g, toDisplayString as _, unref as v } from "vue";
1
+ import { hasNamedSlot as e, isPropPresent as t } from "../../Utils/slotOrProp.js";
2
+ import n from "../Icon/Icon.js";
3
+ import { useAlert as r } from "./composables/useAlert.js";
4
+ import { Fragment as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, defineComponent as u, guardReactiveProps as d, mergeProps as f, normalizeProps as p, openBlock as m, renderSlot as h, toDisplayString as g, unref as _ } from "vue";
5
5
  //#region src/Components/Alert/Alert.vue?vue&type=script&setup=true&lang.ts
6
- var y = {
6
+ var v = {
7
7
  key: 1,
8
8
  class: "flex justify-between items-start"
9
- }, b = { class: "flex items-start gap-x-3" }, x = /*@__PURE__*/ d({
9
+ }, y = { class: "flex items-start gap-x-3" }, b = /*@__PURE__*/ u({
10
10
  inheritAttrs: !1,
11
11
  __name: "Alert",
12
12
  props: {
@@ -20,20 +20,20 @@ var y = {
20
20
  title: {},
21
21
  variant: {}
22
22
  },
23
- setup(d) {
24
- let { slots: x, merged: S, bodyBind: C, iconBind: w, rootBind: T, titleBind: E, resolvedIcon: D, hasDefaultBody: O } = i(d, {
23
+ setup(u) {
24
+ let { slots: b, merged: x, bodyBind: S, iconBind: C, rootBind: w, hasTitle: T, titleBind: E, resolvedIcon: D, hasDefaultBody: O } = r(u, {
25
25
  shadow: "sm",
26
26
  rounded: "sm",
27
27
  variant: "flat",
28
28
  color: "primary",
29
29
  padding: "medium"
30
30
  });
31
- return (i, d) => (h(), c("div", m(f(v(T))), [
32
- v(e)(v(x), "header") ? g(i.$slots, "header", {}, void 0, void 0, 0) : v(t)(v(x), "title", v(S).title) ? (h(), c("div", y, [l("div", b, [v(e)(v(x), "icon") ? g(i.$slots, "icon", {}, void 0, void 0, 0) : v(D) ? (h(), o(r, p({ key: 1 }, v(w), { icon: v(D) }), null, 16, ["icon"])) : s("", !0), l("div", m(f(v(E))), [v(e)(v(x), "title") ? g(i.$slots, "title", {}, void 0, void 0, 0) : v(n)(v(S).title) ? (h(), c(a, { key: 1 }, [u(_(v(S).title), 1)], 64)) : s("", !0)], 16)]), g(i.$slots, "action")])) : s("", !0),
33
- v(O) ? (h(), c("div", m(p({ key: 2 }, v(C))), [g(i.$slots, "default")], 16)) : s("", !0),
34
- g(i.$slots, "footer")
31
+ return (r, u) => (m(), s("div", p(d(_(w))), [
32
+ _(e)(_(b), "header") ? h(r.$slots, "header", {}, void 0, void 0, 0) : _(T) ? (m(), s("div", v, [c("div", y, [_(e)(_(b), "icon") ? h(r.$slots, "icon", {}, void 0, void 0, 0) : _(D) ? (m(), a(n, f({ key: 1 }, _(C), { icon: _(D) }), null, 16, ["icon"])) : o("", !0), c("div", p(d(_(E))), [_(e)(_(b), "title") ? h(r.$slots, "title", {}, void 0, void 0, 0) : _(t)(_(x).title) ? (m(), s(i, { key: 1 }, [l(g(_(x).title), 1)], 64)) : h(r.$slots, "default", {}, void 0, void 0, 2)], 16)]), h(r.$slots, "action")])) : o("", !0),
33
+ _(O) ? (m(), s("div", p(f({ key: 2 }, _(S))), [h(r.$slots, "default")], 16)) : o("", !0),
34
+ h(r.$slots, "footer")
35
35
  ], 16));
36
36
  }
37
37
  });
38
38
  //#endregion
39
- export { x as default };
39
+ export { b as default };
@@ -76,7 +76,7 @@ export interface AlertOwnProps {
76
76
  */
77
77
  icon?: null | IconSource;
78
78
  /**
79
- * The padding to apply to the alert.
79
+ * Root padding scale. Each token also sets body indent under the title row.
80
80
  *
81
81
  * @default "medium"
82
82
  */
@@ -94,7 +94,8 @@ export interface AlertOwnProps {
94
94
  */
95
95
  shadow?: MergeProps<AlertShadow, AlertShadowOverrides>;
96
96
  /**
97
- * The title to apply to the alert.
97
+ * Title in the heading row. When omitted, the default slot is used as the
98
+ * title.
98
99
  *
99
100
  * @default undefined
100
101
  */
@@ -112,7 +113,8 @@ export interface AlertSlots {
112
113
  */
113
114
  action?: Slot<undefined>;
114
115
  /**
115
- * Main body text below the title row.
116
+ * Body below the title row. Used as the title when `title` and the `title`
117
+ * slot are omitted.
116
118
  */
117
119
  default?: Slot<undefined>;
118
120
  /**
@@ -128,7 +130,8 @@ export interface AlertSlots {
128
130
  */
129
131
  icon?: Slot<undefined>;
130
132
  /**
131
- * The title of the alert.
133
+ * Title in the heading row. Takes precedence over the `title` prop and the
134
+ * default slot.
132
135
  */
133
136
  title?: Slot<undefined>;
134
137
  }
@@ -11,6 +11,7 @@ export declare function useAlert(props: AlertOwnProps, libDefaults: AlertLibDefa
11
11
  bodyBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
12
12
  iconBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", Partial<Omit<import('../../Icon').IconProps, "icon">> | undefined, {}>>;
13
13
  rootBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, Omit<AlertProps, "color" | "icon" | "classes" | "customProps" | "title" | "padding" | "rounded" | "shadow" | "variant">>>;
14
+ hasTitle: import('vue').ComputedRef<boolean>;
14
15
  titleBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
15
16
  resolvedIcon: import('vue').ComputedRef<IconSource | null>;
16
17
  hasDefaultBody: import('vue').ComputedRef<boolean>;
@@ -1,11 +1,12 @@
1
- import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
2
- import { alertDefaultIcons as r } from "../alertDefaultIcons.js";
3
- import { computed as i, useAttrs as a, useSlots as o } from "vue";
4
- import { get as s, isNull as c } from "es-toolkit/compat";
5
- import { alertPaddingProps as l, alertRoundedProps as u, alertShadowProps as d, alertVariantProps as f } from "@bridge-ui/core/Tokens";
6
- import { cn as p, mergeBridgeUILayeredClasses as m, splitComponentProps as h } from "@bridge-ui/core/Utils";
1
+ import { hasNamedSlot as e, hasSlotOrProp as t } from "../../../Utils/slotOrProp.js";
2
+ import { mergePartBind as n, useBridgeUIComponent as r, useBridgeUIMergedRegistryClasses as i } from "../../../Utils/index.js";
3
+ import { alertDefaultIcons as a } from "../alertDefaultIcons.js";
4
+ import { computed as o, useAttrs as s, useSlots as c } from "vue";
5
+ import { get as l, isNull as u } from "es-toolkit/compat";
6
+ import { alertPaddingProps as d, alertRoundedProps as f, alertShadowProps as p, alertVariantProps as m } from "@bridge-ui/core/Tokens";
7
+ import { cn as h, mergeBridgeUILayeredClasses as g, splitComponentProps as _ } from "@bridge-ui/core/Utils";
7
8
  //#region src/Components/Alert/composables/useAlert.ts
8
- var g = [
9
+ var v = [
9
10
  "icon",
10
11
  "color",
11
12
  "title",
@@ -16,68 +17,70 @@ var g = [
16
17
  "variant",
17
18
  "customProps"
18
19
  ];
19
- function _(_, v) {
20
- let y = a(), b = o(), x = i(() => h({
21
- bridgeKeys: g,
20
+ function y(y, b) {
21
+ let x = s(), S = c(), C = o(() => _({
22
+ bridgeKeys: v,
22
23
  props: {
23
- ...y,
24
- ..._
24
+ ...x,
25
+ ...y
25
26
  }
26
- })), { merged: S, entry: C } = t({
27
- libDefaults: v,
27
+ })), { merged: w, entry: T } = r({
28
+ libDefaults: b,
28
29
  componentName: "Alert",
29
- props: () => x.value.componentProps
30
- }), w = i(() => S.value.customProps), T = n({
31
- entry: C,
32
- props: () => x.value.componentProps
33
- }), E = i(() => {
34
- let e = b.default?.();
30
+ props: () => C.value.componentProps
31
+ }), E = o(() => w.value.customProps), D = i({
32
+ entry: T,
33
+ props: () => C.value.componentProps
34
+ }), O = o(() => t(S, "title", w.value.title)), k = o(() => {
35
+ let e = S.default?.();
35
36
  return !!(e && e.length > 0);
36
- }), D = i(() => {
37
- let e = m(f, C.value?.tokens?.variant);
38
- return s(e, [S.value.variant, S.value.color]);
39
- }), O = i(() => {
40
- let e = m(d, C.value?.tokens?.shadow);
41
- return s(e, S.value.shadow);
42
- }), k = i(() => {
43
- let e = m(l, C.value?.tokens?.padding);
44
- return s(e, S.value.padding);
45
- }), A = i(() => {
46
- let e = m(u, C.value?.tokens?.rounded);
47
- return s(e, S.value.rounded);
48
- }), j = i(() => c(S.value.icon) ? null : S.value.icon ? S.value.icon : s(D.value, "icon") ?? s(r, S.value.color));
37
+ }), A = o(() => !e(S, "header") && (k.value || O.value)), j = o(() => k.value && (O.value || e(S, "header"))), M = o(() => {
38
+ let e = g(m, T.value?.tokens?.variant);
39
+ return l(e, [w.value.variant, w.value.color]);
40
+ }), N = o(() => {
41
+ let e = g(p, T.value?.tokens?.shadow);
42
+ return l(e, w.value.shadow);
43
+ }), P = o(() => {
44
+ let e = g(d, T.value?.tokens?.padding);
45
+ return l(e, w.value.padding);
46
+ }), F = o(() => {
47
+ let e = g(f, T.value?.tokens?.rounded);
48
+ return l(e, w.value.rounded);
49
+ }), I = o(() => u(w.value.icon) ? null : w.value.icon ? w.value.icon : l(M.value, "icon") ?? l(a, w.value.color));
49
50
  return {
50
- slots: b,
51
- merged: S,
52
- bodyBind: i(() => e(w.value?.body, {}, p({
51
+ slots: S,
52
+ merged: w,
53
+ bodyBind: o(() => n(E.value?.body, {}, h({
53
54
  "grow text-sm text-start": !0,
54
- [k.value ?? ""]: !0,
55
- [s(D.value, "text") ?? ""]: !0,
56
- [s(T.value, "body") ?? ""]: !0
55
+ [l(P.value, "body") ?? ""]: !0,
56
+ [l(M.value, "text") ?? ""]: !0,
57
+ [l(D.value, "body") ?? ""]: !0
57
58
  }))),
58
- iconBind: i(() => e(w.value?.icon, {}, p({
59
+ iconBind: o(() => n(E.value?.icon, {}, h({
59
60
  "w-5 h-5 shrink-0": !0,
60
- [s(D.value, "iconColor") ?? ""]: !0,
61
- [s(T.value, "icon") ?? ""]: !0
61
+ [l(M.value, "iconColor") ?? ""]: !0,
62
+ [l(D.value, "icon") ?? ""]: !0
62
63
  }))),
63
- rootBind: i(() => e(w.value?.root, x.value.inheritedAttrs, p({
64
- "w-full flex flex-col p-4": !0,
65
- [O.value ?? ""]: !0,
66
- [A.value ?? ""]: !0,
67
- [s(D.value, "border") ?? ""]: !0,
68
- [s(D.value, "background") ?? ""]: !0,
69
- [s(T.value, "root") ?? ""]: !0
64
+ rootBind: o(() => n(E.value?.root, C.value.inheritedAttrs, h({
65
+ "w-full flex flex-col": !0,
66
+ [l(P.value, "root") ?? ""]: !0,
67
+ [N.value ?? ""]: !0,
68
+ [F.value ?? ""]: !0,
69
+ [l(M.value, "border") ?? ""]: !0,
70
+ [l(M.value, "background") ?? ""]: !0,
71
+ [l(D.value, "root") ?? ""]: !0
70
72
  }))),
71
- titleBind: i(() => e(w.value?.title, {}, p({
73
+ hasTitle: A,
74
+ titleBind: o(() => n(E.value?.title, {}, h({
72
75
  "text-start text-sm whitespace-normal": !0,
73
- "font-normal": !E.value,
74
- "font-semibold": E.value,
75
- [s(D.value, "text") ?? ""]: !0,
76
- [s(T.value, "title") ?? ""]: !0
76
+ "font-normal": !j.value,
77
+ "font-semibold": j.value,
78
+ [l(M.value, "text") ?? ""]: !0,
79
+ [l(D.value, "title") ?? ""]: !0
77
80
  }))),
78
- resolvedIcon: j,
79
- hasDefaultBody: E
81
+ resolvedIcon: I,
82
+ hasDefaultBody: j
80
83
  };
81
84
  }
82
85
  //#endregion
83
- export { _ as useAlert };
86
+ export { y as useAlert };
@@ -31,9 +31,9 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {
31
31
  showFooter: boolean;
32
32
  showErrorIcon: boolean;
33
33
  clearable: boolean;
34
- freeSolo: boolean;
35
34
  minItemsForSearch: number;
36
35
  searchable: boolean;
36
+ freeSolo: boolean;
37
37
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
38
38
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
39
39
  declare const _default: typeof __VLS_export;
@@ -76,6 +76,7 @@ var N = {
76
76
  readonly: { type: Boolean },
77
77
  required: { type: Boolean },
78
78
  rounded: {},
79
+ showDescriptionOnError: { type: Boolean },
79
80
  showErrorIcon: {
80
81
  type: Boolean,
81
82
  default: !0
@@ -436,7 +436,7 @@ export declare function useAutocomplete(props: AutocompleteOwnProps, model: Ref<
436
436
  onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
437
437
  onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
438
438
  onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
439
- }, Partial<Omit<Omit<FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showErrorIcon" | "startIcon">>>>;
439
+ }, Partial<Omit<Omit<FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showDescriptionOnError" | "showErrorIcon" | "startIcon">>>>;
440
440
  isNotched: import('vue').ComputedRef<boolean>;
441
441
  isStacked: import('vue').ComputedRef<boolean>;
442
442
  startBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
@@ -461,6 +461,8 @@ export declare function useAutocomplete(props: AutocompleteOwnProps, model: Ref<
461
461
  hasInsetLabelRow: import('vue').ComputedRef<boolean>;
462
462
  insetLabelRowBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
463
463
  stackedInputRowBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", {}, {}>>;
464
+ showErrorMessageRow: import('vue').ComputedRef<boolean>;
465
+ showDescriptionContent: import('vue').ComputedRef<boolean>;
464
466
  showErrorMessageContent: import('vue').ComputedRef<boolean>;
465
467
  reservesErrorMessageSpace: import('vue').ComputedRef<boolean>;
466
468
  };
@@ -720,7 +722,7 @@ export declare function useAutocomplete(props: AutocompleteOwnProps, model: Ref<
720
722
  onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
721
723
  onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
722
724
  onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
723
- }, Partial<Omit<Omit<FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showErrorIcon" | "startIcon">>>>>;
725
+ }, Partial<Omit<Omit<FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showDescriptionOnError" | "showErrorIcon" | "startIcon">>>>>;
724
726
  handleApply: () => void;
725
727
  selectOption: (option: SelectOption) => void;
726
728
  handleCancel: () => void;
@@ -19,30 +19,30 @@ var C = [
19
19
  ...D
20
20
  }
21
21
  })), k = o(() => t(D, "label", O.value.merged.value.label) || t(D, "corner", O.value.merged.value.corner));
22
- return (o, p) => (_(), c("div", h(O.value.rootBind.value, {
22
+ return (t, o) => (_(), c("div", h(O.value.rootBind.value, {
23
23
  "data-invalid": O.value.invalidated.value || void 0,
24
24
  "aria-disabled": O.value.isDisabled.value || void 0,
25
25
  "aria-readonly": O.value.isReadonly.value || void 0
26
26
  }), [
27
27
  k.value ? (_(), c("div", g(h({ key: 0 }, O.value.headerBind.value)), [f(i, { api: O.value }, u({ _: 2 }, [b(e)(b(D), "label") ? {
28
28
  name: "label",
29
- fn: S(() => [v(o.$slots, "label")]),
29
+ fn: S(() => [v(t.$slots, "label")]),
30
30
  key: "0"
31
31
  } : void 0]), 1032, ["api"]), f(r, { api: O.value }, u({ _: 2 }, [b(e)(b(D), "corner") ? {
32
32
  name: "corner",
33
- fn: S(() => [v(o.$slots, "corner")]),
33
+ fn: S(() => [v(t.$slots, "corner")]),
34
34
  key: "0"
35
35
  } : void 0]), 1032, ["api"])], 16)) : s("", !0),
36
36
  l("div", g(m(O.value.groupBind.value)), [
37
- b(e)(b(D), "start") ? (_(), c("div", g(h({ key: 0 }, O.value.startSlotBind.value)), [v(o.$slots, "start")], 16)) : s("", !0),
38
- v(o.$slots, "default"),
39
- b(e)(b(D), "end") ? (_(), c("div", g(h({ key: 1 }, O.value.endSlotBind.value)), [v(o.$slots, "end")], 16)) : s("", !0)
37
+ b(e)(b(D), "start") ? (_(), c("div", g(h({ key: 0 }, O.value.startSlotBind.value)), [v(t.$slots, "start")], 16)) : s("", !0),
38
+ v(t.$slots, "default"),
39
+ b(e)(b(D), "end") ? (_(), c("div", g(h({ key: 1 }, O.value.endSlotBind.value)), [v(t.$slots, "end")], 16)) : s("", !0)
40
40
  ], 16),
41
- !O.value.invalidated.value && b(t)(b(D), "description", O.value.merged.value.description) ? (_(), c("p", h({ key: 1 }, O.value.descriptionBind.value, { id: `${O.value.controlId.value}-description` }), [b(e)(b(D), "description") ? v(o.$slots, "description", {}, void 0, void 0, 0) : b(n)(O.value.merged.value.description) ? (_(), c(a, { key: 1 }, [d(y(O.value.merged.value.description), 1)], 64)) : s("", !0)], 16, w)) : s("", !0),
42
- O.value.merged.value.hideErrorMessage ? s("", !0) : (_(), c("p", h({ key: 2 }, O.value.errorBind.value, {
41
+ O.value.showDescriptionContent.value ? (_(), c("p", h({ key: 1 }, O.value.descriptionBind.value, { id: `${O.value.controlId.value}-description` }), [b(e)(b(D), "description") ? v(t.$slots, "description", {}, void 0, void 0, 0) : b(n)(O.value.merged.value.description) ? (_(), c(a, { key: 1 }, [d(y(O.value.merged.value.description), 1)], 64)) : s("", !0)], 16, w)) : s("", !0),
42
+ O.value.showErrorMessageRow.value ? (_(), c("p", h({ key: 2 }, O.value.errorBind.value, {
43
43
  id: `${O.value.controlId.value}-error`,
44
44
  "aria-hidden": !O.value.showErrorMessageContent.value || void 0
45
- }), [O.value.showErrorMessageContent.value ? (_(), c(a, { key: 0 }, [b(e)(b(D), "errorMessage") ? v(o.$slots, "errorMessage", {}, void 0, void 0, 0) : b(n)(O.value.merged.value.errorMessage) ? (_(), c(a, { key: 1 }, [d(y(O.value.merged.value.errorMessage), 1)], 64)) : s("", !0)], 64)) : s("", !0)], 16, T))
45
+ }), [O.value.showErrorMessageContent.value ? (_(), c(a, { key: 0 }, [b(e)(b(D), "errorMessage") ? v(t.$slots, "errorMessage", {}, void 0, void 0, 0) : b(n)(O.value.merged.value.errorMessage) ? (_(), c(a, { key: 1 }, [d(y(O.value.merged.value.errorMessage), 1)], 64)) : s("", !0)], 64)) : s("", !0)], 16, T)) : s("", !0)
46
46
  ], 16, C));
47
47
  }
48
48
  });
@@ -115,7 +115,8 @@ export interface BaseFieldOwnProps {
115
115
  */
116
116
  customProps?: BaseFieldCustomProps;
117
117
  /**
118
- * Helper text below the control group (hidden when the field is invalid).
118
+ * Helper text below the control group. Hidden when `error` is true and an
119
+ * error message is shown, unless `showDescriptionOnError` is true.
119
120
  *
120
121
  * @default undefined
121
122
  */
@@ -127,7 +128,9 @@ export interface BaseFieldOwnProps {
127
128
  */
128
129
  disabled?: boolean;
129
130
  /**
130
- * When `true`, applies invalid styling on the label and control group.
131
+ * When `true`, applies invalid styling on the label and control group. Hides
132
+ * description when an error message is shown, unless `showDescriptionOnError`
133
+ * is true.
131
134
  *
132
135
  * @default false
133
136
  */
@@ -148,7 +151,8 @@ export interface BaseFieldOwnProps {
148
151
  */
149
152
  field?: UseBaseFieldReturn;
150
153
  /**
151
- * When `true`, does not reserve space below the group for error messages.
154
+ * When `true`, does not reserve the error row. That row is also omitted
155
+ * while a description is shown.
152
156
  *
153
157
  * @default false
154
158
  */
@@ -171,6 +175,12 @@ export interface BaseFieldOwnProps {
171
175
  * @default false
172
176
  */
173
177
  required?: boolean;
178
+ /**
179
+ * When `true`, keeps the description visible while the field is invalid.
180
+ *
181
+ * @default false
182
+ */
183
+ showDescriptionOnError?: boolean;
174
184
  /**
175
185
  * Label typography and control group gap scale.
176
186
  *
@@ -195,7 +205,8 @@ export interface BaseFieldSlots {
195
205
  */
196
206
  default?: Slot<undefined>;
197
207
  /**
198
- * Helper text below the control group.
208
+ * Helper text below the control group. Hidden when the field is invalid and
209
+ * an error message is shown, unless `showDescriptionOnError` is true.
199
210
  */
200
211
  description?: Slot;
201
212
  /**
@@ -5,14 +5,16 @@ import { LabelProps } from '../../Label/label.types';
5
5
  export type BaseFieldOptions = {
6
6
  /**
7
7
  * Public registry key that owns BaseField chrome defaults/tokens.
8
+ * Defaults to `BaseField`; Slider / OtpField pass their own key so chrome
9
+ * cascades (`BaseField` → parent).
8
10
  */
9
- componentName?: "Slider" | "OtpField";
11
+ componentName?: "Slider" | "OtpField" | "BaseField";
10
12
  /**
11
13
  * Resolve `Label` `for` from `controlId`. Defaults to the control id itself.
12
14
  */
13
15
  labelHtmlFor?: (controlId: string) => string;
14
16
  };
15
- export declare const baseFieldBridgeKeys: readonly ["size", "error", "label", "corner", "classes", "disabled", "readonly", "required", "controlId", "customProps", "description", "errorMessage", "hideErrorMessage"];
17
+ export declare const baseFieldBridgeKeys: readonly ["size", "error", "label", "corner", "classes", "disabled", "readonly", "required", "controlId", "customProps", "description", "errorMessage", "hideErrorMessage", "showDescriptionOnError"];
16
18
  type BaseFieldLibDefaults = LibDefaultsShape<Omit<BaseFieldOwnProps, "field">, "size" | "error" | "hideErrorMessage">;
17
19
  type BaseFieldMerged = MergeLibDefaults<Omit<BaseFieldOwnProps, "field">, BaseFieldLibDefaults>;
18
20
  /**
@@ -49,6 +51,8 @@ export declare function useBaseField(props: MaybeRefOrGetter<Omit<BaseFieldOwnPr
49
51
  fieldLabelProps: import('vue').ComputedRef<LabelProps>;
50
52
  descriptionBind: import('vue').ComputedRef<import('@bridge-ui/core/Utils').MergePartBind<object, "class", HTMLAttributes | undefined, {}>>;
51
53
  fieldCornerProps: import('vue').ComputedRef<LabelProps>;
54
+ showErrorMessageRow: import('vue').ComputedRef<boolean>;
55
+ showDescriptionContent: import('vue').ComputedRef<boolean>;
52
56
  showErrorMessageContent: import('vue').ComputedRef<boolean>;
53
57
  };
54
58
  export type UseBaseFieldReturn = ReturnType<typeof useBaseField>;
@@ -18,7 +18,8 @@ var g = [
18
18
  "customProps",
19
19
  "description",
20
20
  "errorMessage",
21
- "hideErrorMessage"
21
+ "hideErrorMessage",
22
+ "showDescriptionOnError"
22
23
  ];
23
24
  function _(_, v = {
24
25
  size: "md",
@@ -31,102 +32,101 @@ function _(_, v = {
31
32
  ...b,
32
33
  ...o(_)
33
34
  }
34
- })), { merged: w, entry: T } = r({
35
+ })), w = y.componentName ?? "BaseField", { merged: T, entry: E, chromeEntry: D } = r({
35
36
  libDefaults: v,
36
- componentName: y.componentName,
37
+ componentName: w,
37
38
  props: () => C.value.componentProps
38
- }), E = i({
39
- entry: T,
39
+ }), O = i({
40
+ entry: E,
41
+ chromeEntry: D,
40
42
  props: () => C.value.componentProps
41
- }), D = a(() => w.value.customProps), O = a(() => w.value.error === !0), k = a(() => !!w.value.disabled), A = a(() => !!w.value.readonly), j = a(() => w.value.controlId ?? C.value.inheritedAttrs.id ?? S), M = a(() => {
42
- let e = m(f, u(T.value, [
43
- "tokens",
44
- "baseField",
45
- "size"
46
- ]));
47
- return u(e, w.value.size ?? "md");
48
- }), N = a(() => !w.value.hideErrorMessage), P = a(() => O.value && e(x, "errorMessage", w.value.errorMessage)), F = a(() => {
49
- let t = [];
50
- return !O.value && e(x, "description", w.value.description) && t.push(`${j.value}-description`), O.value && !w.value.hideErrorMessage && e(x, "errorMessage", w.value.errorMessage) && t.push(`${j.value}-error`), t.length > 0 ? t.join(" ") : void 0;
51
- }), I = a(() => n(D.value?.root, {
43
+ }), k = a(() => T.value.customProps), A = a(() => T.value.error === !0), j = a(() => !!T.value.disabled), M = a(() => !!T.value.readonly), N = a(() => T.value.controlId ?? C.value.inheritedAttrs.id ?? S), P = a(() => {
44
+ let e = w !== "BaseField", t = m(f, u(D.value, ["tokens", "size"]), e ? void 0 : u(E.value, ["tokens", "size"]));
45
+ return u(t, T.value.size ?? "md");
46
+ }), F = a(() => !T.value.hideErrorMessage && !e(x, "description", T.value.description)), I = a(() => A.value && !T.value.hideErrorMessage && e(x, "errorMessage", T.value.errorMessage)), L = a(() => e(x, "description", T.value.description) ? !I.value || T.value.showDescriptionOnError === !0 : !1), R = a(() => I.value || F.value), z = a(() => {
47
+ let e = [];
48
+ return L.value && e.push(`${N.value}-description`), I.value && e.push(`${N.value}-error`), e.length > 0 ? e.join(" ") : void 0;
49
+ }), B = a(() => n(k.value?.root, {
52
50
  class: p(C.value.inheritedAttrs.class),
53
51
  ...d(C.value.inheritedAttrs, ["class", "id"])
54
52
  }, p({
55
53
  "group w-full relative": !0,
56
54
  "aria-disabled:pointer-events-none aria-disabled:select-none aria-disabled:opacity-60": !0,
57
55
  "aria-readonly:pointer-events-none aria-readonly:select-none": !0,
58
- [E.value.root ?? ""]: !0
59
- }))), L = a(() => n(D.value?.header, {}, p({
56
+ [O.value.root ?? ""]: !0
57
+ }))), V = a(() => n(k.value?.header, {}, p({
60
58
  "flex w-full gap-x-2 mb-1.5": !0,
61
- "justify-between items-end": e(x, "label", w.value.label),
62
- "justify-end": !e(x, "label", w.value.label),
63
- [E.value.header ?? ""]: !0
64
- }))), R = a(() => {
59
+ "justify-between items-end": e(x, "label", T.value.label),
60
+ "justify-end": !e(x, "label", T.value.label),
61
+ [O.value.header ?? ""]: !0
62
+ }))), H = a(() => {
65
63
  let e = y.labelHtmlFor ?? ((e) => e);
66
- return t(D.value?.corner, {
67
- size: w.value.size,
68
- for: e(j.value),
69
- classes: { root: p({ [E.value.corner ?? ""]: !0 }) }
64
+ return t(k.value?.corner, {
65
+ size: T.value.size,
66
+ for: e(N.value),
67
+ classes: { root: p({ [O.value.corner ?? ""]: !0 }) }
70
68
  });
71
- }), z = a(() => n(D.value?.group, {
69
+ }), U = a(() => n(k.value?.group, {
72
70
  role: "group",
73
- id: j.value,
74
- "aria-describedby": F.value,
75
- "aria-disabled": k.value || void 0,
76
- "aria-invalid": O.value || void 0
71
+ id: N.value,
72
+ "aria-describedby": z.value,
73
+ "aria-disabled": j.value || void 0,
74
+ "aria-invalid": A.value || void 0
77
75
  }, p({
78
76
  "flex flex-wrap items-center": !0,
79
- [M.value?.group ?? ""]: !0,
80
- [E.value.group ?? ""]: !0
81
- }))), B = a(() => n(D.value?.start, {}, p({
77
+ [P.value?.group ?? ""]: !0,
78
+ [O.value.group ?? ""]: !0
79
+ }))), W = a(() => n(k.value?.start, {}, p({
82
80
  "group/start wrapper-start-slot shrink-0 flex items-center [&>*]:min-h-0": !0,
83
- [E.value.start ?? ""]: !0
84
- }))), V = a(() => n(D.value?.end, {}, p({
81
+ [O.value.start ?? ""]: !0
82
+ }))), G = a(() => n(k.value?.end, {}, p({
85
83
  "group/end wrapper-end-slot shrink-0 flex items-center [&>*]:min-h-0": !0,
86
- [E.value.end ?? ""]: !0
87
- }))), H = a(() => n(D.value?.description, {}, p({
84
+ [O.value.end ?? ""]: !0
85
+ }))), K = a(() => n(k.value?.description, {}, p({
88
86
  "mt-1 px-1 text-dark-500 dark:text-dark-400": !0,
89
- [M.value?.text ?? ""]: !0,
90
- [E.value.description ?? ""]: !0
87
+ [P.value?.text ?? ""]: !0,
88
+ [O.value.description ?? ""]: !0
91
89
  })));
92
90
  return {
93
91
  slots: x,
94
- merged: w,
95
- rootBind: I,
96
- errorBind: a(() => n(D.value?.errorMessage, {}, p({
92
+ merged: T,
93
+ rootBind: B,
94
+ errorBind: a(() => n(k.value?.errorMessage, {}, p({
97
95
  "mt-1 px-1": !0,
98
- "min-h-[1lh]": N.value,
96
+ "min-h-[1lh]": F.value,
99
97
  "text-error-600 dark:text-error-400": !0,
100
- [M.value?.text ?? ""]: !0,
101
- [E.value.errorMessage ?? ""]: !0
98
+ [P.value?.text ?? ""]: !0,
99
+ [O.value.errorMessage ?? ""]: !0
102
100
  }))),
103
- groupBind: z,
104
- controlId: j,
105
- headerBind: L,
106
- isDisabled: k,
107
- isReadonly: A,
108
- sizeClasses: M,
109
- endSlotBind: V,
110
- invalidated: O,
111
- startSlotBind: B,
112
- mergedClasses: E,
113
- ariaDescribedBy: F,
101
+ groupBind: U,
102
+ controlId: N,
103
+ headerBind: V,
104
+ isDisabled: j,
105
+ isReadonly: M,
106
+ sizeClasses: P,
107
+ endSlotBind: G,
108
+ invalidated: A,
109
+ startSlotBind: W,
110
+ mergedClasses: O,
111
+ ariaDescribedBy: z,
114
112
  fieldLabelProps: a(() => {
115
113
  let e = y.labelHtmlFor ?? ((e) => e);
116
- return t(D.value?.label, {
117
- size: w.value.size,
118
- error: O.value,
119
- required: w.value.required,
120
- for: e(j.value),
114
+ return t(k.value?.label, {
115
+ size: T.value.size,
116
+ error: A.value,
117
+ required: T.value.required,
118
+ for: e(N.value),
121
119
  classes: {
122
- required: E.value.required,
123
- root: p({ [E.value.label ?? ""]: !0 })
120
+ required: O.value.required,
121
+ root: p({ [O.value.label ?? ""]: !0 })
124
122
  }
125
123
  });
126
124
  }),
127
- descriptionBind: H,
128
- fieldCornerProps: R,
129
- showErrorMessageContent: P
125
+ descriptionBind: K,
126
+ fieldCornerProps: H,
127
+ showErrorMessageRow: R,
128
+ showDescriptionContent: L,
129
+ showErrorMessageContent: I
130
130
  };
131
131
  }
132
132
  //#endregion