@dxtmisha/scripts 0.4.4 → 0.4.7

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dxtmisha/scripts",
3
3
  "private": false,
4
- "version": "0.4.4",
4
+ "version": "0.4.7",
5
5
  "type": "module",
6
6
  "description": "Development scripts and CLI tools for DXT UI projects - automated component generation, library building and project management tools",
7
7
  "keywords": [
@@ -5,7 +5,8 @@ import type { LibraryFiles } from '../../types/libraryTypes'
5
5
  import {
6
6
  UI_DIRS_LIST_EXPORT,
7
7
  UI_DIRS_FILE_EXPORT,
8
- UI_DIR_IN, UI_FLAG_NOT_EXPORT
8
+ UI_DIR_IN,
9
+ UI_FLAG_NOT_EXPORT
9
10
  } from '../../config'
10
11
 
11
12
  /**
@@ -47,7 +48,7 @@ export class LibraryExport {
47
48
  * @param path filename/ имя файла
48
49
  */
49
50
  protected isExport(path: string | string[]): boolean {
50
- return !this.getFile(path).match(UI_FLAG_NOT_EXPORT)
51
+ return !PropertiesFile.joinPath(path).match('.test.') && !this.getFile(path).match(UI_FLAG_NOT_EXPORT)
51
52
  }
52
53
 
53
54
  /**
@@ -114,8 +114,9 @@ export class PropertiesToLink extends PropertiesToAbstract {
114
114
  this.addIgnore(data.value)
115
115
  }
116
116
  } else {
117
- expect = true
118
- break
117
+ // TODO: зачем это надо?
118
+ // expect = true
119
+ // break
119
120
  }
120
121
  } else if (
121
122
  isObjectNotArray(item.value)
package/src/config.ts CHANGED
@@ -58,6 +58,7 @@ export const UI_DIRS_LIST_EXPORT = [
58
58
  'components',
59
59
  'composables',
60
60
  'functions',
61
+ 'global',
61
62
  'types'
62
63
  ]
63
64
 
@@ -1,5 +1,5 @@
1
1
  You need to prepare documentation for a component in the [wikiLanguage] language. Follow the format and requirements strictly. Do not add anything beyond what is described.
2
- Stack: Storybook 9.x, TypeScript, MDX.
2
+ Stack: Storybook 9.x, TypeScript, MDX, Vue 3 Composition API.
3
3
 
4
4
  Canvas component is imported from '@storybook/addon-docs/blocks'
5
5
 
@@ -9,12 +9,21 @@ Canvas component is imported from '@storybook/addon-docs/blocks'
9
9
  ```
10
10
  [code]
11
11
  ```
12
- Analyze the structure, props, events, slots, types, internal logic.
12
+
13
+ Analyze:
14
+ - Component structure (props, computed, methods)
15
+ - Events (emit) and their parameters
16
+ - Slots and their parameters
17
+ - Data types (interfaces, types)
18
+ - Expose methods and properties
19
+ - Internal logic and behavior
20
+ - Dependencies on other components
13
21
 
14
22
  ====================================
15
23
  2) Add missing type comments
16
24
  ====================================
17
25
  Add brief single-language (in [wikiLanguage]) JSDoc comments to missing types and their properties.
26
+
18
27
  Code to fix:
19
28
  ```ts
20
29
  // types.ts
@@ -22,12 +31,14 @@ Code to fix:
22
31
  ```
23
32
 
24
33
  Comment requirements:
25
- - Single-line for simple fields.
26
- - Multi-line for logic blocks.
27
- - No duplication of the obvious.
28
- - Adapted for storybook.
29
-
30
- Example:
34
+ - Single-line for simple fields (/** Description */)
35
+ - Multi-line for complex types or logic blocks
36
+ - No duplication of the obvious (don't comment "id" as "component id")
37
+ - Adapted for display in Storybook
38
+ - Use technical terms correctly
39
+ - For union types, describe each value separately in code
40
+
41
+ Example (strictly follow the format):
31
42
  ```ts
32
43
  /**
33
44
  * Basic properties for image components.
@@ -44,52 +55,261 @@ export interface IconPropsBasic<
44
55
  icon?: ImageValue<Image>
45
56
  /** Active icon value */
46
57
  iconActive?: ImageValue<Image>
58
+
59
+ // Design
60
+ /**
61
+ * Icon size
62
+ * @default 'medium'
63
+ */
64
+ size?: 'small' | 'medium' | 'large'
47
65
  }
48
66
  ```
49
67
 
50
68
  ====================================
51
69
  3) Stories for Storybook
52
70
  ====================================
53
- Create only the minimum necessary examples. Each example is as simple as possible, without extra wrappers, only what demonstrates the essence.
71
+ Create minimum necessary examples. Each story demonstrates a specific usage scenario.
72
+
54
73
  Code to fix:
55
74
  ```ts
56
75
  // ComponentDoc.stories.ts
57
76
  [stories]
58
77
  ```
78
+
59
79
  Rules:
60
- - Don't touch existing stories, only additions.
61
- - Don't touch const meta. DO NOT CHANGE ANYTHING IN META.
62
- - Don't touch existing constants.
63
- - Don't rename existing constants.
64
- - Don't add stories just for filling.
65
- - If the component has different modes (e.g., states or display variants), show one example each.
66
- - Story names in PascalCase style without extra words.
67
- - Minimize imports: only what is required.
80
+ - STRICTLY FORBIDDEN to touch const meta. DO NOT CHANGE ANYTHING IN META.
81
+ - Don't touch existing constants and stories
82
+ - Don't rename existing constants
83
+ - Don't add stories just for filling
84
+ - Each story must have a purpose and demonstrate specific functionality
85
+ - If component has different modes, show one clear example for each
86
+ - Story names in PascalCase style without extra words (e.g.: `Basic`, `WithIcon`, `Disabled`)
87
+ - Minimize imports: only necessary
88
+ - Don't use extra wrappers (div, section) without necessity
89
+ - Simple, readable code
90
+
91
+ Example:
92
+ ```ts
93
+ export const Basic: Story = {
94
+ args: {
95
+ label: 'Click me'
96
+ }
97
+ }
98
+
99
+ export const WithIcon: Story = {
100
+ args: {
101
+ label: 'Click me',
102
+ icon: 'check'
103
+ }
104
+ }
105
+ ```
68
106
 
