0.0.1-beta.26 ā€¢ Published 4 days ago

@trilogy-ds/react v0.0.1-beta.26

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
4 days ago

Trilogy DS

šŸš€ Quick Start

Trilogy DS, developed by Bouygues Telecom, is a multiplatform design system ( Web / React / React Native ) with reusable components with same codebase.

SASS React

React Native

Structure

.
ā”œā”€ā”€ react             
   ā”œā”€ā”€ components      # ā—€ React functional components
   ā”œā”€ā”€ context         # Providers (Themes , styles / hashed styles)
   ā”œā”€ā”€ events          # Event type definitions
   ā”œā”€ā”€ helpers         # Utility functions
   ā”œā”€ā”€ objects         # Atoms & facets definition & implementation
   ā”œā”€ā”€ services        # Hooks
   ā””ā”€ā”€ types           # Typescript types

Usage

npm i @trilogy-ds/react
import { Button, Text } from '@trilogy-ds/react';

<Button variant='PRIMARY'>My Button</Button>
<Text level='1'>My Text</Text>

Trilogy Provider - Import directly css styles

The TrilogyProvider simplifies integrating Trilogy style into your app by wrapping your entry point with a provider. It offers two props for customization:

  • mangled optional: Apply compressed styling for performance.
  • injectTrilogyAssets: Inject Trilogy assets directly into the DOM.

Web Usage

  1. Import the TrilogyProvider component:

    import { TrilogyProvider } from "@trilogy-ds/react/lib/context/provider"
  2. Wrap your app's root component with it:

      <TrilogyProvider mangled injectTrilogyAssets>
        <App />
      </TrilogyProvider>

Native Usage

  1. Import the TrilogyThemeProvider along with SVGicons & colors from @trilogy-ds/assets library:

    import { TrilogyThemeProvider, defaultTheme } from '@trilogy-ds/react/lib/context/providerTheme'
    import { SVGicons } from '@trilogy-ds/assets/lib/iconsPath'
  2. Wrap your app's root component with it:

      const theme = {
        ...defaultTheme,
        icons: SVGicons,
        // here: override theme colors
      }
    
      <TrilogyThemeProvider theme={theme}>
        <AppNative />
      </TrilogyThemeProvider>

Environment

Web

Mobile (Android / IOS)

See how to setup your environment for Android and IOS

Example

Check out our example project using Trilogy for consumption.

Contributing

Read the contributing guide to become familiar with our development process, suggest fixes for bugs and improvements, and understand how to construct and assess your modifications

Changelog

The changelog is consistently refreshed to show the modifications made in each new version.