Code Monkey home page Code Monkey logo

liquid's Introduction

Liquid

Join us on GitHub discussions Join us on Teams semantic-release browser-support Coverage Status Open in GitHub Codespaces

Liquid is a UI component library based on the Liquid Design System, focusing on accessibility and interoperability. It is built with Stencil.js and contains, inter alia, CSS Components and Web Components, bundled in several bundle formats, which you can use in a wide veriaty of plattforms and projects.

Links

Contributing

If you'd like to contribute to the project, please read our code of conduct. Then proceed to the contributing docs.

License

Liquid Oxygen is available under a custom license which restricts its usage to applications created for or by Merck KGaA, Darmstadt, Germany as well as its vendors.

liquid's People

Contributors

borisdiakur avatar dependabot[bot] avatar renet avatar semantic-release-bot avatar tabanion avatar toastedtoast 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

Watchers

 avatar  avatar  avatar  avatar  avatar

liquid's Issues

setAssetPath has no effect when using React bindings.

Bug description

We tried to use setAssetPath in this sandbox app, but to no avail. Currently our workaround here is to configure webpack, so that it copies all assets to the public/assets/ folder, served under /assets/, where the stencil components look for them by default. However, this only works for components used on the base path (/) of the application. If we navigate to a different path, the assets are fetched relatively to that path and we end up 404s.
We tried to use import { setAssetPath } from 'our-lib/dist/components' and use the function to change the default behaviour, but it didn't seem to have any effect.

Steps to reproduce the behavior

  1. Clone https://github.com/emdgroup-liquid/liquid-sandbox-next-tailwind
  2. Try to use setAssetPath

Expected behavior

setAssetPath sets the path to the desired assets folder.

Actual behavior

setAssetPath (if imported from '@emdgroup-liquid/liquid/dist/components') has no effect.

Additional context

This is an upstream issue for ionic-team/stencil-ds-output-targets#186 in the stencil-ds-output-targets project.

cloneAttributes: Wildcard Props forwarding to internal elements

Bug description

Component props being forwarded using the cloneAttributes helper function do not update, if these props are changed in a later component lifecycle, but only if these props are not explicitly defined in the component using the Prop() decorator.

Steps to reproduce the behavior

  1. Go to the ld-button docs
  2. Open the developer tools and search for an ld-button component
  3. Add a type="button" prop to that component.
  4. The inner button element does not update.
  5. Add a disabled prop to the ld-button component.
  6. The inner button element updates, as disabled is explicitly defined as a prop of ld-button.

Expected behavior

No matter what manipulations of props happen on any ld-* web component, the props get updated on the internally used HTML element, as well (if wildcard props forwarding is implemented for that specific component).

Actual behavior

Only changes on explicitly defined props trigger a rerendering of the component's shadow DOM.

Additional context

Browser used: Google Chrome version 91.0.4472.77

ld-select not opening up on mobile safari

Describe the bug
ld-select not opening up on mobile safari (the real one; in the Simulator everything works fine) when inside ld-label in production.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://emdgroup-liquid.github.io/liquid/components/ld-select/
  2. Click on the select component

Expected behavior
The select popper opens up.

Actual behavior
The popper is not visible.

Reproducable on:

  • OS: iOS
  • Browser: mobile safari
  • Version: current