69
107
  ====================================
70
108
  4) MDX documentation (component description)
71
109
  ====================================
72
- Prepare a complete component description in MDX format. Strict style: no tables, no extra sections.
110
+ Prepare complete component description in MDX format. Strict style: no tables, no extra sections, only necessary information.
111
+
73
112
  Code to fix:
74
113
  ```md
75
- // UiPlayerLite.mdx
114
+ // ComponentName.mdx
76
115
  [md]
77
116
  ```
78
117
 
79
- MDX structure rules:
80
- - At the beginning: [description] — Brief description of the purpose (1–3 sentences): conveys the essence of the component as briefly as possible.
81
- - Next: main text (documentation) — starts without a heading. This is [doc].
82
- - You can refine existing text by changing it, but don't delete. Delete only unnecessary or outdated content.
83
- - Be sure to list Expose (if any), slots (if any) and events (if any) in the given format.
84
- - Don't describe props in a list if they are simple. Describe only complex relationships (e.g., dependent props) or composite types in detail.
85
- - Expose, Slots and events — strictly in the format below. If there are no types, the type block is omitted.
86
- - Add Canvas if there is a usage example. If not, add stories.
87
- - Don't add <Canvas of={Component.Component}/>
88
- - Don't touch Meta and StorybookMain. They must remain as they are and be at the top. Don't add, don't delete, don't modify them.
89
-
90
- Example MDX documentation (don't include in response, only as style guide)
91
- Make sure to follow the style and formatting as shown in the example
92
- ====================================
118
+ Document structure (strict):
119
+
120
+ **1. Brief description:**
121
+ - One sentence, conveying the essence of the component as briefly as possible
122
+ - Don't use phrases like "This component", start immediately with the purpose
123
+
124
+ **2. Main documentation text:**
125
+ - Starts WITHOUT a heading
126
+ - Detailed functionality description (2-4 paragraphs)
127
+ - Block "**Key Features:**" (list of key features)
128
+ - Block "**Typical Use Cases:**" (list of usage examples)
129
+ - Can refine existing text, but DO NOT delete relevant information
130
+ - Delete only outdated or redundant content
131
+
132
+ **3. Special sections (if present):**
133
+
134
+ Instead of simply listing Props, describe **specific component capabilities**.
135
+
136
+ Each section should:
137
+ - Have a second-level heading (`##`) describing the capability, not just the prop name
138
+ - Briefly explain the purpose and behavior of the functionality
139
+ - List related properties (if there are several)
140
+ - Describe property interaction with each other and their effect on the component
141
+ - Include usage examples with code
142
+
143
+ **Capability description format:**
144
+
145
+ ```md
146
+ ## Capability Name
147
+
148
+ Brief description of the capability and its purpose (1-2 paragraphs).
149
+
150
+ **Properties:** (if several related properties)
151
+
152
+ - `propName` — property description
153
+ - `propName2` — property description
154
+
155
+ **Possible values:** (for enum/union types)
156
+
157
+ - `'value1'` — value description and its behavior
158
+ - `'value2'` — value description and its behavior
159
+
160
+ Additional description of behavior, property interaction, features, and limitations.
161
+
162
+ [code examples]
163
+ ```
164
+
165
+ **Examples of correct capability descriptions:**
166
+
167
+ ```md
168
+ ## Header Position Animation
169
+
170
+ The `animationHeadPosition` property defines the behavior of the Head area during show/hide animations.
171
+
172
+ **Possible values:**
173
+
174
+ - `'top'` — keeps Head at the top during transition (default)
175
+ - `'toBottom'` — animates Head down along with content
176
+
177
+ Synchronizes header movement with content animation using CSS transforms for smooth transitions.
178
+
179
+ [code example]
180
+ ```
181
+
182
+ ```md
183
+ ## Navigation and Arrows
184
+
185
+ Properties `arrowCarousel`, `arrowStepper`, `disabledPrevious`, `disabledNext`, and `align` are designed for managing built-in navigation elements and content alignment.
186
+
187
+ **Properties:**
188
+
189
+ - `arrowCarousel` — enables navigation arrows (left/right) for switching elements
190
+ - `arrowStepper` — enables numeric step buttons (minus/plus)
191
+ - `disabledPrevious` — disables left button (back/minus)
192
+ - `disabledNext` — disables right button (forward/plus)
193
+ - `align` — horizontal content alignment (`left`, `center`, `right`)
194
+
195
+ Properties work together: only one arrow mode is active — if `arrowCarousel = true`, `arrowStepper` mode is ignored and vice versa.
196
+
197
+ [code example]
198
+ ```
199
+
200
+ ```md
201
+ ## Outline Buttons
202
+
203
+ Button component supports outline mode via the `outline` property. In this mode, buttons have a minimalist visual style with transparent background and colored border:
204
+
205
+ - **Minimalist design** - suitable for interfaces requiring reduced visual load
206
+ - **Transparent background** - maintains clean appearance while remaining interactive
207
+ - **Hover feedback** - background appears on hover for better user interaction
208
+
209
+ Outline mode is especially useful for creating tertiary actions and secondary options.
210
+
211
+ [code example]
212
+ ```
213
+
214
+ **When NOT to describe Props in separate sections:**
215
+
216
+ - Simple boolean/string/number properties without complex logic — JSDoc comments in types are sufficient
217
+ - Properties with obvious behavior (e.g., `disabled`, `label`, `placeholder`)
218
+ - Single independent properties without interaction with others
219
+
220
+ **When to describe capabilities in separate sections:**
221
+
222
+ - Properties with complex interaction logic (e.g., `cancel` and `cancelShow`)
223
+ - Groups of related properties working together (e.g., navigation arrows)
224
+ - Properties with multiple operation modes (e.g., `adaptive` with different values)
225
+ - Properties affecting other component parts or having priority over others
226
+ - Component display modes (e.g., `primary`, `secondary`, `outline`)
227
+ - CSS classes for behavior control
228
+
229
+ **4. Mandatory sections (if present in component):**
230
+
231
+ **Expose methods/properties:**
232
+ ```md
233
+ ## Expose Methods
234
+ ### `methodName`
235
+
236
+ Method description.
237
+
238
+ **Type:** `(param: Type) => ReturnType`
239
+
240
+ **Parameters:**
241
+ - `param: Type` — parameter description
242
+
243
+ **Returns:** return value description
244
+
245
+ [code example]
246
+ ```
247
+
248
+ **Slots:**
249
+ ```md
250
+ ## Slots
251
+ ### `slotName`
252
+
253
+ Slot description.
254
+
255
+ **Parameters:**
256
+ - `param: Type` — slot parameter description
257
+
258
+ [code example]
259
+ ```
260
+
261
+ **Events:**
262
+ ```md
263
+ ## Events
264
+ ### `eventName`
265
+
266
+ Event description.
267
+
268
+ **Parameters:**
269
+ - `param: Type` — event parameter description
270
+
271
+ **Type structure:** (if parameter is complex)
272
+ - `field: string` — field description
273
+ - `field2: number` — field description
274
+
275
+ [code example]
276
+ ```
277
+
278
+ **5. Usage examples:**
279
+ - Add Canvas to demonstrate specific scenarios
280
+ - DO NOT add base `<Canvas of={Component.Component}/>` — it's already at the beginning
281
+ - Format: `<Canvas of={Component.StoryName}/>`
282
+
283
+ **Strict formatting rules:**
284
+
285
+ - Heading levels:
286
+ - `##` — main sections (Props, Expose Methods, Slots, Events)
287
+ - `###` — specific elements (method, slot, event names)
288
+ - `####` — subsections within description (Behavior, Examples)
289
+
290
+ - Code:
291
+ - Types and interfaces: ` ```ts `
292
+ - Component markup: ` ```html ` (NOT ` ```vue `)
293
+ - Inline code: wrap in backticks `` `code` ``
294
+
295
+ - Meta and StorybookMain:
296
+ - STRICTLY FORBIDDEN to touch Meta and StorybookMain blocks
297
+ - They must remain as is at the beginning of the file
298
+ - Don't add, don't delete, don't modify them
299
+
300
+ - Structural elements:
301
+ - Use `**Bold text:**` for subheadings within descriptions
302
+ - Use `>` for important notes and warnings
303
+ - Lists only where they improve readability
304
+
305
+ **Example of full document structure:**
306
+
307
+ ```md
308
+ import { Meta, Canvas } from '@storybook/addon-docs/blocks'
309
+ import * as Component from './Component.stories'
310
+
311
+ <Meta of={Component} />
312
+
93
313
  Component for creating modal windows, dialogs, and popup elements with flexible positioning and adaptive behavior.
94
314
 
95
315
  Window manages content display over the main interface, supports various positioning types (modal windows, dropdown menus, action sheets), open/close animations, and event system integration. The component automatically handles clicks outside the area, focus management, and adaptation to different screen sizes.
@@ -114,6 +334,8 @@ Window manages content display over the main interface, supports various positio
114
334
 
115
335
  ## CSS Classes for Behavior Control
116
336
 
337
+ Component uses special CSS classes for behavior control:
338
+
117
339
  - `*--block` — prevents window from closing when clicking outside its boundaries
118
340
  - `*--blockChildren` — prevents current window from closing
119
341
  - `*--blockOther` — prevents other windows from closing until current one is closed
@@ -124,53 +346,45 @@ Window manages content display over the main interface, supports various positio
124
346
 
125
347
  Where `*` is the component class name (e.g., `d1-window`, `m3-window`).
126
348
 
127
- ## Static Mode (staticMode)
128
-
129
- The Window component supports static mode operation through the `staticMode` property. In this mode, the window works as an embedded component without modal behavior:
349
+ ## Header Position Animation
130
350
 
131
- - **Content displays immediately** window doesn't hide and doesn't require activation
132
- - **Animations disabled** — no appearance/disappearance effects
133
- - **Positioning disabled** — window is embedded in document flow
134
- - **Works with adaptive** — when the `adaptive` property has one of the static modes (e.g., `static`), static mode is enabled
351
+ The `animationHeadPosition` property defines the behavior of the Head area during show/hide animations.
135
352
 
136
- Static mode is especially useful for embedding window content directly into the interface without modal behavior.
137
-
138
- ## Positioning Direction (axis)
353
+ **Possible values:**
139
354
 
140
- Controls the axis of window placement relative to the anchor element. Default: `y`.
355
+ - `'top'` keeps Head at the top during transition (default)
356
+ - `'toBottom'` — animates Head down along with content
141
357
 
142
- > Applies only in menu mode (`adaptive="menu"` or `adaptive="menuWindow"`).
358
+ Synchronizes header movement with content animation using CSS transforms for smooth transitions.
143
359
 
144
- **Possible values:**
145
- - `'x'` — horizontal axis (left or right of anchor)
146
- - `'y'` — vertical axis (top or bottom of anchor)
147
- - `'on'` — over anchor (window centers on element)
360
+ ```html
361
+ <template>
362
+ <Window v-model:open="isOpen" :animationHeadPosition="'toBottom'">
363
+ <template #default>
364
+ <p>Window content</p>
365
+ <button @click="isOpen = false">Close</button>
366
+ </template>
367
+ </Window>
368
+ </template>
369
+ ```
148
370
 
149
- ### Behavior
371
+ ## Navigation and Arrows
150
372
 
151
- - Component automatically selects the placement side with the most available space
152
- - When using context menu (`contextmenu`), positioning occurs from cursor coordinates
153
- - Window always stays within visible screen area (viewport)
154
- - Indent from anchor is set via `indent` property (default 4px)
373
+ Properties `arrowCarousel`, `arrowStepper`, `disabledPrevious`, `disabledNext`, and `align` are designed for managing built-in navigation elements and content alignment.
155
374
 
156
- ## State Management via v-model
375
+ **Properties:**
157
376
 
158
- Two-way binding of window open state via `v-model:open`.
377
+ - `arrowCarousel` enables navigation arrows (left/right) for switching elements
378
+ - `arrowStepper` — enables numeric step buttons (minus/plus)
379
+ - `disabledPrevious` — disables left button (back/minus)
380
+ - `disabledNext` — disables right button (forward/plus)
381
+ - `align` — horizontal content alignment (`left`, `center`, `right`)
159
382
 
160
- **Parameters:**
161
- - `open: boolean` — window open state
383
+ Properties work together: only one arrow mode is active — if `arrowCarousel = true`, `arrowStepper` mode is ignored and vice versa.
162
384
 
163
385
  ```html
164
- <script setup>
165
- import { ref } from 'vue'
166
-
167
- const isOpen = ref(false)
168
- </script>
169
-
170
386
  <template>
171
- <button @click="isOpen = true">Open</button>
172
-
173
- <Window v-model:open="isOpen">
387
+ <Window v-model:open="isOpen" :arrowCarousel="true" :align="'center'">
174
388
  <template #default>
175
389
  <p>Window content</p>
176
390
  <button @click="isOpen = false">Close</button>
@@ -179,6 +393,22 @@ const isOpen = ref(false)
179
393
  </template>
180
394
  ```
181
395
 
396
+ ## Outline Buttons
397
+
398
+ Button component supports outline mode via the `outline` property. In this mode, buttons have a minimalist visual style with transparent background and colored border:
399
+
400
+ - **Minimalist design** - suitable for interfaces requiring reduced visual load
401
+ - **Transparent background** - maintains clean appearance while remaining interactive
402
+ - **Hover feedback** - background appears on hover for better user interaction
403
+
404
+ Outline mode is especially useful for creating tertiary actions and secondary options.
405
+
406
+ ```html
407
+ <template>
408
+ <Button outline @click="handleClick">Click me</Button>
409
+ </template>
410
+ ```
411
+
182
412
  ## Expose Methods
183
413
  ### `id`
184
414
 
@@ -251,36 +481,61 @@ const handleWindow = (options) => {
251
481
  </template>
252
482
  ```
253
483
 
254
- Canvas usage example:
255
- <Canvas of={Chip.ChipSkeleton}/>
484
+ ## Usage Examples
485
+ ### Basic Modal Window
486
+
487
+ <Canvas of={Component.BasicModal}/>
488
+
489
+ ### Dropdown Menu
490
+
491
+ <Canvas of={Component.DropdownMenu}/>
492
+ ```
256
493
 
257
494
  ====================================
258
495
  5) Final return
259
496
  ====================================
260
- Return the result strictly in the format (nothing extra before or after):
497
+ Return the result STRICTLY in the format (nothing extra before or after):
498
+
261
499
  [types.ts]
262
500
  #########
263
501
  [ComponentDoc.stories.ts]
264
502
  #########
265
- [UiPlayerLite.mdx]
266
-
267
- Where:
268
- - Don't add anything extra (like ```ts)
269
- - Don't wrap in blocks.
270
- - Don't wrap in ```ts or anything similar.
271
- - [types.ts] final types block with comments (only content, without file name comments).
272
- - [ComponentDoc.stories.ts] final stories file (only content, without file name comments).
273
- - [UiPlayerLite.mdx] final MDX documentation (only content, without file name comments).
274
- - Result strictly in this order, separated by line #########.
503
+ [ComponentName.mdx]
504
+
505
+ **Output format requirements:**
506
+ - DO NOT add file labels like `// filepath: ...`
507
+ - DO NOT wrap in code blocks (` ```ts `, ` ```md `)
508
+ - DO NOT add comments with file names
509
+ - DO NOT include in the result text `[types.ts]`, `[ComponentDoc.stories.ts]`, `[ComponentName.mdx]`
510
+ - Only clean code, separated by a line of nine hash symbols: `#########`
511
+ - Order strictly: types stories documentation
512
+ - Each block starts with the first line of code, without spaces and line breaks before
513
+
514
+ **Structure of each block:**
515
+ - `[types.ts]` — final types file with JSDoc comments (only file content)
516
+ - `[ComponentDoc.stories.ts]` — final stories file (only file content)
517
+ - `[ComponentName.mdx]` — final MDX documentation (only file content)
275
518
 
276
519
  ====================================
277
520
  Constraints and style
278
521
  ====================================
279
- - No tables.
280
- - No arbitrary additional sections.
281
- - Don't add "Props" section if there are no complex dependencies.
282
- - Don't duplicate descriptions of the same thing.
283
- - Respect the [wikiLanguage] language — if it's "en" use English, otherwise the corresponding language.
284
- - Don't use placeholders outside those specified.
285
- - Code blocks: for types and events ```ts, for markup — ```html when necessary.
286
- - Stories: only necessary scenarios, without extra visual decorations.
522
+
523
+ **Forbidden:**
524
+ - Tables in any form
525
+ - Arbitrary additional sections outside specified ones
526
+ - "Props" section for simple properties without complex logic
527
+ - Duplication of descriptions of the same thing
528
+ - Placeholders outside those specified in prompt (`[code]`, `[types]`, `[stories]`, `[md]`)
529
+ - Using ` ```vue ` for code examples (only ` ```html `)
530
+ - Changing Meta block in MDX
531
+ - Adding base Canvas (`<Canvas of={Component.Component}/>`)
532
+
533
+ **Required:**
534
+ - Documentation language corresponds to [wikiLanguage]
535
+ - If [wikiLanguage] = "en", use English for ALL documentation
536
+ - If [wikiLanguage] = "ru", use Russian for ALL documentation
537
+ - Code blocks: types and events — ` ```ts `, markup — ` ```html `
538
+ - Stories: only necessary scenarios, without visual decorations
539
+ - Brevity and informativeness without "fluff"
540
+ - Technically correct terms
541
+ - Code examples are functional and up-to-date
@@ -1,7 +1,9 @@
1
- Нужно подготовить документацию для компонента на языке [wikiLanguage]. Следуй строго формату и требованиям ниже. Не добавляй ничего лишнего вне описанного.
2
- Стек Storybook 9.x, TypeScript, MDX.
1
+ Нужно подготовить документацию для компонента на языке [wikiLanguage].
2
+ Следуй строго формату и требованиям ниже.
3
+ Не добавляй ничего лишнего вне описанного.
4
+ Стек: Storybook 9.x, TypeScript, MDX, Vue 3 Composition API.
3
5
 
4
- Компонент Canvas подключается из '@storybook/addon-docs/blocks'
6
+ Canvas компонент импортируется из '@storybook/addon-docs/blocks'
5
7
 
6
8
  ====================================
7
9
  1) Изучи текущий код компонента
