Code Monkey home page Code Monkey logo

inovex / elements Goto Github PK

View Code? Open in Web Editor NEW
69.0 7.0 9.0 160.08 MB

Lovingly crafted ui components based on web components. Works well with all Frameworks - including Angular, React and Vue.

Home Page: https://elements.inovex.de

License: MIT License

JavaScript 2.24% TypeScript 74.15% HTML 2.26% SCSS 14.14% Vue 1.28% CSS 0.14% MDX 5.78%
web-components stencil storybook angular react inovex-elements vue interoperability components design-system

elements's Introduction

inovex Elements

GitHub GitHub commits since latest release (by date) GitHub issues npm bundle size Libraries.io dependency status for latest release GitHub package.json version GitHub Repo stars

Lovingly crafted UI components based on native Web Components
for Angular, React, Vue or any JavaScript project.


Installation

Click on the framework logo to view the installation guide.


✨ Features

  • 🌈 Beautiful UI designed for web applications.
  • 📦 A set of high-quality Web components out of the box.
  • 🛠️ Integrable with your favorite framework
  • 🛡 Written in TypeScript with predictable static types.

⚙️ Tech

We are using the following libraries under the hood:

🔗 Links

❓ Support

Ask a question here

elements's People

Contributors

alessarad avatar benpag avatar bingecode avatar dependabot[bot] avatar dnnr avatar github-actions[bot] avatar helperfunction avatar iandi09 avatar inovexelements avatar jacobcofman avatar janivo avatar jcofman avatar johannesnissl avatar krimdomu avatar magruschinske avatar marialstefan avatar michael-janssen-inovex avatar ninaschlz avatar p1nhe4d avatar pfecht avatar rbrtmrln avatar reysi avatar safi1012 avatar silenthoo avatar sl1nd avatar tobiasheimgalindo avatar webnina 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

elements's Issues

ino-fab: Tooltip failing to append

Describe the bug

If an ino-tooltip renders within ino-fab, it's not ensured that they load in a defined order. It comes down to a race-condition on which one loads first. That leads to various problems (anchor for tooltip not found, tooltip undefined, ...).

To Reproduce

Steps to reproduce the behavior:

  1. Use the ino-fab with tooltip enabled (not extended, tooltip-placement not none)
  2. See console
  3. Refresh if no error

Possible Solution

Wait for the ino-fab to finish loading and append the ino-tooltip afterward.

multiple ino-snackbar instances appear upon changing the value of a story knob

Describe the bug

Storybook generates multiple instances of the ino-snackbar component upon changing the value of a single knob.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://elements.inovex.de/dist/latest/storybook/?path=/story/notification-ino-snackbar--default-usage
  2. Open the footer containing the knobs by pressing D
  3. Change the value of any knob
  4. Click on the corresponding ino-button to open the snackbar
  5. Multiple instances should appear on the screen even though the button has been pressed only once

Expected behavior

Only a single instance of the ino-snackbar should appear if the button is pressed once.

Screenshots

Screenshot 2020-09-28 at 17 32 03

Your Environment

Software Version
@inovex.de/elements 1.0.2
Browser Safari
Operating System Mac OS

ino-fab-set: Small bar below the dial button

Describe the bug

There is a bar below the dial button of the ino-fab-set.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://elements.inovex.de/dist/latest/storybook/?path=/story/buttons-ino-fab-set--default-usage
  2. See the Button in the bottom left

Expected behavior

No bar below the button.

Screenshots

Before:
image
Now:
image

Your Environment

Software Version
@inovex/elements 0.21.0

Possible Solution

The ino-tooltip-placement is left by default which positions the tooltip to the left of the fab-button. The dial button has no label and therefore the ino-tooltip-placement should be set to none.

ino-input: autofocus does not work inside ino-card

Describe the bug

Autofocus of ino-input does not work if wrapped by an ino-card element.

To Reproduce

Steps to reproduce the behavior:

  1. Put ino-input with autofocus enabled inside ino-card element
  2. Reload Page
  3. ino-input is not focused

