Code Monkey home page Code Monkey logo

elix's Introduction

Elix logo

Elix is a community-driven collection of high-quality web components for common user interface patterns.

Most applications make use of common, general-purpose user interface patterns such lists, menus, dialogs, carousels, and so on. Such patterns can be efficiently implemented and packaged as web components. Their modular nature lets you easily incorporate web components into your web application, and their standard definition ensures good results across browsers.

This arrangement permits a beneficial economy of scale, as common patterns only have to be implemented once. But that is not to say that it’s easy to develop general-purpose user interface patterns as solid components. To the contrary, implementing even simple patterns with a very high degree of quality can entail substantial complexity.

For that reason, the Elix project believes that implementing high-quality, general-purpose components is best done as a community effort. This spreads the cost of creating the components across organizations, and ensures that the resulting components satisfy a broad range of concerns and can be used in many contexts.

For full details and demos, see the Elix documentation.

Quick start

Plain HTML and JavaScript

Add the Elix package to your package.json:

{
  "dependencies": {
    "elix": "<latest version number here>"
  }
}

Then run npm install. We generally recommend locking your package.json to a fixed Elix version number (1.0.0 rather than ^1.0.0 or 1.x, for example). See more at Versioning.

In markup, you can then reference the components you need:

<html>
  <head>
    <script type="module" src="node_modules/elix/define/Carousel.js"></script>
  </head>
  <body>
    <elix-carousel>
      <!-- Images and other elements go here -->
    </elix-carousel>
  </body>
</html>

Alternatively, in JavaScript, you can directly import components:

import Carousel from "elix/define/Carousel.js";

const carousel = new Carousel();
// Add images, etc., to the carousel.
const image1 = new Image();
image1.src = "image1.jpg";
carousel.append(image1);
// Add the carousel to the page.
document.body.append(carousel);

The Elix project itself requires no build step. You are free to use your preferred tools to bundle the Elix modules for better network performance.

You can try out the plain HTML and JavaScript project on your own machine.

React

See the sample React project showing how to use Elix components in a React application.

TypeScript

See the sample TypeScript project showing how to use Elix components in a TypeScript application. Elix includes TypeScript declaration files so that you can confirm that interactions with Elix components are type safe.

Core principles

  • Usability excellence. All components are designed with the experience of the end user in mind. Each component tries to provide the best implementation possible of a very common user interface pattern. The components try to provide a great user experience by default, freeing you from having to worry about small details, and letting you focus on your application’s core value. Elix includes universal access in its definition of usability excellence: our components should provide a great experience to all users regardless of temporary or permanent handicaps.
  • As good as HTML elements. These components are measured against the Gold Standard checklist for web components, which uses the built-in HTML elements as the quality bar to which web components should aspire. These components should work predictably and reliably in a wide variety of contexts and with good performance.
  • Ready for use. The project's components can be used as-is, without requiring any customization or further coding.
  • Extensible behavior. No design can meet every situation — there is no One Carousel to Rule Them All. Elix components are factored into parts that you can readily recombine to create solid components to meet your needs.
  • Use the platform. These components are generally written as "close to the metal" as is possible while still allowing code to be shared across components. These components are not built upon a monolithic framework, nor is any shared runtime required to use them. By virtue of being web components, these elements can be used with any front-end framework.
  • Maximize the audience of potential contributors. Designing components that appeal to a broad audience requires accepting contributions from a broad audience. For that to happen, we can’t rely on complex, project-specific abstractions or techniques. We try to write the component code to be as plain as possible, with the least amount of declarative, framework-style magic. In practice, that means that clear, verbose code is often preferred over tight but inscrutable code. We’re willing to tolerate a certain degree of boilerplate code if that makes it easier for you to understand the code or step through it when you’re debugging your own application. If you’re able to write a simple web component in plain JavaScript, a minimal learning curve should allow to you to understand — and contribute to — Elix code.
  • Well-documented. We do our best to document not only the public API of each component and mixin, but also the underlying intention and design principles. We try to document why something is the way it is in order to make the best use of a potential contributor’s time.
  • Provide a minimalist, themeable appearance. These components are meant to fit unobtrusively into your application, and so come with a bare minimum of styling. They can be customized to achieve more distinctive visual effects or branding to blend seamlessly with your application’s own style.
  • Intended to be a foundation for brand design systems. Web components are an excellent way to implement your company's design system so that everyone in your company can build consistent, high-quality UI aligned with your brand. Elix components are explicitly designed to be used as the basis for such a design system. Elix takes care of the structural styling and fundamental UI interactions so that you can focus your time on the aesthetics and behavior that make your brand unique.
  • Native source that loads directly in the browser. We want to leverage your existing understanding of the web's core technologies, and avoid imposing any build-time tools. All Elix demos load directly in the browser with no transpilation or bundling required. (For production environments, of course, you can optimize and package the code however you want.) We use TypeScript on the side as a type-checker to achieve high confidence in our code, but the source for all components is in plain JavaScript.
  • Work on all mainstream browsers. This includes the latest versions of Apple Safari and Mobile Safari, Google Chrome and Chrome for Android, Microsoft Edge (Chromium-based), and Mozilla Firefox.
  • Open process. The process behind Elix is as important to us as the code artifacts. We strive to incorporate feedback from a general web audience, while at the same time imposing just enough structure to keep the project moving forward at a consistent pace in a consistent direction. To that end, all significant changes to the project are proposed and tracked through Request for Comments (RFC) documents tracked in the Elix RFCs repository.

