@telicent-oss/ds 0.0.1 → 0.0.2-rc2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,135 +1,41 @@
1
- <h1 align="center">
2
- Telicent Design System (DS)
3
- </h1>
1
+ # Telicent Design System (DS)
4
2
 
5
- <p align="center">A component library containing common components with Telicent's &copy; unique brand styling. The components that are contained within this design system will be used across multiple projects. New components will meet the criteria for addition if they end up being used in at least 2 separate projects.</p>
3
+ A component library to help developers create frontend applications for [Telicent.io](https://telicent.io/) platform apps.
6
4
 
7
- #### Key Features
5
+ This repo contains:
6
+ 1. ReactJS Components that adhere to the _Design System rules_<sup>1</sup>
7
+ 2. A generated [Storybook](https://telicent-oss.github.io/ds/), describing the components
8
8
 
9
- - **Components**. A growing list of prestyled components
10
- - **Layouts**. Common layouts used in various Telicent applications
9
+ <sup>1</sup> The _Design System rules_ are contained in a Figma file (private for now)
11
10
 
12
- ## 🌚 Usage
11
+ ## Install
13
12
 
14
- You can use the Telicent DS package to easily keep your project up-to-date with the latest components
13
+ This repository is published as an npm package at [@telicent-oss/ds](https://www.npmjs.com/package/@telicent-oss/ds) and is installable via:
15
14
 
16
- 1. Install the library
17
-
18
- If using yarn
19
-
20
- ```
21
- yarn add @telicent-oss/ds
22
- ```
23
-
24
- If using npm
25
-
26
- ```
27
- npm install @telicent-oss/ds
28
- ```
29
-
30
- 2. Import css styles
31
-
32
- Note: The order of css imports matters. In order to override the styles from
33
- the DS, the imports below should appear before the applications css file(s)
34
- import.
35
-
36
- ```
37
- import "@telicent-oss/ds/dist/style.css";
38
-
39
- // Adds fontawesome icon pack
40
- import "@telicent-oss/ds/dist/fontawesome.css";
41
- ```
42
-
43
- 3. Disable tailwind preflight (only if using tailwind in your application)
44
-
45
- In tailwind.config.[js | ts]
46
-
47
- ```
48
- {
49
- ...
50
- corePlugins: {
51
- preflight: false,
52
- }
53
- ...
54
- }
55
- ```
56
-
57
- ## Developer notes
58
-
59
- ### Pre-deployment
60
-
61
- To test the components before pushing to a npm registry please perform the following steps:
62
-
63
- ```
64
- git clone https://github.com/Telicent-oss/telicent-ds.git
65
- cd telicent-ds
66
- yarn install
67
- yarn link #this will make it so you have a endpoint to link projects to
68
- cd <project-root>/node_modules/react
69
- yarn link # needs to be done or you app will throw errors due to clashing react instances
70
- cd <project-root>/node_modules/react-dom # needs to be done or you app will throw errors due to clashing react instances
71
-
72
- # Navigate to project you want to test the components in
73
- cd /path/to/project
74
- yarn link telicent/ds
75
- yarn link react
76
- yarn link react-dom
15
+ ```sh
16
+ npm install @telicent-oss/ds
77
17
  ```
78
18
 
79
- ### Host libary viewer
80
-
81
- To host the component library viewer
19
+ ## Usage
82
20
 
21
+ Before you start, import the required styles into your top-level file:
22
+ ```tsx
23
+ import "@telicent-oss/ds/dist/style.css";
24
+ import "@telicent-oss/ds/dist/fontawesome.css";
83
25
  ```
84
- cd /path/to/project
85
- yarn storybook
86
- ```
87
-
88
- ### Build library viewer
89
-
90
- To build the library viewer so that it can be hosted on something like Nginx just type `yarn build-storybook`.
91
- By default the output will be created in the storybook-static folder.
92
-
93
- ### Build components
94
-
95
- To build the components ready for uploading to a package manager type `yarn build:babel`
96
-
97
- ### Publish Component Library
98
-
99
- To publish this library to git packages:
100
26
 
101
- - Bump package version in package.json
102
- - push feature branch to git (this will kick off the chromatic action)
103
- - if there are changes in chromatic this will need to be reviewed
104
- - raise a pull request
105
- - requires at least one reviewer to accept to merge
106
- - merge pr in to main
107
- - on the main branch raise a release
108
- - this will kick off chromatic and npm-publish actions
27
+ Then search for a component in the Storybook. Navigate between stories by clicking on them in the sidebar or using the sidebar searchbox.
109
28
 
110
- If all that passed, congrats you have successfully deployed your npm package!
29
+ Once you have found the component, you can import it into your application:
111
30
 
112
- ### How to use published library in your apps
113
-
114
- [Create a personal access token](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token) that has read permissions to Packages
115
-
116
- Modify your ~/.npmrc file with the following:
117
-
118
- ```bash
119
- prefix=/Users/dave/.npm
120
- @telicent-oss:registry=https://npm.pkg.github.com/
121
- //npm.pkg.github.com/:_authToken={GITHUB_PERSONAL_ACCESS_TOKEN}
31
+ ```tsx
32
+ import { TeliStandardLayout } from '@telicent-oss/ds';
122
33
  ```
123
34
 
124
- To add to your app in the project root type `yarn add @telicent-oss/ds`
125
-
126
- ### How to publish a release candidate
127
-
128
- In this section you will learn the steps required to publish a release candidate to test bleeding edge capabilities in your app.
35
+ ## Run storybook locally
129
36
 
130
- - Set the version number in the package.json manually i.e. `1.1.2-rc1`
131
- - Commit your changes to the branch you are currently working on.
132
- - Create a tag `git tag <tag_name> <branch_name>`
133
- - Push the tag `git push origin <tag_name>`
134
-
135
- The workflow will now run and publish the package to [Telicent's private npm repo](https://github.com/Telicent-oss/telicent-ds/pkgs/npm/ds)
37
+ ```sh
38
+ git clone https://github.com/Telicent-oss/telicent-ds.git
39
+ cd telicent-ds
40
+ yarn && yarn storybook
41
+ ```