20.37.1 • Published 5 months ago

@infineon/infineon-design-system-stencil v20.37.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

Infineon Design System Stencil Web Components (MVP)

GitHub Repo Issues GitHub Pull Requests GitHub Repo Version GitHub Master Branch Weekly Commits GitHub Repo Contributors GitHub Repo Discussions

About The Project

As part of the Infineon brand guidelines, the Infineon Digital Design System supports designers, developers and project managers to build user interfaces faster and better – with the ultimate goal to create a coherent and optimal user journey across all internal and external Infineon digital touchpoints.

This repository contains an implementation of Infineons Digital Design System and it's Storybook sourcecode using Stencil web components.

Use it to build & run storybook and distribute the Stencil web components.

Built With

Stencil web components

Example applications demonstrating the usage of IFX Web Components

Project structure

Overall structure

The repository has a monorepo architecture using Lerna. It contains not only our Stencil Web Components, but also framework integrations for Vue and React as well as example applications demonstrating component usage (not included in the Lerna workspaces)

Wrapper components

Stencil Web Components can be used with any JavaScript framework or with no framework at all, just like any other HTML elements. This is because they are built on Web APIs that are native to the browser. They are self-contained and encapsulate their functionality in a way that makes them portable and easy to drop into any project.

To bridge the gap between Stencil components and specific frameworks, it can be useful to create wrapper components

A Stencil Wrapper Component is a component that wraps around a Stencil Web Component and translates the properties, events, and methods to work seamlessly within the specific framework context.

Our Wrapper Components are built automatically every time npm run stencil:build is executed.


Getting Started

Prerequisites

Installation of the component libraray


Angular

1.

  • with NPM

npm install --save @infineon/infineon-design-system-stencil

  • with Yarn

yarn add @infineon/infineon-design-system-stencil

2. Installation of SASS

npm install sass

3. Import the module inside your entry point file

#main.ts
import { defineCustomElements } from "@infineon/infineon-design-system-stencil/loader";

defineCustomElements(window);

4. Additional steps only for Angular

Inside app.modules.ts file:

import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';

@NgModule({
 ...
  schemas: [
    CUSTOM_ELEMENTS_SCHEMA
  ],
 ...
})

React

React Wrappers: Similarly to Vue, a React wrapper provides a React interface to a Stencil web component, making the web component feel more like a typical React component. This includes proper handling of props, state, and events within the context of a React application.

1. Installation

- with NPM

npm install @infineon/infineon-design-system-react

- with Yarn

yarn add @infineon/infineon-design-system-react

2. Installation of SASS

npm install sass

3. Import the module inside your entry point file

import { defineCustomElements } from '@infineon/infineon-design-system-react';
//...

defineCustomElements(window)

In React, there isn't a built-in mechanism to globally register components like in Vue. Therefore, components need to be imported in the file that they are being used in.

4. Usage

import { IfxProgressBar, IfxSearchBar, IfxButton } from '@infineon/infineon-design-system-react';
//...
<IfxSearchBar onIfxChange={handleSearch} show-close-button="true"></IfxSearchBar>

React + Javascript specific

It may be necessary to add the following to your .env file at project root:

GENERATE_SOURCEMAP=false

This can also be achieved by updating your start script in the package.json accordingly.


Vanilla

Include the following script tag in your index.html

<script type="module" src="https://cdn.jsdelivr.net/npm/@infineon/infineon-design-system-stencil/dist/infineon-design-system-stencil/infineon-design-system-stencil.esm.js"></script>'

Vue

1. Installation

- with NPM

npm install @infineon/infineon-design-system-vue

- with Yarn

yarn add @infineon/infineon-design-system-vue

2. Installation of SASS

npm install sass

3. Import the module inside your entry point file

//main.js/main.ts
import { ComponentLibrary } from '@infineon/infineon-design-system-vue';
//...

createApp(App).use(ComponentLibrary).mount('#app');

In Vue, this registers the components globally.

4. Usage

<ifx-progress-bar v-model="progress" size="m" show-label="true"></ifx-progress-bar>

General usage of IFX web components

Explore our currently available web components in Storybook. You will also find the code snippets needed to include them in your application.

https://infineon.github.io/infineon-design-system-stencil


Using only the Icons

