@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 +129 -60
- package/dist/components/ui/button./Button.d.ts +10 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3080 -0
- package/dist/lct-logo.svg +3 -0
- package/dist/lib/utils.d.ts +2 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,73 +1,142 @@
|
|
|
1
|
-
#
|
|
1
|
+
# LCT Africa UI Library
|
|
2
2
|
|
|
3
|
-
This
|
|
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
|
-
|
|
6
|
+
## Project Structure
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
```
|
|
9
|
+
src/
|
|
10
|
+
components/
|
|
11
|
+
ui/
|
|
12
|
+
button/
|
|
13
|
+
Button.tsx
|
|
14
|
+
Button.stories.tsx
|
|
15
|
+
Button.test.tsx
|
|
16
|
+
```
|
|
9
17
|
|
|
10
|
-
|
|
18
|
+
---
|
|
11
19
|
|
|
12
|
-
|
|
20
|
+
## Getting Started
|
|
13
21
|
|
|
14
|
-
|
|
22
|
+
### Prerequisites
|
|
15
23
|
|
|
16
|
-
|
|
24
|
+
- Node.js v18+ (recommended)
|
|
25
|
+
- npm or yarn
|
|
17
26
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
### Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install
|
|
31
|
+
# or
|
|
32
|
+
yarn install
|
|
33
|
+
```
|
|
25
34
|
|
|
26
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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 };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './components/ui/button./Button';
|