Expected behavior

Autofocus should work despite its parent element.

URLs in components showcase point to the landing page

Describe the bug

Clicking on any component card in the components showcase leads to the landing page.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://elements.inovex.de/dist/latest/storybook/?path=/story/docs-showcase--components
  2. Click on any component card
  3. You'll end up on the landing page

Expected behavior

Clicking on a component card should lead to the documentation of the corresponding component.

Your Environment

Software Version
@inovex.de/elements 1.0.0
Browser Safari
Operating System MacOS

Possible Solution

/dist/latest/storybook/ needs to be added to the beginning of the path.

Allow Consumers to set border box to all elements

Describe the bug

It is convenient that consumers may set box-sizing: border-box; to all elements, i.e.

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

The elements should support these configurations. However, I identified that the ino-input and ino-chip components do not understand this.

Expected behavior

The element's behavior exactly the same.

Possible Solution

(To debug): Set the border-box setting within the storybook)

  1. Override the border-box setting for all needed elements (ino-chip and ino-input for sure) with
& * {
    box-sizing: initial;
  }

ino-table: disable shadow dom

The shadow dom of the ino-table component is currently activated which makes it difficult to adjust the appearance of the table as the piercing selectors (/deep/, ::ng-deep or >>>) are no longer supported.
What is more, there aren't any CSS variables that can be used to, for example, set the width of the table. Hence, I would like to propose to disable the shadow dom of the affected component and wait for the concept to evolve before enabling it again.

Provide global styles for consumer application

It would be great to have a global stylesheet which can be imported to have typography and inovex branding in the consumer application.

Stencil provides https://stenciljs.com/docs/config#globalstyle this out of the box and inovex-elements use it so far only for a few variables.

Having such a stylesheet, the consumer can decide whether he wants to import global styles or not. It's shipped and distributed in dist/collection/inovex-elements.css but not part of the core components.

One possible way to import the style would be in an app.scss with:

@import "../../../node_modules/@mips-see/elements/dist/inovex-elements/inovex-elements.css";

An idea for the content: Theming (Typography, Colors, ...):

@import "./fonts.scss";


$headings-font-weight:         500 !default;
$headings-line-height:         1.2 !default;
$h1-font-size:                 26px !default;
$h2-font-size:                 24px !default;
$h3-font-size:                 22px !default;
$h4-font-size:                 20px !default;
$h5-font-size:                 18px !default;
$h6-font-size:                 16px !default;


:root, html {
  font-family: $font-family-sans-serif;
}

a {
  background-color: transparent;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: $headings-font-weight;
  line-height: $headings-line-height;
}

h1 {
  font-size: $h1-font-size;
}

h2 {
  font-size: $h2-font-size;
}

h3 {
  font-size: $h3-font-size;
}

h4 {
  font-size: $h4-font-size;
}

h5 {
  font-size: $h5-font-size;
}

h6 {
  font-size: $h6-font-size;
}

small {
  font-size: 75%;
}

sub,
sup {
  position: relative;
  font-size: 75%;
  line-height: 0;
  vertical-align: baseline;
}

sup {
  top: -.5em;
}

sub {
  bottom: -.25em;
}

Second step: Move the entire "LatoImport"-Stuff to this global stylesheet and let the consumer decide, whether he wants to import lato or already has it (or any other typo) imported.

elements-angular: Event Handlers are called twice for checkbox component

Describe the bug

Value Accessors for ino-checkbox handle the same events twice. Hence, checkedChange-handler sin Angular are triggered twice. This leads to problems, if we want to implement toggle logic without explicitly check the emitted state.

This bug has a high potential to affect other components like radio, switch, ... as well (I did not test it tho).

To Reproduce

Integrate the @inovex.de/elements-angular package on v2 and add the InoElementsModule as import in the AppModule of an Angular application (aká setup Angular for Elements).

Hence, define a component as:

import { Component } from "@angular/core";