For the case in which you only want to use our icons, please follow these steps:

  1. install the package by following the instructions for the respective framework
  2. Import only the ifx-icon component inside your entry point file as explained below;

For React: index.js/index.ts For Vue: main.js/main.ts For Angular: main.ts

import { defineCustomElement as defineCustomElementIfxIcon } from "@infineon/infineon-design-system-stencil/dist/components/ifx-icon";

defineCustomElementIfxIcon(window);

Local development

Installation

git clone https://github.com/Infineon/infineon-design-system-stencil.git

Install all the modules and dependencies listed on the package.json file with:

yarn/npm install

Build Storybook

To run Storybook to view and test our Stencil Web Components, we first need to export it as a static web app.

For building the application for the first time (to load fonts, assets and stylesheets) run:

yarn/npm run build:components

Start Storybook

To run storybook locally (automatically rebuilds on changes), run:

yarn/npm run storybook

Example applications

To test the standard Stencil components within our example applicatons, navigate to

cd examples/stencil-components

and go to the folder for Vue, React, Angular or VanillaJs. Follow the instructions described in the readme.md in each of these folders.

To test the Wrapper components within React or Vue applicatons, navigate to

cd examples/wrapper-components

and go to the application folder you want to use for testing. (React-Ts, React-Js, Vue-Ts, Vue-Js). Again, follow the instructions described in the readme.md in each of these folders.


Contributing

  • Clone the repository
  • Create an issue with a proper description (Naming convention: 'name-of-component: feature/bug')
  • Create a pull request with a proper description
  • Request a review (tishoyanchev || verena-ifx)

Email

dds@infineon.com

20.37.1

5 months ago

20.37.0

5 months ago

20.36.5

5 months ago

20.36.4

5 months ago

20.36.3

5 months ago

20.36.2

5 months ago

20.36.1

5 months ago

20.35.0

5 months ago

20.36.0

5 months ago

20.31.0

6 months ago

20.20.0

8 months ago

20.20.1

8 months ago

18.5.6

10 months ago

18.5.5

10 months ago

18.5.4

10 months ago

18.5.3

10 months ago

18.5.2

10 months ago

18.5.1

10 months ago

18.5.0

10 months ago

20.18.0

8 months ago

20.29.0

6 months ago

20.29.1

6 months ago

19.1.0

9 months ago

19.1.2

9 months ago

18.3.3

10 months ago

19.1.1

9 months ago

18.3.2

10 months ago

19.1.4

9 months ago

18.3.1

10 months ago

19.1.3

9 months ago

18.3.0

10 months ago

19.1.6

9 months ago

19.1.5

9 months ago

19.1.8

9 months ago

19.1.7

9 months ago

19.1.9

9 months ago

20.1.0

9 months ago

20.15.0

8 months ago

20.15.1

8 months ago

20.15.2

8 months ago

20.15.3

8 months ago

20.15.4

8 months ago

20.26.0

7 months ago

20.26.1

6 months ago

20.3.0

9 months ago

20.17.0

8 months ago

20.17.1

8 months ago

20.17.2

8 months ago

20.17.3

8 months ago

20.17.4

8 months ago

20.17.5

8 months ago

20.28.0

6 months ago

20.5.0

9 months ago

20.11.0

9 months ago

20.11.1

9 months ago

20.22.0

8 months ago

20.22.1

8 months ago

20.22.2

8 months ago

20.22.3

8 months ago

20.7.0

9 months ago

20.13.0

8 months ago

20.33.0

6 months ago

20.24.0

7 months ago

20.24.1

7 months ago

20.9.0

9 months ago

20.9.2

9 months ago

20.9.1

9 months ago

18.2.9

10 months ago

19.0.0

9 months ago

20.32.0

6 months ago

20.23.12

7 months ago

20.23.13

7 months ago

20.23.10

7 months ago

20.23.11

7 months ago

20.23.16

7 months ago

20.23.17

7 months ago

20.23.14

7 months ago

20.23.15

7 months ago

20.23.18

7 months ago

20.23.19

7 months ago

20.30.1

6 months ago

20.30.0

6 months ago

18.6.0

10 months ago

20.19.0

8 months ago

20.19.1

8 months ago

20.19.2

8 months ago

20.19.3

8 months ago

20.19.4

8 months ago

20.19.5

