Giter VIP home page Giter VIP logo

onu-ui's Introduction

Onu UI (WIP)

Bullheaded and lightweight UnoCSS ui library.

作者很菜很懒,写不下去了

NPM version

🧑‍💻 Document Beta | 🤹‍♂️ Playground

Features

  • 🌈 Components Design - Onu provides neat & beautiful crafted UI components.
  • 🔥 On demand Import - Provide resolver to automatically import only used components.
  • 🎉 Typescript Supported - Support TypeScript & type checked & type inference.
  • 💎 Iconify Icons - Use any icon from the library you love.
  • 🍬 CSS Preset - Has UnoCSS preset package to use, rendered UI easily.
  • ⚙️ Theme Config - Use attribute mode like unocss to design. Support theme config to customize theme.

Usage

Full Import

pnpm i onu-ui
pnpm i unocss -D

Add onu-ui in your main entry file.

// main.ts
import OnuUI from 'onu-ui'
import 'uno.css'
import 'onu-ui/dist/style.css'

createApp(App).use(OnuUI).mount('#app')

Custom UnoCSS config

Custom your UnoCSS config:

// uno.config.ts
import { defineConfig, presetAttributify, presetUno } from 'unocss'
import { presetOnu } from 'onu-ui'

export default defineConfig({
  presets: [
    // ...
    presetUno(),
    presetAttributify(),
    presetOnu(),
  ],
})

On-demand Import:

You need to use an additional plugin to import components you used. First you need to install unplugin-vue-components and unplugin-auto-import.

npm install -D unplugin-vue-components unplugin-auto-import

Then add the code below into your Vite config file.

// vite.config.ts
import { defineConfig } from 'vite'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { OnuResolver } from 'onu-ui'

export default defineConfig({
  // ...
  plugins: [
    // ...
    AutoImport({
      resolvers: [OnuResolver()],
    }),
    Components({
      resolvers: [OnuResolver()],
    }),
  ],
})

Online Playground

You can try OnuUI out with the components built-in playground.

Try it with our built-in playground

Playground

Try it with stackblitz or codesandbox


Contributing

Developers interested in contributing should read the Code of Conduct and the Contributing Guide.

Thanks to everyone who has already contributed to OnuUI!

Discussions

Since OnuUI is under intensive development, we need your valuable comments and feature requirements of the component

Welcome to contact us at Discussions or Issues, we will be more than happy to reply to your message.

Credits

License

MIT License © 2022 Chris

onu-ui's People

Contributors

baiwusanyu-c avatar brain777777 avatar ca-lee-b avatar charleewa avatar chengzicy avatar chenjiezi avatar chinbor avatar chizukicn avatar dazuizui avatar dimplesy avatar fubaooo avatar iceywu avatar joaopalmeiro avatar priority3 avatar soub4i avatar vtrbo avatar wzc520pyfm avatar xiaojieajie avatar yzh990918 avatar zguolee avatar zhangmo8 avatar zyyv 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

onu-ui's Issues

Can't be installed with NPM or PNPM

Here is the error message:

> pnpm install onu-ui
 ERR_PNPM_FETCH_404  GET https://registry.npmjs.org/@onu-ui%2Fcomponents: Not Found - 404

This error happened while installing the dependencies of [email protected]

@onu-ui/components is not in the npm registry, or you have no permission to fetch it.

[Bug]: HMR in dev server

当我在开发环境中开发时(pnpm run dev),我使用了vite build --watchtsup --watch去监听多个 package 文件内更新进而重新打包,以方便playground进行开发环境的实时预览。
但是现在即时我开始 watch 模式,控制台也重新打包了,但是playground 并没有得到及时更新,我需要手动去执行pnpm run build,使playground的依赖发生变更,才会使 playground 拥有热更新。

有大神帮我解决一下问题吗?万分感谢🙏

ex:
image

image

[BUG]: Playground HMR not working

