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

@arcteryx/components-universal

v6.0.0

Published

Provide market and env aware components for your FDP page templates.

Downloads

1,636

Readme

@arcteryx/components-universal

This package provides context aware components that can be used across our system of React apps.

Dependencies

  • @arcteryx/components-contexts

UIFooter and UIHeader

These components bootstrap the ui-components Header/Footer custom built webcomponents. They're market and env aware.

UIHeader Props:

  • env - default: production
  • loadScript - default: true - By default load the ui-components scripts utilizing the UIComponentsScript components (see below)
  • fdp - default: true - Passed through to the web component. Recommended to be true

UIFooter Props:

  • uiBaseUrl - required. Value can be https://ui-components.arcteryx.com | https://ui-components-staging.arcteryx.com | https://ui-components-dev.arcteryx.com
  • env - required. Value can be: production | preprod | stage | qa
  • loadScript - default: true - By default load the ui-components scripts utilizing the UIComponentsScript components (see below)

Usage

This pulls in the outdoor Header/Footer because of the SiteContext. It uses production Header/Footer by default, but you can specify an env property to align it with your deployment environment.

import { UIHeader, UIFooter } from "@arcteryx/components-universal"
import { SiteContextProvider } from "@arcteryx/components-contexts"

// env can be: production | preprod | stage | qa
// `UIHeader` defaults to using `production` if the `env` prop is not set. 
const env = process.env.DEPLOY_ENV

const MyApp = () => (
  <SiteContextProvider market="outdoor" country="ca" language="en">
    <UIHeader env={ env } />
    
    <UIFooter />
  </SiteContextProvider>
)

UIComponentsScript

This component is used by UIHeader by default and it will load up ui-components web components script, which ultimately implements <arcteryx-outdoor-header>, etc.

Props:

  • uiBaseUrl - required. Value can be https://ui-components.arcteryx.com | https://ui-components-staging.arcteryx.com | https://ui-components-dev.arcteryx.com
  • env - required. Value can be: production | preprod | stage | qa
  • async - default: true
  • injectInHead - default: true
  • WrapComponent - default: null (See below regarding NextJS) If set, injectInHead becomes implicitly false

Usage

import { UIComponentsScript, UIHeader, UIFooter, COOKIE_SCRIPT_PREFIX_KEY } from "@arcteryx/components-universal"
import { SiteContextProvider } from "@arcteryx/components-contexts"

const env = process.env.DEPLOY_ENV;
const uiBaseUrl = process.env.UI_BASE_URL;
const scriptPrefix = cookies.get(COOKIE_SCRIPT_PREFIX_KEY);

const MyApp = () => (
  <SiteContextProvider market="outdoor" country="ca" language="en">
    <UIComponentsScript uiBaseUrl={uiBaseUrl} env={ env } scriptPrefix={scriptPrefix} />
    <UIHeader loadScript={ false } />
    
    <UIFooter />
  </SiteContextProvider>
)

TagManagerScript

This component will load up the Adobe Launch tag manager scripts based on market and env.

Props:

  • env - required. Value can be: production | preprod | stage | qa
  • async - default: true
  • injectInHead - default: true
  • WrapComponent - default: null (See below regarding NextJS)

Usage

import { TagManagerScript } from "@arcteryx/components-universal"
import { SiteContextProvider } from "@arcteryx/components-contexts"

const env = process.env.DEPLOY_ENV

const MyApp = () => (
  <SiteContextProvider market="outdoor" country="ca" language="en">
    <TagManagerScript env={ env } />
  </SiteContextProvider>
)

NextJS Apps

NextJS provides the ability to do a server-side-render (SSR) and it exposes a <Head> component that wraps tags like <script> and <link>. The benefit is that you can put the <Head> component anywhere and it will place its children into document.head. However, the problem is that you cannot use other React components as children. So this is invalid: <Head><TagManagerScript /></Head>. To get around this, the <*Script> components expose a WrapComponent prop.

Usage

import Head from "next/head";
import { TagManagerScript } from "@arcteryx/components-universal"
import { SiteContextProvider } from "@arcteryx/components-contexts"

const env = process.env.DEPLOY_ENV

const MyApp = () => (
  <SiteContextProvider market="outdoor" country="ca" language="en">
    <TagManagerScript env={ env } WrapComponent={ Head } />
  </SiteContextProvider>
)