base-ui-vue 0.1.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.
- package/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/button/Button.cjs +524 -0
- package/dist/button/Button.cjs.map +1 -0
- package/dist/button/Button.js +453 -0
- package/dist/button/Button.js.map +1 -0
- package/dist/composite/composite.cjs +56 -0
- package/dist/composite/composite.cjs.map +1 -0
- package/dist/composite/composite.js +21 -0
- package/dist/composite/composite.js.map +1 -0
- package/dist/control/FieldControl.cjs +576 -0
- package/dist/control/FieldControl.cjs.map +1 -0
- package/dist/control/FieldControl.js +511 -0
- package/dist/control/FieldControl.js.map +1 -0
- package/dist/control/FieldControlDataAttributes.cjs +42 -0
- package/dist/control/FieldControlDataAttributes.cjs.map +1 -0
- package/dist/control/FieldControlDataAttributes.js +36 -0
- package/dist/control/FieldControlDataAttributes.js.map +1 -0
- package/dist/description/FieldDescription.cjs +86 -0
- package/dist/description/FieldDescription.cjs.map +1 -0
- package/dist/description/FieldDescription.js +81 -0
- package/dist/description/FieldDescription.js.map +1 -0
- package/dist/direction-provider/DirectionContext.cjs +26 -0
- package/dist/direction-provider/DirectionContext.cjs.map +1 -0
- package/dist/direction-provider/DirectionContext.js +15 -0
- package/dist/direction-provider/DirectionContext.js.map +1 -0
- package/dist/direction-provider/DirectionProvider.cjs +37 -0
- package/dist/direction-provider/DirectionProvider.cjs.map +1 -0
- package/dist/direction-provider/DirectionProvider.js +32 -0
- package/dist/direction-provider/DirectionProvider.js.map +1 -0
- package/dist/error/FieldError.cjs +414 -0
- package/dist/error/FieldError.cjs.map +1 -0
- package/dist/error/FieldError.js +373 -0
- package/dist/error/FieldError.js.map +1 -0
- package/dist/fallback/AvatarFallback.cjs +165 -0
- package/dist/fallback/AvatarFallback.cjs.map +1 -0
- package/dist/fallback/AvatarFallback.js +136 -0
- package/dist/fallback/AvatarFallback.js.map +1 -0
- package/dist/form/Form.cjs +159 -0
- package/dist/form/Form.cjs.map +1 -0
- package/dist/form/Form.js +154 -0
- package/dist/form/Form.js.map +1 -0
- package/dist/header/AccordionHeader.cjs +189 -0
- package/dist/header/AccordionHeader.cjs.map +1 -0
- package/dist/header/AccordionHeader.js +148 -0
- package/dist/header/AccordionHeader.js.map +1 -0
- package/dist/image/AvatarImage.cjs +150 -0
- package/dist/image/AvatarImage.cjs.map +1 -0
- package/dist/image/AvatarImage.js +145 -0
- package/dist/image/AvatarImage.js.map +1 -0
- package/dist/image/AvatarImageDataAttributes.cjs +26 -0
- package/dist/image/AvatarImageDataAttributes.cjs.map +1 -0
- package/dist/image/AvatarImageDataAttributes.js +20 -0
- package/dist/image/AvatarImageDataAttributes.js.map +1 -0
- package/dist/index.cjs +64 -0
- package/dist/index.d.cts +1501 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +1501 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index2.cjs +2767 -0
- package/dist/index2.cjs.map +1 -0
- package/dist/index2.js +2618 -0
- package/dist/index2.js.map +1 -0
- package/package.json +77 -0
- package/src/accordion/accordion.types.ts +126 -0
- package/src/accordion/header/AccordionHeader.vue +36 -0
- package/src/accordion/index.ts +10 -0
- package/src/accordion/item/AccordionItem.vue +124 -0
- package/src/accordion/item/AccordionItemContext.ts +24 -0
- package/src/accordion/item/AccordionItemDataAttributes.ts +15 -0
- package/src/accordion/item/stateAttributesMapping.ts +14 -0
- package/src/accordion/panel/AccordionPanel.vue +156 -0
- package/src/accordion/panel/AccordionPanelCssVars.ts +12 -0
- package/src/accordion/root/AccordionRoot.vue +130 -0
- package/src/accordion/root/AccordionRootContext.ts +37 -0
- package/src/accordion/root/AccordionRootDataAttributes.ts +10 -0
- package/src/accordion/root/stateAttributesMapping.ts +6 -0
- package/src/accordion/trigger/AccordionTrigger.vue +186 -0
- package/src/avatar/fallback/AvatarFallback.vue +75 -0
- package/src/avatar/image/AvatarImage.vue +103 -0
- package/src/avatar/image/AvatarImageDataAttributes.ts +14 -0
- package/src/avatar/image/useImageLoadingStatus.ts +58 -0
- package/src/avatar/index.ts +19 -0
- package/src/avatar/root/AvatarRoot.vue +62 -0
- package/src/avatar/root/AvatarRootContext.ts +22 -0
- package/src/avatar/root/stateAttributesMapping.ts +7 -0
- package/src/button/Button.vue +59 -0
- package/src/button/ButtonDataAttributes.ts +6 -0
- package/src/button/button.types.ts +22 -0
- package/src/button/index.ts +2 -0
- package/src/collapsible/collapsible.types.ts +64 -0
- package/src/collapsible/index.ts +6 -0
- package/src/collapsible/panel/CollapsiblePanel.vue +145 -0
- package/src/collapsible/panel/CollapsiblePanelCssVars.ts +12 -0
- package/src/collapsible/panel/CollapsiblePanelDataAttributes.ts +18 -0
- package/src/collapsible/panel/useCollapsiblePanel.ts +489 -0
- package/src/collapsible/root/CollapsibleRoot.vue +60 -0
- package/src/collapsible/root/CollapsibleRootContext.ts +18 -0
- package/src/collapsible/root/stateAttributesMapping.ts +9 -0
- package/src/collapsible/root/useCollapsibleRoot.ts +252 -0
- package/src/collapsible/trigger/CollapsibleTrigger.vue +63 -0
- package/src/collapsible/trigger/CollapsibleTriggerDataAttributes.ts +6 -0
- package/src/composite/composite.ts +232 -0
- package/src/composite/constants.ts +1 -0
- package/src/composite/item/CompositeItem.vue +75 -0
- package/src/composite/item/useCompositeItem.ts +63 -0
- package/src/composite/list/CompositeList.vue +168 -0
- package/src/composite/list/CompositeListContext.ts +21 -0
- package/src/composite/list/useCompositeListItem.ts +130 -0
- package/src/composite/root/CompositeRoot.vue +106 -0
- package/src/composite/root/CompositeRootContext.ts +36 -0
- package/src/composite/root/index.ts +7 -0
- package/src/composite/root/useCompositeRoot.ts +418 -0
- package/src/direction-provider/DirectionContext.ts +29 -0
- package/src/direction-provider/DirectionProvider.vue +31 -0
- package/src/direction-provider/index.ts +8 -0
- package/src/field/control/FieldControl.vue +211 -0
- package/src/field/control/FieldControlDataAttributes.ts +30 -0
- package/src/field/description/FieldDescription.vue +62 -0
- package/src/field/description/FieldDescriptionDataAttributes.ts +30 -0
- package/src/field/error/FieldError.vue +159 -0
- package/src/field/error/FieldErrorDataAttributes.ts +38 -0
- package/src/field/index.ts +27 -0
- package/src/field/item/FieldItem.vue +63 -0
- package/src/field/item/FieldItemContext.ts +16 -0
- package/src/field/label/FieldLabel.vue +102 -0
- package/src/field/label/FieldLabelDataAttributes.ts +30 -0
- package/src/field/root/FieldRoot.vue +262 -0
- package/src/field/root/FieldRootContext.ts +97 -0
- package/src/field/root/FieldRootDataAttributes.ts +30 -0
- package/src/field/root/useFieldRootState.ts +81 -0
- package/src/field/root/useFieldValidation.ts +298 -0
- package/src/field/root/useFieldValidity.ts +30 -0
- package/src/field/useField.ts +73 -0
- package/src/field/utils/constants.ts +45 -0
- package/src/field/utils/getCombinedFieldValidityData.ts +18 -0
- package/src/field/validity/FieldValidity.vue +36 -0
- package/src/fieldset/index.ts +8 -0
- package/src/fieldset/legend/FieldsetLegend.vue +72 -0
- package/src/fieldset/root/FieldsetRoot.vue +74 -0
- package/src/fieldset/root/FieldsetRootContext.ts +26 -0
- package/src/floating-ui-vue/types.ts +4 -0
- package/src/floating-ui-vue/utils/composite.ts +475 -0
- package/src/floating-ui-vue/utils/constants.ts +4 -0
- package/src/floating-ui-vue/utils/event.ts +4 -0
- package/src/floating-ui-vue/utils.ts +2 -0
- package/src/form/Form.vue +188 -0
- package/src/form/FormContext.ts +59 -0
- package/src/form/index.ts +10 -0
- package/src/index.ts +14 -0
- package/src/labelable-provider/LabelableContext.ts +33 -0
- package/src/labelable-provider/LabelableProvider.vue +55 -0
- package/src/labelable-provider/index.ts +6 -0
- package/src/labelable-provider/useAriaLabelledBy.ts +100 -0
- package/src/labelable-provider/useLabelableId.ts +30 -0
- package/src/merge-props/index.ts +1 -0
- package/src/merge-props/mergeProps.ts +192 -0
- package/src/test/index.ts +1 -0
- package/src/test/utils.ts +9 -0
- package/src/types/index.ts +10 -0
- package/src/use-button/index.ts +1 -0
- package/src/use-button/useButton.ts +231 -0
- package/src/use-render/index.ts +1 -0
- package/src/use-render/useRender.spec.ts +90 -0
- package/src/use-render/useRender.ts +152 -0
- package/src/utils/collapsibleOpenStateMapping.ts +33 -0
- package/src/utils/constants.ts +1 -0
- package/src/utils/createBaseUIEventDetails.ts +127 -0
- package/src/utils/empty.ts +5 -0
- package/src/utils/error.ts +19 -0
- package/src/utils/getStateAttributesProps.ts +31 -0
- package/src/utils/isElementDisabled.ts +7 -0
- package/src/utils/noop.ts +1 -0
- package/src/utils/reasons.ts +69 -0
- package/src/utils/resolveRef.ts +9 -0
- package/src/utils/slot.ts +6 -0
- package/src/utils/stateAttributesMapping.ts +28 -0
- package/src/utils/transitionStatusMapping.ts +22 -0
- package/src/utils/types.ts +47 -0
- package/src/utils/useAnimationFrame.ts +130 -0
- package/src/utils/useAnimationsFinished.ts +101 -0
- package/src/utils/useBaseUiId.ts +9 -0
- package/src/utils/useControllableState.ts +44 -0
- package/src/utils/useFocusableWhenDisabled.ts +85 -0
- package/src/utils/useId.ts +26 -0
- package/src/utils/useMergedRefs.ts +91 -0
- package/src/utils/useOpenChangeComplete.ts +52 -0
- package/src/utils/useRenderElement.ts +162 -0
- package/src/utils/useTimeout.ts +48 -0
- package/src/utils/useTransitionStatus.ts +104 -0
- package/src/utils/warn.ts +15 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 vuepont
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# base-ui-vue
|
|
@@ -0,0 +1,524 @@
|
|
|
1
|
+
let vue = require("vue");
|
|
2
|
+
let _floating_ui_utils_dom = require("@floating-ui/utils/dom");
|
|
3
|
+
|
|
4
|
+
//#region src/merge-props/mergeProps.ts
|
|
5
|
+
function makeEventPreventable(event) {
|
|
6
|
+
const baseUIEvent = event;
|
|
7
|
+
if (!baseUIEvent.preventBaseUIHandler) baseUIEvent.preventBaseUIHandler = () => {
|
|
8
|
+
baseUIEvent.baseUIHandlerPrevented = true;
|
|
9
|
+
};
|
|
10
|
+
return baseUIEvent;
|
|
11
|
+
}
|
|
12
|
+
function mergeClasses(ourClass, theirClass) {
|
|
13
|
+
if (theirClass) {
|
|
14
|
+
if (ourClass) return `${theirClass} ${ourClass}`;
|
|
15
|
+
return theirClass;
|
|
16
|
+
}
|
|
17
|
+
return ourClass;
|
|
18
|
+
}
|
|
19
|
+
function mergeObjects(a, b) {
|
|
20
|
+
if (a && !b) return a;
|
|
21
|
+
if (!a && b) return b;
|
|
22
|
+
if (a || b) return {
|
|
23
|
+
...a,
|
|
24
|
+
...b
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function isEventHandler(key, value) {
|
|
28
|
+
return key.startsWith("on") && key.charCodeAt(2) >= 65 && key.charCodeAt(2) <= 90 && (typeof value === "function" || Array.isArray(value) || typeof value === "undefined");
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Merges Vue prop/attr objects using Base UI Vue semantics.
|
|
32
|
+
*
|
|
33
|
+
* Later props overwrite earlier ones, except for:
|
|
34
|
+
* - Event listeners: merged so the rightmost listener runs first and can prevent earlier listeners.
|
|
35
|
+
* - `class`: merged in rightmost-first order.
|
|
36
|
+
* - `style`: merged using Vue's native style merging.
|
|
37
|
+
*/
|
|
38
|
+
function mergeProps(...args) {
|
|
39
|
+
const definedArgs = args.filter((arg) => arg != null);
|
|
40
|
+
const merged = (0, vue.mergeProps)(...definedArgs);
|
|
41
|
+
const classValue = mergeClassValues(definedArgs);
|
|
42
|
+
if (classValue !== void 0) merged.class = classValue;
|
|
43
|
+
for (const propName in merged) if (isEventHandler(propName, merged[propName])) merged[propName] = wrapEventHandlers(merged[propName]);
|
|
44
|
+
return merged;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Merges an array of Vue prop/attr objects using the same semantics as {@link mergeProps}.
|
|
48
|
+
*
|
|
49
|
+
* Useful when prop layers are assembled dynamically before being bound with `v-bind`.
|
|
50
|
+
*/
|
|
51
|
+
function mergePropsN(props) {
|
|
52
|
+
const definedProps = props.filter((prop) => prop != null);
|
|
53
|
+
if (definedProps.length === 0) return {};
|
|
54
|
+
return mergeProps(...definedProps);
|
|
55
|
+
}
|
|
56
|
+
function mergeClassValues(args) {
|
|
57
|
+
const classValues = args.map((props) => props?.class).filter((value) => value != null);
|
|
58
|
+
if (classValues.length === 0) return;
|
|
59
|
+
return (0, vue.normalizeClass)(classValues.reverse());
|
|
60
|
+
}
|
|
61
|
+
function wrapEventHandlers(handlers) {
|
|
62
|
+
if (Array.isArray(handlers)) {
|
|
63
|
+
const flatHandlers = handlers.flat(Infinity).filter((handler) => typeof handler === "function");
|
|
64
|
+
return (...args) => {
|
|
65
|
+
const preventableArgs = getPreventableArgs(args);
|
|
66
|
+
if (preventableArgs) {
|
|
67
|
+
let result;
|
|
68
|
+
for (let i = flatHandlers.length - 1; i >= 0; i -= 1) {
|
|
69
|
+
const handlerResult = flatHandlers[i](...preventableArgs.args);
|
|
70
|
+
if (result === void 0) result = handlerResult;
|
|
71
|
+
if (preventableArgs.event.baseUIHandlerPrevented) break;
|
|
72
|
+
}
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
let result;
|
|
76
|
+
for (let i = flatHandlers.length - 1; i >= 0; i -= 1) {
|
|
77
|
+
const handlerResult = flatHandlers[i](...args);
|
|
78
|
+
if (result === void 0) result = handlerResult;
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
if (typeof handlers !== "function") return handlers;
|
|
84
|
+
return (...args) => {
|
|
85
|
+
const preventableArgs = getPreventableArgs(args);
|
|
86
|
+
if (preventableArgs) return handlers(...preventableArgs.args);
|
|
87
|
+
return handlers(...args);
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function getPreventableArgs(args) {
|
|
91
|
+
const eventIndex = args.findIndex(isPreventableEventArg);
|
|
92
|
+
if (eventIndex === -1) return null;
|
|
93
|
+
const nextArgs = [...args];
|
|
94
|
+
const event = makeEventPreventable(nextArgs[eventIndex]);
|
|
95
|
+
nextArgs[eventIndex] = event;
|
|
96
|
+
return {
|
|
97
|
+
args: nextArgs,
|
|
98
|
+
event
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function isPreventableEventArg(value) {
|
|
102
|
+
return Boolean(value && typeof value === "object" && (value instanceof Event || "nativeEvent" in value || "preventBaseUIHandler" in value));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/utils/empty.ts
|
|
107
|
+
function NOOP() {}
|
|
108
|
+
const EMPTY_ARRAY = Object.freeze([]);
|
|
109
|
+
const EMPTY_OBJECT = Object.freeze({});
|
|
110
|
+
|
|
111
|
+
//#endregion
|
|
112
|
+
//#region src/utils/getStateAttributesProps.ts
|
|
113
|
+
function getStateAttributesProps(state, customMapping) {
|
|
114
|
+
const props = {};
|
|
115
|
+
for (const key in state) {
|
|
116
|
+
const value = state[key];
|
|
117
|
+
if (customMapping && Object.prototype.hasOwnProperty.call(customMapping, key)) {
|
|
118
|
+
const customProps = customMapping[key](value);
|
|
119
|
+
if (customProps != null) Object.assign(props, customProps);
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
if (value === true) props[`data-${key.toLowerCase()}`] = "";
|
|
123
|
+
else if (value !== false && value != null) props[`data-${key.toLowerCase()}`] = value.toString();
|
|
124
|
+
}
|
|
125
|
+
return props;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/utils/slot.ts
|
|
130
|
+
/**
|
|
131
|
+
* Pass as the `as` prop to make a component renderless.
|
|
132
|
+
*/
|
|
133
|
+
const Slot = Symbol("Slot");
|
|
134
|
+
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region src/utils/useMergedRefs.ts
|
|
137
|
+
/**
|
|
138
|
+
* Merges multiple refs or ref callbacks into a single template ref callback.
|
|
139
|
+
* Returns `undefined` when all input refs are nullish (optimization to avoid no-op callbacks).
|
|
140
|
+
*
|
|
141
|
+
* Supports cleanup callbacks: if a callback ref returns a function, it will be
|
|
142
|
+
* called on unmount (when the ref receives `null`) instead of calling the
|
|
143
|
+
* callback with `null` directly.
|
|
144
|
+
*
|
|
145
|
+
* Vue-specific: automatically unwraps `ComponentPublicInstance` to its root `$el`,
|
|
146
|
+
* since Vue template refs on components return the instance, not the DOM element.
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```vue
|
|
150
|
+
* <script setup>
|
|
151
|
+
* const internalRef = ref(null)
|
|
152
|
+
* const externalRef = ref(null)
|
|
153
|
+
*
|
|
154
|
+
* const mergedRef = useMergedRefs(internalRef, externalRef)
|
|
155
|
+
* <\/script>
|
|
156
|
+
*
|
|
157
|
+
* <template>
|
|
158
|
+
* <div :ref="mergedRef"></div>
|
|
159
|
+
* </template>
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
function useMergedRefs(...refs) {
|
|
163
|
+
if (refs.every((ref) => ref == null)) return;
|
|
164
|
+
const cleanupCallbacks = Array.from({ length: refs.length }, () => null);
|
|
165
|
+
return (el) => {
|
|
166
|
+
const instance = el && "$el" in el ? el.$el : el;
|
|
167
|
+
if (instance != null) for (let i = 0; i < refs.length; i += 1) {
|
|
168
|
+
const ref = refs[i];
|
|
169
|
+
if (ref == null) continue;
|
|
170
|
+
if (typeof ref === "function") {
|
|
171
|
+
const refCleanup = ref(instance);
|
|
172
|
+
if (typeof refCleanup === "function") cleanupCallbacks[i] = refCleanup;
|
|
173
|
+
} else if ("value" in ref) ref.value = instance;
|
|
174
|
+
}
|
|
175
|
+
else for (let i = 0; i < refs.length; i += 1) {
|
|
176
|
+
const ref = refs[i];
|
|
177
|
+
if (ref == null) continue;
|
|
178
|
+
if (typeof ref === "function") {
|
|
179
|
+
const cleanupCallback = cleanupCallbacks[i];
|
|
180
|
+
if (typeof cleanupCallback === "function") {
|
|
181
|
+
cleanupCallback();
|
|
182
|
+
cleanupCallbacks[i] = null;
|
|
183
|
+
} else ref(null);
|
|
184
|
+
} else if ("value" in ref) ref.value = null;
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/utils/useRenderElement.ts
|
|
191
|
+
/**
|
|
192
|
+
* Renders a Base UI element (internal composable).
|
|
193
|
+
*
|
|
194
|
+
* Assembles state-to-data-attribute conversion, class/style resolution,
|
|
195
|
+
* and ref wrapping into a single composable used by all polymorphic components.
|
|
196
|
+
*
|
|
197
|
+
* @param params - The render element parameters.
|
|
198
|
+
*/
|
|
199
|
+
function useRenderElement(params) {
|
|
200
|
+
const renderless = (0, vue.computed)(() => params.componentProps.as === Slot);
|
|
201
|
+
return {
|
|
202
|
+
tag: (0, vue.computed)(() => {
|
|
203
|
+
if (renderless.value) return;
|
|
204
|
+
return params.componentProps.as ?? params.defaultTagName ?? "div";
|
|
205
|
+
}),
|
|
206
|
+
mergedProps: (0, vue.computed)(() => {
|
|
207
|
+
const state = (0, vue.unref)(params.state);
|
|
208
|
+
const rawProps = (0, vue.unref)(params.props) ?? EMPTY_OBJECT;
|
|
209
|
+
const merged = {
|
|
210
|
+
...getStateAttributesProps(state, params.stateAttributesMapping),
|
|
211
|
+
...rawProps
|
|
212
|
+
};
|
|
213
|
+
const resolvedClass = typeof params.componentProps.class === "function" ? params.componentProps.class(state) : params.componentProps.class;
|
|
214
|
+
const resolvedStyle = typeof params.componentProps.style === "function" ? params.componentProps.style(state) : params.componentProps.style;
|
|
215
|
+
if (resolvedClass !== void 0) merged.class = normalizeClass(merged.class, resolvedClass);
|
|
216
|
+
if (resolvedStyle !== void 0) merged.style = normalizeStyle(merged.style, resolvedStyle);
|
|
217
|
+
return merged;
|
|
218
|
+
}),
|
|
219
|
+
renderless,
|
|
220
|
+
state: params.state,
|
|
221
|
+
ref: params.ref ? useMergedRefs(params.ref) : void 0
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function normalizeClass(currentValue, nextValue) {
|
|
225
|
+
if (currentValue == null) return nextValue;
|
|
226
|
+
if (nextValue == null) return currentValue;
|
|
227
|
+
if (typeof currentValue === "string" && typeof nextValue === "string") return mergeClasses(currentValue, nextValue);
|
|
228
|
+
return [currentValue, nextValue];
|
|
229
|
+
}
|
|
230
|
+
function normalizeStyle(currentValue, nextValue) {
|
|
231
|
+
if (currentValue == null) return nextValue;
|
|
232
|
+
if (nextValue == null) return currentValue;
|
|
233
|
+
if (isPlainObject(currentValue) && isPlainObject(nextValue)) return mergeObjects(currentValue, nextValue);
|
|
234
|
+
return [currentValue, nextValue];
|
|
235
|
+
}
|
|
236
|
+
function isPlainObject(value) {
|
|
237
|
+
return value != null && typeof value === "object" && !Array.isArray(value);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region src/composite/root/CompositeRootContext.ts
|
|
242
|
+
const compositeRootContextKey = Symbol("CompositeRootContext");
|
|
243
|
+
function useCompositeRootContext(optional = false) {
|
|
244
|
+
const context = (0, vue.inject)(compositeRootContextKey, void 0);
|
|
245
|
+
if (context === void 0 && !optional) throw new Error("Base UI Vue: CompositeRootContext is missing. Composite parts must be placed within <CompositeRoot>.");
|
|
246
|
+
return context;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
//#endregion
|
|
250
|
+
//#region src/utils/error.ts
|
|
251
|
+
let set;
|
|
252
|
+
if (process.env.NODE_ENV !== "production") set = /* @__PURE__ */ new Set();
|
|
253
|
+
function error(...messages) {
|
|
254
|
+
if (process.env.NODE_ENV !== "production") {
|
|
255
|
+
const messageKey = messages.join(" ");
|
|
256
|
+
if (!set.has(messageKey)) {
|
|
257
|
+
set.add(messageKey);
|
|
258
|
+
console.error(`Base UI Vue: ${messageKey}`);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
//#endregion
|
|
264
|
+
//#region src/utils/useFocusableWhenDisabled.ts
|
|
265
|
+
function useFocusableWhenDisabled(params) {
|
|
266
|
+
return { props: (0, vue.computed)(() => {
|
|
267
|
+
const focusableWhenDisabled = (0, vue.toValue)(params.focusableWhenDisabled);
|
|
268
|
+
const disabled = (0, vue.toValue)(params.disabled);
|
|
269
|
+
const composite = (0, vue.toValue)(params.composite) ?? false;
|
|
270
|
+
const tabIndexProp = (0, vue.toValue)(params.tabIndex) ?? 0;
|
|
271
|
+
const isNativeButton = (0, vue.toValue)(params.isNativeButton);
|
|
272
|
+
const isFocusableComposite = composite && focusableWhenDisabled !== false;
|
|
273
|
+
const isNonFocusableComposite = composite && focusableWhenDisabled === false;
|
|
274
|
+
const additionalProps = { onKeydown(event) {
|
|
275
|
+
if (disabled && focusableWhenDisabled && event.key !== "Tab") event.preventDefault();
|
|
276
|
+
} };
|
|
277
|
+
if (!composite) {
|
|
278
|
+
additionalProps.tabIndex = tabIndexProp;
|
|
279
|
+
if (!isNativeButton && disabled) additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;
|
|
280
|
+
}
|
|
281
|
+
if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled) additionalProps["aria-disabled"] = disabled;
|
|
282
|
+
if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) additionalProps.disabled = disabled;
|
|
283
|
+
return additionalProps;
|
|
284
|
+
}) };
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
//#endregion
|
|
288
|
+
//#region src/use-button/useButton.ts
|
|
289
|
+
function useButton(parameters = {}) {
|
|
290
|
+
const buttonRef = (0, vue.ref)(null);
|
|
291
|
+
const { props: focusableWhenDisabledProps } = useFocusableWhenDisabled({
|
|
292
|
+
focusableWhenDisabled: () => (0, vue.toValue)(parameters.focusableWhenDisabled) ?? false,
|
|
293
|
+
disabled: () => (0, vue.toValue)(parameters.disabled) ?? false,
|
|
294
|
+
isNativeButton: () => (0, vue.toValue)(parameters.native) ?? true,
|
|
295
|
+
tabIndex: () => (0, vue.toValue)(parameters.tabIndex) ?? 0
|
|
296
|
+
});
|
|
297
|
+
if (process.env.NODE_ENV !== "production") (0, vue.watchEffect)(() => {
|
|
298
|
+
if (!buttonRef.value) return;
|
|
299
|
+
const isButtonTag = isButtonElement(buttonRef.value);
|
|
300
|
+
if ((0, vue.toValue)(parameters.native) ?? true) {
|
|
301
|
+
if (!isButtonTag) error("A component that acts as a button expected a native <button> because the `nativeButton` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the `as` prop, or set `nativeButton` to `false`.");
|
|
302
|
+
} else if (isButtonTag) error("A component that acts as a button expected a non-<button> because the `nativeButton` prop is false. Rendering a <button> keeps native behavior while Base UI Vue applies non-native attributes and handlers, which can add unintended extra attributes (such as `role` or `aria-disabled`). Use a non-<button> in the `as` prop, or set `nativeButton` to `true`.");
|
|
303
|
+
});
|
|
304
|
+
const isCompositeItem = useCompositeRootContext(true) !== void 0;
|
|
305
|
+
const updateDisabled = () => {
|
|
306
|
+
const element = buttonRef.value;
|
|
307
|
+
if (!isButtonElement(element)) return;
|
|
308
|
+
if (isCompositeItem && (0, vue.toValue)(parameters.disabled) && focusableWhenDisabledProps.value.disabled === void 0 && element.disabled) element.disabled = false;
|
|
309
|
+
};
|
|
310
|
+
(0, vue.watchEffect)(updateDisabled, { flush: "post" });
|
|
311
|
+
const getButtonProps = (externalProps = {}) => {
|
|
312
|
+
const { onClick: externalOnClick, onMousedown: externalOnMousedown, onKeydown: externalOnKeydown, onKeyup: externalOnKeyup, onPointerdown: externalOnPointerdown, ...otherExternalProps } = externalProps;
|
|
313
|
+
const disabled = (0, vue.toValue)(parameters.disabled) ?? false;
|
|
314
|
+
const isNativeButton = (0, vue.toValue)(parameters.native) ?? true;
|
|
315
|
+
return mergeProps({
|
|
316
|
+
type: isNativeButton ? "button" : void 0,
|
|
317
|
+
onClick(event) {
|
|
318
|
+
if (disabled) {
|
|
319
|
+
event.preventDefault();
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
externalOnClick?.(event);
|
|
323
|
+
},
|
|
324
|
+
onMousedown(event) {
|
|
325
|
+
if (!disabled) externalOnMousedown?.(event);
|
|
326
|
+
},
|
|
327
|
+
onKeydown(event) {
|
|
328
|
+
if (disabled) return;
|
|
329
|
+
makeEventPreventable(event);
|
|
330
|
+
externalOnKeydown?.(event);
|
|
331
|
+
if (event.baseUIHandlerPrevented) return;
|
|
332
|
+
if (event.target === event.currentTarget && !isNativeButton && !isValidLinkElement(buttonRef.value)) {
|
|
333
|
+
const isEnterKey = event.key === "Enter";
|
|
334
|
+
if (event.key === " " || isEnterKey) event.preventDefault();
|
|
335
|
+
if (isEnterKey) externalOnClick?.(event);
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
onKeyup(event) {
|
|
339
|
+
if (disabled) return;
|
|
340
|
+
makeEventPreventable(event);
|
|
341
|
+
externalOnKeyup?.(event);
|
|
342
|
+
if (event.baseUIHandlerPrevented) return;
|
|
343
|
+
if (event.target === event.currentTarget && !isNativeButton && event.key === " ") externalOnClick?.(event);
|
|
344
|
+
},
|
|
345
|
+
onPointerdown(event) {
|
|
346
|
+
if (disabled) {
|
|
347
|
+
event.preventDefault();
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
externalOnPointerdown?.(event);
|
|
351
|
+
}
|
|
352
|
+
}, !isNativeButton ? { role: "button" } : void 0, focusableWhenDisabledProps.value, otherExternalProps);
|
|
353
|
+
};
|
|
354
|
+
return {
|
|
355
|
+
getButtonProps,
|
|
356
|
+
buttonRef
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
function isButtonElement(elem) {
|
|
360
|
+
return (0, _floating_ui_utils_dom.isHTMLElement)(elem) && elem.tagName === "BUTTON";
|
|
361
|
+
}
|
|
362
|
+
function isValidLinkElement(elem) {
|
|
363
|
+
return Boolean(elem?.tagName === "A" && elem?.href);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
//#endregion
|
|
367
|
+
//#region src/button/Button.vue?vue&type=script&setup=true&lang.ts
|
|
368
|
+
var Button_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.defineComponent)({
|
|
369
|
+
name: "BaseUIButton",
|
|
370
|
+
inheritAttrs: false,
|
|
371
|
+
__name: "Button",
|
|
372
|
+
props: {
|
|
373
|
+
disabled: {
|
|
374
|
+
type: Boolean,
|
|
375
|
+
required: false,
|
|
376
|
+
default: false
|
|
377
|
+
},
|
|
378
|
+
focusableWhenDisabled: {
|
|
379
|
+
type: Boolean,
|
|
380
|
+
required: false,
|
|
381
|
+
default: false
|
|
382
|
+
},
|
|
383
|
+
nativeButton: {
|
|
384
|
+
type: Boolean,
|
|
385
|
+
required: false,
|
|
386
|
+
default: void 0
|
|
387
|
+
},
|
|
388
|
+
as: {
|
|
389
|
+
type: null,
|
|
390
|
+
required: false,
|
|
391
|
+
default: "button"
|
|
392
|
+
},
|
|
393
|
+
class: {
|
|
394
|
+
type: Function,
|
|
395
|
+
required: false,
|
|
396
|
+
skipCheck: true
|
|
397
|
+
},
|
|
398
|
+
style: {
|
|
399
|
+
type: [
|
|
400
|
+
Boolean,
|
|
401
|
+
null,
|
|
402
|
+
String,
|
|
403
|
+
Object,
|
|
404
|
+
Array,
|
|
405
|
+
Function
|
|
406
|
+
],
|
|
407
|
+
required: false,
|
|
408
|
+
skipCheck: true
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
setup(__props) {
|
|
412
|
+
const props = __props;
|
|
413
|
+
const attrs = (0, vue.useAttrs)();
|
|
414
|
+
const { getButtonProps, buttonRef } = useButton({
|
|
415
|
+
disabled: () => props.disabled,
|
|
416
|
+
focusableWhenDisabled: () => props.focusableWhenDisabled,
|
|
417
|
+
native: (0, vue.computed)(() => {
|
|
418
|
+
if (props.nativeButton !== void 0) return props.nativeButton;
|
|
419
|
+
return typeof props.as === "string" && props.as.toLowerCase() === "button";
|
|
420
|
+
})
|
|
421
|
+
});
|
|
422
|
+
const state = (0, vue.computed)(() => ({ disabled: props.disabled }));
|
|
423
|
+
const { tag, mergedProps, renderless, ref: renderRef } = useRenderElement({
|
|
424
|
+
componentProps: props,
|
|
425
|
+
state,
|
|
426
|
+
props: (0, vue.computed)(() => getButtonProps({ ...attrs })),
|
|
427
|
+
defaultTagName: "button",
|
|
428
|
+
ref: buttonRef
|
|
429
|
+
});
|
|
430
|
+
return (_ctx, _cache) => {
|
|
431
|
+
return (0, vue.unref)(renderless) ? (0, vue.renderSlot)(_ctx.$slots, "default", {
|
|
432
|
+
key: 0,
|
|
433
|
+
ref: (0, vue.unref)(renderRef),
|
|
434
|
+
props: (0, vue.unref)(mergedProps),
|
|
435
|
+
state: state.value
|
|
436
|
+
}) : ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)((0, vue.unref)(tag)), (0, vue.mergeProps)({
|
|
437
|
+
key: 1,
|
|
438
|
+
ref: (0, vue.unref)(renderRef)
|
|
439
|
+
}, (0, vue.unref)(mergedProps)), {
|
|
440
|
+
default: (0, vue.withCtx)(() => [(0, vue.renderSlot)(_ctx.$slots, "default", { state: state.value })]),
|
|
441
|
+
_: 3
|
|
442
|
+
}, 16));
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
//#endregion
|
|
448
|
+
//#region src/button/Button.vue
|
|
449
|
+
var Button_default = Button_vue_vue_type_script_setup_true_lang_default;
|
|
450
|
+
|
|
451
|
+
//#endregion
|
|
452
|
+
Object.defineProperty(exports, 'Button_default', {
|
|
453
|
+
enumerable: true,
|
|
454
|
+
get: function () {
|
|
455
|
+
return Button_default;
|
|
456
|
+
}
|
|
457
|
+
});
|
|
458
|
+
Object.defineProperty(exports, 'EMPTY_OBJECT', {
|
|
459
|
+
enumerable: true,
|
|
460
|
+
get: function () {
|
|
461
|
+
return EMPTY_OBJECT;
|
|
462
|
+
}
|
|
463
|
+
});
|
|
464
|
+
Object.defineProperty(exports, 'NOOP', {
|
|
465
|
+
enumerable: true,
|
|
466
|
+
get: function () {
|
|
467
|
+
return NOOP;
|
|
468
|
+
}
|
|
469
|
+
});
|
|
470
|
+
Object.defineProperty(exports, 'Slot', {
|
|
471
|
+
enumerable: true,
|
|
472
|
+
get: function () {
|
|
473
|
+
return Slot;
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
Object.defineProperty(exports, 'makeEventPreventable', {
|
|
477
|
+
enumerable: true,
|
|
478
|
+
get: function () {
|
|
479
|
+
return makeEventPreventable;
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
Object.defineProperty(exports, 'mergeClasses', {
|
|
483
|
+
enumerable: true,
|
|
484
|
+
get: function () {
|
|
485
|
+
return mergeClasses;
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
Object.defineProperty(exports, 'mergeObjects', {
|
|
489
|
+
enumerable: true,
|
|
490
|
+
get: function () {
|
|
491
|
+
return mergeObjects;
|
|
492
|
+
}
|
|
493
|
+
});
|
|
494
|
+
Object.defineProperty(exports, 'mergeProps', {
|
|
495
|
+
enumerable: true,
|
|
496
|
+
get: function () {
|
|
497
|
+
return mergeProps;
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
Object.defineProperty(exports, 'mergePropsN', {
|
|
501
|
+
enumerable: true,
|
|
502
|
+
get: function () {
|
|
503
|
+
return mergePropsN;
|
|
504
|
+
}
|
|
505
|
+
});
|
|
506
|
+
Object.defineProperty(exports, 'useButton', {
|
|
507
|
+
enumerable: true,
|
|
508
|
+
get: function () {
|
|
509
|
+
return useButton;
|
|
510
|
+
}
|
|
511
|
+
});
|
|
512
|
+
Object.defineProperty(exports, 'useMergedRefs', {
|
|
513
|
+
enumerable: true,
|
|
514
|
+
get: function () {
|
|
515
|
+
return useMergedRefs;
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
Object.defineProperty(exports, 'useRenderElement', {
|
|
519
|
+
enumerable: true,
|
|
520
|
+
get: function () {
|
|
521
|
+
return useRenderElement;
|
|
522
|
+
}
|
|
523
|
+
});
|
|
524
|
+
//# sourceMappingURL=Button.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.cjs","names":[],"sources":["../../src/merge-props/mergeProps.ts","../../src/utils/empty.ts","../../src/utils/getStateAttributesProps.ts","../../src/utils/slot.ts","../../src/utils/useMergedRefs.ts","../../src/utils/useRenderElement.ts","../../src/composite/root/CompositeRootContext.ts","../../src/utils/error.ts","../../src/utils/useFocusableWhenDisabled.ts","../../src/use-button/useButton.ts","../../src/button/Button.vue","../../src/button/Button.vue"],"sourcesContent":[],"mappings":";;;;AAGA,SAAgB,qBACd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