feat: migrate Toast and Table with reviewed state focus and SSR contracts
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, h, inject, useAttrs, type PropType } from "vue";
|
||||
import type { ButtonVariants } from "@heroui-vue/styles";
|
||||
import Button from "../button/Button.vue";
|
||||
import { toastContextKey } from "./context";
|
||||
|
||||
export default defineComponent({
|
||||
name: "ToastActionButton",
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
isDisabled: { type: Boolean, default: false },
|
||||
variant: {
|
||||
type: String as PropType<ButtonVariants["variant"]>,
|
||||
default: "secondary",
|
||||
},
|
||||
size: { type: String as PropType<ButtonVariants["size"]>, default: "sm" },
|
||||
},
|
||||
setup(props, { slots }) {
|
||||
const attrs = useAttrs();
|
||||
const ctx = inject(toastContextKey, null);
|
||||
return () =>
|
||||
h(
|
||||
Button,
|
||||
{
|
||||
...attrs,
|
||||
variant: props.variant as never,
|
||||
size: props.size as never,
|
||||
isDisabled: props.isDisabled,
|
||||
class: [ctx?.slots.value.action(), attrs.class],
|
||||
"data-slot": "toast-action-button",
|
||||
},
|
||||
slots,
|
||||
);
|
||||
},
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user