@brandingbrand/fscomponents
Reusable, cross-platform frontend components
Last updated a month ago by branderbrett .
MIT · Original npm · Tarball · package.json
$ cnpm install @brandingbrand/fscomponents 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 3.0.1-alpha.28                                ...           canary (3 days ago)
  • 3.0.0                                ...           latest (a month ago)

185 Versions

  • 3.0.1-alpha.28                                ...           3 days ago
  • 3.0.1-alpha.27                                ...           3 days ago
  • 3.0.1-alpha.22                                ...           6 days ago
  • 3.0.1-alpha.20                                ...           6 days ago
  • 3.0.1-alpha.19                                ...           9 days ago
  • 3.0.1-alpha.18                                ...           12 days ago
  • 3.0.1-alpha.17                                ...           17 days ago
  • 3.0.1-alpha.16                                ...           17 days ago
  • 3.0.1-alpha.7                                ...           20 days ago
  • 3.0.1-alpha.6                                ...           22 days ago
  • 3.0.1-alpha.4                                ...           25 days ago
  • 3.0.1-alpha.3                                ...           25 days ago
  • 3.0.1-alpha.2                                ...           25 days ago
  • 3.0.0                                ...           a month ago
  • 3.0.1-alpha.14                                ...           a month ago
  • 3.0.1-alpha.13                                ...           a month ago
  • 2.0.1-alpha.46                                ...           a month ago
  • 2.0.1-alpha.45                                ...           a month ago
  • 2.0.1-alpha.44                                ...           a month ago
  • 2.0.1-alpha.42                                ...           a month ago
  • 2.0.1-alpha.41                                ...           a month ago
  • 3.0.1-alpha.1                                ...           a month ago
  • 2.0.1-alpha.40                                ...           2 months ago
  • 2.0.1-alpha.39                                ...           2 months ago
  • 2.0.1-alpha.38                                ...           2 months ago
  • 2.0.1-alpha.37                                ...           2 months ago
  • 2.0.1-alpha.36                                ...           2 months ago
  • 2.0.1-alpha.35                                ...           2 months ago
  • 2.0.1-alpha.34                                ...           2 months ago
  • 2.0.1-alpha.33                                ...           2 months ago
  • 2.0.1-alpha.32                                ...           2 months ago
  • 2.0.1-alpha.31                                ...           2 months ago
  • 2.0.1-alpha.30                                ...           2 months ago
  • 2.0.1-alpha.28                                ...           2 months ago
  • 2.0.1-alpha.27                                ...           3 months ago
  • 2.0.1-alpha.26                                ...           3 months ago
  • 2.0.1-alpha.23                                ...           3 months ago
  • 2.0.1-alpha.22                                ...           3 months ago
  • 2.0.1-alpha.18                                ...           4 months ago
  • 2.0.1-alpha.17                                ...           4 months ago
  • 2.0.1-alpha.16                                ...           4 months ago
  • 2.0.1-alpha.15                                ...           4 months ago
  • 2.0.1-alpha.14                                ...           4 months ago
  • 2.0.1-alpha.13                                ...           4 months ago
  • 2.0.1-alpha.12                                ...           4 months ago
  • 2.0.1-alpha.11                                ...           5 months ago
  • 2.0.1-alpha.10                                ...           5 months ago
  • 2.0.1-alpha.9                                ...           5 months ago
  • 2.0.1-alpha.7                                ...           5 months ago
  • 2.0.1-alpha.1                                ...           5 months ago
  • 2.0.0                                ...           5 months ago
  • 0.2.0-alpha.74e71f8c                                ...           6 months ago
  • 0.2.0-alpha.03d713be                                ...           6 months ago
  • 0.2.0-alpha.74b8b7f4                                ...           6 months ago
  • 0.2.0-alpha.95dd219d                                ...           6 months ago
  • 0.2.0-alpha.414d45f2                                ...           6 months ago
  • 0.2.0-alpha.27bb3bd8                                ...           6 months ago
  • 0.2.0-alpha.68357379                                ...           6 months ago
  • 0.2.0-alpha.a96082b3                                ...           6 months ago
  • 0.2.0-alpha.c7903ac2                                ...           6 months ago
  • 0.2.0-alpha.c754ad35                                ...           6 months ago
  • 0.2.0-alpha.adccb560                                ...           6 months ago
  • 0.2.0-alpha.9426f892                                ...           6 months ago
  • 0.2.0-alpha.b5f6b79d                                ...           6 months ago
  • 0.2.0-alpha.8e9e5f73                                ...           6 months ago
  • 0.2.0-alpha.e326bceb                                ...           6 months ago
  • 0.2.0-alpha.cb1604dd                                ...           6 months ago
  • 0.2.0-alpha.f2461fef                                ...           6 months ago
  • 0.2.0-alpha.da0f2d11                                ...           6 months ago
  • 0.2.0-alpha.8cc83689                                ...           6 months ago
  • 0.2.0-alpha.47bc20f7                                ...           6 months ago
  • 0.2.0-alpha.bbadd96c                                ...           6 months ago
  • 0.2.0-alpha.41e794fd                                ...           6 months ago
  • 0.2.0-alpha.7afadfed                                ...           6 months ago
  • 0.2.0-alpha.3bf49fbd                                ...           6 months ago
  • 0.2.0-alpha.1adff63a                                ...           7 months ago
  • 0.2.0-alpha.3f287a06                                ...           7 months ago
  • 0.2.0-alpha.be87dd01                                ...           7 months ago
  • 0.2.0-alpha.837469bb                                ...           7 months ago
  • 0.2.0-alpha.0bb130ca                                ...           7 months ago
  • 0.2.0-alpha.bc4a19f7                                ...           7 months ago
  • 0.2.0-alpha.a564fd22                                ...           7 months ago
  • 0.2.0-alpha.864b0bb8                                ...           7 months ago
  • 0.2.0-alpha.20a2b2ed                                ...           7 months ago
  • 0.2.0-alpha.68b84b56                                ...           7 months ago
  • 0.2.0-alpha.0f20dbf0                                ...           7 months ago
  • 0.2.0-alpha.d2eafc2e                                ...           7 months ago
  • 0.2.0-alpha.e2cc0f95                                ...           7 months ago
  • 0.2.0-alpha.f4cb1884                                ...           7 months ago
  • 0.2.0-alpha.a7e5bceb                                ...           7 months ago
  • 0.2.0-alpha.14a5c57f                                ...           7 months ago
  • 0.2.0-alpha.26a8dc9d                                ...           7 months ago
  • 0.2.0-alpha.587df802                                ...           7 months ago
  • 0.2.0-alpha.60583fda                                ...           7 months ago
  • 0.2.0-alpha.0d466f67                                ...           7 months ago
  • 0.2.0-alpha.8ce3cc7a                                ...           7 months ago
  • 0.2.0-alpha.230cbfe8                                ...           7 months ago
  • 0.2.0-alpha.79fd2218                                ...           7 months ago
  • 0.2.0-alpha.83b6f01c                                ...           7 months ago
  • 0.2.0-alpha.987931a8                                ...           7 months ago
  • 0.2.0-alpha.1db13cba                                ...           7 months ago
  • 0.2.0-alpha.23707849                                ...           7 months ago
  • 0.2.0-alpha.21c2f4f6                                ...           7 months ago
  • 0.2.0-alpha.49d305a0                                ...           7 months ago
  • 0.2.0-alpha.61e2d50f                                ...           8 months ago
  • 0.2.0-alpha.709ef378                                ...           8 months ago
  • 0.2.0-alpha.5f599f3c                                ...           8 months ago
  • 0.2.0-alpha.53dc2262                                ...           8 months ago
  • 0.2.0-alpha.7ba6a941                                ...           8 months ago
  • 0.2.0-alpha.409f7e9e                                ...           8 months ago
  • 0.2.0-alpha.fed9b250                                ...           8 months ago
  • 0.2.0-alpha.810c5dc1                                ...           8 months ago
  • 0.2.0-alpha.3c023cbf                                ...           8 months ago
  • 0.2.0-alpha.92e88d6d                                ...           8 months ago
  • 0.2.0-alpha.0fc7e99d                                ...           8 months ago
  • 0.2.0-alpha.3a450a5c                                ...           8 months ago
  • 0.2.0-alpha.a63df2ca                                ...           8 months ago
  • 0.2.0-alpha.f483bd88                                ...           8 months ago
  • 0.2.0-alpha.f33a6b0c                                ...           8 months ago
  • 0.2.0-alpha.a2323718                                ...           8 months ago
  • 0.2.0-alpha.3d308725                                ...           8 months ago
  • 0.2.0-alpha.442ed60e                                ...           8 months ago
  • 0.2.0-alpha.c0ceb59d                                ...           8 months ago
  • 0.2.0-alpha.0b0dd155                                ...           8 months ago
  • 0.2.0-alpha.b64e30dd                                ...           8 months ago
  • 0.2.0-alpha.700551d9                                ...           8 months ago
  • 0.2.0-alpha.72c610d6                                ...           8 months ago
  • 0.2.0-alpha.44a6626d                                ...           8 months ago
  • 0.2.0-alpha.5a439850                                ...           8 months ago
  • 0.2.0-alpha.50d491f0                                ...           8 months ago
  • 0.2.0-alpha.d9a56009                                ...           8 months ago
  • 0.2.0-alpha.46afc872                                ...           8 months ago
  • 0.2.0-alpha.cd1cfac4                                ...           8 months ago
  • 0.2.0-alpha.b4a85e8a                                ...           8 months ago
  • 0.2.0-alpha.a84e12cd                                ...           8 months ago
  • 0.2.0-alpha.0874d73b                                ...           8 months ago
  • 0.2.0-alpha.288096b9                                ...           8 months ago
  • 0.2.0-alpha.edb71636                                ...           8 months ago
  • 0.2.0-alpha.d476994f                                ...           8 months ago
  • 0.2.0-alpha.a677e08f                                ...           8 months ago
  • 0.2.0-alpha.8195ad25                                ...           8 months ago
  • 0.2.0-alpha.3971d89b                                ...           8 months ago
  • 0.2.0-alpha.7f49f4e5                                ...           8 months ago
  • 0.2.0-alpha.3f838cc9                                ...           8 months ago
  • 0.2.0-alpha.943fe174                                ...           8 months ago
  • 0.2.0-alpha.bd11590d                                ...           8 months ago
  • 0.2.0-alpha.71820862                                ...           8 months ago
  • 0.2.0-alpha.83aba47e                                ...           8 months ago
  • 0.2.0-alpha.bc7219c1                                ...           8 months ago
  • 0.2.0-alpha.a6ee192f                                ...           8 months ago
  • 0.2.0-alpha.64333850                                ...           8 months ago
  • 0.2.0-alpha.74aadba4                                ...           8 months ago
  • 0.2.0-alpha.bbd56b44                                ...           8 months ago
  • 0.2.0-alpha.d6236ad2                                ...           8 months ago
  • 0.2.0-alpha.bb156bd9                                ...           8 months ago
  • 0.2.0-alpha.b2a2bfc3                                ...           8 months ago
  • 0.2.0-alpha.a0872f53                                ...           8 months ago
  • 0.2.0-alpha.2383e1ac                                ...           8 months ago
  • 0.2.0-alpha.808ad2a2                                ...           8 months ago
  • 0.2.0-alpha.a834caa6                                ...           8 months ago
  • 0.2.0-alpha.2105647                                ...           8 months ago
  • 0.2.0-alpha.0880a1b5                                ...           8 months ago
  • 0.2.0-alpha.33643ce7                                ...           8 months ago
  • 0.2.0-alpha.cff15a98                                ...           8 months ago
  • 0.2.0-alpha.f546f315                                ...           8 months ago
  • 0.2.0-alpha.8d2fa0d5                                ...           8 months ago
  • 0.2.0-alpha.0dbd965c                                ...           8 months ago
  • 0.2.0-alpha.d53bf42b                                ...           9 months ago
  • 0.2.0-alpha.9b3f5f43                                ...           9 months ago
  • 0.2.0-alpha.bcdbbbc9                                ...           9 months ago
  • 0.2.0-alpha.6db4b83c                                ...           9 months ago
  • 0.2.0-alpha.e8c61611                                ...           9 months ago
  • 0.2.0-alpha.02b91410                                ...           9 months ago
  • 0.2.0-alpha.1c6ddbdd                                ...           9 months ago
  • 0.2.0-alpha.331c05e7                                ...           9 months ago
  • 0.2.0-alpha.159c4a6b                                ...           9 months ago
  • 0.2.0-alpha.9a00966c                                ...           9 months ago
  • 0.2.0-alpha.fad0a274                                ...           9 months ago
  • 0.2.0-alpha.b606797b                                ...           9 months ago
  • 0.2.0-alpha.eec415ab                                ...           9 months ago
  • 0.2.0-alpha.0df49d9f                                ...           9 months ago
  • 0.2.0-alpha.01da8a20                                ...           9 months ago
  • 0.2.0-alpha.039a84f6                                ...           9 months ago
  • 0.1.0                                ...           9 months ago
  • 0.1.0-alpha.8204c6aa                                ...           9 months ago

Copyright 2014 - 2016 © taobao.org |