@bridge-ui/vue 0.0.6 → 0.0.7
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.
- package/dist/Actions/Snackbar/BridgeSnackbarAction.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/Actions/Snackbar/BridgeSnackbarHost.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/Actions/Snackbar/createBridgeSnackbarApi.js +17 -17
- package/dist/Adapters/I18n/index.d.ts +1 -1
- package/dist/Adapters/I18n/index.js +2 -2
- package/dist/Adapters/I18n/useI18nAdapter.d.ts +7 -3
- package/dist/Adapters/I18n/useI18nAdapter.js +12 -7
- package/dist/Adapters/Icon/useIconAdapter.d.ts +1 -1
- package/dist/Adapters/index.d.ts +1 -1
- package/dist/Adapters/index.js +3 -3
- package/dist/Components/Alert/composables/useAlert.js +17 -17
- package/dist/Components/Autocomplete/Autocomplete.js +5 -0
- package/dist/Components/Autocomplete/Autocomplete.vue.d.ts +40 -0
- package/dist/Components/Autocomplete/Autocomplete.vue_vue_type_script_setup_true_lang.js +197 -0
- package/dist/Components/Autocomplete/AutocompleteOption.js +5 -0
- package/dist/Components/Autocomplete/AutocompleteOption.vue.d.ts +4 -0
- package/dist/Components/Autocomplete/AutocompleteOption.vue_vue_type_script_setup_true_lang.js +32 -0
- package/dist/Components/Autocomplete/autocomplete.types.d.ts +285 -0
- package/dist/Components/Autocomplete/autocompleteInjectionKey.d.ts +7 -0
- package/dist/Components/Autocomplete/autocompleteInjectionKey.js +4 -0
- package/dist/Components/Autocomplete/composables/useAutocomplete.d.ts +762 -0
- package/dist/Components/Autocomplete/composables/useAutocomplete.js +382 -0
- package/dist/Components/Autocomplete/index.d.ts +4 -0
- package/dist/Components/Autocomplete/index.js +4 -0
- package/dist/Components/Avatar/composables/useAvatar.js +13 -13
- package/dist/Components/Badge/composables/useBadge.js +8 -8
- package/dist/Components/Button/composables/useButton.js +14 -14
- package/dist/Components/Card/composables/useCard.js +27 -27
- package/dist/Components/Checkbox/Checkbox.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Checkbox/composables/useCheckbox.d.ts +3 -3
- package/dist/Components/Checkbox/composables/useCheckbox.js +9 -9
- package/dist/Components/Chip/composables/useChip.js +6 -6
- package/dist/Components/Divider/composables/useDivider.js +5 -5
- package/dist/Components/Drawer/composables/useDrawer.js +23 -23
- package/dist/Components/FormControl/FormControl.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/Components/FormControl/composables/useFormControl.d.ts +3 -3
- package/dist/Components/FormControl/composables/useFormControl.js +12 -12
- package/dist/Components/FormControl/formControl.types.d.ts +6 -6
- package/dist/Components/FormField/FilledFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/NotchedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/OutlinedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/StackedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/UnderlinedFormField.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/FormField/composables/useFormField.d.ts +3 -3
- package/dist/Components/FormField/composables/useFormField.js +28 -28
- package/dist/Components/FormField/formField.types.d.ts +14 -14
- package/dist/Components/Icon/composables/useIcon.js +5 -5
- package/dist/Components/Label/composables/useLabel.js +5 -5
- package/dist/Components/Link/composables/useLink.js +9 -9
- package/dist/Components/List/composables/useList.js +6 -6
- package/dist/Components/ListItem/composables/useListItem.js +20 -20
- package/dist/Components/ListSection/composables/useListSection.js +8 -8
- package/dist/Components/Listbox/Listbox.vue_vue_type_script_setup_true_lang.js +28 -28
- package/dist/Components/Listbox/composables/useListbox.js +7 -7
- package/dist/Components/Listbox/index.js +3 -3
- package/dist/Components/Menu/composables/useMenu.js +43 -43
- package/dist/Components/Modal/composables/useModal.js +18 -18
- package/dist/Components/NumberField/NumberField.vue_vue_type_script_setup_true_lang.js +34 -34
- package/dist/Components/NumberField/composables/useNumberField.d.ts +4 -4
- package/dist/Components/NumberField/composables/useNumberField.js +9 -9
- package/dist/Components/OtpField/OtpField.js +5 -0
- package/dist/Components/OtpField/OtpField.vue.d.ts +31 -0
- package/dist/Components/OtpField/OtpField.vue_vue_type_script_setup_true_lang.js +80 -0
- package/dist/Components/OtpField/OtpFieldLabel.js +5 -0
- package/dist/Components/OtpField/OtpFieldLabel.vue.d.ts +7 -0
- package/dist/Components/OtpField/OtpFieldLabel.vue_vue_type_script_setup_true_lang.js +16 -0
- package/dist/Components/OtpField/composables/useOtpField.d.ts +460 -0
- package/dist/Components/OtpField/composables/useOtpField.js +212 -0
- package/dist/Components/OtpField/index.d.ts +4 -0
- package/dist/Components/OtpField/index.js +3 -0
- package/dist/Components/OtpField/otpField.types.d.ts +290 -0
- package/dist/Components/PasswordField/PasswordField.vue_vue_type_script_setup_true_lang.js +23 -23
- package/dist/Components/PasswordField/composables/usePasswordField.d.ts +4 -4
- package/dist/Components/PasswordField/composables/usePasswordField.js +2 -2
- package/dist/Components/Progress/composables/useProgress.js +11 -11
- package/dist/Components/Radio/Radio.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Radio/composables/useRadio.d.ts +3 -3
- package/dist/Components/Radio/composables/useRadio.js +9 -9
- package/dist/Components/Select/Select.vue.d.ts +1 -1
- package/dist/Components/Select/Select.vue_vue_type_script_setup_true_lang.js +16 -13
- package/dist/Components/Select/composables/useSelect.d.ts +4 -4
- package/dist/Components/Select/composables/useSelect.js +161 -161
- package/dist/Components/Skeleton/composables/useSkeleton.js +5 -5
- package/dist/Components/Snackbar/Snackbar.vue_vue_type_script_setup_true_lang.js +54 -54
- package/dist/Components/Snackbar/composables/useSnackbar.js +115 -115
- package/dist/Components/Spinner/composables/useSpinner.js +11 -11
- package/dist/Components/Switch/Switch.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/Components/Switch/composables/useSwitch.d.ts +3 -3
- package/dist/Components/Switch/composables/useSwitch.js +9 -9
- package/dist/Components/Tab/composables/useTab.js +11 -11
- package/dist/Components/TabList/composables/useTabList.js +7 -7
- package/dist/Components/TabPanel/composables/useTabPanel.js +7 -7
- package/dist/Components/Tabs/composables/useTabs.js +22 -22
- package/dist/Components/TextField/TextField.vue.d.ts +1 -1
- package/dist/Components/TextField/TextField.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/Components/TextField/composables/useTextField.d.ts +4 -4
- package/dist/Components/TextField/composables/useTextField.js +1 -1
- package/dist/Components/Textarea/Textarea.vue.d.ts +1 -1
- package/dist/Components/Textarea/Textarea.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/Components/Textarea/composables/useTextarea.d.ts +4 -4
- package/dist/Components/Textarea/composables/useTextarea.js +9 -9
- package/dist/Components/Tooltip/composables/useTooltip.js +17 -17
- package/dist/Provider/bridgeUITypes.d.ts +4 -1
- package/dist/Provider/createBridgeUIApi.js +13 -1
- package/dist/Utils/index.js +7 -7
- package/dist/Utils/useBreakpoint.js +7 -7
- package/dist/augments.d.ts +2 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +84 -80
- package/package.json +3 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { hasNamedSlot as e, hasSlotOrProp as t } from "../../../Utils/slotOrProp.js";
|
|
2
2
|
import { mergeNestedComponentProps as n, mergePartBind as r, useBridgeUIComponent as i, useBridgeUIMergedRegistryClasses as a } from "../../../Utils/index.js";
|
|
3
3
|
import { computed as o, toValue as s, useId as c, useSlots as l } from "vue";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { cn as u, mergeBridgeUILayeredClasses as d, splitComponentProps as f } from "@bridge-ui/core";
|
|
5
|
+
import { get as p, omit as m } from "es-toolkit/compat";
|
|
6
6
|
import { colorProps as h, invalidatedProps as g, roundedProps as _, sizeProps as v, variantProps as y } from "@bridge-ui/core/Tokens/FormField";
|
|
7
7
|
//#region src/Components/FormField/composables/useFormField.ts
|
|
8
8
|
var b = [
|
|
@@ -25,11 +25,11 @@ var b = [
|
|
|
25
25
|
"customProps",
|
|
26
26
|
"description",
|
|
27
27
|
"errorMessage",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
28
|
+
"showErrorIcon",
|
|
29
|
+
"hideErrorMessage"
|
|
30
30
|
];
|
|
31
31
|
function x(x, S, C = {}) {
|
|
32
|
-
let ee = c(), w = l(), T = o(() =>
|
|
32
|
+
let ee = c(), w = l(), T = o(() => f({
|
|
33
33
|
props: s(x),
|
|
34
34
|
bridgeKeys: b
|
|
35
35
|
})), { merged: E, entry: D } = i({
|
|
@@ -39,28 +39,28 @@ function x(x, S, C = {}) {
|
|
|
39
39
|
}), O = o(() => E.value.customProps), k = o(() => C.control?.() ?? "input"), A = a({
|
|
40
40
|
entry: D,
|
|
41
41
|
props: () => T.value.componentProps
|
|
42
|
-
}), j = o(() => E.value.error === !0), M = o(() => !!E.value.disabled), N = o(() => !!E.value.readonly), P = o(() => E.value.variant ?? "outline"), F = o(() => E.value.errorIcon ?? "alert"), I = o(() => P.value === "notched"), L = o(() => P.value === "stacked"), R = o(() => P.value === "underlined"), z = o(() => k.value === "textarea"), B = o(() => z.value && !!C.likeInput?.()), V = o(() => !E.value.
|
|
42
|
+
}), j = o(() => E.value.error === !0), M = o(() => !!E.value.disabled), N = o(() => !!E.value.readonly), P = o(() => E.value.variant ?? "outline"), F = o(() => E.value.errorIcon ?? "alert"), I = o(() => P.value === "notched"), L = o(() => P.value === "stacked"), R = o(() => P.value === "underlined"), z = o(() => k.value === "textarea"), B = o(() => z.value && !!C.likeInput?.()), V = o(() => !E.value.hideErrorMessage), H = o(() => {
|
|
43
43
|
let e = T.value.inheritedAttrs.id;
|
|
44
44
|
return E.value.controlId ?? e ?? ee;
|
|
45
45
|
}), U = o(() => j.value && t(w, "errorMessage", E.value.errorMessage)), W = o(() => (I.value || L.value) && (t(w, "label", E.value.label) || t(w, "corner", E.value.corner))), G = o(() => t(w, "label", E.value.label) ? "justify-between items-end" : "justify-end"), K = o(() => {
|
|
46
46
|
let e = [];
|
|
47
|
-
return !j.value && t(w, "description", E.value.description) && e.push(`${H.value}-description`), j.value && !E.value.
|
|
48
|
-
}), q = o(() =>
|
|
47
|
+
return !j.value && t(w, "description", E.value.description) && e.push(`${H.value}-description`), j.value && !E.value.hideErrorMessage && t(w, "errorMessage", E.value.errorMessage) && e.push(`${H.value}-error`), e.length > 0 ? e.join(" ") : void 0;
|
|
48
|
+
}), q = o(() => p(d(v, D.value?.tokens?.size), [E.value.size, P.value])), J = o(() => p(d(h, D.value?.tokens?.color), E.value.color ?? "primary")), Y = o(() => d(g, D.value?.tokens?.invalidated, E.value.customProps?.invalidated)), X = o(() => j.value ? Y.value : void 0), Z = o(() => p(d(_, D.value?.tokens?.rounded), E.value.rounded)), Q = o(() => p(d(y, D.value?.tokens?.variant), P.value)), te = o(() => {
|
|
49
49
|
let e = j.value ? Y.value : J.value;
|
|
50
50
|
return R.value ? e?.underlined : e?.input;
|
|
51
51
|
}), ne = o(() => {
|
|
52
|
-
if (L.value) return
|
|
52
|
+
if (L.value) return u({
|
|
53
53
|
[q.value?.insetTop ?? ""]: !0,
|
|
54
54
|
[q.value?.insetStart ?? ""]: !0,
|
|
55
55
|
[q.value?.insetEnd ?? ""]: !0
|
|
56
56
|
});
|
|
57
57
|
}), re = o(() => {
|
|
58
58
|
let t = C.reservedSlots?.() ?? [], n = e(w, "end") || t.includes("end"), r = e(w, "start") || t.includes("start");
|
|
59
|
-
if (!L.value) return !r && !n ? q.value?.padding :
|
|
59
|
+
if (!L.value) return !r && !n ? q.value?.padding : u({
|
|
60
60
|
[q.value?.insetStart ?? ""]: !r,
|
|
61
61
|
[q.value?.insetEnd ?? ""]: !n
|
|
62
62
|
});
|
|
63
|
-
}), ie = o(() => r(O.value?.end, {},
|
|
63
|
+
}), ie = o(() => r(O.value?.end, {}, u({
|
|
64
64
|
"shrink-0 self-center flex items-center whitespace-nowrap select-none pointer-events-none": !0,
|
|
65
65
|
"text-gray-500": !j.value,
|
|
66
66
|
[Z.value?.end ?? ""]: !R.value && !L.value,
|
|
@@ -70,15 +70,15 @@ function x(x, S, C = {}) {
|
|
|
70
70
|
}))), ae = o(() => {
|
|
71
71
|
let e = T.value.inheritedAttrs;
|
|
72
72
|
return r(O.value?.root, {
|
|
73
|
-
class:
|
|
74
|
-
...
|
|
75
|
-
},
|
|
73
|
+
class: u(e.class),
|
|
74
|
+
...m(e, ["class"])
|
|
75
|
+
}, u({
|
|
76
76
|
"group w-full relative": !0,
|
|
77
77
|
"aria-disabled:pointer-events-none aria-disabled:select-none aria-disabled:opacity-60": !0,
|
|
78
78
|
"aria-readonly:pointer-events-none aria-readonly:select-none": !0,
|
|
79
79
|
[A.value.root ?? ""]: !0
|
|
80
80
|
}));
|
|
81
|
-
}), oe = o(() => r(O.value?.errorMessage, {},
|
|
81
|
+
}), oe = o(() => r(O.value?.errorMessage, {}, u({
|
|
82
82
|
"mt-2": !0,
|
|
83
83
|
"min-h-[1lh]": V.value,
|
|
84
84
|
[X.value?.errorMessage ?? ""]: !0,
|
|
@@ -91,7 +91,7 @@ function x(x, S, C = {}) {
|
|
|
91
91
|
readonly: N.value,
|
|
92
92
|
"aria-describedby": K.value,
|
|
93
93
|
"aria-invalid": j.value || void 0
|
|
94
|
-
},
|
|
94
|
+
}, m(T.value.inheritedAttrs, ["class"]), u({
|
|
95
95
|
"flex-1 min-w-0 min-h-0 bg-transparent border-0 shadow-none": !0,
|
|
96
96
|
"h-full": !z.value && !L.value,
|
|
97
97
|
"max-h-none": z.value,
|
|
@@ -109,26 +109,26 @@ function x(x, S, C = {}) {
|
|
|
109
109
|
required: E.value.required,
|
|
110
110
|
classes: {
|
|
111
111
|
required: A.value.required,
|
|
112
|
-
root:
|
|
112
|
+
root: u({
|
|
113
113
|
[Q.value?.label ?? ""]: I.value,
|
|
114
114
|
[A.value.label ?? ""]: !0
|
|
115
115
|
})
|
|
116
116
|
}
|
|
117
|
-
})), ce = o(() => r(O.value?.start, {},
|
|
117
|
+
})), ce = o(() => r(O.value?.start, {}, u({
|
|
118
118
|
"shrink-0 self-center flex items-center whitespace-nowrap select-none pointer-events-none": !0,
|
|
119
119
|
"text-gray-400": !j.value,
|
|
120
120
|
[Z.value?.start ?? ""]: !R.value && !L.value,
|
|
121
121
|
[J.value?.start ?? ""]: !j.value,
|
|
122
122
|
[X.value?.adornment ?? ""]: j.value,
|
|
123
123
|
[A.value.start ?? ""]: !0
|
|
124
|
-
}))), le = o(() => r(O.value?.corner, {},
|
|
124
|
+
}))), le = o(() => r(O.value?.corner, {}, u({
|
|
125
125
|
"text-gray-500 dark:text-gray-400": !I.value,
|
|
126
126
|
[q.value?.text ?? ""]: !0,
|
|
127
127
|
[Q.value?.corner ?? ""]: I.value,
|
|
128
128
|
[A.value.corner ?? ""]: !0
|
|
129
129
|
}))), ue = o(() => {
|
|
130
130
|
let e = t(w, "label", E.value.label);
|
|
131
|
-
return r(O.value?.header, {},
|
|
131
|
+
return r(O.value?.header, {}, u({
|
|
132
132
|
flex: !0,
|
|
133
133
|
"w-full shrink-0": !0,
|
|
134
134
|
"justify-between": e,
|
|
@@ -138,20 +138,20 @@ function x(x, S, C = {}) {
|
|
|
138
138
|
[Q.value?.labelRow ?? ""]: W.value,
|
|
139
139
|
[A.value.header ?? ""]: !0
|
|
140
140
|
}));
|
|
141
|
-
}), de = o(() => r(O.value?.header, {},
|
|
141
|
+
}), de = o(() => r(O.value?.header, {}, u({
|
|
142
142
|
flex: !0,
|
|
143
143
|
"mb-1": !0,
|
|
144
144
|
[G.value]: !0,
|
|
145
145
|
[A.value.header ?? ""]: !0
|
|
146
|
-
}))), fe = o(() => r(O.value?.endIcon, {},
|
|
146
|
+
}))), fe = o(() => r(O.value?.endIcon, {}, u({ "inline-flex shrink-0 items-center justify-center self-center": L.value }))), pe = o(() => r(O.value?.end, {}, u({
|
|
147
147
|
"group/end wrapper-end-slot shrink-0 flex w-auto items-stretch self-stretch [&>*]:min-h-0": !0,
|
|
148
148
|
"self-stretch min-h-0 overflow-hidden py-0.5 pe-0.5": L.value,
|
|
149
149
|
"h-full min-h-0 overflow-hidden py-0.5 pe-0.5": !L.value,
|
|
150
150
|
[A.value.end ?? ""]: !0
|
|
151
|
-
}))), me = o(() => r({}, {},
|
|
151
|
+
}))), me = o(() => r({}, {}, u({
|
|
152
152
|
"flex min-h-0 min-w-0 flex-1 flex-col": !0,
|
|
153
153
|
[ne.value ?? ""]: !0
|
|
154
|
-
}))), he = o(() => r({}, {},
|
|
154
|
+
}))), he = o(() => r({}, {}, u({
|
|
155
155
|
"flex w-full min-w-0 flex-1 items-stretch gap-x-2": !0,
|
|
156
156
|
[q.value?.controlRow ?? ""]: !0
|
|
157
157
|
})));
|
|
@@ -176,7 +176,7 @@ function x(x, S, C = {}) {
|
|
|
176
176
|
endIconBind: fe,
|
|
177
177
|
endSlotBind: pe,
|
|
178
178
|
invalidated: j,
|
|
179
|
-
containerBind: o(() => r(O.value?.container, { "data-bridge-rounded": E.value.rounded ?? "md" },
|
|
179
|
+
containerBind: o(() => r(O.value?.container, { "data-bridge-rounded": E.value.rounded ?? "md" }, u({
|
|
180
180
|
"group/field relative flex flex-row items-stretch overflow-hidden": L.value,
|
|
181
181
|
"group/field relative flex justify-start gap-x-2 items-stretch": !L.value,
|
|
182
182
|
"transition-all ease-in-out duration-150 outline-none": !0,
|
|
@@ -193,8 +193,8 @@ function x(x, S, C = {}) {
|
|
|
193
193
|
[X.value?.containerUnderlined ?? ""]: j.value && R.value,
|
|
194
194
|
[A.value.container ?? ""]: !0
|
|
195
195
|
}))),
|
|
196
|
-
startIconBind: o(() => r(O.value?.startIcon, {},
|
|
197
|
-
startSlotBind: o(() => r(O.value?.start, {},
|
|
196
|
+
startIconBind: o(() => r(O.value?.startIcon, {}, u({ "inline-flex shrink-0 items-center justify-center self-center": L.value }))),
|
|
197
|
+
startSlotBind: o(() => r(O.value?.start, {}, u({
|
|
198
198
|
"group/start wrapper-start-slot shrink-0 flex w-auto items-stretch self-stretch [&>*]:min-h-0": !0,
|
|
199
199
|
"self-stretch min-h-0 overflow-hidden py-0.5 ps-0.5": L.value,
|
|
200
200
|
"h-full min-h-0 overflow-hidden py-0.5 ps-0.5": !L.value,
|
|
@@ -202,7 +202,7 @@ function x(x, S, C = {}) {
|
|
|
202
202
|
}))),
|
|
203
203
|
fieldLabelProps: se,
|
|
204
204
|
ariaDescribedBy: K,
|
|
205
|
-
descriptionBind: o(() => r(O.value?.description, {},
|
|
205
|
+
descriptionBind: o(() => r(O.value?.description, {}, u({
|
|
206
206
|
"mt-2 text-gray-500 dark:text-gray-400": !0,
|
|
207
207
|
[q.value?.text ?? ""]: !0,
|
|
208
208
|
[A.value.description ?? ""]: !0
|
|
@@ -175,7 +175,7 @@ export interface FormFieldOwnProps {
|
|
|
175
175
|
*/
|
|
176
176
|
error?: boolean;
|
|
177
177
|
/**
|
|
178
|
-
* Icon used when `
|
|
178
|
+
* Icon used when `showErrorIcon` is enabled and the field is invalid.
|
|
179
179
|
*
|
|
180
180
|
* @default "alert"
|
|
181
181
|
*/
|
|
@@ -194,6 +194,12 @@ export interface FormFieldOwnProps {
|
|
|
194
194
|
* @default undefined
|
|
195
195
|
*/
|
|
196
196
|
field?: UseFormFieldReturn;
|
|
197
|
+
/**
|
|
198
|
+
* When `true`, does not reserve space below the control for error messages.
|
|
199
|
+
*
|
|
200
|
+
* @default false
|
|
201
|
+
*/
|
|
202
|
+
hideErrorMessage?: boolean;
|
|
197
203
|
/**
|
|
198
204
|
* The primary label text above the control.
|
|
199
205
|
*
|
|
@@ -218,6 +224,13 @@ export interface FormFieldOwnProps {
|
|
|
218
224
|
* @default "md"
|
|
219
225
|
*/
|
|
220
226
|
rounded?: MergeProps<FormFieldRounded, FormFieldRoundedOverrides>;
|
|
227
|
+
/**
|
|
228
|
+
* When `true` and the field is invalid, shows an error icon at the inline end
|
|
229
|
+
* when no `endIcon` or `end` slot is present.
|
|
230
|
+
*
|
|
231
|
+
* @default true
|
|
232
|
+
*/
|
|
233
|
+
showErrorIcon?: boolean;
|
|
221
234
|
/**
|
|
222
235
|
* Typography scale for label, corner, description, and error message, and
|
|
223
236
|
* control sizing (input, container, icons).
|
|
@@ -248,19 +261,6 @@ export interface FormFieldOwnProps {
|
|
|
248
261
|
* @default "outline"
|
|
249
262
|
*/
|
|
250
263
|
variant?: MergeProps<FormFieldVariant, FormFieldVariantOverrides>;
|
|
251
|
-
/**
|
|
252
|
-
* When `true` and the field is invalid, shows an error icon at the inline end
|
|
253
|
-
* when no `endIcon` or `end` slot is present.
|
|
254
|
-
*
|
|
255
|
-
* @default true
|
|
256
|
-
*/
|
|
257
|
-
withErrorIcon?: boolean;
|
|
258
|
-
/**
|
|
259
|
-
* When `true`, does not reserve space below the control for error messages.
|
|
260
|
-
*
|
|
261
|
-
* @default false
|
|
262
|
-
*/
|
|
263
|
-
withoutErrorMessage?: boolean;
|
|
264
264
|
}
|
|
265
265
|
export interface FormFieldSlots {
|
|
266
266
|
/**
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useIconAdapter as e } from "../../../Adapters/Icon/useIconAdapter.js";
|
|
2
2
|
import { mergePartBind as t, useBridgeUIComponent as n } from "../../../Utils/index.js";
|
|
3
3
|
import { computed as r, useAttrs as i } from "vue";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { cn as a, mergeBridgeUILayeredClasses as o, resolveIconSource as s, splitComponentProps as c } from "@bridge-ui/core";
|
|
5
|
+
import { get as l } from "es-toolkit/compat";
|
|
6
6
|
import { sizeProps as u } from "@bridge-ui/core/Tokens/Icon";
|
|
7
7
|
//#region src/Components/Icon/composables/useIcon.ts
|
|
8
8
|
var d = ["icon", "size"];
|
|
9
9
|
function f(f, p) {
|
|
10
|
-
let m = i(), h = r(() =>
|
|
10
|
+
let m = i(), h = r(() => c({
|
|
11
11
|
bridgeKeys: d,
|
|
12
12
|
props: {
|
|
13
13
|
...m,
|
|
@@ -17,10 +17,10 @@ function f(f, p) {
|
|
|
17
17
|
libDefaults: p,
|
|
18
18
|
componentName: "Icon",
|
|
19
19
|
props: () => h.value.componentProps
|
|
20
|
-
}), v = e(), y = r(() =>
|
|
20
|
+
}), v = e(), y = r(() => s(g.value.icon, v.value)), b = r(() => l(o(u, _.value?.tokens?.size), g.value.size));
|
|
21
21
|
return {
|
|
22
22
|
merged: g,
|
|
23
|
-
rootBind: r(() => t({}, h.value.inheritedAttrs,
|
|
23
|
+
rootBind: r(() => t({}, h.value.inheritedAttrs, a({ [b.value ?? ""]: !0 }))),
|
|
24
24
|
resolvedIcon: y
|
|
25
25
|
};
|
|
26
26
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
2
|
import { computed as r, useAttrs as i } from "vue";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { cn as a, mergeBridgeUILayeredClasses as o, splitComponentProps as s } from "@bridge-ui/core";
|
|
4
|
+
import { get as c } from "es-toolkit/compat";
|
|
5
5
|
import { invalidatedProps as l, sizeProps as u } from "@bridge-ui/core/Tokens/Label";
|
|
6
6
|
//#region src/Components/Label/composables/useLabel.ts
|
|
7
7
|
var d = [
|
|
@@ -11,7 +11,7 @@ var d = [
|
|
|
11
11
|
"required"
|
|
12
12
|
];
|
|
13
13
|
function f(f, p) {
|
|
14
|
-
let m = i(), h = r(() =>
|
|
14
|
+
let m = i(), h = r(() => s({
|
|
15
15
|
bridgeKeys: d,
|
|
16
16
|
props: {
|
|
17
17
|
...m,
|
|
@@ -24,13 +24,13 @@ function f(f, p) {
|
|
|
24
24
|
}), v = n({
|
|
25
25
|
entry: _,
|
|
26
26
|
props: () => h.value.componentProps
|
|
27
|
-
}), y = r(() =>
|
|
27
|
+
}), y = r(() => c(o(u, _.value?.tokens?.size), g.value.size)), b = r(() => o(l, _.value?.tokens?.invalidated)), x = r(() => e({}, {}, a({
|
|
28
28
|
[b.value.required ?? ""]: !0,
|
|
29
29
|
[v.value.required ?? ""]: !0
|
|
30
30
|
})));
|
|
31
31
|
return {
|
|
32
32
|
merged: g,
|
|
33
|
-
rootBind: r(() => e({}, h.value.inheritedAttrs,
|
|
33
|
+
rootBind: r(() => e({}, h.value.inheritedAttrs, a({
|
|
34
34
|
"inline-flex items-center gap-x-0.5 font-medium leading-none": !0,
|
|
35
35
|
"text-gray-700 dark:text-gray-300": !g.value.error,
|
|
36
36
|
[b.value.label ?? ""]: g.value.error,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
2
|
import { computed as r, useAttrs as i, useSlots as a } from "vue";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { cn as o, mergeBridgeUILayeredClasses as s, splitComponentProps as c } from "@bridge-ui/core";
|
|
4
|
+
import { get as l } from "es-toolkit/compat";
|
|
5
5
|
import { colorProps as u, sizeProps as d, underlineProps as f } from "@bridge-ui/core/Tokens/Link";
|
|
6
6
|
//#region src/Components/Link/composables/useLink.ts
|
|
7
7
|
var p = [
|
|
@@ -17,7 +17,7 @@ var p = [
|
|
|
17
17
|
"customProps"
|
|
18
18
|
];
|
|
19
19
|
function m(m, h) {
|
|
20
|
-
let g = i(), _ = a(), v = r(() =>
|
|
20
|
+
let g = i(), _ = a(), v = r(() => c({
|
|
21
21
|
bridgeKeys: p,
|
|
22
22
|
props: {
|
|
23
23
|
...g,
|
|
@@ -34,28 +34,28 @@ function m(m, h) {
|
|
|
34
34
|
if (y.value.external && !C.value) return "_blank";
|
|
35
35
|
}), D = r(() => {
|
|
36
36
|
if (y.value.external && !C.value) return "noopener noreferrer";
|
|
37
|
-
}), O = r(() =>
|
|
37
|
+
}), O = r(() => l(s(d, b.value?.tokens?.size), y.value.size)), k = r(() => l(s(u, b.value?.tokens?.color), y.value.color)), A = r(() => l(s(f, b.value?.tokens?.underline), y.value.underline));
|
|
38
38
|
return {
|
|
39
39
|
slots: _,
|
|
40
40
|
merged: y,
|
|
41
41
|
rootRel: D,
|
|
42
|
-
rootBind: r(() => e(x.value?.root, v.value.inheritedAttrs,
|
|
42
|
+
rootBind: r(() => e(x.value?.root, v.value.inheritedAttrs, o({
|
|
43
43
|
"inline-flex items-center gap-x-1 font-medium": !0,
|
|
44
44
|
"transition-colors duration-200": !0,
|
|
45
45
|
[O.value ?? ""]: !0,
|
|
46
46
|
[A.value ?? ""]: !0,
|
|
47
|
-
[
|
|
48
|
-
[
|
|
47
|
+
[l(k.value, "base") ?? ""]: !0,
|
|
48
|
+
[l(k.value, "hover") ?? ""]: !0,
|
|
49
49
|
"aria-disabled:opacity-80 aria-disabled:cursor-not-allowed aria-disabled:pointer-events-none": !0,
|
|
50
50
|
[S.value.root ?? ""]: !0
|
|
51
51
|
}))),
|
|
52
52
|
rootHref: T,
|
|
53
53
|
rootTarget: E,
|
|
54
|
-
leftIconBind: r(() => e(x.value?.leftIcon, {},
|
|
54
|
+
leftIconBind: r(() => e(x.value?.leftIcon, {}, o({
|
|
55
55
|
"shrink-0": !0,
|
|
56
56
|
[S.value.leftIcon ?? ""]: !0
|
|
57
57
|
}))),
|
|
58
|
-
rightIconBind: r(() => e(x.value?.rightIcon, {},
|
|
58
|
+
rightIconBind: r(() => e(x.value?.rightIcon, {}, o({
|
|
59
59
|
"shrink-0": !0,
|
|
60
60
|
[S.value.rightIcon ?? ""]: !0
|
|
61
61
|
}))),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { mergePartBind as e, useBridgeUIComponent as t, useBridgeUIMergedRegistryClasses as n } from "../../../Utils/index.js";
|
|
2
2
|
import { LIST_INJECTION_KEY as r } from "../listInjectionKey.js";
|
|
3
3
|
import { computed as i, provide as a, useAttrs as o } from "vue";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { cn as s, splitComponentProps as c } from "@bridge-ui/core";
|
|
5
|
+
import { get as l, omit as u } from "es-toolkit/compat";
|
|
6
6
|
//#region src/Components/List/composables/useList.ts
|
|
7
7
|
var d = [
|
|
8
8
|
"as",
|
|
@@ -12,7 +12,7 @@ var d = [
|
|
|
12
12
|
"customProps"
|
|
13
13
|
];
|
|
14
14
|
function f(f) {
|
|
15
|
-
let p = o(), m = i(() =>
|
|
15
|
+
let p = o(), m = i(() => c({
|
|
16
16
|
bridgeKeys: d,
|
|
17
17
|
props: {
|
|
18
18
|
...p,
|
|
@@ -26,13 +26,13 @@ function f(f) {
|
|
|
26
26
|
props: () => m.value.componentProps
|
|
27
27
|
});
|
|
28
28
|
a(r, i(() => ({ dense: h.value.dense === !0 })));
|
|
29
|
-
let y = i(() =>
|
|
29
|
+
let y = i(() => u(m.value.inheritedAttrs, []));
|
|
30
30
|
return {
|
|
31
31
|
merged: h,
|
|
32
|
-
rootBind: i(() => e(_.value?.root, y.value,
|
|
32
|
+
rootBind: i(() => e(_.value?.root, y.value, s({
|
|
33
33
|
"m-0 list-none py-2 text-dark-900 dark:text-dark-100": !0,
|
|
34
34
|
"pl-4": h.value.nested,
|
|
35
|
-
[
|
|
35
|
+
[l(v.value, "root") ?? ""]: !0
|
|
36
36
|
})))
|
|
37
37
|
};
|
|
38
38
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { hasNamedSlot as e, isPropPresent as t, resolveNamedSlot as n } from "../../../Utils/slotOrProp.js";
|
|
2
2
|
import { mergePartBind as r, useBridgeUIComponent as i, useBridgeUIMergedRegistryClasses as a } from "../../../Utils/index.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { getListboxOptionId as o } from "../../Listbox/composables/useListboxNavigation.js";
|
|
4
|
+
import { LIST_INJECTION_KEY as s } from "../../List/listInjectionKey.js";
|
|
5
5
|
import { LISTBOX_INJECTION_KEY as c } from "../../Listbox/listboxInjectionKey.js";
|
|
6
6
|
import { computed as l, getCurrentInstance as u, inject as d, onBeforeUnmount as f, toValue as p, useAttrs as m, watch as h } from "vue";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { cn as g, splitComponentProps as _ } from "@bridge-ui/core";
|
|
8
|
+
import { get as v, isNull as y, omit as b } from "es-toolkit/compat";
|
|
9
9
|
//#region src/Components/ListItem/composables/useListItem.ts
|
|
10
10
|
var x = [
|
|
11
11
|
"as",
|
|
@@ -23,7 +23,7 @@ var x = [
|
|
|
23
23
|
"selectedIcon"
|
|
24
24
|
];
|
|
25
25
|
function S(t, n, S) {
|
|
26
|
-
let C = m(), w = d(
|
|
26
|
+
let C = m(), w = d(s, null), T = d(c, null), E = T != null, D = l(() => _({
|
|
27
27
|
props: {
|
|
28
28
|
...C,
|
|
29
29
|
...t
|
|
@@ -52,13 +52,13 @@ function S(t, n, S) {
|
|
|
52
52
|
let N = l(() => j.value != null), P = l(() => !j.value || !A.value ? !1 : A.value.isSelected(j.value.value)), F = l(() => !j.value || !A.value ? -1 : A.value.getOptionIndex(j.value.value)), I = l(() => !A.value || F.value < 0 ? !1 : A.value.highlightedIndex === F.value), L = l(() => O.value.customProps), R = a({
|
|
53
53
|
entry: k,
|
|
54
54
|
props: () => D.value.componentProps
|
|
55
|
-
}), z = l(() => "dense" in (u()?.vnode.props ?? {}) ? t.dense === !0 : t.dense === !0 ? !0 : w ? p(w).dense : !1), B = l(() => e(S, "primary") || e(S, "default") || !!O.value.primary), V = l(() => e(S, "secondary") || !!O.value.secondary), H = l(() => e(S, "start")), U = l(() => N.value ? !P.value || !A.value?.showCheckmark ? null : "check" : !O.value.selected ||
|
|
56
|
-
class:
|
|
55
|
+
}), z = l(() => "dense" in (u()?.vnode.props ?? {}) ? t.dense === !0 : t.dense === !0 ? !0 : w ? p(w).dense : !1), B = l(() => e(S, "primary") || e(S, "default") || !!O.value.primary), V = l(() => e(S, "secondary") || !!O.value.secondary), H = l(() => e(S, "start")), U = l(() => N.value ? !P.value || !A.value?.showCheckmark ? null : "check" : !O.value.selected || y(O.value.selectedIcon) ? null : O.value.selectedIcon ?? "check"), W = l(() => e(S, "end") || U.value != null), G = l(() => b(D.value.inheritedAttrs, [])), K = l(() => r(L.value?.root, G.value, {
|
|
56
|
+
class: g({
|
|
57
57
|
"list-none": !0,
|
|
58
58
|
"border-b border-black/10 last:border-b-0 dark:border-white/10": O.value.divider,
|
|
59
|
-
[
|
|
59
|
+
[v(R.value, "root") ?? ""]: !0
|
|
60
60
|
}),
|
|
61
|
-
id: N.value && A.value?.listboxId && F.value >= 0 ?
|
|
61
|
+
id: N.value && A.value?.listboxId && F.value >= 0 ? o(A.value.listboxId, F.value) : void 0
|
|
62
62
|
})), q = l(() => O.value.interactive || N.value ? r(L.value?.interactive, {}, {
|
|
63
63
|
"aria-disabled": O.value.disabled ? !0 : void 0,
|
|
64
64
|
role: N.value ? "option" : O.value.role,
|
|
@@ -71,7 +71,7 @@ function S(t, n, S) {
|
|
|
71
71
|
onClick: N.value ? () => {
|
|
72
72
|
j.value && A.value?.onSelect(j.value);
|
|
73
73
|
} : void 0,
|
|
74
|
-
class:
|
|
74
|
+
class: g({
|
|
75
75
|
"flex w-full min-w-0 items-center gap-x-3 text-left text-dark-900 outline-hidden transition-colors dark:text-dark-100": !0,
|
|
76
76
|
"cursor-pointer select-none": !O.value.disabled,
|
|
77
77
|
"px-4": !0,
|
|
@@ -84,28 +84,28 @@ function S(t, n, S) {
|
|
|
84
84
|
[A.value?.optionHighlightedClass ?? ""]: N.value && I.value && !P.value,
|
|
85
85
|
[A.value?.mergedClasses.optionHighlighted ?? ""]: N.value && I.value && !P.value,
|
|
86
86
|
"opacity-50 pointer-events-none": O.value.disabled,
|
|
87
|
-
[
|
|
87
|
+
[v(R.value, "interactive") ?? ""]: !0,
|
|
88
88
|
[A.value?.sizeClasses?.option ?? ""]: !0
|
|
89
89
|
})
|
|
90
|
-
}) : null), J = l(() =>
|
|
90
|
+
}) : null), J = l(() => g({
|
|
91
91
|
"flex w-full min-w-0 gap-x-3": !0,
|
|
92
92
|
"items-center text-dark-900 dark:text-dark-100": !O.value.interactive,
|
|
93
93
|
"px-4": !O.value.interactive,
|
|
94
94
|
"py-2": !O.value.interactive && !z.value,
|
|
95
95
|
"py-1.5": !O.value.interactive && z.value
|
|
96
|
-
})), Y = l(() => r(L.value?.start, {},
|
|
96
|
+
})), Y = l(() => r(L.value?.start, {}, g({
|
|
97
97
|
"flex shrink-0 text-dark-600 dark:text-dark-300": !0,
|
|
98
|
-
[
|
|
99
|
-
}))), X = l(() => r(L.value?.content, {},
|
|
98
|
+
[v(R.value, "start") ?? ""]: !0
|
|
99
|
+
}))), X = l(() => r(L.value?.content, {}, g({
|
|
100
100
|
"min-w-0 flex-1": !0,
|
|
101
|
-
[
|
|
102
|
-
}))), Z = l(() => r(L.value?.primary, {},
|
|
101
|
+
[v(R.value, "content") ?? ""]: !0
|
|
102
|
+
}))), Z = l(() => r(L.value?.primary, {}, g("block truncate text-sm font-medium", A.value?.sizeClasses?.primary, v(R.value, "primary")))), Q = l(() => r(L.value?.secondary, {}, g("mt-0.5 block truncate text-xs text-dark-500 dark:text-dark-400", A.value?.sizeClasses?.secondary, v(R.value, "secondary"))));
|
|
103
103
|
return {
|
|
104
104
|
merged: O,
|
|
105
105
|
hasEnd: W,
|
|
106
|
-
endBind: l(() => r(L.value?.end, {},
|
|
106
|
+
endBind: l(() => r(L.value?.end, {}, g({
|
|
107
107
|
"ml-auto flex shrink-0 items-center": !0,
|
|
108
|
-
[
|
|
108
|
+
[v(R.value, "end") ?? ""]: !0
|
|
109
109
|
}))),
|
|
110
110
|
rootBind: K,
|
|
111
111
|
rowClass: J,
|
|
@@ -119,7 +119,7 @@ function S(t, n, S) {
|
|
|
119
119
|
interactiveBind: q,
|
|
120
120
|
selectedIconBind: l(() => r(L.value?.selectedIcon, {}, {
|
|
121
121
|
size: "sm",
|
|
122
|
-
class:
|
|
122
|
+
class: g("shrink-0", A.value?.checkClass, v(R.value, "selectedIcon"))
|
|
123
123
|
})),
|
|
124
124
|
resolvedSelectedIcon: U
|
|
125
125
|
};
|
|
@@ -2,8 +2,8 @@ import { resolveSlotOrProp as e } from "../../../Utils/slotOrProp.js";
|
|
|
2
2
|
import { mergePartBind as t, useBridgeUIComponent as n, useBridgeUIMergedRegistryClasses as r } from "../../../Utils/index.js";
|
|
3
3
|
import { LIST_INJECTION_KEY as i } from "../../List/listInjectionKey.js";
|
|
4
4
|
import { computed as a, inject as o, toValue as s, useAttrs as c } from "vue";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { cn as l, splitComponentProps as u } from "@bridge-ui/core";
|
|
6
|
+
import { get as d, omit as f } from "es-toolkit/compat";
|
|
7
7
|
//#region src/Components/ListSection/composables/useListSection.ts
|
|
8
8
|
var p = [
|
|
9
9
|
"as",
|
|
@@ -14,7 +14,7 @@ var p = [
|
|
|
14
14
|
"customProps"
|
|
15
15
|
];
|
|
16
16
|
function m(m, h) {
|
|
17
|
-
let g = c(), _ = o(i, null), v = a(() =>
|
|
17
|
+
let g = c(), _ = o(i, null), v = a(() => u({
|
|
18
18
|
props: {
|
|
19
19
|
...g,
|
|
20
20
|
...m
|
|
@@ -26,24 +26,24 @@ function m(m, h) {
|
|
|
26
26
|
}), x = a(() => y.value.customProps), S = r({
|
|
27
27
|
entry: b,
|
|
28
28
|
props: () => v.value.componentProps
|
|
29
|
-
}), C = a(() => _ ? s(_).dense : !1), w = a(() => e(h, "default", y.value.title)), T = a(() =>
|
|
29
|
+
}), C = a(() => _ ? s(_).dense : !1), w = a(() => e(h, "default", y.value.title)), T = a(() => f(v.value.inheritedAttrs, [])), E = a(() => y.value.as === "div");
|
|
30
30
|
return {
|
|
31
31
|
label: w,
|
|
32
32
|
merged: y,
|
|
33
|
-
rootBind: a(() => t(x.value?.root, T.value,
|
|
33
|
+
rootBind: a(() => t(x.value?.root, T.value, l({
|
|
34
34
|
"list-none": !0,
|
|
35
35
|
"sticky top-0 z-10 bg-white dark:bg-dark-800": y.value.sticky && !E.value,
|
|
36
|
-
[
|
|
36
|
+
[d(S.value, "root") ?? ""]: !0
|
|
37
37
|
}))),
|
|
38
38
|
titleBind: a(() => t(x.value?.title, {}, {
|
|
39
39
|
role: "presentation",
|
|
40
|
-
class:
|
|
40
|
+
class: l({
|
|
41
41
|
"bg-white px-4 text-xs font-semibold tracking-wide text-dark-500 uppercase dark:bg-dark-800 dark:text-dark-300": !0,
|
|
42
42
|
"sticky top-0 z-10": y.value.sticky && E.value,
|
|
43
43
|
"py-2": !C.value,
|
|
44
44
|
"py-1.5": C.value,
|
|
45
45
|
"pl-14": y.value.inset,
|
|
46
|
-
[
|
|
46
|
+
[d(S.value, "title") ?? ""]: !0
|
|
47
47
|
})
|
|
48
48
|
}))
|
|
49
49
|
};
|