Giter Club home page Giter Club logo

core-components's Introduction

@nrk/core-components

Arkivert

NRK har stoppet aktiv forvaltning og videreutvikling av Core-components. Eventuelle issues og pull-requests vil ikke bli besvart.

Vi anbefaler å undersøke om for eksempel u-elements kan benyttes som erstatning.

Archived

NRK is no longer actively maintaining and developing Core-components. New issues or pull-requests will not be considered.

We recommend looking into u-elements as a possible replacement.


Playwright Tests

A kit of lightweight, unstyled and accessible Javascript and React / Preact components. It provides effortless and flexible usage, while under the hood enhancing markup and functionality for best best user experience across all major browsers and screen readers.

Documentation

https://static.nrk.no/core-components/latest/

Local development

First clone @nrk/core-components and install its dependencies:

git clone [email protected]:nrkno/core-components.git
cd core-components
npm install # Installs dependencies for all packages
npm start # Your browser will open documentation with hot reloading

Testing with Playwright

Tests in this project are written using Playwright and are executed against major browser engines including Chromium, WebKit, and Firefox.

Local Testing

To run tests from the command line, use the following npm command:

npm run test

You can enhance your testing experience in VSCode by using the Playwright Test for VSCode plugin.

Testing in GitHub Actions

The GitHub Actions workflow has been configured to automatically execute Playwright tests in response to changes being pushed to the master branch, as well as when code is pushed upstream to pull requests.

Additionally, it generates test reports and summaries, which are made available as artifacts for the purpose of reviewing and analyzing the test results. Artifacts have a retention period of 30 days.

Building and committing

After having applied changes, remember to build before pushing the changes upstream.

git checkout -b feature/my-changes
# update the source code
npm run build
git commit -am "<prefix>: Add my changes"
git push --set-upstream origin feature/my-changes
# then make PR to the master branch,
# and assign a developer to review your code

Publishing

npm run publish:minor -- --core-input --core-toggle # Specify packages to publish

NOTE! Please also make sure to keep commits small and clean (that the commit message actually refers to the updated files). Stylistically, make sure the commit message is Capitalized and starts with a verb in the present tense (for example Add minification support).

core-components's People

Contributors

aril-spetalen avatar dependabot-preview[bot] avatar dependabot[bot] avatar eirikbacker avatar htor avatar ingvilddev avatar klizter avatar laat avatar markusv avatar mia-aasbakken avatar renovate-bot avatar renovate[bot] avatar saegrov avatar simenbrekken avatar sindrebilden avatar skjalgepalg avatar tmarty avatar toggu avatar tolu avatar wwalmnes 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

core-components's Issues

core-scroll enhancements

instantly trigger onChange on startup to ensure correct state is set in JSX
Also potentially make first element child the scrollable area?
scrollbars
resize-event
friction prop

core-toggle.jsx sets hidden on all siblings

core-toggle.jsx sets the hidden property on all siblings of button and not just next element sibling. core-toggle.js behaves as intended (/ described on the documentation page).

core-dialog: click on backdrop should not close

Depending on the needs of the user, the click on backdrop should not necessarily close the dialog. I think there should be an option passed to the dialog determining whether clicks on backdrop should trigger close or not. The default behavior can be close.

core-tabs with core-scroll

https://tv.nrk.no/serie/dyrevenn/sesong/5 bruker jeg begge i sesong-velgeren. Når jeg drar for scroll og slipper musa over en fane registreres ett klikk-event og jeg navigerer til den. Jeg burde ikke navigere hvis klikket var for å dra sesong-velgeren.

Eventen er event.defaultPrevented === true men jeg klarer ikke finne ut om det var prevented pga core-scroll eller core-tabs.

Fanene er lenker for å gjøre de crawlable for søkemotorer.
De blir alltid event.preventDefault():
https://github.com/nrkno/core-components/blob/master/packages/core-tabs/core-tabs.js#L28

Jeg tror også core-scroll gjør en event.preventDefault():
https://github.com/nrkno/core-components/blob/master/packages/core-scroll/core-scroll.js#L115

Hvordan kan jeg best bruke disse i kombinasjon?
Jeg tenker at event.preventDefault i core-tabs ikke burde skje. Om jeg kan konfig-styre det eller om oppførselen fjernes totalt har jeg ikke så mange meninger om :)

core-tabs: tab order on tabs in tablist

We do not have consistent behavior when tabbing on tabs. Tabbing usually results into focus being placed to an element outside of the tabslist, however if focus is on a tab placed before a tab that is a selected, tabbing will result into focus being placed on the tab. This is not the issue when focus is on a tab placed after a selected tab.

Either tabbing on tabs should always result into tabbing to the selected tab, or (more preferably) tabbing should always cause focus to be placed outside of the tabslist.

Simplifications

  • Use Element.closest instead of for(let el...) (and polyfill if needed)
  • Make a attr() function to reduce setAttribute and removeAttribute
  • Concept: Keyboard-shortcut-center?
  • Concept: List looper?
  • Timeout-before-focus
  • Find controller from target (for instance; find input from list in core-input)
  • Find target from controller (for instance; find list from input in core-input)

Add CI

npm test on master is currently broken. Travis or similar is awesome to avoid this state. 😄

Add styling

There should be an easy way to optionally include some base styling, distributed with each component for individual versioning. Uncertain best way of doing this, so need some research

Separate NPM pagackes

  • Potentially check out if Lerna is nice to have for multiple packages in one repo
  • See babel repo
  • Enables us to have different version of components simultaniously

Core:tabs - Prop open wont work

After upgrading to latest version of core:tabs, the open prop wont work.

Nothing happens when you change the prop, or when you change the default prop value from 0 to ex 1

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.