@Component({
  selector: "app-root",
  templateUrl: "./app.component.html",
  styleUrls: ["./app.component.css"]
})
export class AppComponent {
  title = "CodeSandbox";

  events = [];

  checkedChangeHandler($event) {
    this.events.push("Event triggered");
  }
}

with the response template:

<!--The content below is only a placeholder and can be replaced.-->
<div>
  <h1>
    Welcome to {{ title }}!
  </h1>
  This is a test sandbox:
  <ino-checkbox (checkedChange)="checkedChangeHandler($event)"></ino-checkbox>

  <ul>
    <li *ngFor="let event of events">{{event}}</li>
  </ul>
</div>

Finally, check and uncheck the checkbox. As you can see, the event is thrown twice.

=> See the following codesandbox: https://codesandbox.io/s/eloquent-allen-fppgd

Expected behavior

EventHandlers are only triggered once.

Additional context

My insights are:

The event (checkedChange) is only thrown once from ino-checkbox, but handled twice within the BooleanControlValueAccessor In the https://github.com/inovex/elements/blob/master/packages/elements-angular/elements/src/directives/control-value-accesors/value-accessor.directive.ts we have the following code:

  handleChangeEvent(value: any) {
    if (value !== this.lastValue) {
      this.lastValue = value;
      this.onChange(value);
      this.writeValue(value);
    }
  }

Since this code is called twice for every checkbox state change, this leads to the following behavior:

  1. Call: Value is different from lastValue => writes the value to the native input
  2. Call: Value equals last value => do nothing.

However, the checkedChange-Event is still handled by the defined checkedChange-handler.

(No) Possible Solution

It is not possible, to simply change the abvoe code to:

  handleChangeEvent(value: any) {
    if (value !== this.lastValue) {
      this.lastValue = value;
      this.onChange(value);
      this.writeValue(value);
    } 
   else {
       // ===>  event.stopImmediatePropagation()
    }
  }