@@ -9,12 +11,21 @@
9
11
  ```
10
12
  [code]
11
13
  ```
12
- Проанализируй структуру, props, события, слоты, типы, внутреннюю логику.
14
+
15
+ Проанализируй:
16
+ - Структуру компонента (props, computed, methods)
17
+ - События (emit) и их параметры
18
+ - Слоты (slots) и их параметры
19
+ - Типы данных (interfaces, types)
20
+ - Expose методы и свойства
21
+ - Внутреннюю логику и поведение
22
+ - Зависимости от других компонентов
13
23
 
14
24
  ====================================
15
25
  2) Добавь недостающие комментарии к типам
16
26
  ====================================
17
27
  Добавь краткие одноязычные (на [wikiLanguage]) JSDoc-комментарии к отсутствующим типам и их свойствам.
28
+
18
29
  Код для исправления:
19
30
  ```ts
20
31
  // types.ts
@@ -22,12 +33,14 @@
22
33
  ```
23
34
 
24
35
  Требования к комментариям:
25
- - Однострочные для простых полей.
26
- - Многострочные для блоков логики.
27
- - Без дублирования очевидного.
28
- - Адаптированы к storybook.
29
-
30
- Пример:
36
+ - Однострочные для простых полей (/** Описание */)
37
+ - Многострочные для сложных типов или блоков логики
38
+ - Без дублирования очевидного (не комментируй "id" как "id компонента")
39
+ - Адаптированы для отображения в Storybook
40
+ - Используй технические термины правильно
41
+ - Для union типов опиши каждое значение отдельно в коде
42
+
43
+ Пример (строго следуй формату):
31
44
  ```ts
32
45
  /**
33
46
  * Basic properties for image components.
@@ -44,53 +57,261 @@ export interface IconPropsBasic<
44
57
  icon?: ImageValue<Image>
45
58
  /** Значение активной иконки */
46
59
  iconActive?: ImageValue<Image>
60
+
61
+ // Design
62
+ /**
63
+ * Размер иконки
64
+ * @default 'medium'
65
+ */
66
+ size?: 'small' | 'medium' | 'large'
47
67
  }
48
68
  ```
