@vuetify/v0 0.0.2-beta.4 → 0.0.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 +252 -0
- package/dist/browser/index.js +3123 -0
- package/dist/components/{index.d.mts → index.d.ts} +7 -5
- package/dist/components/{index.mjs → index.js} +7 -5
- package/dist/{components-B5iiovK7.mjs → components-Cc48kKWf.js} +5 -33
- package/dist/composables/index.d.ts +7 -0
- package/dist/composables/index.js +8 -0
- package/dist/{composables-C6dl5kjP.mjs → composables-7Cbs2sdO.js} +395 -6
- package/dist/constants/index.d.ts +2 -0
- package/dist/constants/index.js +5 -0
- package/dist/constants-DiTCgvMU.js +1 -0
- package/dist/factories/index.d.ts +2 -0
- package/dist/factories/{index.mjs → index.js} +1 -2
- package/dist/globals--2b7sF4-.js +12 -0
- package/dist/htmlElements-SjqYu0am.js +78 -0
- package/dist/index-BnsMFYhs.d.ts +1407 -0
- package/dist/{index-D4Grk5x1.d.mts → index-BozA2pze.d.ts} +1 -1
- package/dist/{index-oCBJwhpG.d.mts → index-BqrLvboW.d.ts} +31 -13
- package/dist/index-z_zwVNP8.d.ts +79 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +11 -0
- package/dist/transformers/index.d.ts +2 -0
- package/dist/transformers/index.js +4 -0
- package/dist/{transformers-BTjuwbOV.mjs → transformers-BAeg3QJF.js} +1 -1
- package/dist/types/{index.d.mts → index.d.ts} +1 -1
- package/dist/types/index.js +1 -0
- package/dist/{useTheme-tY7MoBKr.mjs → useTheme-DSYiiz0R.js} +65 -19
- package/dist/utilities/{index.d.mts → index.d.ts} +2 -2
- package/dist/utilities/{index.mjs → index.js} +1 -1
- package/package.json +32 -21
- package/dist/composables/index.d.mts +0 -5
- package/dist/composables/index.mjs +0 -7
- package/dist/factories/index.d.mts +0 -3
- package/dist/factories-DOLmqhVS.mjs +0 -0
- package/dist/index-ChaaTPKp.d.mts +0 -421
- package/dist/index-Cya5Y9pB.d.mts +0 -412
- package/dist/index-DfahEz6s.d.mts +0 -18
- package/dist/index-jG0yrC1F.d.mts +0 -467
- package/dist/index.d.mts +0 -9
- package/dist/index.mjs +0 -9
- package/dist/transformers/index.d.mts +0 -2
- package/dist/transformers/index.mjs +0 -4
- package/dist/types/index.mjs +0 -0
- /package/dist/{createTrinity-CwGvQ2ng.mjs → factories-CPq2yMlr.js} +0 -0
- /package/dist/{index-BA3ZFBnL.d.mts → index-LBy5OPMu.d.ts} +0 -0
- /package/dist/{index-CZRh0I2w.d.mts → index-tUyghL98.d.ts} +0 -0
- /package/dist/{utilities-lZSfrXgw.mjs → utilities-D9rWEgQK.js} +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://vuetifyjs.b-cdn.net/docs/images/logos/vzero-logo-dark.png">
|
|
4
|
+
<img alt="Vuetify One Logo" src="https://vuetifyjs.b-cdn.net/docs/images/logos/vzero-logo-light.png" height="150">
|
|
5
|
+
</picture>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
# @vuetify/v0
|
|
9
|
+
|
|
10
|
+
Core foundational package from providing components and composables for building modern applications. `@vuetify/v0` is the foundational layer of the Vuetify ecosystem, offering lightweight, headless building blocks with TypeScript support and accessibility features built-in that serve as building blocks for higher-order UI libraries and custom design systems.
|
|
11
|
+
|
|
12
|
+
## 🚀 Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @vuetify/v0
|
|
16
|
+
# or
|
|
17
|
+
pnpm add @vuetify/v0
|
|
18
|
+
# or
|
|
19
|
+
yarn add @vuetify/v0
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 📦 What's Included
|
|
23
|
+
|
|
24
|
+
### Components
|
|
25
|
+
|
|
26
|
+
- **`Atom`** - Base element wrapper with renderless capabilities
|
|
27
|
+
- **`Breakpoints`** - Responsive breakpoint utilities
|
|
28
|
+
- **`Context`** - Context injection/provision system
|
|
29
|
+
- **`Group`** - Selection grouping with multiple/single modes
|
|
30
|
+
- **`Hydration`** - Client-side hydration utilities
|
|
31
|
+
- **`Popover`** - CSS anchor-positioned popup components
|
|
32
|
+
- **`Step`** - Step-based navigation system
|
|
33
|
+
- **`Theme`** - Theme management and CSS variable injection
|
|
34
|
+
|
|
35
|
+
### Composables
|
|
36
|
+
|
|
37
|
+
- **`useBreakpoints`** - Responsive breakpoint detection
|
|
38
|
+
- **`createContext`** - Type-safe context management
|
|
39
|
+
- **`useEventListener`** - Event listener utilities
|
|
40
|
+
- **`useFilter`** - Collection filtering utilities
|
|
41
|
+
- **`useForm`** - Form validation and management
|
|
42
|
+
- **`useGroup`** - Selection group management
|
|
43
|
+
- **`useHydration`** - SSR hydration helpers
|
|
44
|
+
- **`useIntersectionObserver`** - Intersection observer utilities
|
|
45
|
+
- **`useKeydown`** - Keyboard event handling
|
|
46
|
+
- **`useLayout`** - Layout management utilities
|
|
47
|
+
- **`useLocale`** - Internationalization support
|
|
48
|
+
- **`useLogger`** - Development logging utilities
|
|
49
|
+
- **`useMutationObserver`** - DOM mutation observation
|
|
50
|
+
- **`useProxyModel`** - Model proxy utilities
|
|
51
|
+
- **`useRegistry`** - Component registration system
|
|
52
|
+
- **`useResizeObserver`** - Resize observer utilities
|
|
53
|
+
- **`useSelection`** - Selection management
|
|
54
|
+
- **`useSingle`** - Single selection utilities
|
|
55
|
+
- **`useStep`** - Step navigation logic
|
|
56
|
+
- **`useStorage`** - Local/session storage utilities
|
|
57
|
+
- **`useTheme`** - Theme switching and CSS variable management
|
|
58
|
+
- **`useTokens`** - Design token system
|
|
59
|
+
|
|
60
|
+
### Factories
|
|
61
|
+
|
|
62
|
+
- **`createContext`** - Context factory with type safety
|
|
63
|
+
- **`createPlugin`** - Vue plugin factory
|
|
64
|
+
- **`createRootProvider`** - Root provider factory
|
|
65
|
+
- **`createTrinity`** - Trinity pattern factory
|
|
66
|
+
|
|
67
|
+
### Transformers
|
|
68
|
+
|
|
69
|
+
- **`toArray`** - Array transformation utilities
|
|
70
|
+
- **`toReactive`** - Reactive object conversion
|
|
71
|
+
|
|
72
|
+
### Utilities
|
|
73
|
+
|
|
74
|
+
- **Type guards** - `isString`, `isNumber`, `isObject`, etc.
|
|
75
|
+
- **Object utilities** - `mergeDeep`, `genId`
|
|
76
|
+
- **Performance utilities** - Benchmarking tools
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## 📖 Basic Usage
|
|
80
|
+
|
|
81
|
+
### Theme Setup
|
|
82
|
+
|
|
83
|
+
```vue
|
|
84
|
+
<script setup>
|
|
85
|
+
import { createThemePlugin } from '@vuetify/v0'
|
|
86
|
+
|
|
87
|
+
// Install theme plugin in your main.js
|
|
88
|
+
app.use(createThemePlugin({
|
|
89
|
+
default: 'light',
|
|
90
|
+
themes: {
|
|
91
|
+
light: {
|
|
92
|
+
colors: {
|
|
93
|
+
primary: '#1976d2',
|
|
94
|
+
secondary: '#424242',
|
|
95
|
+
background: '#ffffff'
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
dark: {
|
|
99
|
+
colors: {
|
|
100
|
+
primary: '#2196f3',
|
|
101
|
+
secondary: '#616161',
|
|
102
|
+
background: '#121212'
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}))
|
|
107
|
+
</script>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Using Components
|
|
111
|
+
|
|
112
|
+
```vue
|
|
113
|
+
<script setup>
|
|
114
|
+
import { Atom, Group, Step } from '@vuetify/v0'
|
|
115
|
+
import { ref } from 'vue'
|
|
116
|
+
|
|
117
|
+
const selectedItems = ref([])
|
|
118
|
+
const currentStep = ref(0)
|
|
119
|
+
</script>
|
|
120
|
+
|
|
121
|
+
<template>
|
|
122
|
+
<!-- Base Atom component -->
|
|
123
|
+
<Atom as="section" class="container">
|
|
124
|
+
<h1>My Application</h1>
|
|
125
|
+
</Atom>
|
|
126
|
+
|
|
127
|
+
<!-- Group selection -->
|
|
128
|
+
<Group v-model="selectedItems" multiple>
|
|
129
|
+
<template #default="{ select, isSelected }">
|
|
130
|
+
<button
|
|
131
|
+
v-for="item in items"
|
|
132
|
+
:key="item.id"
|
|
133
|
+
@click="select(item.id)"
|
|
134
|
+
:class="{ active: isSelected(item.id) }"
|
|
135
|
+
>
|
|
136
|
+
{{ item.name }}
|
|
137
|
+
</button>
|
|
138
|
+
</template>
|
|
139
|
+
</Group>
|
|
140
|
+
|
|
141
|
+
<!-- Step navigation -->
|
|
142
|
+
<Step v-model="currentStep" :max="3">
|
|
143
|
+
<template #default="{ step, next, prev, canNext, canPrev }">
|
|
144
|
+
<div class="step-content">
|
|
145
|
+
Step {{ step + 1 }} content
|
|
146
|
+
</div>
|
|
147
|
+
<div class="step-actions">
|
|
148
|
+
<button @click="prev" :disabled="!canPrev">Previous</button>
|
|
149
|
+
<button @click="next" :disabled="!canNext">Next</button>
|
|
150
|
+
</div>
|
|
151
|
+
</template>
|
|
152
|
+
</Step>
|
|
153
|
+
</template>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Using Composables
|
|
157
|
+
|
|
158
|
+
```vue
|
|
159
|
+
<script setup>
|
|
160
|
+
import { useBreakpoints, useTheme, useForm } from '@vuetify/v0'
|
|
161
|
+
import { ref } from 'vue'
|
|
162
|
+
|
|
163
|
+
// Responsive breakpoints
|
|
164
|
+
const { isMobile, mdAndUp } = useBreakpoints()
|
|
165
|
+
|
|
166
|
+
// Theme management
|
|
167
|
+
const { theme, setTheme, colors } = useTheme()
|
|
168
|
+
|
|
169
|
+
// Form management
|
|
170
|
+
const { register, validate, errors } = useForm({
|
|
171
|
+
validateOn: 'change'
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
const email = ref('')
|
|
175
|
+
const password = ref('')
|
|
176
|
+
|
|
177
|
+
// Register form fields
|
|
178
|
+
register('email', email, [
|
|
179
|
+
(value) => !!value || 'Email is required',
|
|
180
|
+
(value) => /.+@.+\..+/.test(value) || 'Email must be valid'
|
|
181
|
+
])
|
|
182
|
+
|
|
183
|
+
register('password', password, [
|
|
184
|
+
(value) => !!value || 'Password is required',
|
|
185
|
+
(value) => value.length >= 8 || 'Password must be at least 8 characters'
|
|
186
|
+
])
|
|
187
|
+
|
|
188
|
+
const handleSubmit = async () => {
|
|
189
|
+
const isValid = await validate()
|
|
190
|
+
if (isValid) {
|
|
191
|
+
// Submit form
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
</script>
|
|
195
|
+
|
|
196
|
+
<template>
|
|
197
|
+
<div :class="{ mobile: isMobile, desktop: mdAndUp }">
|
|
198
|
+
<button @click="setTheme(theme === 'light' ? 'dark' : 'light')">
|
|
199
|
+
Toggle Theme ({{ theme }})
|
|
200
|
+
</button>
|
|
201
|
+
|
|
202
|
+
<form @submit.prevent="handleSubmit">
|
|
203
|
+
<input
|
|
204
|
+
v-model="email"
|
|
205
|
+
type="email"
|
|
206
|
+
placeholder="Email"
|
|
207
|
+
:style="{ borderColor: colors.primary }"
|
|
208
|
+
/>
|
|
209
|
+
<div v-if="errors.email" class="error">{{ errors.email[0] }}</div>
|
|
210
|
+
|
|
211
|
+
<input
|
|
212
|
+
v-model="password"
|
|
213
|
+
type="password"
|
|
214
|
+
placeholder="Password"
|
|
215
|
+
/>
|
|
216
|
+
<div v-if="errors.password" class="error">{{ errors.password[0] }}</div>
|
|
217
|
+
|
|
218
|
+
<button type="submit">Submit</button>
|
|
219
|
+
</form>
|
|
220
|
+
</div>
|
|
221
|
+
</template>
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
## 🏗️ Design Principles
|
|
225
|
+
|
|
226
|
+
- **Headless First**: Components provide logic and accessibility without imposed styling
|
|
227
|
+
- **Slot-Driven**: Maximum flexibility through comprehensive slot APIs
|
|
228
|
+
- **CSS Variables**: All styling configurable via CSS custom properties
|
|
229
|
+
- **TypeScript Native**: Full type safety with excellent developer experience
|
|
230
|
+
- **Minimal Dependencies**: Lightweight with only essential peer dependencies
|
|
231
|
+
- **Composable Architecture**: Reusable logic through Vue 3 composables
|
|
232
|
+
|
|
233
|
+
## 📚 API Reference
|
|
234
|
+
|
|
235
|
+
For detailed API documentation, type definitions, and examples, visit our [documentation site](https://0.vuetifyjs.com) or explore the TypeScript definitions included in this package.
|
|
236
|
+
|
|
237
|
+
## 🔗 Related Packages
|
|
238
|
+
|
|
239
|
+
- **[@vuetify/paper](https://npmjs.com/package/@vuetify/paper)** - Styling and layout primitives
|
|
240
|
+
- **[Vuetify 3](https://vuetifyjs.com)** - Full-featured Material Design component library
|
|
241
|
+
|
|
242
|
+
## 🤝 Contributing
|
|
243
|
+
|
|
244
|
+
Contributions are welcome! Please read our contributing guidelines and ensure all tests pass before submitting a pull request.
|
|
245
|
+
|
|
246
|
+
## 📄 License
|
|
247
|
+
|
|
248
|
+
MIT License
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
Built with ❤️ for the Vue ecosystem. Part of the Vuetify family.
|