to avoid other handlers from being called, since Angular does not support this (angular/angular#9587).
Further, this "solution" doesn't answer the question of why the event is handled twice in the first place.

One possible path of investigation may be to use the native change and to check the difference of our implementation to ionic https://github.com/ionic-team/ionic-framework/tree/master/angular/src/directives/control-value-accessors

Use shared font files

In our packages (elements and storybook) we use custom fonts, which we host ourselves in our project. Currently the fonts are defined in the elements package (see https://github.com/inovex/elements/blob/master/packages/elements/src/components/styles/fonts.scss). The storybook package tries to import these fonts into its own package:

@use '../../../elements/src/components/styles/mdc.customize';

Since the import of the fonts is a relative import, the files cannot be found by the Storybook. Here we should find a way to store the fonts statically and use them in both packages.

ino-icon: Replace occurrences of hardcoded color codes with currentColor

Problem

Our icons (SVG's) have hardcoded color codes in their strokes/path/polyline elements. This leads to the problem that we have to figure out on which level these elements reside inside their SVG and write a specific CSS selector for the icon in order to overwrite these hardcoded color codes.

Suggestion

Replace all occurrences of hardcoded color values with currentColor. This way we only have to set the color attribute on the SVG element itself and the provided color will be applied to each element without having to write a special case for each icon.

ino-card: Provide a way to disable the hover effect

Is your feature request related to a problem? Please describe.

When using the ino-card there is currently no way to disable the hover effect. In some cases (e.g. just displaying some data), it might be helpful to disable this behavior.

Describe the solution you'd like

Provide a way to disable the hover effect which elevates the card.

Describe alternatives you've considered

I've tried to disable/overwrite the current behaviour with CSS but without any success.

The component font is blurry (floating components)

Describe the bug

While elements are floating, the font is blurry. At least on Retina screens.

To Reproduce

  1. Go to https://elements.inovex.de
  2. Scroll a bit down to see the floating elements
  3. Watch when the element is floating up or down
  4. You now see the blurriness of the font

Expected behavior

The font is crystal clear.

Screenshots

image

ino-input: Number-Arrows too large

Describe the bug

The arrows in the ino-input number-type appear too large.

To Reproduce

Steps to reproduce the behavior:

  1. Checkout current master and start the storybook
  2. Go to Storybook -> ino-input
  3. Scroll down to Demo -> Types
  4. See error

Expected behavior

image

Possible Solution

The css variables for the Ino-Icon component have been changed. These were probably not adjusted correctly.

Refactor fonts

As a consumer, I would like to have the choice of my preferred font. Currently, the use of Lato font is deeply connected inside the elements and wrappers like Angular.

It would be better to let the consumer decide whether the fonts should be imported or not.

Aspects of a possible solution

  • The default font face for all components can be changed at a single place (css variable?)
  • No inovex-elements fonts are imported if the consumer changes the font face.
  • No font-dependant code in any angular/react wrapper.

ino-select: opened menu doens't close on scroll

Describe the bug

If you open the select box and scroll the site the menu is kept open.

To Reproduce

Steps to reproduce the behavior:

  1. Go to 'https://elements.inovex.de/dist/latest/storybook/?path=/story/input-ino-select--default-usage'
  2. Click on any 'ino-select' sample to open the options
  3. Scroll down and up
  4. See error

Expected behavior

According to the behavior of the native select the menu should close on scrolling the page.
Probably its a better option to replace the underlying material select with the native one? As there are further complexities with ino-select, propaply its a better solution to switch to the native select and replace the underlying material select #26?

ino-option: Height too large

Describe the bug

The height of the ino-options appear too large.

To Reproduce

Steps to reproduce the behavior:

  1. Go to the storybook with version > 0.18.0
  2. Go to ino-select
  3. Open a select menu
  4. See error

Expected behavior

https://elements.inovex.de/dist/v0.18.0/storybook/?path=/story/input-ino-select--default-usage
image

Screenshots

If applicable, add screenshots to help explain your problem.
image

Possible Solution

The change of height to min-height in 21717eb introduced this behavior. The height should possibly be set to auto and padding applied.

angular/react: Fonts can't be found

Describe the bug

After updating to version 1.0.2, the selfhosted fonts cannot be found in the consumer project.

To Reproduce

Steps to reproduce the behavior:

  1. Add @inovex.de/elements(-react/-angular)@1.0.2 package to your dependencies
  2. Start the app
  3. Open dev console in browser
  4. See error

Expected behavior

No errors and the correct fonts to be used.

Screenshots

React:
image
Angular:
image

Your Environment

Software Version
@inovex.de/elements 1.0.0
Browser Chrome 85.0.4183.102

Possible Solution

We probably have to copy the fonts to the angular and react wrapper as well.

ino-tooltip cannot find target

Describe the bug

On some occasions, the ino-tooltip component throws an error which states that the target to attach to could not be found. But the component still seems to work properly.

To Reproduce

Hard to reproduce because it's most likely a race condition.

Steps to reproduce the behavior:

  1. Create an ino-tooltip next to any element
  2. Give the element an id and enter the same ID in the inoFor attribute of the ino-tooltip
  3. Open the dev-tools/console and observe the error

Expected behavior

The ino-tooltip should find the element inside the document and should not throw an error.

Screenshots

bildschirmfoto_2020-07-29_um_11 35 08

Your Environment

Software Version
@inovex/elements 0.19.1
Browser Chrome 84.0.4147.105
Operating System MacOS Catalina 10.15.5

Possible Solution

I believe the problem might be caused by a race condition. Both elements are in the process of being rendered and therefore the element cannot be queried yet. A timeout of 1 sec exists already but maybe this value has to be increased.

JS import is deprecated

Describe the bug

If you follow the JS integration instruction in our docs, you will find out that the import of the elements is not working with version 1.1.0.

<script src="https://elements.inovex.de/dist/v1.1.0/inovex-elements.js"></script>

This line will return a 404 error code and you won't be able to use the elements.

To Reproduce

Steps to reproduce the behavior:

  1. Start a new js project
  2. In your index.html, import the elements with the script tag like this: <script src="https://elements.inovex.de/dist/v1.1.0/inovex-elements.js"></script>
  3. Open dev console within your running application
  4. See errors

Expected behavior

No 404 error code and useable components

Your Environment

Software Version
@inovex.de/elements 1.1.0

ino-switch story: color schemes are not rendered correctly

Describe the bug

The different color schemes in the ino-switch story are not rendered correctly - all switches have the same color.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://elements.inovex.de/dist/latest/storybook/?path=/story/input-ino-switch--default-usage
  2. Scroll down to the examples
  3. All switches have the default color scheme

Expected behavior

The colors should be different and correspond to the title of each switch.

Screenshots

Screenshot 2020-09-29 at 11 10 37

Your Environment

Software Version
@inovex.de/elements 1.0.2
Browser Safari
Operating System Mac OS

Canary releases

Add canary releases in order to provide consumers a fast way to upgrade to new features.

Describe the solution you'd like

It would make the development much easier if the latest master would always be published to npm registry as canary deployment.

Additional context

Lerna has such a feature and we could add such a script to package.json

 "publish:canary": "yarn lerna publish --canary --exact --preid next.$(git rev-parse --short HEAD) --force-publish='*'"

This deploys a new version under the tag canary (we can change the tag with --dist-tag) and adds a version based on the last commit hash. It forces all packages to create a canary release and use the exact version to overcome conflicts resolving the correct version.

Canary deployments neither create a git commit nor a tag. We can add such canary release to the github pipeline in a similar way to the following gitlab ci script step:

publish_package:
  stage: publish
  script:
    - PUPPETEER_SKIP_DOWNLOAD=true yarn 
    - yarn publish:canary
  only:
    - master

This requires the pipeline to be able to publish to npm registry.

Support dynamic ino-option inside of ino-select

Describe the bug

The ino-select component has a deeply nested <slot> which is used to insert the ino-options. If you dynamically insert other ino-options at runtime, the elements will not be rendered at it's correct position inside the DOM because of the virtualDOM which is used by React and Vue. Read more about it here: ionic-team/stencil#2259.

To Reproduce

Steps to reproduce the behavior:

  1. Use React/Vue
  2. Import the elements(/-react) package
  3. Use the ino-select component
  4. Insert ino-options dynamically

Expected behavior

The options should correctly be placed inside the slot of the ino-select.

Screenshots

If applicable, add screenshots to help explain your problem.

Your Environment

Software Version
@inovex/elements 0.21.0
Browser Chrome
Operating System MacOS Catalina

Additional context

ionic-team/stencil#2259

Possible Solution

Use the ino-option-group component as a wrapper around the dynamically added ino-options. This way the slots are direct children of the ino-option-group and the problem should not occur again. In order to use the ino-option-group this way, it is necessary to be able to use this component without having to provide the ino-label property.

ino-table: fix documentation samples

The example of an ino-table given in the Storybook (https://elements.inovex.de/dist/latest/storybook/?path=/story/structure-ino-table--default-usage):

<ino-table>
    <ino-table-row slot="header">
        <ino-table-cell>Column A</ino-table-cell>
        <ino-table-cell>Column B</ino-table-cell>
    </ino-table-row>
    <ino-table-row slot="body">
        <ino-table-cell>Cell A1</ino-table-cell>
        <ino-table-cell>Cell B1</ino-table-cell>
    </ino-table-row>
    <ino-table-row slot="body">
        <ino-table-cell>Cell A2</ino-table-cell>
        <ino-table-cell>Cell B2</ino-table-cell>
    </ino-table-row>
</ino-table>

is not working.

Took me quite a while to find out the proper syntax searching the docs of ino-table-row and ino-table-cell.

Also: Would be great to extend the documentation for the data table in general and motivate for certain decisions (like f.i. the ino-numeric property in ino-table-cell.

Automated release not working correctly

Describe the bug

When we try to release a new version, we use the lerna release command. Up to the last step - the release of NPM.js - everything runs correctly, but the release of the Angular Package fails without giving a helpful error message.

To Reproduce

⚠️ Caution! When executing the lerna publish command, the core and the react packet will be irreversibly published.

Steps to reproduce the behavior:

  1. Clone the project
  2. Install dependencies
  3. Run lerna publish --conventional-commits --no-changelog
  4. See the error on angular package

Expected behavior

The angular package to be successfully released as well.

Your Environment

Software Version
@inovex.de/elements 1.0.2

ino-select: size changes on selecting different options

Describe the bug

If you select different options the width of the element changes. This behavior changed because the underlying native select
has been replaced with material select component. https://material.io/develop/web/components/input-controls/select-menus
Now, if no fix width is set the width is set to the current selected option.

To Reproduce

Steps to reproduce the behavior:
Use ino-select in a flex box container with various options that differ in its text-length.

Expected behavior

The behavior is similar to the native select. The length of the ino-select doesn't change on chaging option. Overfloating options are displayed with an ellipsis('...')

ino-input-file: Drag 'n Drop

Describe the solution you'd like

I would like to upload a file by dragging it onto the ino-input-file component.

Describe alternatives you've considered

I can already upload a file by clicking the upload button and selecting the file within the file explorer. While this solution is working correctly, it's sometimes more comfortable to drag the file without having to navigate in the file explorer.

ino-input: onBlur test fails after Stencil upgrade

Describe the bug

An onBlur event tests fails after upgrading from Stencil v0.18.0 to v1.4.0.

To Reproduce

Steps to reproduce the behavior:

  1. Uncomment this test:
    it('should trigger inoBlur-Event when blurred', async () => {
  2. Start test script with yarn test
  3. See test failing

Expected behavior

Test to be successful

Additional context

(by @P1NHE4D)

We tried:

  • Searching for similar issues in Stencil's Github Repo
  • Triggering the event with the native blur() function
  • Upgrading Puppeteer

Maybe a Stencil upgrade will do the trick?

Evaluate Styled-Components

I just found this repository in which they use the styled components library with stencil. Personally, I'm a big fan of it and I think it might be worth it to use this library instead of css/sass. We should evaluate this option.

Here are some reasons from the documentation on why to use styled-components:

styled-components is the result of wondering how we could enhance CSS for styling React component systems. By focusing on a single use case we managed to optimize the experience for developers as well as the output for end users.

Apart from the improved experience for developers, styled-components provides:

  • Automatic critical CSS: styled-components keeps track of which components are rendered on a page and injects their styles and nothing else, fully automatically. Combined with code splitting, this means your users load the least amount of code necessary.
  • No class name bugs: styled-components generates unique class names for your styles. You never have to worry about duplication, overlap or misspellings.
  • Easier deletion of CSS: it can be hard to know whether a class name is used somewhere in your codebase. styled-components makes it obvious, as every bit of styling is tied to a specific component. If the component is unused (which tooling can detect) and gets deleted, all its styles get deleted with it.
  • Simple dynamic styling: adapting the styling of a component based on its props or a global theme is simple and intuitive without having to manually manage dozens of classes.
  • Painless maintenance: you never have to hunt across different files to find the styling affecting your component, so maintenance is a piece of cake no matter how big your codebase is.
  • Automatic vendor prefixing: write your CSS to the current standard and let styled-components handle the rest.

You get all of these benefits while still writing the CSS you know and love, just bound to individual components.

ino-nav-drawer showcase card contains a faulty link

Describe the bug

Clicking on the ino-nav-drawer card in the showcase section does not lead to the documentation of the component.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://elements.inovex.de/dist/latest/storybook/?path=/story/docs-showcase--components
  2. Click on the nav-drawer-card
  3. You'll end up on a page telling you that there are no stories.

Expected behavior

Clicking on the ino-nav-drawer card should lead to the corresponding story of the component.

Your Environment

Software Version
@inovex.de/elements 1.02
Browser Safari
Operating System MacOS

Possible Solution

There's a typo in the link to the story which causes the error - naw needs to be replaced with nav: https://elements.inovex.de/dist/latest/storybook/?path=/story/structure-ino-naw-drawer--default-usage

ino-fab-set: padding is limited to ino-fab only

Describe the bug

Padding is set explicitly to be used for ino-fab children only. If you have to use e.g. anchor-wrapper padding is not set.

To Reproduce

Steps to reproduce the behavior:

  1. Use ino-fab-set with wrapping anchor element
  2. See that no space is granted

Expected behavior

The CSS Rule should be more generic to match generic children

Screenshots

grafik

ino-chip: properties have no effect on the appearance of the component in Angular

Describe the bug

The ino-chip component comes with a set of properties that can be used to alter the appearance of the component. However, it appears that the properties are not working as intended in Angular projects. More specifically, I tried to set inoFill to outline and inoColorScheme to primary, but the appearance of the chip stays the same. Incorporating the component into a ino-chip-set has no effect.

To Reproduce

Steps to reproduce the behavior:

  1. Setup a simple angular project (ng new test)
  2. Add "@inovex.de/elements-angular": "^2.0.0" to the package.json file
  3. Run npm i
  4. Add InoElementsModule.forRoot() to the imports array in the app.module.ts file
  5. Replace the sample template in the app.component.html file with the ino-chip component
  6. Set inoFill to outline and inoColorScheme to primary
  7. Run npm start
  8. Navigate to localhost:4200 and observe the error. Setting the properties did not change the appearance.

Expected behavior

The properties should affect the appearance of the ino-chip component.

Screenshots

Screenshot 2020-11-03 at 15 09 24

Screenshot 2020-11-03 at 15 12 33

Your Environment

Software Version
@inovex.de/elements 2.0.0 (bug is also present in v1.2.0)
Browser Safari
Operating System Mac OS
 Angular Version 10

Rewrite and clean-up Sass Files

At the moment it looks like there are some inconsistencies in the sass definition files.

Possible Solution

  • Use Modul (@use) everywhere.

  • Delete styles/variables.scss since these are currently only z-index (of which 2 are not used). Also remove it from the stencil.config.ts since it does not make sense to make these as global styles.

  • Rethink the structure of the entire styles folder in terms of sass modules. Wouldn't it be better to have sth like @use core/fonts as imports

  • Make a decision either for relative path imports or not.

  • Double-check if the mdc integration is still up-to-date (it seems that in recent versions the imports have changed).

New component: ino-carousel

Is your feature request related to a problem? Please describe.

We would like to add a new carousel component to the library. A carousel can be used to display an array of images as a slide show.

Describe the solution you'd like

The Quasar carousel component can be used as a blueprint.

Acceptance criteria:

  • The component is called ino-carousel
  • It offers two arrow buttons that can be used to switch the slides back and forth
  • Slides can be added using the ino-carousel-slide component
  • The slide transition is animated
  • The arrow buttons can be hidden
  • It features an autoplay property to switch the slides automatically if enabled
  • The slide transition time can be customized
  • The component offers an ino-infinite property to playback the slides in an indefinite loop

Activate Shadow-DOM for isolated components

Is your feature request related to a problem? Please describe.

As our components have straightforward class names, an issue could arise where the class names of the elements and the consumer may conflict.

Describe the solution you'd like

The Shadow DOM API allows encapsulating the DOM and the styles of a component. This means that we don't have to worry about the correct scoping of our CSS, nor about our internal DOM being disturbed by anything outside our component. Stencil provides the ability to enable the Shadow DOM for our components. Therefore we should use the Shadow DOM for our non-structured components that function on themselves and do not rely on any slotted elements (e.g. `, , ...).

Additional context

We've already begun to change our components to the shadow DOM but at that time we encountered some problems which lead to the decision to skip this feature for now. Read about it in this ADR.

Example images in ino-image-list won't load

Describe the bug

The images in the story of ino-image-list won't load.

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://elements.inovex.de/dist/latest/storybook/?path=/story/graphic-ino-img-list--default-usage
  2. Scroll down to Customizable Image List

Expected behavior

The images in the image list should be loaded and displayed properly.

Screenshots

image
image

Your Environment

Software Version
@inovex/elements 0.21.0
Browser Chrome
Operating System Mac OS

Possible Solution

The example images are probably not packed correctly.

No mdc customization possible

The https://github.com/inovex/elements/blob/master/packages/elements/src/components/styles/mdc.customize.scss contains variables to overwrite MDC variables like f.e. the base typography.

As a matter of fact, however, the mdc.customize is not used at all. If I think about its behavior correctly, it should be imported into every component before importing any material scss components.

Expected behavior

The font for every mdc component can be changed in the mdc.customize.scss file

Possible Solution

  1. Add the import to the beginning of every component.scss file.
  2. Rename mdc.customize.scss to mdc-customize.scss
  3. Change the content to sass module, f.e.
// Simple module to override sass variables of mdc
// Manly used for theming and typography.

@use 'colors';
@use 'fonts';

// @material/theme
@use "@material/theme" with (
  $primary: colors.$primary,
  $secondary: colors.$primary-contrast,
  $on-primary: colors.$secondary,
  $on-secondary: colors.$secondary-contrast,
);

// @material/typography
@use "@material/typography" with (
  $font-family: fonts.$font-family-sans-serif
);

see https://github.com/material-components/material-components-web/tree/master/packages/mdc-typography#typography-styles

ino-list: Cannot read property 'destroy of undefined

Describe the bug

The error occurs if disconnectedCallback is called before componentDidLoad was triggered. This happened in React preventing on unmounting the `ino-list´ component before it was rendered.

Expected behavior

If no MDCList instance was initialized it should't be destroyed

Screenshots

grafik

Angular example project not working in Codesandbox

Describe the bug

We use Codesandbox to have a live environment to test the inovex-elements in each framework. The sandbox of the elements-angular package does not work. This is related to the following issue on Codesandbox: codesandbox/codesandbox-client#2634. If this issue is fixed, we should

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/github/inovex/elements-example-angular
  2. Wait for dependencies to be installed
  3. See error

Expected behavior

The codesandbox to compile successfully.

Screenshots

If applicable, add screenshots to help explain your problem.
image

Your Environment

Software Version
@inovex.de/elements 1.1.0

Possible Solution

Wait for the issue above to be resolved and apply fixes if necessary.

Remove constants.ts in ino-button and ino-segment-button

Currently, the ino-button and ino-segment-button have css classes defined in separate constant.ts files. This was an approach to provide more clarity within the component files.

However, in my opinion, this leads to less transparency. Further, all components should handle constants in the same way, i.e. either all css classes in constant files or none.

Possible solution

Delete constant.ts in the respective components and move the css classes to the components again.

Add color schemes to ino-snackbar

Describe the solution you'd like

The user should be able to change the overall color scheme of the ino-snackbar component. Hence, I would like to add a new inoColorScheme property - just like in the ino-button component - which can be set to either of the following color schemes: primary, secondary, warning, error

elements-angular: Cannot find InoElementsModule

Describe the bug

Cannot find InoElementsModule in @inovex.de/elements-angular/. Before the release of version 1.0.0, it was possible to import the Elements Module with import { InoElementsModule } from '@inovex.de/elements-angular';. With the current version, you have to import it with @inovex.de/elements-angular/src/ino-elements.module which leads to other typescript errors.

To Reproduce

Steps to reproduce the behavior:

  1. Clone the elements-example-angular project
  2. Update the inovex elements dependency to @inovex.de/elements-angluar with version being 1.0.0
  3. Change the appearances of @inovex... to @inovex.de....
  4. ng serve
  5. See compile error

Expected behavior

Should compile without any problems.

Your Environment

Software Version
@inovex.de/elements 1.0.0

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.