Versioning

Elix is an ambitious attempt to deconstruct complex user interface elements into constituent parts at various levels of abstraction. We regularly feel like the project is breaking new ground at the frontier of front-end design and implementation. That can be exciting, but also means that promising implementation strategies will sometimes turn out to be dead ends. Moving forward will often entail breaking changes.

  • Elix follows standard semantic version numbering, and signals breaking changes by incrementing its major project version number.
  • We do our best to announce breaking changes in advance, and to provide upgrade guidance as we can.
  • In some cases, we may retire a particular component or mixin and replace it with something fundamentally new.
  • These user interface components are extremely complex, and are designed to be customized to work in a wide range of applications and environments. This means that even minor Elix releases may accidentally introduce breaking changes, particularly in customized components. We’ll try to fix those when we can.
  • As recommended above, locking on to a specific Elix version number will let you evaluate new Elix releases — including minor releases — in a more controlled fashion.

Contributing

Please see our Contributor's guide.

The Elix project is led by Component Kitchen, which offers professional support for Elix.

elix's People

Contributors

catwell avatar cletusw avatar dependabot[bot] avatar howlowck avatar imme-emosol avatar janmiksovsky avatar mateatslc avatar mroderick avatar nerdbeere avatar robbear avatar rperki8 avatar wolframkriesing 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

elix's Issues

`ExpandablePanel` should not use `height` on the host after animation finish

