tokenizer-ui-kit 0.0.6 → 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 +84 -1
- package/dist/tokenizer-ui-kit.es.js +1692 -1689
- package/dist/tokenizer-ui-kit.umd.js +1 -1
- package/package.json +1 -1
- package/dist/types/index.d.ts +0 -46
package/README.md
CHANGED
|
@@ -32,20 +32,103 @@ import { CircularLoader } from "tokenizer-ui-kit";
|
|
|
32
32
|
|
|
33
33
|
## 🚀 Usage
|
|
34
34
|
|
|
35
|
+
### For Vue/Vite Applications
|
|
36
|
+
|
|
37
|
+
#### 1. Import components and styles
|
|
38
|
+
|
|
39
|
+
```vue
|
|
40
|
+
<script setup>
|
|
41
|
+
import { DatePicker, CButton, CircularLoader } from "tokenizer-ui-kit";
|
|
42
|
+
// ⚠️ IMPORTANT: Import CSS styles for proper styling
|
|
43
|
+
import "tokenizer-ui-kit/dist/tokenizer-ui-kit.css";
|
|
44
|
+
</script>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
#### 2. Use components
|
|
48
|
+
|
|
35
49
|
```vue
|
|
36
50
|
<template>
|
|
37
51
|
<div>
|
|
38
52
|
<DatePicker v-model="selectedDate" />
|
|
39
|
-
<CButton @click="handleClick">Click me</CButton>
|
|
53
|
+
<CButton @click="handleClick" color="green">Click me</CButton>
|
|
40
54
|
<CircularLoader v-if="loading" />
|
|
41
55
|
</div>
|
|
42
56
|
</template>
|
|
43
57
|
|
|
44
58
|
<script setup>
|
|
59
|
+
import { ref } from "vue";
|
|
45
60
|
import { DatePicker, CButton, CircularLoader } from "tokenizer-ui-kit";
|
|
61
|
+
import "tokenizer-ui-kit/dist/tokenizer-ui-kit.css";
|
|
62
|
+
|
|
63
|
+
const selectedDate = ref(null);
|
|
64
|
+
const loading = ref(false);
|
|
65
|
+
|
|
66
|
+
const handleClick = () => {
|
|
67
|
+
console.log("Button clicked!");
|
|
68
|
+
};
|
|
46
69
|
</script>
|
|
47
70
|
```
|
|
48
71
|
|
|
72
|
+
### For Nuxt Applications
|
|
73
|
+
|
|
74
|
+
#### Option 1: In `nuxt.config.ts` (Recommended)
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
// nuxt.config.ts
|
|
78
|
+
export default defineNuxtConfig({
|
|
79
|
+
css: ["tokenizer-ui-kit/dist/tokenizer-ui-kit.css"],
|
|
80
|
+
// ... other config
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
#### Option 2: In `app.vue` or layout
|
|
85
|
+
|
|
86
|
+
```vue
|
|
87
|
+
<!-- app.vue or layouts/default.vue -->
|
|
88
|
+
<script setup>
|
|
89
|
+
// Import CSS globally
|
|
90
|
+
import "tokenizer-ui-kit/dist/tokenizer-ui-kit.css";
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<template>
|
|
94
|
+
<NuxtPage />
|
|
95
|
+
</template>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
#### Option 3: In individual components
|
|
99
|
+
|
|
100
|
+
```vue
|
|
101
|
+
<!-- components/MyComponent.vue -->
|
|
102
|
+
<script setup>
|
|
103
|
+
import { DatePicker, CButton } from "tokenizer-ui-kit";
|
|
104
|
+
import "tokenizer-ui-kit/dist/tokenizer-ui-kit.css";
|
|
105
|
+
|
|
106
|
+
const selectedDate = ref(null);
|
|
107
|
+
</script>
|
|
108
|
+
|
|
109
|
+
<template>
|
|
110
|
+
<DatePicker v-model="selectedDate" />
|
|
111
|
+
<CButton color="green">Click me</CButton>
|
|
112
|
+
</template>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### Option 4: Using Nuxt plugins
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
// plugins/tokenizer-ui-kit.client.ts
|
|
119
|
+
export default defineNuxtPlugin(() => {
|
|
120
|
+
// Import CSS only on client side
|
|
121
|
+
import("tokenizer-ui-kit/dist/tokenizer-ui-kit.css");
|
|
122
|
+
});
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## ⚠️ Important Notes
|
|
126
|
+
|
|
127
|
+
- **CSS Styles**: Always import the CSS file for proper component styling
|
|
128
|
+
- **Date Picker**: Requires CSS for calendar popup to display correctly
|
|
129
|
+
- **TypeScript**: Full TypeScript support included
|
|
130
|
+
- **Nuxt**: Use `nuxt.config.ts` for global CSS import (recommended)
|
|
131
|
+
|
|
49
132
|
## 📚 Documentation
|
|
50
133
|
|
|
51
134
|
Each component comes with TypeScript support and comprehensive documentation.
|