Additional context

  • I have the suspicion that ld-label might be the cause of the problem as only selects which are contained by an ld-label component are not working as expected.
  • I also noticed that this is only happening on the docs page while the ld-select components used in our sandbox apps work fine even in combination with an ld-label (for instance here https://g5w7w.sse.codesandbox.io). This indicates that it might be something other than the label. Maybe it has something to do with the overall height / content size of the page?

Removing/replacing nodes as direct children of a Web Component

If a component is to be removed (or replaced, e.g. re-rendered because of a change in its "key"-prop) that is a direct child of a Web Component, React produces a DOMException, stating: "Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node."

This may be connected to (deeply nested?) slots inside the Stencil component.

Themeable notifications

Is your feature request related to a problem? Please describe.
Notifications of the type info are always rich blue regardless the theme while I was expecting that these should be themeable.

Describe the solution you'd like
The info notification should adapt to the current theme while warning and alert should stay yellow and red.

Describe alternatives you've considered
Alternatively a notification could accept a color property to create full flexibility but this could cause undesired design results.

Loading button overflows

Describe the bug
The loading indicator on the loading buttons overflows the parent. This is visible because the rounded corners become rectangular.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://emdgroup-liquid.github.io/liquid/components/ld-button/

Expected behavior
Button remains rounded while loading

Screenshots
image

Desktop (please complete the following information):

  • OS: MacOS Big Sur
  • Browser: Safari
  • Version 14.1.22

Ghost Button on Brand Color

Is your feature request related to a problem? Please describe.
In some cases I need a Button on Brand color which does not show a white border as the Secondary on Brand Button mode.

Describe the solution you'd like
Add a new button mode for ghost-on-brand-color which does not show a border.

Form onSubmit

Bug description
When using LD Input and Button components, the onSubmit method is not triggered when pressing the enter key from Input.

Steps to reproduce the behavior
Go to: https://codesandbox.io/s/liquid-oxygen-form-onsubmit-9cpf2
Focus on the First name/ Last name input field in LIQUID OXYGEN FORM.
Hit enter.

Expected behavior
The form should be submitted & the onSubmit method should be triggred.
The Expected behavior example is added in the codesandbox.

Actual behavior
The onSubmit method is not triggered.

ld-input: does not integrate as well as native input elements

Bug description

When integrating the ld-input component with the form validation library react-hook-form, it gets clear that it does not behave the same way as a native input element does.

For example, the form state does not properly update on blur or while the user is typing, if only the register function of react-hook-form is used.

Another example is that the first "invalid" input automatically gets focus when the form is submitted - which works for native inputs, but not ld-input.

I assume that this points to the ld-input component not properly emitting onInput/onChange/onBlur/etc events.

Expected behavior

The ld-input integrates with form validation libraries just as good as native input elements do.

Actual behavior

Integration works partly, but not as seamless as it could. Not all events seem to be emitted properly (or forwarded properly from the component's internal native input element).

Additional context

The issues can be reproduced when removing the custom onInput and onBlur handlers in this sandbox.

Update README.md to contain developer quick-start instructions

Suggestion:

npm install @emdgroup-liquid/liquid
import { defineCustomElements } from '@emdgroup-liquid/liquid'
import '@emdgroup-liquid/liquid/dist/css/liquid.css'

defineCustomElements()

For more details on which bundles are available etc. etc. see...

Cannot toggle disabled state using the LdInput component in react

Bug description
Cannot toggle disabled state using the LdInput component in react.

Steps to reproduce the behavior
Add disabled property to a LdInput component and set to "false"

Expected behavior
Setting LdInput component to "false" should keep the component enabled.

Actual behavior
Once disabled attribute is added there is no way to toggle between disabled and enabled state anymore... or at least not a clean way of doing so.

The automated release is failing 🚨

🚨 The automated release from the main branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this 💪.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


Invalid npm token.

The npm token configured in the NPM_TOKEN environment variable must be a valid token allowing to publish to the registry https://registry.npmjs.org/.

If you are using Two Factor Authentication for your account, set its level to "Authorization only" in your account settings. semantic-release cannot publish with the default "
Authorization and writes" level.

Please make sure to set the NPM_TOKEN environment variable in your CI with the exact value of the npm token.


Good luck with your project ✨

Your semantic-release bot 📦🚀

ld-toggle component needs some fine tuning

aria-disabled: works, but some documentation would be cool , similar to https://emdgroup-liquid.github.io/liquid/components/ld-input/#disabled

mode="large" should be size="lg", so that we stay consistent with other components (see https://emdgroup-liquid.github.io/liquid/components/ld-button/#size for example)

There is a difference at https://emdgroup-liquid.github.io/liquid/components/ld-toggle/#with-label between the Web Component example and the CSS Component example. Please remove the required attribute on the CSS component, so that both examples show the same result. 

Web components: `<ld-button>`, `<ld-checkbox> ` and `<ld-input>` not working since `v1.0.0-rc.10`.

Bug description

Web components like <ld-button>, <ld-checkbox> and <ld-input> not working since v1.0.0-rc.10.

Steps to reproduce the behavior

  1. Create a file named app.ts with the following content
import { defineCustomElements } from '@emdgroup-liquid/liquid'

defineCustomElements()
  1. Install esbuild
  2. Generate the bundle: npx esbuild app.ts --bundle --outfile=app.js
  3. Open an HTML that loads app.js and contains the web components.

Expected behavior

The web components should work.

Actual behavior

They are not even rendered, this error appears in the console when using v1.0.0-rc.10:

DOMException: Failed to execute 'setAttribute' on 'Element': '0' is not a valid attribute name.

And this one when using v1.0.0-rc.20:

DOMException: Failed to execute 'setAttribute' on 'Element': '-e-l-e-m-e-n-t_-n-o-d-e' is not a valid attribute name.

Screenshots

image

Details about device, OS, browser (including versions)

  • Device: Macbook Pro M1 2020
  • OS: macOS Big Sur v11.6
  • Browser: Chrome v96

Additional context

All components work when using v1.0.0-rc.9, but I only manage to make <ld-select> work in the newer versions.

Tailwind color documentation

This might be my own incompetence, but I just spent half an hour trying to find out the names under which liquid defines its theme colours.

Maybe add a section in the https://emdgroup-liquid.github.io/liquid/introduction/tailwindcss-integration/ docs.

Proposal:

Accessing Colours

The Liquid Tailwind presets adds the liquid colour palettes to your tailwind colour configuration.

Accessing the current theme

Your selected theme is available with the thmprefix. This will reference the global css variables (https://emdgroup-liquid.github.io/liquid/global/theming/)

Examples:

/* Primary colour */
.bg-thm-primary 
.bg-thm-primary-hover
.bg-thm-primary-active
.bg-thm-primary-focus
.bg-thm-primary-highlight

/* Secondary colour */
.bg-thm-secondary 

/* Others */

.bg-thm-success
.bg-thm-warning
.bg-thm-error

Accessing other themes

Other themes can be accessed by their name directly:

Example:

.bg-ocean-primary

Accessing liquid colors

Colors can be accessed by their short names:

.bg-rb /* Rich blue */
.bg-rg /* Rich green */
.bg-rp /* Rich purple */
.bg-rr /* Rich red */
.bg-vg /* Vibrant green */
.bg-vc /* Vibrant cyan */
.bg-vy /* Vibrant yellow */
.bg-vm /* Vibrant magenta */
.bg-sg /* Sensitive green */
.bg-sy /* Sensitive yellow */ 
.bg-sb /* Sensitive blue */
.bg-sp /* Sensitive purple */

Cheers!

Pagination

Screenshot 2021-11-22 at 11 16 37

Design: https://www.figma.com/file/JcDMeUwec9e185HfBgT9XE/Liquid-Oxygen?node-id=1084%3A790

Acceptance criteria:

  • 3 modes:
    • horizontal numbers (default)
    • horizontal dots
    • dropdown (with numbers)
  • transition between states
    • active border moves to new selection
    • numbers slide in/out of the visible area (maybe fading in/out)
    • dots expand/collapse as needed (maybe fading in/out)
  • option to always show the first/last page (optional feature)
  • trigger custom change event on click
  • possibility to control state via props
  • non-composable component
  • prop to define a page type label ("Slide", "Page", etc. - default: "Page")

Button is always disabled

Bug description

When passing the disabled prop to the LdButton component (in React) it is always disabled even when passing disabled={false}

Steps to reproduce the behavior

 <LdButton disabled={false}>
Test
</LdButton>

Expected behavior

Disabled false should mean enabled

Actual behavior

Button is disabled

Screenshots

Details about device, OS, browser (including versions)

  • Device: MacBook
  • OS: macOS Monterey 12.1
  • Browser: Safari 15.2
  • Version: "@emdgroup-liquid/liquid": "^1.0.0-rc.2"

Add "Remove" icon with minus

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

Under Icons>Modifiers, there is an "Add" icon with a "+" (plus). However, there is nothing like a "Remove" icon with a "-" (minus). It would be great if such an icon could be added to complement the "Add" icon.

basePath not respected when using ld-icon

Describe the bug

I set up a Nextjs application in accordance with the documentation on the website using setAssetPath() as well as the other recommended settings. Most of the elements are coming nicely, but can't get the icons to work. We're using basePath so the app is served under localhost:<port>/<package-name>, but it still tries to access the icons from localhost:<port>/placeholder.svg (the basePath is omitted). For images, the basePath must be passed as well (e.g src="project1/placeholder.svg"), not sure how/if that'd work with the icons.

To Reproduce
Steps to reproduce the behavior:

  1. Setup a next app according to docs
  2. Set a base path according to https://nextjs.org/docs/api-reference/next.config.js/basepath
  3. Try to render an ld-icon component

Expected behavior
The icon is visible.

Actual behavior

GET http://localhost:3000/assets/placeholder.svg 404 (Not Found)

Sidenav

Screenshot 2021-11-22 at 13 42 44

See https://www.figma.com/file/JcDMeUwec9e185HfBgT9XE/Liquid-Oxygen?node-id=1084%3A907

Depends on #127

Acceptance criteria:

  • It can be attached to the left side and the right side of its container
  • It is positioned fix
  • It is vertically scrollable and shows or hides scroll container boundaries on scroll
  • It indicates visually which nav item is currently active
  • It is accessible (supports keyboard navigation etc.)
  • It allows for an optional fixed slot at the top for arbitrary content (such as a search input field)
  • It allows for an optional fixed slot at the bottom for arbitrary content (such as a user profile section) sticky group headings
  • Allows for arbitrary child elements
  • Can be composed using nav-item, accordion, group heading and separator component, etc.
  • Accordion sections in the sidenav use transitions when opening or closing
  • On larger viewports
    • it is collapsible via click to the side in a way, that labeled nav items are reduced to icon only nav items when collapsed
    • when collapsed it saves the state of the currently selected sub-nav (if applicable) and only shows icon nav-items; if no icon nav-items exist, it collapses to a narrower version with no nav-items visible; icon nav-items move to the top when collapsed
  • On smaller viewports
    • it is hidden initially and can be toggled “from the outside” (i.e. via an event) it stretches to full width of the screen

Updating text content inside a component

Updating a text node as direct child of a web component causes the internal markup of the component to be removed. This may be related to slot handling in Stencil. Other technologies don't cause these problems, though.

Workaround: Add "key"-Attribute to the component that equals to the text node, for react to know when to re-render the whole component.

Input component not triggering onChange.

Bug description
While using React Input component, the onChange method is not triggered.

Steps to reproduce the behavior
Use a React Input component & pass a function to the onChange property. Change the value of the Input component.

Expected behavior
onChange function should be triggered.

Actual behavior
onChange function is not triggered.

Additional context
https://codesandbox.io/s/liquid-oxygen-input-0ikq1

React Bindings: Property 'xy' does not exist on type [...] (TypeScript)

Bug description

When using React Bindings, as soon as I want to add a prop that is not explicitly defined in the component class, a TS error is raised stating, for example:

TypeScript error in /dev/project/src/components/Component/Component.tsx(335,61):
Type '{ children: string; onClick: MouseEventHandler<HTMLLdButtonElement>; mode: "secondary"; type: string; }' is not assignable to type 'IntrinsicAttributes & Pick<LdButton & Omit<HTMLAttributes<HTMLLdButtonElement>, "style"> & StyleReactProps, "title" | ... 260 more ... | "justifyContent"> & RefAttributes<...>'.
  Property 'type' does not exist on type 'IntrinsicAttributes & Pick<LdButton & Omit<HTMLAttributes<HTMLLdButtonElement>, "style"> & StyleReactProps, "title" | ... 260 more ... | "justifyContent"> & RefAttributes<...>'.  TS2322

This happens, even though we allow for unknown properties and forward them to the inner element in many cases.

Expected behavior

A TypeScript definition is used that allows all known props of the element that the props are forwarded to. So for example, if props are forwarded to a button element used inside the ld-button component, I want to be able to pass all browser-supported props of a button element to the ld-button. This works for web components as well as for React components.

Actual behavior

Props need to be explicitly defined via the Prop() decorator in a component in order to pass them to a React component.

Additional context

Using

with TS strict mode, in an app developed using create-react-app and craco.

Controlled Tab component issue.

Bug description
When controlling the Tab component through the selected & onTabSelect properties, the initial rendered content is incorrect.

Steps to reproduce the behavior
https://codesandbox.io/s/liquid-oxygen-tab-e14r2?file=/src/App.tsx

Expected behavior
The selected tab value is "Q1" & therefore "Q1"'s panel content should be displayed.

Actual behavior
The selected tab value is "Q1" but it's showing "Q4"'s panel content. Even if we change the selected tab value to "Q2", it always displays "Q4"'s content on the initial render.

Cannot apply css property `resize` to multiline ld-input

Bug description

I need to prevent the user from resizing the textarea created by ld-input so I set the css to resize: none on ld-input. Unfortunately this css prop is then not reflected in the textarea.

Steps to reproduce the behavior

This is a react example (regarding style) but i think you get the point.

<ld-input placeholder="Tell us your story..." multiline style={{ resize: 'none' }}></ld-input>

Expected behavior

The textarea should inherit the css property for resizing.

Actual behavior

The resize behavior cannot be changed

Details about device, OS, browser (including versions)

  • Device: Macbook
  • OS: Mac OS
  • Browser: Chrome / Safari
  • Version: x

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.