@pgcorp/ui-kit 0.1.0 → 0.1.1
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 +198 -87
- package/docs/security.md +10 -6
- package/package.json +11 -5
package/README.md
CHANGED
|
@@ -1,33 +1,27 @@
|
|
|
1
1
|
# @pgcorp/ui-kit
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[](https://vuejs.org/)
|
|
6
|
-
[](./LICENSE)
|
|
3
|
+
**Типизированная дизайн-система PGCorp для Vue 3: от базовых controls до
|
|
4
|
+
полноценных workbench-интерфейсов.**
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
**A typed PGCorp design system for Vue 3, spanning foundational controls and
|
|
7
|
+
complete workbench interfaces.**
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
design tokens, themes, accessibility contracts, and reusable complex UI patterns.
|
|
9
|
+
`Vue 3` · `TypeScript` · `118 exact exports` · `6 themes` · `MIT`
|
|
13
10
|
|
|
14
|
-
##
|
|
11
|
+
## Что входит / What is included
|
|
15
12
|
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
- Controls, navigation, data display, overlays, workbench layouts, editors, and graphs.
|
|
29
|
-
- Keyboard, focus, ARIA, disabled, loading, and error states.
|
|
30
|
-
- Executable unit, Storybook, browser, accessibility, and visual contracts.
|
|
13
|
+
- Vue Single-File Components с типизированными props, slots, events и exposed methods.
|
|
14
|
+
Vue Single-File Components with typed props, slots, events, and exposed methods.
|
|
15
|
+
- Controls, navigation, containers, data display, overlays и layout-примитивы.
|
|
16
|
+
Controls, navigation, containers, data display, overlays, and layout primitives.
|
|
17
|
+
- Таблицы, деревья, редакторы, graph surfaces и составные workbench-компоненты.
|
|
18
|
+
Tables, trees, editors, graph surfaces, and composed workbench components.
|
|
19
|
+
- Semantic CSS tokens и шесть светлых и тёмных тем.
|
|
20
|
+
Semantic CSS tokens and six light and dark themes.
|
|
21
|
+
- Контракты keyboard navigation, focus, ARIA, loading, disabled, invalid и error states.
|
|
22
|
+
Contracts for keyboard navigation, focus, ARIA, loading, disabled, invalid, and error states.
|
|
23
|
+
- Только явные package exports: wildcard и private source imports отсутствуют.
|
|
24
|
+
Explicit package exports only, with no wildcards or private source imports.
|
|
31
25
|
|
|
32
26
|
## Установка / Installation
|
|
33
27
|
|
|
@@ -35,123 +29,240 @@ design tokens, themes, accessibility contracts, and reusable complex UI patterns
|
|
|
35
29
|
npm install @pgcorp/ui-kit vue pinia vue-router
|
|
36
30
|
```
|
|
37
31
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
| Требование / Requirement | Версия / Version |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| Node.js | `>=20.19.0` |
|
|
35
|
+
| npm | `>=11.10.0 <12` |
|
|
36
|
+
| Vue | `^3.5.0` |
|
|
37
|
+
| Pinia | `^3.0.4` |
|
|
38
|
+
| Vue Router | `^5.0.0` |
|
|
39
|
+
| Build tool | Vite with Vue SFC support |
|
|
46
40
|
|
|
47
|
-
|
|
41
|
+
`vue`, `pinia` и `vue-router` являются peer dependencies. Consumer-приложение
|
|
42
|
+
владеет их единственными runtime-экземплярами.
|
|
48
43
|
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
- Vue `^3.5`;
|
|
52
|
-
- Pinia `^3.0`;
|
|
53
|
-
- Vue Router `^5.0`;
|
|
54
|
-
- a Vite-based Vue application.
|
|
44
|
+
`vue`, `pinia`, and `vue-router` are peer dependencies. The consumer application
|
|
45
|
+
owns their single runtime instances.
|
|
55
46
|
|
|
56
47
|
## Быстрый старт / Quick start
|
|
57
48
|
|
|
58
|
-
Подключите базовые стили
|
|
49
|
+
Подключите Pinia, router и базовые стили в entrypoint приложения:
|
|
59
50
|
|
|
60
|
-
|
|
51
|
+
Register Pinia, the router, and the base stylesheet in the application entrypoint:
|
|
61
52
|
|
|
62
53
|
```ts
|
|
54
|
+
import { createPinia } from 'pinia'
|
|
63
55
|
import { createApp } from 'vue'
|
|
64
56
|
import '@pgcorp/ui-kit/style.css'
|
|
65
57
|
|
|
66
58
|
import App from './App.vue'
|
|
59
|
+
import router from './router'
|
|
67
60
|
|
|
68
|
-
createApp(App)
|
|
61
|
+
createApp(App)
|
|
62
|
+
.use(createPinia())
|
|
63
|
+
.use(router)
|
|
64
|
+
.mount('#app')
|
|
69
65
|
```
|
|
70
66
|
|
|
71
|
-
Импортируйте
|
|
67
|
+
Импортируйте каждый компонент через точный публичный subpath:
|
|
72
68
|
|
|
73
|
-
Import
|
|
69
|
+
Import every component through its exact public subpath:
|
|
74
70
|
|
|
75
71
|
```vue
|
|
76
72
|
<script setup lang="ts">
|
|
77
|
-
import SButton from '@pgcorp/ui-kit/shared/controls/SButton.vue'
|
|
78
73
|
import SPanel from '@pgcorp/ui-kit/shared/containers/SPanel.vue'
|
|
74
|
+
import SButton from '@pgcorp/ui-kit/shared/controls/SButton.vue'
|
|
79
75
|
</script>
|
|
80
76
|
|
|
81
77
|
<template>
|
|
82
|
-
<SPanel
|
|
83
|
-
|
|
84
|
-
|
|
78
|
+
<SPanel
|
|
79
|
+
title="Профиль"
|
|
80
|
+
description="Настройки рабочей области"
|
|
81
|
+
:heading-level="2"
|
|
82
|
+
content-layout="stack"
|
|
83
|
+
content-gap="content"
|
|
84
|
+
>
|
|
85
|
+
<SButton variant="primary">
|
|
86
|
+
Сохранить
|
|
87
|
+
</SButton>
|
|
85
88
|
</SPanel>
|
|
86
89
|
</template>
|
|
87
90
|
```
|
|
88
91
|
|
|
89
|
-
|
|
92
|
+
Production build должен разрешать package exports напрямую, без alias на
|
|
93
|
+
исходный monorepo и без копирования файлов UI-kit.
|
|
94
|
+
|
|
95
|
+
The production build must resolve package exports directly, without a source
|
|
96
|
+
monorepo alias or copied UI-kit files.
|
|
97
|
+
|
|
98
|
+
## Карта компонентов / Component map
|
|
99
|
+
|
|
100
|
+
| Группа / Group | Назначение / Purpose | Примеры exports / Example exports |
|
|
101
|
+
| --- | --- | --- |
|
|
102
|
+
| Layout | App shell, dock regions, stacks, workbench layout | `layout/SAppShell.vue`, `layout/SStack.vue`, `layout/SWorkbenchLayout.vue` |
|
|
103
|
+
| Controls | Buttons, fields, inputs, selects, menus, selection | `shared/controls/SButton.vue`, `shared/controls/SInputText.vue`, `shared/controls/SSelect.vue` |
|
|
104
|
+
| Containers | Panels, modal, drawer, popover, sidebars | `shared/containers/SPanel.vue`, `shared/containers/SModal.vue`, `shared/containers/SPopover.vue` |
|
|
105
|
+
| Data display | Tables, status, progress, code, JSON, tooltips | `shared/data-display/STable.vue`, `shared/data-display/SCodeBlock.vue`, `shared/data-display/SStatus.vue` |
|
|
106
|
+
| Navigation | Tabs, breadcrumbs, catalog navigation, wizard | `shared/navigation/STabs.vue`, `shared/navigation/SBreadcrumbs.vue`, `shared/navigation/SWizardSteps.vue` |
|
|
107
|
+
| Complex surfaces | Tree, Kanban, data grid, SQL editor, graph | `shared/complex/STree.vue`, `shared/database/SDataGrid.vue`, `shared/graph/SGraphViewport.vue` |
|
|
108
|
+
| Runtime | Themes, variants, icons, composables, stores | `theme`, `variants`, `icons`, `composables/useNotifier`, `stores/useNotifierStore` |
|
|
109
|
+
|
|
110
|
+
Полный машинно-читаемый каталог находится в `package.json#exports`. IDE и
|
|
111
|
+
TypeScript показывают доступные subpaths при импорте.
|
|
112
|
+
|
|
113
|
+
The complete machine-readable catalog is declared in `package.json#exports`.
|
|
114
|
+
IDEs and TypeScript expose the available subpaths during import.
|
|
115
|
+
|
|
116
|
+
## Темы и стили / Themes and styles
|
|
90
117
|
|
|
91
|
-
|
|
92
|
-
интеграции доступен отдельный export:
|
|
118
|
+
Для обычного приложения подключайте полный style entrypoint один раз:
|
|
93
119
|
|
|
94
|
-
|
|
95
|
-
|
|
120
|
+
For a regular application, import the complete style entrypoint once:
|
|
121
|
+
|
|
122
|
+
```ts
|
|
123
|
+
import '@pgcorp/ui-kit/style.css'
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Для token-only интеграции доступен отдельный entrypoint:
|
|
127
|
+
|
|
128
|
+
A separate entrypoint is available for token-only integration:
|
|
96
129
|
|
|
97
130
|
```ts
|
|
98
131
|
import '@pgcorp/ui-kit/tokens.css'
|
|
99
132
|
```
|
|
100
133
|
|
|
101
|
-
|
|
102
|
-
|
|
134
|
+
Тема применяется через типизированный runtime API:
|
|
135
|
+
|
|
136
|
+
Apply a theme through the typed runtime API:
|
|
137
|
+
|
|
138
|
+
```ts
|
|
139
|
+
import { applyThemeIdToDocument } from '@pgcorp/ui-kit/theme'
|
|
140
|
+
|
|
141
|
+
applyThemeIdToDocument(document, 'classic-dark')
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Поддерживаемые идентификаторы:
|
|
145
|
+
|
|
146
|
+
Supported identifiers:
|
|
147
|
+
|
|
148
|
+
```ts
|
|
149
|
+
type ThemeId =
|
|
150
|
+
| 'classic-light'
|
|
151
|
+
| 'classic-dark'
|
|
152
|
+
| 'pink-light'
|
|
153
|
+
| 'pink-dark'
|
|
154
|
+
| 'green-light'
|
|
155
|
+
| 'green-dark'
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Компоненты используют semantic custom properties. Consumer переопределяет
|
|
159
|
+
документированные tokens на корневом theme-контейнере и не зависит от
|
|
160
|
+
внутренних CSS-классов или структуры template.
|
|
103
161
|
|
|
104
|
-
Components consume semantic
|
|
105
|
-
|
|
162
|
+
Components consume semantic custom properties. Consumers override documented
|
|
163
|
+
tokens on the root theme container and do not depend on internal CSS classes or
|
|
164
|
+
template structure.
|
|
106
165
|
|
|
107
|
-
|
|
166
|
+
## Публичный контракт / Public contract
|
|
108
167
|
|
|
109
|
-
|
|
168
|
+
`package.json#exports` — источник истины для импортов. Публичный контракт
|
|
169
|
+
компонента состоит из typed props, slots, events и exposed methods.
|
|
110
170
|
|
|
111
|
-
|
|
171
|
+
`package.json#exports` is the source of truth for imports. A component's public
|
|
172
|
+
contract consists of typed props, slots, events, and exposed methods.
|
|
112
173
|
|
|
113
|
-
|
|
174
|
+
Поддерживается:
|
|
114
175
|
|
|
115
|
-
|
|
176
|
+
Supported:
|
|
116
177
|
|
|
117
178
|
```ts
|
|
118
|
-
import
|
|
179
|
+
import SModal from '@pgcorp/ui-kit/shared/containers/SModal.vue'
|
|
180
|
+
import { useNotifier } from '@pgcorp/ui-kit/composables/useNotifier'
|
|
181
|
+
import { themeVariants } from '@pgcorp/ui-kit/theme'
|
|
119
182
|
```
|
|
120
183
|
|
|
121
|
-
|
|
122
|
-
|
|
184
|
+
- Не используйте wildcard imports и private source paths.
|
|
185
|
+
Do not use wildcard imports or private source paths.
|
|
186
|
+
- Не стилизуйте внутренний DOM через `:deep` и private selectors.
|
|
187
|
+
Do not style internal DOM through `:deep` or private selectors.
|
|
188
|
+
- Выражайте состояние через documented props, slots, variants и tokens.
|
|
189
|
+
Express state through documented props, slots, variants, and tokens.
|
|
190
|
+
- Передавайте человекочитаемые labels интерактивным компонентам.
|
|
191
|
+
Provide human-readable labels to interactive components.
|
|
192
|
+
|
|
193
|
+
## Доступность / Accessibility
|
|
194
|
+
|
|
195
|
+
Leaf-компоненты UI-kit владеют интерактивной семантикой:
|
|
196
|
+
|
|
197
|
+
UI-kit leaf components own interactive semantics:
|
|
198
|
+
|
|
199
|
+
- keyboard navigation и ожидаемые клавиши / keyboard navigation and expected keys;
|
|
200
|
+
- visible focus и focus restoration / visible focus and focus restoration;
|
|
201
|
+
- accessible names, roles и ARIA state / accessible names, roles, and ARIA state;
|
|
202
|
+
- disabled, loading, invalid и error states / disabled, loading, invalid, and error states;
|
|
203
|
+
- hitboxes и narrow-viewport behavior / hitboxes and narrow-viewport behavior.
|
|
204
|
+
|
|
205
|
+
Consumer передаёт содержательные labels и не заменяет семантику компонента
|
|
206
|
+
локальными DOM listeners или CSS.
|
|
123
207
|
|
|
124
|
-
|
|
125
|
-
|
|
208
|
+
Consumers provide meaningful labels and do not replace component semantics with
|
|
209
|
+
local DOM listeners or CSS.
|
|
126
210
|
|
|
127
|
-
|
|
211
|
+
## Версии / Versioning
|
|
128
212
|
|
|
129
|
-
|
|
213
|
+
Пакет следует Semantic Versioning:
|
|
130
214
|
|
|
131
|
-
|
|
215
|
+
The package follows Semantic Versioning:
|
|
132
216
|
|
|
133
|
-
-
|
|
134
|
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
138
|
-
|
|
139
|
-
- [Безопасность / Security](./docs/security.md)
|
|
217
|
+
- `patch` — исправление с сохранением документированного контракта;
|
|
218
|
+
a fix that preserves the documented contract;
|
|
219
|
+
- `minor` — обратно совместимое расширение public API;
|
|
220
|
+
a backward-compatible public API extension;
|
|
221
|
+
- `major` — несовместимое изменение exports, props, events, tokens или поведения;
|
|
222
|
+
an incompatible change to exports, props, events, tokens, or behavior.
|
|
140
223
|
|
|
141
|
-
|
|
224
|
+
Один и тот же номер версии не публикуется повторно.
|
|
142
225
|
|
|
143
|
-
|
|
144
|
-
[remand-gambol4g@icloud.com](mailto:remand-gambol4g@icloud.com).
|
|
145
|
-
Security reports отправляются по процессу из [Security](./docs/security.md).
|
|
226
|
+
A version number is never republished.
|
|
146
227
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
228
|
+
## Поддержка и безопасность / Support and security
|
|
229
|
+
|
|
230
|
+
Контакт сопровождения хранится в npm package metadata:
|
|
231
|
+
|
|
232
|
+
The maintainer contact is published in the npm package metadata:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
npm view @pgcorp/ui-kit bugs
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
Для дефекта укажите версию, affected subpath, воспроизводимый сценарий,
|
|
239
|
+
ожидаемое и фактическое поведение.
|
|
240
|
+
|
|
241
|
+
For a defect report, include the version, affected subpath, reproducible
|
|
242
|
+
scenario, expected behavior, and actual behavior.
|
|
243
|
+
|
|
244
|
+
Сведения об уязвимости не публикуются открыто до согласования исправления.
|
|
245
|
+
Private security report включает версию, affected component/subpath,
|
|
246
|
+
reproduction, impact и известные ограничения.
|
|
247
|
+
|
|
248
|
+
Do not disclose vulnerability details publicly before a fix is coordinated. A
|
|
249
|
+
private security report includes the version, affected component/subpath,
|
|
250
|
+
reproduction, impact, and known constraints.
|
|
150
251
|
|
|
151
252
|
## Лицензия / License
|
|
152
253
|
|
|
153
|
-
`@pgcorp/ui-kit` распространяется по лицензии MIT. Copyright и текст
|
|
154
|
-
|
|
254
|
+
`@pgcorp/ui-kit` распространяется по лицензии MIT. Copyright notice и текст
|
|
255
|
+
лицензии сохраняются в копиях и существенных частях пакета.
|
|
155
256
|
|
|
156
257
|
`@pgcorp/ui-kit` is distributed under the MIT License. The copyright and license
|
|
157
|
-
notice must be retained in copies and substantial portions
|
|
258
|
+
notice must be retained in copies and substantial portions of the package.
|
|
259
|
+
|
|
260
|
+
Enterprise-возможности могут поставляться отдельным закрытым пакетом,
|
|
261
|
+
приложением или сервисом по коммерческой лицензии. Это не изменяет лицензию
|
|
262
|
+
опубликованных MIT-версий `@pgcorp/ui-kit`. Название PGCorp и связанные товарные
|
|
263
|
+
знаки не лицензируются условиями MIT.
|
|
264
|
+
|
|
265
|
+
Enterprise capabilities may be distributed as a separate private package,
|
|
266
|
+
application, or service under a commercial license. This does not change the
|
|
267
|
+
license of published MIT versions of `@pgcorp/ui-kit`. The PGCorp name and
|
|
268
|
+
related trademarks are not licensed under the MIT License.
|
package/docs/security.md
CHANGED
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
## Русский
|
|
4
4
|
|
|
5
5
|
Не публикуйте сведения об уязвимости в public issue до согласования исправления.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
Актуальный private contact сопровождения доступен в npm package metadata:
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
npm view @pgcorp/ui-kit bugs
|
|
10
|
+
```
|
|
9
11
|
|
|
10
12
|
Укажите версию пакета, затронутый component/subpath, воспроизводимый сценарий,
|
|
11
13
|
impact и известные ограничения.
|
|
@@ -13,9 +15,11 @@ impact и известные ограничения.
|
|
|
13
15
|
## English
|
|
14
16
|
|
|
15
17
|
Do not disclose a vulnerability in a public issue before a fix is coordinated.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
The current private maintainer contact is available from npm package metadata:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm view @pgcorp/ui-kit bugs
|
|
22
|
+
```
|
|
19
23
|
|
|
20
24
|
Include the package version, affected component/subpath, reproducible scenario,
|
|
21
25
|
impact, and known constraints.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgcorp/ui-kit",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Typed Vue 3 design system with accessible components, semantic themes, and workbench patterns.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./index.ts",
|
|
7
7
|
"files": [
|
|
@@ -19,11 +19,17 @@
|
|
|
19
19
|
"keywords": [
|
|
20
20
|
"vue",
|
|
21
21
|
"vue3",
|
|
22
|
+
"vite",
|
|
23
|
+
"typescript",
|
|
22
24
|
"ui-kit",
|
|
25
|
+
"component-library",
|
|
23
26
|
"design-system",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
+
"design-tokens",
|
|
28
|
+
"accessibility",
|
|
29
|
+
"a11y",
|
|
30
|
+
"dark-theme",
|
|
31
|
+
"data-grid",
|
|
32
|
+
"workbench"
|
|
27
33
|
],
|
|
28
34
|
"license": "MIT",
|
|
29
35
|
"author": "PGCorp",
|