GithubHelp home page GithubHelp logo

josephuspaye / keen-ui Goto Github PK

View Code? Open in Web Editor NEW
4.1K 94.0 441.0 10.23 MB

A lightweight Vue.js UI library with a simple API, inspired by Google's Material Design.

Home Page: https://josephuspaye.github.io/Keen-UI/

License: MIT License

JavaScript 83.19% Vue 16.02% SCSS 0.71% HTML 0.07% CSS 0.01%
vue material-design ui components javascript vue3

keen-ui's Introduction

Keen UI

Keen UI is a Vue.js UI library with a simple API, inspired by Google's Material Design.

Keen UI is not a CSS framework. Therefore, it doesn't include styles for a grid system, typography, etc. Instead, the focus is on interactive components that require Javascript. You should be able to use Keen UI with any page layout, structure, or CSS framework.

Documentation and demo

http://josephuspaye.github.io/Keen-UI/

Requirements

Optional

Browser support

Keen UI supports browsers with native ES2015 support (same as Vue 3).

Installation

npm install keen-ui --save

Usage

CSS Reset

Before using Keen UI, ensure that the following CSS resets are applied to your site.

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

You can add the reset to your stylesheet (before other styles). If you are using a CSS framework, check to see if the framework already includes a reset (most CSS frameworks do). The root font size set on <html> can be customized to globally resize the components.

ES6

Use as a Vue plugin (globally registers all components):

import { createApp } from "vue";
import * as KeenUI from "keen-ui";
import "keen-ui/keen-ui.css";

const app = createApp();
app.use(KeenUI);

Use individual components:

import { createApp } from "vue";
import { UiAlert, UiButton } from "keen-ui";
import "keen-ui/keen-ui.css";

const app = createApp({
  components: {
    UiAlert,
    UiButton,
  },
});

Global script tag

First, add a stylesheet link to the Keen UI CSS file in dist/keen-ui.min.css. Then, add a script tag pointing to dist/keen-ui.min.js.

The library is made available globally via window.KeenUI so that you can use it on your app instance.

Example:

<!-- Place this in <head> -->
<link rel="stylesheet" href="path/to/keen-ui.min.css" />

<!-- Place this in <body> -->
<div id="app">
  <ui-button>{{ message }}</ui-button>
</div>

<script src="path/to/vue.global.prod.js"></script>
<script src="path/to/keen-ui.min.js"></script>
<script>
  const app = Vue.createApp({
    data() {
      return {
        message: "Hello world!",
      };
    },
  });
  app.use(KeenUI);
  app.mount("#app");
</script>

Customization

You can customize many aspects of Keen UI, including theme colors, component sizes, default props, and more.

See Customization.

Using standalone components

Each component is built into a standalone file with all its dependencies included. You can use these individual standalone components without importing the rest of the library. The standalone components are located in the lib/ folder.

Note Standalone component files each contain their own dependencies, and many contain overlapping dependencies. As a result, using multiple standalone files may increase the size of your bundle due to duplicate code.

import { createApp } from "vue";
import "keen-ui/src/bootstrap"; // Required when using standalone components, should be imported only once in your project
import UiButton from "keen-ui/lib/UiButton";
import "keen-ui/css/UiButton.css";

const app = createApp({
  components: {
    UiButton,
  },
});

Licence

Keen UI is open source and released under the MIT Licence.

Copyright (c) 2023 Josephus Paye II.

PS: Made something cool with Keen UI? I would love to know! Tweet to me at @JosephusPaye.

keen-ui's People

Contributors

albertmoravec avatar anvaka avatar artonge avatar ashwinkshenoy avatar davidiusdadi avatar dependabot[bot] avatar desko27 avatar emilmoe avatar entioentio avatar hiroshiba avatar hyvyys avatar jeff-hykin avatar jonasdoebertin avatar josephuspaye avatar kilobyte2007 avatar lewiscowles1986 avatar luispinero avatar minigod avatar myerscw avatar olsgreen avatar plakak avatar reinventit avatar sagg avatar saulio avatar stijnvermeeren avatar thedirigible avatar tom0brien avatar uran1980 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  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

keen-ui's Issues

Component does not register

I am very interested in this library but I am experiencing some issues integrating it into my vue-cli generated + vue-loader project:

main.js (NOTE: keen-ui was installed using npm):

import Vue from 'vue'
import Keen from 'keen-ui'
import VueRouter from 'vue-router'
import App from './components/App'
import CountriesView from './components/CountriesView'

Vue.use(VueRouter, Keen)

var router = new VueRouter()

router.map({
  '/countries': {
    component: CountriesView
  }
})

router.redirect({
  '*': '/countries'
})

router.start(App, '#app')

app.vue

