katalyst-riya-test 0.1.5 → 1.0.0

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,6 +1,241 @@
1
- ## Getting Started
2
- First, run the development server:
1
+ # Katerpillar Component Library
2
+
3
+ ## Step 1: Installation
4
+
5
+ Begin by installing the Katerpillar Component Library via npm:
3
6
 
4
7
  ```bash
5
- npm run dev
8
+ npm i @atomos_tech/katerpillar
9
+ ```
10
+
11
+ ## Step 2: Import CSS
12
+
13
+ Import the library's CSS in your root page to apply the default styles:
14
+
15
+ ```typescript
16
+ import "@atomos_tech/katerpillar/style";
17
+ ```
18
+
19
+ **Make sure to import it right above your global.css file to override the default colour palette!**
20
+
21
+ For example:
22
+
23
+ ```typescript
24
+ import "@atomos_tech/katerpillar/style";
25
+ import "./globals.css";
26
+ ```
27
+
28
+ ## Step 3: Configure Tailwind
29
+
30
+ You can set up the Tailwind CSS configuration in your tailwind.config.ts or tailwind.config.js and copy the theme styling below:
31
+
32
+ ```
33
+ import type { Config } from "tailwindcss";
34
+
35
+ const config: Config = {
36
+ content: [ ...your-pages ],
37
+ darkMode: "class",
38
+ theme: {
39
+ extend: {
40
+ colors: {
41
+ light: "var(--light)",
42
+ dark: "var(--dark)",
43
+ error: "var(--error)",
44
+ success: "var(--success)",
45
+ warning: "var(--warning)",
46
+
47
+ gray: {
48
+ 25: "var(--gray-25)",
49
+ 50: "var(--gray-50)",
50
+ 100: "var(--gray-100)",
51
+ 200: "var(--gray-200)",
52
+ 300: "var(--gray-300)",
53
+ 400: "var(--gray-400)",
54
+ 500: "var(--gray-500)",
55
+ 600: "var(--gray-600)",
56
+ 700: "var(--gray-700)",
57
+ 800: "var(--gray-800)",
58
+ 900: "var(--gray-900)",
59
+ },
60
+
61
+ primary: {
62
+ 25: "var(--primary-25)",
63
+ 50: "var(--primary-50)",
64
+ 100: "var(--primary-100)",
65
+ 200: "var(--primary-200)",
66
+ 300: "var(--primary-300)",
67
+ 400: "var(--primary-400)",
68
+ 500: "var(--primary-500)",
69
+ 600: "var(--primary-600)",
70
+ 700: "var(--primary-700)",
71
+ 800: "var(--primary-800)",
72
+ 900: "var(--primary-900)",
73
+ },
74
+ },
75
+ borderRadius: {
76
+ "radius-sm": "4px",
77
+ "radius-md": "8px",
78
+ "radius-lg": "16px",
79
+ "radius-xl": "32px",
80
+ },
81
+ spacing: {
82
+ "spacing-xxs": "2px",
83
+ "spacing-xs": "4px",
84
+ "spacing-sm": "8px",
85
+ "spacing-md": "16px",
86
+ "spacing-lg": "32px",
87
+ "spacing-xl": "64px",
88
+ "spacing-xxl": "128px",
89
+ },
90
+ fontFamily: {
91
+ karla: "var(--font-karla)",
92
+ montserrat: "var(--font-montserrat)",
93
+ },
94
+ screens: {
95
+ tablet: { max: "800px" },
96
+ mobile: { max: "480px" },
97
+ },
98
+ boxShadow: {
99
+ cardShadow: "0px 5px 16px 0px rgba(8, 15, 52, 0.06)",
100
+ cardShadowActive: "0px 5px 15px 0px rgba(66, 133, 244, 0.32)",
101
+ innerShadow: "3px 4px 5.3px 0px rgba(13, 51, 116, 0.64) inset",
102
+ },
103
+ },
104
+ },
105
+ plugins: [],
106
+ };
107
+ export default config;
108
+ ```
109
+
110
+ ## Step 4: Define Global Styles
111
+
112
+ Add the following CSS to your `global.css` file to define the theme variables and styles:
113
+
114
+ ```css
115
+ @layer base {
116
+ :root {
117
+ /* primary */
118
+ --primary-25: #f5faff;
119
+ --primary-50: #ecf3fe;
120
+ --primary-100: #d9e7fd;
121
+ --primary-200: #b3cefb;
122
+ --primary-300: #8eb6f8;
123
+ --primary-400: #689df6;
124
+ --primary-500: #4285f4;
125
+ --primary-600: #356ac3;
126
+ --primary-700: #285092;
127
+ --primary-800: #1a3562;
128
+ --primary-900: #0d1b31;
129
+
130
+ /* gray */
131
+ --gray-25: #ffffff;
132
+ --gray-50: #fefefe;
133
+ --gray-100: #f8f8f8;
134
+ --gray-200: #f2f2f2;
135
+ --gray-300: #e4e4e4;
136
+ --gray-400: #c0c0c0;
137
+ --gray-500: #a2a2a2;
138
+ --gray-600: #797979;
139
+ --gray-700: #656565;
140
+ --gray-800: #464646;
141
+ --gray-900: #252525;
142
+
143
+ /* secondary colors */
144
+ --light: #ffffff;
145
+ --dark: #070707;
146
+ --error: #ea4335;
147
+ --success: #34a853;
148
+ --warning: #fbbc05;
149
+ }
150
+ }
6
151
  ```
