GithubHelp home page GithubHelp logo

qiskit / web-components Goto Github PK

View Code? Open in Web Editor NEW
21.0 12.0 13.0 20.74 MB

Qiskit Web Components

Home Page: https://qiskit.github.io/web-components/

License: MIT License

JavaScript 2.61% TypeScript 90.14% SCSS 7.25%
typescript web-components lit lit-html lit-element

web-components's Introduction

Important

This repository is unmaintained and the content in qiskit.org has been superseded by the IBM Quantum | Community page. These source files are no longer maintained and may contain omissions or outdated information. Contributions to this repo are no longer accepted.

Qiskit Components

Qiskit Components is a future-looking project to develop Qiskit design system based around Web Components, ES Modules, and modern browser standards.

Usage

Prerequisites

Install

npm install @qiskit/web-components

Example

import '@qiskit/web-components/banner';
<qiskit-banner>We have an important announcement!</qiskit-banner>

Contributing

Prerequisites

Furthermore, this project is built on TypeScript with the intention of improving the developer experience.

Install the dependencies

npm install

Start the development server (with Storybook)

This command serves the app at http://localhost:8000:

npm start

Running the tests

This command runs the tests:

npm test

web-components's People

Contributors

1ucian0 avatar abdonrd avatar alexao8 avatar dependabot[bot] avatar eddybrando avatar eric-arellano avatar frankharkins avatar gaya3-mv avatar github-actions[bot] avatar huangjunye avatar korgan00 avatar mariacloehb avatar memolina2323 avatar mentesniker avatar tansito avatar techtolentino avatar y4izus avatar yoshiemuranaka avatar

Stargazers

 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

web-components's Issues

Bug: Overview link in documentation dropdown doesn't direct to overview

Steps to reproduce the problem

  1. go to qiskit.org
  2. click on documentation in the top menu
  3. when the documentation menu expands, go to the left, click the "overview" link under getting started
  4. this link directs users to the "getting started" page rather than the overview page

What is the current behavior?

the overview link directs users to the getting started page in the qiskit documentation

What is the expected behavior?

