@lctafrica/ui 0.0.0 → 0.0.2

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,73 +1,142 @@
1
- # React + TypeScript + Vite
1
+ # LCT Africa UI Library
2
2
 
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
3
+ This is an internal UI component library for **LCT Africa**, built with **React**, **TypeScript**, and **Vite**. It provides reusable, consistent, and tested UI components for use across LCT Africa’s frontend projects.
4
+ ---
4
5
 
5
- Currently, two official plugins are available:
6
+ ## Project Structure
6
7
 
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs)
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/)
8
+ ```
9
+ src/
10
+ components/
11
+ ui/
12
+ button/
13
+ Button.tsx
14
+ Button.stories.tsx
15
+ Button.test.tsx
16
+ ```
9
17
 
10
- ## React Compiler
18
+ ---
11
19
 
12
- The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
20
+ ## Getting Started
13
21
 
14
- ## Expanding the ESLint configuration
22
+ ### Prerequisites
15
23
 
16
- If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
24
+ - Node.js v18+ (recommended)
25
+ - npm or yarn
17
26
 
18
- ```js
19
- export default defineConfig([
20
- globalIgnores(['dist']),
21
- {
22
- files: ['**/*.{ts,tsx}'],
23
- extends: [
24
- // Other configs...
27
+ ### Installation
28
+
29
+ ```bash
30
+ npm install
31
+ # or
32
+ yarn install
33
+ ```
25
34
 
26
- // Remove tseslint.configs.recommended and replace with this
27
- tseslint.configs.recommendedTypeChecked,
28
- // Alternatively, use this for stricter rules
29
- tseslint.configs.strictTypeChecked,
30
- // Optionally, add this for stylistic rules
31
- tseslint.configs.stylisticTypeChecked,
35
+ ### Development
32
36
 
33
- // Other configs...
34
- ],
35
- languageOptions: {
36
- parserOptions: {
37
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
38
- tsconfigRootDir: import.meta.dirname,
39
- },
40
- // other options...
41
- },
42
- },
43
- ])
37
+ Start the development server with hot module replacement:
38
+
39
+ ```bash
40
+ npm run dev
41
+ # or
42
+ yarn dev
44
43
  ```
45
44
 
46
- You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
47
-
48
- ```js
49
- // eslint.config.js
50
- import reactX from 'eslint-plugin-react-x'
51
- import reactDom from 'eslint-plugin-react-dom'
52
-
53
- export default defineConfig([
54
- globalIgnores(['dist']),
55
- {
56
- files: ['**/*.{ts,tsx}'],
57
- extends: [
58
- // Other configs...
59
- // Enable lint rules for React
60
- reactX.configs['recommended-typescript'],
61
- // Enable lint rules for React DOM
62
- reactDom.configs.recommended,
63
- ],
64
- languageOptions: {
65
- parserOptions: {
66
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
67
- tsconfigRootDir: import.meta.dirname,
68
- },
69
- // other options...
70
- },
71
- },
72
- ])
45
+ ---
46
+
47
+ ## Building for Production
48
+
49
+ ```bash
50
+ npm run build
51
+ # or
52
+ yarn build
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Linting
58
+
59
+ This project uses **ESLint** with recommended **TypeScript** and **React** rules.
60
+
61
+ You can expand the ESLint configuration for type-aware or React-specific lint rules. For example:
62
+
63
+ ```bash
64
+ npm install --save-dev eslint-plugin-react-x eslint-plugin-react-dom
73
65
  ```
66
+
67
+ Check `eslint.config.js` for comments on stricter or stylistic rules.
68
+
69
+ ---
70
+
71
+ ## Testing
72
+
73
+ Example tests are located alongside components, e.g.:
74
+
75
+ ```
76
+ src/components/ui/button/Button.test.tsx
77
+ ```
78
+
79
+ Run tests with:
80
+
81
+ ```bash
82
+ npm run test
83
+ # or
84
+ yarn test
85
+ ```
86
+
87
+ ---
88
+
89
+ ## Storybook
90
+
91
+ Component stories are located in:
92
+
93
+ ```
94
+ src/components/ui/button/Button.stories.tsx
95
+ ```
96
+
97
+ Run Storybook:
98
+
99
+ ```bash
100
+ npm run storybook
101
+ # or
102
+ yarn storybook
103
+ ```
104
+
105
+ ---
106
+
107
+ ## Project Highlights
108
+
109
+ - **React + TypeScript:** Modern, type-safe UI development
110
+ - **Vite:** Fast build and dev server
111
+ - **Component-driven:** UI components organized under `ui`
112
+ - **Testing:** Example tests using Vitest
113
+ - **ESLint:** Ensures code quality and consistency
114
+
115
+ ---
116
+
117
+ ## Contributing
118
+
119
+ 1. Fork the repository
120
+ 2. Create your feature branch:
121
+
122
+ ```bash
123
+ git checkout -b feature/YourFeature
124
+ ```
125
+
126
+ 3. Commit your changes:
127
+
128
+ ```bash
129
+ git commit -am "Add some feature"
130
+ ```
131
+
132
+ 4. Push to your branch:
133
+
134
+ ```bash
135
+ git push origin feature/YourFeature
136
+ ```
137
+
138
+ 5. Open a pull request
139
+
140
+ > **Note:** This library is intended for internal use within LCT Africa projects only.
141
+
142
+ ---
@@ -0,0 +1,10 @@
1
+ import { VariantProps } from 'class-variance-authority';
2
+ import * as React from "react";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
5
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
6
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
7
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
8
+ asChild?: boolean;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export { Button, buttonVariants };
@@ -0,0 +1 @@
1
+ export * from './components/ui/button./Button';