@ark-ui/vue
Version:
A collection of unstyled, accessible UI components for Vue, utilizing state machines for seamless interaction.
32 lines (29 loc) • 1.16 kB
JavaScript
import { defineComponent, createBlock, openBlock, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString } from 'vue';
import { ark } from '../factory.js';
import { usePasswordInputContext } from './use-password-input-context.js';
import { useForwardExpose } from '../../utils/use-forward-expose.js';
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "password-input-indicator",
props: {
fallback: {},
asChild: { type: Boolean }
},
setup(__props) {
const passwordInput = usePasswordInputContext();
useForwardExpose();
return (_ctx, _cache) => {
return openBlock(), createBlock(unref(ark).span, mergeProps(unref(passwordInput).getIndicatorProps(), { "as-child": _ctx.asChild }), {
default: withCtx(() => [
unref(passwordInput).visible ? renderSlot(_ctx.$slots, "default", { key: 0 }) : renderSlot(_ctx.$slots, "fallback", {
key: 1,
fallback: _ctx.fallback
}, () => [
createTextVNode(toDisplayString(_ctx.fallback), 1)
])
]),
_: 3
}, 16, ["as-child"]);
};
}
});
export { _sfc_main as default };