the overview link should go to the the overview page of the qiskit documentation (https://qiskit.org/documentation/index.html)

I think it would also be good if we could add a heading in that section specifically directing users to the getting started page

Screenshots

No response

Device

No response

OS

No response

Browser

No response

Additional information

No response

Replace Aer provider link in top menu

When Qiskit Aer v0.12 is released it will start building and deploying it's own documentation, meaning we should update the top menu link to reflect this change (currently it points to the metapackage aer docs)

[UI-Shell] axe landmark-contentinfo-is-top-level failure

Steps to reproduce the problem

In platypus ui-shell integration PR, remove disabled rule and run npm run test and see failures.

Rule link

Changing the sidenav social icon <footer> to a regular <div> will resolve the problem

1 accessibility violation was detected
{
  id: 'landmark-contentinfo-is-top-level',
  impact: 'moderate',
  tags: [ 'cat.semantics', 'best-practice' ],
  description: 'Ensures the contentinfo landmark is at top level',
  help: 'Contentinfo landmark should not be contained in another landmark',
  helpUrl: 'https://dequeuniversity.com/rules/axe/4.4/landmark-contentinfo-is-top-level?application=axeAPI',
  nodes: [
    {
      any: [Array],
      all: [],
      none: [],
      impact: 'moderate',
      html: '<footer class="qiskit-side-nav-footer">',
      target: [Array],
      failureSummary: 'Fix any of the following:\n' +
        '  The null landmark is contained in another landmark.'
    }
  ]
}
┌─────────┬─────────────────────────────────────┬────────────┬────────────────────────────────────────────────────┬───────┐
 (index)                  id                     impact                       description                      nodes 
├─────────┼─────────────────────────────────────┼────────────┼────────────────────────────────────────────────────┼───────┤
    0     'landmark-contentinfo-is-top-level'  'moderate'  'Ensures the contentinfo landmark is at top level'    1   
└─────────┴─────────────────────────────────────┴────────────┴────────────────────────────────────────────────────┴───────┘
    1) has no detectable violations on load


  0 passing (9s)
  1 failing

  1) Accessibility
       has no detectable violations on load:
     AssertionError: 1 accessibility violation was detected: expected 1 to equal 0
      at Context.eval (http://localhost:8080/__cypress/tests?p=cypress/support/index.js:797:20)

What is the current behavior?

Running platypus cypress tests fails accessibility spec with new ui-header component

What is the expected behavior?

The existing a11y tests should pass

Screenshots

Accessibility -- has no detectable violations on load (failed)

Device

No response

OS

No response

Browser

No response

Additional information

Changing the sidenav social icon <footer> to a regular <div> will resolve the problem

Contributing.MD file missing

Feature description

I noticed that CONTRIBUTING.md file is missing in this repo.

I think this is the main reason why their aren't much contributors here.

And this is quite a great project.

Adding this file would attract first timers and would push the contribution to a greater length.

This is just suggestion, please what do you think?

Additional context

No response

[Navbar] "Get started" should be "Getting Started"

Steps to reproduce the problem

  1. Go to https://qiskit.org/
  2. Click "Documentation" dropdown menu

image

What is the current behavior?

"Get started"

What is the expected behavior?

"Getting Started" to matched with the linked page: https://qiskit.org/documentation/getting_started.html

"S" should be capitalized to match the style of "Help and Learning"

image

Screenshots

No response

Device

No response

OS

No response

Browser

No response

Additional information

No response

[Navbar] Should the Slack link be the invitation link on mega dropdown menu?

Steps to reproduce the problem

  1. Go to https://qiskit.org/
  2. Click "Documentation" dropdown menu
  3. Check the link for "Slack"

What is the current behavior?

The current link is https://qiskit.slack.com/

What is the expected behavior?

We have been using https://ibm.co/joinqiskitslack (which is a bit.ly link for the Slack invitation) for the link to Slack so that new users can also join. The current link https://qiskit.slack.com/ only works for users that already joined Slack.

But I know there is also discussions about reducing the number of users to our Slack so this link https://qiskit.slack.com/ could be a better link.

cc: @lerongil @1ucian0

Screenshots

No response

Device

No response

OS

No response

Browser

No response

Additional information

No response

Implement Segment tracking events in Navbar links

Feature description

After implementing the Documentation Dropdown in the Navbar web component, we need to also ensure that all links send the appropriate Segment tracking events when clicked.

For this, we need to consider that now we'll be able to have one unified navbar / header for all Qiskit websites.

Dependencies

This task depends on:

Additional context

  • We need to work closely with @agebbie to provide the data in the most useful format possible.
  • We need to coordinate with @korgan00 to have a consistent approach to triggering tracking events here and in the widgets.

[UI Shell] Make base url for nav items dynamic

Feature description

The current implementation of the ui-shell (navbar) uses absolute URLs for each navigation item. We would like to explore an alternative approach that would allow us to stay in context of the current environment. For example, when testing a branch preview, clicking the account icon would maintain the base preview URL instead of navigating to the live prod build.

Related comment Qiskit/platypus#1555 (review)

After internal discussions, we would like to try something to the logic below 👇

const BASE_URL = window.origin === 'https://learn.qiskit.org/'
    ? 'https://qiskit.org/'
    : window.origin;

Additional context

The decision to use the absolute URL was to avoid any issues specifically when users are in the textbook/platypus experience since the textbook pages have the learn. subdomain.

Also should consider how these changes may affect documentation platform

Slack discussion

Add "Ecosystem" link

Feature description

We need to add the "Ecosystem" link in the "Community" dropdown, pointing to https://qiskit.org/ecosystem/.

Alternatives

No response

Additional context

After creating the new "ecosystem" page, the link was added to the header. We need to update the web component accordingly.

Create a Card component

Feature description

To accommodate for the Curated Syllabi designs, we'll be needing a consistent Card component that will be used across multiple projects — qiskit org, platypus (for now), and later on saiba.

Acceptance criteria

  • Card should have a body that allows for content
  • Card should have option for single action (button)
  • Card should have option for a set of actions

Screen Shot 2022-09-15 at 6 27 58 AM

Screen Shot 2022-09-15 at 6 28 33 AM

Additional context

No response

Improve README with instructions for projects other than node based ones

Feature description

It would be great if the README had instructions for how to use these components in other environments other than npm based projects.

Additional context

For example I am trying to implement the main top menu bar in a basic html file and not sure how to proceed 😅

[Navigation UI] User Account text not showing up

Steps to reproduce the problem

Resize the NavBar component until the navBar is collapsed. Then open the menu with the hamburguer button.

What is the current behavior?

The text of the user account button is not displayed. Also the colors of the user icon and backgorund color are inverted (the first must be purple the second must be white).

What is the expected behavior?

It should say "Account" and the colors should be inverted.

Screenshots

image

Device

No response

OS

No response

Browser

Chrome

Additional information

No response

Create footer web component

We need to recreate the footer currently available in qiskit.org as a web component to reuse it in multiple projects.

Screenshot 2022-05-16 at 17 12 41

Change the link of `Qiskit IBM Provider` to the new `qiskit-ibm-provider` doc

Feature description

Currently Qiskit IBM Provider in the mega dropdown menu is linked to the old qiskit-ibmq-provider doc (part of the qiskit meta doc). The old provider is going to be deprecated and replaced by the new qiskit-ibm-provider soon. With that, I think we should replace the link in the mega dropdown menu to the new provider doc: https://qiskit.org/documentation/partners/qiskit_ibm_provider/

FYI @1ucian0 @kt474 @jyu00

Additional context

No response

[Navbar UI] Transparent background

Steps to reproduce the problem

  1. visit any saiba page that has enough content to warrant a vertical scroll
  2. see error

What is the current behavior?

the main site nav has a transparent background, allowing content to be visible through the nav

What is the expected behavior?

the main site nav should have a defined background-color

Additional information

Originally reported by @techtolentino in https://github.com/Qiskit/saiba/issues/120

Screenshots

Screen.Recording.2022-08-24.at.1.01.26.PM.mov

Device

No response

OS

No response

Browser

No response

Additional information

No response

Textbook Versioning

Feature description

This feature gives the user the ability to change to a different version of the textbook, as well as view the change log to understand what has changed on the textbook. The designs are complete.

areas of change include:

  • learn page versioning next to the "browse all content". this will scroll next to the "browse all content" down the page
  • versioning will be available on the individual textbook pages on the left next to the "browse all content"

https://www.figma.com/file/s94cmNVUcbFnTEbasdPNgN/1476-textbook-content-versioning?node-id=209%3A3177&t=rmG6WTM4svKq33JW-1

Additional context

No response

Bug: Typo for "Qiskit Textbook" in mega dropdown menu

Steps to reproduce the problem

  1. Go to https://qiskit.org/
  2. Click "Documentation" drop down menu
  3. See "Qiskit textboox"

What is the current behavior?

"Qiskit Textbook" is spelled "Qiskit textboox"

image

What is the expected behavior?

The correct spelling should be "Qiskit Textbook" and "T" should be capitalized to follow the style of other links listed in the dropdown menu.

Screenshots

No response

Device

No response

OS

No response

Browser

No response

Additional information

No response

Add "Documentation" dropdown to Navbar

Feature description

We need to update the main navigation bar (aka Navbar) to replace the current "Documentation" link with a "Documentation" dropdown that shows various links to documentation pages.

We could try and use the "Masthead" Carbon for IBM.com component if possible, or maybe at least take some inspiration from its implementation.

Dependencies

This issue depends on:

Ressources

Design capture

Screenshot 2022-08-24 at 10 51 30

Additional context

Mega dropdown menu navigation

Feature description

#140 added an awesome dropdown menu for documentation. It's great to have this unified top menu with additional links. However, after trying it a bit, I realized the user experience of getting to the documentation homepage is actually worse.

Previously users can go to the documentation homepage with one click on the "Documentation" menu item. Now they need to click on it, move the cursor all the way across the screen and click "Overview" under "Get started". That's two clicks and a lot of mouse movement.

qiskit doc dropdown menu navigation

Suggestion

Would it be possible to split the action for the linked text and the dropdown arrow for "Documentation" on the top menu? That means when a user clicks on the text "Documentation", they will go to documentation homepage https://qiskit.org/documentation/ just like in the past, but when they click on the arrow "^" it opens the dropdown menu.

This possibly violate some web design principles. I mainly want to bring up this issue, and hope we can find a good solution :D

Additional context

No response

Update link to Aer documentation homepage after Aer 0.11 release

Feature description

Following up from #140 (comment), since #140 is already merged. Creating this issue to keep track.

With Aer 0.11 release (coming soon), aer documentation will have it's own page. Depending on when this PR is merged, we should change the link to https://qiskit.org/documentation/aer

label: 'Qiskit Aer',
url: 'https://qiskit.org/documentation/apidoc/aer.html',
},

