@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
51 lines (48 loc) • 1.64 kB
JavaScript
import { defineComponent, mergeDefaults, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot } from 'vue';
import { ark } from '../factory.js';
import { usePasswordInput } from './use-password-input.js';
import { PasswordInputProvider } from './use-password-input-context.js';
import { useForwardExpose } from '../../utils/use-forward-expose.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "password-input-root",
props: /* @__PURE__ */ mergeDefaults({
autoComplete: {},
defaultVisible: { type: Boolean },
disabled: { type: Boolean },
id: {},
ids: {},
ignorePasswordManagers: { type: Boolean },
invalid: { type: Boolean },
name: {},
readOnly: { type: Boolean },
required: { type: Boolean },
translations: {},
visible: { type: Boolean },
asChild: { type: Boolean }
}, {
defaultVisible: void 0,
disabled: void 0,
ignorePasswordManagers: void 0,
invalid: void 0,
readOnly: void 0,
required: void 0,
visible: void 0
}),
emits: ["visibilityChange", "update:visible"],
setup(__props, { emit: __emit }) {
const props = __props;
const emits = __emit;
const passwordInput = usePasswordInput(props, emits);
PasswordInputProvider(passwordInput);
useForwardExpose();
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ark).div, mergeProps(unref(passwordInput).getRootProps(), { "as-child": __props.asChild }), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16, ["as-child"]);
};
}
});
export { _sfc_main as default };