Coder Social home page Coder Social logo

vaul-vue's Introduction


Logo

Radix Vue

An unofficial Vue port of Radix UI.
Radix is an unstyled, customisable UI Library with built in accessibility for building top quality design systems.

NPM version NPM Downloads GitHub stars

Get involved!

Documentation | Getting Started | Examples | Why Radix Vue?

hero image design by: icarusgkx, melkam

Installation

pnpm add radix-vue
npm install radix-vue
yarn add radix-vue

Documentation

For full documentation, visit radix-vue.com.

Releases

For changelog, visit releases.

Contributing

We would love to have your contributions! All PRs all welcomed! We need help building the core components, docs, tests, stories! Join our discord and we will get you up and running!

Dev Setup

Docs

  1. Clone the repo
  2. Run pnpm i
  3. Run pnpm build to run build radix-vue locally
  4. Run pnpm docs:dev to run vitepress
  5. Open http://localhost:5173

Package

  1. Clone the repo
  2. Run pnpm i
  3. Run pnpm story:dev to run histoire (storybook)
  4. Open http://localhost:6006

Authors

Credits

All credits go to these open-source works and resources

  • Radix UI for doing all the hard work to make sure components are accessible
  • Floating UI for creating powerful components that as the base of many Radix Vue components
  • VueUse for providing many useful utilities.
  • Ark UI for the <Primitive> component
  • Radix Svelte
  • Headless UI

vaul-vue's People

Contributors

connerblanton avatar cpreston321 avatar elliot-alexander avatar github-actions[bot] avatar mickeldebs avatar zernonia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vaul-vue's Issues

Reduce duplicated utilities

Thanks for take care of porting vaul to Vue


radix-vue uses @vueuse/core underhood so why not use their utility functions?

why not using our local utility functions?

They have same logic why not replace them with already defined utility in @vueuse/core? we can prevent duplication by doing this

Local utils @vueuse/core utils
isIOS function isIOS expression
addEvent useEventListener
set function CSS maybe useCssVar I'm not sure about this one

Or other local utility which I can't recognize the equivalent in @vueuse/core

Scrollable content cannot dismiss

The drawer with scrollable content cannot be dismissed. pls see the code below

<template>
  <DrawerRoot should-scale-background>
    <DrawerTrigger
      class="rounded-full bg-white px-4 py-2.5 text-sm font-semibold text-app-positive shadow-sm ring-1 ring-inset ring-app-positive hover:bg-app-positive"
    >
      Open Drawer
    </DrawerTrigger>
    <DrawerPortal>
      <DrawerOverlay class="fixed bg-dark-primary/50 inset-0" />
      <DrawerContent
        class="bg-light-primary flex flex-col fixed bottom-0 left-0 right-0 max-h-[96%] rounded-t-[10px]"
      >
        <div
          class="max-w-md w-full mx-auto flex flex-col overflow-auto p-4 rounded-t-[10px]"
        >
          <input class="border border-gray-400 my-8" placeholder="Input" />
          <p>
            But I must explain to you how all this mistaken idea of denouncing
            pleasure and praising pain was born and I will give you a complete
            account of the system, and expound the actual teachings of the great
            explorer of the truth, the master-builder of human happiness. No one
            rejects, dislikes, or avoids pleasure itself, because it is
            pleasure, but because those who do not know how to pursue pleasure
            rationally encounter consequences that are extremely painful. Nor
            again is there anyone who loves or pursues or desires to obtain pain
            of itself, because it is pain, but because occasionally
            circumstances occur in which toil and pain can procure him some
            great pleasure. To take a trivial example, which of us ever
            undertakes laborious physical exercise, except to obtain some
            advantage from it? But who has any right to find fault with a man
            who chooses to enjoy a pleasure that has no annoying consequences,
            or one who avoids a pain that produces no resultant pleasure?
          </p>
          <input class="border border-gray-400 my-8" placeholder="Input" />
          <p>
            On the other hand, we denounce with righteous indignation and
            dislike men who are so beguiled and demoralized by the charms of
            pleasure of the moment, so blinded by desire, that they cannot
            foresee the pain and trouble that are bound to ensue; and equal
            blame belongs to those who fail in their duty through weakness of
            will, which is the same as saying through shrinking from toil and
            pain. These cases are perfectly simple and easy to distinguish. In a
            free hour, when our power of choice is untrammelled and when nothing
            prevents our being able to do what we like best, every pleasure is
            to be welcomed and every pain avoided. But in certain circumstances
            and owing to the claims of duty or the obligations of business it
            will frequently occur that pleasures have to be repudiated and
            annoyances accepted. The wise man therefore always holds in these
            matters to this principle of selection: he rejects pleasures to
            secure other greater pleasures, or else he endures pains to avoid
            worse pains.
          </p>
          <input class="border border-gray-400 my-8" placeholder="Input" />
        </div>
      </DrawerContent>
    </DrawerPortal>
  </DrawerRoot>
