@skill-academy/uikit 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 +115 -0
- package/dist/index.cjs +4817 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.css +4184 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.cts +488 -0
- package/dist/index.d.ts +488 -0
- package/dist/index.js +4547 -0
- package/dist/index.js.map +1 -0
- package/package.json +161 -0
- package/postcss.config.cjs +5 -0
- package/styles/fonts.css +4 -0
- package/styles/index.css +10 -0
- package/styles/tailwind-src.css +9 -0
- package/styles/tailwind.css +3893 -0
- package/styles/theme-variables.css +82 -0
- package/styles/theme.css +181 -0
- package/tailwind.preset.js +55 -0
package/README.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# @skill-academy/uikit
|
|
2
|
+
|
|
3
|
+
Shared UI component library for the Skill Management Platform and Tech Qualify Academy FE apps. Built with React, Radix UI primitives, and Tailwind CSS utilities.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
From a sibling app (e.g. `tech-qualify-learners-app`):
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
yarn add file:../skill-management-ui
|
|
11
|
+
# or with workspaces: "@skill-academy/uikit": "workspace:*"
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The package is published as `@skill-academy/uikit`; when using a local path, the folder may still be named `skill-management-ui`.
|
|
15
|
+
|
|
16
|
+
## Peer dependencies
|
|
17
|
+
|
|
18
|
+
The consuming app must install:
|
|
19
|
+
|
|
20
|
+
- `react`, `react-dom`
|
|
21
|
+
- All `@radix-ui/*` packages used by the components you import (see `package.json` peerDependencies)
|
|
22
|
+
- `class-variance-authority`, `clsx`, `tailwind-merge`
|
|
23
|
+
|
|
24
|
+
Optional (only if you use components that need them): `cmdk`, `date-fns`, `embla-carousel-react`, `input-otp`, `lucide-react`, `next-themes`, `react-day-picker`, `react-hook-form`, `react-resizable-panels`, `recharts`, `sonner`, `vaul`.
|
|
25
|
+
|
|
26
|
+
## Styling (theme and variables)
|
|
27
|
+
|
|
28
|
+
This package ships the same design-system styles as **Skill Management Platform Designs**. Import them in your app’s main CSS (or entry) so tokens and base styles apply.
|
|
29
|
+
|
|
30
|
+
| File | Use when |
|
|
31
|
+
|------|----------|
|
|
32
|
+
| `@skill-academy/uikit/styles/theme.css` | **Tailwind v4**: full theme (`:root` / `.dark` variables, `@theme inline`, `@layer base`). Import once so Tailwind can process it. |
|
|
33
|
+
| `@skill-academy/uikit/styles/theme-variables.css` | **Tailwind v3** or no Tailwind: variables only. Use in your global CSS; for Tailwind v3, extend your `theme` from these vars if needed. |
|
|
34
|
+
| `@skill-academy/uikit/styles/index.css` | Tailwind v4 convenience entry; currently just imports `theme.css`. |
|
|
35
|
+
|
|
36
|
+
**Example (Tailwind v4):**
|
|
37
|
+
|
|
38
|
+
```css
|
|
39
|
+
/* In your app’s main CSS, e.g. src/index.css */
|
|
40
|
+
@import '@skill-academy/uikit/styles/theme.css';
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Example (Tailwind v3):**
|
|
44
|
+
|
|
45
|
+
```css
|
|
46
|
+
/* In your app’s main CSS */
|
|
47
|
+
@import '@skill-academy/uikit/styles/theme-variables.css';
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Then use the preset so utilities like `bg-primary` and `rounded-lg` match:
|
|
51
|
+
|
|
52
|
+
```js
|
|
53
|
+
// tailwind.config.js
|
|
54
|
+
module.exports = {
|
|
55
|
+
presets: [require('@skill-academy/uikit/tailwind.preset.js')],
|
|
56
|
+
content: ['./src/**/*.{js,ts,jsx,tsx}', './node_modules/@skill-academy/uikit/dist/**/*.js'],
|
|
57
|
+
};
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Fonts:** `@skill-academy/uikit/styles/fonts.css` is a placeholder; add `@font-face` or font imports there in your app if you use custom fonts.
|
|
61
|
+
|
|
62
|
+
## Tailwind setup
|
|
63
|
+
|
|
64
|
+
Components rely on Tailwind utility classes and design tokens (e.g. `bg-primary`, `text-card-foreground`, `rounded-xl`). The library does **not** bundle Tailwind.
|
|
65
|
+
|
|
66
|
+
1. **Use Tailwind** in your app (Tailwind v3 or v4 with PostCSS or Vite plugin).
|
|
67
|
+
|
|
68
|
+
2. **Provide the same design tokens** so components look correct. The easiest way is to import this package’s styles (see **Styling** above). Alternatively, in your Tailwind config extend `theme` with matching colors and border radius (e.g. `primary`, `destructive`, `card`, `muted`, `accent`, `border`, `input`, `ring`, `sidebar`).
|
|
69
|
+
|
|
70
|
+
3. **Content paths**: In `tailwind.config.js`, add the library’s dist (or source) so classes used by the components are not purged:
|
|
71
|
+
```js
|
|
72
|
+
content: [
|
|
73
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
74
|
+
'./node_modules/@skill-academy/uikit/dist/**/*.js',
|
|
75
|
+
],
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Usage
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
import { Button, Card, CardHeader, CardTitle, CardContent, cn } from '@skill-academy/uikit';
|
|
82
|
+
|
|
83
|
+
export function MyPage() {
|
|
84
|
+
return (
|
|
85
|
+
<Card>
|
|
86
|
+
<CardHeader>
|
|
87
|
+
<CardTitle>Title</CardTitle>
|
|
88
|
+
</CardHeader>
|
|
89
|
+
<CardContent>
|
|
90
|
+
<Button>Submit</Button>
|
|
91
|
+
</CardContent>
|
|
92
|
+
</Card>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
All exported components and utilities are listed in `src/index.ts`.
|
|
98
|
+
|
|
99
|
+
## Build
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
yarn install
|
|
103
|
+
yarn build
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
- **JS:** `yarn build:js` (or `tsup`) → `dist/index.js` (ESM), `dist/index.cjs` (CJS), `dist/index.d.ts` (types).
|
|
107
|
+
- **CSS:** `yarn build:css` runs Tailwind v4 (PostCSS) on `styles/tailwind-src.css` → `styles/tailwind.css` (includes theme + utilities used by the package). Full build runs both.
|
|
108
|
+
|
|
109
|
+
## Development
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
yarn dev
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Runs the build in watch mode.
|