49
69
 
50
70
  ====================================
51
71
  3) Истории (stories) для Storybook
52
72
  ====================================
53
- Создай только минимально необходимые примеры. Каждый пример максимально простой, без лишних обёрток, только то, что демонстрирует суть.
73
+ Создай минимально необходимые примеры. Каждая история демонстрирует конкретный сценарий использования.
74
+
54
75
  Код для исправления:
55
76
  ```ts
56
77
  // ComponentDoc.stories.ts
57
78
  [stories]
58
79
  ```
80
+
59
81
  Правила:
60
- - Не трогать те stories, которые уже есть, только добавления.
61
- - Не трогать const meta. НИЧЕГО НЕ МЕНЯТЬ В META.
62
- - Не трогать существующие константы.
63
- - Не переименовывай существующие константы.
64
- - Не добавляй истории ради заполнения.
65
- - Если компонент имеет разные режимы (например, состояния или варианты отображения), покажи по одному примеру.
66
- - Имена историй в стиле PascalCase без лишних слов.
67
- - Минимизируй импорты: только то, что требуется.
82
+ - СТРОГО ЗАПРЕЩЕНО трогать const meta. НИЧЕГО НЕ МЕНЯТЬ В META.
83
+ - Не трогать существующие константы и истории
84
+ - Не переименовывать существующие константы
85
+ - Не добавлять истории ради заполнения
86
+ - Каждая история должна иметь цель и демонстрировать конкретную функциональность
87
+ - Если компонент имеет разные режимы, покажи по одному чёткому примеру для каждого
88
+ - Имена историй в стиле PascalCase без лишних слов (например: `Basic`, `WithIcon`, `Disabled`)
89
+ - Минимизируй импорты: только необходимое
90
+ - Не используй лишние обёртки (div, section) без необходимости
91
+ - Простой, читаемый код
92
+
93
+ Пример:
94
+ ```ts
95
+ export const Basic: Story = {
96
+ args: {
97
+ label: 'Click me'
98
+ }
99
+ }
100
+
101
+ export const WithIcon: Story = {
102
+ args: {
103
+ label: 'Click me',
104
+ icon: 'check'
105
+ }
106
+ }
107
+ ```
68
108
 
