@alkimi.org/ui-kit 0.1.13 → 0.1.15
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.github.md +166 -100
- package/README.md +182 -97
- package/README.npm.md +182 -97
- package/dist/HelveticaNowDisplay-Medium-CXVMKHU3.ttf +0 -0
- package/dist/HelveticaNowDisplay-Regular-O4IVE4NP.ttf +0 -0
- package/dist/chunk-2XHWLYXD.mjs +3 -0
- package/dist/chunk-2XHWLYXD.mjs.map +1 -0
- package/dist/chunk-74PDRKS7.js +3 -0
- package/dist/chunk-74PDRKS7.js.map +1 -0
- package/dist/chunk-BCAQUOTY.mjs +3 -0
- package/dist/chunk-BCAQUOTY.mjs.map +1 -0
- package/dist/chunk-FUYXCJOQ.js +3 -0
- package/dist/chunk-FUYXCJOQ.js.map +1 -0
- package/dist/chunk-IK3C7KV5.mjs +3 -0
- package/dist/chunk-IK3C7KV5.mjs.map +1 -0
- package/dist/chunk-JNEIOQGF.js +3 -0
- package/dist/chunk-JNEIOQGF.js.map +1 -0
- package/dist/chunk-R74QDO2Z.js +3 -0
- package/dist/chunk-R74QDO2Z.js.map +1 -0
- package/dist/chunk-S5TKCF6T.mjs +3 -0
- package/dist/chunk-S5TKCF6T.mjs.map +1 -0
- package/dist/chunk-SVWC2KRP.js +3 -0
- package/dist/chunk-SVWC2KRP.js.map +1 -0
- package/dist/chunk-WF73K6X2.mjs +3 -0
- package/dist/chunk-WF73K6X2.mjs.map +1 -0
- package/dist/chunk-WJXJQZGO.js +3 -0
- package/dist/chunk-WJXJQZGO.js.map +1 -0
- package/dist/chunk-XNHJPYUV.mjs +3 -0
- package/dist/chunk-XNHJPYUV.mjs.map +1 -0
- package/dist/components/GlitchLink.js +2 -88
- package/dist/components/GlitchLink.js.map +1 -1
- package/dist/components/GlitchLink.mjs +1 -57
- package/dist/components/GlitchLink.mjs.map +1 -1
- package/dist/components/PixelLoad.js +2 -181
- package/dist/components/PixelLoad.js.map +1 -1
- package/dist/components/PixelLoad.mjs +1 -146
- package/dist/components/PixelLoad.mjs.map +1 -1
- package/dist/components/TextDecoder.js +2 -284
- package/dist/components/TextDecoder.js.map +1 -1
- package/dist/components/TextDecoder.mjs +1 -257
- package/dist/components/TextDecoder.mjs.map +1 -1
- package/dist/components/button.d.mts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/button.js +2 -108
- package/dist/components/button.js.map +1 -1
- package/dist/components/button.mjs +2 -73
- package/dist/components/button.mjs.map +1 -1
- package/dist/components/card.js +2 -114
- package/dist/components/card.js.map +1 -1
- package/dist/components/card.mjs +2 -75
- package/dist/components/card.mjs.map +1 -1
- package/dist/components/tabs.d.mts +9 -0
- package/dist/components/tabs.d.ts +9 -0
- package/dist/components/tabs.js +3 -0
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/tabs.mjs +3 -0
- package/dist/components/tabs.mjs.map +1 -0
- package/dist/fonts/fonts/HelveticaNowDisplay-Medium.ttf +0 -0
- package/dist/fonts/fonts/HelveticaNowDisplay-Regular.ttf +0 -0
- package/dist/index.css +2 -807
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +6 -9
- package/dist/index.d.ts +6 -9
- package/dist/index.js +2 -598
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -563
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +2 -807
- package/dist/styles.css.map +1 -1
- package/package.json +18 -40
- package/dist/lib/utils.d.mts +0 -5
- package/dist/lib/utils.d.ts +0 -5
- package/dist/lib/utils.js +0 -36
- package/dist/lib/utils.js.map +0 -1
- package/dist/lib/utils.mjs +0 -12
- package/dist/lib/utils.mjs.map +0 -1
package/README.github.md
CHANGED
|
@@ -10,95 +10,59 @@ npm install @alkimi.org/ui-kit
|
|
|
10
10
|
|
|
11
11
|
## Setup
|
|
12
12
|
|
|
13
|
-
### 1. Install Tailwind CSS
|
|
13
|
+
### 1. Install Tailwind CSS v4
|
|
14
14
|
|
|
15
|
-
If you haven't already, install Tailwind CSS in your project:
|
|
15
|
+
If you haven't already, install Tailwind CSS v4 and its dependencies in your project:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
npm install -D tailwindcss postcss autoprefixer
|
|
19
|
-
npx tailwindcss init -p
|
|
18
|
+
npm install -D tailwindcss@next @tailwindcss/postcss@next postcss autoprefixer
|
|
20
19
|
```
|
|
21
20
|
|
|
22
|
-
### 2. Configure
|
|
21
|
+
### 2. Configure PostCSS
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
Create or update your `postcss.config.js`:
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
module.exports = {
|
|
27
|
+
plugins: {
|
|
28
|
+
"@tailwindcss/postcss": {},
|
|
29
|
+
autoprefixer: {},
|
|
30
|
+
},
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 3. Configure Tailwind
|
|
35
|
+
|
|
36
|
+
Create a `tailwind.config.js` to specify your content paths:
|
|
25
37
|
|
|
26
38
|
```js
|
|
27
39
|
/** @type {import('tailwindcss').Config} */
|
|
28
40
|
module.exports = {
|
|
29
|
-
darkMode: ["class"],
|
|
30
41
|
content: [
|
|
42
|
+
// 👇 Scans YOUR project files for Tailwind classes
|
|
31
43
|
"./src/**/*.{js,jsx,ts,tsx}",
|
|
44
|
+
"./app/**/*.{js,jsx,ts,tsx}", // If using Next.js App Router
|
|
45
|
+
"./pages/**/*.{js,jsx,ts,tsx}", // If using Next.js Pages Router
|
|
46
|
+
"./components/**/*.{js,jsx,ts,tsx}",
|
|
47
|
+
|
|
48
|
+
// 👇 Scans the UI Kit's components for their Tailwind classes
|
|
49
|
+
// (Required for library components to be styled correctly)
|
|
32
50
|
"./node_modules/@alkimi.org/ui-kit/dist/**/*.{js,mjs}",
|
|
33
51
|
],
|
|
34
|
-
theme: {
|
|
35
|
-
fontSize: {
|
|
36
|
-
xs: ["0.75rem", "1rem"],
|
|
37
|
-
sm: ["12px", "1.25rem"],
|
|
38
|
-
base: ["14px", "1.5rem"],
|
|
39
|
-
lg: ["1.125rem", "1.75rem"],
|
|
40
|
-
xl: ["1.25rem", "1.75rem"],
|
|
41
|
-
"2xl": ["1.5rem", "2rem"],
|
|
42
|
-
"3xl": ["1.875rem", "2.25rem"],
|
|
43
|
-
"4xl": ["2.25rem", "2.5rem"],
|
|
44
|
-
"5xl": ["3rem", "1"],
|
|
45
|
-
"6xl": ["3.75rem", "1"],
|
|
46
|
-
"7xl": ["4.5rem", "1"],
|
|
47
|
-
"8xl": ["6rem", "1"],
|
|
48
|
-
"9xl": ["8rem", "1"],
|
|
49
|
-
},
|
|
50
|
-
extend: {
|
|
51
|
-
colors: {
|
|
52
|
-
border: "hsl(var(--border))",
|
|
53
|
-
input: "hsl(var(--input))",
|
|
54
|
-
ring: "hsl(var(--ring))",
|
|
55
|
-
background: "hsl(var(--background))",
|
|
56
|
-
foreground: "hsl(var(--foreground))",
|
|
57
|
-
primary: {
|
|
58
|
-
DEFAULT: "hsl(var(--primary))",
|
|
59
|
-
foreground: "hsl(var(--primary-foreground))",
|
|
60
|
-
},
|
|
61
|
-
secondary: {
|
|
62
|
-
DEFAULT: "hsl(var(--secondary))",
|
|
63
|
-
foreground: "hsl(var(--secondary-foreground))",
|
|
64
|
-
},
|
|
65
|
-
destructive: {
|
|
66
|
-
DEFAULT: "hsl(var(--destructive))",
|
|
67
|
-
foreground: "hsl(var(--destructive-foreground))",
|
|
68
|
-
},
|
|
69
|
-
muted: {
|
|
70
|
-
DEFAULT: "hsl(var(--muted))",
|
|
71
|
-
foreground: "hsl(var(--muted-foreground))",
|
|
72
|
-
},
|
|
73
|
-
accent: {
|
|
74
|
-
DEFAULT: "hsl(var(--accent))",
|
|
75
|
-
foreground: "hsl(var(--accent-foreground))",
|
|
76
|
-
},
|
|
77
|
-
popover: {
|
|
78
|
-
DEFAULT: "hsl(var(--popover))",
|
|
79
|
-
foreground: "hsl(var(--popover-foreground))",
|
|
80
|
-
},
|
|
81
|
-
card: {
|
|
82
|
-
DEFAULT: "hsl(var(--card))",
|
|
83
|
-
foreground: "hsl(var(--card-foreground))",
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
borderRadius: {
|
|
87
|
-
DEFAULT: "var(--radius)",
|
|
88
|
-
lg: "calc(var(--radius) + 2px)",
|
|
89
|
-
md: "var(--radius)",
|
|
90
|
-
sm: "calc(var(--radius) - 2px)",
|
|
91
|
-
xl: "calc(var(--radius) + 4px)",
|
|
92
|
-
"2xl": "calc(var(--radius) + 6px)",
|
|
93
|
-
"3xl": "3.75rem",
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
plugins: [require("tailwindcss-animate")],
|
|
98
52
|
}
|
|
99
53
|
```
|
|
100
54
|
|
|
101
|
-
|
|
55
|
+
**Important**: The second path (`node_modules/@alkimi.org/ui-kit/dist/...`) is **required** for the library components to display correctly. It tells Tailwind to scan the library's compiled files and generate CSS for the utility classes used inside the components (like `bg-primary`, `rounded-3xl`, etc.).
|
|
56
|
+
|
|
57
|
+
### 4. Import Tailwind in Your CSS
|
|
58
|
+
|
|
59
|
+
Create or update your main CSS file (e.g., `app.css` or `globals.css`):
|
|
60
|
+
|
|
61
|
+
```css
|
|
62
|
+
@import "tailwindcss";
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 5. Import Styles
|
|
102
66
|
|
|
103
67
|
Import the library's CSS in your main application file (e.g., `App.tsx` or `index.tsx`):
|
|
104
68
|
|
|
@@ -106,36 +70,131 @@ Import the library's CSS in your main application file (e.g., `App.tsx` or `inde
|
|
|
106
70
|
import "@alkimi.org/ui-kit/styles.css"
|
|
107
71
|
```
|
|
108
72
|
|
|
109
|
-
|
|
73
|
+
## Customizing Colors
|
|
74
|
+
|
|
75
|
+
The library uses CSS variables for colors, making it easy to customize. You have two approaches:
|
|
76
|
+
|
|
77
|
+
### Option A: Override CSS Variables (Recommended)
|
|
78
|
+
|
|
79
|
+
Add custom color values to your CSS file **after** importing the library styles:
|
|
110
80
|
|
|
111
81
|
```css
|
|
82
|
+
/* In your app.css or globals.css */
|
|
83
|
+
@import "tailwindcss";
|
|
84
|
+
@import "@alkimi.org/ui-kit/styles.css";
|
|
85
|
+
|
|
86
|
+
/* 👇 Override the library's default colors */
|
|
112
87
|
@layer base {
|
|
113
88
|
:root {
|
|
114
|
-
/*
|
|
115
|
-
--
|
|
116
|
-
--foreground:
|
|
117
|
-
--
|
|
118
|
-
--
|
|
119
|
-
--
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
89
|
+
/* Your custom colors (HSL format: Hue Saturation% Lightness%) */
|
|
90
|
+
--primary: 220 100% 50%; /* Custom blue primary color */
|
|
91
|
+
--primary-foreground: 0 0% 100%; /* White text on primary */
|
|
92
|
+
--secondary: 280 60% 60%; /* Custom purple secondary */
|
|
93
|
+
--background: 0 0% 100%; /* White background */
|
|
94
|
+
--foreground: 0 0% 0%; /* Black text */
|
|
95
|
+
|
|
96
|
+
/* You can override any of these variables:
|
|
97
|
+
--muted, --muted-foreground
|
|
98
|
+
--accent, --accent-foreground
|
|
99
|
+
--destructive, --destructive-foreground
|
|
100
|
+
--border, --input, --ring
|
|
101
|
+
--radius (border radius)
|
|
102
|
+
*/
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Option B: Don't Import Library CSS (Manual Setup)
|
|
108
|
+
|
|
109
|
+
If you want complete control, skip importing the library CSS and define all variables yourself:
|
|
110
|
+
|
|
111
|
+
```css
|
|
112
|
+
/* In your app.css or globals.css */
|
|
113
|
+
@import "tailwindcss";
|
|
114
|
+
|
|
115
|
+
@layer base {
|
|
116
|
+
:root {
|
|
117
|
+
/* Define ALL color variables used by the library */
|
|
118
|
+
--background: 0 0% 100%;
|
|
119
|
+
--foreground: 0 0% 0%;
|
|
120
|
+
--card: 0 0% 100%;
|
|
121
|
+
--card-foreground: 0 0% 0%;
|
|
122
|
+
--popover: 0 0% 100%;
|
|
123
|
+
--popover-foreground: 0 0% 0%;
|
|
124
|
+
--primary: 220 100% 50%;
|
|
125
|
+
--primary-foreground: 0 0% 100%;
|
|
126
|
+
--secondary: 280 60% 60%;
|
|
127
|
+
--secondary-foreground: 0 0% 100%;
|
|
128
|
+
--muted: 0 0% 96%;
|
|
129
|
+
--muted-foreground: 0 0% 45%;
|
|
130
|
+
--accent: 0 0% 96%;
|
|
131
|
+
--accent-foreground: 0 0% 0%;
|
|
132
|
+
--destructive: 0 84% 60%;
|
|
133
|
+
--destructive-foreground: 0 0% 100%;
|
|
134
|
+
--border: 0 0% 90%;
|
|
135
|
+
--input: 0 0% 90%;
|
|
136
|
+
--ring: 220 100% 50%;
|
|
137
|
+
--radius: 0.5rem;
|
|
135
138
|
}
|
|
136
139
|
|
|
137
140
|
body {
|
|
138
|
-
|
|
141
|
+
@apply bg-background text-foreground;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Note**: When using Option B, don't import `@alkimi.org/ui-kit/styles.css` in your code.
|
|
147
|
+
|
|
148
|
+
## Typography & Sizing
|
|
149
|
+
|
|
150
|
+
### Default Font
|
|
151
|
+
|
|
152
|
+
The library uses **Helvetica Now Display** as the default font family. This font is included in the library and will be automatically loaded when you import the styles.
|
|
153
|
+
|
|
154
|
+
### Font Sizes
|
|
155
|
+
|
|
156
|
+
The library uses **rem-based sizing** with a base font size of **1rem (16px)**. All font sizes use rem units for better accessibility and scalability:
|
|
157
|
+
|
|
158
|
+
- **Base text**: 1rem (16px)
|
|
159
|
+
- **Small text**: 0.875rem (14px) - Used in small buttons, captions, etc.
|
|
160
|
+
- **Large text**: 1.125rem (18px) and above
|
|
161
|
+
|
|
162
|
+
### Button Sizes
|
|
163
|
+
|
|
164
|
+
Buttons have the following font sizes by default:
|
|
165
|
+
|
|
166
|
+
- **Small** (`size="sm"`): 0.875rem (14px)
|
|
167
|
+
- **Default**: 1rem (16px)
|
|
168
|
+
- **Large** (`size="lg"`): 1rem (16px)
|
|
169
|
+
|
|
170
|
+
You can override these sizes using Tailwind's text utility classes (e.g., `className="text-lg"`) on any component.
|
|
171
|
+
|
|
172
|
+
## Customizing Font
|
|
173
|
+
|
|
174
|
+
You can override the default font family by setting the `--font-family` CSS variable in your own CSS file:
|
|
175
|
+
|
|
176
|
+
```css
|
|
177
|
+
/* In your app.css or globals.css */
|
|
178
|
+
@import "tailwindcss";
|
|
179
|
+
@import "@alkimi.org/ui-kit/styles.css";
|
|
180
|
+
|
|
181
|
+
@layer base {
|
|
182
|
+
:root {
|
|
183
|
+
/* Override the library's default font */
|
|
184
|
+
--font-family: 'Your Custom Font', 'Helvetica', sans-serif;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Make sure to include your custom font using `@font-face` or a web font service like Google Fonts:
|
|
190
|
+
|
|
191
|
+
```css
|
|
192
|
+
/* Example: Using Google Fonts */
|
|
193
|
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
|
194
|
+
|
|
195
|
+
@layer base {
|
|
196
|
+
:root {
|
|
197
|
+
--font-family: 'Inter', system-ui, sans-serif;
|
|
139
198
|
}
|
|
140
199
|
}
|
|
141
200
|
```
|
|
@@ -150,25 +209,32 @@ You can import components in two ways:
|
|
|
150
209
|
import { Button, Card } from "@alkimi.org/ui-kit"
|
|
151
210
|
```
|
|
152
211
|
|
|
153
|
-
### Option 2: Import Individual Components (
|
|
212
|
+
### Option 2: Import Individual Components (Optimized Bundle Size)
|
|
154
213
|
|
|
155
|
-
For better
|
|
214
|
+
For better code splitting and smaller production bundles, import components individually:
|
|
156
215
|
|
|
157
216
|
```tsx
|
|
158
217
|
// Import only the Button component
|
|
159
218
|
import { Button } from "@alkimi.org/ui-kit/button"
|
|
160
219
|
|
|
161
|
-
// Import only the
|
|
162
|
-
import {
|
|
220
|
+
// Import only the Tabs components
|
|
221
|
+
import {
|
|
222
|
+
Tabs,
|
|
223
|
+
TabsList,
|
|
224
|
+
TabsTrigger,
|
|
225
|
+
TabsContent,
|
|
226
|
+
} from "@alkimi.org/ui-kit/tabs"
|
|
163
227
|
|
|
164
228
|
// Import utilities
|
|
165
229
|
import { cn } from "@alkimi.org/ui-kit/utils"
|
|
166
230
|
```
|
|
167
231
|
|
|
232
|
+
**Note**: Both import methods require installing the full `@alkimi.org/ui-kit` package. The individual imports help optimize your production bundle size (only used components are included), but don't reduce installation size.
|
|
233
|
+
|
|
168
234
|
### Available Component Paths
|
|
169
235
|
|
|
170
236
|
- `@alkimi.org/ui-kit/button` - Button component
|
|
171
|
-
- `@alkimi.org/ui-kit/
|
|
237
|
+
- `@alkimi.org/ui-kit/tabs` - Tabs components (with animated sliding indicator)
|
|
172
238
|
- `@alkimi.org/ui-kit/text-decoder` - TextDecoder component
|
|
173
239
|
- `@alkimi.org/ui-kit/glitch-link` - GlitchLink component (requires Next.js)
|
|
174
240
|
- `@alkimi.org/ui-kit/pixel-load` - PixelLoad component (requires Next.js)
|
package/README.md
CHANGED
|
@@ -10,95 +10,59 @@ npm install @alkimi.org/ui-kit
|
|
|
10
10
|
|
|
11
11
|
## Setup
|
|
12
12
|
|
|
13
|
-
### 1. Install Tailwind CSS
|
|
13
|
+
### 1. Install Tailwind CSS v4
|
|
14
14
|
|
|
15
|
-
If you haven't already, install Tailwind CSS in your project:
|
|
15
|
+
If you haven't already, install Tailwind CSS v4 and its dependencies in your project:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
npm install -D tailwindcss postcss autoprefixer
|
|
19
|
-
npx tailwindcss init -p
|
|
18
|
+
npm install -D tailwindcss@next @tailwindcss/postcss@next postcss autoprefixer
|
|
20
19
|
```
|
|
21
20
|
|
|
22
|
-
### 2. Configure
|
|
21
|
+
### 2. Configure PostCSS
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
Create or update your `postcss.config.js`:
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
module.exports = {
|
|
27
|
+
plugins: {
|
|
28
|
+
"@tailwindcss/postcss": {},
|
|
29
|
+
autoprefixer: {},
|
|
30
|
+
},
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### 3. Configure Tailwind
|
|
35
|
+
|
|
36
|
+
Create a `tailwind.config.js` to specify your content paths:
|
|
25
37
|
|
|
26
38
|
```js
|
|
27
39
|
/** @type {import('tailwindcss').Config} */
|
|
28
40
|
module.exports = {
|
|
29
|
-
darkMode: ["class"],
|
|
30
41
|
content: [
|
|
42
|
+
// Scans YOUR project files for Tailwind classes
|
|
31
43
|
"./src/**/*.{js,jsx,ts,tsx}",
|
|
44
|
+
"./app/**/*.{js,jsx,ts,tsx}", // If using Next.js App Router
|
|
45
|
+
"./pages/**/*.{js,jsx,ts,tsx}", // If using Next.js Pages Router
|
|
46
|
+
"./components/**/*.{js,jsx,ts,tsx}",
|
|
47
|
+
|
|
48
|
+
// Scans the UI Kit's components for their Tailwind classes
|
|
49
|
+
// (Required for library components to be styled correctly)
|
|
32
50
|
"./node_modules/@alkimi.org/ui-kit/dist/**/*.{js,mjs}",
|
|
33
51
|
],
|
|
34
|
-
theme: {
|
|
35
|
-
fontSize: {
|
|
36
|
-
xs: ['0.75rem', '1rem'],
|
|
37
|
-
sm: ['12px', '1.25rem'],
|
|
38
|
-
base: ['14px', '1.5rem'],
|
|
39
|
-
lg: ['1.125rem', '1.75rem'],
|
|
40
|
-
xl: ['1.25rem', '1.75rem'],
|
|
41
|
-
'2xl': ['1.5rem', '2rem'],
|
|
42
|
-
'3xl': ['1.875rem', '2.25rem'],
|
|
43
|
-
'4xl': ['2.25rem', '2.5rem'],
|
|
44
|
-
'5xl': ['3rem', '1'],
|
|
45
|
-
'6xl': ['3.75rem', '1'],
|
|
46
|
-
'7xl': ['4.5rem', '1'],
|
|
47
|
-
'8xl': ['6rem', '1'],
|
|
48
|
-
'9xl': ['8rem', '1'],
|
|
49
|
-
},
|
|
50
|
-
extend: {
|
|
51
|
-
colors: {
|
|
52
|
-
border: "hsl(var(--border))",
|
|
53
|
-
input: "hsl(var(--input))",
|
|
54
|
-
ring: "hsl(var(--ring))",
|
|
55
|
-
background: "hsl(var(--background))",
|
|
56
|
-
foreground: "hsl(var(--foreground))",
|
|
57
|
-
primary: {
|
|
58
|
-
DEFAULT: "hsl(var(--primary))",
|
|
59
|
-
foreground: "hsl(var(--primary-foreground))",
|
|
60
|
-
},
|
|
61
|
-
secondary: {
|
|
62
|
-
DEFAULT: "hsl(var(--secondary))",
|
|
63
|
-
foreground: "hsl(var(--secondary-foreground))",
|
|
64
|
-
},
|
|
65
|
-
destructive: {
|
|
66
|
-
DEFAULT: "hsl(var(--destructive))",
|
|
67
|
-
foreground: "hsl(var(--destructive-foreground))",
|
|
68
|
-
},
|
|
69
|
-
muted: {
|
|
70
|
-
DEFAULT: "hsl(var(--muted))",
|
|
71
|
-
foreground: "hsl(var(--muted-foreground))",
|
|
72
|
-
},
|
|
73
|
-
accent: {
|
|
74
|
-
DEFAULT: "hsl(var(--accent))",
|
|
75
|
-
foreground: "hsl(var(--accent-foreground))",
|
|
76
|
-
},
|
|
77
|
-
popover: {
|
|
78
|
-
DEFAULT: "hsl(var(--popover))",
|
|
79
|
-
foreground: "hsl(var(--popover-foreground))",
|
|
80
|
-
},
|
|
81
|
-
card: {
|
|
82
|
-
DEFAULT: "hsl(var(--card))",
|
|
83
|
-
foreground: "hsl(var(--card-foreground))",
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
borderRadius: {
|
|
87
|
-
DEFAULT: "var(--radius)",
|
|
88
|
-
lg: "calc(var(--radius) + 2px)",
|
|
89
|
-
md: "var(--radius)",
|
|
90
|
-
sm: "calc(var(--radius) - 2px)",
|
|
91
|
-
xl: "calc(var(--radius) + 4px)",
|
|
92
|
-
"2xl": "calc(var(--radius) + 6px)",
|
|
93
|
-
"3xl": "3.75rem",
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
plugins: [require("tailwindcss-animate")],
|
|
98
52
|
}
|
|
99
53
|
```
|
|
100
54
|
|
|
101
|
-
|
|
55
|
+
**Important**: The second path (`node_modules/@alkimi.org/ui-kit/dist/...`) is **required** for the library components to display correctly. It tells Tailwind to scan the library's compiled files and generate CSS for the utility classes used inside the components (like `bg-primary`, `rounded-3xl`, etc.).
|
|
56
|
+
|
|
57
|
+
### 4. Import Tailwind in Your CSS
|
|
58
|
+
|
|
59
|
+
Create or update your main CSS file (e.g., `app.css` or `globals.css`):
|
|
60
|
+
|
|
61
|
+
```css
|
|
62
|
+
@import "tailwindcss";
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 5. Import Styles
|
|
102
66
|
|
|
103
67
|
Import the library's CSS in your main application file (e.g., `App.tsx` or `index.tsx`):
|
|
104
68
|
|
|
@@ -106,46 +70,145 @@ Import the library's CSS in your main application file (e.g., `App.tsx` or `inde
|
|
|
106
70
|
import "@alkimi.org/ui-kit/styles.css"
|
|
107
71
|
```
|
|
108
72
|
|
|
109
|
-
|
|
73
|
+
## Customizing Colors
|
|
74
|
+
|
|
75
|
+
The library uses CSS variables for colors, making it easy to customize. You have two approaches:
|
|
76
|
+
|
|
77
|
+
### Option A: Override CSS Variables (Recommended)
|
|
78
|
+
|
|
79
|
+
Add custom color values to your CSS file **after** importing the library styles:
|
|
80
|
+
|
|
81
|
+
```css
|
|
82
|
+
/* In your app.css or globals.css */
|
|
83
|
+
@import "tailwindcss";
|
|
84
|
+
@import "@alkimi.org/ui-kit/styles.css";
|
|
85
|
+
|
|
86
|
+
/* 👇 Override the library's default colors */
|
|
87
|
+
@layer base {
|
|
88
|
+
:root {
|
|
89
|
+
/* Your custom colors (HSL format: Hue Saturation% Lightness%) */
|
|
90
|
+
--primary: 220 100% 50%; /* Custom blue primary color */
|
|
91
|
+
--primary-foreground: 0 0% 100%; /* White text on primary */
|
|
92
|
+
--secondary: 280 60% 60%; /* Custom purple secondary */
|
|
93
|
+
--background: 0 0% 100%; /* White background */
|
|
94
|
+
--foreground: 0 0% 0%; /* Black text */
|
|
95
|
+
|
|
96
|
+
/* You can override any of these variables:
|
|
97
|
+
--muted, --muted-foreground
|
|
98
|
+
--accent, --accent-foreground
|
|
99
|
+
--destructive, --destructive-foreground
|
|
100
|
+
--border, --input, --ring
|
|
101
|
+
--radius (border radius)
|
|
102
|
+
*/
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Option B: Don't Import Library CSS (Manual Setup)
|
|
108
|
+
|
|
109
|
+
If you want complete control, skip importing the library CSS and define all variables yourself:
|
|
110
110
|
|
|
111
111
|
```css
|
|
112
|
+
/* In your app.css or globals.css */
|
|
113
|
+
@import "tailwindcss";
|
|
114
|
+
|
|
112
115
|
@layer base {
|
|
113
116
|
:root {
|
|
114
|
-
/*
|
|
115
|
-
--background:
|
|
116
|
-
--foreground:
|
|
117
|
-
--card: 0 0%
|
|
118
|
-
--card-foreground:
|
|
119
|
-
--popover: 0 0%
|
|
120
|
-
--popover-foreground:
|
|
121
|
-
--primary:
|
|
122
|
-
--primary-foreground:
|
|
123
|
-
--secondary:
|
|
124
|
-
--secondary-foreground:
|
|
125
|
-
--muted:
|
|
126
|
-
--muted-foreground:
|
|
127
|
-
--accent: 0 0%
|
|
128
|
-
--accent-foreground:
|
|
129
|
-
--destructive: 0
|
|
130
|
-
--destructive-foreground:
|
|
131
|
-
--border:
|
|
132
|
-
--input:
|
|
133
|
-
--ring:
|
|
134
|
-
--radius: 0.
|
|
117
|
+
/* Define ALL color variables used by the library */
|
|
118
|
+
--background: 0 0% 100%;
|
|
119
|
+
--foreground: 0 0% 0%;
|
|
120
|
+
--card: 0 0% 100%;
|
|
121
|
+
--card-foreground: 0 0% 0%;
|
|
122
|
+
--popover: 0 0% 100%;
|
|
123
|
+
--popover-foreground: 0 0% 0%;
|
|
124
|
+
--primary: 220 100% 50%;
|
|
125
|
+
--primary-foreground: 0 0% 100%;
|
|
126
|
+
--secondary: 280 60% 60%;
|
|
127
|
+
--secondary-foreground: 0 0% 100%;
|
|
128
|
+
--muted: 0 0% 96%;
|
|
129
|
+
--muted-foreground: 0 0% 45%;
|
|
130
|
+
--accent: 0 0% 96%;
|
|
131
|
+
--accent-foreground: 0 0% 0%;
|
|
132
|
+
--destructive: 0 84% 60%;
|
|
133
|
+
--destructive-foreground: 0 0% 100%;
|
|
134
|
+
--border: 0 0% 90%;
|
|
135
|
+
--input: 0 0% 90%;
|
|
136
|
+
--ring: 220 100% 50%;
|
|
137
|
+
--radius: 0.5rem;
|
|
135
138
|
}
|
|
136
139
|
|
|
137
140
|
body {
|
|
138
|
-
|
|
141
|
+
@apply bg-background text-foreground;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Note**: When using Option B, don't import `@alkimi.org/ui-kit/styles.css` in your code.
|
|
147
|
+
|
|
148
|
+
## Typography & Sizing
|
|
149
|
+
|
|
150
|
+
### Default Font
|
|
151
|
+
|
|
152
|
+
The library uses **Helvetica Now Display** as the default font family. This font is included in the library and will be automatically loaded when you import the styles.
|
|
153
|
+
|
|
154
|
+
### Font Sizes
|
|
155
|
+
|
|
156
|
+
The library uses **rem-based sizing** with a base font size of **1rem (16px)**. All font sizes use rem units for better accessibility and scalability:
|
|
157
|
+
|
|
158
|
+
- **Base text**: 1rem (16px)
|
|
159
|
+
- **Small text**: 0.875rem (14px) - Used in small buttons, captions, etc.
|
|
160
|
+
- **Large text**: 1.125rem (18px) and above
|
|
161
|
+
|
|
162
|
+
### Button Sizes
|
|
163
|
+
|
|
164
|
+
Buttons have the following font sizes by default:
|
|
165
|
+
|
|
166
|
+
- **Small** (`size="sm"`): 0.875rem (14px)
|
|
167
|
+
- **Default**: 1rem (16px)
|
|
168
|
+
- **Large** (`size="lg"`): 1rem (16px)
|
|
169
|
+
|
|
170
|
+
You can override these sizes using Tailwind's text utility classes (e.g., `className="text-lg"`) on any component.
|
|
171
|
+
|
|
172
|
+
## Customizing Font
|
|
173
|
+
|
|
174
|
+
You can override the default font family by setting the `--font-family` CSS variable in your own CSS file:
|
|
175
|
+
|
|
176
|
+
```css
|
|
177
|
+
/* In your app.css or globals.css */
|
|
178
|
+
@import "tailwindcss";
|
|
179
|
+
@import "@alkimi.org/ui-kit/styles.css";
|
|
180
|
+
|
|
181
|
+
@layer base {
|
|
182
|
+
:root {
|
|
183
|
+
/* Override the library's default font */
|
|
184
|
+
--font-family: 'Your Custom Font', 'Helvetica', sans-serif;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Make sure to include your custom font using `@font-face` or a web font service like Google Fonts:
|
|
190
|
+
|
|
191
|
+
```css
|
|
192
|
+
/* Example: Using Google Fonts */
|
|
193
|
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
|
|
194
|
+
|
|
195
|
+
@layer base {
|
|
196
|
+
:root {
|
|
197
|
+
--font-family: 'Inter', system-ui, sans-serif;
|
|
139
198
|
}
|
|
140
199
|
}
|
|
141
200
|
```
|
|
142
201
|
|
|
143
202
|
## Usage
|
|
144
203
|
|
|
145
|
-
|
|
204
|
+
You can import components in two ways:
|
|
205
|
+
|
|
206
|
+
### Option 1: Import from Main Package
|
|
207
|
+
|
|
208
|
+
Import all components from the main package entry point:
|
|
146
209
|
|
|
147
210
|
```tsx
|
|
148
|
-
import { Button } from "@alkimi.org/ui-kit"
|
|
211
|
+
import { Button, Tabs } from "@alkimi.org/ui-kit"
|
|
149
212
|
|
|
150
213
|
function App() {
|
|
151
214
|
return (
|
|
@@ -163,6 +226,28 @@ function App() {
|
|
|
163
226
|
}
|
|
164
227
|
```
|
|
165
228
|
|
|
229
|
+
### Option 2: Import Individual Components (Optimized Bundle Size)
|
|
230
|
+
|
|
231
|
+
For better code splitting and smaller production bundles, import components individually:
|
|
232
|
+
|
|
233
|
+
```tsx
|
|
234
|
+
// Import only the Button component
|
|
235
|
+
import { Button } from "@alkimi.org/ui-kit/button"
|
|
236
|
+
|
|
237
|
+
// Import only the Tabs components
|
|
238
|
+
import {
|
|
239
|
+
Tabs,
|
|
240
|
+
TabsList,
|
|
241
|
+
TabsTrigger,
|
|
242
|
+
TabsContent,
|
|
243
|
+
} from "@alkimi.org/ui-kit/tabs"
|
|
244
|
+
|
|
245
|
+
// Import utilities
|
|
246
|
+
import { cn } from "@alkimi.org/ui-kit/utils"
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
**Note**: Both import methods require installing the full `@alkimi.org/ui-kit` package. The individual imports help optimize your production bundle size (only used components are included), but don't reduce installation size.
|
|
250
|
+
|
|
166
251
|
## License
|
|
167
252
|
|
|
168
253
|
MIT
|