</template>
<script setup>
import {
  DrawerContent,
  DrawerOverlay,
  DrawerPortal,
  DrawerRoot,
  DrawerTrigger,
} from "vaul-vue";


</script>

Docs / Static site domain

We need to get some kind of domain or static hosting for this project. With the intention that it may be grouped in as a dependency that the Radix Vue org helps maintain, are there any considerations we need to make there? Are all of Radix Vue's domains currently registered, hosted etc with a particular provider? Does it help if Vaul Vue does the same?

[Bug]: Using dropdown menu and drawer causes scrollbar to dissapear

Reproduction

https://stackblitz.com/edit/vitejs-vite-jr9eay?file=src%2FApp.vue

Describe the bug

Hello everyone thanks for working on this great package, today i noticed that if you open the drawer using a dropdown menu the scrollbar no longer shows up after you close the drawer. This does not happen using a Sheet component.

Please check the reproduction link, notice that you can scroll, then open the dropdown menu and click Drawer, the scrollbar will display when using the drawer but if you close it, it gets hidden and you cannot do anything since it has no pointer events

2024-03-25 12 48 11

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.3 - /usr/local/bin/pnpm
  npmPackages:
    radix-vue: ^1.5.3 => 1.5.3 
    vue: ^3.4.21 => 3.4.21

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests

Scroll does not work if drawer disappeares before close

How to reproduce

  1. Open https://www.shadcn-vue.com/docs/components/drawer.html
  2. Scroll to Responsive Dialog
  3. Open devtools, resize window to width 500px
  4. Click "Edit profile"
  5. Resize window to width 800px
  6. Close dialog
  7. Scroll is gone

Reason

Responsive Dialog is a component that implemented like this

<Dialog v-if="isDesktop" v-model:open="isOpen"> ... </Dialog>
<Drawer v-else v-model:open="isOpen">... </Drawer>

And drawer keeps this styles on body, since when viewport changes it does not close

<body style="right: 0px; position: fixed; top: 0px; left: 0px; height: auto; pointer-events: none; overflow: hidden;">

Possible solution

  • add onUnmounted() that removes this style

Export prop/emit type

Thanks again for the hardwork guys.

Can the prop types be exported for the different components please?

Pull down to close not working when form is inside the DrawerContent

Hello again,

I added a little demo of how to use the drawer component here: https://ui-thing.behonbaker.com/components/drawer#usage

I noticed that when I added a form to the DrawerContent, the ability to pull down and close the drawer only happens once.

If I open the drawer a second time without leaving the page(unmounting the component), then the functionality to pull down and close does not work.

Maybe I am doing something wrong?

How to use direction?

I know with vaul you can se direction like "left", "right" & "bottom" is this also supported here? thanks

NPM package name

Unfortunately, vaul-vue, vue-vaul and vue-vaul-drawer are all taken with minimal (if any) implementation. Should we publish this as vaul-vue under an organisation scope? Zernonia from the Radix Vue team has expressed interest in having a scope for packages related to the tools and libraries they maintain, does it make sense for us to wait and use that scope?

Page jump on close

Hello,

for some reason, the whole page takes a jump when closing the vaul.
I think that its because of the styles appended on the body, (I'd guess the negative top property) that when removed cause this shift.

Is this a bug or something we can prevent when implementing the component?
I have made a video of the issue

Grabacion.2024-02-01.170735.mp4

Thanks for your work and time

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.