All Projects → axa-ch-webhub-cloud → pattern-library

axa-ch-webhub-cloud / pattern-library

Licence: other
AXA CH UI component library. Please share, comment, create issues and work with us!

Programming Languages

javascript
184084 projects - #8 most used programming language
SCSS
7915 projects
shell
77523 projects
HTML
75241 projects
Rich Text Format
576 projects
typescript
32286 projects

Projects that are alternatives of or similar to pattern-library

highcharts-webcomponent
Highcharts Web Component usable with any Framework
Stars: ✭ 21 (-79.61%)
Mutual labels:  webcomponents, custom-elements, lit-html, lit-element
lit-components
Moved to https://github.com/vaadin/component-mixins
Stars: ✭ 59 (-42.72%)
Mutual labels:  webcomponents, custom-elements, lit-html, lit-element
MoleculeJS
A library for creating fast and reactive Custom Elements
Stars: ✭ 39 (-62.14%)
Mutual labels:  webcomponents, custom-elements, lit-html
bui
‹b› Web components for creating applications – built by Blackstone Publishing using lit-html and lit-element
Stars: ✭ 29 (-71.84%)
Mutual labels:  custom-elements, lit-html, lit-element
rollup-plugin-lit-css
Moved to https://github.com/bennypowers/lit-css
Stars: ✭ 35 (-66.02%)
Mutual labels:  webcomponents, lit-html, lit-element
create-evergreen-app
Get up and running with an evergreen web application development stack designed by, and for, today's modern web.
Stars: ✭ 16 (-84.47%)
Mutual labels:  webcomponents, lit-html, lit-element
api-viewer-element
API documentation and live playground for Web Components. Based on Custom Elements Manifest format
Stars: ✭ 222 (+115.53%)
Mutual labels:  webcomponents, custom-elements, lit-element
redux-connect-element
Redux HTMLElement Connector
Stars: ✭ 16 (-84.47%)
Mutual labels:  webcomponents, lit-html, lit-element
wheat-ui
Web Components 组件库;拍平框架差异
Stars: ✭ 17 (-83.5%)
Mutual labels:  webcomponents, storybook, lit-html
polymerx-cli
⚡ Unlock the power of Polymer 3, Web Components and modern web tools.
Stars: ✭ 30 (-70.87%)
Mutual labels:  webcomponents, lit-html, lit-element
Wired Elements
Collection of custom elements that appear hand drawn. Great for wireframes or a fun look.
Stars: ✭ 8,848 (+8490.29%)
Mutual labels:  webcomponents, lit-html, lit-element
Vanilla Hamburger
Animated hamburger menu icons for modern web apps (1.8 KB) 🍔
Stars: ✭ 110 (+6.8%)
Mutual labels:  webcomponents, custom-elements
Styleguide
🖌 Conjunction of design patterns, components and resources used across our products.
Stars: ✭ 162 (+57.28%)
Mutual labels:  styleguide, lerna
Nutmeg
Build, test, and publish vanilla Web Components with a little spice
Stars: ✭ 111 (+7.77%)
Mutual labels:  webcomponents, custom-elements
Api Viewer Element
API documentation and live playground for Web Components
Stars: ✭ 121 (+17.48%)
Mutual labels:  webcomponents, custom-elements
Calcite Components
Web Components for the Calcite Design System. Built with Stencil JS. Currently in Beta!
Stars: ✭ 96 (-6.8%)
Mutual labels:  webcomponents, custom-elements
Vaadin Combo Box
The Web Component for displaying a list of items with filtering. Part of the Vaadin components.
Stars: ✭ 113 (+9.71%)
Mutual labels:  webcomponents, custom-elements
Omi
Front End Cross-Frameworks Framework - 前端跨框架跨平台框架
Stars: ✭ 12,153 (+11699.03%)
Mutual labels:  webcomponents, custom-elements
Hybrids
Extraordinary JavaScript framework with unique declarative and functional architecture
Stars: ✭ 2,529 (+2355.34%)
Mutual labels:  webcomponents, custom-elements
Standalone
Create framework agnostic components that are truly reusable and interoperable with all the benefits of the React ecosystem – using the HTML5 custom elements API to extend HTML's vocabulary.
Stars: ✭ 205 (+99.03%)
Mutual labels:  webcomponents, custom-elements

Pattern Library

CI/CD Status

>> Pattern Library Demo

Check out our Contribution File

Check out our Architecture File

Check out our Code of Conduct

Design Guidelines

Link to Styleguide