<template>
  <div id="wrapper">
    <ui-button type="normal" color="success">Default</ui-button>
    <router-view></router-view>
  </div>
</template>

<script>
  import store from './../vuex/store'

  export default {
    name: 'App',
    store: store
  }
</script>

<style lang="scss">
  @import '~keen-ui/dist/keen-ui.css';
</style>

I keep getting the following error in the console:

vue.common.js?e881:987[Vue warn]: Unknown custom element: <ui-button> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

I am not sure why I keep getting these errors because I just followed the ES6 way of configuring keen according to the github documentation. Any ideas?

How to use "events"

Thanks for a great looking component package!

I'm trying to catch an event but I'm not sure how to do it. The @option-selected triggers, but how can I get the data from the event?

<ui-menu color="primary"
    @option-selected="doStuff()"
    :show-secondary-text="true"
    :options="[{text: 'Hey', id: 1, 'secondaryText': 'Ok whatever'}, {text: 'foop', id: 2}]">
    Hello world!
</ui-menu>
export default {
    name: 'Home',
    ready: function() {
        this.$on('option-selected', function (msg) {
            console.log(msg)
        })
    },
    methods: {
        doStuff: function() {
            //How do I get the option data here?
        }
    }
}

List of checkboxes connected to one list

Hi,

I can't go with rendering list of days with checkboxes (as long as there is no select, it's way around for multiple select).

<ui-checkbox v-for="day in days" class="col s12" :value.sync="selectedDays" v-bind:id="day.id" v-bind:label="day.name">

I was trying few other ways but no success.

I need to fill array with selected values.

UiAutocomplete

I'm not sure where you define the value prop? But it's returning the text value. I can't see how to return the value property which contains my id?

Ideally I would like to:

  • :text.sync=""
  • - to sync the text
  • :value.sync=""
  • - to sync the value
  • :object.sync=""
  • - to sync the whole object

UiIconButton group

Like you have in your examples, it would probably be needed (?) by others too to have a way to group icon buttons. I have added this to my styles, following a BEM structure.

<div class="ui-icon-button__group">
  <ui-icon-button></ui-icon-button>
  <ui-icon-button></ui-icon-button>
</div>
.ui-icon-button {
    &__group {
        display: flex;
    }
}

UIMenu: allow html / components inside options

I'm currently using UIPopover to show a dropdown menu where each option has a UISwitch toggle, resulting in a mutant, a functionality mix of UIMenu and UISelect (multiple with switches instead of checkboxes).
I think would be useful to allow for further customization on the UIMenu options.

Suggestion: Translations

It would be very nice to be able to translate all error message in one place. I will be happy to provide you at least a danish one :-)

Autocomplete events

Gday,

I've managed to get the autocomplete component working quite nicely but I'm wondering if you had any guidance on the best way to work with selection events? I couldn't really find a good way to do anything when a user selected something, I'm probably missing something obvious?

I did have a look at the source code and perhaps the Autocomplete component should dispatch events on the 'select' and 'highlight' methods that people can listen to? I did have an initial play with this and it seems to work well Does this sound like a worthwhile approach, if so I'm happy to put in a pull request.

Cheers

Binding

I can't seem to get the model value to bind for ui-textbox

<ui-textbox name="name" icon="input" label="Name" help-text="Please enter a name" validation-rules="required" value="name"></ui-textbox>

But when I type, Vuedev tools just shows the value as empty

No styling

I'm not sure what I'm missing here, I have added this to my main.js

import { UiAutocomplete } from 'keen-ui';

and registered the component. However if I use it will not style it, although the javascript seems to work.

Add CLASS prop to all components

Hi,
I hope you won't hate me for another issue opened...
Could you add CLASS prop for all components to make possible easy styling with just adding classes?

Debounce

The debounce attribute doesn't seem to do anything. See below:

<ui-textbox name="name" :debounce="500" icon="input" :value.sync="name" label="Name"></ui-textbox>

build from source

Could you consider publishing your webpack config files? Your package.json references these for nearly all builds, but they are ignored and not pushed making it impossible to build this package from source (or we'd have to reverse engineer a lot).
Same goes for your tests and their configs.

In short, could you provide the files you use to build your software instead of ignoring them

EDIT: I cloned the repo through bower which ignores above mentioned files. My apologies

Button Type

Is there a way to set the type on a button? It default to submit but I want to explicitly declare it as a button

the date&time picker is important

keen-ui is so beautiful and useful; i have found the thing like it for a long time;

I do not find a datetime component in keen-ui; and do you have a plan to support it???

and the rich text editor like Draft.js is important too, i think

Dynamic suggestions

Sorry for all the reports :-)

I want to dynamic load suggestions from my backend as the user types in the field. I'm not sure however if you have made this possible yet?
So now I just preload everything, but this isn't optimal when the database grow large of course.