The ExpandablePanel assumes that children added to the panel won''t change (at least I can't see any code related to it). When a content is rendered (opened property is set to true) and after removing an item from the children, the panel keeps the original height of the content.

I am using the ExpandablePanel in an navigation element. It renders a list of items. The navigation items, however, changes for given conditions and and if the tree leaf was opened and a child was removed it renders a gap. I need to close and open the panel to mitigate this.

I think that after finishing the animation the panel should remove the height from the container's styles.

How to change icon on MenuButton?

I'm trying to change the icon on the menu button and docs say I should use "up-icon" and "down-icon" CSS part, but nothing is working:

I cannot even change the background color, never mind the image.

            elix-menu-button::part(up-icon) {
                background: pink;
            }

Drawer backdrop's maxOpacity hardcoded

In the Drawer, the backdrop's maxOpacity is hard-coded to 0.2. That makes it impossible to adjust the color to be darker than the default. Overriding it with ::part(backdrop) { opacity: 1 } effectively disables the transition, since the transition is overridden while the animation is taking place.

I propose either:

  • Changing the default styling to [part~="backdrop"] { opacity: 1; background: rgba(0, 0, 0, 0.2); } and setting maxOpacity to 1, or
  • Making opacity a property of Backdrop (or ModalBackdrop, or Drawer, whichever) that can be used to override the maxOpacity here.

Bug when resolve dependencies

Hi
when i run npm install command; npm show me the next error message:

npm ERR! Error while executing:
npm ERR! /usr/local/bin/git ls-remote -h -t ssh://[email protected]/componentkitchen/sauce-test-runner.git
npm ERR!
npm ERR! ERROR: Repository not found.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128

pleas; can you check the version name of resource componentkitchen/sauce-test-runner?

standalone downloadable version?

the components look really nice, but if one wants to try them in a mostly-server-side context (maybe with a sprinkle of js) using node seems very overkill. Is there a reason elix is not on cndjs or doesn't have a minified .js.zip download link?

Add ability to disable blur handling in popups

We find ourselves commenting out the blur handler during development because it can wreak havoc with debugging:

// If we lose focus, and the new focus isn't inside us, then close.
this.addEventListener("blur", blurHandler.bind(this));

It would be nice if there were a config option for this, or at least some way of temporarily removing this.

Thanks.

IE/Edge support?

I see that there is no IE11 and not even Edge support. But what is the limiting factor?
Can it run with a Webcomponents loader?
Does it need shims etc?
Is it compiling to ES6?

Would be helpful since I still need IE11 support in my project and found your efforts spot on. I would gladly contribute if this solved my problems.

Website documentation bug in Symbol.js

@JanMiksovsky
The elix.org documentation for Symbol.js results in a broken link. (Thank you, @Nevraeka)

I looked into this and one of the last changes to mixins/Symbol.js involved documenting the uniqueString function for TypeScript purposes. I think this broke the documentation at the time for Symbol, but we didn't notice.

The buildDocs.js script (in the web site build) is making assumptions about documentation ordering - that the object matching the file name (Symbol.js => "Symbol") is the first thing in the file being documented. Since uniqueString is now coming first, terror and mayhem ensue.

We can either make the ordering a coding convention, and/or I can look into mapping the documented object whose name matches the file become the first item in the computed list. Doing the former would be most expedient. If we want to allow more flexibility in the source placement of the primary object, we can add a new issue as a work item to update the documentation generation code.

Feedback

Hi @JanMiksovsky and all contributors

Last night while looking for good Web Components starting point and after seeing Polymer and few others I found Elix and I am impressed!

Just to say thank you for the great array of mixins, the use of es6 modules (that works in the browser), not having a complicated build step, not dependent on an astronomical number of packages, not using elaborate styles and themes, and most importantly the flat folder structure of src, ... just beautiful.

SlidingStage interferes with tab navigation

After going through all focusable elements of a SlidingStage item, tab navigation jumps to the next SlidingStage item (1st problem) and causes a partial scroll of that item in order to make the focused element visible (2nd problem).

Steps that reproduce the issue

My use case is a multi-page wizard implemented as a form containing a SlidingPages/SlidingStage and a pair of buttons for validation+navigation. Each page contains focusable elements such as INPUT:

          <elix-sliding-pages>
            <div>
              <h2>PAGE 1</h2>
              <input name="input1a">
              <input name="input1b">
            </div>
            <div>
              <h2>PAGE 2</h2>
              <input name="input2">
            </div>
          </elix-sliding-pages>

          <div>
            <button style="float: right">Next</button>
            <button>Previous</button>
          </div>

Click on input1a ("start"), then hit the 'tab' key a first time, focus goes to input1b. Hit the tab key again, focus goes to input2. The second item ("PAGE 2") becomes partially visible.

Expected behavior
Focusable elements, which are in items not currently shown, should not participate in tab navigation. Instead, navigation should leave the item and jump to the next focusable outside of the SlidingStage component (here the "Next" button).

Methink the proper behavior would be attained if not-shown items had visibility: hidden. This does not seem to interfere with the transition effect, at least when tested by adding the rule:

      elix-sliding-pages > [aria-selected="false"] {
        visibility: hidden;
      }

Filtering with diacritical marks

It would be really useful to have an option on the components such as FilterListBox to ignore diacritical marks. That would allow for a search of para (for example) to return both paralelogramo and parábola in Spanish.

Drawer doesn't open or close the way I'd expect

Disclaimer: I'm early-on in my exploration of web components, so it's possible I'm missing something really obvious—sorry, if that's the case.

For a couple days I've been attempting to get the <elix-drawer></elix-drawer> to work within our Polymer or LitElement library. I'm seeing some puzzling behavior, though.

After trying it in Polymer 3 and then in a LitElement component, I created a simple HTML document to test :

<!DOCTYPE html>
<html>
  <head>
    <script src="./dist/bundle.js"></script>
    <!-- elix/define/Drawer.js is included in the bundle above -->
    <script>
      function openDrawer() {
        document.getElementById('drawer').opened = true;
      }

      function closeDrawer(event) {
        document.getElementById('drawer').opened = false;
      }
    </script>
  </head>
  <body>
    <elix-drawer id="drawer">
      <button onclick="closeDrawer()">Close</button>
    </elix-drawer>
    
    <button onclick="openDrawer()">Open</button>
    <button style="position: fixed; z-index: 100000;" onclick="closeDrawer(event)">Close</button>
  </body>
</html>

In this state:

  • The drawer opens when I push the Open button.
  • I can close the drawer by clicking the backdrop, but not by clicking the Close button inside the drawer.
  • I can close the drawer by clicking the Close button that is outside the drawer. 🤔 (I don't really care to be able to do that, though, unfortunately.)
  • In Dev Tools, if I select the button inside the drawer and call $0.parentElement.close() or $0.parentElement.opened = false, it works. However, either of those fail when used in the onclick attribute or assigned via addEventListener.

Here are some things I tried while attempting to wrap the elix-drawer with another drawer component:

Tried Result
Setting opened attribute to "true" Drawer is "opened" initially but not visible. Clicking anywhere on the screen "closes" it, i.e. the drawer suddenly becomes visible and plays the closing animation
Just applying the opened attribute with no value No noticeable result
opened="opened" No noticeable result
Using document.getElementById('drawer').open()/.close() instead of setting opened to true/false open() works fine, close() doesn't. In Dev Tools I can see that the opened and aria-expanded attributes are updated, though. (To true.)
Setting opened=false or closed=true programmatically, e.g. in LitElement's updated() callback Doesn't work—same as above

After all this, I can't close the drawer from within at all (e.g. by clicking a close/X button or by pressing Save), and I can't initialize the drawer in an opened state. I like the accessibility and usability of this drawer component, and I'd rather not implement all the functionality it has built in, but I can't really use it for anything if I can't get these basic functions working…hopefully you can set me straight?

Can't see Elix component in context of Angular dynamic component sample app

From Twitter user @SwConsults:

I have a quick question. I"m able to consume Elix within an Angular App, but when I place Elix or any Web Component within a Dynamically Generated Component, there's no errors but the component does not show either. Have you seen this issue before?

im using this sample code: https://stackblitz.com/angular/mrxxaqgmrel … ( which is the official code from Angular https://angular.io/generated/zips/dynamic-component-loader/dynamic-component-loader.zip … ). By adding 2 lines of code into the hero-profile.component.ts there's no errors but the component never renders. I also imported import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; and schemas: [CUSTOM_ELEMENTS_SCHEMA]. Any ideas?

Filing this as an issue so we can track and hopefully help out other Angular users.

Event handler not triggered

Awesome work, I am doing some test in the devtools console on the site components.
How come if I monitorEvents(elix-expandable-panel) I don't get the opened-changed event.
But I do get the selected-index-changed when monitorEvents(elix-list-box)

'focusableTarget is null' when clicking Date Combo Box

I am trying to use the Date Combo Box in a webcomponent project based on lit-element written in Typescript. The combo loads and runs correctly except for this error 'focusableTarget is null' when I click anywhere in the flyout. the actions are correctly captured before it closes. For example clicking on the right chevron will move the calendar forward by one month before the flyout closes.

here is my render fuction

protected render(): TemplateResult {
    return html`
            <h1>Elix Example</h1>

            <elix-date-combo-box
            year-format="2-digit"
            month-format="2-digit"
            days-of-week-format="long"
            >
          `;
}

Am I doing something wrong?

FilterComboBox overflow

The dropdown container's height should be limited and allow scrolling. Right now it overflows the container:

FilterComboBox

regarding TypeScript; change documentation || example project

The documentation currently contains the following text:

TypeScript

See the sample TypeScript project showing how to use Elix components in a TypeScript application. Elix includes TypeScript declaration files so that you can confirm that interactions with Elix components are type safe.

But the example shows one component and not even in what I would consider an application.

Question: By customizable web-components do you also mean that they can be styled/themed with external CSS

I like your web components - they seem like un-styled and therefore not opinionated, which is great

would you like to clarify in the readme, a little bit on your vision of styling them or theming them.

Do you think, its a good idea, to give an option or make it easier to leak styles to the shadow DOM so that they can be styled with an external stylesheet, or do you have any other way to make it possible,
I am sure there will be cases where others can consume these component as is without any change to its behavior but style them according to some corporate guidelines ?

Question: removing children automatically

For example: Toast.

I was searching the whole project for "remove" (HTMLElement::remove) invoke, and did not see any.
How does the toast removes itself from the DOM?

CrossfadeStage: Unselected items are transparent but can still interfere with interactions inside selected item

This issue was first referenced by @bahrus in #104, and I'm opening a new issue to track it.

@bahrus reports:

I created a demo, which, if I'm not mistaken, may indicate something is amiss.

What you see when open the page appears to be Standard Rooms Detail, which is a details element, inside of which is a button. Expanding the summary ought to show the button inside. It doesn't (for me). But when I switch to the Deluxe button, I see the Deluxe Rooms Detail expanded.

The relevant component here is CrossfadeStage, a subcomponent used inside a Tabs instance in the Serene demo.

CrossfadeStage currently gives the selected item opacity: 1 and the other, unselected items opacity: 0. While that does make the items appear invisible, they're still there on the page, and can prevent the user from clicking through to items — e.g., buttons — on the selected item (here, in the original report, a tab). As one response to this StackOverflow question indicates, "You should think of an opacity:0 element as if it was made of glass."

CrossfadeStage can't simply hide the unselected items, as they need to be visible for the animated CSS opacity transition to work. What's needed is for CrossfadeStage to hide all unselected items until the transition effect is needed. It then needs to show the newly-selected item, and leave the previously-selected item visible until the transition effect completes. At that point, it should hide the previously-selected item.

Related feature request from #104: CrossfadeStage should raise an event when the transition effect completes so that the outer page can perform any work of its own once the new selection state has completely finished rendering. Since CrossfadeStage is used as a stage inside of Explorer subclasses like Tabs, Explorer should also be aware of that transition effect complete event, and reraise it. (If it doesn't do that, an effect complete event raised by CrossfadeStage won't bubble up outside of the Explorer's shadow boundary.)

SlidingStage: Minimum web api requirements (SlotContentMixin not populated in Safari 12 mobile)

hello! I'm thinking of using the lib to build a big universal production-ready web application.

Looking at the code and at the demos, I was not able to figure out the minimum browser APIs needed for the components to run.

I was able to run the sliding pages demo (https://component.kitchen/demos/slidingPages.html) on desktop evergreen browsers fine (chrome, safari, and firefox), but when trying to run into chrome (78.0) mobile and safari (12.2) mobile swiping the screen has no effect. I suspect that it is because of the initial state of the components is not populated. (edited)

Upon inspecting the elements on Safari inspector, apparently the [internal.state] looks like some values did not update:

Safari mobile
image

Google chrome desktop
image

So, i have some doubts:

  • Which are the minimum Web Api requirements for the lib support?
  • Is there any limitation with the library in regards to using mobile on devices besides availability of native API's?
  • Are there community plans to maintain mobile support?

btw, awesome architectural job on the lib selecting classes, building the interoperability and abstracting responsibilities!

how to add forms / input elements validation

It seems that the Input element (possibly also other elements participating in a form) does not propagate the type attribute to the inner input element. This prevents the default browser validation from taking place.

The Input documentation states about type:

The value of this property will be the same as the HTML tag name registered for the custom element.

And that is indeed the case (elix-input), but what is the purpose? In Chrome I can force the inner element type to be number and get a specialized input (though I must admit that this doesn't work with type email).

Of course to keep elix clean and reliable, it might be preferable to not rely on the browser for validation because of the implied styling of specialized input types. But then elix form elements could provide their own validation, like is currently done in NumberSpinBox ?

I realize that validation is not an easy topic --even the NumberSpinBox implementation is questionable as the feedback messages are not internationalization-ready. So in this issue I am rather asking for advice: how do you suggest we add validation to elix form elements ? (assuming a 'modern' browser, see also issue #113 for the others)

incorrect size for PlainHamburgerMenuButton

Just a small glitch: the style for PlainHamburgerMenuButton goes

          :host {
            height: 1em;
            width: 1em;
          }

          [part~="menu-icon"] {
            display: block;
            height: 24px;
            width: 24px;
          }

So the size of the host is set to a value different (usually smaller) then the size of the contained icon, causing the icon to overflow and be misaligned in its container. Removing the :host styling fixes the issue.

production-grade support for forms / input elements

Hi elix / component kitchen team

We just started to use elix, which we had selected for its complete UI component set, clean implementation, and most importantly for its explicitly unopinionated styling. It's a shame that this project is not better known, from our perspective you are doing exactly what needs to be done. Thank you, elix rocks! :-)

We are struggling with forms, and this is the first of two issues I would like to report:

If we are not mistaken, currently (elix v12.1x) only Chrome and Edge are supported when using elix input components within a form (ElementInternals required). In order to be able to use elix in production with a wider browser coverage, we added a shadow hidden element when elix-input is mounted:

        if (!("ElementInternals" in window)) {
          this.state.input = document.createElement("INPUT");
          this.state.input.type = "hidden";
          this.state.input.name = props.name;
          this.$('elix-input').parentElement.appendChild(this.state.input);
        }

The value of that shadow input must of course be updated each time the input event fires:

      onInput(ev) {
        const value = ev.target.value;
        if (this.state.input) {
          this.state.input.value = value;
        }
      }

With this ticket I wanted to ask if something similar could not be done within FormElementMixin and/or Input ?

UPDATE: thinking about issue #114, adding support for validation might be tricky... It does at any rate speak for a pure elix implementation instead of relying on browser support.

named slot in embedded component ends up in default slot

I am trying to use elix from within a web component framework (Riot.js). See this minimal demo: https://plnkr.co/edit/7m76cYjdj4Xl9fqQ.

I found out that named slots within the elix component are not handled correctly (default slots are fine). It looks like those slots have their name stripped: they end up next to the default slot content for the elix component.

Is elix doing any specific processing on named slots? Do you see a specific reason why this is happening? I am aware that mixing elix and Riot.js might be tricky, this is not so much a bug report as a request for guidance.

Drop down appears under other Comboboxes

I'm really enjoying working with elix, it seems to be a high quality set of components, that are shockingly difficult to find elsewhere packaged as well.

When I have an auto complete combo box immediately above another autocomplete combobox the popup appears underneath the lower auto complete combo box.

<!DOCTYPE html>
<html>
<body>
    <script type="module" src="https://unpkg.com/[email protected]/define/AutoCompleteComboBox.js"></script>
    <elix-auto-complete-combo-box aria-label="Pet" value="Cat">
        <div>Cat</div>
        <div>Dog</div>
        <div>Fish</div>
    </elix-auto-complete-combo-box>
    <br />
    <elix-auto-complete-combo-box aria-label="Pet" value="Dog">
        <div>Cat</div>
        <div>Dog</div>
        <div>Fish</div>
    </elix-auto-complete-combo-box>
</body>
</html>

Steps:

  1. Load the above page in a browser (I've tested in Firefox 80.0b1 and chrome 84.0.4147.105)
  2. Click on the top combo box
  3. Observe that the 'Dog' combo box is on top of the drop down.

[Design] What other basic elements can contributors work on?

This is a issue to discuss what elements and/or collections should be created for Elix. What are the ways to determine if a element is right for this repository? Solely the gold standard or other criteria?

Here are a few ideas to start...

🔘 Tabs Family
⚪️ Inputs?
⚪️ Buttons?
⚪️ Spinners?
⚪️ Layout and media query families?

Feature Request : package it as monorepo

I have a use case where I would like to use/extend a single component from elix.
importing the whole package makes my extended component too bulky.
Would you consider restructuring this project as a Monorepo and logically separate the shared and unique code into individual sub-packages ?

A11y Issue with navigating the DateComboBox component.

Begin with a clear and concise description of the bug.

Steps that reproduce the issue

  1. Go to your documentation page for the DateComboBox. https://component.kitchen/elix/DateComboBox
  2. Using the keyboard only (no mouse or trackpad) try to select a date from the calendar dropdown.

Expected behavior
I expected to press the "Enter" key and use the arrow keys to move around, the press "enter" again when the preferred date is reached. This is how the CalendarMonthNavigator component works. https://component.kitchen/elix/CalendarMonthNavigator

Thanks

Styling with classes (get template() called only once)

tldr; what would it take to call get template() for every instance on the page?

I'm experimenting with ways to style elix components. Here's one way:

<elix-button data-class="f6 link  br2 ph3 pv2 mb2 dib white dim bg-green pointer"  id="btnTachyon">Elix Tachyon Button</elix-button>

<elix-button disabled data-class="f6 link  br2 ph3 pv2 mb2 dib white button-disabled bg-gray"  id="btnTachyonDisabled">Elix Tachyon Button</elix-button>

I can pass classes in via dataset attributes. Then modify the component to pick them up like this:

get [symbols.template]() {
    console.log('get template: ${this.id} - ${this.dataset.class}')
    return template.html'
      <style>
        @import "/assets/tachyons.min.css";
        .button-disabled {
          opacity: 0.65;
          cursor: not-allowed;
        }
      </style>

      <button class="${this.dataset.class}" id="inner" role="none">
        <slot></slot>
      </button>
    ';
  }

But get template() is only being called once, regardless of the number of instances on the page, so both buttons are getting the same classes.

The call chain is non-trivial:

get [template] | @ | Button.js:103
  | getTemplate | @ | ShadowTemplateMixin.js:107
  | [render] | @ | ShadowTemplateMixin.js:81
  | [render] | @ | ReactiveMixin.js:138
  | [render] | @ | WrappedStandardElement.js:333
  | [render] | @ | KeyboardMixin.js:89
  | [render] | @ | FocusVisibleMixin.js:90
  | [render] | @ | AriaRoleMixin.js:24
  | [render] | @ | Button.js:86
  | render | @ | ReactiveMixin.js:98
  | connectedCallback | @ | ReactiveMixin.js:49

Thoughts?

Elix elements aren't observed

Issue

elix-hamburger-menu-button doesn't work, no menu icon and no overflow hidden. There's no console error too.

Reproducing

Create a Laravel project with laravel new elix-proj and edit webpack.mix.js with the line:

mix.js('resources/js/elix.js', 'public/js')

Set the contents of the view welcome.blade.php to:

<!doctype html>
<html>
<head>
    <script type="javascript" src="{{ mix('/js/elix.js') }}"></script>
</head>
<body>
    <elix-hamburger-menu-button style="float: right">
        <button>Store</button>
    </elix-hamburger-menu-button>
</body>
</html>

Create resources/js/elix.js with:

import Input from "elix/define/Input";
import HamburgerMenuButton from "elix/define/HamburgerMenuButton";
import AutoSizeTextarea from "elix/define/AutoSizeTextarea";

new Input;
new HamburgerMenuButton;
new AutoSizeTextarea;

Run:

$ composer install
$ npm install
$ npm install elix --save-dev
$ npm run dev
$ php artisan serve

Restoring state to components

I am probably doing this wrong...but

<elix-auto-complete-combo-box id="bomlist" >
          ${this.state.bomManagerList.map((item) =>
              html`
              <div value="${item.bomId}">${item.name}</div>
              `)}
      </elix-auto-complete-combo-box>

when I render this I want to be able to indicate which is the selected item based on the value. Can I do that?

<elix-auto-complete-combo-box id="bomlist" selected-item="${this.selectedBomId}">

Carousel draggable with mouse

This is related to the examle https://component.kitchen/elix/Carousel

From other carousels/sliders I am used to be able to move the slide by dragging it with the mouse button down. Currently, it seems that the default event is to drag/drop the image inside the slide. It's probably just a missing preventDefault to fix that issue. Or is this behaviour by design?

can't "get started"; cloning plain-example gives permission denied

I tried following the instructions on this page. When I type git clone [email protected]:elix/plain-example.git I get the error below. I'm not an expert on Git but have used it successfully before. In the same command prompt I typed git clone https://github.com/material-components/material-components-web.git and it worked fine.

git
Cloning into 'plain-example'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Build doesn't work on Windows

From @svastanesto:

I had some problems with running the build, which turns out to be due to the fact that I am on windows. So slash is different, in the split() and lastIndexOf() part of the script in tasks/wphelper.js (key.lastIndexOf('\') + 1)).key.split('\').pop(); Of course it needs to be fixed so its platform independent. And I also needed to add {shell: true} in lintHelper.js (let task = spawn( 'jshint', args, {stdio: 'inherit', shell: true});) nodejs/node-v0.x-archive#2318 (comment)

So I got it to build now at the end without errors. However, it looks like babel is not transpiling, and I am left with classes in demos.js, which then breaks in IE 11 of course.
But maybe it would not work anyway, due to those breaking changes that you mentioned in web components polyfill?

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.