Coder Social home page Coder Social logo

chakra-ui / chakra-ui-vue-next Goto Github PK

View Code? Open in Web Editor NEW
259.0 11.0 34.0 10.64 MB

⚑️ The next most epic version of Chakra UI Vue based on Vue 3 πŸš€(WIP)

Home Page: https://next.vue.chakra-ui.com

License: MIT License

TypeScript 81.11% Vue 17.15% HTML 0.27% JavaScript 0.74% EJS 0.74%
chakra-ui-vue accessibility-js-hooks vite hygen workspace vue nuxt chakra-ui

chakra-ui-vue-next's Introduction

Chakra logo

Build Accessible React Apps with Speed ⚑️


Bundle Size Github Checks MIT License NPM Downloads Github Stars Discord


Chakra UI is a comprehensive library of accessible, reusable, and composable React components that streamlines the development of modern web applications and websites. The library offers a diverse range of components that can be easily combined to build complex user interfaces while adhering to accessibility best practices.

Table of contents

Documentation

It's the https://chakra-ui.com website for the latest version of Chakra UI. For older versions head over here

Features

  • Ease of Styling: Chakra UI contains a set of layout components like Box and Stack that make it easy to style your components by passing props. Learn more
  • Flexible & composable: Chakra UI components are built on top of a React UI Primitive for endless composability.
  • Accessible. Chakra UI components follow the WAI-ARIA guidelines specifications and have the right aria-* attributes.
  • Dark Mode 😍: Most components in Chakra UI are dark mode compatible.

Installation

To use Chakra UI components, all you need to do is install the @chakra-ui/react package and its peer dependencies:

# with Yarn
$ yarn add @chakra-ui/react @emotion/react@^11 @emotion/styled@^11 framer-motion@^6

# with npm
$ npm i @chakra-ui/react @emotion/react@^11 @emotion/styled@^11 framer-motion@^6

# with pnpm
$ pnpm add @chakra-ui/react @emotion/react@^11 @emotion/styled@^11 framer-motion@^6

# with Bun
$ bun add @chakra-ui/react @emotion/react@^11 @emotion/styled@^11 framer-motion@^6

Usage

To start using the components, please follow these steps:

  1. Wrap your application with the ChakraProvider provided by @chakra-ui/react.
import { ChakraProvider } from "@chakra-ui/react"

// Do this at the root of your application
function App({ children }) {
  return <ChakraProvider>{children}</ChakraProvider>
}

Optionally, you can wrap your application with the ColorModeProvider so you can toggle between light and dark mode within your app.

  1. Now you can start using components like so!:
import { Button } from "@chakra-ui/react"

function Example() {
  return <Button>I just consumed some ⚑️Chakra!</Button>
}

More guides on how to get started are available here

CodeSandbox Templates

create-react-app Templates

Check out our guide for information on how to use our official create-react-app templates.

Contributing

Feel like contributing? That's awesome! We have a contributing guide to help guide you.

Our docsite lives in a separate repo. If you're interested in contributing to the documentation, check out the docsite contribution guide.

Support Chakra UI

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

Individuals

By donating $5 or more you can support the ongoing development of this project. We'll appreciate some support. Thank you to all our supporters! πŸ™ [Contribute]

Testimonials

People throw React component libraries and design systems at me regularly. This might be the best one I've seen. The APIs are simple but composable and the accessibility on the couple components I looked is complete.

Great work @thesegunadebayo, really inspiring work. – Ryan Florence

Awesome new open-source component library from @thesegunadebayo. Really impressive stuff! – Colm Tuite

This is incredible work. Amazing job Segun! – Lee Robinson

Chakra UI is glorious! I love the consistent use of focus styling and the subtle animation – Guillermo β–²

Awards and Mentions

We've been extremely humbled to receive awards and mentions from the community for all the innovation and reach Chakra UI brings to the JavaScript ecosystem.

Technology Radar

Solution Worth Pursuing

Technology Radar (2020–2021)

Open Source Awards 2020

The Most Impactful Contribution to the community

Open Source Awards (2020)

Contributors

Thanks goes to these wonderful people

Segun Adebayo
Segun Adebayo

πŸ’» 🚧 πŸ“– πŸ’‘ 🎨
Tioluwani Kolawole
Tioluwani Kolawole

πŸ“– πŸ’‘ 🚧
Devansh Jethmalani
Devansh Jethmalani

πŸ’»
Adrian Aleixandre
Adrian Aleixandre

πŸ’» πŸ“–
Lee
Lee

πŸ“–
KristΓ³f PoduszlΓ³
KristΓ³f PoduszlΓ³

πŸ’» πŸ€” πŸ› πŸ“–
Justin Hall
Justin Hall

πŸ’»
Mark Chandler
Mark Chandler

πŸ’» ⚠️ πŸ“– 🚧
Folasade Agbaje
Folasade Agbaje

πŸ’» πŸ€”
Christian Nwamba
Christian Nwamba

πŸ“–
Jonathan Bakebwa
Jonathan Bakebwa

πŸ“– πŸ€”
Alex Luong
Alex Luong

πŸ’» πŸ”Œ
Jesco WΓΌster
Jesco WΓΌster

πŸ’»
Dusty Doris
Dusty Doris

πŸ’»
Alex Lobera
Alex Lobera

πŸ’»
Tommaso De Rossi
Tommaso De Rossi

πŸ’»
Odi
Odi