69
109
  ====================================
70
110
  4) MDX-документация (описание компонента)
71
111
  ====================================
72
- Подготовь полное описание компонента в формате MDX. Строгая стилистика: никаких таблиц, никаких лишних разделов.
112
+ Подготовь полное описание компонента в формате MDX. Строгая стилистика: никаких таблиц, никаких лишних разделов, только необходимая информация.
113
+
73
114
  Код для исправления:
74
115
  ```md
75
- // UiPlayerLite.mdx
116
+ // ComponentName.mdx
76
117
  [md]
77
118
  ```
78
119
 
79
- Правила структуры MDX:
80
- - В начале: [description] — Краткое описание назначения (1–3 предложения): максимально коротко передаёт суть компонента.
81
- - Далее: основной текст (документация) — начинается без заголовка. Это [doc].
82
- - Можно дорабатывать существующий текст, изменяя, но не удалять. Удаляй только лишнее или неактуальное.
83
- - Обязательно перечисли Expose (если есть), слоты (если есть) и события (если есть) в заданном формате.
84
- - Не описывай props списком, если они простые. Подробно описывай только сложные связки (например, зависимые props) или составные типы.
85
- - Expose, Слоты и события — строго в формате ниже. Если типов нет — блок с типом опускается.
86
- - Добавь Canvas, если есть пример использования. Если нет — добавь stories.
87
- - Не надо добавлять <Canvas of={Component.Component}/>
88
- - Нельзя трогать Meta и StorybookMain. Они должны остаться как есть и находиться вверху. Не добавляй, не удаляй, не изменяй их.
120
+ Структура документа (строго):
121
+
122
+ **1. Краткое описание (description):**
123
+ - Одно предложение, максимально кратко передающее суть компонента
124
+ - Не используй фразы типа "Этот компонент", начинай сразу с назначения
125
+
126
+ **2. Основной текст документации (doc):**
127
+ - Начинается БЕЗ заголовка
128
+ - Детальное описание функциональности (2-4 абзаца)
129
+ - Блок "**Основные возможности:**" (список ключевых фич)
130
+ - Блок "**Типичные сценарии использования:**" (список примеров применения)
131
+ - Можно дорабатывать существующий текст, но НЕ удалять актуальную информацию
132
+ - Удаляй только устаревшее или избыточное
133
+
134
+ **3. Специальные разделы (если есть):**
135
+
136
+ Вместо простого перечисления Props, описывай **конкретные возможности компонента**.
137
+
138
+ Каждый раздел должен:
139
+ - Иметь заголовок второго уровня (`##`), описывающий возможность, а не просто название prop
140
+ - Кратко объяснять назначение и поведение функциональности
141
+ - Перечислять связанные свойства (если их несколько)
142
+ - Описывать взаимодействие свойств между собой и их влияние на компонент
143
+ - Включать примеры использования с кодом
144
+
145
+ **Формат описания возможности:**
146
+
147
+ ```md
148
+ ## Название возможности
149
+
150
+ Краткое описание возможности и её назначения (1-2 абзаца).
151
+
152
+ **Свойства:** (если несколько связанных свойств)
153
+
154
+ - `propName` — описание свойства
155
+ - `propName2` — описание свойства
156
+
157
+ **Возможные значения:** (для enum/union типов)
158
+
159
+ - `'value1'` — описание значения и его поведения
160
+ - `'value2'` — описание значения и его поведения
161
+
162
+ Дополнительное описание поведения, взаимодействия свойств, особенностей и ограничений.
163
+
164
+ [примеры кода]
165
+ ```
166
+
167
+ **Примеры правильного описания возможностей:**
168
+
169
+ ```md
170
+ ## Анимация позиции заголовка
171
+
172
+ Свойство `animationHeadPosition` определяет поведение области Head во время анимаций показа/скрытия.
173
+
174
+ **Возможные значения:**
175
+
176
+ - `'top'` — сохраняет Head вверху во время перехода (по умолчанию)
177
+ - `'toBottom'` — анимирует Head вниз вместе с контентом
178
+
179
+ Синхронизирует движение заголовка с анимацией контента, используя CSS-трансформации для плавных переходов.
180
+
181
+ [код примера]
182
+ ```
183
+
184
+ ```md
185
+ ## Навигация и стрелки
186
+
187
+ Свойства `arrowCarousel`, `arrowStepper`, `disabledPrevious`, `disabledNext` и `align` предназначены для управления встроенными элементами навигации и выравнивания содержимого.
188
+
189
+ **Свойства:**
190
+
191
+ - `arrowCarousel` — включает стрелки навигации (влево/вправо) для переключения элементов
192
+ - `arrowStepper` — включает числовые шаговые кнопки (минус/плюс)
193
+ - `disabledPrevious` — отключает левую кнопку (назад/минус)
194
+ - `disabledNext` — отключает правую кнопку (вперёд/плюс)
195
+ - `align` — горизонтальное выравнивание содержимого (`left`, `center`, `right`)
196
+
197
+ Свойства работают совместно: активен только один режим стрелок — если `arrowCarousel = true`, режим `arrowStepper` игнорируется и наоборот.
198
+
199
+ [код примера]
200
+ ```
201
+
202
+ ```md
203
+ ## Контурные кнопки (outline)
204
+
205
+ Компонент Button поддерживает контурный режим через свойство `outline`. В этом режиме кнопки имеют минималистичный визуальный стиль с прозрачным фоном и цветной границей:
206
+
207
+ - **Минималистичный дизайн** - подходит для интерфейсов, требующих сниженной визуальной нагрузки
208
+ - **Прозрачный фон** - поддерживает чистый внешний вид, оставаясь интерактивными
209
+ - **Обратная связь при наведении** - фон появляется при наведении
210
+
211
+ Outline режим особенно полезен для создания третичных действий и второстепенных опций.
212
+
213
+ [код примера]
214
+ ```
215
+
216
+ **Когда НЕ нужно описывать Props отдельными разделами:**
217
+
218
+ - Простые boolean/string/number свойства без сложной логики — достаточно JSDoc комментариев в типах
219
+ - Свойства с очевидным поведением (например, `disabled`, `label`, `placeholder`)
220
+ - Единичные независимые свойства без взаимодействия с другими
221
+
222
+ **Когда НУЖНО описывать возможности отдельными разделами:**
223
+
224
+ - Свойства со сложной логикой взаимодействия (например, `cancel` и `cancelShow`)
225
+ - Группы связанных свойств, работающих вместе (например, стрелки навигации)
226
+ - Свойства с несколькими режимами работы (например, `adaptive` с разными значениями)
227
+ - Свойства, влияющие на другие части компонента или имеющие приоритет над другими
228
+ - Режимы отображения компонента (например, `primary`, `secondary`, `outline`)
229
+ - CSS классы для управления поведением
230
+
231
+ **4. Обязательные секции (если присутствуют в компоненте):**
232
+
233
+ **Expose методы/свойства:**
234
+ ```md
235
+ ## Expose методы
236
+ ### `methodName`
237
+
238
+ Описание метода.
239
+
240
+ **Тип:** `(param: Type) => ReturnType`
241
+
242
+ **Параметры:**
243
+ - `param: Type` — описание параметра
244
+
245
+ **Возвращает:** описание возвращаемого значения
246
+
247
+ [пример кода]
248
+ ```
249
+
250
+ **Слоты:**
251
+ ```md
252
+ ## Слоты
253
+ ### `slotName`
254
+
255
+ Описание слота.
256
+
257
+ **Параметры:**
258
+ - `param: Type` — описание параметра слота
259
+
260
+ [пример кода]
261
+ ```
262
+
263
+ **События:**
264
+ ```md
265
+ ## События
266
+ ### `eventName`
267
+
268
+ Описание события.
269
+
270
+ **Параметры:**
271
+ - `param: Type` — описание параметра события
272
+
273
+ **Структура Type:** (если параметр сложный)
274
+ - `field: string` — описание поля
275
+ - `field2: number` — описание поля
276
+
277
+ [пример кода]
278
+ ```
279
+
280
+ **5. Примеры использования:**
281
+ - Добавляй Canvas для демонстрации конкретных сценариев
282
+ - НЕ добавляй базовый `<Canvas of={Component.Component}/>` — он уже есть в начале
283
+ - Формат: `<Canvas of={Component.StoryName}/>`
284
+
285
+ **Строгие правила форматирования:**
286
+
287
+ - Заголовки уровней:
288
+ - `##` — основные разделы (Props, Expose методы, Слоты, События)
289
+ - `###` — конкретные элементы (названия методов, слотов, событий)
290
+ - `####` — подразделы внутри описания (Поведение, Примеры)
291
+
292
+ - Код:
293
+ - Типы и интерфейсы: ` ```ts `
294
+ - Разметка компонентов: ` ```html ` (НЕ ` ```vue `)
295
+ - Inline код: обёртка в обратные кавычки `` `код` ``
296
+
297
+ - Meta и StorybookMain:
298
+ - СТРОГО ЗАПРЕЩЕНО трогать блоки Meta и StorybookMain
299
+ - Они должны остаться как есть в начале файла
300
+ - Не добавлять, не удалять, не изменять их
301
+
302
+ - Структурные элементы:
303
+ - Используй `**Жирный текст:**` для подзаголовков внутри описаний
304
+ - Используй `>` для важных замечаний и предупреждений
305
+ - Списки только там, где они улучшают читаемость
306
+
307
+ **Пример полной структуры документа:**
308
+
309
+ ```md
310
+ import { Meta, Canvas } from '@storybook/addon-docs/blocks'
311
+ import * as Component from './Component.stories'
312
+
313
+ <Meta of={Component} />
89
314
 
90
- ====================================
91
- Пример MDX-документация (не включать в ответ, только как ориентир стиля)
92
- Обязательно соблюдай стиль и форматирование как в примере
93
- ====================================
94
315
  Компонент для создания модальных окон, диалогов и всплывающих элементов с гибким позиционированием и адаптивным поведением.
95
316
 
96
317
  Window управляет отображением контента поверх основного интерфейса, поддерживает различные типы позиционирования (модальные окна, выпадающие меню, action sheets), анимации открытия/закрытия и интеграцию с системой событий. Компонент автоматически обрабатывает клики вне области, управление фокусом и адаптацию под различные размеры экранов.
@@ -115,6 +336,8 @@ Window управляет отображением контента поверх
115
336
 
116
337
  ## CSS классы для управления поведением
117
338
 
339
+ Компонент использует специальные CSS классы для управления поведением:
340
+
118
341
  - `*--block` — предотвращает закрытие окна при клике вне его границ
119
342
  - `*--blockChildren` — предотвращает закрытие текущего окна
120
343
  - `*--blockOther` — предотвращает закрытие других окон до закрытия текущего
@@ -125,59 +348,63 @@ Window управляет отображением контента поверх
125
348
 
126
349
  Где `*` — название класса компонента (например, `d1-window`, `m3-window`).
127
350
 
128
- ## Статический режим (staticMode)
351
+ ## Анимация позиции заголовка
129
352
 
130
- Компонент Window поддерживает статический режим работы через свойство `staticMode`. В этом режиме окно работает как встроенный компонент без модального поведения:
353
+ Свойство `animationHeadPosition` определяет поведение области Head во время анимаций показа/скрытия.
131
354
 
132
- - **Содержимое отображается сразу** — окно не скрывается и не требует активации
133
- - **Отключены анимации** — нет эффектов появления/исчезновения
134
- - **Отключено позиционирование** — окно встраивается в поток документа
135
- - **Работает с adaptive** — когда свойство `adaptive` имеет один из статичных режимов (например, `static`), включается статичный режим
355
+ **Возможные значения:**
136
356
 
137
- Статический режим особенно полезен для встраивания содержимого окна непосредственно в интерфейс без модального поведения.
357
+ - `'top'` сохраняет Head вверху во время перехода (по умолчанию)
358
+ - `'toBottom'` — анимирует Head вниз вместе с контентом
138
359
 
139
- ## Направление позиционирования (axis)
360
+ Синхронизирует движение заголовка с анимацией контента, используя CSS-трансформации для плавных переходов.
140
361
 
141
- Управляет осью размещения окна относительно элемента-якоря. По умолчанию: `y`.
362
+ ```html
363
+ <Window
364
+ v-slot:default="{ animationHeadPosition }"
365
+ :style="{ '--head-animation': animationHeadPosition }"
366
+ >
367
+ <Header>Заголовок</Header>
368
+ <Content>Содержимое</Content>
369
+ </Window>
370
+ ```
142
371
 
143
- > Применяется только в режиме меню (`adaptive="menu"` или `adaptive="menuWindow"`).
372
+ ## Навигация и стрелки
144
373
 
145
- **Возможные значения:**
146
- - `'x'` — горизонтальная ось (слева или справа от якоря)
147
- - `'y'` — вертикальная ось (сверху или снизу от якоря)
148
- - `'on'` — поверх якоря (окно центрируется над элементом)
374
+ Свойства `arrowCarousel`, `arrowStepper`, `disabledPrevious`, `disabledNext` и `align` предназначены для управления встроенными элементами навигации и выравнивания содержимого.
149
375
 
150
- ### Поведение
376
+ **Свойства:**
151
377
 
152
- - Компонент автоматически выбирает сторону размещения с наибольшим доступным пространством
153
- - При использовании контекстного меню (`contextmenu`) позиционирование происходит от координат курсора
154
- - Окно всегда остается в пределах видимой области экрана (viewport)
155
- - Отступ от якоря задается через свойство `indent` (по умолчанию 4px)
378
+ - `arrowCarousel` включает стрелки навигации (влево/вправо) для переключения элементов
379
+ - `arrowStepper` включает числовые шаговые кнопки (минус/плюс)
380
+ - `disabledPrevious` отключает левую кнопку (назад/минус)
381
+ - `disabledNext` отключает правую кнопку (вперёд/плюс)
382
+ - `align` — горизонтальное выравнивание содержимого (`left`, `center`, `right`)
156
383
 
157
- ## Управление состоянием через v-model
384
+ Свойства работают совместно: активен только один режим стрелок — если `arrowCarousel = true`, режим `arrowStepper` игнорируется и наоборот.
158
385
 
159
- Двусторонняя привязка состояния открытия окна через `v-model:open`.
386
+ ```html
387
+ <Window
388
+ v-slot:default="{ arrowCarousel, arrowStepper }"
389
+ :arrow-carousel="arrowCarousel"
390
+ :arrow-stepper="arrowStepper"
391
+ >
392
+ <Content>Содержимое</Content>
393
+ </Window>
394
+ ```
160
395
 
161
- **Параметры:**
162
- - `open: boolean` — состояние открытия окна
396
+ ## Контурные кнопки (outline)
163
397
 
164
- ```html
165
- <script setup>
166
- import { ref } from 'vue'
398
+ Компонент Button поддерживает контурный режим через свойство `outline`. В этом режиме кнопки имеют минималистичный визуальный стиль с прозрачным фоном и цветной границей:
167
399
 
168
- const isOpen = ref(false)
169
- </script>
400
+ - **Минималистичный дизайн** - подходит для интерфейсов, требующих сниженной визуальной нагрузки
401
+ - **Прозрачный фон** - поддерживает чистый внешний вид, оставаясь интерактивными
402
+ - **Обратная связь при наведении** - фон появляется при наведении
170
403
 
171
- <template>
172
- <button @click="isOpen = true">Открыть</button>
404
+ Outline режим особенно полезен для создания третичных действий и второстепенных опций.
173
405
 
174
- <Window v-model:open="isOpen">
175
- <template #default>
176
- <p>Содержимое окна</p>
177
- <button @click="isOpen = false">Закрыть</button>
178
- </template>
179
- </Window>
180
- </template>
406
+ ```html
407
+ <Button outline>Контурная кнопка</Button>
181
408
  ```
182
409
 
183
410
  ## Expose методы
@@ -252,36 +479,61 @@ const handleWindow = (options) => {
252
479
  </template>
253
480
  ```
254
481
 
255
- Пример использования Canvas:
256
- <Canvas of={Chip.ChipSkeleton}/>
482
+ ## Примеры использования
483
+ ### Базовое модальное окно
484
+
485
+ <Canvas of={Component.BasicModal}/>
486
+
487
+ ### Выпадающее меню
488
+
489
+ <Canvas of={Component.DropdownMenu}/>
490
+ ```
257
491
 
258
492
  ====================================
259
493
  5) Итоговый возврат
260
494
  ====================================
261
- Верни результат строго в формате (ничего лишнего до или после):
495
+ Верни результат СТРОГО в формате (ничего лишнего до или после):
496
+
262
497
  [types.ts]
263
498
  #########
264
499
  [ComponentDoc.stories.ts]
265
500
  #########
266
- [UiPlayerLite.mdx]
267
-
268
- Где:
269
- - Не добавляй ничего лишнего (типа ```ts)
270
- - Не оборачивай в блоки.
271
- - Не оборачивай в ```ts или что-то подобное.
272
- - [types.ts] итоговый блок типов с комментариями (only content, without file name comments).
273
- - [ComponentDoc.stories.ts] итоговый файл историй (only content, without file name comments).
274
- - [UiPlayerLite.mdx] итоговая MDX-документация (only content, without file name comments).
275
- - Результат строго в этом порядке, разделённый строкой #########.
501
+ [ComponentName.mdx]
502
+
503
+ **Требования к формату вывода:**
504
+ - НЕ добавляй метки файлов типа `// filepath: ...`
505
+ - НЕ оборачивай в блоки кода (` ```ts `, ` ```md `)
506
+ - НЕ добавляй комментарии с названиями файлов
507
+ - НЕ включай в сам результат текст `[types.ts]`, `[ComponentDoc.stories.ts]`, `[ComponentName.mdx]`
508
+ - Только чистый код, разделённый строкой из девяти символов решётки: `#########`
509
+ - Порядок строго: типы истории документация
510
+ - Каждый блок начинается с первой строки кода, без пробелов и переносов перед
511
+
512
+ **Структура каждого блока:**
513
+ - `[types.ts]` — итоговый файл типов с JSDoc комментариями (только содержимое файла)
514
+ - `[ComponentDoc.stories.ts]` — итоговый файл историй (только содержимое файла)
515
+ - `[ComponentName.mdx]` — итоговая MDX-документация (только содержимое файла)
276
516
 