8 months ago

20.19.6

8 months ago

18.2.19

10 months ago

18.2.18

10 months ago

18.2.17

10 months ago

18.2.16

10 months ago

18.2.15

10 months ago

18.2.14

10 months ago

18.2.13

10 months ago

18.2.12

10 months ago

18.2.11

10 months ago

18.2.10

10 months ago

18.4.1

10 months ago

18.4.0

10 months ago

20.0.1

9 months ago

20.0.0

9 months ago

20.0.4

9 months ago

20.0.3

9 months ago

20.0.2

9 months ago

20.2.1

9 months ago

20.2.0

9 months ago

20.14.0

8 months ago

20.25.0

7 months ago

20.25.1

7 months ago

20.25.2

7 months ago

20.4.0

9 months ago

18.7.1

9 months ago

18.7.0

10 months ago

20.16.0

8 months ago

20.16.1

8 months ago

20.16.2

8 months ago

20.16.3

8 months ago

20.16.4

8 months ago

20.16.5

8 months ago

20.16.6

8 months ago

20.16.7

8 months ago

20.16.8

8 months ago

20.27.0

6 months ago

20.6.0

9 months ago

20.10.0

9 months ago

20.21.0

8 months ago

20.21.1

8 months ago

20.21.2

8 months ago

20.21.3

8 months ago

20.21.4

8 months ago

20.8.0

9 months ago

20.12.0

8 months ago

20.34.6

5 months ago

20.34.5

6 months ago

20.34.4

6 months ago

20.34.3

6 months ago

20.34.2

6 months ago

20.34.1

6 months ago

20.34.0

6 months ago

20.23.0

8 months ago

20.23.1

8 months ago

20.23.2

8 months ago

20.23.3

8 months ago

20.23.4

8 months ago

20.23.5

8 months ago

20.23.6

8 months ago

20.23.7

8 months ago

20.23.8

7 months ago

20.23.9

7 months ago

18.2.8

11 months ago

18.2.7

11 months ago

18.2.6

11 months ago

18.2.5

11 months ago

18.2.4

11 months ago

18.2.3

11 months ago

18.2.2

11 months ago

18.2.1

11 months ago

18.2.0

11 months ago

18.1.1

11 months ago

18.1.0

11 months ago

18.0.9

1 year ago

18.0.10

1 year ago

18.0.11

1 year ago

18.0.12

1 year ago

18.0.13

1 year ago

18.0.14

1 year ago

18.0.15

12 months ago

18.0.16

12 months ago

18.0.17

12 months ago

18.0.18

12 months ago

18.0.19

12 months ago

18.0.20

12 months ago

18.0.21

12 months ago

18.0.1-canary.6

1 year ago

18.0.1-canary.5

1 year ago

1.0.0

1 year ago

18.0.8

1 year ago

18.0.7

1 year ago

18.0.6

1 year ago

18.0.5

1 year ago

0.0.68-canary.7

1 year ago

0.0.68-canary.8

1 year ago

0.0.68-canary.9

1 year ago

0.0.68-canary.0

1 year ago

0.0.68-canary.2

1 year ago

18.0.4

1 year ago

18.0.3

1 year ago

18.0.2

1 year ago

18.0.1

1 year ago

18.0.0

1 year ago

18.0.1-canary.0

1 year ago

18.0.1-canary.2

1 year ago

18.0.1-canary.1

1 year ago

18.0.1-canary.4

1 year ago

18.0.1-canary.3

1 year ago

0.0.64

1 year ago

0.0.65

1 year ago

0.0.66

1 year ago

0.0.67

1 year ago

0.0.68

1 year ago

0.0.63

1 year ago

0.0.62

1 year ago

0.0.60

1 year ago

0.0.52

1 year ago

0.0.51

1 year ago

0.0.50

1 year ago

0.0.49

1 year ago

0.0.48

1 year ago

0.0.47

1 year ago

0.0.46

1 year ago

0.0.45

1 year ago

0.0.44

1 year ago

0.0.43

1 year ago

0.0.42

1 year ago

0.0.41

1 year ago

0.0.40

1 year ago

0.0.39

1 year ago

0.0.38

1 year ago

0.0.37

1 year ago

0.0.36

1 year ago

0.0.35

1 year ago

0.0.34

1 year ago