Additional context

No response

Fix node engine warning

When you use the library in a project that is not using Node v16 we have this warning:

npm WARN notsup Unsupported engine for @qiskit/[email protected]: wanted: {"node":"16.x"} (current: {"node":"14.17.5","npm":"6.14.15"})
npm WARN notsup Not compatible with your version of node/npm: @qiskit/[email protected]

We should fix this with a more open engine range or removing it.

Support content changes in Mega Menu

With the new Learn content being available on Qiskit.org's site, we'll need to update the MegaMenu dropdown to handle the new content structure.

Designs shown here

  • MegaMenu should have section titles
  • MegaMenu should not have hard-coded menu links

Have a general "support channels" instead of QCSE direct link

In many places in qiskit.org and other IBM products, we are sending users to http://quantumcomputing.stackexchange.com/ when they have general questions. However, the QCSE forum is designed to focus on a very specific list of topics and many of the questions that users (specially newcomers) make there end up being closed as off-topic.

I think we should give more context on the kind of question that should go to QCSE and present alternatives to users on how to get support (such as documentation site or slack).

At the moment, the closest we have to such a general support channel index is https://qisk.it/support. I suggest to change the footer to replace Stack Exchange for Support channels linking to https://qisk.it/support.
Screenshot 2023-03-08 at 11 39 58