Communication

Use the following channels for different kinds of requests/reports:

  • Bug reports, small change requests, "wishes": Issues
  • Questions, requests for help, requests for product presentations, etc: Slack #patterns-lib-devs
  • Feature requests (Components, etc): Contact Webhub Team

What we deliver

We release self-contained plug-and-play web components based on the custom elements specification, derived from the lit-element base class (maintained by Google).

Pattern Library components are exported to npm with 2 types of build artifacts: /dist/index.js and /lib/index.* in ES2019.

Component versioning

Different versions of our web components can coexist on the same web page! Here you can read more about component versioning.

Released Components

lerna

Component Github Packages
AXA Accordion npm version
AXA Button npm version
AXA Carousel npm version
AXA Checkbox npm version
AXA Commercial Hero Banner npm version
AXA Container npm version
AXA Cookie Disclaimer npm version
AXA Datepicker npm version
AXA Dropdown npm version
AXA Fieldset npm version
AXA File Upload npm version
AXA Footer npm version
AXA Heading npm version
AXA Footer Small npm version
AXA Icon npm version
AXA Input File npm version
AXA Input Text npm version
AXA Link npm version
AXA Materials npm version
AXA Policy Features npm version
AXA Popup npm version
AXA Radio npm version
AXA Table npm version
AXA Table Sortable npm version
AXA Text npm version
AXA Textarea npm version
AXA Top Content Bar npm version
AXA Modal npm version
AXA Stepper npm version
AXA Testimonials npm version

Code of Conduct

We are dedicated to building a welcoming, diverse, and safe community. We expect everyone participating in the AXA community to read and accept our Code of Conduct

Version Control

This repository is a monorepo managed by Lerna. This means that all components are centrally managed here, even though we publish them to NPM as separate packages.

Pattern Library via community CDN

You can add any Pattern Library component via the community CDN jsdelivr. This is useful for Prototyping or experimenting or if you don't want to bother with a frontend stack. This works only native (no react support). Here an example on how to add the JS for <axa-button></axa-button>: <script src="https://cdn.jsdelivr.net/npm/@axa-ch/button@latest/dist/index.js"></script>

How do I get my (unit) tests to work when using Pattern Library components?

The problem

Unit-test frameworks like Jest run under the node environment, which is quite different from a browser. The most commonly used abstraction to mimic a minimal browser within node is jsdom. However, jsdom lacks crucial features such as Mutation Observer, Custom Elements and other browser APIs commonly needed by web components.

Solutions

So what are your options?

  • Insisting on jest, one option would be to use a better DOM emulation. Exchanging jsdom with happydom, we now have enough emulated browser features to test web components. The details are described here.
  • Instead of using jest, employ end-to-end (e2e) testing tools that control a real browser, e.g. Playwright, Cypress or Testcafe. Arguably this is a better match for UI-heavy apps anyway, because e2e tests are closer to a real user experience.
  • Use a lightweight mocking strategy. The idea is to mock pattern library components by a simple, traditional-HTML replacement such as a <div> or a <button>. Here is a code sketch using Jest that employs this strategy:
    All Pattern-Library React components are imported from this index.js.
    
    import createAXAButton from '@axa-ch-webhub-cloud/button/lib/index.react';
    import createAXADropdown from '@axa-ch-webhub-cloud/dropdown/lib/index.react';
    
    export const AXAButton = createAXAButton(createElement);
    export const AXADropdown = createAXADropdown(createElement);
    
    AXAButton.displayName = 'AXAButton';
    AXADropdown.displayName = 'AXADropdown';
    
    __mocks__/index.js
    
    export const AXAButton = (props) => {
    return <button {...props}>{props.children}</button>;
    };
    ...
    

Testing with Selenium, Testcafe and other UI testing tools

By default, pattern-library web components make use of ShadowDOM. To trigger interactions inside such web component you need to access the DOM via the ShadowRoot. Schematically, this works like this: UI Testtool -> Driver -> native DOM selector -> ShadowRoot -> querySelector

Here is a concrete example in Java using Selenium:

public WebElement expandRootElement(WebElement element, WebDriver driver) {
    WebElement ele = (WebElement) ((JavascriptExecutor) driver)
            .executeScript("return arguments[0].shadowRoot",element);
    return ele;
}

Calling this method gives you the ShadowRoot in your Selenium environment. Beware: when calling findElement on the return value of expandRootElement only the following selectors will work:

  • By.id
  • By.className
  • By.cssSelector
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].