Description

I want to try to run Playground in the local dev environment, but I found that the libraries that Playground depends on are all CDN links, which means that Playground cannot sense changes in the component library, and I also found a problem, when I modify 'welcome.vue' with the editor, Playground cannot be refresh @baiwusanyu have time to help see if not,hhh.

You can try the minimal implementation locally bypnpm play .

New componet:Rate

截屏2022-09-18 13 37 49

Props

Attribute Description Type Accepted Values Default
modelValue binding value number 0
max max rating score number 5
readonly whether Rate is read-only boolean false
allow-half whether picking half start is allowed boolean false
color selected icon color string warning
void-color unselected icon color string -
show-text text displayed at the end of the star string -

Event

Name Parameters Description
change value after changing Triggers when rate value is changed

[Feature Request] - Republish the npm package

Clear and concise description of the problem

Component libraries need to be rebuilt and npm released for better typescript support.

Suggested solution

Describe alternatives you've considered

No response

Screenshots or Videos

No response

⏸️ Stop !!!

Let's pause the input of new components, we should optimize the current components and workflow first, and then consider new components.
I think so many issues should be optimized, we can review other component code mutually.

dev error

我在运行pnpm run dev 后 抛出了这样error,但是我debug了半天好像并没有发现原因😢
image

O-Card divider not shown with custom header slot

Description

<OCard divider>
 <template #header> header </template>
 <template #default> default </template> 
 <template #extra> extra </template>
 <template #actions> actions </template>
</OCard>

image

[Feature Request] - New component: Backtop

Clear and concise description of the problem

A back to top component.

It should contain at least the following props:

  • target: The target to trigger scroll.
  • visibility-height: The button will not show until the scroll height reaches this value.
  • right: Right distance.
  • bottom: Bottom distance.

It should also support click back and slots.

Suggested solution

No response

Describe alternatives you've considered

No response

Screenshots or Videos

No response

Build production optimization

I will reconstruct the build script of OnuUI. There are some problems in the current packaged dist package, such as no dts file export, which will cause problems in installation and use.

[BUG]: pnpm run play 失败

Describe the bug

我用ni安装完项目依赖,执行nr play后,显示以下报错:
image

我发现在packages/componentspackages/onu-uipackages/preset中,并没有build生成的dist文件夹,所以我分别在这三个项目中去执行build生成dist。然后再执行nr play,结果显示另外一个错误。如下图所示:
image

Reproduction

No response

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11700 @ 2.50GHz
    Memory: 3.27 GB / 15.72 GB
  Binaries:
    Node: 16.17.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
    npm: 8.15.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (105.0.1343.53)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    vue: ^3.2.39 => 3.2.39

Used Package Manager

pnpm

Validations

[BUG] - The HMR doesn't work any more after OnuUI used

Describe the bug

All the *.vue pages in brower will not be updated automatically after using OnuUI in main.ts like this

app.use(OnuUI);

Once a vue page that using any OnuUI element like OButton is actived, all the *.vue pages also will not be updated automatically any more.

<OButton >Button</OButton>

I can see the page is updated by vite:

11:17:02 [vite] page reload src/main.ts
11:17:45 [vite] hmr update /src/views/AboutView.vue

Reproduction

https://github.com/Dedal378/vue3-template

System Info

System:
    OS: Linux 4.19 Debian GNU/Linux 10 (buster) 10 (buster)
    CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
    Memory: 32.20 GB / 47.01 GB
    Container: Yes
    Shell: 5.7.1 - /usr/bin/zsh
  Binaries:
    Node: 16.17.0 - /usr/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 7.16.0 - /usr/local/bin/npm
  Browsers:
    Firefox: 102.4.0esr
  npmPackages:
    vue: ^3.2.41 => 3.2.41

Used Package Manager

pnpm

Validations

refactor: preset shortcuts