πŸ’»
Hendrik Niemann
Hendrik Niemann

πŸ’»
Matt Rothenberg
Matt Rothenberg

πŸ’» πŸ’‘
Luis Felipe Zaguini
Luis Felipe Zaguini

πŸ’»
Jean
Jean

πŸ’»
Temitope Ajiboye
Temitope Ajiboye

πŸ“–
Jonathan Kim
Jonathan Kim

πŸ’»
Chris Thompson
Chris Thompson

πŸ’»
WALTER KIMARO
WALTER KIMARO

πŸ’»
Jack Leslie
Jack Leslie

πŸ’»
Ken-Lauren Daganio
Ken-Lauren Daganio

πŸ’»
Ramon
Ramon

πŸ’»
jess
jess

πŸ“– πŸ”
Ayelegun Kayode Michael
Ayelegun Kayode Michael

πŸ’»
Tal Williams
Tal Williams

πŸ’»
Trevor Blades
Trevor Blades

πŸ’» πŸ“– πŸ›
Gord Lea
Gord Lea

πŸ’»
Aggelos Arvanitakis
Aggelos Arvanitakis

πŸ’»
Douglas Gabriel
Douglas Gabriel

πŸ’»
Martin NordstrΓΆm
Martin NordstrΓΆm

πŸ’»
Danny Tatom
Danny Tatom

πŸ’»
Simon Collins
Simon Collins

πŸ’»
Santi Albo
Santi Albo

πŸ’» πŸ“–
PILO7980
PILO7980

πŸ’»
Ishimoto Koji
Ishimoto Koji

πŸ’»
Jeff Wen
Jeff Wen

πŸ’»
Pablo Saez
Pablo Saez

πŸ’»
Nejc Ravnik
Nejc Ravnik

πŸ’»
Julien Viala
Julien Viala

πŸ’»
Sebastian Trebunak
Sebastian Trebunak

πŸ’» πŸ“–
Adam Plante
Adam Plante

πŸ’»
LΓΊcio Rubens
LΓΊcio Rubens

πŸ’»
Jason Miazga
Jason Miazga

πŸ’» πŸ“–
Gonzalo Pozzo
Gonzalo Pozzo

πŸ’»
Christian
Christian

πŸ’» πŸš‡
Christian Hagendorn
Christian Hagendorn

πŸ’»
Andrey Krasnov
Andrey Krasnov

πŸ’»
Dony Sukardi
Dony Sukardi

πŸ’»
Meng
Meng

πŸ’»
Gabriele Belluardo
Gabriele Belluardo

πŸ’»
Francois Best
Francois Best

πŸ’»
Tianci He
Tianci He

πŸ’»
Steven
Steven

πŸ’»
Baptiste Adrien
Baptiste Adrien

πŸ’»
Rob Bevan
Rob Bevan

πŸ’»
Tomasz
Tomasz

πŸ’»
徐愷
徐愷

πŸ’»
David Wippel
David Wippel

πŸ’»
Naveen
Naveen

πŸ’»
Vincent
Vincent

πŸ’»
Osamah Aldoaiss
Osamah Aldoaiss

πŸ’»
Fred K. Schott
Fred K. Schott

πŸ’»
Jared Palmer
Jared Palmer

πŸ’»
Austin Walela
Austin Walela

πŸ’»
Tony Narlock
Tony Narlock

πŸ’» πŸ“–
Thomas Maximini
Thomas Maximini

πŸ’»
David Baumgold
David Baumgold

πŸ’»
ralphilius
ralphilius

πŸ’»
Rahul Rangnekar
Rahul Rangnekar

πŸ’»
Pierre Nel
Pierre Nel

πŸ’»
Pierre Grimaud
Pierre Grimaud

πŸ’»
Whisp R&D
Whisp R&D

πŸ’»
Makenna Smutz
Makenna Smutz

πŸ’» πŸ“– πŸ€”
Nelson Reitz
Nelson Reitz

πŸ’»
Mohamed Nainar
Mohamed Nainar

πŸ“–
Mustafa Turhan
Mustafa Turhan

πŸ“–
Kim RΓΈen
Kim RΓΈen

πŸ“–
Justin Mak
Justin Mak

πŸ’»
Jeremy Davis
Jeremy Davis

πŸ’»
Jeremy Lu
Jeremy Lu

πŸ“– πŸ’»
Ivan Dalmet
Ivan Dalmet

πŸ“– πŸ’» πŸ”Œ
Dillon Curry
Dillon Curry

πŸ’»
idfunctor
idfunctor

πŸ’»
denkigai
denkigai

πŸ’»
Aaron Adams
Aaron Adams

πŸ’»
Abdulazeez Adeshina
Abdulazeez Adeshina

πŸ’»
Sandro
Sandro

πŸ’»
Premkumar Shanmugam
Premkumar Shanmugam

πŸ’»
Tobias Meixner
Tobias Meixner

πŸ’»
Jeremie Leblanc
Jeremie Leblanc

πŸ’»
Kelvin Oghenerhoro
Kelvin Oghenerhoro

πŸ’»
David J. Felix
David J. Felix

πŸ’»
Brody McKee
Brody McKee

πŸ“–
Per Svensson
Per Svensson

πŸ’»
Patrick Cason
Patrick Cason

πŸ“–
Ivo Ilić
Ivo Ilić

πŸ’»
Avaneesh Tripathi
Avaneesh Tripathi

πŸ’»
balibebas
balibebas