Also it seems like that when I populate it with array of objects, it has a hard time auto completing my input?

UIIconButton symbol not centered horizontally in Safari on MacOSX

Hi,

First of all, your package is awesome. Many thanks for sharing it with the community.

I have a spotted a small issue with UIIconButton which does not center horizontally the icon in the button on Safari MacOSX. See screenshot from the documentation.
screen shot 2016-06-01 at 22 15 33

Actually, centering the icon can be achieved by changing the width in the ui-icon-button-icon class to 100% which forces the horizontal centering of the icon:

.ui-icon-button-icon {
    width: 100%;
    height: initial;
}

I have successfully tested it on latest versions of Safari, Chrome and Firefox on MacOSX.

Timeline for datepicker and select and floating labels

I really like this package you have made. I just need these components to make my project look more consistent, so do you have an idea what the time frame is for:

  • Floating labels
  • Select
  • Datepicker

And can I help in any way?

UiAutocomplete width of <ul>

It might be something I did, but the width of 0 makes the popup screw up. It should have the width of the input field in my opinion, but maybe it's something to do with the bootstrap code that messes it up and add the 0 width?

<ul class="sey-list sey-show" style="left: 341px; top: 552px; width: 0px;">

Change primary & secondary colors

Thanks a lot for these awesome set of components! They're so nice to use ๐ŸŽ‰

I just have one question though: is there an easy way of changing the primary and secondary colors used throughout the components when using the prebuild scripts and styles from the dist/ directory?

Or, what in general would I have to do to compile my own version of the CSS with changed colors?

Dropdown position

I thought there was error in dropdown position but everything is fine now
Thanks

Toolbar, hide nav icon does not work

It seems that hide-nav-icon="true" does not work on the toolbar. Also why are prop names in de docs in camelCase but differently in the real code, example: nav-icon (code) vs navIcon (docs)?

LICENSE

You probably want to check your LICENCE file name which differ from the LICENSE file entry in the package.json.

Nice job, btw!

UiTooltip

I have a component that opens another component in UiModal (the modal is placed in the first component).

In the second component I have UiIconButton with tooltip, but these tooltip don't show up.

The tooltips works fine in the first component, so I think something is going wrong in the inheritance proces.

UiSelect default value not marked as "selected"

When I use the Select component and want to edit a resource on my app, I cannot make the values pre-selected.

With multiple off, the value is not selected (which is not a problem), but with multiple on, the checkboxes are not checked, and when I "check" it the values get duplicated.

I'm absolutely no expert, but analyzing the code, I think the problem is on UiSelect, setDefaultValue method. For some reason, this.options[i] === defaults[j] is never true, even if it is true.

Can it be changed to this.options[i].value === defaults[j].value or something like this?


On a side note, I think requiring an array with "text" doesn't make sense... the important thing in a select option is the value... Can It be able to recognize different patterns, being the "value" the only required thing?

1st (value = text): [value1, value2, value3]

2nd: [{'value': value1, 'text': 'text to value1'}, {'value': value2, 'text': 'text to value2'}]

3rd: [{value1: 'text to value1'}, {value2: 'text to value2'}]

Also being able to accept a pattern as the options (like the 2nd one for example), and a different pattern as the value/default (because only the value matters, the text is only "aesthetic").

It would be great if you could make it happen!

Code snippets in documentation

Could we maybe get the code required under the examples in the docs. Would really help to get up and running with this library quickly. For example <ui-alert>Hi everybody! This is the default alert</ui-alert> under the alerts section.

UiTextbox height changes when disabled

The div with a class of ui-textbox-feedback is removed for disabled elements, but it has min-height:20px so it pushes everything 20px each time the disabled state changes. Maybe it needs to stay there but change the visibility?

Is there a sample guide i can implement my grid and typography?

I have successfully integrated all components but there is no grid...
and typography...

if i wanna include for example grid of bootsrap 4 , or materializecss grid or bulma...

How can i do it? any ideas?

thanks... Hope someone can help me , add this in my test app

To make it working with vue-validator

Hi,
@JosephusPaye
Is it possible to make it working with vue-validator?
It is more convenient than lib used by you - much less code necessary etc.
I think you would just have to accept v-validate and v-model and just replicate it (currently impossible).
What you think? A lot of people using vue-validator.
I found your package today and already like it so much!

Add autocomplete search type

Gday @JosephusPaye

Another idea for the autocomplete component.

Currently the search is powered by fuzzy search which returns items which might not be an exact match. In my use case I'm only interested in exact matches.

So would you be interested in adding a property that allows you to define the search type as either as fuzzy (used by default) or exact?

I've got the regex which powers an exact match search by looking at awesomplete and it seems to be working well so if you're interested I'll put in another pull request.

Cheers

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.