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

@brandingbrand/fscomponents

v11.88.1

Published

Reusable, cross-platform frontend components

Downloads

2,543

Readme

FSComponents

FSComponents is Flagship's React Native component libraries.

Storybook

A great way to see some of the components and options that FSComponents offers is to visit Flagship's Storybook on our wiki.

It is often helpful to run a development version of storybook on your local system to interactively develop and test changes to the components in a controlled environment with a rapid re-compile time. To run:

  1. Verify that yarn is installed on your computer. If you are not sure if it is, type “which yarn” into your terminal. If the terminal does not output a path, install yarn.
  2. Clone flagship
  3. cd flagship
  4. yarn to install all required dependencies
  5. yarn dev:storybook to compile and run local version that will watch for and update according to changes. The default port is 9001.

Individual Component Guides

Below you will find some guidance and advice on using some of our most-used and most-customizable components.

Form

Basic Info

Flagship's Form component utilizes the t-comb-form-native library for its excellent validation capablities. As such, each form instance requires types to be passed in via the Form's fieldsTypes property. T-comb-form options are passed in via our Form component's individual fieldsOptions, fieldsStyleConfig, style, and templates props, respectively.

Important Note: T-comb-form-native instances are immutable, which means attempts to dynamically update them can result in unexpected behaviors. Consult the Disable a field based on another field's value section in t-comb-form-native's api guide and t-comb's updating immutable instances for more info.

Label Positions

Our basic form component can be configured to display the textbox (other structures in development) field labels above, inline with, or floating in the textbox, or hidden altogether. The default position is inline - the other options can be configured through the labelPosition property which accepts the enums FormLabelPosition.Above, FormLabelPosition.Floating, FormLabelPosition.Hidden, and FormLabelPosition.Inline, respectively.

The labelPosition templates are implemented as templates. Templates in t-comb-form native must be functional components. Because we need each field to ultimately be a stateful component in order to display activity and errors, these functional components return our stateful textbox field component and passes it locals and labelPosition as props. The constructor conditionally generates styles values from the locals stylesheet based on the labelPosition prop.

These labelPosition templates are passed into the templates field in the options object between the default templates (t-comb form) and the templates prop templates to ensure that

  1. If we have not configured a custom template, the default t-comb form templates will be used
  2. If a user inputs a field template, that field template will overwrite ours.
const _options = {
  stylesheet: { ...stylesheet, ...fieldsStyleConfig },
  fields: fieldsOptions,
  templates: { ...defaultTemplates, ...LabelMap[labelPosition], ...templates },
};

In order to ensure that our customized form label positions were still overwritable by an individual user's fieldsStyleConfig or template choices

Active, Inactive, and Error Colors

Our form component changes color and style when active, inactive, and when the validator has found an error. The default colors are black (#000000), grey (#cccccc), and red (#d0021b), but they can be changed through the activeColor, errorColor, and inactiveColor props. On render, the form component dynamically generates a stylesheet with the correct colors.