@strands.gg/accui 0.0.7 → 0.0.8
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
|
@@ -13,14 +13,17 @@ Modern authentication UI components for Vue 3 with magic link support and OAuth
|
|
|
13
13
|
- **Responsive Design** - Mobile-first approach
|
|
14
14
|
- **Route Protection** - Built-in middleware for authentication
|
|
15
15
|
|
|
16
|
-
## 🆕 What's New in v0.0.
|
|
16
|
+
## 🆕 What's New in v0.0.7
|
|
17
17
|
|
|
18
|
+
- ✅ **Auto-Import Styles** - Styles automatically imported with components (no manual CSS import needed)
|
|
19
|
+
- ✅ **Custom Styling Control** - `autoImportStyles: false` option for developers who want full styling control
|
|
20
|
+
- ✅ **Enhanced Nuxt Integration** - CSS automatically included in Nuxt builds
|
|
21
|
+
- ✅ **Simplified Setup** - Just install and use, styles are handled automatically
|
|
18
22
|
- ✅ **Fixed Nuxt Module** - Complete rewrite with proper configuration
|
|
19
23
|
- ✅ **Magic Link Signup** - Passwordless authentication flow
|
|
20
24
|
- ✅ **Auto-imports** - Components and composables automatically available
|
|
21
25
|
- ✅ **Route Middleware** - Built-in `auth` and `guest` middleware
|
|
22
26
|
- ✅ **Updated Dependencies** - Vue 3.5.18, Vite 6.3.5, Node.js 22 support
|
|
23
|
-
- ✅ **Enhanced Documentation** - Complete setup guides and examples
|
|
24
27
|
|
|
25
28
|
## 📦 Installation
|
|
26
29
|
|
|
@@ -28,13 +31,25 @@ Modern authentication UI components for Vue 3 with magic link support and OAuth
|
|
|
28
31
|
npm install @strands.gg/accui
|
|
29
32
|
```
|
|
30
33
|
|
|
31
|
-
### Import
|
|
34
|
+
### Styles Auto-Import
|
|
35
|
+
|
|
36
|
+
**Styles are automatically imported!** No manual CSS import needed.
|
|
37
|
+
|
|
38
|
+
- **Vue 3**: Styles load automatically when you import any component
|
|
39
|
+
- **Nuxt 3**: Styles are automatically included when you add the module
|
|
40
|
+
|
|
41
|
+
<details>
|
|
42
|
+
<summary>Manual CSS Import (if needed)</summary>
|
|
43
|
+
|
|
44
|
+
If you need to manually import styles for any reason:
|
|
32
45
|
|
|
33
46
|
```javascript
|
|
34
47
|
// Import the CSS in your main.js or app.vue
|
|
35
48
|
import '@strands.gg/accui/style.css'
|
|
36
49
|
```
|
|
37
50
|
|
|
51
|
+
</details>
|
|
52
|
+
|
|
38
53
|
## 🎯 Quick Start
|
|
39
54
|
|
|
40
55
|
### Basic Vue 3 Usage
|
|
@@ -62,6 +77,7 @@ import {
|
|
|
62
77
|
StrandsSignUp,
|
|
63
78
|
useStrandsAuth
|
|
64
79
|
} from "@strands.gg/accui"
|
|
80
|
+
// Styles are automatically imported! ✨
|
|
65
81
|
|
|
66
82
|
// Access auth state globally
|
|
67
83
|
const { user, isAuthenticated, signOut } = useStrandsAuth()
|
|
@@ -86,7 +102,7 @@ Add the module to your `nuxt.config.ts`:
|
|
|
86
102
|
|
|
87
103
|
```typescript
|
|
88
104
|
export default defineNuxtConfig({
|
|
89
|
-
modules: ['@strands.gg/accui/nuxt'],
|
|
105
|
+
modules: ['@strands.gg/accui/nuxt'], // Styles auto-imported! ✨
|
|
90
106
|
|
|
91
107
|
// Public runtime configuration
|
|
92
108
|
runtimeConfig: {
|
|
@@ -118,6 +134,7 @@ interface StrandsAuthConfig {
|
|
|
118
134
|
|
|
119
135
|
// Styling
|
|
120
136
|
accentColor?: string // Default: '#EA00A8'
|
|
137
|
+
autoImportStyles?: boolean // Default: true (disable for custom styling)
|
|
121
138
|
|
|
122
139
|
// Security & Performance
|
|
123
140
|
autoRefresh?: boolean // Default: true
|
|
@@ -152,6 +169,7 @@ export default defineNuxtConfig({
|
|
|
152
169
|
|
|
153
170
|
// Styling
|
|
154
171
|
accentColor: '#8b5cf6',
|
|
172
|
+
autoImportStyles: true, // Set to false for custom styling
|
|
155
173
|
|
|
156
174
|
// Route Protection
|
|
157
175
|
protectedRoutes: [
|
|
@@ -307,6 +325,41 @@ The Nuxt module provides a complete authentication solution with:
|
|
|
307
325
|
- **Composables**: Authentication state management available globally
|
|
308
326
|
- **Middleware**: Route protection built-in (`auth`, `guest`, global middleware)
|
|
309
327
|
- **Types**: Full TypeScript support with auto-completion
|
|
328
|
+
- **Styles**: CSS automatically included in your Nuxt build
|
|
329
|
+
|
|
330
|
+
### 🎨 **Auto-Import Styles**
|
|
331
|
+
The Nuxt module automatically includes all necessary CSS:
|
|
332
|
+
```typescript
|
|
333
|
+
// Automatically added to your project:
|
|
334
|
+
// - Main component styles (@strands.gg/accui/style.css)
|
|
335
|
+
// - Custom accent color variables
|
|
336
|
+
// - Responsive design classes
|
|
337
|
+
// - Dark/light mode support
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
**Custom Styling (Disable Auto-Import):**
|
|
341
|
+
```typescript
|
|
342
|
+
export default defineNuxtConfig({
|
|
343
|
+
modules: ['@strands.gg/accui/nuxt'],
|
|
344
|
+
runtimeConfig: {
|
|
345
|
+
public: {
|
|
346
|
+
strandsAuth: {
|
|
347
|
+
apiBaseUrl: 'https://accounts.strands.dev',
|
|
348
|
+
clientId: 'your-client-id',
|
|
349
|
+
autoImportStyles: false, // Disable auto-import
|
|
350
|
+
// ... other options
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
// Manually control CSS imports
|
|
355
|
+
css: [
|
|
356
|
+
// Import only base styles
|
|
357
|
+
'@strands.gg/accui/style.css',
|
|
358
|
+
// Or use your own custom styles
|
|
359
|
+
'~/assets/css/custom-auth.css'
|
|
360
|
+
]
|
|
361
|
+
})
|
|
362
|
+
```
|
|
310
363
|
|
|
311
364
|
### 🔒 **Route Protection**
|
|
312
365
|
```typescript
|
|
@@ -479,6 +532,32 @@ declare module '@nuxt/schema' {
|
|
|
479
532
|
modules: ['@strands.gg/accui/nuxt']
|
|
480
533
|
```
|
|
481
534
|
|
|
535
|
+
**Styles not loading:**
|
|
536
|
+
```typescript
|
|
537
|
+
// Check if auto-import is enabled (default: true)
|
|
538
|
+
runtimeConfig: {
|
|
539
|
+
public: {
|
|
540
|
+
strandsAuth: {
|
|
541
|
+
autoImportStyles: true // Enable auto-import
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// Or manually import styles:
|
|
547
|
+
export default defineNuxtConfig({
|
|
548
|
+
css: ['@strands.gg/accui/style.css'] // Manual import
|
|
549
|
+
})
|
|
550
|
+
|
|
551
|
+
// For completely custom styling:
|
|
552
|
+
runtimeConfig: {
|
|
553
|
+
public: {
|
|
554
|
+
strandsAuth: {
|
|
555
|
+
autoImportStyles: false // Disable auto-import
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
```
|
|
560
|
+
|
|
482
561
|
**Middleware not working:**
|
|
483
562
|
```vue
|
|
484
563
|
<!-- Ensure pages are in pages/ directory -->
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auto-import-styles.d.ts","sourceRoot":"","sources":["../../../apps/accounts-ui/src/auto-import-styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAKzB,wBAAgB,gBAAgB,SAU/B;AAGD,eAAO,MAAM,mBAAmB;iBACjB,GAAG;CAIjB,CAAA"}
|
package/dist/nuxt/module.d.ts
CHANGED
|
@@ -53,6 +53,12 @@ export interface StrandsAuthConfig {
|
|
|
53
53
|
* @default false
|
|
54
54
|
*/
|
|
55
55
|
devMode?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Automatically import CSS styles
|
|
58
|
+
* Set to false if you want to manually import styles or use custom styling
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
styles?: boolean;
|
|
56
62
|
}
|
|
57
63
|
declare const _default: import('@nuxt/schema').NuxtModule<StrandsAuthConfig, StrandsAuthConfig, false>;
|
|
58
64
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../apps/accounts-ui/src/nuxt/module.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAE1B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAE1B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../apps/accounts-ui/src/nuxt/module.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IAErB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAE1B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;IAE1B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;;AAED,wBAoIE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strands.gg/accui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"description": "Strands Authentication UI Components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/strands-auth-ui.umd.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"import": "./dist/strands-auth-ui.es.js",
|
|
13
13
|
"require": "./dist/strands-auth-ui.umd.js"
|
|
14
14
|
},
|
|
15
|
-
"./style.css": "./dist/
|
|
15
|
+
"./style.css": "./dist/accui.css",
|
|
16
16
|
"./nuxt": {
|
|
17
17
|
"types": "./dist/nuxt.d.ts",
|
|
18
18
|
"import": "./dist/nuxt.d.ts"
|