πŸ“–
Navin Moorthy
Navin Moorthy

πŸ’» πŸ“–
Tim Kindberg
Tim Kindberg

πŸ“–
iodar
iodar

πŸ“–
MAO YUFENG
MAO YUFENG

πŸ“–
Peng Jie
Peng Jie

πŸ’» πŸ“–
James Gee
James Gee

πŸ’» ⚠️ πŸ’‘
Anton
Anton

πŸ“–
Damnjan Lukovic
Damnjan Lukovic

πŸ“–
Stanila Andrei
Stanila Andrei

πŸ’»
Ekunola Ezekiel
Ekunola Ezekiel

πŸ’»
Ben Mitchinson
Ben Mitchinson

πŸ“–
Jess Telford
Jess Telford

πŸ’»
Simo Aleksandrov
Simo Aleksandrov

πŸ“–
HΓ©ricles Emanuel
HΓ©ricles Emanuel

πŸ’»
CodinCat
CodinCat

πŸ“–
Sam Dawson
Sam Dawson

πŸ€”
hy2k
hy2k

πŸ’»
Pierre Ortega
Pierre Ortega

πŸ’»
Kerem Sevencan
Kerem Sevencan

πŸ“–
harveyhalwin
harveyhalwin

πŸ“–
Mansour benyoucef
Mansour benyoucef

πŸ“–
Andrew Garrison
Andrew Garrison

πŸ“–
Carlos Rodrigues
Carlos Rodrigues

πŸ“–
Dwight Watson
Dwight Watson

πŸ“–
ChasinHues
ChasinHues

πŸ“–
Nahuel Greco
Nahuel Greco

πŸ“† πŸ›
Pablo Rocha
Pablo Rocha

πŸ“–
Dustin Larimer
Dustin Larimer

πŸ’» 🎨
Juliano Farias
Juliano Farias

πŸ“–
Joe Bell
Joe Bell

πŸ› πŸ’»
Henning Pohlmeyer
Henning Pohlmeyer

πŸ’»
Sivert Schou Olsen
Sivert Schou Olsen

πŸ“–
Andrei Lazarescu
Andrei Lazarescu

πŸ“–
JosΓ© Teixeira
JosΓ© Teixeira

πŸ›
Adriano Resende
Adriano Resende

πŸ“–
Victor Bastos
Victor Bastos

πŸ“–
Vincent
Vincent

πŸ“–
Candice
Candice

🎨 πŸ› πŸ“–
Dave Bauman
Dave Bauman

πŸ“–
TimKolberger
TimKolberger

πŸ› πŸ“– πŸ’»
Stephane Mensah
Stephane Mensah

πŸ›
iskanderbroere
iskanderbroere

πŸ“–
Dominik Sumer
Dominik Sumer

πŸ’»
Pavel 'Strajk' Dolecek
Pavel 'Strajk' Dolecek

πŸ“–
Keshav Bohra
Keshav Bohra

πŸ“–
okezieuc
okezieuc

πŸ“–
Clayton Faria
Clayton Faria

πŸ“–
Andrew Ellis
Andrew Ellis

πŸ’» πŸ› πŸ“–
Joel Gallant
Joel Gallant

πŸ›
Jaya Krishna Namburu
Jaya Krishna Namburu

πŸ’»
Ifeoma Imoh
Ifeoma Imoh

πŸ“–
Jason Adkison
Jason Adkison

πŸ›
Gauthier Rodaro
Gauthier Rodaro

πŸ›
Tom Dohnal
Tom Dohnal

πŸ’»
Sam Margalit
Sam Margalit

πŸ›
Marcus Wood
Marcus Wood

πŸ’»
Spencer Duball
Spencer Duball

πŸ“–
Jacob Arriola
Jacob Arriola

πŸ“–
Kenley Jean
Kenley Jean

πŸ“–
Dennis Morello
Dennis Morello

πŸ›
Umar Gora
Umar Gora

πŸ“–
Zyclotrop-j
Zyclotrop-j

πŸ’»
Hong Suk Woo
Hong Suk Woo

πŸ“–
Junho Yeo
Junho Yeo

πŸ“–
Thomas Siller
Thomas Siller

⚠️ πŸ’»
Samuel Kauffmann
Samuel Kauffmann

πŸ“–
Jozef MikulΓ‘Ε‘
Jozef MikulΓ‘Ε‘

πŸ’»
JoΓ£o Victor
JoΓ£o Victor

πŸ’»
yuichiro miyamae
yuichiro miyamae

πŸ“–
Gifa Eriyanto
Gifa Eriyanto

πŸ›
Yuzi
Yuzi

⚠️ πŸ’»
songheewon
songheewon

πŸ“–
Prasanna Venkatesh T S
Prasanna Venkatesh T S

πŸ“–
anthowm
anthowm

πŸ“–
Osama Ahmaro
Osama Ahmaro

πŸ›
Danan Wijaya
Danan Wijaya

πŸ“–
electather
electather

πŸ›
Shubham Kaushal
Shubham Kaushal

πŸ“–
Petter Sæther Moen
Petter Sæther Moen

πŸ“–
Herman Nygaard
Herman Nygaard

πŸ“–
jnmsl
jnmsl

πŸ“–
Mohamed Sayed
Mohamed Sayed

πŸ’»
Sam Poder
Sam Poder

πŸ“–
Dominic Lee
Dominic Lee

πŸ“– πŸ’»
Feras Aloudah
Feras Aloudah

