cisse-vue-ui 0.1.0 → 0.1.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 +435 -6
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang-DQD2I1Wk.cjs +621 -0
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang-DQD2I1Wk.cjs.map +1 -0
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang-DVkcMcSN.js +622 -0
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang-DVkcMcSN.js.map +1 -0
- package/dist/CollapsibleCard.vue_vue_type_script_setup_true_lang-D2MeLTRV.cjs +1133 -0
- package/dist/CollapsibleCard.vue_vue_type_script_setup_true_lang-D2MeLTRV.cjs.map +1 -0
- package/dist/CollapsibleCard.vue_vue_type_script_setup_true_lang-Ixih38V0.js +1134 -0
- package/dist/CollapsibleCard.vue_vue_type_script_setup_true_lang-Ixih38V0.js.map +1 -0
- package/dist/{NotificationList.vue_vue_type_script_setup_true_lang-B2hjbMm4.js → EmptyState.vue_vue_type_script_setup_true_lang-CrVvFwXA.js} +163 -44
- package/dist/EmptyState.vue_vue_type_script_setup_true_lang-CrVvFwXA.js.map +1 -0
- package/dist/{NotificationList.vue_vue_type_script_setup_true_lang-Ci3zIvrv.cjs → EmptyState.vue_vue_type_script_setup_true_lang-mlqLBP5W.cjs} +163 -44
- package/dist/EmptyState.vue_vue_type_script_setup_true_lang-mlqLBP5W.cjs.map +1 -0
- package/dist/MenuItem.vue_vue_type_script_setup_true_lang-BWz86k7c.cjs +86 -0
- package/dist/MenuItem.vue_vue_type_script_setup_true_lang-BWz86k7c.cjs.map +1 -0
- package/dist/MenuItem.vue_vue_type_script_setup_true_lang-emN2qlfR.js +87 -0
- package/dist/MenuItem.vue_vue_type_script_setup_true_lang-emN2qlfR.js.map +1 -0
- package/dist/PageLayout.vue_vue_type_script_setup_true_lang-DTlUENg3.js +265 -0
- package/dist/PageLayout.vue_vue_type_script_setup_true_lang-DTlUENg3.js.map +1 -0
- package/dist/PageLayout.vue_vue_type_script_setup_true_lang-IcouTz4C.cjs +264 -0
- package/dist/PageLayout.vue_vue_type_script_setup_true_lang-IcouTz4C.cjs.map +1 -0
- package/dist/components/core/AutocompleteComponent.vue.d.ts +7 -1
- package/dist/components/core/Avatar.vue.d.ts +20 -0
- package/dist/components/core/Button.vue.d.ts +49 -0
- package/dist/components/core/CollapsibleCard.vue.d.ts +28 -0
- package/dist/components/core/Dropdown.vue.d.ts +52 -0
- package/dist/components/core/MenuItem.vue.d.ts +11 -1
- package/dist/components/core/Stepper.vue.d.ts +22 -0
- package/dist/components/core/TabPanel.vue.d.ts +21 -0
- package/dist/components/core/Tabs.vue.d.ts +39 -0
- package/dist/components/core/index.cjs +14 -6
- package/dist/components/core/index.cjs.map +1 -1
- package/dist/components/core/index.d.ts +12 -0
- package/dist/components/core/index.js +14 -6
- package/dist/components/core/index.js.map +1 -1
- package/dist/components/feedback/Alert.vue.d.ts +34 -0
- package/dist/components/feedback/EmptyState.vue.d.ts +29 -0
- package/dist/components/feedback/index.cjs +8 -6
- package/dist/components/feedback/index.cjs.map +1 -1
- package/dist/components/feedback/index.d.ts +3 -0
- package/dist/components/feedback/index.js +3 -1
- package/dist/components/form/Checkbox.vue.d.ts +20 -0
- package/dist/components/form/FormSelect.vue.d.ts +35 -6
- package/dist/components/form/Switch.vue.d.ts +21 -0
- package/dist/components/form/index.cjs +9 -7
- package/dist/components/form/index.cjs.map +1 -1
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +4 -2
- package/dist/components/index.cjs +34 -19
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +26 -11
- package/dist/components/index.js.map +1 -1
- package/dist/components/layout/BaseLayout.vue.d.ts +58 -0
- package/dist/components/layout/PageLayout.vue.d.ts +37 -0
- package/dist/components/layout/index.cjs +6 -0
- package/dist/components/layout/index.cjs.map +1 -0
- package/dist/components/layout/index.d.ts +3 -0
- package/dist/components/layout/index.js +6 -0
- package/dist/components/layout/index.js.map +1 -0
- package/dist/index-Bt9enqyq.cjs +47 -0
- package/dist/index-Bt9enqyq.cjs.map +1 -0
- package/dist/index-CxPY8Qb7.js +48 -0
- package/dist/index-CxPY8Qb7.js.map +1 -0
- package/dist/index.cjs +35 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +29 -14
- package/dist/index.js.map +1 -1
- package/dist/style.css +2 -0
- package/dist/types/components.d.ts +7 -0
- package/package.json +12 -3
- package/dist/NotificationList.vue_vue_type_script_setup_true_lang-B2hjbMm4.js.map +0 -1
- package/dist/NotificationList.vue_vue_type_script_setup_true_lang-Ci3zIvrv.cjs.map +0 -1
- package/dist/SearchInput.vue_vue_type_script_setup_true_lang-Be73hShP.cjs +0 -234
- package/dist/SearchInput.vue_vue_type_script_setup_true_lang-Be73hShP.cjs.map +0 -1
- package/dist/SearchInput.vue_vue_type_script_setup_true_lang-DjT2qdcp.js +0 -235
- package/dist/SearchInput.vue_vue_type_script_setup_true_lang-DjT2qdcp.js.map +0 -1
- package/dist/TableAction.vue_vue_type_script_setup_true_lang-BHskhVhK.js +0 -540
- package/dist/TableAction.vue_vue_type_script_setup_true_lang-BHskhVhK.js.map +0 -1
- package/dist/TableAction.vue_vue_type_script_setup_true_lang-CojbKn7E.cjs +0 -539
- package/dist/TableAction.vue_vue_type_script_setup_true_lang-CojbKn7E.cjs.map +0 -1
- package/dist/index-BoCtJCg0.cjs +0 -32
- package/dist/index-BoCtJCg0.cjs.map +0 -1
- package/dist/index-CGhDI10m.js +0 -33
- package/dist/index-CGhDI10m.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,15 +1,444 @@
|
|
|
1
|
-
# vue-
|
|
1
|
+
# cisse-vue-ui
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A Vue 3 component library built with TypeScript and Tailwind CSS v4.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
4
6
|
|
|
5
7
|
```bash
|
|
6
|
-
|
|
8
|
+
npm install cisse-vue-ui
|
|
9
|
+
# or
|
|
10
|
+
bun add cisse-vue-ui
|
|
7
11
|
```
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
### Peer Dependencies
|
|
10
14
|
|
|
11
15
|
```bash
|
|
12
|
-
|
|
16
|
+
npm install vue@^3.4 tailwindcss@^4 @iconify/vue@^4
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Setup
|
|
20
|
+
|
|
21
|
+
### 1. Import Styles
|
|
22
|
+
|
|
23
|
+
Add the pre-compiled CSS to your main CSS file:
|
|
24
|
+
|
|
25
|
+
```css
|
|
26
|
+
@import 'cisse-vue-ui/style.css';
|
|
27
|
+
@import 'tailwindcss';
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 2. Configure Primary Color (Optional)
|
|
31
|
+
|
|
32
|
+
Override the default primary color in your CSS:
|
|
33
|
+
|
|
34
|
+
```css
|
|
35
|
+
@theme {
|
|
36
|
+
--color-primary-50: oklch(97% 0.02 142);
|
|
37
|
+
--color-primary-100: oklch(94% 0.05 142);
|
|
38
|
+
--color-primary-200: oklch(88% 0.10 142);
|
|
39
|
+
--color-primary-300: oklch(78% 0.15 142);
|
|
40
|
+
--color-primary-400: oklch(65% 0.20 142);
|
|
41
|
+
--color-primary-500: oklch(55% 0.22 142);
|
|
42
|
+
--color-primary-600: oklch(48% 0.20 142);
|
|
43
|
+
--color-primary-700: oklch(40% 0.17 142);
|
|
44
|
+
--color-primary-800: oklch(32% 0.14 142);
|
|
45
|
+
--color-primary-900: oklch(25% 0.10 142);
|
|
46
|
+
--color-primary-950: oklch(18% 0.08 142);
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Usage
|
|
51
|
+
|
|
52
|
+
### Tree-Shaken Imports (Recommended)
|
|
53
|
+
|
|
54
|
+
```vue
|
|
55
|
+
<script setup lang="ts">
|
|
56
|
+
import { Button, CardComponent, FormInput } from 'cisse-vue-ui'
|
|
57
|
+
</script>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Category Imports
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import { Button, Tabs, TabPanel } from 'cisse-vue-ui/components/core'
|
|
64
|
+
import { FormInput, FormSelect, Switch } from 'cisse-vue-ui/components/form'
|
|
65
|
+
import { Modal, Alert, LoadingSpinner } from 'cisse-vue-ui/components/feedback'
|
|
66
|
+
import { BaseLayout, PageLayout } from 'cisse-vue-ui/components/layout'
|
|
13
67
|
```
|
|
14
68
|
|
|
15
|
-
|
|
69
|
+
### Global Registration (Vue Plugin)
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
import { createApp } from 'vue'
|
|
73
|
+
import { VueTailwindUI } from 'cisse-vue-ui'
|
|
74
|
+
|
|
75
|
+
const app = createApp(App)
|
|
76
|
+
|
|
77
|
+
// Register all components
|
|
78
|
+
app.use(VueTailwindUI)
|
|
79
|
+
|
|
80
|
+
// Or with a prefix
|
|
81
|
+
app.use(VueTailwindUI, { prefix: 'Ui' }) // <UiButton>, <UiCard>, etc.
|
|
82
|
+
|
|
83
|
+
// Or specific components only
|
|
84
|
+
app.use(VueTailwindUI, { components: ['Button', 'CardComponent'] })
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Components
|
|
88
|
+
|
|
89
|
+
### Core
|
|
90
|
+
|
|
91
|
+
| Component | Description |
|
|
92
|
+
|-----------|-------------|
|
|
93
|
+
| `Button` | Button with variants (primary, secondary, outline, ghost, danger, success), sizes, icons, loading state |
|
|
94
|
+
| `CardComponent` | Card container with header, content, and footer slots |
|
|
95
|
+
| `TableComponent` | Data table with sorting, actions, and custom column rendering |
|
|
96
|
+
| `Tabs` | Tab navigation with variants (underline, pills, boxed) |
|
|
97
|
+
| `TabPanel` | Tab content panel (use with Tabs) |
|
|
98
|
+
| `Dropdown` | Dropdown menu with items, icons, and dividers |
|
|
99
|
+
| `Avatar` | User avatar with image, initials, or icon fallback |
|
|
100
|
+
| `AutocompleteComponent` | Searchable select with keyboard navigation |
|
|
101
|
+
| `MenuItem` | Navigation menu item with icon, active state detection, and route support |
|
|
102
|
+
| `StatusBadge` | Colored status indicator badge |
|
|
103
|
+
| `TableAction` | Icon button for table row actions |
|
|
104
|
+
| `Stepper` | Multi-step progress indicator with horizontal/vertical orientation |
|
|
105
|
+
| `CollapsibleCard` | Card that can expand/collapse its content |
|
|
106
|
+
|
|
107
|
+
### Form
|
|
108
|
+
|
|
109
|
+
| Component | Description |
|
|
110
|
+
|-----------|-------------|
|
|
111
|
+
| `FormInput` | Text input with label, validation, and icons |
|
|
112
|
+
| `FormSelect` | Select dropdown with label and validation |
|
|
113
|
+
| `FormGroup` | Form field wrapper with label and help text |
|
|
114
|
+
| `FormLabel` | Styled form label |
|
|
115
|
+
| `FormHelp` | Help text for form fields |
|
|
116
|
+
| `SearchInput` | Search input with icon and clear button |
|
|
117
|
+
| `Switch` | Toggle switch with label and description |
|
|
118
|
+
| `Checkbox` | Checkbox with label and description |
|
|
119
|
+
|
|
120
|
+
### Feedback
|
|
121
|
+
|
|
122
|
+
| Component | Description |
|
|
123
|
+
|-----------|-------------|
|
|
124
|
+
| `Modal` | Modal dialog with header, body, footer slots |
|
|
125
|
+
| `Alert` | Alert banner with variants (info, success, warning, error) |
|
|
126
|
+
| `LoadingSpinner` | Loading indicator with size variants |
|
|
127
|
+
| `PaginationControls` | Pagination with page numbers and navigation |
|
|
128
|
+
| `NotificationList` | Toast notification container |
|
|
129
|
+
| `NotificationComponent` | Individual toast notification |
|
|
130
|
+
| `EmptyState` | Placeholder for empty content with icon and action slot |
|
|
131
|
+
|
|
132
|
+
### Layout
|
|
133
|
+
|
|
134
|
+
| Component | Description |
|
|
135
|
+
|-----------|-------------|
|
|
136
|
+
| `BaseLayout` | App shell with sidebar, header, main content area, and route-aware menu |
|
|
137
|
+
| `PageLayout` | Page wrapper with breadcrumbs |
|
|
138
|
+
|
|
139
|
+
### Type Display
|
|
140
|
+
|
|
141
|
+
| Component | Description |
|
|
142
|
+
|-----------|-------------|
|
|
143
|
+
| `TextType` | Text value display |
|
|
144
|
+
| `NumberType` | Formatted number display |
|
|
145
|
+
| `DateType` | Formatted date display |
|
|
146
|
+
| `BooleanType` | Boolean value display (check/cross icons) |
|
|
147
|
+
| `BadgeType` | Badge value display with colors |
|
|
148
|
+
|
|
149
|
+
## Composables
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
import { useNotifications, useDarkMode, useExportCSV } from 'cisse-vue-ui/composables'
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### useNotifications
|
|
156
|
+
|
|
157
|
+
```typescript
|
|
158
|
+
const { notifications, addNotification, removeNotification } = useNotifications()
|
|
159
|
+
|
|
160
|
+
addNotification({
|
|
161
|
+
type: 'success',
|
|
162
|
+
title: 'Saved',
|
|
163
|
+
message: 'Your changes have been saved.'
|
|
164
|
+
})
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### useDarkMode
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
const { isDark, toggle, enable, disable } = useDarkMode({
|
|
171
|
+
selector: 'html', // Element to add .dark class
|
|
172
|
+
storageKey: 'theme', // localStorage key
|
|
173
|
+
defaultDark: false // Default state
|
|
174
|
+
})
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### useExportCSV
|
|
178
|
+
|
|
179
|
+
```typescript
|
|
180
|
+
const { exportToCSV } = useExportCSV()
|
|
181
|
+
|
|
182
|
+
exportToCSV(data, columns, 'export.csv')
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Types
|
|
186
|
+
|
|
187
|
+
```typescript
|
|
188
|
+
import type { Property, Notification, Breadcrumb } from 'cisse-vue-ui/types'
|
|
189
|
+
|
|
190
|
+
// Table column definition
|
|
191
|
+
const columns: Property[] = [
|
|
192
|
+
{ key: 'name', label: 'Name', sortable: true },
|
|
193
|
+
{ key: 'email', label: 'Email' },
|
|
194
|
+
{ key: 'status', label: 'Status', type: 'badge' }
|
|
195
|
+
]
|
|
196
|
+
|
|
197
|
+
// Breadcrumb navigation
|
|
198
|
+
const breadcrumbs: Breadcrumb[] = [
|
|
199
|
+
{ label: 'Home', to: '/' },
|
|
200
|
+
{ label: 'Users', to: '/users' },
|
|
201
|
+
{ label: 'Edit' }
|
|
202
|
+
]
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Component Examples
|
|
206
|
+
|
|
207
|
+
### Button
|
|
208
|
+
|
|
209
|
+
```vue
|
|
210
|
+
<Button variant="primary" size="md" :loading="isLoading">
|
|
211
|
+
Save Changes
|
|
212
|
+
</Button>
|
|
213
|
+
|
|
214
|
+
<Button variant="outline" icon="lucide:plus">
|
|
215
|
+
Add Item
|
|
216
|
+
</Button>
|
|
217
|
+
|
|
218
|
+
<Button variant="danger" icon="lucide:trash">
|
|
219
|
+
Delete
|
|
220
|
+
</Button>
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Tabs
|
|
224
|
+
|
|
225
|
+
```vue
|
|
226
|
+
<script setup>
|
|
227
|
+
import { ref } from 'vue'
|
|
228
|
+
import { Tabs, TabPanel } from 'cisse-vue-ui'
|
|
229
|
+
|
|
230
|
+
const activeTab = ref('profile')
|
|
231
|
+
const tabs = [
|
|
232
|
+
{ key: 'profile', label: 'Profile' },
|
|
233
|
+
{ key: 'settings', label: 'Settings' },
|
|
234
|
+
{ key: 'notifications', label: 'Notifications' }
|
|
235
|
+
]
|
|
236
|
+
</script>
|
|
237
|
+
|
|
238
|
+
<template>
|
|
239
|
+
<Tabs v-model="activeTab" :tabs="tabs" variant="underline">
|
|
240
|
+
<TabPanel value="profile">Profile content</TabPanel>
|
|
241
|
+
<TabPanel value="settings">Settings content</TabPanel>
|
|
242
|
+
<TabPanel value="notifications">Notifications content</TabPanel>
|
|
243
|
+
</Tabs>
|
|
244
|
+
</template>
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Switch
|
|
248
|
+
|
|
249
|
+
```vue
|
|
250
|
+
<Switch
|
|
251
|
+
v-model="emailNotifications"
|
|
252
|
+
label="Email notifications"
|
|
253
|
+
description="Receive email updates about your account"
|
|
254
|
+
/>
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### Alert
|
|
258
|
+
|
|
259
|
+
```vue
|
|
260
|
+
<Alert variant="success" title="Success!" dismissible>
|
|
261
|
+
Your changes have been saved successfully.
|
|
262
|
+
</Alert>
|
|
263
|
+
|
|
264
|
+
<Alert variant="error" title="Error">
|
|
265
|
+
Something went wrong. Please try again.
|
|
266
|
+
</Alert>
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
### Dropdown
|
|
270
|
+
|
|
271
|
+
```vue
|
|
272
|
+
<script setup>
|
|
273
|
+
import { Dropdown } from 'cisse-vue-ui'
|
|
274
|
+
|
|
275
|
+
const items = [
|
|
276
|
+
{ key: 'edit', label: 'Edit', icon: 'lucide:edit' },
|
|
277
|
+
{ key: 'duplicate', label: 'Duplicate', icon: 'lucide:copy' },
|
|
278
|
+
{ key: 'divider', divider: true },
|
|
279
|
+
{ key: 'delete', label: 'Delete', icon: 'lucide:trash', danger: true }
|
|
280
|
+
]
|
|
281
|
+
|
|
282
|
+
const handleSelect = (item) => {
|
|
283
|
+
console.log('Selected:', item.key)
|
|
284
|
+
}
|
|
285
|
+
</script>
|
|
286
|
+
|
|
287
|
+
<template>
|
|
288
|
+
<Dropdown :items="items" @select="handleSelect">
|
|
289
|
+
<template #trigger-label>Actions</template>
|
|
290
|
+
</Dropdown>
|
|
291
|
+
</template>
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### Stepper
|
|
295
|
+
|
|
296
|
+
```vue
|
|
297
|
+
<script setup>
|
|
298
|
+
import { ref } from 'vue'
|
|
299
|
+
import { Stepper } from 'cisse-vue-ui'
|
|
300
|
+
|
|
301
|
+
const currentStep = ref('step2')
|
|
302
|
+
const steps = [
|
|
303
|
+
{ key: 'step1', title: 'Account', description: 'Create account', icon: 'lucide:user' },
|
|
304
|
+
{ key: 'step2', title: 'Profile', description: 'Set up profile', icon: 'lucide:settings' },
|
|
305
|
+
{ key: 'step3', title: 'Complete', description: 'Ready to go!', icon: 'lucide:check' }
|
|
306
|
+
]
|
|
307
|
+
</script>
|
|
308
|
+
|
|
309
|
+
<template>
|
|
310
|
+
<Stepper v-model="currentStep" :steps="steps" />
|
|
311
|
+
</template>
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
### EmptyState
|
|
315
|
+
|
|
316
|
+
```vue
|
|
317
|
+
<EmptyState
|
|
318
|
+
title="No results found"
|
|
319
|
+
message="Try adjusting your search or filters"
|
|
320
|
+
icon="lucide:search-x"
|
|
321
|
+
>
|
|
322
|
+
<template #action>
|
|
323
|
+
<Button variant="primary" size="sm">Clear filters</Button>
|
|
324
|
+
</template>
|
|
325
|
+
</EmptyState>
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### Checkbox
|
|
329
|
+
|
|
330
|
+
```vue
|
|
331
|
+
<Checkbox
|
|
332
|
+
v-model="accepted"
|
|
333
|
+
label="Accept terms"
|
|
334
|
+
description="I agree to the terms and conditions"
|
|
335
|
+
/>
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
### TableComponent
|
|
339
|
+
|
|
340
|
+
```vue
|
|
341
|
+
<script setup>
|
|
342
|
+
import { TableComponent } from 'cisse-vue-ui'
|
|
343
|
+
|
|
344
|
+
const properties = [
|
|
345
|
+
{ key: 'name', label: 'Name', sortable: true },
|
|
346
|
+
{ key: 'email', label: 'Email' },
|
|
347
|
+
{ key: 'role', label: 'Role', type: 'badge' }
|
|
348
|
+
]
|
|
349
|
+
|
|
350
|
+
const data = [
|
|
351
|
+
{ id: 1, name: 'John Doe', email: 'john@example.com', role: 'Admin' },
|
|
352
|
+
{ id: 2, name: 'Jane Smith', email: 'jane@example.com', role: 'User' }
|
|
353
|
+
]
|
|
354
|
+
</script>
|
|
355
|
+
|
|
356
|
+
<template>
|
|
357
|
+
<TableComponent
|
|
358
|
+
:properties="properties"
|
|
359
|
+
:data="data"
|
|
360
|
+
:loading="false"
|
|
361
|
+
>
|
|
362
|
+
<template #actions="{ item }">
|
|
363
|
+
<TableAction icon="lucide:edit" @click="edit(item)" />
|
|
364
|
+
<TableAction icon="lucide:trash" variant="danger" @click="delete(item)" />
|
|
365
|
+
</template>
|
|
366
|
+
</TableComponent>
|
|
367
|
+
</template>
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
### MenuItem
|
|
371
|
+
|
|
372
|
+
```vue
|
|
373
|
+
<script setup>
|
|
374
|
+
import { useRoute } from 'vue-router'
|
|
375
|
+
import { MenuItem } from 'cisse-vue-ui'
|
|
376
|
+
|
|
377
|
+
const route = useRoute()
|
|
378
|
+
|
|
379
|
+
const menuItem = {
|
|
380
|
+
label: 'Dashboard',
|
|
381
|
+
link: '/dashboard',
|
|
382
|
+
icon: 'lucide:layout-dashboard'
|
|
383
|
+
}
|
|
384
|
+
</script>
|
|
385
|
+
|
|
386
|
+
<template>
|
|
387
|
+
<!-- Auto-detect active state from current route -->
|
|
388
|
+
<MenuItem :menu-item="menuItem" :current-path="route.path" />
|
|
389
|
+
|
|
390
|
+
<!-- Or manually control active state -->
|
|
391
|
+
<MenuItem :menu-item="menuItem" :active="true" />
|
|
392
|
+
</template>
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### BaseLayout
|
|
396
|
+
|
|
397
|
+
```vue
|
|
398
|
+
<script setup>
|
|
399
|
+
import { useRoute } from 'vue-router'
|
|
400
|
+
import { BaseLayout } from 'cisse-vue-ui'
|
|
401
|
+
|
|
402
|
+
const route = useRoute()
|
|
403
|
+
|
|
404
|
+
const menuItems = [
|
|
405
|
+
{ label: 'Dashboard', link: '/', icon: 'lucide:home' },
|
|
406
|
+
{ label: 'Users', link: '/users', icon: 'lucide:users' },
|
|
407
|
+
{ label: 'Settings', link: '/settings', icon: 'lucide:settings' }
|
|
408
|
+
]
|
|
409
|
+
</script>
|
|
410
|
+
|
|
411
|
+
<template>
|
|
412
|
+
<BaseLayout
|
|
413
|
+
:menu-items="menuItems"
|
|
414
|
+
:current-path="route.path"
|
|
415
|
+
:show-dark-toggle="true"
|
|
416
|
+
>
|
|
417
|
+
<template #logo>
|
|
418
|
+
<img src="/logo.svg" alt="Logo" class="h-8" />
|
|
419
|
+
</template>
|
|
420
|
+
|
|
421
|
+
<RouterView />
|
|
422
|
+
</BaseLayout>
|
|
423
|
+
</template>
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
## Dark Mode
|
|
427
|
+
|
|
428
|
+
Components support dark mode via the `.dark` class on a parent element:
|
|
429
|
+
|
|
430
|
+
```html
|
|
431
|
+
<html class="dark">
|
|
432
|
+
<!-- Components will use dark theme -->
|
|
433
|
+
</html>
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
Use the `useDarkMode` composable or implement your own toggle:
|
|
437
|
+
|
|
438
|
+
```typescript
|
|
439
|
+
const { isDark, toggle } = useDarkMode()
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
## License
|
|
443
|
+
|
|
444
|
+
MIT
|