@skygraph/vue 0.0.0-placeholder.0 → 0.5.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SkyGraph Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,12 +1,121 @@
1
1
  # @skygraph/vue
2
2
 
3
- > Placeholder package. **Do not install yet.**
3
+ Vue 3 adapter for [`@skygraph/core`](../core). MVP: 5 composables and 4 base
4
+ components built on top of the framework-agnostic engines, sharing the same
5
+ `.sg-*` CSS contract as `@skygraph/react` via `@skygraph/styles`.
4
6
 
5
- `@skygraph/vue` is the Vue 3 adapter for [SkyGraph](https://skygraph.ruslansinkevich.ru) — composables and components built on `@skygraph/core`.
7
+ ## Status
6
8
 
7
- This release is a name-reservation stub (`0.0.0-placeholder.0`, dist-tag `placeholder`). The first usable version will be published under the `latest` tag.
9
+ - 5 composables: `useForm`, `useField`, `useTable`, `useTree`, `useGraph`
10
+ - 4 components: `SgButton`, `SgInput`, `SgForm`, `SgField`
11
+ - Vue 3 only, Composition API only, `<script setup>` SFCs
12
+ - ~48 vitest tests via `@vue/test-utils` + `jsdom`
13
+ - Built with `vite` library mode + `vite-plugin-dts`
8
14
 
9
- - Live Vue demo: <https://skygraph.ruslansinkevich.ru/vue/>
10
- - Repository: <https://github.com/RuslanSinkevich/skygraph>
15
+ ## Install
11
16
 
12
- MIT © Ruslan Sinkevich
17
+ For most apps the easier path is the meta-package, which pulls in
18
+ `@skygraph/core` and `@skygraph/styles` transitively and auto-loads the
19
+ CSS:
20
+
21
+ ```bash
22
+ npm install skygraph-vue
23
+ ```
24
+
25
+ If you want fine-grained control over the install set, the adapter is
26
+ still published separately:
27
+
28
+ ```bash
29
+ pnpm add @skygraph/vue @skygraph/core @skygraph/styles vue
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ ```vue
35
+ <script setup lang="ts">
36
+ import { ref } from 'vue'
37
+ import { SgButton, SgInput, SgForm, SgField } from '@skygraph/vue'
38
+ import '@skygraph/styles'
39
+
40
+ const text = ref('')
41
+
42
+ function onSubmit(payload: {
43
+ values: Record<string, unknown>
44
+ valid: boolean
45
+ }) {
46
+ console.log(payload)
47
+ }
48
+ </script>
49
+
50
+ <template>
51
+ <SgInput v-model="text" placeholder="Type here…" />
52
+
53
+ <SgForm
54
+ :default-values="{ email: '' }"
55
+ @submit="onSubmit"
56
+ >
57
+ <SgField
58
+ name="email"
59
+ label="Email"
60
+ :rules="[{ required: true }, { type: 'email' }]"
61
+ v-slot="{ value, onChange, errors }"
62
+ >
63
+ <SgInput
64
+ :model-value="String(value ?? '')"
65
+ :status="errors.length ? 'error' : undefined"
66
+ @update:model-value="onChange"
67
+ />
68
+ </SgField>
69
+ <SgButton type="primary" html-type="submit">Submit</SgButton>
70
+ </SgForm>
71
+ </template>
72
+ ```
73
+
74
+ ## Mapping to `@skygraph/react`
75
+
76
+ | React | Vue |
77
+ | ------------------------- | ------------------------- |
78
+ | `useForm()` | `useForm()` |
79
+ | `useField(core, form, n)` | `useField(core, form, n)` |
80
+ | `useTable()` | `useTable()` |
81
+ | `useTree()` | `useTree()` |
82
+ | `useGraph()` | `useGraph()` |
83
+ | `<Button />` | `<SgButton />` |
84
+ | `<Input />` | `<SgInput v-model />` |
85
+ | `<Form />` | `<SgForm />` |
86
+ | `<Field />` | `<SgField v-slot />` |
87
+
88
+ The `Sg` prefix avoids clashing with the React names *and* with native HTML
89
+ elements / globally-registered Vue components (e.g. `Form`, `Input`).
90
+
91
+ CSS class names (`.sg-button`, `.sg-input`, `.sg-form`, `.sg-field`, …) are
92
+ **identical** between the React and Vue adapters — both consume the same
93
+ [`@skygraph/styles`](../styles) package, which is the single source of
94
+ truth for visual styling.
95
+
96
+ ## Scope of MVP
97
+
98
+ This package is a foundation, not a full port. It deliberately does not
99
+ yet ship Vue equivalents for:
100
+
101
+ - the other ~74 React components (Select, Table, Diagram, Charts, …)
102
+ - chart / dashboard / calendar / tree-view widgets
103
+ - per-component i18n
104
+ - per-component documentation pages
105
+
106
+ Those land in subsequent Vue streams.
107
+
108
+ ## Development
109
+
110
+ ```bash
111
+ pnpm install
112
+ pnpm --filter @skygraph/vue typecheck
113
+ pnpm --filter @skygraph/vue test
114
+ pnpm --filter @skygraph/vue build
115
+ ```
116
+
117
+ To explore a live demo:
118
+
119
+ ```bash
120
+ pnpm --filter demo-vue dev
121
+ ```