can I refactor the shortcuts of presetOnu in onu-ui package, like #15 ,
The file is too long for reading and writing styles

[BUG] - HMR: package/preset

Describe the bug

When I was developing, I found that after editing package/preset/src/shortcuts , the newly edited content will not take effect in the browser page.

  1. pnpm run dev
  2. pnpm run example
  3. edit file in package/preset/src/shortcuts
  4. HMR filed

Reproduction

No response

System Info

No response

Used Package Manager

pnpm

Validations

Button transition animation takes too long

按钮hover和active时有0.2s的过渡,就我个人体验而言我觉得时间有点长,给我造成一种卡顿的感觉,个人觉得可以不要这个0.2s的过渡或者过渡时间相对短一点

作者探讨个问题

我尝试 fork 项目,并编写了card组件,编写完了 unocss 的 preset shortcuts,发现最后打包并不能将新增加的 card 的 shortcuts 打包进style.css, 这很困惑我 , 其他的配置均没有动,能帮忙看看吗

fork仓库地址:https://github.com/251205668/onu-ui

🥰 V2 Plan

Description

We plan to refactor this component library, but due to our busy schedule recently, we shelved this plan, but we never gave up the idea of this plan. We very much welcome the idea of the'PR 'project. When we are done with what we are doing, we will restart the development of V2 . All the best wishes ❤️

I18n Support

Description

Like other component libraries, we will support switching between multiple languages.

BUG

Description

image

When I try the latest package, I don't know why this file in the dist package is referenced in the same way as before. Is there something wrong.

image

Local packaging is fine, This is a real headache.

O-Badge coloring inside button didnt work

Description

   <OButton 
     size="lg"
     type="primary"
     class="w-full"
   > 
     
     <OBadge o="primary"  :value="15">
        Testing 
     </OBadge>
     
  </OButton>

Badge should be blue but o-error styles from OButton class owerride css colors of badge by red.

Seems its not documented usage, but userfull for wide buttons with badges (like main menu or mobile menu and etc)

image

作者打算让社区一起做么?

因为我也挺想加入开发的,毕竟unocss + vue搭配起来真的很爽

但是你好像没说需要做哪些组件,想贡献也无从下手,可以在README写个todo,让社区一起贡献完善吗?

真的很期待unocss的ui

[BUG] - Some component usage issues

Describe the bug

I recently wanted to contribute a playground, but encountered problems during the writing process
1.An error will be reported when a single component of the component library is imported and used

Taking the button component as an example, a single manual import or automatic import using a plug-in will result in an error
image

2.The absence of class makes some style variables unavailable.
Take the message component as an example:
image

Reproduction

https://codesandbox.io/p/github/baiwusanyu-c/test-uno/csb-sebguv/draft/crimson-firefly?file=%2Fsrc%2FApp.vue&workspace=%257B%2522activeFileId%2522%253A%2522cla96yqwv0002l2ja51clf2jr%2522%252C%2522openFiles%2522%253A%255B%2522%252FREADME.md%2522%255D%252C%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522gitSidebarPanel%2522%253A%2522COMMIT%2522%252C%2522sidekickItems%2522%253A%255B%257B%2522type%2522%253A%2522PREVIEW%2522%252C%2522taskId%2522%253A%2522dev%2522%252C%2522port%2522%253A5173%252C%2522key%2522%253A%2522cla96zwjg000m356l327b8t79%2522%252C%2522isMinimized%2522%253Afalse%257D%255D%257D

System Info

I don't know if it's a beta version problem, or if I have some preset configuration errors
both mac and win
Version 1.0.10-beta.5

Used Package Manager

pnpm

Validations

Style(Collapse): Collapse Component border-bottom is strange

Description

In OnuUI, the border-bottom is the Title shown with the Folding panel Close.
But in other Ui Libray, The Collapse Component border-bottom will be with the animation from the Folding panel.

I don't know if this is a bug. But I think it's strange

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.