npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@telia/styleguide

v1.57.30

Published

This is a React component library of the Atomic Design components found in the Telia Styleguide. This is a living styleguide, showing the components which should be used in Telia Norway's web applications to achieve a common look & feel, and therefore use

Downloads

3,489

Readme

Telia Styleguide

This is a React component library of the Atomic Design components found in the Telia Styleguide. This is a living styleguide, showing the components which should be used in Telia Norway's web applications to achieve a common look & feel, and therefore user experience.

Usage

  1. Install the styleguide package: npm install --save @telia/styleguide

  2. Import the CSS styles. Use import '@telia/styleguide/dist/index.css'; for the full CSS or import '@telia/styleguide/dist/components.css'; if you only need the components themselves without the global styles. If you are using the business components, you need import '@telia/styleguide/business.css';. If you only use the business components, you don't need the other CSS files.

  3. Import and use a component: import { Button } from '@telia/styleguide'; and <Button text="Default button" />.

Development

Getting started

  1. Install dependencies: npm install
  2. Start Storybook: npm run storybook
  3. Open a browser at http://localhost:6006/

Adding a new component

All new components should employ TypeScript.

  1. Add a folder called YourComponentName in src/atoms|molecules|organisms

  2. In the new folder, create a new file YourComponentName.tsx React component file

  3. Write thorough docblocks above the function itself and all the parameters/props.

  4. Optionally add React PropTypes as well if the component is to be used in a non-TypeScript environment.

  5. Export the new component from src/index.ts.

  6. If the new component requires CSS, add a new file YourComponentName.pcss alongside the TSX source file. This will be included automatically.

  7. Add a new storybook file YourComponentName.stories.tsx with detailed examples of the new component in use (look at the existing components for examples).

CSS classes

All classes should be prefixed with "telia"

We also use the BEM-pattern: block__elements--modifiers

  • Component elements should be preceded with "__"
    • Example: telia-[component-name]__header
  • Component modifiers should be preceded with "--"
    • Example: "telia-[component-name]--compact"

Add new icons

NOTE: This section needs revision

  1. Copy the new icons into the folder assets/icons/dropHereNewIcons

  2. Build the library: npm run icons. Note that the original icons are optimized and moved from the drop here folder. The files that cannot be processed successfully remain in the drop folder

  3. Run npm run build, npm run storybook and check if your icon appears here: http://localhost:6006/?path=/docs/component-library-atoms-icon--default

Consuming the local, development styleguide in other local web apps

Use npm link to test a modified Telia Norge Styleguide component locally in telia-no-min-side project.

#  in Telia Norge Styleguide directory
npm run build:icons
npm run build
cd dist
npm link

# in your project directory
npm link @telia/styleguide
npm start

Now whenever you change anything in Telia Norge Styleguide, rerun npm run build and your project should pick up the changes.

When you're finished, unlink the Telia Norge Styleguide:

# in your project directory
npm unlink --no-save @telia/styleguide
npm install

# in Telia Norge Styleguide directory
npm unlink -g

To publish locally

  1. Local test: npm run publish:local-test

Deployment

We use Github Actions for build and deploy and the pipelines can be found at https://github.com/TeliaSoneraNorge/styleguide/actions. If you do not have access here and think you should have, post in the #styleguide channel on slack.

When a new feature/branch is merged to master, a new build of Storybook is automatically deployed. TODO: Add step in pipeline to post message to the Slack channel #styleguide-deploy to verify when the deploy has completed.

React component library package

After the deploy of the website is complete you can in the "Publish to npm" action trigger a version update. You can choose between major, minor and patch version update. See VERSIONS.md for more details on which to choose.

Remember to write a description in VERSIONS.md if it is a noteworthy change.

Other

Useful links

Versioning

Notify all "breaking changes" or major changes in the #styleguide Slack Channel and update VERSIONS.md.