@engrate/components 0.0.2 → 0.0.4

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
@@ -5,7 +5,7 @@ A React component library built with Tailwind CSS, following Engrate's brand gui
5
5
  ## Installation
6
6
 
7
7
  ```bash
8
- npm install eg-components
8
+ npm install @engrate/components
9
9
  ```
10
10
 
11
11
  ### Peer Dependencies
@@ -18,46 +18,58 @@ npm install react react-dom
18
18
 
19
19
  ## Usage
20
20
 
21
- ### Option 1: Pre-compiled CSS (Non-Tailwind Projects)
22
-
23
- Import the compiled CSS bundle for projects not using Tailwind:
21
+ Import the styles and use the components:
24
22
 
25
23
  ```tsx
26
- import { Button } from 'eg-components'
27
- import 'eg-components/styles.css'
24
+ import { Button } from '@engrate/components'
25
+ import '@engrate/components/styles.css'
28
26
 
29
27
  function App() {
30
28
  return <Button variant="primary">Click me</Button>
31
29
  }
32
30
  ```
33
31
 
34
- ### Option 2: Tailwind Preset (Tailwind Projects)
35
-
36
- Extend your Tailwind config with Engrate's design tokens:
32
+ ### Using with Tailwind CSS v4
37
33
 
38
- ```js
39
- // tailwind.config.js
40
- import { egComponentsPreset } from 'eg-components/tailwind.preset'
34
+ If your project uses Tailwind CSS v4, import the styles in your main CSS file. The component library exports all design tokens as CSS custom properties which Tailwind v4 will automatically detect:
41
35
 
42
- export default {
43
- presets: [egComponentsPreset],
44
- content: [
45
- './src/**/*.{js,ts,jsx,tsx}',
46
- './node_modules/eg-components/dist/**/*.js',
47
- ],
48
- }
36
+ ```css
37
+ /* app.css */
38
+ @import 'tailwindcss';
39
+ @import '@engrate/components/styles.css';
49
40
  ```
50
41
 
51
- Then use components without importing CSS:
42
+ This gives you access to all Engrate design tokens in your own components:
52
43
 
53
44
  ```tsx
54
- import { Button } from 'eg-components'
55
-
56
- function App() {
57
- return <Button variant="primary">Click me</Button>
45
+ // Your custom component can use Engrate's design tokens
46
+ function CustomCard({ children }) {
47
+ return (
48
+ <div className="bg-card border-border text-primary rounded-lg p-4">
49
+ {children}
50
+ </div>
51
+ )
58
52
  }
59
53
  ```
60
54
 
55
+ ### Available Design Tokens
56
+
57
+ The library provides the following CSS custom properties:
58
+
59
+ **Colors:**
60
+
61
+ - `sunflower`, `sunflower-hover` - Primary brand color
62
+ - `primary`, `secondary`, `tertiary` - Text colors
63
+ - `main`, `alt`, `card`, `contrast` - Background colors
64
+ - `border` - Border color
65
+ - `error` - Error state color
66
+
67
+ **Typography:**
68
+
69
+ - `font-display` - Libre Baskerville (headings)
70
+ - `font-sans` - Work Sans (body text)
71
+ - `font-mono` - IBM Plex Mono (code)
72
+
61
73
  ## Development
62
74
 
63
75
  ### Setup
@@ -89,17 +101,16 @@ npm install
89
101
  ```
90
102
  src/
91
103
  ├── components/
92
- │ ├── ui/ # Base UI components (Button, etc.)
93
- │ └── layout/ # Layout components
104
+ │ ├── ui/ # Base UI components (Button, etc.)
105
+ │ └── layout/ # Layout components
94
106
  ├── lib/
95
- │ └── utils.ts # Utility functions (cn, etc.)
107
+ │ └── utils.ts # Utility functions (cn, etc.)
96
108
  ├── styles/
97
- │ ├── fonts.css # @font-face declarations
98
- │ └── index.css # Tailwind entry point
109
+ │ ├── fonts.css # @font-face declarations
110
+ │ └── index.css # Tailwind v4 with @theme tokens
99
111
  ├── test/
100
- │ └── setup.ts # Test configuration
101
- ├── tailwind.preset.ts # Exportable design tokens
102
- └── index.ts # Main entry point
112
+ │ └── setup.ts # Test configuration
113
+ └── index.ts # Main entry point
103
114
  ```
104
115
 
105
116
  ### Adding a Component
@@ -142,6 +153,14 @@ This library follows Engrate's brand guidelines:
142
153
  - **No bold fonts**: Use Regular weight only (Medium for emphasis)
143
154
  - **Left-aligned text**: Default alignment
144
155
 
156
+ ## Publishing to NPM
157
+
158
+ Make sure you have access to the @engrate org in NPM and then run:
159
+
160
+ ```
161
+ npm publish --access public
162
+ ```
163
+
145
164
  ## License
146
165
 
147
166
  MIT License