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

@microsoft/fast-development-site-react

v4.4.30

Published

FAST development testing site for React

Downloads

253

Readme

FAST Development site React

FAST Development site React has been deprecated.

A boilerplate development site that can be used to show a library of React components. All necessary navigational elements and routing will be generated to provide a full site for the documentation and testing of components.

Installation

npm i --save @microsoft/fast-development-site-react

Usage

import React from "react";
import ReactDOM from "react-dom";
import Site, { SiteCategory, SiteCategoryItem } from "@microsoft/fast-development-site-react";

const root = document.createElement("div");
root.setAttribute("id", "root");
document.body.appendChild(root);

function render(): void {
    ReactDOM.render(
        <Site
            formChildOptions={formChildOptions}
            onUpdateDirection={this.handleUpdateDirection}
        >
            <SiteTitle slot={"title"}>
                <SiteTitleBrand>FAST</SiteTitleBrand> Documentation
            </SiteTitle>
            <SiteCategory
                slot={"category"}
                name={"Components"}
                schema={ParagraphSchema},
                component={Paragraph},
                status={"Released"}
            >
                <SiteCategoryDocumentation slot={"canvas-detail-view-documentation"}>
                    <div>
                        Hello world
                    </div>
                </SiteCategoryDocumentation>
                <SiteCategoryItem
                    slot={"canvas-detail-view-example"}
                    data={componentDataItem}
                    designSystem={{ltr: this.state.direction}}
                />
                <SiteCategoryItem
                    slot={"canvas-example-view"}
                    data={componentDataItem}
                    designSystem={{ltr: this.state.direction}}
                />
            </SiteCategory>
        </Site>,
        root
    );
}

render();

Slots

You will see that a lot of the components require the passing of a property called slot. In a similar vein to how web components use slots we have them assigned to our components and they can also be used for arbirary components to place any component into the location indicated by the slot. Using your own components with a slot is still in flux so do this at your own risk.

Site

The Site component should be used as the wrapping component for the development site.

formChildOptions - The form child options are the optional children that can be added to a component that can have children, as specified in its JSON schema. The options are provided to the implementation the FAST development site makes of the @microsoft/fast-tooling-react, the data structure that is used is from the Form property childOptions and can be referenced here.

onUpdateDirection - The callback provided for an update in RTL, it will execute the given callback with "rtl" or "ltr".

onUpdateTheme - The callback provided for an update for theme, it well execute the given callback with the selected theme.

Example callback to be passed to onUpdateTheme

handleOnUpdateTheme = (theme: string) {
    this.setState({theme});
}

themes - An object with properties id,displayName and background. The background property will be applied to the container of the component examples on the detail and example pages.

Example on usage of themes

const themes = [
    {id: "Light", displayName: "Light", background: "#FFF"},
    {id: "Dark", displayName: "Dark", background: "#000"},
    {id: "Blue", displayName: "Blue", background: "#0000FF"}];
}

componentBackgroundTransparent - Adds an initial background transparency to the examples on the component view.

SiteTitle

The SiteTitle is used as a child of Site and should contain the title of the application/site which will appear in the header.

slot - The slot property is required and must pass the string "title".

SiteTitleBrand

The SiteTitleBrand can be used as a child of SiteTitle and will bold and color the text contents to the FAST Development Site brand color.

SiteCategory

The SiteCategory is used as a child of Site and can contain other SiteCategory components to create a nested structure.

slot - The slot property is required and must pass the string "category".

status If the SiteCategory contains SiteCategoryItem component(s) it can set the status of these items which can be Alpha, Beta or Release. The default is always set to Beta. As the component becomes more stable or is release ready the status can be updated on ISiteCategory props by setting status "Alpha","Beta" or "Released".

SiteCategoryItem

The SiteCategoryItem is used as a child of SiteCategory,

slot - The slot property is required, the first SiteCategoryItem should pass "canvas-detail-view-documentation" and any subsequent SiteCategoryItem components must pass "canvas-detail-view-example". The item that has the "canvas-detail-view-documentation" will show up on the documentation tab while the "canvas-detail-view-example" items will be displayed on the examples tab.

data - The data is should map to the properties of the component in the parent SiteCategory

designSystem - (Optional) If a design system is used from the @microsoft/fast-jss-manager-react then you can provide any design system configurations to this property.

SiteCategoryDocumentation

The SiteCategoryDocumentation is used as a child of SiteCategory and it's children should contain the documentation for the category, provided that the category contains a component and SiteCategoryItem components. This will show up below the SiteCategoryItem with the slot of "canvas-detail-view-documentation".

slot - The slot property is required and must pass the string "canvas-detail-view-documentation".