@bridge-ui/vue 0.0.7 → 0.0.8

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 (136) hide show
  1. package/ai/AGENTS.md +31 -0
  2. package/ai/README.md +35 -0
  3. package/ai/guidelines/core.md +44 -0
  4. package/ai/llms.txt +38 -0
  5. package/ai/skills/bridge-ui-components/SKILL.md +37 -0
  6. package/ai/skills/bridge-ui-forms/SKILL.md +38 -0
  7. package/ai/skills/bridge-ui-overlays/SKILL.md +37 -0
  8. package/ai/skills/bridge-ui-setup/SKILL.md +38 -0
  9. package/bin/__tests__/ai.test.ts +319 -0
  10. package/bin/ai.mjs +469 -0
  11. package/dist/Adapters/I18n/useI18nAdapter.d.ts +1 -1
  12. package/dist/Adapters/Icon/useIconAdapter.d.ts +1 -1
  13. package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +5 -5
  14. package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +3 -2
  15. package/dist/Components/Autocomplete/composables/useAutocomplete.js +6 -2
  16. package/dist/Components/Avatar/composables/useAvatar.d.ts +1 -1
  17. package/dist/Components/BaseField/BaseField.js +5 -0
  18. package/dist/Components/BaseField/BaseField.vue.d.ts +15 -0
  19. package/dist/Components/BaseField/BaseField.vue_vue_type_script_setup_true_lang.js +41 -0
  20. package/dist/Components/BaseField/BaseFieldLabel.js +5 -0
  21. package/dist/Components/{OtpField/OtpFieldLabel.vue.d.ts → BaseField/BaseFieldLabel.vue.d.ts} +2 -2
  22. package/dist/Components/{OtpField/OtpFieldLabel.vue_vue_type_script_setup_true_lang.js → BaseField/BaseFieldLabel.vue_vue_type_script_setup_true_lang.js} +2 -2
  23. package/dist/Components/BaseField/baseField.types.d.ts +222 -0
  24. package/dist/Components/BaseField/composables/useBaseField.d.ts +55 -0
  25. package/dist/Components/BaseField/composables/useBaseField.js +131 -0
  26. package/dist/Components/BaseField/index.d.ts +4 -0
  27. package/dist/Components/BaseField/index.js +3 -0
  28. package/dist/Components/Button/composables/useButton.d.ts +1 -1
  29. package/dist/Components/Checkbox/composables/useCheckbox.d.ts +1 -1
  30. package/dist/Components/Checkbox/composables/useCheckbox.js +1 -1
  31. package/dist/Components/Chip/Chip.vue.d.ts +1 -1
  32. package/dist/Components/Chip/composables/useChip.d.ts +1 -1
  33. package/dist/Components/Drawer/Drawer.vue.d.ts +2 -2
  34. package/dist/Components/Drawer/composables/useDrawer.d.ts +1 -1
  35. package/dist/Components/FormControl/composables/useFormControl.d.ts +11 -2
  36. package/dist/Components/FormControl/composables/useFormControl.js +57 -53
  37. package/dist/Components/FormControl/index.d.ts +1 -1
  38. package/dist/Components/FormField/composables/useFormField.d.ts +5 -1
  39. package/dist/Components/FormField/composables/useFormField.js +1 -1
  40. package/dist/Components/ListItem/ListItem.vue.d.ts +1 -1
  41. package/dist/Components/ListItem/composables/useListItem.d.ts +1 -1
  42. package/dist/Components/Listbox/Listbox.vue.d.ts +3 -3
  43. package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +2 -1
  44. package/dist/Components/Listbox/composables/useListbox.d.ts +10 -1
  45. package/dist/Components/Listbox/composables/useListbox.js +20 -20
  46. package/dist/Components/Listbox/index.d.ts +1 -0
  47. package/dist/Components/Listbox/listbox.types.d.ts +6 -0
  48. package/dist/Components/Menu/Menu.vue.d.ts +2 -2
  49. package/dist/Components/Modal/Modal.vue.d.ts +2 -2
  50. package/dist/Components/Modal/composables/useModal.d.ts +1 -1
  51. package/dist/Components/NumberField/NumberField.vue.d.ts +2 -2
  52. package/dist/Components/NumberField/composables/useNumberField.d.ts +2 -2
  53. package/dist/Components/NumberField/composables/useNumberField.js +4 -1
  54. package/dist/Components/OtpField/OtpField.vue.d.ts +3 -3
  55. package/dist/Components/OtpField/OtpField.vue_vue_type_script_setup_true_lang.js +34 -52
  56. package/dist/Components/OtpField/composables/useOtpField.d.ts +40 -213
  57. package/dist/Components/OtpField/composables/useOtpField.js +92 -150
  58. package/dist/Components/OtpField/otpField.types.d.ts +10 -180
  59. package/dist/Components/PasswordField/composables/usePasswordField.d.ts +2 -2
  60. package/dist/Components/PasswordField/composables/usePasswordField.js +4 -1
  61. package/dist/Components/Radio/composables/useRadio.d.ts +1 -1
  62. package/dist/Components/Radio/composables/useRadio.js +1 -1
  63. package/dist/Components/Select/Select.vue.d.ts +4 -4
  64. package/dist/Components/Select/composables/useSelect.d.ts +3 -2
  65. package/dist/Components/Select/composables/useSelect.js +6 -2
  66. package/dist/Components/Slider/Slider.js +5 -0
  67. package/dist/Components/Slider/Slider.vue.d.ts +25 -0
  68. package/dist/Components/Slider/Slider.vue_vue_type_script_setup_true_lang.js +113 -0
  69. package/dist/Components/Slider/composables/useSlider.d.ts +482 -0
  70. package/dist/Components/Slider/composables/useSlider.js +287 -0
  71. package/dist/Components/Slider/index.d.ts +4 -0
  72. package/dist/Components/Slider/index.js +3 -0
  73. package/dist/Components/Slider/slider.types.d.ts +169 -0
  74. package/dist/Components/Snackbar/Snackbar.vue.d.ts +2 -2
  75. package/dist/Components/Switch/composables/useSwitch.d.ts +1 -1
  76. package/dist/Components/Switch/composables/useSwitch.js +1 -1
  77. package/dist/Components/Tabs/Tabs.vue.d.ts +2 -2
  78. package/dist/Components/TextField/composables/useTextField.d.ts +2 -2
  79. package/dist/Components/TextField/composables/useTextField.js +1 -1
  80. package/dist/Components/Textarea/composables/useTextarea.d.ts +2 -2
  81. package/dist/Components/Textarea/composables/useTextarea.js +1 -0
  82. package/dist/Utils/index.d.ts +3 -3
  83. package/dist/Utils/index.js +5 -2
  84. package/dist/augments.d.ts +29 -17
  85. package/dist/index.d.ts +5 -1
  86. package/dist/index.js +59 -55
  87. package/docs/README.md +56 -0
  88. package/docs/components/Alert.md +96 -0
  89. package/docs/components/Autocomplete.md +198 -0
  90. package/docs/components/Avatar.md +60 -0
  91. package/docs/components/Badge.md +47 -0
  92. package/docs/components/BaseField.md +126 -0
  93. package/docs/components/BridgeUIProvider.md +151 -0
  94. package/docs/components/Button.md +93 -0
  95. package/docs/components/Card.md +287 -0
  96. package/docs/components/Checkbox.md +87 -0
  97. package/docs/components/Divider.md +56 -0
  98. package/docs/components/Drawer.md +137 -0
  99. package/docs/components/FormControl.md +66 -0
  100. package/docs/components/FormField.md +71 -0
  101. package/docs/components/I18n.md +125 -0
  102. package/docs/components/Icon.md +88 -0
  103. package/docs/components/Label.md +31 -0
  104. package/docs/components/Link.md +71 -0
  105. package/docs/components/List.md +167 -0
  106. package/docs/components/Menu.md +97 -0
  107. package/docs/components/Modal.md +154 -0
  108. package/docs/components/NumberField.md +80 -0
  109. package/docs/components/OtpField.md +133 -0
  110. package/docs/components/PasswordField.md +82 -0
  111. package/docs/components/Progress.md +68 -0
  112. package/docs/components/Radio.md +91 -0
  113. package/docs/components/Select.md +181 -0
  114. package/docs/components/Skeleton.md +38 -0
  115. package/docs/components/Slider.md +140 -0
  116. package/docs/components/Snackbar.md +99 -0
  117. package/docs/components/Spinner.md +61 -0
  118. package/docs/components/Switch.md +72 -0
  119. package/docs/components/Tabs.md +207 -0
  120. package/docs/components/TextField.md +72 -0
  121. package/docs/components/Textarea.md +80 -0
  122. package/docs/components/Tooltip.md +125 -0
  123. package/docs/components/useBreakpoint.md +100 -0
  124. package/docs/components/useDialogAction.md +97 -0
  125. package/docs/components/useDrawerAction.md +75 -0
  126. package/docs/components/useModalAction.md +75 -0
  127. package/docs/components/useSnackbarAction.md +85 -0
  128. package/docs/examples/i18n-dictionary.ts +48 -0
  129. package/docs/examples/i18n-vue-i18n.ts +34 -0
  130. package/docs/examples/icon-fontawesome.ts +112 -0
  131. package/docs/examples/icon-heroicons.ts +57 -0
  132. package/docs/examples/icon-lucide.ts +57 -0
  133. package/docs/examples/icon-phosphor.ts +57 -0
  134. package/docs/examples/icon-tabler.ts +57 -0
  135. package/package.json +12 -5
  136. package/dist/Components/OtpField/OtpFieldLabel.js +0 -5