Ditto, the top bar.
Screenshot 2023-03-08 at 11 40 08

This issue was thought in collaboration with @Eric-Arellano and it is part of this user-story.

For more context, see:

[UI-Shell] Tab navigation of Navbar includes hidden elements

Steps to reproduce the problem

  1. Open the Navbar on a desktop-sized viewport
  2. Use the tab to navigate thought the Navbar links and see the target links
  3. Move to the next element after "Documentation" with the tab key
  4. See how hidden links from the mobile menu are being selected (like overview)

What is the current behavior?

Hidden links are accessible via tab.

What is the expected behavior?

Hidden links (like the links from the mobile menu when on a desktop-sized viewport) should not be accessible via tabs.

Screenshots

In this screen recording, I change the link to the overview page that should only be accessible in the mobile menu.

Then I use tabs to navigate the Navbar.

Please watch the target links at the bottom of the window when I select a new link from the Navbar, and see how after I select Dropdown, the overview link from the mobile menu is selected, even thought the mobile menu should be invisible / inaccessible in this viewport.

Screen.Recording.2022-09-15.at.13.44.53.mov

Device

MacBook Pro

OS

MacOS

Browser

Chrome

Additional information

No response

Bug: `MegaMenuDropdown` background-color on small viewports

Steps to reproduce the problem

View the qiskit-mega-menu-dropdown on small viewports

What is the current behavior?

The input field bg color is transparent

What is the expected behavior?

It should be allowed to be overridden so that a consuming project can set it to white (use case needed for qiskit.org)

Screenshots

IMG_41B64CA3DF47-1

RPReplay_Final1654554800.MP4

Bug: image not showing in `MegaMenuDropdown`