πŸ€”
JP Ungaretti
JP Ungaretti

πŸ“–
Endika Intxaurtieta
Endika Intxaurtieta

πŸ“–
Matt Wells
Matt Wells

πŸ’»
Anant Jain
Anant Jain

πŸ“–
Tom Chen
Tom Chen

πŸ“– πŸš‡
Ernie Miranda
Ernie Miranda

πŸ“–
bjoluc
bjoluc

πŸ“–
Sujit Pradhan
Sujit Pradhan

πŸ“– πŸ’»
Abhishek Kashyap
Abhishek Kashyap

πŸ“–
Kristian Djaković
Kristian Djaković

πŸ’»
Antoniel MagalhΓ£es
Antoniel MagalhΓ£es

πŸ’»
Griko Nibras
Griko Nibras

πŸ€” πŸ’»
imalbert
imalbert

πŸ“–
mcha
mcha

πŸ’» ⚠️
Hasib Hassan
Hasib Hassan

πŸ“–
Jamie Rolfs
Jamie Rolfs

πŸ€” πŸ“– πŸ’»
Surabhi Gupta
Surabhi Gupta

πŸ“–
Ningaro
Ningaro

πŸ›
Monae
Monae

πŸ’»
Wade McDaniel
Wade McDaniel

πŸ“–
Gordon Goldbach
Gordon Goldbach

πŸ’»
Bhish
Bhish

πŸ’»
Amilkar Munoz
Amilkar Munoz

πŸ“–
Samar Mohan
Samar Mohan

πŸ’»
JoΓ£o Paulo Rodrigues
JoΓ£o Paulo Rodrigues

πŸ“–
Avery Freeman
Avery Freeman

πŸ“–
Daniel Schulz
Daniel Schulz

πŸ› πŸ’» πŸ“– πŸ€”
Michael Kilbane
Michael Kilbane

πŸ’»
ngxCoder
ngxCoder

πŸ’»
Kristofer Giltvedt Selbekk
Kristofer Giltvedt Selbekk

πŸ“–
Johann Ehlers
Johann Ehlers

πŸ“– πŸ’»
Lukas Bach
Lukas Bach

πŸ’»
Lazar Nikolov
Lazar Nikolov

πŸ›
iwata
iwata

πŸ› πŸ’»
Lee seung chan
Lee seung chan

πŸ’»
pomSense
pomSense

πŸ’»
be-student
be-student

πŸ“–
Tatsuya Itakura
Tatsuya Itakura

πŸ’» 🚧
Yuku Kotani
Yuku Kotani

πŸ’» 🚧
Vadim Demedes
Vadim Demedes

πŸ’»

(emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

Testing supported by

BrowserStack

License

MIT Β© Segun Adebayo

chakra-ui-vue-next's People

Contributors

bhantsi avatar carwack avatar codebender828 avatar dependabot[bot] avatar devivekw avatar elevatebart avatar feitian124 avatar github-actions[bot] avatar jessicasachs avatar koca avatar lmiller1990 avatar prazdevs avatar shyrro avatar tahul avatar tylerapfledderer 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chakra-ui-vue-next's Issues

Add `c-progress` components

Visually indicates the current level of the progress bar.

This is a set of components denoting a linear and circular progress bar with labeling for accessibility.

See React Package Progress

There are separate files containing reusable internal components for the progress bars, such as a Shape component to help define the SVG and structure of CircleProgress

Add `c-visibility` component

Feature request

Add the Visibility component to the Vue package.

This is an existing component in the React package to control visibility of its children based on a breakpoint.

🚨Important

Depends on the useMediaQuery composable (see issue #182), so this component can not be built yet until a PR is merged and issue closed, or unless an alternative approach is given.

Update scaffold and components to tsx

For improved readability and to assist in the update of the documentation for future contributors (see Issue #168 ), there are a couple of existing components that should convert their rendering from h() to tsx.

In addition, update the component template for hygen generator to reflect this for future components that are created.

BUG: CPopper component loses reference element during HMR

Bug report

There's a weird bug I've spent a lot of time trying to figure out but haven't had much progress on yet.

When initially loading the page, the vue-popper composable hook works just fine. However during development(HMR with tie), when the template is changed where it's consumed, the referenceElement is no longer found by popperjs, even though it can be logged into the DOM.

TODO: Add reproduction

Describe the bug

To reproduce

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Minimal reproduction

Expected behavior

Screenshots

System information

  • OS: [e.g. macOS, Windows]
  • Browser (if applies): [e.g. Chrome, Safari]
  • Version of @chakra-ui/core: [e.g. 1.0.0-rc.3]
  • Version of Node.js: [e.g. 12.11.1]

Additional context

Add `useQuery` composable

Feature request

Add the useQuery composable to the Vue package.

This is an existing function in the React package, currently as support for the media query components 'Show' and 'Hide' (components not yet in the Vue package).

It takes a breakpoint token value from the Chakra theme config and returns a media query string with a min-width or max-width.

Add `c-popover` component

Non-modal dialog that floats around a trigger.
It is used to display contextual information to the user, and should be paired with a clickable trigger element.

See React Package Popover

failed to start project following Setup the Project in CONTRIBUTING.md

failed to start project following Setup the Project in CONTRIBUTING.md

Describe the bug

Β± |develop βœ“| β†’ yarn dev
yarn run v1.22.10
$ NODE_ENV=development vite serve playground --config ./vite.config.ts
failed to load config from /home/ming/learn/js/chakra-ui/chakra-ui-vue-next/vite.config.ts
error when starting dev server:
Error: Cannot find module '/home/ming/learn/js/chakra-ui/chakra-ui-vue-next/node_modules/@chakra-ui/vue-auto-import/dist/cjs/index.js'
    at createEsmNotFoundErr (internal/modules/cjs/loader.js:912:15)
    at finalizeEsmResolution (internal/modules/cjs/loader.js:905:15)
    at resolveExports (internal/modules/cjs/loader.js:437:14)
    at Function.Module._findPath (internal/modules/cjs/loader.js:477:31)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:872:27)
    at Function.Module._load (internal/modules/cjs/loader.js:730:27)
    at Module.require (internal/modules/cjs/loader.js:957:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/home/ming/learn/js/chakra-ui/chakra-ui-vue-next/vite.config.ts:33:41)
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To reproduce

  1. git clone repo
  2. yarn bootstrap
  3. yarn dev

Additional context

i noticed that there are not dist folder in chakra-ui-vue-next/node_modules/@chakra-ui/vue-auto-import.

seems command yarn bootstrap does not aim to generate above dist folder, after i search lerna docment then run lerna run build, dist is generated there and 'yarn dev' works

Add `c-radio` components and composables

Used in forms when a user needs to select a single value from several options.

This is a set of components and composables, including:

  • Radio to render a single radio
  • RadioGroup for form control with a set of radios (using either Radio or the native element)
  • useRadio and useRadioGroup that can be used instead to create custom radios.

See React Package Radio

Add `c-slider` component

Used to allow users to make selections from a range of values.

It provides context and functionality for all slider components.

See React package Slider

🚨 Important

React version uses multiple hooks. Consider building these hooks first if need be, or look at alternatives from VueUse

  • usePanEvent
  • useControllableState
  • useCallbackRef (not needed)
  • useUpdateEffect
  • useSizes

Add `c-editable` component

Multi-component used for inline renaming of some text.
It appears as normal UI text but transforms into a text input field when the user clicks or focuses on it.

See React Package Editable

🚨 Important

Depends on multiple Chakra hooks and components, some currently not present in the Vue package. Consider later build.

Is this project abandoned?

I don't see a lot of activity, but I was hoping to try Chakra with Nuxt 3. Is this project still active?

feat: add `v-model` support for `chakra` factory components

Feat: add v-model support for chakra factory components

User would like to do this:

<template>
  <chakra.input type="text" v-model="input" />
</template>

<script>
export default {
  name: "App",
  data() {
    return {
      input: "",
    };
  },
};
</script>

Is your feature request related to a problem? Please describe.

Cannot use two-way binding for components generated by chakra factory function

Reproduction

https://codesandbox.io/s/charka-input-issue-forked-9m5mw?file=/src/App.vue:0-350

Describe alternatives you've considered

Additional context

Add `c-transition` components

Component tandem used to select one item from a list of options.

See React package transitions

A couple of the transition components have already been added: CCollapse and CMotion and CAnimatePresence. Utilize those with the new transitions.

Add `c-tooltip` component

Display informative text when users hover, focus on, or tap an element.

See React package Tooltip

🚨 Important

The React component involves framer-motion components to handle the transitions, and has Portal applied.

Chakra elements seem to work with Nuxt 3 HMR only in ~20% of cases

Bug report

Describe the bug

Most of the time all styling props that I try to use (including plain style="" along with chakra's pl, mr, etc) on chakra components don't auto-refresh. That also includes components as chakra.div. I noticed that replacing chakra's nodes with native divs fixes the issue, but then I can only use the native style property to add raw css.

There's also a lot of other problems, eg duplication of nodes, stale state, etc. It's hard to say how much of that issue is on Nuxt side, given that they have other HMR tickets currently in investigation. I found it interesting that native html nodes seem to play well with it though, comparing to chakra.

To reproduce

Even although it's the frequency of occurrence is high, it doesn't reproduce with 100% prob in many exact scenarios. Subjectively it affects 80% of all edits though.

Today I started deleting files from my project until I didn't get to at least one reliable reproduction case, although sounds as I can find a high number of other cases if I go through the same steps for other elements.

  1. clone https://github.com/effective-altruism-work/eawork-frontend/tree/hmr-issue
  2. yarn install
  3. yarn run nuxi dev
  4. http://localhost:3000/
  5. open app.vue and remove the line color="gray.500"
  6. in console see [vite] hot updated: /app.vue, but the color stays the same
  7. remove :_hover="{color: 'blue.900'}" and this particular issue with the stale color prop will be fixed

Not sure attaching a code sandbox would help, as this is a very inconsequential example of the general problem. I wonder whether anyone else managed to setup nuxt 3 with chakra in general?

System information

  • OS: MacOS 12.5.1 (21G83)
  • Browser: Chrome latest, but also doesn't work in latest Firefox
  • Version of @chakra-ui: "@chakra-ui/vue-next": "^1.0.0-alpha.15"
  • Version of Node.js: v16.16.0

Missing Return Type for `useTheme()`

Bug report

Describe the bug

When chaining the return object from useTheme() I expect VSCode intellisense to present me with the following properties:

__breakpoints

__cssMaps

__cssVars

Instead, no intellisense is triggered, as only a generic type is returned.

In comparison to the React package, type assertion is used on the function return to ensure proper typing is applied.

This composable should be using WithCSSVar as the return type and supplying the generic type through it.

To reproduce

  1. Import and declare the useTheme() composable (i.e. const theme = useTheme())
  2. Call the theme variable and add a chain to trigger the autocomplete dropdown in VSCode of properties to select from this object.
  3. Observe no proper options to select.

Expected behavior

image

(Minus the shown error, because it is unrelated to the issue πŸ˜… )

System information

  • OS: Windows
  • Browser (if applies): N/A
  • Version of @chakra-ui/core: 1.0.0-alpha.13
  • Version of Node.js: [e.g. 12.11.1]

Additional context

This was discovered when building the useBreakpoint composable. In attempt to translate the hook from the React package it accesses the __breakpoint object within the useTheme() return to obtain the media data from the theme config.

CButton variant is not reactive

Bug report

Describe the bug

To reproduce

  1. Create a variant for the Button component
  2. In the template have the 'variant' prop dynamic
  3. Switch to another variant name
  4. See error

Minimal reproduction

https://codesandbox.io/s/charka-ui-vue-chidori-test-playground-0zl73?file=/src/App.vue

Expected behavior

I would expect the variant to change into the new variant on runtime. This does work with props like 'color'.

Additional context

It possibly has to do with the reactivity of the variant prop

TS: Declare `chakra.element` types globally for factory function components.

Feature request

Is your feature request related to a problem? Please describe.

It is currently unclear how to provide Typescript SFC support for Chakra factory components that will be auto imported. For JavaScript projects he seems to work fine however we may need to provide a solution for TS SFCs.

At the moment the solution is to declare a global namespace for Chakra UI Vue components.

In TypeScript declaration file

declare global {
  declare namespace chakra {
    import { chakra } from '@chakra-ui/vue-next'
    export const div: typeof chakra.div
  }
}

export {}

In SFC

<template>
  <chakra.div>value</chakra.div>
</template>

<script lang="ts" setup></script>

Describe the solution you'd like

Describe alternatives you've considered

Additional context

Add `c-switch` component

Component used as an alternative for the checkbox component for switching between "enabled" and "disabled" states.

See React package Switch

Look at importing the existing logic from the CCheckbox component.

c-modal: `Failed to resolve import "@vueuse/motion"` occurs due to lack of the package in dependencies

Bug report

Describe the bug

Vite fails to update dependencies because of lack of @vueuse/motion in @chakra-ui/c-modal

To reproduce

  1. Clone https://github.com/AumyF/chakra-vue-next-vite-test
  2. npm i
  3. npx vite
  4. See error
  5. Once you explicitly add "@vueuse/motion" to project dependencies, this error will not occur
7:57:27 AM [vite] new dependencies found: @chakra-ui/vue-next, updating...
 > node_modules/@chakra-ui/c-modal/dist/esm/c-drawer.js:12:44: error: Could not resolve "@vueuse/motion" (mark it as external to exclude it from the bundle)
    12 β”‚ import { MotionDirective, useMotions } from '@vueuse/motion';
       β•΅                                             ~~~~~~~~~~~~~~~~

 > node_modules/@chakra-ui/c-modal/dist/esm/c-modal.js:18:44: error: Could not resolve "@vueuse/motion" (mark it as external to exclude it from the bundle)
    18 β”‚ import { MotionDirective, useMotions } from '@vueuse/motion';
       β•΅                                             ~~~~~~~~~~~~~~~~

7:57:27 AM [vite] error while updating dependencies:
Error: Build failed with 2 errors:
node_modules/@chakra-ui/c-modal/dist/esm/c-drawer.js:12:44: error: Could not resolve "@vueuse/motion" (mark it as external to exclude it from the bundle)
node_modules/@chakra-ui/c-modal/dist/esm/c-modal.js:18:44: error: Could not resolve "@vueuse/motion" (mark it as external to exclude it from the bundle)
    at failureErrorWithLog (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/esbuild/lib/main.js:1449:15)
    at /home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/esbuild/lib/main.js:1131:28
    at runOnEndCallbacks (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/esbuild/lib/main.js:921:63)
    at buildResponseToResult (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/esbuild/lib/main.js:1129:7)
    at /home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/esbuild/lib/main.js:1236:14
    at /home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/esbuild/lib/main.js:609:9
    at handleIncomingPacket (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/esbuild/lib/main.js:706:9)
    at Socket.readFromStdout (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/esbuild/lib/main.js:576:7)
    at Socket.emit (node:events:394:28)
    at Socket.emit (node:domain:470:12)
7:57:28 AM [vite] Internal server error: Failed to resolve import "@vueuse/motion" from "node_modules/@chakra-ui/c-modal/dist/esm/c-modal.js". Does the file exist?
  Plugin: vite:import-analysis
  File: /home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/@chakra-ui/c-modal/dist/esm/c-modal.js
  16 |  import { CAnimatePresence, CMotion } from '@chakra-ui/c-motion';
  17 |  import { CCloseButton } from '@chakra-ui/c-close-button';
  18 |  import { MotionDirective, useMotions } from '@vueuse/motion';
     |                                               ^
  19 |  import { useModal } from './use-modal';
  20 |  import { dialogMotionPresets } from './modal-transitions';
      at formatError (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/vite/dist/node/chunks/dep-c1a9de64.js:50738:46)
      at TransformContext.error (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/vite/dist/node/chunks/dep-c1a9de64.js:50734:19)
      at normalizeUrl (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/vite/dist/node/chunks/dep-c1a9de64.js:74223:26)
      at async TransformContext.transform (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/vite/dist/node/chunks/dep-c1a9de64.js:74356:57)
      at async Object.transform (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/vite/dist/node/chunks/dep-c1a9de64.js:50939:30)
      at async transformRequest (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/vite/dist/node/chunks/dep-c1a9de64.js:66763:29)
      at async viteTransformMiddleware (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/vite/dist/node/chunks/dep-c1a9de64.js:66904:32)
7:57:28 AM [vite] Internal server error: Failed to resolve import "@vueuse/motion" from "node_modules/@chakra-ui/c-modal/dist/esm/c-drawer.js". Does the file exist?
  Plugin: vite:import-analysis
  File: /home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/@chakra-ui/c-modal/dist/esm/c-drawer.js
  10 |  import { chakra, useStyles, useTheme } from '@chakra-ui/vue-system';
  11 |  import { CModal, modalProps, useModalContext } from './c-modal';
  12 |  import { MotionDirective, useMotions } from '@vueuse/motion';
     |                                               ^
  13 |  import { useId } from '@chakra-ui/vue-composables';
  14 |  
      at formatError (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/vite/dist/node/chunks/dep-c1a9de64.js:50738:46)
      at TransformContext.error (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/vite/dist/node/chunks/dep-c1a9de64.js:50734:19)
      at normalizeUrl (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/vite/dist/node/chunks/dep-c1a9de64.js:74223:26)
      at async TransformContext.transform (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/vite/dist/node/chunks/dep-c1a9de64.js:74356:57)
      at async Object.transform (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/vite/dist/node/chunks/dep-c1a9de64.js:50939:30)
      at async transformRequest (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/vite/dist/node/chunks/dep-c1a9de64.js:66763:29)
      at async viteTransformMiddleware (/home/u/ghq/github.com/aumyf/chakra-vue-next-vite-test/node_modules/vite/dist/node/chunks/dep-c1a9de64.js:66904:32)

Minimal reproduction

https://github.com/AumyF/chakra-vue-next-vite-test

Expected behavior

Build correctly

System information

  • OS: Ubuntu 20.04 on WSL (Windows 10 21H1)
  • Version of @chakra-ui/core: 1.0.0-alpha.8
  • Version of Node.js: 16.5.0

Add `c-skeleton` component set

Component set used to provide placeholder loading state of some component.

This is an alternative to some text, loading bar, spinner, etc. where the component itself is presented as a solid highlighter on load before the content is rendered.

Contains a set of components to define whether the content to be loaded is text, and avatar, solid block, etc.

See React Package Skeleton

Important

Depends on the composable usePrevious to isolate reference and change of state to the isLoaded prop. Consider building this composable first, or building a computed within the component. usePrevious is only used in this component and made available for other uses.

Update `CONTRIBUTING.md`

During the process of fixing and updating my local environment to ensure everything is working (at least in the scope of running the development playground) I noticed that the information in the CONTRIBUTING.md file does not quite line up in the successful steps I actually took.

And based on the configuration of the package as a Windows OS user, it might also be good to have a section for those specific users with suggestions on troubleshooting any issue to get their local environment working properly without compromising the package.

Current suggestions:

  • Change the Setup the Project section: Fork repo > clone locally > run yarn install (installs deps and build the packages) > run yarn playground:dev (runs the Vite playground)
    • Currently, it suggests running yarn build and yarn bootstrap which seem to be unnecessary based on the scripts used in other steps.
  • Mention yarn playground:dev script in Commands section
    • yarn dev currently does nothing but validate preconstruct dev and not actually boot up the playground
  • Add For Windows Users section to address suggestions in ensuring the local environment in that OS operates properly
    • Ensure node version used is greater than v16.16.0
    • Use the win-node-env package to have NODE_ENV commands work in related package scripts (thank you @Shyrro for this suggestion!)
  • Add link to the components-guide.md for building new package components (resides in docs/guides

Add `c-image` component

Renders an image with support for fallbacks.

See React Package Image

Note handling of SSR (a separate Img component) and the native image element.

Add `useBreakpoint` composable

Feature request

Add the useBreakpoint composable to the Vue package.

This is an existing function from the React package to retrieve the current responsive media breakpoint. Returns the token name from the theme config.

🚨 Important

This depends on the useMediaQuery, based on the hook from the React package (See Issue #182). However, it is suggested to use the version of the composable from the VueUse library.

Core: Provide types for Plugin

Bug report

Describe the bug

Currently the Chakra UI Plugin does not provide types for the plugin options. So VSCode intellisense cannot determine what to do with the plugin options.

To reproduce

  1. In a new Vite project Install @chakra-ui/vue-next in stand alone package.
  2. Import the plugin and begin to provide options.
  3. Observe that plugin options are unavailable to intellisense

Screenshots

image

Burger Menu Not Working

Bug report

Burger Menu

Describe the bug

When a user clicks on the menu it's redirecting to a discord invite, ideally, it should toggle a menu with nav icons
The following code snippets comes from the inspector

 <a class="chakra-button css-9oowru" aria-label="Open menu" variant-color="gray" target="_blank" rel="noopener noreferrer" href="https://discord.gg/sq2Kp6x" icon="menu" isround="false"><!----><!----><svg class="chakra-icon css-13otjrl" focusable="false" viewBox="0 0 1024 1024"><path fill="currentColor" d="M904 160H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0 624H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8zm0-312H120c-4.4 0-8 3.6-8 8v64c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-64c0-4.4-3.6-8-8-8z"></path></svg><!----></a>

To reproduce

  1. Go to 'Homepage'
  2. Click on 'Burger Menu'
  3. Scroll down to 'to navbar contents'
  4. See error

Dependency: `@chakra-ui/styled-system` depends on `react`

Bug report

Describe the bug

Currently @chakra-ui/styled-system depends on react.

The dependency graph is somewhat like this:
@chakra-ui/vue-next -> @chakra-ui/styled-system -> @chakra-ui/utils -> react

Why is this an issue:
Since we're using it in @chakra-ui/vue to prevent code duplication, it currently requires consumers to install react as a dependency as well into the project.

In order to prevent this from happening, we can split the @chakra-ui/utils into a standalone package and then moving the react utils into @chakra-ui/react-utils

Add `c-live-region` component

Handles aria attributes that programmatically expose dynamic content changes for a screen reader to detect and read out.

See React package useLiveRegion

🚨 Important

The setup of the state in the React Package uses a class to construct an instance of the live controls for each component that will use it.

In this package, it will be created as a component with at least more flexibility for render.

Add `useClickable` composable

useClickable implements all the interactions of a native button
component with support for making it focusable even if it is disabled.

It can be used with both native button elements or other elements (like div).

See React Package useClickable

🚨 Important

Depends on Chakra's useEventListeners (See Issue #190). Consider using this or VueUse useEventListener.

Jest expect methods "do not exist on type `Assertion`"

Bug report

Describe the bug

Via vscode intellisense, errors are being registered for various jest expect methods stating:
Property X does not exist on type 'Assertion'.

Upon inspection of expect() via intellisense tooltip, the type signature being recognized is Chai.ExpectStatic.

So instead of toEqual, typescript is looking for equal, because it is looking at the Chai package that exists in the root node_modules

To reproduce

Occurring within VSCode

Minimal reproduction

N/A

Expected behavior

Typescript recognizing Jest methods instead of Chai

Screenshots

image

System information

  • OS: Windows
  • Browser (if applies): N/A
  • Version of @chakra-ui/core: 1.0.0-alpha.13
  • Version of Node.js: 16.16.0

Additional context

These errors do not effect the tests that run. However I personally use the Error Lens extension, so it highlights the line of code in red.

Add `c-menu` component

Multi-component accessible dropdown menu for common dropdown menu design patterns.
Uses roving tabIndex for focus management.

See React Package Menu

🚨 Important

Depends on multiple Chakra hooks and components, some currently not present in the Vue package. Consider later build.

CCheckBox icon not rendering correctly

Bug report

Describe the bug

The checkbox renders the raw function instead of the "checked" icon.

raw function text

There are also 99+ errors in the console

To reproduce

  1. Go to https://chakra-ui-vue-next-playground-2zajhe2uw-chakra-ui.vercel.app/c-checkbox/examples/simple-checkbox
  2. Select the checkbox
  3. If you're under Firefox, no icon is shown. If you're under Chromium based browser, you'll see a weird text. In both cases, inspecting the DOM show a rendered string instead of an icon.

Expected behavior

For the icon to show instead of the function text to print.

Screenshots

System information

  • OS: All. ( Tested on Mac, Windows and Linux )
  • Browser (if applies): Chromium based/FF

Additional context

Since we see the raw function string, it's probably just a double call somewhere to the render function. Instead of returning the render function, we probably return a function that return the render function which causes the string render instead of what is expected.
The errors in the console are probably unrelated, they probably come from null objects trying to access property before the component finished mounting or something like that. (It's a lead to confirm)

Add `c-tabs` component

Provides context and logic for all tabs components.

See React package Tabs

🚨 Important

The React component uses multiple Chakra hooks imported into useTabs consider these and/or adding them to the package first, or look to versions from VueUse

Modal not returning focus on close by default

Bug report

Describe the bug

When opening a modal, if finalFocusRef is not specified, focus will not be returned to the element that trigerred the modal.

To reproduce

  1. Clone https://github.com/Shyrro/chakra-modal-issue-repro
  2. Run pnpm install and pnpm dev
  3. Open your browser on dev url and click on "Open Modal" button
  4. Once the modal opens, close it
  5. Notice that the button does not have focus ( style of focus is border red so it's noticeable )

Minimal reproduction

Github repro : https://github.com/Shyrro/chakra-modal-issue-repro

Expected behavior

When the modal closes, it should return the focus to the button

System information

  • Version of @chakra-ui/vue-next: 1.0.0-alpha.15

Add `c-show` / `c-hide` components

Feature request

Add the Show and Hide components to the Vue package.

These are existing components in the React package to wrap elements that need to be shown or hidden depending on a given breakpoint.

🚨Important

Depends on the Visibility component and useQuery composable (see issues #181 and #183) so these components can not be completed until PRs have been merged and issues closed, or until an alternative approach is given.

Add `useMediaQuery` composable

Feature request

Add the useMediaQuery composable to the Vue package.

This is an existing function in the React package to track state of a given CSS media query.

Note: In the React package, it uses a hook called useEnvironment. Need to consider whether or not to also add this as a composable and use it in order to make useMediaQuery workable in these early stages of the Chakra package
See Vue's discussion on Access to Platform Specific APIs in regard to SSR with useEnvironment

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.