@@ -21,83 +21,87 @@ var _ = [
21
21
  "errorMessage",
22
22
  "hideErrorMessage"
23
23
  ];
24
- function v(v, y) {
25
- let b = c(), x = l(), S = s(), C = a(() => f({
24
+ function v(v, y, b = {}) {
25
+ let x = c(), S = l(), C = s(), w = a(() => f({
26
26
  bridgeKeys: _,
27
27
  props: {
28
- ...S,
28
+ ...C,
29
29
  ...o(v)
30
30
  }
31
- })), { merged: w, entry: T } = r({
31
+ })), { merged: T, entry: E } = r({
32
32
  libDefaults: y,
33
- componentName: "FormControl",
34
- props: () => C.value.componentProps
35
- }), E = a(() => w.value.customProps), D = i({
36
- entry: T,
37
- props: () => C.value.componentProps
38
- }), O = a(() => w.value.error === !0), k = a(() => !!w.value.disabled), A = a(() => !!w.value.readonly), j = a(() => {
39
- let e = C.value.inheritedAttrs.id;
40
- return w.value.controlId ?? e ?? b;
41
- }), M = a(() => !w.value.hideErrorMessage), N = a(() => O.value && e(x, "errorMessage", w.value.errorMessage)), P = a(() => {
33
+ componentName: b.componentName,
34
+ props: () => w.value.componentProps
35
+ }), D = a(() => T.value.customProps), O = i({
36
+ entry: E,
37
+ props: () => w.value.componentProps
38
+ }), k = a(() => T.value.error === !0), A = a(() => !!T.value.disabled), j = a(() => !!T.value.readonly), M = a(() => {
39
+ let e = w.value.inheritedAttrs.id;
40
+ return T.value.controlId ?? e ?? x;
41
+ }), N = a(() => !T.value.hideErrorMessage), P = a(() => k.value && e(S, "errorMessage", T.value.errorMessage)), F = a(() => {
42
42
  let t = [];
43
- return !O.value && e(x, "description", w.value.description) && t.push(`${j.value}-description`), O.value && M.value && e(x, "errorMessage", w.value.errorMessage) && t.push(`${j.value}-error`), t.length > 0 ? t.join(" ") : void 0;
44
- }), F = a(() => p(h, w.value.size ?? "md")), I = a(() => d(g, T.value?.tokens?.invalidated, w.value.customProps?.invalidated)), L = a(() => n(E.value?.root, m(C.value.inheritedAttrs, ["class"]), u({
43
+ return !k.value && e(S, "description", T.value.description) && t.push(`${M.value}-description`), k.value && N.value && e(S, "errorMessage", T.value.errorMessage) && t.push(`${M.value}-error`), t.length > 0 ? t.join(" ") : void 0;
44
+ }), I = a(() => p(h, T.value.size ?? "md")), L = a(() => d(g, p(E.value, [
45
+ "tokens",
46
+ "formControl",
47
+ "invalidated"
48
+ ]), T.value.customProps?.invalidated)), R = a(() => n(D.value?.root, m(w.value.inheritedAttrs, ["class"]), u({
45
49
  "group/form-control relative w-full": !0,
46
50
  "aria-disabled:pointer-events-none aria-disabled:select-none aria-disabled:opacity-60 aria-disabled:cursor-not-allowed": !0,
47
51
  "aria-readonly:pointer-events-none aria-readonly:select-none": !0,
48
- [D.value.root ?? ""]: !0,
49
- [S.class]: !!S.class
50
- }))), R = a(() => n(E.value?.row, {}, u({
52
+ [O.value.root ?? ""]: !0,
53
+ [C.class]: !!C.class
54
+ }))), z = a(() => n(D.value?.row, {}, u({
51
55
  "flex flex-row items-center gap-x-2": !0,
52
- [D.value.row ?? ""]: !0
53
- }))), z = a(() => {
54
- let e = (e) => t(E.value?.[e], {
55
- for: j.value,
56
- size: w.value.size,
57
- error: O.value,
58
- required: w.value.required,
56
+ [O.value.row ?? ""]: !0
57
+ }))), B = a(() => {
58
+ let e = (e) => t(D.value?.[e], {
59
+ for: M.value,
60
+ size: T.value.size,
61
+ error: k.value,
62
+ required: T.value.required,
59
63
  classes: { root: u({
60
64
  "cursor-pointer": !0,
61
- [D.value[e] ?? ""]: !0
65
+ [O.value[e] ?? ""]: !0
62
66
  }) }
63
67
  });
64
68
  return {
65
69
  endLabel: e("endLabel"),
66
70
  startLabel: e("startLabel")
67
71
  };
68
- }), B = a(() => n(E.value?.description, { id: `${j.value}-description` }, u({
72
+ }), V = a(() => n(D.value?.description, { id: `${M.value}-description` }, u({
69
73
  "mt-2 text-gray-500 dark:text-gray-400": !0,
70
- [F.value ?? ""]: !0,
71
- [D.value.description ?? ""]: !0
72
- }))), V = a(() => n(E.value?.errorMessage, { id: `${j.value}-error` }, u({
74
+ [I.value ?? ""]: !0,
75
+ [O.value.description ?? ""]: !0
76
+ }))), H = a(() => n(D.value?.errorMessage, { id: `${M.value}-error` }, u({
73
77
  "mt-2": !0,
74
- "min-h-[1lh]": M.value,
75
- [I.value.errorMessage ?? ""]: !0,
76
- [F.value ?? ""]: !0,
77
- [D.value.errorMessage ?? ""]: !0
78
+ "min-h-[1lh]": N.value,
79
+ [L.value.errorMessage ?? ""]: !0,
80
+ [I.value ?? ""]: !0,
81
+ [O.value.errorMessage ?? ""]: !0
78
82
  })));
79
83
  return {
80
- slots: x,
81
- merged: w,
82
- rowBind: R,
83
- rootBind: L,
84
- controlId: j,
85
- isDisabled: k,
86
- isReadonly: A,
84
+ slots: S,
85
+ merged: T,
86
+ rowBind: z,
87
+ rootBind: R,
88
+ controlId: M,
89
+ isDisabled: A,
90
+ isReadonly: j,
87
91
  controlBind: a(() => ({
88
- id: j.value,
89
- disabled: k.value,
90
- readonly: A.value,
91
- "aria-describedby": P.value,
92
- required: w.value.required || void 0,
93
- "aria-invalid": O.value || void 0
92
+ id: M.value,
93
+ disabled: A.value,
94
+ readonly: j.value,
95
+ "aria-describedby": F.value,
96
+ required: T.value.required || void 0,
97
+ "aria-invalid": k.value || void 0
94
98
  })),
95
- invalidated: O,
96
- fieldLabelProps: z,
97
- descriptionBind: B,
98
- errorMessageBind: V,
99
- showErrorMessageContent: N,
100
- reservesErrorMessageSpace: M
99
+ invalidated: k,
100
+ fieldLabelProps: B,
101
+ descriptionBind: V,
102
+ errorMessageBind: H,
103
+ showErrorMessageContent: P,
104
+ reservesErrorMessageSpace: N
101
105
  };
102
106
  }
103
107
  //#endregion
@@ -1,4 +1,4 @@
1
1
  export { formControlBridgeKeys, useFormControl, } from './composables/useFormControl';
2
- export type { UseFormControlReturn } from './composables/useFormControl';
2
+ export type { FormControlOptions, UseFormControlReturn, } from './composables/useFormControl';
3
3
  export type { FormControlClasses, FormControlCustomProps, FormControlOwnProps, FormControlProps, FormControlSizeOverrides, FormControlSlots, } from './formControl.types';
4
4
  export { default as FormControl } from './FormControl.vue';
@@ -4,6 +4,10 @@ import { FormFieldOwnProps, FormFieldSlots } from '../formField.types';
4
4
  import { LabelProps } from '../../Label/label.types';
5
5
  export type FormFieldReservedSlotName = Exclude<keyof FormFieldSlots, "default">;
6
6
  export type FormFieldOptions = {
7
+ /**
8
+ * Public registry key that owns FormField chrome defaults/tokens.
9
+ */
10
+ componentName?: "Select" | "Textarea" | "TextField" | "NumberField" | "Autocomplete" | "PasswordField";
7
11
  /**
8
12
  * Native control rendered by the field composable (`<input>` vs `<textarea>`).
9
13
  *
@@ -443,7 +447,7 @@ export declare function useFormField(props: MaybeRefOrGetter<Omit<FormFieldOwnPr
443
447
  onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
444
448
  onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
445
449
  onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
446
- }, Partial<Omit<Omit<FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "endIcon" | "startIcon" | "start" | "required" | "description" | "errorMessage" | "hideErrorMessage" | "readonly" | "errorIcon" | "showErrorIcon" | "corner">>>>;
450
+ }, 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">>>>;
447
451
  isNotched: import('vue').ComputedRef<boolean>;
448
452
  isStacked: import('vue').ComputedRef<boolean>;
449
453
  startBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", HTMLAttributes | undefined, {}>>;
@@ -34,7 +34,7 @@ function x(x, S, C = {}) {
34
34
  bridgeKeys: b
35
35
  })), { merged: E, entry: D } = i({
36
36
  libDefaults: S,
37
- componentName: "FormField",
37
+ componentName: C.componentName,
38
38
  props: () => T.value.componentProps
39
39
  }), O = o(() => E.value.customProps), k = o(() => C.control?.() ?? "input"), A = a({
40
40
  entry: D,
@@ -2,8 +2,8 @@ import { ListItemOwnProps, ListItemSlots } from './listItem.types';
2
2
  type __VLS_Slots = ListItemSlots;
3
3
  declare const __VLS_base: import('vue').DefineComponent<ListItemOwnProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ListItemOwnProps> & Readonly<{}>, {
4
4
  role: "button" | "option" | "menuitem";
5
- as: "li" | "div";
6
5
  disabled: boolean;
6
+ as: "li" | "div";
7
7
  divider: boolean;
8
8
  interactive: boolean;
9
9
  selected: boolean;
@@ -11,7 +11,7 @@ export declare function useListItem(props: ListItemOwnProps, libDefaults: ListIt
11
11
  rootBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
12
12
  class: string;
13
13
  id: string | undefined;
14
- }, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListItemProps, "role" | "value" | "classes" | "customProps" | "primary" | "secondary" | "as" | "disabled" | "dense" | "divider" | "interactive" | "selected" | "selectedIcon">, never>>>;
14
+ }, "class", import('vue').HTMLAttributes | undefined, Omit<Omit<ListItemProps, "role" | "value" | "classes" | "customProps" | "primary" | "secondary" | "disabled" | "as" | "dense" | "divider" | "interactive" | "selected" | "selectedIcon">, never>>>;
15
15
  rowClass: import('vue').ComputedRef<string>;
16
16
  hasStart: import('vue').ComputedRef<boolean>;
17
17
  startBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
@@ -9,22 +9,22 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
9
9
  declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
10
  select: (option: ListboxOption) => any;
11
11
  "update:modelValue": (value: boolean) => any;
12
- "show-change": (show: boolean) => any;
13
12
  "registered-options-change": (options: ListboxOption[]) => any;
13
+ "show-change": (show: boolean) => any;
14
14
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
15
15
  onSelect?: ((option: ListboxOption) => any) | undefined;
16
16
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
17
- "onShow-change"?: ((show: boolean) => any) | undefined;
18
17
  "onRegistered-options-change"?: ((options: ListboxOption[]) => any) | undefined;
18
+ "onShow-change"?: ((show: boolean) => any) | undefined;
19
19
  }>, {
20
20
  color: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').ListboxColor, import('./listbox.types').ListboxColorOverrides>;
21
21
  size: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').ListboxSize, import('./listbox.types').ListboxSizeOverrides>;
22
- loading: boolean;
23
22
  multiple: boolean;
24
23
  disableAutoFocus: boolean;
25
24
  placement: import('@floating-ui/utils').Placement;
26
25
  hideEmptyMessage: boolean;
27
26
  highlightedIndex: number;
27
+ loading: boolean;
28
28
  showCheckmark: boolean;
29
29
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
30
30
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -18,6 +18,7 @@ var P = { key: 1 }, F = /* @__PURE__ */ g({
18
18
  anchorEl: {},
19
19
  classes: {},
20
20
  color: { default: "primary" },
21
+ componentName: {},
21
22
  customProps: {},
22
23
  disableAutoFocus: {
23
24
  type: Boolean,
@@ -73,7 +74,7 @@ var P = { key: 1 }, F = /* @__PURE__ */ g({
73
74
  let R = g, z = e(), B = l(() => R.emptyMessage ?? z("No options")), V = l(() => R.loadingMessage ?? z("Loading...")), { merged: H, checkClass: U, scrollBind: W, messageBind: G, sizeClasses: K, mergedClasses: q, optionSelectedClass: se, optionHighlightedClass: ce } = ee(R, {
74
75
  size: "md",
75
76
  color: "primary"
76
- }), le = l(() => R.options ?? []), J = l(() => R.entries ? R.entries : oe(le.value)), Y = l(() => j(J.value)), X = l(() => t(F, "default")), Z = l(() => !R.loading && !X.value && Y.value.length === 0 && R.hideEmptyMessage !== !0), ue = l(() => ae(U.value, q.value.check)), Q = C([]);
77
+ }, { componentName: R.componentName }), le = l(() => R.options ?? []), J = l(() => R.entries ? R.entries : oe(le.value)), Y = l(() => j(J.value)), X = l(() => t(F, "default")), Z = l(() => !R.loading && !X.value && Y.value.length === 0 && R.hideEmptyMessage !== !0), ue = l(() => ae(U.value, q.value.check)), Q = C([]);
77
78
  function $(e) {
78
79
  return R.isSelected?.(e) ?? !1;
79
80
  }
@@ -3,7 +3,16 @@ import { ListboxClasses, ListboxOwnProps } from '../listbox.types';
3
3
  export declare const listboxBridgeKeys: readonly ["size", "color", "classes", "maxHeight", "customProps", "invalidated", "disableMaxHeight"];
4
4
  type ListboxLibDefaults = LibDefaultsShape<ListboxOwnProps, "size" | "color">;
5
5
  type ListboxMerged = MergeLibDefaults<ListboxOwnProps, ListboxLibDefaults>;
6
- export declare function useListbox(props: ListboxOwnProps, libDefaults: ListboxLibDefaults): {
6
+ /**
7
+ * Options for {@link useListbox}.
8
+ */
9
+ export type ListboxOptions = {
10
+ /**
11
+ * Public registry key that owns nested `tokens.listbox` defaults.
12
+ */
13
+ componentName?: "Select" | "Autocomplete";
14
+ };
15
+ export declare function useListbox(props: ListboxOwnProps, libDefaults: ListboxLibDefaults, options?: ListboxOptions): {
7
16
  merged: import('vue').ComputedRef<ListboxMerged>;
8
17
  checkClass: import('vue').ComputedRef<string>;
9
18
  scrollBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
@@ -13,40 +13,40 @@ var f = [
13
13
  "invalidated",
14
14
  "disableMaxHeight"
15
15
  ];
16
- function p(p, m) {
17
- let h = i(), g = r(() => s({
16
+ function p(p, m, h = {}) {
17
+ let g = i(), _ = r(() => s({
18
18
  props: {
19
- ...h,
19
+ ...g,
20
20
  ...p
21
21
  },
22
22
  bridgeKeys: f
23
- })), { merged: _, entry: v } = t({
23
+ })), { merged: v, entry: y } = t({
24
24
  libDefaults: m,
25
- componentName: "Listbox",
26
- props: () => g.value.componentProps
27
- }), y = n({
28
- entry: v,
29
- props: () => g.value.componentProps
30
- }), b = r(() => c(o(l, v.value?.tokens?.color), _.value.color ?? "primary")), x = r(() => o(u, v.value?.tokens?.invalidated)), S = r(() => _.value.invalidated ? x.value : b.value), C = r(() => c(o(d, v.value?.tokens?.size), _.value.size ?? "md")), w = r(() => S.value?.selected), T = r(() => S.value?.highlighted);
25
+ componentName: h.componentName,
26
+ props: () => _.value.componentProps
27
+ }), b = n({
28
+ entry: y,
29
+ props: () => _.value.componentProps
30
+ }), x = r(() => c(y.value, ["tokens", "listbox"])), S = r(() => c(o(l, x.value?.color), v.value.color ?? "primary")), C = r(() => o(u, x.value?.invalidated)), w = r(() => v.value.invalidated ? C.value : S.value), T = r(() => c(o(d, x.value?.size), v.value.size ?? "md")), E = r(() => w.value?.selected), D = r(() => w.value?.highlighted);
31
31
  return {
32
- merged: _,
33
- checkClass: r(() => a(C.value?.check, S.value?.check)),
32
+ merged: v,
33
+ checkClass: r(() => a(T.value?.check, w.value?.check)),
34
34
  scrollBind: r(() => {
35
- let t = _.value.maxHeight ?? "max-h-60", n = _.value.disableMaxHeight === !0;
36
- return e(_.value.customProps?.scroll, {}, a({
35
+ let t = v.value.maxHeight ?? "max-h-60", n = v.value.disableMaxHeight === !0;
36
+ return e(v.value.customProps?.scroll, {}, a({
37
37
  "overflow-y-auto overscroll-contain": !n,
38
38
  [t]: !n,
39
- [y.value.scroll ?? ""]: !0
39
+ [b.value.scroll ?? ""]: !0
40
40
  }));
41
41
  }),
42
42
  messageBind: r(() => e({}, {}, a({
43
43
  "text-gray-500": !0,
44
- [C.value?.message ?? ""]: !0
44
+ [T.value?.message ?? ""]: !0
45
45
  }))),
46
- sizeClasses: C,
47
- mergedClasses: y,
48
- optionSelectedClass: w,
49
- optionHighlightedClass: T
46
+ sizeClasses: T,
47
+ mergedClasses: b,
48
+ optionSelectedClass: E,
49
+ optionHighlightedClass: D
50
50
  };
51
51
  }
52
52
  //#endregion
@@ -1,4 +1,5 @@
1
1
  export { useListbox } from './composables/useListbox';
2
+ export type { ListboxOptions } from './composables/useListbox';
2
3
  export { findFirstEnabledOptionIndex, findLastEnabledOptionIndex, getListboxActiveDescendantId, getListboxOptionId, moveListboxHighlight, useListboxNavigation, } from './composables/useListboxNavigation';
3
4
  export type { ListboxClasses, ListboxColorOverrides, ListboxCustomProps, ListboxEmits, ListboxEntry, ListboxOption, ListboxOwnProps, ListboxProps, ListboxSlots, ListboxValue, } from './listbox.types';
4
5
  export { default as Listbox } from './Listbox.vue';
@@ -101,6 +101,12 @@ export interface ListboxOwnProps {
101
101
  * @default "primary"
102
102
  */
103
103
  color?: MergeProps<ListboxColor, ListboxColorOverrides>;
104
+ /**
105
+ * Public parent registry key for nested `tokens.listbox`.
106
+ *
107
+ * @internal
108
+ */
109
+ componentName?: "Select" | "Autocomplete";
104
110
  /**
105
111
  * Extra props for internal parts (`list`, `listItem`, `listSection`, `menu`,
106
112
  * `progress`, `scroll`).
@@ -6,11 +6,11 @@ type __VLS_ModelProps = {
6
6
  };
7
7
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
8
  declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
- "update:modelValue": (value: boolean) => any;
10
9
  close: () => any;
10
+ "update:modelValue": (value: boolean) => any;
11
11
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
- "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
13
12
  onClose?: (() => any) | undefined;
13
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
14
14
  }>, {
15
15
  offset: number;
16
16
  rounded: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').MenuRounded, import('./menu.types').MenuRoundedOverrides>;
@@ -8,12 +8,12 @@ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
8
  declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
9
9
  stackId: import('vue').ComputedRef<string>;
10
10
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
- "update:modelValue": (value: boolean) => any;
12
11
  close: () => any;
12
+ "update:modelValue": (value: boolean) => any;
13
13
  "show-change": (show: boolean) => any;
14
14
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
15
- "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
16
15
  onClose?: (() => any) | undefined;
16
+ "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
17
17
  "onShow-change"?: ((show: boolean) => any) | undefined;
18
18
  }>, {
19
19
  closeOnEscape: boolean;
@@ -34,7 +34,7 @@ export declare function useModal(props: ModalOwnProps, libDefaults: ModalLibDefa
34
34
  };
35
35
  "aria-hidden": boolean | undefined;
36
36
  class: string;
37
- }, "class", import('vue').HTMLAttributes | undefined, Omit<ModalProps, "size" | "classes" | "customProps" | "closeOnEscape" | "disableScrollLock" | "keepMounted" | "persistent" | "teleportTo" | "blur" | "scroll" | "align" | "autoFocus" | "closeOnOverlay" | "disableEnforceFocus" | "disableRestoreFocus" | "hideBackdrop" | "stackId" | "transition">>>;
37
+ }, "class", import('vue').HTMLAttributes | undefined, Omit<ModalProps, "size" | "classes" | "customProps" | "closeOnEscape" | "disableScrollLock" | "keepMounted" | "persistent" | "teleportTo" | "scroll" | "blur" | "align" | "autoFocus" | "closeOnOverlay" | "disableEnforceFocus" | "disableRestoreFocus" | "hideBackdrop" | "stackId" | "transition">>>;
38
38
  panelBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<{
39
39
  "data-modal-part": string;
40
40
  "data-state": "open" | "closed";
@@ -6,11 +6,11 @@ type __VLS_ModelProps = {
6
6
  };
7
7
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
8
  declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
- "update:modelValue": (...args: unknown[]) => any;
10
9
  change: (value: number) => any;
10
+ "update:modelValue": (...args: unknown[]) => any;
11
11
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
12
- "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
13
12
  onChange?: ((value: number) => any) | undefined;
13
+ "onUpdate:modelValue"?: ((...args: unknown[]) => any) | undefined;
14
14
  }>, {
15
15
  step: number;
16
16
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -435,7 +435,7 @@ export declare function useNumberField(props: NumberFieldOwnProps, model: Ref<nu
435
435
  onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
436
436
  onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
437
437
  onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
438
- }, Partial<Omit<Omit<import('../../FormField').FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "endIcon" | "startIcon" | "start" | "required" | "description" | "errorMessage" | "hideErrorMessage" | "readonly" | "errorIcon" | "showErrorIcon" | "corner">>>>;
438
+ }, Partial<Omit<Omit<import('../../FormField').FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showErrorIcon" | "startIcon">>>>;
439
439
  isNotched: import('vue').ComputedRef<boolean>;
440
440
  isStacked: import('vue').ComputedRef<boolean>;
441
441
  startBind: import('vue').ComputedRef<import('@bridge-ui/core').MergePartBind<object, "class", import('vue').HTMLAttributes | undefined, {}>>;
@@ -684,7 +684,7 @@ export declare function useNumberField(props: NumberFieldOwnProps, model: Ref<nu
684
684
  onTransitionend?: ((payload: TransitionEvent) => void) | undefined;
685
685
  onTransitionrun?: ((payload: TransitionEvent) => void) | undefined;
686
686
  onTransitionstart?: ((payload: TransitionEvent) => void) | undefined;
687
- }, Partial<Omit<Omit<import('../../FormField').FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "endIcon" | "startIcon" | "start" | "required" | "description" | "errorMessage" | "hideErrorMessage" | "readonly" | "errorIcon" | "showErrorIcon" | "corner">>>, {
687
+ }, Partial<Omit<Omit<import('../../FormField').FormFieldOwnProps, "field">, "error" | "color" | "end" | "size" | "classes" | "customProps" | "rounded" | "variant" | "label" | "disabled" | "required" | "corner" | "description" | "errorMessage" | "start" | "endIcon" | "errorIcon" | "hideErrorMessage" | "readonly" | "showErrorIcon" | "startIcon">>>, {
688
688
  min: number | undefined;
689
689
  max: number | undefined;
690
690
  type: string;
@@ -25,7 +25,10 @@ function c(c, l, u = {}) {
25
25
  color: "primary",
26
26
  variant: "outline",
27
27
  showErrorIcon: !1
28
- }, { reservedSlots: () => ["end"] }), g = i(() => e(h.inputBind.value, {
28
+ }, {
29
+ componentName: "NumberField",
30
+ reservedSlots: () => ["end"]
31
+ }), g = i(() => e(h.inputBind.value, {
29
32
  min: c.min,
30
33
  max: c.max,
31
34
  type: "number",
@@ -6,17 +6,17 @@ type __VLS_ModelProps = {
6
6
  };
7
7
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
8
8
  declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
- "update:modelValue": (value: string | null | undefined) => any;
10
9
  change: (value: string) => any;
10
+ "update:modelValue": (value: string | null | undefined) => any;
11
11
  complete: (value: string) => any;
12
12
  }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
13
- "onUpdate:modelValue"?: ((value: string | null | undefined) => any) | undefined;
14
13
  onChange?: ((value: string) => any) | undefined;
14
+ "onUpdate:modelValue"?: ((value: string | null | undefined) => any) | undefined;
15
15
  onComplete?: ((value: string) => any) | undefined;
16
16
  }>, {
17
17
  color: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').OtpFieldColor, import('./otpField.types').OtpFieldColorOverrides>;
18
18
  type: import('@bridge-ui/core').OtpInputType;
19
- size: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').OtpFieldSize, import('./otpField.types').OtpFieldSizeOverrides>;
19
+ size: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').BaseFieldSize, import('../BaseField').BaseFieldSizeOverrides>;
20
20
  length: number;
21
21
  rounded: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').OtpFieldRounded, import('./otpField.types').OtpFieldRoundedOverrides>;
22
22
  variant: import('@bridge-ui/core').MergeProps<import('@bridge-ui/core').OtpFieldVariant, import('./otpField.types').OtpFieldVariantOverrides>;
@@ -1,80 +1,62 @@
1
- import { hasNamedSlot as e, hasSlotOrProp as t, resolveNamedSlot as n, resolveSlotOrProp as r } from "../../Utils/slotOrProp.js";
2
- import { useOtpField as i } from "./composables/useOtpField.js";
3
- import a from "./OtpFieldLabel.js";
4
- import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createVNode as f, defineComponent as p, guardReactiveProps as m, mergeModels as h, mergeProps as g, normalizeProps as _, openBlock as v, renderList as y, resolveDynamicComponent as b, unref as x, useModel as S } from "vue";
1
+ import e from "../BaseField/BaseField.js";
2
+ import { useOtpField as t } from "./composables/useOtpField.js";
3
+ import { Fragment as n, createBlock as r, createElementBlock as i, createElementVNode as a, defineComponent as o, guardReactiveProps as s, mergeModels as c, mergeProps as l, normalizeProps as u, openBlock as d, renderList as f, unref as p, useModel as m, withCtx as h } from "vue";
5
4
  //#region src/Components/OtpField/OtpField.vue?vue&type=script&setup=true&lang.ts
6
- var C = [
7
- "data-invalid",
8
- "aria-disabled",
9
- "aria-readonly"
10
- ], w = [
5
+ var g = [
11
6
  "value",
12
7
  "onFocus",
13
8
  "onPaste",
14
9
  "onInput",
15
10
  "onKeydown"
16
- ], T = ["id"], E = ["id", "aria-hidden"], D = /* @__PURE__ */ p({
11
+ ], _ = /* @__PURE__ */ o({
17
12
  inheritAttrs: !1,
18
13
  __name: "OtpField",
19
- props: /* @__PURE__ */ h({
14
+ props: /* @__PURE__ */ c({
20
15
  autoFocus: { type: Boolean },
21
16
  classes: {},
22
17
  color: { default: "primary" },
23
- controlId: {},
24
- corner: {},
25
18
  customProps: {},
26
19
  defaultValue: {},
20
+ length: { default: 6 },
21
+ mask: { type: Boolean },
22
+ placeholder: {},
23
+ rounded: { default: "md" },
24
+ type: { default: "numeric" },
25
+ variant: { default: "outline" },
26
+ controlId: {},
27
+ corner: {},
27
28
  description: {},
28
29
  disabled: { type: Boolean },
29
30
  error: { type: Boolean },
30
31
  errorMessage: {},
31
32
  hideErrorMessage: { type: Boolean },
32
33
  label: {},
33
- length: { default: 6 },
34
- mask: { type: Boolean },
35
- placeholder: {},
36
34
  readonly: { type: Boolean },
37
35
  required: { type: Boolean },
38
- rounded: { default: "md" },
39
- size: { default: "md" },
40
- type: { default: "numeric" },
41
- variant: { default: "outline" }
36
+ size: { default: "md" }
42
37
  }, {
43
38
  modelValue: {},
44
39
  modelModifiers: {}
45
40
  }),
46
- emits: /* @__PURE__ */ h(["change", "complete"], ["update:modelValue"]),
47
- setup(p, { emit: h }) {
48
- let D = h, O = i(p, S(p, "modelValue"), {
49
- onChange: (e) => D("change", e),
50
- onComplete: (e) => D("complete", e)
51
- }), { slots: k, merged: A, digits: j, pinBind: M, rootBind: N, errorBind: P, groupBind: F, inputBind: I, setPinRef: L, controlId: R, headerBind: z, cornerBind: B, endSlotBind: V, invalidated: H, startSlotBind: U, handlePinInput: W, handlePinFocus: G, handlePinPaste: K, descriptionBind: q, handlePinKeyDown: J, showErrorMessageContent: Y } = O, X = s(() => t(k, "label", A.value.label) || t(k, "corner", A.value.corner));
52
- return (i, s) => (v(), u("div", g(x(N), {
53
- "data-invalid": x(H) || void 0,
54
- "aria-disabled": x(A).disabled || void 0,
55
- "aria-readonly": x(A).readonly || void 0
56
- }), [
57
- X.value ? (v(), u("div", _(g({ key: 0 }, x(z))), [f(a, { api: x(O) }, null, 8, ["api"]), x(t)(x(k), "corner", x(A).corner) ? (v(), u("span", _(g({ key: 0 }, x(B))), [(v(), c(b(x(r)(x(k), "corner", x(A).corner))))], 16)) : l("", !0)], 16)) : l("", !0),
58
- d("div", _(m(x(F))), [
59
- x(e)(x(k), "start") ? (v(), u("div", _(g({ key: 0 }, x(U))), [(v(), c(b(x(n)(x(k), "start"))))], 16)) : l("", !0),
60
- (v(!0), u(o, null, y(x(j), (e, t) => (v(), u("div", g({ key: t }, { ref_for: !0 }, x(M)(t)), [d("input", g({ ref_for: !0 }, x(I)(t), {
61
- value: e,
62
- onFocus: (e) => x(G)(t),
63
- onPaste: (e) => x(K)(t, e),
64
- onInput: (e) => x(W)(t, e),
65
- onKeydown: (e) => x(J)(t, e),
66
- ref_for: !0,
67
- ref: (e) => x(L)(t, e)
68
- }), null, 16, w)], 16))), 128)),
69
- x(e)(x(k), "end") ? (v(), u("div", _(g({ key: 1 }, x(V))), [(v(), c(b(x(n)(x(k), "end"))))], 16)) : l("", !0)
70
- ], 16),
71
- !x(H) && x(t)(x(k), "description", x(A).description) ? (v(), u("p", g({ key: 1 }, x(q), { id: `${x(R)}-description` }), [(v(), c(b(x(r)(x(k), "description", x(A).description))))], 16, T)) : l("", !0),
72
- x(A).hideErrorMessage ? l("", !0) : (v(), u("p", g({ key: 2 }, x(P), {
73
- id: `${x(R)}-error`,
74
- "aria-hidden": x(Y) ? void 0 : !0
75
- }), [x(Y) ? (v(), c(b(x(r)(x(k), "errorMessage", x(A).errorMessage)), { key: 0 })) : l("", !0)], 16, E))
76
- ], 16, C));
41
+ emits: /* @__PURE__ */ c(["change", "complete"], ["update:modelValue"]),
42
+ setup(o, { emit: c }) {
43
+ let _ = c, { digits: v, pinBind: y, pinsBind: b, baseField: x, inputBind: S, setPinRef: C, handlePinInput: w, handlePinFocus: T, handlePinPaste: E, handlePinKeyDown: D } = t(o, m(o, "modelValue"), {
44
+ onChange: (e) => _("change", e),
45
+ onComplete: (e) => _("complete", e)
46
+ });
47
+ return (t, o) => (d(), r(e, { field: p(x) }, {
48
+ default: h(() => [a("div", u(s(p(b))), [(d(!0), i(n, null, f(p(v), (e, t) => (d(), i("div", l({ key: t }, { ref_for: !0 }, p(y)(t)), [a("input", l({ ref_for: !0 }, p(S)(t), {
49
+ value: e,
50
+ onFocus: (e) => p(T)(t),
51
+ onPaste: (e) => p(E)(t, e),
52
+ onInput: (e) => p(w)(t, e),
53
+ onKeydown: (e) => p(D)(t, e),
54
+ ref_for: !0,
55
+ ref: (e) => p(C)(t, e)
56
+ }), null, 16, g)], 16))), 128))], 16)]),
57
+ _: 1
58
+ }, 8, ["field"]));
77
59
  }
78
60
  });
79
61
  //#endregion
80
- export { D as default };
62
+ export { _ as default };