@dxtmisha/wiki 0.25.1 → 0.39.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/package.json +2 -2
- package/src/classes/WikiStorybook.ts +92 -1
- package/src/classes/WikiStorybookItem.ts +55 -5
- package/src/classes/WikiStorybookProp.ts +109 -0
- package/src/library.ts +1 -0
- package/src/media/descriptions/wikiDescriptions.ts +4 -0
- package/src/media/descriptions/wikiDescriptionsAccordion.ts +46 -0
- package/src/media/descriptions/wikiDescriptionsActionSheet.ts +53 -0
- package/src/media/descriptions/wikiDescriptionsActions.ts +28 -0
- package/src/media/descriptions/wikiDescriptionsAnchor.ts +36 -0
- package/src/media/descriptions/wikiDescriptionsArrow.ts +33 -0
- package/src/media/descriptions/wikiDescriptionsBadge.ts +43 -0
- package/src/media/descriptions/wikiDescriptionsBars.ts +33 -0
- package/src/media/descriptions/wikiDescriptionsBlock.ts +67 -5
- package/src/media/descriptions/wikiDescriptionsButton.ts +32 -0
- package/src/media/descriptions/wikiDescriptionsCell.ts +24 -0
- package/src/media/descriptions/wikiDescriptionsChip.ts +42 -0
- package/src/media/descriptions/wikiDescriptionsChipGroup.ts +45 -14
- package/src/media/descriptions/wikiDescriptionsDialog.ts +44 -0
- package/src/media/descriptions/wikiDescriptionsField.ts +55 -2
- package/src/media/descriptions/wikiDescriptionsFieldCounter.ts +32 -0
- package/src/media/descriptions/wikiDescriptionsFieldLabel.ts +22 -0
- package/src/media/descriptions/wikiDescriptionsFieldMessage.ts +25 -0
- package/src/media/descriptions/wikiDescriptionsIcon.ts +46 -8
- package/src/media/descriptions/wikiDescriptionsImage.ts +50 -1
- package/src/media/descriptions/wikiDescriptionsInput.ts +56 -0
- package/src/media/descriptions/wikiDescriptionsList.ts +31 -0
- package/src/media/descriptions/wikiDescriptionsListGroup.ts +57 -0
- package/src/media/descriptions/wikiDescriptionsListItem.ts +42 -0
- package/src/media/descriptions/wikiDescriptionsListMenu.ts +41 -0
- package/src/media/descriptions/wikiDescriptionsMask.ts +42 -0
- package/src/media/descriptions/wikiDescriptionsMenu.ts +56 -0
- package/src/media/descriptions/wikiDescriptionsModal.ts +61 -6
- package/src/media/descriptions/wikiDescriptionsMotionTransform.ts +57 -0
- package/src/media/descriptions/wikiDescriptionsPage.ts +155 -0
- package/src/media/descriptions/wikiDescriptionsProgress.ts +39 -0
- package/src/media/descriptions/wikiDescriptionsRipple.ts +42 -3
- package/src/media/descriptions/wikiDescriptionsScrollbar.ts +48 -0
- package/src/media/descriptions/wikiDescriptionsSection.ts +152 -0
- package/src/media/descriptions/wikiDescriptionsSelect.ts +44 -0
- package/src/media/descriptions/wikiDescriptionsSelectValue.ts +29 -0
- package/src/media/descriptions/wikiDescriptionsSkeleton.ts +42 -1
- package/src/media/descriptions/wikiDescriptionsTextareaAutosize.ts +30 -0
- package/src/media/descriptions/wikiDescriptionsTooltip.ts +47 -0
- package/src/media/descriptions/wikiDescriptionsWindow.ts +60 -0
- package/src/media/functional/functional-basic/functions/getCurrentDate/getCurrentDate.en.mdx +25 -0
- package/src/media/functional/functional-basic/functions/getCurrentDate/getCurrentDate.ru.mdx +25 -0
- package/src/media/functional/functional-basic/functions/getCurrentDate/getCurrentDate.vi.mdx +25 -0
- package/src/media/functional/functional-basic/functions/isEnter/isEnter.en.mdx +30 -0
- package/src/media/functional/functional-basic/functions/isEnter/isEnter.ru.mdx +30 -0
- package/src/media/functional/functional-basic/functions/isEnter/isEnter.vi.mdx +30 -0
- package/src/media/mdx/Image/flag.en.mdx +23 -0
- package/src/media/mdx/Image/flag.ru.mdx +23 -0
- package/src/media/mdx/Image/image.en.mdx +26 -21
- package/src/media/mdx/Image/image.ru.mdx +26 -22
- package/src/media/mdx/Image/wikiMdxImage.ts +6 -0
- package/src/media/mdx/Page/page.en.mdx +38 -0
- package/src/media/mdx/Page/page.ru.mdx +38 -0
- package/src/media/mdx/Page/wikiMdxPage.ts +19 -0
- package/src/media/mdx/Section/section.en.mdx +38 -0
- package/src/media/mdx/Section/section.ru.mdx +38 -0
- package/src/media/mdx/Section/wikiMdxSection.ts +19 -0
- package/src/media/mdx/expose/expose.clear.en.mdx +1 -1
- package/src/media/mdx/wikiMdx.ts +4 -0
- package/src/media/props/wiki.ts +2 -0
- package/src/media/props/wikiActionsInclude.ts +1 -1
- package/src/media/props/wikiAnchor.ts +3 -2
- package/src/media/props/wikiAria.ts +21 -0
- package/src/media/props/wikiArrowInclude.ts +1 -1
- package/src/media/props/wikiAttributes.ts +143 -0
- package/src/media/props/wikiBadge.ts +7 -4
- package/src/media/props/wikiBars.ts +7 -6
- package/src/media/props/wikiBarsInclude.ts +5 -3
- package/src/media/props/wikiButton.ts +8 -4
- package/src/media/props/wikiChip.ts +4 -2
- package/src/media/props/wikiDialog.ts +1 -2
- package/src/media/props/wikiField.ts +18 -10
- package/src/media/props/wikiFieldCounterInclude.ts +15 -6
- package/src/media/props/wikiForm.ts +32 -13
- package/src/media/props/wikiIcon.ts +16 -3
- package/src/media/props/wikiIconInclude.ts +12 -9
- package/src/media/props/wikiImage.ts +26 -1
- package/src/media/props/wikiInformation.ts +21 -17
- package/src/media/props/wikiList.ts +10 -4
- package/src/media/props/wikiListItem.ts +3 -2
- package/src/media/props/wikiMask.ts +2 -2
- package/src/media/props/wikiMaskInclude.ts +1 -1
- package/src/media/props/wikiMenu.ts +1 -1
- package/src/media/props/wikiMotionTransform.ts +7 -3
- package/src/media/props/wikiOption.ts +250 -7
- package/src/media/props/wikiProgress.ts +8 -5
- package/src/media/props/wikiScrollbar.ts +6 -6
- package/src/media/props/wikiSelect.ts +22 -22
- package/src/media/props/wikiStatus.ts +16 -27
- package/src/media/props/wikiStyle.ts +43 -275
- package/src/media/props/wikiTechnical.ts +77 -2
- package/src/media/props/wikiText.ts +110 -0
- package/src/media/props/wikiValue.ts +26 -91
- package/src/media/props/wikiWindow.ts +27 -17
- package/src/shims-mdx.d.ts +5 -0
- package/src/types/storybookTypes.ts +22 -0
|
@@ -3,7 +3,7 @@ import type { StorybookComponentsDescriptionItem } from '../../types/storybookTy
|
|
|
3
3
|
export const wikiDescriptionsImage: StorybookComponentsDescriptionItem = {
|
|
4
4
|
name: 'Image',
|
|
5
5
|
description: {
|
|
6
|
-
en: '
|
|
6
|
+
en: 'Component for displaying images and icons. Based on `ImageDesign` and supports working with files, links, and icon names.',
|
|
7
7
|
ru: 'Компонент для отображения изображений и иконок. Основан на `ImageDesign` и поддерживает работу с файлами, ссылками и именами икон'
|
|
8
8
|
},
|
|
9
9
|
possibilities: {
|
|
@@ -160,6 +160,7 @@ export const wikiDescriptionsImage: StorybookComponentsDescriptionItem = {
|
|
|
160
160
|
body: `
|
|
161
161
|
<StorybookDescriptions componentName={'Image'} type={'image'}/>
|
|
162
162
|
<StorybookDescriptions componentName={'Image'} type={'value'}/>
|
|
163
|
+
<StorybookDescriptions componentName={'Image'} type={'flag'}/>
|
|
163
164
|
<Canvas of={Component.ImageType}/>
|
|
164
165
|
|
|
165
166
|
<StorybookDescriptions componentName={'Image'} type={'img-tag'}/>
|
|
@@ -177,5 +178,53 @@ export const wikiDescriptionsImage: StorybookComponentsDescriptionItem = {
|
|
|
177
178
|
expose: `
|
|
178
179
|
<StorybookDescriptions componentName={'Image'} type={'expose'}/>
|
|
179
180
|
`
|
|
181
|
+
},
|
|
182
|
+
ai: {
|
|
183
|
+
render: `
|
|
184
|
+
<div
|
|
185
|
+
:class="classDemo.item"
|
|
186
|
+
style="position: relative; width: 48px; height: 48px;"
|
|
187
|
+
>
|
|
188
|
+
<Image v-bind="args"/>
|
|
189
|
+
</div>
|
|
190
|
+
`,
|
|
191
|
+
description: `
|
|
192
|
+
Image is a universal component for displaying graphic content.
|
|
193
|
+
It automatically determines the type of content (image, icon, file, PDF)
|
|
194
|
+
based on the \`value\` property.
|
|
195
|
+
|
|
196
|
+
**Key Features:**
|
|
197
|
+
1. **Automatic Type Detection:**
|
|
198
|
+
- **Image:** If \`value\` is a URL to an image or a File object.
|
|
199
|
+
- **Icon:** If \`value\` is a string matching an icon name
|
|
200
|
+
(e.g., "home", "filled-home"). Supports Material Symbols/Icons.
|
|
201
|
+
- **PDF:** If \`value\` is a URL to a PDF file.
|
|
202
|
+
- **Color:** If \`value\` is a color string (e.g., "#ff0000").
|
|
203
|
+
|
|
204
|
+
2. **Display Modes (\`size\`):**
|
|
205
|
+
- \`auto\` (default): Standard behavior.
|
|
206
|
+
- \`contain\`: Scales the image to fit within the container while maintaining aspect ratio.
|
|
207
|
+
- \`cover\`: Scales the image to cover the container, cropping if necessary.
|
|
208
|
+
|
|
209
|
+
3. **Rendering Method (\`tagImg\`):**
|
|
210
|
+
- \`false\` (default): Renders as a background image (\`background-image\`) on a \`<span>\`.
|
|
211
|
+
Useful for precise positioning and sizing.
|
|
212
|
+
- \`true\`: Renders as a standard \`<img>\` tag. Required for SEO (alt text), lazy loading,
|
|
213
|
+
and accessibility.
|
|
214
|
+
|
|
215
|
+
4. **Adaptivity (\`adaptive\`):**
|
|
216
|
+
- Allows scaling the image relative to its original size using \`objectWidth\` and \`objectHeight\`.
|
|
217
|
+
|
|
218
|
+
5. **Advanced Positioning:**
|
|
219
|
+
- \`coordinator\`: Array \`[top, right, bottom, left]\` for cropping or positioning the background.
|
|
220
|
+
- \`x\`, \`y\`: Direct control over background position.
|
|
221
|
+
|
|
222
|
+
**Usage Examples:**
|
|
223
|
+
|
|
224
|
+
- **Icon:** \`<Image value="home" />\`
|
|
225
|
+
- **Image (Background):** \`<Image value="https://example.com/img.jpg" size="cover" />\`
|
|
226
|
+
- **Image (Tag):** \`<Image value="https://example.com/img.jpg" tag-img alt="Description" />\`
|
|
227
|
+
- **PDF:** \`<Image value="https://example.com/doc.pdf" />\`
|
|
228
|
+
`
|
|
180
229
|
}
|
|
181
230
|
}
|
|
@@ -253,5 +253,61 @@ export const wikiDescriptionsInput: StorybookComponentsDescriptionItem = {
|
|
|
253
253
|
<StorybookDescriptions componentName={'Slot'} type={'leading'} />
|
|
254
254
|
<StorybookDescriptions componentName={'Slot'} type={'trailing'} />
|
|
255
255
|
`
|
|
256
|
+
},
|
|
257
|
+
ai: {
|
|
258
|
+
description: `
|
|
259
|
+
Input is the primary component for getting user data. It wraps the native \`<input>\` element and adds support for floating labels, validation, masking, and formatting.
|
|
260
|
+
|
|
261
|
+
**When to use:**
|
|
262
|
+
1. **Text Fields:** Names, emails, addresses, search queries.
|
|
263
|
+
2. **Numeric Data:** Quantities, prices (use \`type="number"\` or \`type="currency"\`).
|
|
264
|
+
3. **Formatted Inputs:** Phone numbers, credit cards (use \`mask\`).
|
|
265
|
+
4. **Passwords:** Secure entry with visibility toggle (use \`type="password"\`).
|
|
266
|
+
5. **Date/Time:** Date selection (use \`type="date"\`, \`type="time"\`).
|
|
267
|
+
|
|
268
|
+
**Key Properties & Logic:**
|
|
269
|
+
|
|
270
|
+
1. **Input Types (\`type\`):**
|
|
271
|
+
- **Standard:** \`text\`, \`email\`, \`search\`, \`url\`, \`tel\`.
|
|
272
|
+
- **Password:** \`password\`. Automatically adds a "show/hide" eye icon.
|
|
273
|
+
- **Native Number:** \`number\`. Uses browser's native number input.
|
|
274
|
+
- **Formatted Number:** \`number-format\`. A text input that formats numbers with thousands separators (e.g., "1,234.56") based on \`language\`.
|
|
275
|
+
- **Currency:** \`currency\`. Formats input as money. Requires \`currency\` prop (e.g., "USD").
|
|
276
|
+
- **Date/Time:** \`date\`, \`datetime\`, \`time\`, \`year-month\`.
|
|
277
|
+
|
|
278
|
+
2. **Masking (\`mask\`):**
|
|
279
|
+
- Applies a strict pattern to the input.
|
|
280
|
+
- Example: \`mask="+1 (###) ###-####"\` for phones.
|
|
281
|
+
- The component automatically handles placeholder characters and cursor movement.
|
|
282
|
+
- Use \`match\` to restrict allowed characters (e.g., \`match="[0-9]"\`).
|
|
283
|
+
|
|
284
|
+
3. **Validation:**
|
|
285
|
+
- **Error State:** Set \`validationMessage\` to show an error text and turn the field red.
|
|
286
|
+
- **Regex Pattern:** Use \`pattern\` to validate the final value.
|
|
287
|
+
- **Input Filter:** Use \`match\` to prevent typing invalid characters.
|
|
288
|
+
|
|
289
|
+
4. **Field Structure (Visuals):**
|
|
290
|
+
- **Label:** \`label\` prop. Can be floating or static.
|
|
291
|
+
- **Placeholder:** \`placeholder\` prop. Shown when empty.
|
|
292
|
+
- **Helper Text:** \`helperMessage\` prop. Shown below the input.
|
|
293
|
+
- **Icons:** \`icon\` (left/leading) and \`iconTrailing\` (right/trailing).
|
|
294
|
+
- **Affixes:** \`prefix\` (text before value, e.g., "$") and \`suffix\` (text after value, e.g., "kg").
|
|
295
|
+
- **Counter:** \`counter\` prop. Shows character count (requires \`maxlength\`).
|
|
296
|
+
|
|
297
|
+
5. **Behavior:**
|
|
298
|
+
- **Loading:** \`loading\` prop shows a spinner/skeleton.
|
|
299
|
+
- **Clearable:** \`cancel\` prop adds a clear (X) button.
|
|
300
|
+
- **Read-only/Disabled:** \`readonly\` and \`disabled\` props.
|
|
301
|
+
|
|
302
|
+
**Design Identification:**
|
|
303
|
+
- **Standard Input:** A box or underline with text.
|
|
304
|
+
- **With Icon:** Input with a symbol on the left or right.
|
|
305
|
+
- **With Prefix/Suffix:** Input containing fixed text like "$" or "items".
|
|
306
|
+
- **Error State:** Input with red border/text and a message below.
|
|
307
|
+
- **Password:** Input with dots and an eye icon.
|
|
308
|
+
|
|
309
|
+
**Example:**
|
|
310
|
+
\`<Input label="Email" type="email" icon="mail" />\`
|
|
311
|
+
`
|
|
256
312
|
}
|
|
257
313
|
}
|
|
@@ -116,5 +116,36 @@ export const wikiDescriptionsList: StorybookComponentsDescriptionItem = {
|
|
|
116
116
|
slots: `
|
|
117
117
|
<StorybookDescriptions componentName={'List'} type={'slot.html'}/>
|
|
118
118
|
`
|
|
119
|
+
},
|
|
120
|
+
ai: {
|
|
121
|
+
description: `
|
|
122
|
+
List is a core structural component for rendering interactive lists.
|
|
123
|
+
It is the engine behind Dropdowns, Selects, and Navigation Menus.
|
|
124
|
+
|
|
125
|
+
**Key Features:**
|
|
126
|
+
1. **Data Structure:**
|
|
127
|
+
- \`list\`: Array of objects. Supports types: \`item\` (default), \`group\`, \`menu\`, \`line\` (separator), \`space\`, \`subtitle\`, \`html\`.
|
|
128
|
+
- Items properties: \`label\`, \`value\`, \`icon\`, \`description\`, \`disabled\`, \`to\` (link).
|
|
129
|
+
|
|
130
|
+
2. **Interaction:**
|
|
131
|
+
- **Selection:** \`v-model:selected\` (single or array).
|
|
132
|
+
- **Keyboard:** Full arrow key navigation, Enter to select.
|
|
133
|
+
- **Focus:** Manages internal focus.
|
|
134
|
+
|
|
135
|
+
3. **Search & Filtering:**
|
|
136
|
+
- \`highlight\`: Text to highlight.
|
|
137
|
+
- \`filterMode\`: Hides non-matching items.
|
|
138
|
+
|
|
139
|
+
**Usage Examples:**
|
|
140
|
+
|
|
141
|
+
- **Basic List:**
|
|
142
|
+
\`<List :list="[{ label: 'Home', icon: 'home' }, { label: 'Settings', icon: 'settings' }]" />\`
|
|
143
|
+
|
|
144
|
+
- **With Selection:**
|
|
145
|
+
\`<List v-model:selected="current" :list="options" />\`
|
|
146
|
+
|
|
147
|
+
- **Filtered List:**
|
|
148
|
+
\`<List :list="data" :highlight="searchText" filter-mode />\`
|
|
149
|
+
`
|
|
119
150
|
}
|
|
120
151
|
}
|
|
@@ -75,5 +75,62 @@ export const wikiDescriptionsListGroup: StorybookComponentsDescriptionItem = {
|
|
|
75
75
|
slots: `
|
|
76
76
|
<StorybookDescriptions componentName={'ListGroup'} type={'slots'}/>
|
|
77
77
|
`
|
|
78
|
+
},
|
|
79
|
+
ai: {
|
|
80
|
+
render: `
|
|
81
|
+
<div :class="classDemo.item">
|
|
82
|
+
<ListGroup v-bind="args">
|
|
83
|
+
<template #head="{ binds }">
|
|
84
|
+
<span v-bind="binds">head</span>
|
|
85
|
+
</template>
|
|
86
|
+
<template #list>
|
|
87
|
+
list
|
|
88
|
+
</template>
|
|
89
|
+
</ListGroup>
|
|
90
|
+
</div>
|
|
91
|
+
`,
|
|
92
|
+
description: `
|
|
93
|
+
ListGroup is a structural component designed to group related list items, often providing collapsible/expandable functionality.
|
|
94
|
+
It serves as a container that manages the visibility of nested items, creating a hierarchical structure within lists or menus.
|
|
95
|
+
|
|
96
|
+
**Key Features:**
|
|
97
|
+
1. **Collapsible Logic:**
|
|
98
|
+
- Wraps content in a \`MotionTransform\` component for smooth height animations.
|
|
99
|
+
- Can be controlled programmatically via the \`open\` prop or interactively via the header.
|
|
100
|
+
|
|
101
|
+
2. **Slots Structure:**
|
|
102
|
+
- \`#head\`: The header area acting as the trigger. It receives \`binds\` (click handlers, ARIA attributes) that **must** be applied to the interactive element (e.g., \`ListItem\`) to enable toggling.
|
|
103
|
+
- \`#list\`: The content area where nested \`ListItem\` or other components are placed.
|
|
104
|
+
|
|
105
|
+
3. **Styling:**
|
|
106
|
+
- \`divider\`: Adds a visual separator if enabled.
|
|
107
|
+
- Automatically handles ARIA roles (\`role="group"\`).
|
|
108
|
+
|
|
109
|
+
**When to use:**
|
|
110
|
+
- **Navigation Menus:** To create submenus or grouped links (e.g., "Settings" -> "Profile", "Security").
|
|
111
|
+
- **Categorized Lists:** To group items under a common heading.
|
|
112
|
+
- **Accordions within Lists:** When list items need to expand to show details.
|
|
113
|
+
|
|
114
|
+
**Usage Examples:**
|
|
115
|
+
|
|
116
|
+
- **Basic Group:**
|
|
117
|
+
\`<ListGroup>
|
|
118
|
+
<template #head="{ binds }">
|
|
119
|
+
<ListItem v-bind="binds" label="My Group" icon="folder" />
|
|
120
|
+
</template>
|
|
121
|
+
<template #list>
|
|
122
|
+
<ListItem label="File 1" />
|
|
123
|
+
<ListItem label="File 2" />
|
|
124
|
+
</template>
|
|
125
|
+
</ListGroup>\`
|
|
126
|
+
|
|
127
|
+
- **Open by Default:**
|
|
128
|
+
\`<ListGroup open>
|
|
129
|
+
<template #head="{ binds }">
|
|
130
|
+
<ListItem v-bind="binds" label="Always Open" />
|
|
131
|
+
</template>
|
|
132
|
+
<template #list>...</template>
|
|
133
|
+
</ListGroup>\`
|
|
134
|
+
`
|
|
78
135
|
}
|
|
79
136
|
}
|
|
@@ -144,5 +144,47 @@ export const wikiDescriptionsListItem: StorybookComponentsDescriptionItem = {
|
|
|
144
144
|
<StorybookDescriptions componentName={'Slot'} type={'description'}/>
|
|
145
145
|
<StorybookDescriptions componentName={'ListItem'} type={'slots'}/>
|
|
146
146
|
`
|
|
147
|
+
},
|
|
148
|
+
ai: {
|
|
149
|
+
description: `
|
|
150
|
+
ListItem is a versatile structural component used to render items within lists, menus, or navigation bars.
|
|
151
|
+
It provides a standardized layout with slots for leading (prefix) and trailing (suffix) elements, along with a central content area.
|
|
152
|
+
|
|
153
|
+
**Key Features:**
|
|
154
|
+
1. **Layout Structure:**
|
|
155
|
+
- **Prefix:** Left-most area (e.g., for avatars, checkboxes, or icons).
|
|
156
|
+
- **Content:** Central area containing:
|
|
157
|
+
- \`label\`: Main title.
|
|
158
|
+
- \`caption\`: Meta text (above or next to label).
|
|
159
|
+
- \`description\`: Subtitle text (below label).
|
|
160
|
+
- **Suffix:** Right-side meta content (e.g., timestamp, status).
|
|
161
|
+
- **Trailing:** Far-right action area (e.g., arrow icon, badge).
|
|
162
|
+
|
|
163
|
+
2. **Interaction:**
|
|
164
|
+
- **Navigation:** Renders as an \`<a>\` tag if \`href\` is provided.
|
|
165
|
+
- **Selection:** Supports \`selected\` state (useful for menus).
|
|
166
|
+
- **Feedback:** Includes ripple effect and hover/active states.
|
|
167
|
+
- **Disabled:** \`disabled\` prop prevents interaction.
|
|
168
|
+
|
|
169
|
+
3. **Styling:**
|
|
170
|
+
- \`divider\` adds a bottom border.
|
|
171
|
+
- Supports \`badge\` integration via props.
|
|
172
|
+
|
|
173
|
+
**Usage Examples:**
|
|
174
|
+
|
|
175
|
+
- **Navigation Link:**
|
|
176
|
+
\`<ListItem href="/home" label="Home" icon="chevron_right">
|
|
177
|
+
<template #prefix>prefix</template>
|
|
178
|
+
</ListItem>\`
|
|
179
|
+
|
|
180
|
+
- **User List Item:**
|
|
181
|
+
\`<ListItem label="John Doe" description="Online" divider>
|
|
182
|
+
<template #prefix><Avatar src="..."/></template>
|
|
183
|
+
<template #suffix>12:30 PM</template>
|
|
184
|
+
</ListItem>\`
|
|
185
|
+
|
|
186
|
+
- **Menu Item:**
|
|
187
|
+
\`<ListItem label="Settings" icon="settings" selected />\`
|
|
188
|
+
`
|
|
147
189
|
}
|
|
148
190
|
}
|
|
@@ -73,5 +73,46 @@ export const wikiDescriptionsListMenu: StorybookComponentsDescriptionItem = {
|
|
|
73
73
|
slots: `
|
|
74
74
|
<StorybookDescriptions componentName={'ListGroup'} type={'slots'}/>
|
|
75
75
|
`
|
|
76
|
+
},
|
|
77
|
+
ai: {
|
|
78
|
+
render: `
|
|
79
|
+
<div :class="classDemo.item">
|
|
80
|
+
<ListMenu v-bind="args">
|
|
81
|
+
<template #head="{ binds }">
|
|
82
|
+
<span v-bind="binds as any">head</span>
|
|
83
|
+
</template>
|
|
84
|
+
<template #list>
|
|
85
|
+
list
|
|
86
|
+
</template>
|
|
87
|
+
</ListMenu>
|
|
88
|
+
</div>
|
|
89
|
+
`,
|
|
90
|
+
description: `
|
|
91
|
+
ListMenu is a specialized wrapper component designed to create dropdown menus or nested navigation lists.
|
|
92
|
+
It utilizes the \`Window\` component logic with a menu preset to manage the visibility and positioning of a list of items relative to a trigger.
|
|
93
|
+
|
|
94
|
+
**Key Features:**
|
|
95
|
+
1. **Structure:**
|
|
96
|
+
- \`#head\`: The trigger area (Control). It exposes \`binds\` which **must** be applied to the interactive element (e.g., \`ListItem\`, \`Button\`) to toggle the menu.
|
|
97
|
+
- \`#list\`: The content area containing the menu items.
|
|
98
|
+
|
|
99
|
+
2. **Behavior:**
|
|
100
|
+
- **Popup/Dropdown:** By default, it behaves like a dropdown menu (\`adaptive="menu"\`).
|
|
101
|
+
- **Interaction:** Manages click/hover events via \`binds\` to open/close the list.
|
|
102
|
+
- **Accessibility:** Automatically applies \`role="menu"\` and \`aria-haspopup\`.
|
|
103
|
+
|
|
104
|
+
**Usage Examples:**
|
|
105
|
+
|
|
106
|
+
- **List Item with Submenu:**
|
|
107
|
+
\`<ListMenu>
|
|
108
|
+
<template #head="{ binds }">
|
|
109
|
+
<ListItem v-bind="binds" label="Settings" icon="settings" />
|
|
110
|
+
</template>
|
|
111
|
+
<template #list>
|
|
112
|
+
<ListItem label="Profile" />
|
|
113
|
+
<ListItem label="Account" />
|
|
114
|
+
</template>
|
|
115
|
+
</ListMenu>\`
|
|
116
|
+
`
|
|
76
117
|
}
|
|
77
118
|
}
|
|
@@ -227,5 +227,47 @@ export const wikiDescriptionsMask: StorybookComponentsDescriptionItem = {
|
|
|
227
227
|
<StorybookDescriptions componentName={'Mask'} type={'expose'}/>
|
|
228
228
|
<StorybookDescriptions componentName={'Expose'} type={'clear'}/>
|
|
229
229
|
`
|
|
230
|
+
},
|
|
231
|
+
ai: {
|
|
232
|
+
description: `
|
|
233
|
+
**Note:** This component is already integrated into the \`Input\` component and should not be used directly.
|
|
234
|
+
|
|
235
|
+
Mask is a low-level utility component responsible for controlling and formatting user input. It ensures that the data entered matches a predefined structure (mask) or data type (date, number, currency).
|
|
236
|
+
|
|
237
|
+
**How it works:**
|
|
238
|
+
The component intercepts input events (\`beforeinput\`, \`input\`) and validates each character against allowed patterns (\`match\`). It automatically inserts static characters defined in the \`mask\` (like parentheses, dashes) and skips over them during navigation. For complex types like \`date\` or \`number\`, it uses internal logic to validate ranges (e.g., month 1-12) and format values (e.g., adding thousands separators).
|
|
239
|
+
|
|
240
|
+
**Key Properties & Usage:**
|
|
241
|
+
|
|
242
|
+
1. **Masking (\`mask\`):**
|
|
243
|
+
- **String:** A single pattern (e.g., \`+1 (***) ***-****\`). The \`*\` character (or value of \`special\`) represents an input slot. All other characters are treated as static literals and are automatically inserted/skipped.
|
|
244
|
+
- **Array:** A list of patterns (e.g., \`['(***) ***-****', '+1 (***) ***-****']\`). The component automatically selects the most appropriate mask based on the input length.
|
|
245
|
+
|
|
246
|
+
2. **Input Types (\`type\`):**
|
|
247
|
+
- \`text\` (default): Uses the \`mask\` pattern directly.
|
|
248
|
+
- \`number\`: Formats input as a number. Automatically adds thousands separators based on \`language\`.
|
|
249
|
+
- \`currency\`: Formats as currency. Requires \`currency\` prop (e.g., 'USD'). Uses \`fraction\` for decimal places.
|
|
250
|
+
- \`date\` / \`datetime\` / \`time\`: Enforces valid date/time entry. The format (e.g., DD.MM.YYYY vs MM/DD/YYYY) is determined by the \`language\` prop.
|
|
251
|
+
|
|
252
|
+
3. **Validation & Constraints:**
|
|
253
|
+
- \`match\`: A Regular Expression string (e.g., \`[0-9a-fA-F]\`). Only characters matching this pattern are accepted. Useful for Hex codes, alphanumeric IDs, etc.
|
|
254
|
+
- \`pattern\`: A Regex for validating the *completed* value.
|
|
255
|
+
- \`min\`, \`max\`: For number/currency types, restricts the value range.
|
|
256
|
+
|
|
257
|
+
4. **Customization:**
|
|
258
|
+
- \`special\`: Defines the placeholder character in the \`mask\`. Default is \`*\`. Change this if your mask needs to contain literal asterisks.
|
|
259
|
+
- \`language\`: Determines locale-specific formatting for dates and numbers (separators, date order).
|
|
260
|
+
- \`fraction\`: Specifies the number of decimal places for numbers/currency.
|
|
261
|
+
|
|
262
|
+
**When to use (Design Identification):**
|
|
263
|
+
- **Formatted Text:** Inputs that require specific formatting like Phone Numbers \`+1 (555) ...\`, Credit Cards \`0000 0000 ...\`, or License Plates.
|
|
264
|
+
- **Financial Data:** Inputs for amounts that need thousands separators or currency symbols.
|
|
265
|
+
- **Dates:** Inputs requiring strict date structure (DD.MM.YYYY).
|
|
266
|
+
|
|
267
|
+
**Example Scenarios:**
|
|
268
|
+
- **Phone:** \`<Mask mask="+1 (***) ***-****" match="[0-9]"/>\`
|
|
269
|
+
- **Price:** \`<Mask type="currency" currency="USD" fraction="2"/>\`
|
|
270
|
+
- **Date:** \`<Mask type="date" language="en-GB"/>\` (DD/MM/YYYY)
|
|
271
|
+
`
|
|
230
272
|
}
|
|
231
273
|
}
|
|
@@ -206,5 +206,61 @@ export const wikiDescriptionsMenu: StorybookComponentsDescriptionItem = {
|
|
|
206
206
|
<StorybookDescriptions componentName={'Menu'} type={'slotsControl'}/>
|
|
207
207
|
<StorybookDescriptions componentName={'Menu'} type={'slots'}/>
|
|
208
208
|
`
|
|
209
|
+
},
|
|
210
|
+
ai: {
|
|
211
|
+
render: `
|
|
212
|
+
<div :class="classDemo.item">
|
|
213
|
+
<Menu embedded :window-attrs="{open: true}" v-bind="args">
|
|
214
|
+
<template #control="{ binds }">
|
|
215
|
+
<button class="wiki-storybook-button" v-bind="binds">
|
|
216
|
+
Open Menu
|
|
217
|
+
</button>
|
|
218
|
+
</template>
|
|
219
|
+
</Menu>
|
|
220
|
+
</div>
|
|
221
|
+
`,
|
|
222
|
+
description: `
|
|
223
|
+
Menu is a comprehensive dropdown component used for navigation, actions, and selection.
|
|
224
|
+
It combines a trigger (Control), a popup container (Window), and a structured list (List).
|
|
225
|
+
|
|
226
|
+
**Key Features:**
|
|
227
|
+
1. **Structure:**
|
|
228
|
+
- **Control Slot (\`#control\`):** The trigger element (e.g., Button, Avatar). Receives \`binds\` (click/keydown handlers) which **must** be applied.
|
|
229
|
+
- **Popup:** Opens a floating window positioned relative to the trigger.
|
|
230
|
+
- **Content:** Renders a list of items defined in the \`list\` prop.
|
|
231
|
+
|
|
232
|
+
2. **Data Model (\`list\` prop):**
|
|
233
|
+
- Array of objects: \`{ label, value, icon, disabled, to, ... }\`.
|
|
234
|
+
- Supports special types: \`line\` (separator), \`group\` (headers), \`menu\` (nested submenus).
|
|
235
|
+
|
|
236
|
+
3. **Interaction:**
|
|
237
|
+
- **Selection:** Tracks selected values via \`v-model:selected\`.
|
|
238
|
+
- **Navigation:** Supports keyboard navigation (Arrows, Enter, Esc).
|
|
239
|
+
- **Async:** Can load data dynamically using the \`ajax\` prop.
|
|
240
|
+
|
|
241
|
+
**When to use:**
|
|
242
|
+
- **Dropdown Menus:** For user profile menus, settings, or navigation.
|
|
243
|
+
- **Context Menus:** For right-click actions.
|
|
244
|
+
- **Select-like UI:** When a standard select is not enough (needs icons, groups, custom rendering).
|
|
245
|
+
|
|
246
|
+
**Usage Examples:**
|
|
247
|
+
|
|
248
|
+
- **Basic Menu:**
|
|
249
|
+
\`<Menu :list="[{ label: 'Item 1' }, { label: 'Item 2' }]">
|
|
250
|
+
<template #control="{ binds }">
|
|
251
|
+
<button v-bind="binds">Options</button>
|
|
252
|
+
</template>
|
|
253
|
+
</Menu>\`
|
|
254
|
+
|
|
255
|
+
- **With Selection:**
|
|
256
|
+
\`<Menu
|
|
257
|
+
v-model:selected="currentValue"
|
|
258
|
+
:list="options"
|
|
259
|
+
>
|
|
260
|
+
<template #control="{ binds }">
|
|
261
|
+
<button v-bind="binds">Select: {{ currentValue }}</button>
|
|
262
|
+
</template>
|
|
263
|
+
</Menu>\`
|
|
264
|
+
`
|
|
209
265
|
}
|
|
210
266
|
}
|
|
@@ -8,19 +8,19 @@ import type { StorybookComponentsDescriptionItem } from '../../types/storybookTy
|
|
|
8
8
|
export const wikiDescriptionsModal: StorybookComponentsDescriptionItem = {
|
|
9
9
|
name: 'Modal',
|
|
10
10
|
description: {
|
|
11
|
-
en: 'Simplified wrapper over Window component for creating centered modal dialogs',
|
|
11
|
+
en: 'Simplified wrapper over a Window component for creating centered modal dialogs',
|
|
12
12
|
ru: 'Упрощенная обертка над компонентом Window для создания центрированных модальных диалогов'
|
|
13
13
|
},
|
|
14
14
|
possibilities: {
|
|
15
15
|
en: [
|
|
16
16
|
'pre-configured modal window with centered positioning',
|
|
17
17
|
'overlay backdrop with background blocking',
|
|
18
|
-
'close on ESC key and click outside',
|
|
18
|
+
'close on the ESC key and click outside',
|
|
19
19
|
'integration with scrollbar for long content',
|
|
20
20
|
'slots for title, content and footer customization',
|
|
21
21
|
'lifecycle events (preparation, opening, closing)',
|
|
22
|
-
'close button with customizable icon',
|
|
23
|
-
'programmatic control via v-model:open',
|
|
22
|
+
'close a button with a customizable icon',
|
|
23
|
+
'programmatic control via a v-model:open',
|
|
24
24
|
'focus management and keyboard navigation',
|
|
25
25
|
'responsive design with mobile optimization'
|
|
26
26
|
],
|
|
@@ -56,7 +56,7 @@ export const wikiDescriptionsModal: StorybookComponentsDescriptionItem = {
|
|
|
56
56
|
<p>Use modals sparingly and only for content that genuinely requires immediate attention. Ensure modals have clear actions (confirm/cancel), provide easy ways to dismiss them, and avoid nesting modals within modals. The component should be large enough to display content comfortably but not so large that it overwhelms the screen.</p>
|
|
57
57
|
|
|
58
58
|
<h4>Relationship with Window</h4>
|
|
59
|
-
<p>Modal is essentially Window with <code>adaptive="modal"</code> preset, simplifying the usage for standard dialog scenarios. All Window properties, slots, and events are available in Modal component.</p>
|
|
59
|
+
<p>Modal is essentially Window with <code>adaptive="modal"</code> preset, simplifying the usage for standard dialog scenarios. All Window properties, slots, and events are available in a Modal component.</p>
|
|
60
60
|
</template>
|
|
61
61
|
</DesignComponent>
|
|
62
62
|
`,
|
|
@@ -98,7 +98,7 @@ export const wikiDescriptionsModal: StorybookComponentsDescriptionItem = {
|
|
|
98
98
|
|
|
99
99
|
<template #default>
|
|
100
100
|
<h4>Default Slot Content</h4>
|
|
101
|
-
<p>This is the main content area of the modal. You can place any content here including text, forms, images, or other components.</p>
|
|
101
|
+
<p>This is the main content area of the modal. You can place any content here, including text, forms, images, or other components.</p>
|
|
102
102
|
|
|
103
103
|
<div class="wiki-storybook-info">
|
|
104
104
|
<strong>Available slots:</strong>
|
|
@@ -141,5 +141,60 @@ export const wikiDescriptionsModal: StorybookComponentsDescriptionItem = {
|
|
|
141
141
|
<Canvas of={Component.ModalAllSlots}/>
|
|
142
142
|
<StorybookDescriptions componentName={'Window'} type={'slots'}/>
|
|
143
143
|
`
|
|
144
|
+
},
|
|
145
|
+
ai: {
|
|
146
|
+
render: `
|
|
147
|
+
<div :class="classDemo.item">
|
|
148
|
+
<Modal embedded open v-bind="args">
|
|
149
|
+
<template #default>
|
|
150
|
+
<p>This is a modal dialog.</p>
|
|
151
|
+
</template>
|
|
152
|
+
</Modal>
|
|
153
|
+
</div>
|
|
154
|
+
`,
|
|
155
|
+
description: `
|
|
156
|
+
Modal is a simplified wrapper over the Window component for creating centered modal dialogs.
|
|
157
|
+
It is designed to handle standard use cases for pop-ups, alerts, and forms with minimal configuration.
|
|
158
|
+
|
|
159
|
+
**Note:** The \`embedded\` prop is used only for documentation examples to render the component inline. Do not use it in production code.
|
|
160
|
+
|
|
161
|
+
**Key Features:**
|
|
162
|
+
1. **Positioning & Overlay:**
|
|
163
|
+
- Always centered on the screen.
|
|
164
|
+
- Renders a backdrop (overlay) to block background interactions.
|
|
165
|
+
- Preset \`adaptive="modal"\` ensures correct behavior on all devices.
|
|
166
|
+
|
|
167
|
+
2. **State Management:**
|
|
168
|
+
- Controlled via \`v-model:open\` (boolean).
|
|
169
|
+
- Automatically manages focus and scroll locking on the body.
|
|
170
|
+
|
|
171
|
+
3. **Slots Structure:**
|
|
172
|
+
- \`#control\`: The trigger element (e.g., button). Receives \`binds\` (click handlers) to automatically toggle the modal.
|
|
173
|
+
- \`#title\`: The header area of the modal.
|
|
174
|
+
- \`#default\`: The main content body.
|
|
175
|
+
- \`#footer\`: The footer area, typically for action buttons.
|
|
176
|
+
|
|
177
|
+
4. **User Interaction:**
|
|
178
|
+
- Closes on ESC key press.
|
|
179
|
+
- Closes on clicking outside the modal (backdrop).
|
|
180
|
+
- Supports a close button in the header.
|
|
181
|
+
|
|
182
|
+
**Usage Examples:**
|
|
183
|
+
|
|
184
|
+
- **With Trigger Button:**
|
|
185
|
+
\`<Modal>
|
|
186
|
+
<template #control="{ binds }">
|
|
187
|
+
<button v-bind="binds">Open Modal</button>
|
|
188
|
+
</template>
|
|
189
|
+
<template #default>
|
|
190
|
+
<p>Are you sure?</p>
|
|
191
|
+
</template>
|
|
192
|
+
</Modal>\`
|
|
193
|
+
|
|
194
|
+
- **Programmatic Control:**
|
|
195
|
+
\`<Modal v-model:open="showModal">
|
|
196
|
+
<p>Content...</p>
|
|
197
|
+
</Modal>\`
|
|
198
|
+
`
|
|
144
199
|
}
|
|
145
200
|
}
|
|
@@ -208,5 +208,62 @@ export const wikiDescriptionsMotionTransform: StorybookComponentsDescriptionItem
|
|
|
208
208
|
slots: `
|
|
209
209
|
<StorybookDescriptions componentName={'MotionTransform'} type={'slots'}/>
|
|
210
210
|
`
|
|
211
|
+
},
|
|
212
|
+
ai: {
|
|
213
|
+
render: `
|
|
214
|
+
<div :class="classDemo.item">
|
|
215
|
+
<MotionTransform :auto-close="false" v-bind="args">
|
|
216
|
+
<template #head>
|
|
217
|
+
<button class="wiki-storybook-button">Toggle Content</button>
|
|
218
|
+
</template>
|
|
219
|
+
<template #body>
|
|
220
|
+
<div class="wiki-storybook-item--padding">
|
|
221
|
+
<p>Expandable content goes here.</p>
|
|
222
|
+
</div>
|
|
223
|
+
</template>
|
|
224
|
+
</MotionTransform>
|
|
225
|
+
</div>
|
|
226
|
+
`,
|
|
227
|
+
description: `
|
|
228
|
+
MotionTransform is a core utility component for creating expanding, collapsing, or floating UI elements with smooth animations.
|
|
229
|
+
It serves as the base for Dropdowns, Accordions, and custom interactive panels.
|
|
230
|
+
|
|
231
|
+
**Key Features:**
|
|
232
|
+
1. **Structure:**
|
|
233
|
+
- \`#head\`: The trigger area (e.g., a button or title).
|
|
234
|
+
- \`#body\`: The content area that animates in/out.
|
|
235
|
+
|
|
236
|
+
2. **Animation Logic:**
|
|
237
|
+
- Automatically handles height calculations for smooth CSS transitions (expand/collapse).
|
|
238
|
+
- \`animationHeadPosition\`: Controls the visual flow (e.g., \`top\` for standard dropdowns, \`toBottom\` for specific motion effects).
|
|
239
|
+
|
|
240
|
+
3. **Positioning & Teleport:**
|
|
241
|
+
- **Inline (Default):** Content expands within the flow (Accordion style).
|
|
242
|
+
- **Teleported:** With \`teleport\`, content moves to the \`<body>\` tag, useful for floating menus/popups that need to overlay other content.
|
|
243
|
+
|
|
244
|
+
4. **Interaction:**
|
|
245
|
+
- \`clickOpen\`: Toggles state when clicking the head.
|
|
246
|
+
- \`autoClose\`: Closes when clicking outside the component.
|
|
247
|
+
- \`ignore\`: Selectors to exclude from the "click outside" check.
|
|
248
|
+
|
|
249
|
+
**When to use:**
|
|
250
|
+
- **Accordion/Collapse:** When clicking a header should push content down.
|
|
251
|
+
- **Dropdown/Menu:** When clicking a button should show a floating list (use with \`teleport\`).
|
|
252
|
+
- **Custom Toggles:** Any UI pattern requiring show/hide transitions.
|
|
253
|
+
|
|
254
|
+
**Usage Examples:**
|
|
255
|
+
|
|
256
|
+
- **Accordion:**
|
|
257
|
+
\`<MotionTransform click-open>
|
|
258
|
+
<template #head>Title</template>
|
|
259
|
+
<template #body>Content</template>
|
|
260
|
+
</MotionTransform>\`
|
|
261
|
+
|
|
262
|
+
- **Floating Menu:**
|
|
263
|
+
\`<MotionTransform teleport auto-close>
|
|
264
|
+
<template #head><button>Options</button></template>
|
|
265
|
+
<template #body><menu>...</menu></template>
|
|
266
|
+
</MotionTransform>\`
|
|
267
|
+
`
|
|
211
268
|
}
|
|
212
269
|
}
|