152
+
153
+ ## Step 5: Usage
154
+
155
+ With the library set up, you can start using the provided components. Below are examples of how to implement the Button and Chip components.
156
+
157
+ ### Import Components
158
+
159
+ Import the required components from the `@atomos_tech/katerpillar` package:
160
+
161
+ ```typescript
162
+ import { Button, Chip } from "@atomos_tech/katerpillar";
163
+ ```
164
+
165
+ ### Example Usage
166
+
167
+ Here is how you can integrate the Button and Chip into your page:
168
+
169
+ ```typescript
170
+ <Button variant="filled" intent="primary">
171
+ Primary
172
+ </Button>
173
+ <Chip intent="primary" size="lg">
174
+ Primary
175
+ </Chip>
176
+ ```
177
+
178
+ ## Example Page
179
+
180
+ Here's an example of how you might set up a simple page using the library:
181
+
182
+ ```typescript
183
+ import { Button, Chip } from "@atomos_tech/katerpillar";
184
+
185
+ export default function ExamplePage() {
186
+ return (
187
+ <div className="p-4">
188
+ <h1 className="text-2xl font-bold mb-4">Atomos Katerpillar Example</h1>
189
+ <div className="mb-4">
190
+ <Button variant="filled" intent="primary">
191
+ Primary Button
192
+ </Button>
193
+ </div>
194
+ <div>
195
+ <Chip intent="primary" size="lg">
196
+ Primary Chip
197
+ </Chip>
198
+ </div>
199
+ </div>
200
+ );
201
+ }
202
+ ```
203
+
204
+ ## Adding Interactivity
205
+
206
+ You can enhance the user experience by adding more interactive components and styles. Here's an example with a form and some interactive elements:
207
+
208
+ ```typescript
209
+ import { Button, Chip } from "@atomos_tech/katerpillar";
210
+ import { useState } from "react";
211
+
212
+ export default function InteractivePage() {
213
+ const [buttonClicked, setButtonClicked] = useState(false);
214
+
215
+ return (
216
+ <div className="p-4">
217
+ <h1 className="text-2xl font-bold mb-4">
218
+ Interactive Atomos Katerpillar Example
219
+ </h1>
220
+
221
+ <div className="mb-4">
222
+ <Button
223
+ variant="filled"
224
+ intent="primary"
225
+ onClick={() => setButtonClicked(!buttonClicked)}
226
+ >
227
+ {buttonClicked ? "Clicked!" : "Click Me"}
228
+ </Button>
229
+ </div>
230
+
231
+ <div className="mb-4">
232
+ <Chip intent="primary" size="lg">
233
+ {buttonClicked ? "Active Chip" : "Inactive Chip"}
234
+ </Chip>
235
+ </div>
236
+ </div>
237
+ );
238
+ }
239
+ ```
240
+
241
+ These instructions will help you effectively integrate and utilize the `@atomos_tech/katerpillar` library in your web applications, providing a consistent and visually appealing user interface.