@alkimi.org/ui-kit 0.1.14 → 0.1.16
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 +177 -90
- package/README.md +193 -89
- package/README.npm.md +193 -89
- 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 +1 -961
- 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 -661
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -626
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -961
- package/dist/styles.css.map +1 -1
- package/package.json +15 -39
- 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,15 +10,28 @@ npm install @alkimi.org/ui-kit
|
|
|
10
10
|
|
|
11
11
|
## Setup
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
You have **two setup options** depending on your needs:
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
- **Option A (Recommended)**: Import pre-compiled library styles - simpler setup, works immediately
|
|
16
|
+
- **Option B (Advanced)**: Manual styling with full control - requires more configuration
|
|
17
|
+
|
|
18
|
+
Choose the option that best fits your project requirements.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
### Option A: Import Library Styles (Recommended)
|
|
23
|
+
|
|
24
|
+
**Best for**: Most projects. Simple setup with minimal configuration.
|
|
25
|
+
|
|
26
|
+
**What you get**: Pre-compiled utility classes (`rounded-lg`, `bg-primary`, etc.) + CSS variables + fonts
|
|
27
|
+
|
|
28
|
+
#### 1. Install Tailwind CSS v4
|
|
16
29
|
|
|
17
30
|
```bash
|
|
18
31
|
npm install -D tailwindcss@next @tailwindcss/postcss@next postcss autoprefixer
|
|
19
32
|
```
|
|
20
33
|
|
|
21
|
-
|
|
34
|
+
#### 2. Configure PostCSS
|
|
22
35
|
|
|
23
36
|
Create or update your `postcss.config.js`:
|
|
24
37
|
|
|
@@ -31,122 +44,158 @@ module.exports = {
|
|
|
31
44
|
}
|
|
32
45
|
```
|
|
33
46
|
|
|
34
|
-
|
|
47
|
+
#### 3. Import Library Styles
|
|
35
48
|
|
|
36
|
-
|
|
49
|
+
In your root layout file (e.g., `app/layout.tsx` for Next.js App Router):
|
|
37
50
|
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
content: [
|
|
42
|
-
// 👇 Scans YOUR project files for Tailwind classes
|
|
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)
|
|
50
|
-
"./node_modules/@alkimi.org/ui-kit/dist/**/*.{js,mjs}",
|
|
51
|
-
],
|
|
52
|
-
}
|
|
51
|
+
```tsx
|
|
52
|
+
import "@alkimi.org/ui-kit/styles.css"
|
|
53
|
+
import "./globals.css" // Your custom CSS
|
|
53
54
|
```
|
|
54
55
|
|
|
55
|
-
**Important**:
|
|
56
|
+
**Important**: Import the library styles **before** your custom CSS so you can override variables if needed.
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
#### 4. Configure Your CSS
|
|
58
59
|
|
|
59
|
-
Create
|
|
60
|
+
Create your `globals.css`:
|
|
60
61
|
|
|
61
62
|
```css
|
|
62
63
|
@import "tailwindcss";
|
|
64
|
+
|
|
65
|
+
/* Optional: Override library CSS variables */
|
|
66
|
+
:root {
|
|
67
|
+
/* Example: Custom primary color */
|
|
68
|
+
--primary: oklch(0.992 0.019 155.826);
|
|
69
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
70
|
+
|
|
71
|
+
/* You can override any of these variables:
|
|
72
|
+
--secondary, --secondary-foreground
|
|
73
|
+
--background, --foreground
|
|
74
|
+
--muted, --muted-foreground
|
|
75
|
+
--accent, --accent-foreground
|
|
76
|
+
--destructive, --destructive-foreground
|
|
77
|
+
--border, --input, --ring
|
|
78
|
+
--radius (border radius)
|
|
79
|
+
*/
|
|
80
|
+
}
|
|
63
81
|
```
|
|
64
82
|
|
|
65
|
-
|
|
83
|
+
**That's it!** The library components will work immediately because:
|
|
66
84
|
|
|
67
|
-
|
|
85
|
+
- `styles.css` contains pre-compiled utility classes
|
|
86
|
+
- All CSS variables are defined
|
|
87
|
+
- Fonts are included
|
|
88
|
+
- **No `@source` directive needed** (utilities are already compiled into the CSS)
|
|
68
89
|
|
|
69
|
-
|
|
70
|
-
import "@alkimi.org/ui-kit/styles.css"
|
|
71
|
-
```
|
|
90
|
+
#### When to Use Option A
|
|
72
91
|
|
|
73
|
-
|
|
92
|
+
- You want the quickest setup
|
|
93
|
+
- You're happy with the library's default styling approach
|
|
94
|
+
- You want to customize colors via CSS variables
|
|
95
|
+
- You don't need complete control over Tailwind configuration
|
|
74
96
|
|
|
75
|
-
|
|
97
|
+
---
|
|
76
98
|
|
|
77
|
-
### Option
|
|
99
|
+
### Option B: Manual Styling (Advanced)
|
|
78
100
|
|
|
79
|
-
|
|
101
|
+
**Best for**: Advanced users who want complete control over CSS generation and Tailwind configuration.
|
|
80
102
|
|
|
81
|
-
|
|
82
|
-
/* In your app.css or globals.css */
|
|
83
|
-
@import "tailwindcss";
|
|
84
|
-
@import "@alkimi.org/ui-kit/styles.css";
|
|
103
|
+
**What you do**: Define all CSS variables yourself and use `@source` to dynamically generate utility classes.
|
|
85
104
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
*/
|
|
103
|
-
}
|
|
105
|
+
#### 1. Install Tailwind CSS v4
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
npm install -D tailwindcss@next @tailwindcss/postcss@next postcss autoprefixer
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
#### 2. Configure PostCSS
|
|
112
|
+
|
|
113
|
+
Create or update your `postcss.config.js`:
|
|
114
|
+
|
|
115
|
+
```js
|
|
116
|
+
module.exports = {
|
|
117
|
+
plugins: {
|
|
118
|
+
"@tailwindcss/postcss": {},
|
|
119
|
+
autoprefixer: {},
|
|
120
|
+
},
|
|
104
121
|
}
|
|
105
122
|
```
|
|
106
123
|
|
|
107
|
-
|
|
124
|
+
#### 3. Do NOT Import Library Styles
|
|
125
|
+
|
|
126
|
+
In your root layout file (e.g., `app/layout.tsx`):
|
|
127
|
+
|
|
128
|
+
```tsx
|
|
129
|
+
// ❌ Do NOT import library styles in Option B
|
|
130
|
+
// import "@alkimi.org/ui-kit/styles.css"
|
|
131
|
+
|
|
132
|
+
import "./globals.css" // Only import your custom CSS
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### 4. Configure Your CSS with @source
|
|
108
136
|
|
|
109
|
-
|
|
137
|
+
Create your `globals.css`:
|
|
110
138
|
|
|
111
139
|
```css
|
|
112
|
-
/* In your app.css or globals.css */
|
|
113
140
|
@import "tailwindcss";
|
|
114
141
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
142
|
+
/* REQUIRED: Tell Tailwind v4 to scan library components */
|
|
143
|
+
@source "../node_modules/@alkimi.org/ui-kit/dist/**/*.{js,mjs}";
|
|
144
|
+
|
|
145
|
+
/* REQUIRED: Define ALL CSS variables the library needs */
|
|
146
|
+
:root {
|
|
147
|
+
--background: oklch(0.992 0.019 155.826);
|
|
148
|
+
--foreground: oklch(0.205 0 0);
|
|
149
|
+
--card: oklch(0.992 0.019 155.826);
|
|
150
|
+
--card-foreground: oklch(0.205 0 0);
|
|
151
|
+
--popover: oklch(0.992 0.019 155.826);
|
|
152
|
+
--popover-foreground: oklch(0.205 0 0);
|
|
153
|
+
--primary: oklch(0.992 0.019 155.826);
|
|
154
|
+
--primary-foreground: oklch(0.205 0 0);
|
|
155
|
+
--secondary: oklch(0.269 0 0);
|
|
156
|
+
--secondary-foreground: oklch(0.992 0.019 155.826);
|
|
157
|
+
--muted: oklch(0.269 0 0);
|
|
158
|
+
--muted-foreground: oklch(0.608 0 0);
|
|
159
|
+
--accent: oklch(0.269 0 0);
|
|
160
|
+
--accent-foreground: oklch(0.992 0.019 155.826);
|
|
161
|
+
--destructive: oklch(0.576 0.214 25.467);
|
|
162
|
+
--destructive-foreground: oklch(0.992 0.019 155.826);
|
|
163
|
+
--border: #3f3f46;
|
|
164
|
+
--input: #3f3f46;
|
|
165
|
+
--ring: oklch(0.992 0.019 155.826);
|
|
166
|
+
--radius: 0.625rem;
|
|
167
|
+
--font-family: "Helvetica Now Display", "Helvetica", sans-serif;
|
|
168
|
+
}
|
|
139
169
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
170
|
+
body {
|
|
171
|
+
@apply bg-background text-foreground;
|
|
143
172
|
}
|
|
144
173
|
```
|
|
145
174
|
|
|
146
|
-
**
|
|
175
|
+
**Key points**:
|
|
176
|
+
|
|
177
|
+
- The `@source` directive tells Tailwind v4 to scan the library's component files
|
|
178
|
+
- Tailwind will dynamically generate utility classes for any classes used in those components
|
|
179
|
+
- You must define all CSS variables the library expects
|
|
180
|
+
- VS Code may show a warning for `@source` - you can safely ignore it (it's a valid Tailwind v4 directive)
|
|
181
|
+
|
|
182
|
+
#### When to Use Option B
|
|
183
|
+
|
|
184
|
+
- You want complete control over CSS generation
|
|
185
|
+
- You're customizing Tailwind's configuration extensively
|
|
186
|
+
- You want to manage all CSS variables manually
|
|
187
|
+
- You're comfortable with more advanced Tailwind v4 configuration
|
|
188
|
+
|
|
189
|
+
---
|
|
147
190
|
|
|
148
191
|
## Typography & Sizing
|
|
149
192
|
|
|
193
|
+
### Default Font
|
|
194
|
+
|
|
195
|
+
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.
|
|
196
|
+
|
|
197
|
+
### Font Sizes
|
|
198
|
+
|
|
150
199
|
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:
|
|
151
200
|
|
|
152
201
|
- **Base text**: 1rem (16px)
|
|
@@ -156,12 +205,43 @@ The library uses **rem-based sizing** with a base font size of **1rem (16px)**.
|
|
|
156
205
|
### Button Sizes
|
|
157
206
|
|
|
158
207
|
Buttons have the following font sizes by default:
|
|
208
|
+
|
|
159
209
|
- **Small** (`size="sm"`): 0.875rem (14px)
|
|
160
210
|
- **Default**: 1rem (16px)
|
|
161
211
|
- **Large** (`size="lg"`): 1rem (16px)
|
|
162
212
|
|
|
163
213
|
You can override these sizes using Tailwind's text utility classes (e.g., `className="text-lg"`) on any component.
|
|
164
214
|
|
|
215
|
+
## Customizing Font
|
|
216
|
+
|
|
217
|
+
You can override the default font family by setting the `--font-family` CSS variable in your own CSS file:
|
|
218
|
+
|
|
219
|
+
```css
|
|
220
|
+
/* In your app.css or globals.css */
|
|
221
|
+
@import "tailwindcss";
|
|
222
|
+
@import "@alkimi.org/ui-kit/styles.css";
|
|
223
|
+
|
|
224
|
+
@layer base {
|
|
225
|
+
:root {
|
|
226
|
+
/* Override the library's default font */
|
|
227
|
+
--font-family: "Your Custom Font", "Helvetica", sans-serif;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Make sure to include your custom font using `@font-face` or a web font service like Google Fonts:
|
|
233
|
+
|
|
234
|
+
```css
|
|
235
|
+
/* Example: Using Google Fonts */
|
|
236
|
+
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");
|
|
237
|
+
|
|
238
|
+
@layer base {
|
|
239
|
+
:root {
|
|
240
|
+
--font-family: "Inter", system-ui, sans-serif;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
165
245
|
## Usage
|
|
166
246
|
|
|
167
247
|
You can import components in two ways:
|
|
@@ -172,25 +252,32 @@ You can import components in two ways:
|
|
|
172
252
|
import { Button, Card } from "@alkimi.org/ui-kit"
|
|
173
253
|
```
|
|
174
254
|
|
|
175
|
-
### Option 2: Import Individual Components (
|
|
255
|
+
### Option 2: Import Individual Components (Optimized Bundle Size)
|
|
176
256
|
|
|
177
|
-
For better
|
|
257
|
+
For better code splitting and smaller production bundles, import components individually:
|
|
178
258
|
|
|
179
259
|
```tsx
|
|
180
260
|
// Import only the Button component
|
|
181
261
|
import { Button } from "@alkimi.org/ui-kit/button"
|
|
182
262
|
|
|
183
|
-
// Import only the
|
|
184
|
-
import {
|
|
263
|
+
// Import only the Tabs components
|
|
264
|
+
import {
|
|
265
|
+
Tabs,
|
|
266
|
+
TabsList,
|
|
267
|
+
TabsTrigger,
|
|
268
|
+
TabsContent,
|
|
269
|
+
} from "@alkimi.org/ui-kit/tabs"
|
|
185
270
|
|
|
186
271
|
// Import utilities
|
|
187
272
|
import { cn } from "@alkimi.org/ui-kit/utils"
|
|
188
273
|
```
|
|
189
274
|
|
|
275
|
+
**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.
|
|
276
|
+
|
|
190
277
|
### Available Component Paths
|
|
191
278
|
|
|
192
279
|
- `@alkimi.org/ui-kit/button` - Button component
|
|
193
|
-
- `@alkimi.org/ui-kit/
|
|
280
|
+
- `@alkimi.org/ui-kit/tabs` - Tabs components (with animated sliding indicator)
|
|
194
281
|
- `@alkimi.org/ui-kit/text-decoder` - TextDecoder component
|
|
195
282
|
- `@alkimi.org/ui-kit/glitch-link` - GlitchLink component (requires Next.js)
|
|
196
283
|
- `@alkimi.org/ui-kit/pixel-load` - PixelLoad component (requires Next.js)
|