@dxtmisha/wiki 0.24.3 → 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 +8 -8
- package/src/classes/WikiStorybook.ts +92 -1
- package/src/classes/WikiStorybookItem.ts +79 -5
- package/src/classes/WikiStorybookProp.ts +109 -0
- package/src/library.ts +1 -0
- package/src/media/descriptions/wikiDescriptions.ts +32 -0
- package/src/media/descriptions/wikiDescriptionsAccordion.ts +204 -0
- package/src/media/descriptions/wikiDescriptionsActionSheet.ts +264 -0
- package/src/media/descriptions/wikiDescriptionsActions.ts +189 -0
- package/src/media/descriptions/wikiDescriptionsAnchor.ts +78 -0
- package/src/media/descriptions/wikiDescriptionsArrow.ts +214 -0
- package/src/media/descriptions/wikiDescriptionsBadge.ts +43 -0
- package/src/media/descriptions/wikiDescriptionsBars.ts +33 -0
- package/src/media/descriptions/wikiDescriptionsBlock.ts +159 -0
- package/src/media/descriptions/wikiDescriptionsButton.ts +32 -1
- package/src/media/descriptions/wikiDescriptionsCell.ts +26 -1
- package/src/media/descriptions/wikiDescriptionsChip.ts +42 -0
- package/src/media/descriptions/wikiDescriptionsChipGroup.ts +199 -0
- package/src/media/descriptions/wikiDescriptionsDialog.ts +226 -0
- package/src/media/descriptions/wikiDescriptionsField.ts +57 -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 +91 -7
- package/src/media/descriptions/wikiDescriptionsInput.ts +313 -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 +179 -0
- package/src/media/descriptions/wikiDescriptionsModal.ts +200 -0
- package/src/media/descriptions/wikiDescriptionsMotionTransform.ts +59 -6
- 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 +253 -0
- package/src/media/descriptions/wikiDescriptionsSelectValue.ts +107 -0
- package/src/media/descriptions/wikiDescriptionsSkeleton.ts +42 -1
- package/src/media/descriptions/wikiDescriptionsTextareaAutosize.ts +80 -0
- package/src/media/descriptions/wikiDescriptionsTooltip.ts +136 -0
- package/src/media/descriptions/wikiDescriptionsWindow.ts +60 -0
- package/src/media/functional/en/conversions.mdx +67 -0
- package/src/media/functional/en/dataUtils.mdx +25 -0
- package/src/media/functional/en/datetimeRef.mdx +1 -1
- package/src/media/functional/en/eventRef.mdx +1 -1
- package/src/media/functional/en/executionUtils.mdx +58 -0
- package/src/media/functional/en/geoFlagRef.mdx +1 -1
- package/src/media/functional/en/geoIntlRef.mdx +1 -1
- package/src/media/functional/en/geoRef.mdx +2 -2
- package/src/media/functional/en/meta.mdx +1206 -0
- package/src/media/functional/en/metaManager.mdx +376 -0
- package/src/media/functional/en/metaOg.mdx +694 -0
- package/src/media/functional/en/metaTwitter.mdx +853 -0
- package/src/media/functional/en/reactive.mdx +40 -0
- package/src/media/functional/en/refTypes.mdx +1 -1
- package/src/media/functional/en/useApiRef.mdx +5 -5
- package/src/media/functional/en/useMeta.mdx +431 -0
- package/src/media/functional/en/validationUtils.mdx +11 -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/functional/ru/conversions.mdx +67 -0
- package/src/media/functional/ru/dataUtils.mdx +25 -0
- package/src/media/functional/ru/datetimeRef.mdx +2 -2
- package/src/media/functional/ru/eventRef.mdx +1 -1
- package/src/media/functional/ru/executionUtils.mdx +58 -0
- package/src/media/functional/ru/geoFlagRef.mdx +1 -1
- package/src/media/functional/ru/geoIntl.mdx +2 -2
- package/src/media/functional/ru/geoIntlRef.mdx +1 -1
- package/src/media/functional/ru/geoRef.mdx +2 -2
- package/src/media/functional/ru/listTypes.mdx +1 -1
- package/src/media/functional/ru/meta.mdx +1330 -0
- package/src/media/functional/ru/metaManager.mdx +376 -0
- package/src/media/functional/ru/metaOg.mdx +694 -0
- package/src/media/functional/ru/metaTwitter.mdx +853 -0
- package/src/media/functional/ru/reactive.mdx +40 -0
- package/src/media/functional/ru/refTypes.mdx +2 -2
- package/src/media/functional/ru/useApiRef.mdx +5 -5
- package/src/media/functional/ru/useMeta.mdx +431 -0
- package/src/media/functional/ru/validationUtils.mdx +11 -0
- package/src/media/mdx/Accordion/accordion.en.mdx +59 -0
- package/src/media/mdx/Accordion/accordion.ru.mdx +59 -0
- package/src/media/mdx/Accordion/slots.en.mdx +6 -0
- package/src/media/mdx/Accordion/slots.ru.mdx +6 -0
- package/src/media/mdx/Accordion/wikiMdxAccordion.ts +25 -0
- package/src/media/mdx/ActionSheet/actionSheet.en.mdx +61 -0
- package/src/media/mdx/ActionSheet/actionSheet.ru.mdx +61 -0
- package/src/media/mdx/ActionSheet/touchClose.en.mdx +21 -0
- package/src/media/mdx/ActionSheet/touchClose.ru.mdx +21 -0
- package/src/media/mdx/ActionSheet/wikiMdxActionSheet.ts +25 -0
- package/src/media/mdx/Actions/actions.en.mdx +48 -0
- package/src/media/mdx/Actions/actions.ru.mdx +48 -0
- package/src/media/mdx/Actions/flexible.en.mdx +19 -0
- package/src/media/mdx/Actions/flexible.ru.mdx +19 -0
- package/src/media/mdx/Actions/list.en.mdx +50 -0
- package/src/media/mdx/Actions/list.ru.mdx +50 -0
- package/src/media/mdx/Actions/wikiMdxActions.ts +31 -0
- package/src/media/mdx/Anchor/anchor.en.mdx +34 -0
- package/src/media/mdx/Anchor/anchor.ru.mdx +34 -0
- package/src/media/mdx/Anchor/expose.go.en.mdx +6 -0
- package/src/media/mdx/Anchor/expose.go.ru.mdx +6 -0
- package/src/media/mdx/Anchor/hide.en.mdx +28 -0
- package/src/media/mdx/Anchor/hide.ru.mdx +28 -0
- package/src/media/mdx/Anchor/isCopy.en.mdx +23 -0
- package/src/media/mdx/Anchor/isCopy.ru.mdx +23 -0
- package/src/media/mdx/Anchor/scroll.en.mdx +34 -0
- package/src/media/mdx/Anchor/scroll.ru.mdx +35 -0
- package/src/media/mdx/Anchor/wikiMdxAnchor.ts +43 -0
- package/src/media/mdx/Arrow/arrow.en.mdx +33 -0
- package/src/media/mdx/Arrow/arrow.ru.mdx +33 -0
- package/src/media/mdx/Arrow/wikiMdxArrow.ts +19 -0
- package/src/media/mdx/Block/block.en.mdx +42 -0
- package/src/media/mdx/Block/block.ru.mdx +42 -0
- package/src/media/mdx/Block/wikiMdxBlock.ts +19 -0
- package/src/media/mdx/ChipGroup/chipGroup.en.mdx +51 -0
- package/src/media/mdx/ChipGroup/chipGroup.ru.mdx +51 -0
- package/src/media/mdx/ChipGroup/selected.en.mdx +50 -0
- package/src/media/mdx/ChipGroup/selected.ru.mdx +50 -0
- package/src/media/mdx/ChipGroup/wikiMdxChipGroup.ts +25 -0
- package/src/media/mdx/Dialog/buttons.en.mdx +45 -0
- package/src/media/mdx/Dialog/buttons.ru.mdx +45 -0
- package/src/media/mdx/Dialog/dialog.en.mdx +66 -0
- package/src/media/mdx/Dialog/dialog.ru.mdx +65 -0
- package/src/media/mdx/Dialog/events.en.mdx +63 -0
- package/src/media/mdx/Dialog/events.ru.mdx +63 -0
- package/src/media/mdx/Dialog/states.en.mdx +58 -0
- package/src/media/mdx/Dialog/states.ru.mdx +57 -0
- package/src/media/mdx/Dialog/wikiMdxDialog.ts +37 -0
- package/src/media/mdx/Field/arrows.en.mdx +22 -6
- package/src/media/mdx/Field/arrows.ru.mdx +22 -6
- package/src/media/mdx/Field/slots.en.mdx +0 -13
- package/src/media/mdx/Field/slots.ru.mdx +0 -13
- 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/img-tag.en.mdx +105 -0
- package/src/media/mdx/Image/img-tag.ru.mdx +105 -0
- package/src/media/mdx/Image/wikiMdxImage.ts +12 -0
- package/src/media/mdx/Input/currency.en.mdx +38 -0
- package/src/media/mdx/Input/currency.ru.mdx +38 -0
- package/src/media/mdx/Input/date.en.mdx +53 -0
- package/src/media/mdx/Input/date.ru.mdx +53 -0
- package/src/media/mdx/Input/input.en.mdx +143 -0
- package/src/media/mdx/Input/input.ru.mdx +71 -0
- package/src/media/mdx/Input/mask.en.mdx +30 -0
- package/src/media/mdx/Input/mask.ru.mdx +30 -0
- package/src/media/mdx/Input/number.en.mdx +41 -0
- package/src/media/mdx/Input/number.ru.mdx +41 -0
- package/src/media/mdx/Input/type.en.mdx +26 -0
- package/src/media/mdx/Input/type.ru.mdx +26 -0
- package/src/media/mdx/Input/wikiMdxInput.ts +49 -0
- package/src/media/mdx/Menu/event.updateValue.en.mdx +29 -0
- package/src/media/mdx/Menu/event.updateValue.ru.mdx +30 -0
- package/src/media/mdx/Menu/expose.navigation.en.mdx +12 -0
- package/src/media/mdx/Menu/expose.navigation.ru.mdx +12 -0
- package/src/media/mdx/Menu/navigation.en.mdx +56 -0
- package/src/media/mdx/Menu/navigation.ru.mdx +56 -0
- package/src/media/mdx/Menu/slots.control.en.mdx +65 -0
- package/src/media/mdx/Menu/slots.control.ru.mdx +65 -0
- package/src/media/mdx/Menu/slots.en.mdx +2 -24
- package/src/media/mdx/Menu/slots.ru.mdx +2 -24
- package/src/media/mdx/Menu/wikiMdxMenu.ts +27 -3
- package/src/media/mdx/Modal/differences.en.mdx +130 -0
- package/src/media/mdx/Modal/differences.ru.mdx +65 -0
- package/src/media/mdx/Modal/modal.en.mdx +63 -0
- package/src/media/mdx/Modal/modal.ru.mdx +63 -0
- package/src/media/mdx/Modal/wikiMdxModal.ts +25 -0
- package/src/media/mdx/MotionTransform/expose.motionTransformElement.en.mdx +13 -0
- package/src/media/mdx/MotionTransform/expose.motionTransformElement.ru.mdx +14 -0
- package/src/media/mdx/MotionTransform/wikiMdxMotionTransform.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/Select/select.en.mdx +69 -0
- package/src/media/mdx/Select/select.ru.mdx +69 -0
- package/src/media/mdx/Select/wikiMdxSelect.ts +19 -0
- package/src/media/mdx/SelectValue/selectValue.en.mdx +64 -0
- package/src/media/mdx/SelectValue/selectValue.ru.mdx +64 -0
- package/src/media/mdx/SelectValue/wikiMdxSelectValue.ts +19 -0
- package/src/media/mdx/TextareaAutosize/textarea-autosize.en.mdx +65 -0
- package/src/media/mdx/TextareaAutosize/textarea-autosize.ru.mdx +65 -0
- package/src/media/mdx/TextareaAutosize/wikiMdxTextareaAutosize.ts +19 -0
- package/src/media/mdx/Tooltip/event.tooltip.en.mdx +7 -0
- package/src/media/mdx/Tooltip/event.tooltip.ru.mdx +8 -0
- package/src/media/mdx/Tooltip/slot.control.en.mdx +14 -0
- package/src/media/mdx/Tooltip/slot.control.ru.mdx +14 -0
- package/src/media/mdx/Tooltip/tooltip.en.mdx +34 -0
- package/src/media/mdx/Tooltip/tooltip.ru.mdx +34 -0
- package/src/media/mdx/Tooltip/wikiMdxTooltip.ts +31 -0
- package/src/media/mdx/Window/classes.ru.mdx +1 -1
- package/src/media/mdx/event/events.actions.en.mdx +44 -0
- package/src/media/mdx/event/events.actions.ru.mdx +44 -0
- package/src/media/mdx/event/events.inputStandard.en.mdx +6 -0
- package/src/media/mdx/event/events.inputStandard.ru.mdx +6 -0
- package/src/media/mdx/event/wikiMdxEvent.ts +20 -8
- package/src/media/mdx/expose/expose.clear.en.mdx +1 -1
- package/src/media/mdx/expose/expose.descriptionId.en.mdx +6 -0
- package/src/media/mdx/expose/expose.descriptionId.ru.mdx +6 -0
- package/src/media/mdx/expose/expose.id.en.mdx +6 -0
- package/src/media/mdx/expose/expose.id.ru.mdx +6 -0
- package/src/media/mdx/expose/expose.labelId.en.mdx +6 -0
- package/src/media/mdx/expose/expose.labelId.ru.mdx +6 -0
- package/src/media/mdx/expose/wikiMdxExpose.ts +18 -0
- package/src/media/mdx/slot/body.en.mdx +6 -0
- package/src/media/mdx/slot/body.ru.mdx +6 -0
- package/src/media/mdx/slot/headline.en.mdx +7 -0
- package/src/media/mdx/slot/headline.ru.mdx +6 -0
- package/src/media/mdx/slot/leading.en.mdx +7 -0
- package/src/media/mdx/slot/leading.ru.mdx +7 -0
- package/src/media/mdx/slot/secondary.en.mdx +5 -0
- package/src/media/mdx/slot/secondary.ru.mdx +5 -0
- package/src/media/mdx/slot/trailing.en.mdx +7 -0
- package/src/media/mdx/slot/trailing.ru.mdx +7 -0
- package/src/media/mdx/slot/wikiMdxSlot.ts +30 -0
- package/src/media/mdx/style/isSkeleton.en.mdx +2 -2
- package/src/media/mdx/style/isSkeleton.ru.mdx +2 -2
- package/src/media/mdx/value/v-model-selected.en.mdx +28 -0
- package/src/media/mdx/value/v-model-selected.ru.mdx +28 -0
- package/src/media/mdx/value/v-model.en.mdx +26 -0
- package/src/media/mdx/value/v-model.ru.mdx +26 -0
- package/src/media/mdx/value/wikiMdxValue.ts +24 -3
- package/src/media/mdx/wikiMdx.ts +33 -1
- package/src/media/props/wiki.ts +44 -0
- package/src/media/props/wikiActions.ts +43 -0
- package/src/media/props/wikiActionsInclude.ts +62 -0
- package/src/media/props/wikiAnchor.ts +85 -0
- package/src/media/props/wikiAria.ts +123 -0
- package/src/media/props/wikiArrow.ts +24 -0
- package/src/media/props/wikiArrowInclude.ts +45 -0
- 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 +82 -0
- package/src/media/props/wikiButton.ts +8 -4
- package/src/media/props/wikiChip.ts +4 -2
- package/src/media/props/wikiChipGroup.ts +39 -0
- package/src/media/props/wikiDialog.ts +33 -0
- package/src/media/props/wikiField.ts +18 -31
- package/src/media/props/wikiFieldCounterInclude.ts +87 -0
- package/src/media/props/wikiForm.ts +267 -0
- package/src/media/props/wikiHook.ts +20 -0
- package/src/media/props/wikiIcon.ts +19 -6
- package/src/media/props/wikiIconInclude.ts +322 -0
- package/src/media/props/wikiImage.ts +97 -20
- package/src/media/props/wikiInformation.ts +164 -0
- package/src/media/props/wikiInput.ts +34 -0
- package/src/media/props/wikiList.ts +10 -4
- package/src/media/props/wikiListItem.ts +23 -2
- package/src/media/props/wikiMask.ts +2 -12
- package/src/media/props/wikiMaskInclude.ts +54 -0
- package/src/media/props/wikiMenu.ts +1 -11
- package/src/media/props/wikiMotionTransform.ts +7 -13
- package/src/media/props/wikiOption.ts +356 -0
- package/src/media/props/wikiProgress.ts +8 -5
- package/src/media/props/wikiScrollbar.ts +6 -6
- package/src/media/props/wikiSelect.ts +68 -0
- package/src/media/props/wikiSelectValue.ts +30 -0
- package/src/media/props/wikiStatus.ts +34 -57
- package/src/media/props/wikiStyle.ts +85 -406
- package/src/media/props/wikiTechnical.ts +141 -1
- package/src/media/props/wikiText.ts +167 -0
- package/src/media/props/wikiTooltip.ts +53 -0
- package/src/media/props/wikiValue.ts +22 -276
- package/src/media/props/wikiWindow.ts +24 -45
- package/src/shims-mdx.d.ts +5 -0
- package/src/styles/storybookStyle.scss +3 -1
- package/src/types/storybookTypes.ts +48 -4
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import type { StorybookComponentsDescriptionItem } from '../../types/storybookTypes'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Descriptions for ChipGroup component properties
|
|
5
|
+
*
|
|
6
|
+
* Описания свойств компонента ChipGroup
|
|
7
|
+
*/
|
|
8
|
+
export const wikiDescriptionsChipGroup: StorybookComponentsDescriptionItem = {
|
|
9
|
+
name: 'ChipGroup',
|
|
10
|
+
description: {
|
|
11
|
+
en: 'Component for managing a group of interactive chips with support for selection and data binding',
|
|
12
|
+
ru: 'Компонент для управления группой интерактивных чипов с поддержкой выбора и привязки данных'
|
|
13
|
+
},
|
|
14
|
+
possibilities: {
|
|
15
|
+
en: [
|
|
16
|
+
'rendering a list of chips from a data array',
|
|
17
|
+
'managing selection state (single or multiple)',
|
|
18
|
+
'customizing the appearance of all chips in the group via chipAttrs',
|
|
19
|
+
'handling click events and value updates',
|
|
20
|
+
'controlling icon visibility based on selection'
|
|
21
|
+
],
|
|
22
|
+
ru: [
|
|
23
|
+
'рендеринг списка чипов из массива данных',
|
|
24
|
+
'управление состоянием выбора (одиночный или множественный)',
|
|
25
|
+
'настройка внешнего вида всех чипов в группе через chipAttrs',
|
|
26
|
+
'обработка событий клика и обновлений значений',
|
|
27
|
+
'управление видимостью иконки в зависимости от выбора'
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
import: [
|
|
31
|
+
'import { ref } from \'vue\''
|
|
32
|
+
],
|
|
33
|
+
stories: [
|
|
34
|
+
{
|
|
35
|
+
id: 'ChipGroupBasic',
|
|
36
|
+
name: {
|
|
37
|
+
en: 'Basic',
|
|
38
|
+
ru: 'Базовые'
|
|
39
|
+
},
|
|
40
|
+
template: `
|
|
41
|
+
<div class="wiki-storybook-flex-column">
|
|
42
|
+
<div class="wiki-storybook-item wiki-storybook-item--padding wiki-storybook-item--auto">
|
|
43
|
+
<div class="wiki-storybook-item__label wiki-storybook-item__label--static">Default</div>
|
|
44
|
+
<DesignComponent :list="['Option 1', 'Option 2', 'Option 3']"/>
|
|
45
|
+
</div>
|
|
46
|
+
<div class="wiki-storybook-item wiki-storybook-item--padding wiki-storybook-item--auto">
|
|
47
|
+
<div class="wiki-storybook-item__label wiki-storybook-item__label--static">With icons</div>
|
|
48
|
+
<DesignComponent
|
|
49
|
+
:list="[
|
|
50
|
+
{ label: 'Home', icon: 'home' },
|
|
51
|
+
{ label: 'Star', icon: 'star' },
|
|
52
|
+
{ label: 'Heart', icon: 'favorite' }
|
|
53
|
+
]"
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
`
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: 'ChipGroupSelection',
|
|
61
|
+
name: {
|
|
62
|
+
en: 'Selection States',
|
|
63
|
+
ru: 'Состояния выбора'
|
|
64
|
+
},
|
|
65
|
+
template: `
|
|
66
|
+
<div class="wiki-storybook-flex-column">
|
|
67
|
+
<div class="wiki-storybook-item wiki-storybook-item--padding wiki-storybook-item--auto">
|
|
68
|
+
<div class="wiki-storybook-item__label wiki-storybook-item__label--static">Single selection</div>
|
|
69
|
+
<DesignComponent :list="['Option 1', 'Option 2', 'Option 3']" selected="2"/>
|
|
70
|
+
</div>
|
|
71
|
+
<div class="wiki-storybook-item wiki-storybook-item--padding wiki-storybook-item--auto">
|
|
72
|
+
<div class="wiki-storybook-item__label wiki-storybook-item__label--static">Multiple selection</div>
|
|
73
|
+
<DesignComponent :list="['Option 1', 'Option 2', 'Option 3', 'Option 4']" :selected="['2', '3']"/>
|
|
74
|
+
</div>
|
|
75
|
+
<div class="wiki-storybook-item wiki-storybook-item--padding wiki-storybook-item--auto">
|
|
76
|
+
<div class="wiki-storybook-item__label wiki-storybook-item__label--static">Icon when selected</div>
|
|
77
|
+
<DesignComponent
|
|
78
|
+
:list="[
|
|
79
|
+
{ label: 'Option 1', icon: 'check', value: 'option1' },
|
|
80
|
+
{ label: 'Option 2', icon: 'check', value: 'option2' },
|
|
81
|
+
{ label: 'Option 3', icon: 'check', value: 'option3' }
|
|
82
|
+
]"
|
|
83
|
+
:selected="['option2']"
|
|
84
|
+
:icon-when-selected="true"
|
|
85
|
+
/>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
`
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'ChipGroupVModel',
|
|
92
|
+
name: {
|
|
93
|
+
en: 'Two-way binding (v-model)',
|
|
94
|
+
ru: 'Двусторонняя привязка (v-model)'
|
|
95
|
+
},
|
|
96
|
+
setup: `
|
|
97
|
+
return {
|
|
98
|
+
selectedValue: ref('option2'),
|
|
99
|
+
multipleSelected: ref(['option1', 'option3'])
|
|
100
|
+
}
|
|
101
|
+
`,
|
|
102
|
+
template: `
|
|
103
|
+
<div class="wiki-storybook-flex-column">
|
|
104
|
+
<div class="wiki-storybook-item wiki-storybook-item--padding wiki-storybook-item--auto">
|
|
105
|
+
<div class="wiki-storybook-item__label wiki-storybook-item__label--static">Selected: {{ selectedValue }}</div>
|
|
106
|
+
<div class="wiki-storybook-flex-column">
|
|
107
|
+
<DesignComponent
|
|
108
|
+
v-model:selected="selectedValue"
|
|
109
|
+
:list="[
|
|
110
|
+
{ label: 'Option 1', value: 'option1' },
|
|
111
|
+
{ label: 'Option 2', value: 'option2' },
|
|
112
|
+
{ label: 'Option 3', value: 'option3' }
|
|
113
|
+
]"
|
|
114
|
+
:readonly="false"
|
|
115
|
+
/>
|
|
116
|
+
<div class="wiki-storybook-flex">
|
|
117
|
+
<button class="wiki-storybook-button" @click="selectedValue = 'option1'">Select 1</button>
|
|
118
|
+
<button class="wiki-storybook-button" @click="selectedValue = 'option2'">Select 2</button>
|
|
119
|
+
<button class="wiki-storybook-button" @click="selectedValue = undefined">Clear</button>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
|
|
124
|
+
<div class="wiki-storybook-item wiki-storybook-item--padding wiki-storybook-item--auto">
|
|
125
|
+
<div class="wiki-storybook-item__label wiki-storybook-item__label--static">Selected: {{ multipleSelected }}</div>
|
|
126
|
+
<div class="wiki-storybook-flex-column">
|
|
127
|
+
<DesignComponent
|
|
128
|
+
v-model:selected="multipleSelected"
|
|
129
|
+
:list="[
|
|
130
|
+
{ label: 'Option 1', value: 'option1', icon: 'check' },
|
|
131
|
+
{ label: 'Option 2', value: 'option2', icon: 'check' },
|
|
132
|
+
{ label: 'Option 3', value: 'option3', icon: 'check' }
|
|
133
|
+
]"
|
|
134
|
+
:readonly="false"
|
|
135
|
+
:icon-when-selected="true"
|
|
136
|
+
/>
|
|
137
|
+
<div class="wiki-storybook-flex">
|
|
138
|
+
<button class="wiki-storybook-button" @click="multipleSelected = ['option1', 'option2']">Select 1,2</button>
|
|
139
|
+
<button class="wiki-storybook-button" @click="multipleSelected = ['option1', 'option2', 'option3']">Add 3</button>
|
|
140
|
+
<button class="wiki-storybook-button" @click="multipleSelected = []">Clear all</button>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
`
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
documentation: {
|
|
149
|
+
body: `
|
|
150
|
+
<StorybookDescriptions componentName={'ChipGroup'} type={'chipGroup'}/>
|
|
151
|
+
<Canvas of={Component.ChipGroupBasic}/>
|
|
152
|
+
|
|
153
|
+
<StorybookDescriptions componentName={'ChipGroup'} type={'selected'}/>
|
|
154
|
+
<Canvas of={Component.ChipGroupSelection}/>
|
|
155
|
+
|
|
156
|
+
<StorybookDescriptions componentName={'Value'} type={'v-model:selected'}/>
|
|
157
|
+
<Canvas of={Component.ChipGroupVModel}/>
|
|
158
|
+
`,
|
|
159
|
+
events: `
|
|
160
|
+
<StorybookDescriptions componentName={'Event'} type={'click'}/>
|
|
161
|
+
`,
|
|
162
|
+
slots: `
|
|
163
|
+
<StorybookDescriptions componentName={'Slot'} type={'default'}/>
|
|
164
|
+
`
|
|
165
|
+
},
|
|
166
|
+
ai: {
|
|
167
|
+
description: `
|
|
168
|
+
ChipGroup is a wrapper component that manages a collection of Chip elements based on a data list.
|
|
169
|
+
It streamlines the creation of filter sets, choice groups, and tag lists by handling data iteration and selection logic.
|
|
170
|
+
|
|
171
|
+
**Key Features:**
|
|
172
|
+
1. **Data Binding:**
|
|
173
|
+
- \`list\`: Array of objects defining the chips (e.g., \`[{ label: 'A', value: 'a' }]\`).
|
|
174
|
+
- \`v-model:selected\`: Tracks the selected value(s).
|
|
175
|
+
|
|
176
|
+
2. **Selection Modes:**
|
|
177
|
+
- Supports single and multiple selection (depending on configuration, typically inferred from the initial value type or explicit props).
|
|
178
|
+
|
|
179
|
+
3. **Styling & Customization:**
|
|
180
|
+
- \`chipAttrs\`: Object containing props to be passed to every child Chip (e.g., \`{ outline: true, icon: 'check' }\`).
|
|
181
|
+
- \`iconWhenSelected\`: If true, displays the icon only when the chip is selected.
|
|
182
|
+
|
|
183
|
+
**Usage Examples:**
|
|
184
|
+
|
|
185
|
+
- **Basic Selection:**
|
|
186
|
+
\`<ChipGroup
|
|
187
|
+
:list="items"
|
|
188
|
+
v-model:selected="selectedItem"
|
|
189
|
+
/>\`
|
|
190
|
+
|
|
191
|
+
- **Filter Group (Multiple):**
|
|
192
|
+
\`<ChipGroup
|
|
193
|
+
:list="filters"
|
|
194
|
+
v-model:selected="activeFilters"
|
|
195
|
+
:chip-attrs="{ outline: true }"
|
|
196
|
+
/>\`
|
|
197
|
+
`
|
|
198
|
+
}
|
|
199
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import type { StorybookComponentsDescriptionItem } from '../../types/storybookTypes'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Descriptions for Dialog component properties
|
|
5
|
+
*
|
|
6
|
+
* Описания свойств компонента Dialog
|
|
7
|
+
*/
|
|
8
|
+
export const wikiDescriptionsDialog: StorybookComponentsDescriptionItem = {
|
|
9
|
+
name: 'Dialog',
|
|
10
|
+
description: {
|
|
11
|
+
en: 'Modal dialog component for displaying alerts, confirmations, and informational messages with icon and action buttons',
|
|
12
|
+
ru: 'Модальный диалоговый компонент для отображения предупреждений, подтверждений и информационных сообщений с иконкой и кнопками действий'
|
|
13
|
+
},
|
|
14
|
+
possibilities: {
|
|
15
|
+
en: [
|
|
16
|
+
'modal dialog with centered positioning and backdrop',
|
|
17
|
+
'icon support with predefined success and error states',
|
|
18
|
+
'customizable title, description, and content areas',
|
|
19
|
+
'action buttons with OK and Close presets',
|
|
20
|
+
'image positioning (top or left alignment)',
|
|
21
|
+
'integration with Window, Bars, Actions, Icon components',
|
|
22
|
+
'close on ESC key and backdrop click',
|
|
23
|
+
'programmatic control via v-model:open',
|
|
24
|
+
'automatic icon switching based on success/error states',
|
|
25
|
+
'flexible content layout with information block',
|
|
26
|
+
'customizable footer with action buttons',
|
|
27
|
+
'keyboard accessibility and focus management',
|
|
28
|
+
'responsive design with mobile optimization',
|
|
29
|
+
'support for custom button configurations'
|
|
30
|
+
],
|
|
31
|
+
ru: [
|
|
32
|
+
'модальный диалог с центрированием и подложкой',
|
|
33
|
+
'поддержка иконок с предустановленными состояниями успеха и ошибки',
|
|
34
|
+
'настраиваемые области заголовка, описания и контента',
|
|
35
|
+
'кнопки действий с пресетами OK и Закрыть',
|
|
36
|
+
'позиционирование изображения (сверху или слева)',
|
|
37
|
+
'интеграция с компонентами Window, Bars, Actions, Icon',
|
|
38
|
+
'закрытие по ESC и клику на подложку',
|
|
39
|
+
'программное управление через v-model:open',
|
|
40
|
+
'автоматическое переключение иконки на основе состояний успеха/ошибки',
|
|
41
|
+
'гибкая компоновка контента с информационным блоком',
|
|
42
|
+
'настраиваемый футер с кнопками действий',
|
|
43
|
+
'доступность с клавиатуры и управление фокусом',
|
|
44
|
+
'адаптивный дизайн с оптимизацией для мобильных',
|
|
45
|
+
'поддержка пользовательских конфигураций кнопок'
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
import: [
|
|
49
|
+
'import { ref } from \'vue\''
|
|
50
|
+
],
|
|
51
|
+
render: `
|
|
52
|
+
<DesignComponent v-bind="args">
|
|
53
|
+
<template #control="{binds}">
|
|
54
|
+
<button class="wiki-storybook-button" v-bind="binds">Open Dialog</button>
|
|
55
|
+
</template>
|
|
56
|
+
</DesignComponent>
|
|
57
|
+
`,
|
|
58
|
+
stories: [
|
|
59
|
+
{
|
|
60
|
+
id: 'DialogStates',
|
|
61
|
+
name: {
|
|
62
|
+
en: 'Success and error states',
|
|
63
|
+
ru: 'Состояния успеха и ошибки'
|
|
64
|
+
},
|
|
65
|
+
setup: `
|
|
66
|
+
return {
|
|
67
|
+
openSuccess: ref(false),
|
|
68
|
+
openError: ref(false)
|
|
69
|
+
}
|
|
70
|
+
`,
|
|
71
|
+
template: `
|
|
72
|
+
<div class="wiki-storybook-flex">
|
|
73
|
+
<DesignComponent
|
|
74
|
+
:success="true"
|
|
75
|
+
label="Operation Successful"
|
|
76
|
+
description="Your changes have been saved successfully."
|
|
77
|
+
>
|
|
78
|
+
<template #control="{binds}">
|
|
79
|
+
<button class="wiki-storybook-button" v-bind="binds">Success Dialog</button>
|
|
80
|
+
</template>
|
|
81
|
+
</DesignComponent>
|
|
82
|
+
|
|
83
|
+
<DesignComponent
|
|
84
|
+
:error="true"
|
|
85
|
+
label="Operation Failed"
|
|
86
|
+
description="An error occurred while processing your request. Please try again."
|
|
87
|
+
>
|
|
88
|
+
<template #control="{binds}">
|
|
89
|
+
<button class="wiki-storybook-button" v-bind="binds">Error Dialog</button>
|
|
90
|
+
</template>
|
|
91
|
+
</DesignComponent>
|
|
92
|
+
</div>
|
|
93
|
+
`
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: 'DialogVModel',
|
|
97
|
+
name: {
|
|
98
|
+
en: 'Two-way binding (v-model)',
|
|
99
|
+
ru: 'Двусторонняя привязка (v-model)'
|
|
100
|
+
},
|
|
101
|
+
setup: `
|
|
102
|
+
return {
|
|
103
|
+
open: ref(false)
|
|
104
|
+
}
|
|
105
|
+
`,
|
|
106
|
+
template: `
|
|
107
|
+
<button class="wiki-storybook-button" @click="open = true">Open via v-model ({{ open }})</button>
|
|
108
|
+
|
|
109
|
+
<DesignComponent
|
|
110
|
+
v-model:open="open"
|
|
111
|
+
label="Confirmation"
|
|
112
|
+
description="Are you sure you want to proceed with this action?"
|
|
113
|
+
/>
|
|
114
|
+
`
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
id: 'DialogAllSlots',
|
|
118
|
+
name: {
|
|
119
|
+
en: 'All slots demonstration',
|
|
120
|
+
ru: 'Демонстрация всех слотов'
|
|
121
|
+
},
|
|
122
|
+
template: `
|
|
123
|
+
<DesignComponent>
|
|
124
|
+
<template #control="{binds}">
|
|
125
|
+
<button class="wiki-storybook-button" v-bind="binds">Open Dialog with All Slots</button>
|
|
126
|
+
</template>
|
|
127
|
+
|
|
128
|
+
<template #title>
|
|
129
|
+
Title Slot
|
|
130
|
+
</template>
|
|
131
|
+
|
|
132
|
+
<template #label>
|
|
133
|
+
<strong>Label Slot</strong>
|
|
134
|
+
</template>
|
|
135
|
+
|
|
136
|
+
<template #description>
|
|
137
|
+
<em>Description Slot</em>
|
|
138
|
+
</template>
|
|
139
|
+
|
|
140
|
+
<template #default>
|
|
141
|
+
Default Slot
|
|
142
|
+
</template>
|
|
143
|
+
|
|
144
|
+
<template #footer="{classesWindow}">
|
|
145
|
+
Footer Slot
|
|
146
|
+
</template>
|
|
147
|
+
</DesignComponent>
|
|
148
|
+
`
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
documentation: {
|
|
152
|
+
body: `
|
|
153
|
+
<StorybookDescriptions componentName={'Dialog'} type={'dialog'}/>
|
|
154
|
+
|
|
155
|
+
<StorybookDescriptions componentName={'Dialog'} type={'states'}/>
|
|
156
|
+
<Canvas of={Component.DialogStates}/>
|
|
157
|
+
|
|
158
|
+
<StorybookDescriptions componentName={'Dialog'} type={'buttons'}/>
|
|
159
|
+
|
|
160
|
+
<StorybookDescriptions componentName={'Window'} type={'v-model'}/>
|
|
161
|
+
<Canvas of={Component.DialogVModel}/>
|
|
162
|
+
|
|
163
|
+
<StorybookDescriptions componentName={'Modal'} type={'differences'}/>
|
|
164
|
+
`,
|
|
165
|
+
events: `
|
|
166
|
+
<StorybookDescriptions componentName={'Dialog'} type={'events'}/>
|
|
167
|
+
<StorybookDescriptions componentName={'Dialog'} type={'event.dialog'}/>
|
|
168
|
+
<StorybookDescriptions componentName={'Window'} type={'event.window'}/>
|
|
169
|
+
<StorybookDescriptions componentName={'Event'} type={'bars'}/>
|
|
170
|
+
<StorybookDescriptions componentName={'Event'} type={'actions'}/>
|
|
171
|
+
`,
|
|
172
|
+
expose: `
|
|
173
|
+
<StorybookDescriptions componentName={'Window'} type={'expose'}/>
|
|
174
|
+
`,
|
|
175
|
+
slots: `
|
|
176
|
+
<Canvas of={Component.DialogAllSlots}/>
|
|
177
|
+
<StorybookDescriptions componentName={'Slot'} type={'label'}/>
|
|
178
|
+
<StorybookDescriptions componentName={'Slot'} type={'description'}/>
|
|
179
|
+
<StorybookDescriptions componentName={'Window'} type={'slots'}/>
|
|
180
|
+
`
|
|
181
|
+
},
|
|
182
|
+
ai: {
|
|
183
|
+
render: `
|
|
184
|
+
<div :class="classDemo.item">
|
|
185
|
+
<Dialog embedded open label="Dialog Title" description="This is a description text." v-bind="args"/>
|
|
186
|
+
</div>
|
|
187
|
+
`,
|
|
188
|
+
description: `
|
|
189
|
+
Dialog is a specialized modal component designed for standard user interactions such as alerts, confirmations, and status messages.
|
|
190
|
+
It extends the functionality of the Modal component by providing a pre-defined layout for icons, titles, descriptions, and action buttons.
|
|
191
|
+
|
|
192
|
+
**Note:** The \`embedded\` prop is used only for documentation examples to render the component inline. Do not use it in production code.
|
|
193
|
+
|
|
194
|
+
**Key Features:**
|
|
195
|
+
1. **Standardized Layout:**
|
|
196
|
+
- Automatically arranges elements: Icon -> Title (\`label\`) -> Description (\`description\`) -> Content (\`default\`) -> Actions (\`footer\`).
|
|
197
|
+
- Supports positioning the image/icon via \`imagePosition\` (e.g., top or left).
|
|
198
|
+
|
|
199
|
+
2. **State Presets:**
|
|
200
|
+
- **Success:** Setting the \`success\` prop automatically displays a success icon and applies relevant styling.
|
|
201
|
+
- **Error:** Setting the \`error\` prop automatically displays an error icon and applies relevant styling.
|
|
202
|
+
- **Custom:** You can provide a custom icon via the \`icon\` prop.
|
|
203
|
+
|
|
204
|
+
3. **Content Props:**
|
|
205
|
+
- \`label\`: The main heading or title of the dialog.
|
|
206
|
+
- \`description\`: Subtitle or explanatory text.
|
|
207
|
+
- \`open\`: Controls visibility (v-model).
|
|
208
|
+
|
|
209
|
+
4. **Slots:**
|
|
210
|
+
- \`#control\`: Trigger element.
|
|
211
|
+
- \`#default\`: Custom content area.
|
|
212
|
+
- \`#footer\`: Area for action buttons (Cancel, OK).
|
|
213
|
+
|
|
214
|
+
**Usage Examples:**
|
|
215
|
+
|
|
216
|
+
- **Simple Confirmation:**
|
|
217
|
+
\`<Dialog v-model:open="isOpen" label="Confirm Action" description="Are you sure you want to proceed?" />\`
|
|
218
|
+
|
|
219
|
+
- **Success Alert:**
|
|
220
|
+
\`<Dialog success label="Operation Successful" description="Your data has been saved." />\`
|
|
221
|
+
|
|
222
|
+
- **Error Alert:**
|
|
223
|
+
\`<Dialog error label="Error" description="Failed to connect to the server." />\`
|
|
224
|
+
`
|
|
225
|
+
}
|
|
226
|
+
}
|
|
@@ -34,8 +34,8 @@ export const wikiDescriptionsField: StorybookComponentsDescriptionItem = {
|
|
|
34
34
|
import: [],
|
|
35
35
|
render: `
|
|
36
36
|
<DesignComponent v-bind="args">
|
|
37
|
-
<template v-slot:default="{
|
|
38
|
-
<input :value="args.value"
|
|
37
|
+
<template v-slot:default="{binds}">
|
|
38
|
+
<input :value="args.value" readonly v-bind="binds"/>
|
|
39
39
|
</template>
|
|
40
40
|
</DesignComponent>
|
|
41
41
|
`,
|
|
@@ -230,7 +230,62 @@ export const wikiDescriptionsField: StorybookComponentsDescriptionItem = {
|
|
|
230
230
|
<StorybookDescriptions componentName={'Slot'} type={'prefix'} />
|
|
231
231
|
<StorybookDescriptions componentName={'Slot'} type={'suffix'} />
|
|
232
232
|
<StorybookDescriptions componentName={'Slot'} type={'caption'} />
|
|
233
|
+
<StorybookDescriptions componentName={'Slot'} type={'leading'} />
|
|
234
|
+
<StorybookDescriptions componentName={'Slot'} type={'trailing'} />
|
|
233
235
|
<StorybookDescriptions componentName={'Field'} type={'slots'} />
|
|
234
236
|
`
|
|
237
|
+
},
|
|
238
|
+
ai: {
|
|
239
|
+
render: `
|
|
240
|
+
<div :class="classDemo.item">
|
|
241
|
+
<Field label="Field Label" helper-message="Helper text" v-bind="args">
|
|
242
|
+
<template v-slot:default="{binds}">
|
|
243
|
+
<input :value="args.value" readonly v-bind="binds as any"/>
|
|
244
|
+
</template>
|
|
245
|
+
</Field>
|
|
246
|
+
</div>
|
|
247
|
+
`,
|
|
248
|
+
description: `
|
|
249
|
+
Field is the foundational wrapper component for all form inputs.
|
|
250
|
+
It provides the structural layout, styling, and state management for labels, messages, icons, and the input container.
|
|
251
|
+
|
|
252
|
+
**Key Features:**
|
|
253
|
+
1. **Layout Structure:**
|
|
254
|
+
- **Label:** Displays the field label (\`label\`).
|
|
255
|
+
- **Body:** The main container for the input.
|
|
256
|
+
- **Prefix/Suffix:** Content before/after the input (\`prefix\`, \`suffix\`).
|
|
257
|
+
- **Icons:** Leading (\`icon\`) and trailing (\`iconTrailing\`) icons.
|
|
258
|
+
- **Input Slot:** The \`#default\` slot for the actual form control (input, select, etc.).
|
|
259
|
+
- **Footer:** Displays helper text (\`helperMessage\`), validation errors (\`validationMessage\`), and character counter.
|
|
260
|
+
|
|
261
|
+
2. **Input Integration:**
|
|
262
|
+
- The \`#default\` slot exposes \`binds\` (id, class, aria-attributes).
|
|
263
|
+
- These \`binds\` **must** be applied to the native \`<input>\` or the focusable element within the slot to ensure proper styling and accessibility.
|
|
264
|
+
|
|
265
|
+
3. **States & Validation:**
|
|
266
|
+
- **Loading:** \`loading\` prop shows a progress bar.
|
|
267
|
+
- **Validation:** \`validationMessage\` turns the field red and displays the error.
|
|
268
|
+
- **Disabled/Readonly:** \`disabled\`, \`readonly\` props style the wrapper accordingly.
|
|
269
|
+
|
|
270
|
+
**When to use:**
|
|
271
|
+
- When creating a custom form component (e.g., DatePicker, ColorPicker) that needs to match the design system's input style.
|
|
272
|
+
- Do not use for standard text inputs; use \`Input\` instead.
|
|
273
|
+
|
|
274
|
+
**Usage Examples:**
|
|
275
|
+
|
|
276
|
+
- **Custom Input Wrapper:**
|
|
277
|
+
\`<Field label="Username" icon="person">
|
|
278
|
+
<template #default="{ binds }">
|
|
279
|
+
<input v-bind="binds" type="text" />
|
|
280
|
+
</template>
|
|
281
|
+
</Field>\`
|
|
282
|
+
|
|
283
|
+
- **With Validation:**
|
|
284
|
+
\`<Field label="Email" validation-message="Invalid email">
|
|
285
|
+
<template #default="{ binds }">
|
|
286
|
+
<input v-bind="binds" type="email" />
|
|
287
|
+
</template>
|
|
288
|
+
</Field>\`
|
|
289
|
+
`
|
|
235
290
|
}
|
|
236
291
|
}
|
|
@@ -63,5 +63,37 @@ export const wikiDescriptionsFieldCounter: StorybookComponentsDescriptionItem =
|
|
|
63
63
|
<StorybookDescriptions componentName={'FieldCounter'} type={'templates'}/>
|
|
64
64
|
<Canvas of={Component.FieldCounterTemplate}/>
|
|
65
65
|
`
|
|
66
|
+
},
|
|
67
|
+
ai: {
|
|
68
|
+
description: `
|
|
69
|
+
**Note:** This is a subcomponent of \`Field\`. You should generally not use it directly.
|
|
70
|
+
It is automatically integrated into components like \`Input\` and \`Textarea\`.
|
|
71
|
+
|
|
72
|
+
FieldCounter is a utility component designed to display character counts and limits for input fields.
|
|
73
|
+
It provides visual feedback to users about the length of their input and includes accessibility features for screen readers.
|
|
74
|
+
|
|
75
|
+
**Key Features:**
|
|
76
|
+
1. **Display Logic:**
|
|
77
|
+
- **Counter Only:** If \`maxlength\` is not set, displays the current count (e.g., "10").
|
|
78
|
+
- **With Limit:** If \`maxlength\` is set, displays "current / max" (e.g., "10 / 100").
|
|
79
|
+
- **Template:** The \`template\` prop allows custom formatting using placeholders \`[c]\` (counter) and \`[m]\` (max).
|
|
80
|
+
|
|
81
|
+
2. **Accessibility:**
|
|
82
|
+
- Automatically manages ARIA live regions to announce status to screen readers.
|
|
83
|
+
- \`maxlengthOnce\`: Determines when to start announcing remaining characters (default is 10% of max).
|
|
84
|
+
- Provides specific messages for "remaining characters" and "limit exceeded".
|
|
85
|
+
|
|
86
|
+
3. **Integration:**
|
|
87
|
+
- Typically used within \`Input\`, \`Textarea\`, or custom form wrappers.
|
|
88
|
+
- Accepts \`counter\` (current length) and \`maxlength\` (limit) as numbers or strings.
|
|
89
|
+
|
|
90
|
+
**Usage Examples:**
|
|
91
|
+
|
|
92
|
+
- **Standard Limit:**
|
|
93
|
+
\`<FieldCounter :counter="currentLength" :maxlength="50" />\`
|
|
94
|
+
|
|
95
|
+
- **Custom Format:**
|
|
96
|
+
\`<FieldCounter :counter="5" :maxlength="10" template="[c] of [m] chars" />\`
|
|
97
|
+
`
|
|
66
98
|
}
|
|
67
99
|
}
|
|
@@ -34,5 +34,27 @@ export const wikiDescriptionsFieldLabel: StorybookComponentsDescriptionItem = {
|
|
|
34
34
|
slots: `
|
|
35
35
|
<StorybookDescriptions componentName={'Slot'} type={'label'} />
|
|
36
36
|
`
|
|
37
|
+
},
|
|
38
|
+
ai: {
|
|
39
|
+
description: `
|
|
40
|
+
**Note:** This is a subcomponent of \`Field\`. You should generally not use it directly.
|
|
41
|
+
It is automatically integrated into components like \`Input\` and \`Textarea\`.
|
|
42
|
+
|
|
43
|
+
FieldLabel is a component responsible for rendering the label of a form field.
|
|
44
|
+
It ensures consistent styling, positioning, and accessibility for field labels.
|
|
45
|
+
|
|
46
|
+
**Key Features:**
|
|
47
|
+
1. **Label Text:**
|
|
48
|
+
- Displays the text provided in the \`label\` prop.
|
|
49
|
+
- Can be customized via the \`#label\` slot.
|
|
50
|
+
|
|
51
|
+
2. **Required Indicator:**
|
|
52
|
+
- If the \`required\` prop is true, it visually indicates that the field is mandatory (usually with an asterisk).
|
|
53
|
+
|
|
54
|
+
**Usage Examples:**
|
|
55
|
+
|
|
56
|
+
- **Standard Label:**
|
|
57
|
+
\`<FieldLabel label="Username" />\`
|
|
58
|
+
`
|
|
37
59
|
}
|
|
38
60
|
}
|
|
@@ -59,5 +59,30 @@ export const wikiDescriptionsFieldMessage: StorybookComponentsDescriptionItem =
|
|
|
59
59
|
<Canvas of={Component.FieldMessageSlots}/>
|
|
60
60
|
<StorybookDescriptions componentName={'FieldMessage'} type={'slots'}/>
|
|
61
61
|
`
|
|
62
|
+
},
|
|
63
|
+
ai: {
|
|
64
|
+
description: `
|
|
65
|
+
**Note:** This component is part of the \`Field\` component and should not be used directly.
|
|
66
|
+
|
|
67
|
+
FieldMessage is a component used to display informational text below form input fields.
|
|
68
|
+
It can show helper text, validation errors, and a character counter.
|
|
69
|
+
|
|
70
|
+
**When to use:**
|
|
71
|
+
1. **Helper Text:** When a form field needs a hint or an explanation. This is controlled by the \`helperMessage\` prop.
|
|
72
|
+
2. **Validation Error:** When a form field has an invalid value. This is controlled by the \`validationMessage\` prop. The component will automatically style itself to indicate an error (usually by changing the text color to red). The validation message has priority over the helper message.
|
|
73
|
+
3. **Character Counter:** When you need to show the user how many characters they have typed, typically in relation to a \`maxlength\`. This is enabled with the \`counter: true\` prop.
|
|
74
|
+
|
|
75
|
+
**Key Features:**
|
|
76
|
+
- **Priority:** \`validationMessage\` is always shown if present. \`helperMessage\` is shown only if there is no validation message.
|
|
77
|
+
- **Styling:** Automatically applies error styling when a \`validationMessage\` is provided.
|
|
78
|
+
- **Counter:** Integrates a character counter that works with the \`maxlength\` prop.
|
|
79
|
+
- **Accessibility:** It's designed to be linked with an input field via ARIA attributes, which is handled automatically when used within components like TextField.
|
|
80
|
+
|
|
81
|
+
**How to identify in a design:**
|
|
82
|
+
- Look for small text directly beneath an input, textarea, or select.
|
|
83
|
+
- If the text is red or has an error-like appearance, it corresponds to the \`validationMessage\` prop.
|
|
84
|
+
- If the text is a neutral color, it corresponds to the \`helperMessage\` prop.
|
|
85
|
+
- If you see a "current/max" number format (e.g., "12/100"), this is the character counter, enabled by the \`counter\` prop.
|
|
86
|
+
`
|
|
62
87
|
}
|
|
63
88
|
}
|
|
@@ -3,19 +3,23 @@ import type { StorybookComponentsDescriptionItem } from '../../types/storybookTy
|
|
|
3
3
|
export const wikiDescriptionsIcon: StorybookComponentsDescriptionItem = {
|
|
4
4
|
name: 'Icon',
|
|
5
5
|
description: {
|
|
6
|
-
en: '
|
|
7
|
-
ru: 'Компонент для отображения иконок'
|
|
6
|
+
en: 'A component for displaying vector icons with support for state management, automatic directionality adaptation, and design system styling.',
|
|
7
|
+
ru: 'Компонент для отображения векторных иконок с поддержкой управления состоянием, автоматической адаптацией направления и стилизацией дизайн-системы.'
|
|
8
8
|
},
|
|
9
9
|
possibilities: {
|
|
10
10
|
en: [
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'
|
|
11
|
+
'rendering icons by identifier',
|
|
12
|
+
'toggling between two icons based on the active state',
|
|
13
|
+
'automatic mirroring for RTL languages',
|
|
14
|
+
'integration with the color palette and inverse mode',
|
|
15
|
+
'displaying a skeleton loader placeholder'
|
|
14
16
|
],
|
|
15
17
|
ru: [
|
|
16
|
-
'
|
|
17
|
-
'переключение
|
|
18
|
-
'
|
|
18
|
+
'рендеринг иконок по идентификатору',
|
|
19
|
+
'переключение между двумя иконками в зависимости от активного состояния',
|
|
20
|
+
'автоматическое зеркалирование для RTL языков',
|
|
21
|
+
'интеграция с цветовой палитрой и инверсный режим',
|
|
22
|
+
'отображение заполнителя (скелетона) при загрузке'
|
|
19
23
|
]
|
|
20
24
|
},
|
|
21
25
|
import: [],
|
|
@@ -136,5 +140,39 @@ export const wikiDescriptionsIcon: StorybookComponentsDescriptionItem = {
|
|
|
136
140
|
slots: `
|
|
137
141
|
<StorybookDescriptions componentName={'Slot'} type={'default'}/>
|
|
138
142
|
`
|
|
143
|
+
},
|
|
144
|
+
ai: {
|
|
145
|
+
description: `
|
|
146
|
+
Icon is a component for displaying vector icons, typically from the Material Symbols library.
|
|
147
|
+
It supports state switching (active/inactive), directionality (RTL), and integration with the design system's palette.
|
|
148
|
+
|
|
149
|
+
**Key Features:**
|
|
150
|
+
1. **Icon Source:**
|
|
151
|
+
- \`icon\`: The name of the icon to display (e.g., "home", "menu", "arrow_forward").
|
|
152
|
+
Uses the project's icon set (usually Material Symbols).
|
|
153
|
+
|
|
154
|
+
2. **Interactive States:**
|
|
155
|
+
- \`active\`: Boolean flag to toggle the active state.
|
|
156
|
+
- \`iconActive\`: The icon name to show when \`active\` is \`true\`.
|
|
157
|
+
Ideal for toggle buttons (e.g., "favorite_border" vs "favorite").
|
|
158
|
+
|
|
159
|
+
3. **Styling:**
|
|
160
|
+
- \`size\`: Controls the dimensions of the icon (e.g., "sm", "md", "lg").
|
|
161
|
+
- \`asPalette\`: Applies the active palette color to the icon.
|
|
162
|
+
- \`inverse\`: Inverts the colors, useful for dark backgrounds or contrast.
|
|
163
|
+
|
|
164
|
+
4. **Directionality (\`dir\`):**
|
|
165
|
+
- Automatically mirrors the icon for RTL (Right-to-Left) languages if the icon is directional (like arrows).
|
|
166
|
+
|
|
167
|
+
5. **Loading:**
|
|
168
|
+
- \`isSkeleton\`: Renders a loading placeholder (skeleton) instead of the icon.
|
|
169
|
+
|
|
170
|
+
**Usage Examples:**
|
|
171
|
+
|
|
172
|
+
- **Simple Icon:** \`<Icon icon="search" />\`
|
|
173
|
+
- **Toggle Icon:** \`<Icon icon="visibility_off" iconActive="visibility" :active="isVisible" />\`
|
|
174
|
+
- **Directional Arrow:** \`<Icon icon="arrow_forward" dir />\`
|
|
175
|
+
- **Large Palette Icon:** \`<Icon icon="star" size="xl" asPalette />\`
|
|
176
|
+
`
|
|
139
177
|
}
|
|
140
178
|
}
|