@pgcorp/ui-kit 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.
Files changed (3) hide show
  1. package/README.md +198 -87
  2. package/docs/security.md +10 -6
  3. package/package.json +12 -6
package/README.md CHANGED
@@ -1,33 +1,27 @@
1
1
  # @pgcorp/ui-kit
2
2
 
3
- [![npm version](https://img.shields.io/npm/v/%40pgcorp%2Fui-kit)](https://www.npmjs.com/package/@pgcorp/ui-kit)
4
- [![npm downloads](https://img.shields.io/npm/dm/%40pgcorp%2Fui-kit)](https://www.npmjs.com/package/@pgcorp/ui-kit)
5
- [![Vue 3](https://img.shields.io/badge/Vue-3.5%2B-42b883)](https://vuejs.org/)
6
- [![License](https://img.shields.io/npm/l/%40pgcorp%2Fui-kit)](./LICENSE)
3
+ **Типизированная дизайн-система PGCorp для Vue 3: от базовых controls до
4
+ полноценных workbench-интерфейсов.**
7
5
 
8
- Production design system PGCorp для Vue 3: типизированные компоненты, layout-примитивы,
9
- design tokens, темы, accessibility-контракты и готовые сложные интерфейсные паттерны.
6
+ **A typed PGCorp design system for Vue 3, spanning foundational controls and
7
+ complete workbench interfaces.**
10
8
 
11
- PGCorp production design system for Vue 3: typed components, layout primitives,
12
- design tokens, themes, accessibility contracts, and reusable complex UI patterns.
9
+ `Vue 3` · `TypeScript` · `118 exact exports` · `6 themes` · `MIT`
13
10
 
14
- ## Возможности / Features
11
+ ## Что входит / What is included
15
12
 
16
- - 118 точных package exports без wildcard и private imports.
17
- - Vue Single-File Components с TypeScript-контрактами.
18
- - Светлые и тёмные темы на semantic CSS tokens.
19
- - Controls, navigation, data display, overlays, workbench layouts, editors and graphs.
20
- - Keyboard, focus, ARIA, disabled, loading and error states.
21
- - Проверяемые unit, Storybook, browser, accessibility и visual contracts.
22
-
23
- ---
24
-
25
- - 118 exact package exports without wildcards or private imports.
26
- - Vue Single-File Components with TypeScript contracts.
27
- - Light and dark themes built on semantic CSS tokens.
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
- - Node.js `>=20.19`;
41
- - npm `>=11.10 <12`;
42
- - Vue `^3.5`;
43
- - Pinia `^3.0`;
44
- - Vue Router `^5.0`;
45
- - Vite-based Vue application.
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
- Requirements:
41
+ `vue`, `pinia` и `vue-router` являются peer dependencies. Consumer-приложение
42
+ владеет их единственными runtime-экземплярами.
48
43
 
49
- - Node.js `>=20.19`;
50
- - npm `>=11.10 <12`;
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
- Подключите базовые стили один раз в entrypoint приложения:
49
+ Подключите Pinia, router и базовые стили в entrypoint приложения:
59
50
 
60
- Import the base stylesheet once in the application entrypoint:
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).mount('#app')
61
+ createApp(App)
62
+ .use(createPinia())
63
+ .use(router)
64
+ .mount('#app')
69
65
  ```
70
66
 
71
- Импортируйте компоненты только через документированные subpaths:
67
+ Импортируйте каждый компонент через точный публичный subpath:
72
68
 
73
- Import components only through documented subpaths:
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
- <template #header>Профиль</template>
84
- <SButton variant="primary">Сохранить</SButton>
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
- ## Стили и темы / Styling and themes
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
- `style.css` подключает semantic tokens и базовый визуальный контракт. Для token-only
92
- интеграции доступен отдельный export:
118
+ Для обычного приложения подключайте полный style entrypoint один раз:
93
119
 
94
- `style.css` provides semantic tokens and the base visual contract. A token-only
95
- integration is available as a separate export:
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
- Компоненты используют semantic tokens. Consumer не переоформляет внутренний DOM
102
- компонентов через deep selectors; варианты задаются публичными props, slots и tokens.
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 tokens. Consumers do not restyle component internals
105
- through deep selectors; variants are expressed through public props, slots, and tokens.
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
- Подробнее: [темы и tokens](./docs/theming.md).
166
+ ## Публичный контракт / Public contract
108
167
 
109
- Learn more: [themes and tokens](./docs/theming.md).
168
+ `package.json#exports` источник истины для импортов. Публичный контракт
169
+ компонента состоит из typed props, slots, events и exposed methods.
110
170
 
111
- ## Публичный API / Public API
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
- Корневой export содержит theme, variants и icon registry:
174
+ Поддерживается:
114
175
 
115
- The root export contains theme, variants, and the icon registry:
176
+ Supported:
116
177
 
117
178
  ```ts
118
- import { applyThemeIdToDocument, uiVariantClasses } from '@pgcorp/ui-kit'
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
- Компоненты и модули импортируются через exact subpaths из `package.json#exports`.
122
- Wildcard imports и доступ к внутренним путям пакета не поддерживаются.
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
- Components and modules are imported through exact subpaths declared in
125
- `package.json#exports`. Wildcard imports and package-internal paths are unsupported.
208
+ Consumers provide meaningful labels and do not replace component semantics with
209
+ local DOM listeners or CSS.
126
210
 
127
- Полный маршрут по API: [Public API](./docs/public-api.md).
211
+ ## Версии / Versioning
128
212
 
129
- Complete API guide: [Public API](./docs/public-api.md).
213
+ Пакет следует Semantic Versioning:
130
214
 
131
- ## Документация / Documentation
215
+ The package follows Semantic Versioning:
132
216
 
133
- - [Начало работы / Getting started](./docs/getting-started.md)
134
- - [Public API](./docs/public-api.md)
135
- - [Темы и design tokens / Themes and design tokens](./docs/theming.md)
136
- - [Accessibility](./docs/accessibility.md)
137
- - [Версии и релизы / Versioning and releases](./docs/versioning.md)
138
- - [Лицензирование и Enterprise / Licensing and Enterprise](./docs/licensing.md)
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
- ## Поддержка / Support
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
- Bugs and change requests are accepted at
148
- [remand-gambol4g@icloud.com](mailto:remand-gambol4g@icloud.com).
149
- Security reports follow the process documented in [Security](./docs/security.md).
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
- должны сохраняться в копиях и существенных частях пакета. См. [LICENSE](./LICENSE).
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. See [LICENSE](./LICENSE).
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
- Отправьте private security report на
7
- [remand-gambol4g@icloud.com](mailto:remand-gambol4g@icloud.com) с темой
8
- `[SECURITY] @pgcorp/ui-kit`.
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
- Send a private security report to
17
- [remand-gambol4g@icloud.com](mailto:remand-gambol4g@icloud.com) with the subject
18
- `[SECURITY] @pgcorp/ui-kit`.
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.0",
4
- "description": "Production Vue 3 design system and UI component library for Sputnig applications.",
3
+ "version": "0.1.2",
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
- "components",
25
- "typescript",
26
- "accessibility"
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",
@@ -543,7 +549,7 @@
543
549
  "@codemirror/theme-one-dark": "^6.1.3",
544
550
  "@codemirror/view": "^6.39.15",
545
551
  "@uiw/codemirror-extensions-langs": "^4.25.8",
546
- "codemirror": "^6.0.2",
552
+ "codemirror": "6.0.2",
547
553
  "codemirror-lang-makefile": "^0.1.1",
548
554
  "dompurify": "^3.4.12",
549
555
  "graphology": "^0.26.0",