diff --git a/.histoire/package.json b/.histoire/package.json index 0dc04ce1b..4c2c0ac19 100644 --- a/.histoire/package.json +++ b/.histoire/package.json @@ -20,7 +20,8 @@ "eslint": "^8.56.0", "histoire": "^0.17.14", "postcss": "^8.4.33", - "tailwindcss": "^3.4.1" + "tailwindcss": "^3.4.1", + "tailwindcss-animate": "1.0.7" }, "peerDependencies": { "@vitejs/plugin-vue": "*", diff --git a/.histoire/tailwind.config.js b/.histoire/tailwind.config.js index 81dc2e9cf..768a06f3c 100644 --- a/.histoire/tailwind.config.js +++ b/.histoire/tailwind.config.js @@ -1,5 +1,6 @@ -const { blackA, green, grass, mauve, slate, violet, red, indigo, purple, teal } = require("@radix-ui/colors"); -const plugin = require("tailwindcss/plugin"); +import { blackA, green, grass, mauve, slate, violet, red, indigo, purple, teal } from "@radix-ui/colors"; +import plugin from "tailwindcss/plugin"; +import animate from "tailwindcss-animate"; /** @type {import('tailwindcss').Config} */ export default { @@ -158,6 +159,7 @@ export default { }, }, plugins: [ + animate, plugin(({ matchUtilities }) => { matchUtilities({ perspective: (value) => ({ diff --git a/packages/radix-vue/src/DropdownMenu/story/DropdownMenu.story.vue b/packages/radix-vue/src/DropdownMenu/story/DropdownMenu.story.vue index bc934d63d..6ee4ea102 100644 --- a/packages/radix-vue/src/DropdownMenu/story/DropdownMenu.story.vue +++ b/packages/radix-vue/src/DropdownMenu/story/DropdownMenu.story.vue @@ -20,19 +20,23 @@ import { } from '../' const toggleState = ref(false) -const toggleState2 = ref(false) const checkboxOne = ref(false) const checkboxTwo = ref(false) const person = ref('pedro') -function handleClick() { - // alert("hello!"); -} +const content = 'relative min-w-32 bg-white will-change-[opacity,transform] z-50 rounded-md border p-1 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2' -function handleCheck(ev: any) { - // checkboxOne.value = ev; - console.log(ev) -} +const item = 'group w-full text-sm leading-none text-violet11 flex items-center h-7 relative pl-7 pr-2 select-none outline-none data-[state=open]:bg-violet4 data-[state=open]:text-violet11 data-[disabled]:text-mauve8 data-[disabled]:pointer-events-none data-[highlighted]:bg-violet9 data-[highlighted]:text-violet1 data-[highlighted]:data-[state=open]:bg-violet9 data-[highlighted]:data-[state=open]:text-violet1 cursor-default rounded' + +const subContent = 'bg-white rounded-md shadow-md will-change-[opacity,transform] min-w-32 z-50 overflow-hidden p-1 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-left-right-1 data-[side=right]:slide-in-from-right-1 data-[side=top]:slide-in-from-bottom-2' + +const separator = '-mx-1 my-1 h-px bg-mauve5' + +const shortcut = 'ml-auto pl-5 text-[13px] text-mauve11 group-data-[highlighted]:text-white group-data-[disabled]:text-mauve8' + +const checkboxItem = 'group w-full text-sm leading-none text-violet11 flex items-center h-7 relative pl-7 pr-2 select-none outline-none data-[state=open]:bg-violet4 data-[state=open]:text-violet11 data-[disabled]:text-mauve8 data-[disabled]:pointer-events-none data-[highlighted]:bg-violet9 data-[highlighted]:text-violet1 data-[highlighted]:data-[state=open]:bg-violet9 data-[highlighted]:data-[state=open]:text-violet1 cursor-default rounded' + +const radioItem = 'group w-full text-sm leading-none text-violet11 flex items-center h-7 relative pl-7 pr-2 select-none outline-none data-[state=open]:bg-violet4 data-[state=open]:text-violet11 data-[disabled]:text-mauve8 data-[disabled]:pointer-events-none data-[highlighted]:bg-violet9 data-[highlighted]:text-violet1 data-[highlighted]:data-[state=open]:bg-violet9 data-[highlighted]:data-[state=open]:text-violet1 cursor-default rounded'