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

@kth/kth-reactstrap

v1.0.2

Published

https://app-r.referens.sys.kth.se/static/components/

Downloads

161

Readme

KTH Style React components

https://app-r.referens.sys.kth.se/static/components/

kth-reactstrap

Library of React components based on KTH-style and reactstrap

Getting started

Installation:

npm run install

The following commands should be used:

npm run start (start documentation web server)
npm run test:unit (start unit tests in watch mode)
npm run dev (run start and test:unit above)
npm run test (run unit tests)
npm run build (build the code for npm package)

Checklist for new category (e.g. team/group)

One-time setup, given a new category named 'demo':

  • create folder 'src/components/demo'
    • create index file '/components/demo/index.ts'
    • add reference to demo in '/components/index.ts'
  • create folder 'src/stories/demo'

And then create components (and stories to document them):

  • create component in 'src/components/demo'
    • add import/export of component in 'src/components/demo/index.ts'
  • create story in 'src/stories/demo'
    • describe/use component in story

Notes after Upgrading to kth-style version 10

Styles

All the scss styles for the kth-stylea and some fixed for the components are is now loaded inside the index.scss, and it is available at dist/component/index.css after build.

it is recomended to load the index.css in your project, otherwise you need to use the css fixes inside the index.scss and other loaded styles in your project by yourself.

Scripts

All the scripts that you need are now available at dist/js, it is recommended to load the scripts in the index.html of your project. (if you use the KthHeader component now it has a param called loadScipts, the default value is false but if you set true for that param it will load the KPM script by itself and you will have the enterance menu. read more here: https://app.kth.se/style/en/components/kpm)

it is recomended to have the scripts on your project to have functionalities like back-to-top.

Images

you may need kth logotype or icons, they are now available in dist/img now after the build process.

Components

Alert

after upgrading to kth-style version 10 the alert is changed to be aligned with the latest version of kth-style. now you can choose on of these as type of the Alert: 'info' | 'warning' | 'success' | 'danger'. Note that: warning and danger are the same, since the kth style the alert types are only 'info' | 'warning' | 'success'. read more here: https://app.kth.se/style/en/components/alert

LocalNavigation

This is the new component that has been added, it has been used only at this project as the sidebar menu for the stories. You can use it by seeing example usage in the App.tsx file in this project

BackLink

This is now changed to kth-button and use kth-button style in the background as you can see here: https://app.kth.se/style/en/components/button Back Button

Button

All the functionalitie are the same as before, required changes has been made to keep the functionality of this component. you can visit this page to know more about kth-button: https://app.kth.se/style/en/components/button

It needs to be mentioned that, a new decoration has been added to the Button which is "previous" but it will act exactly the same as "back".

now the "back" class is used in Backlink component and in Button component back acts as previous in kth-button.

Application

It is now using the latest classes related to kth-style 10, to be sure that the app is wrapped in correct classes.

KthHeader

The styles is now upgraded to kth-style 10 and two parameter is now added, now you can set true value for "loadScripts" and then you will have the KMP scripts added automatically in the index.html of your project which will add the entrance menu.

Another parameter that has been added is variant, the value can be one of these, 'external' | 'student-web' | 'intranet'. you can read more about variants here: https://app.kth.se/style/en/components/header

KthFooter

The styles is now upgraded to kth-style 10 and onetwo parameter is now added,

The parameter that has been added is variant, the value can be one of these, 'external' | 'student-web' | 'intranet'. you can read more about variants here: https://app.kth.se/style/en/components/header

About cortina.json (notes for maintanence and development)

In KTH we are getting header, footer and some more sections from cortina and we call them cortina blocks. Now this pacakge is used an appraoch to get footer directly from the cortina. the script is inside the generate.js will get the selected blocks by blockID and save them in cortina.json and later you can use the block which is an html string. you can use 'html-react-parser' to insert html inside the jsx.

Testing the package locally

If in further developments you decide to test this package locally you need to fisrt run this command:

  • "npm (or yarn) link ../{consuming project name}/node_modules/react (we are assuming that both projects are at the same folder)

Then run this command for this package:

  • "npm (or yarn) link"

Finaly in the consuming project run this command:

  • "npm (or yarn) link @kth/kth-reactstrap"

Consider that you need to run the build script before link the package to a consuming project.

The reason that we are linking the consuming project react to this project is that we want to use the same react bundler for both pacakge and consuming project (to prevent hooks to be undefiend). read more here: https://react.dev/warnings/invalid-hook-call-warning