Steps to reproduce the problem

  • Visit the MegaMenuDropdown in the storybook
  • type in the word test (or any string that won't exist in the results)

What is the current behavior?

The image is not found

What is the expected behavior?

There should be an image showing

Screenshots

Screen Shot 2022-06-01 at 7 37 04 AM

(Same happens when implemented in Qiskit project)
Screen Shot 2022-06-01 at 7 35 37 AM

Device

No response

OS

No response

Browser

No response

Additional information

No response

Hamburguer button doesn't work

The hamburguer button of the navBar component doesn't do anything on click.
How to reproduce?

  • Enter the NavBar component from your browser
  • Resize the screen until the navBar collapses like in the following image:
    image
  • Click on the hamburguer button.

Bug: Duplicate entries for qiskit textbook / qiskit.org/learn

Steps to reproduce the problem

Go to https://qiskit.org/ and click on "Documentation" to open the mega drop down menu

What is the current behavior?

image

There is already "Learn" in the top level item of the top menu. We don't need to have another entry of "Qiskit Textbook" in the drop down menu under "Help and Learning". I am not sure whether this was a conscious decision in #140

What is the expected behavior?

  1. Remove "Qiskit Textbook" from "Help and Learning" column.
  2. Rename "Help and Learning" column to "Get Help".

Screenshots

No response

Device

No response

OS

No response

Browser

No response

Additional information

No response

Multiple "Overview" buttons on top menu causes confusion for documentation users

In the qiskit.org top menu there are 2 instances of the word "Overview". One at the top level and one inside the documentation dropdown. This was recently raised by a Qiskit maintainer as confusing for documentation users because when users go to the documentation page there is an overview page and it isn't clear that the top menu "Overview" redirects back to the qiskit.org homepage instead of the documentation overview page. I suggest renaming the top level "Overview" to "Home" as a way to prevent this confusion.

topmenu

As a Qiskit Developer, I need the UI shell component available via a custom CDN so that I can integrate it into my HTML project

Background:

The unified top menu has been released on all the pages within Qiskit.org other than the documentation, the below will address the final blocker we have preventing this from getting released to the documentation pages.

Acceptance Criteria:

  1. Need to set up a CDN in IBM cloud -> link to tutorial
  2. Need to make UI shell component available via the CDN
  3. Set up automatic deployment when to the CDN when changes are made in the web components (so that users of the component via the CDN can get the latest versions)
  4. Document to users how to use the component via the CDN

Related open issues:

Additional context

We are unable to use the existing third party CDN because it is incompatible with certain dependencies in the carbon component, this is a blocker for this open issue: Qiskit/qiskit_sphinx_theme#64

In order to have the unified navbar on the documentation page, this blocker needs to be addressed. Additionally, if we want to be able to use web components within the docs in the future, we will need components available via the CDN.

cc @javabster @abdonrd

`MegaMenuDropdown` styling

Steps to reproduce the problem

  1. view the web component implementation in the Storybook or in this Qiskit.org branch preview
  2. notice the different sizes, compared to that of the current qiskit.org/textbook-beta megaMenuDropdown component

What is the current behavior?

The behavior is fine, but the styling is incorrect.

  • the new web component has more height
  • the new web component has too little left and right padding

What is the expected behavior?

According to our design team, the new web component should preserve the styles from the currently implemented megaMenuDropdown on qiskit.org/textbook-beta

Screenshots

MegaMenuDropdown in header
Screen Shot 2022-05-31 at 12 23 50 PM (2)


MegaMenuDropdown in nav
Screen Shot 2022-05-31 at 12 24 04 PM (2)

Find new approach to handle releases

Feature description

Currently, we're using the changesets workflow to help w/ our releases. This made sense when we were aiming to build a monorepo; however, since we're no longer going for a multi-package repo, we should switch to a different approach.

Also, there's something broken about the current way in which we're handling version releases; and this bug in our process has been requiring someone w/ admin privileges, to have to manually Squash and merge PRs.

__
Here are a few automated release packages that we can look into:

Additional context

No response

simple question

this project is only for qiskit- related web content, and not visual/interactive components for the qiskit itself, correct?

[UI Shell] - need to differentiate Overview CTA from Documentation > Overview CTA

Steps to reproduce the problem

On qiskit.org make sure to have the segment extension. First click the top navigation Overview link. Then click Documentation and click Overview from the dropdown. See in segment that both events have the same CTA

What is the current behavior?

Currently, we have the segment click event CTA value as the navbar link label. This is an issue specifically for the Overview in the top-level nav and the Documentation > Overview in the documentation dropdown

What is the expected behavior?

Should be able to differentiate different each link clicked in ui-shell

Screenshots

Screen Shot 2022-09-19 at 10 14 50 AM

Device

No response

OS

No response

Browser

No response

Additional information

Consider adding parent menu label as prefix for all nested links

The build step is not working as expected

Whith this PR we start to export an experimental bundled version of the UI Shell component:

But as we run the tsc command two times:

"prepack": "npm run build && npm run build:ui-shell-bundle",

"build": "tsc && rollup --config rollup.config.js",
"build:ui-shell-bundle": "tsc && rollup --config rollup-ui-shell-bundle.config.js",

We override the first build and break the components:

Note that the v0.10.1 has the import styles from './index.scss' instead of the CSS.

[UI-Shell] update navigation items

Feature description

Main menu updates:

  • The link to the Providers page will be near the Documentation link, on the right side
  • The links to Providers and Core will be removed from the Documentation drop-down menu. Not yet

Additional context

Here we need to decide if the block will continue having the size of the screen or if we want that block to adjust to the content on the submenu. Update: We don't need to remove the providers and core section from the menu, so the size will remain the same

Note: possibly related is this issue from @HuangJunye, regarding the width and usability of the UI Shell Documentation dropdown

Create a pull request template

This is a follow-up on Qiskit/qiskit.org#2456.

As part of our attempt to improve the health of our code review process, we can create a pull request template to try and:

  • warranty that the pull request author will check certain code quality criteria,
  • provide the code reviewer(s) with helpful information for the review, and
  • better document changes for the future, when looking back trying to understand something.

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.