277
517
  ====================================
278
518
  Ограничения и стилистика
279
519
  ====================================
280
- - Никаких таблиц.
281
- - Никаких произвольных дополнительных разделов.
282
- - Не добавляй раздел "Props", если нет сложных зависимостей.
283
- - Не дублируй описание одного и того же.
284
- - Уважай язык [wikiLanguage] — если это "en" используй английский, иначе соответствующий язык.
285
- - Не используй placeholder'ы вне оговорённых.
286
- - Кодовые блоки: для типов и событий ```ts, для разметки — ```html при необходимости.
287
- - Сторисы: только необходимые сценарии, без лишних визуальных украшений.
520
+
521
+ **Запрещено:**
522
+ - Таблицы в любом виде
523
+ - Произвольные дополнительные разделы вне указанных
524
+ - Раздел "Props" для простых свойств без сложной логики
525
+ - Дублирование описаний одного и того же
526
+ - Placeholder'ы вне указанных в промпте (`[code]`, `[types]`, `[stories]`, `[md]`)
527
+ - Использование ` ```vue ` для примеров кода (только ` ```html `)
528
+ - Изменение Meta блока в MDX
529
+ - Добавление базового Canvas (`<Canvas of={Component.Component}/>`)
530
+
531
+ **Обязательно:**
532
+ - Язык документации соответствует [wikiLanguage]
533
+ - Если [wikiLanguage] = "en", используй английский для ВСЕЙ документации
534
+ - Если [wikiLanguage] = "ru", используй русский для ВСЕЙ документации
535
+ - Кодовые блоки: типы и события — ` ```ts `, разметка — ` ```html `
536
+ - Истории: только необходимые сценарии, без визуальных украшений
537
+ - Краткость и информативность без "воды"
538
+ - Технически корректные термины
539
+ - Примеры кода работоспособны и актуальны