@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
|
@@ -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: {
|
|
@@ -75,23 +75,55 @@ export const wikiDescriptionsImage: StorybookComponentsDescriptionItem = {
|
|
|
75
75
|
<div class="wiki-storybook-group">
|
|
76
76
|
<div class="wiki-storybook-item wiki-storybook-item--squared--md">
|
|
77
77
|
<div class="wiki-storybook-item__label">size: auto (default)</div>
|
|
78
|
-
<DesignComponent :value="image1" size="auto"/>
|
|
78
|
+
<DesignComponent :value="image1" size="auto" tag-img/>
|
|
79
79
|
</div>
|
|
80
80
|
<div class="wiki-storybook-item wiki-storybook-item--squared--md">
|
|
81
81
|
<div class="wiki-storybook-item__label">size: contain</div>
|
|
82
|
-
<DesignComponent :value="image1" size="contain"/>
|
|
82
|
+
<DesignComponent :value="image1" size="contain" tag-img/>
|
|
83
83
|
</div>
|
|
84
84
|
<div class="wiki-storybook-item wiki-storybook-item--squared--md">
|
|
85
85
|
<div class="wiki-storybook-item__label">size: cover</div>
|
|
86
|
-
<DesignComponent :value="image1" size="cover"/>
|
|
86
|
+
<DesignComponent :value="image1" size="cover" tag-img/>
|
|
87
87
|
</div>
|
|
88
88
|
<div class="wiki-storybook-item wiki-storybook-item--squared--md">
|
|
89
89
|
<div class="wiki-storybook-item__label">coordinator</div>
|
|
90
|
-
<DesignComponent :value="image1" :coordinator="[60, 10, 10, 40]"/>
|
|
90
|
+
<DesignComponent :value="image1" :coordinator="[60, 10, 10, 40]" tag-img/>
|
|
91
91
|
</div>
|
|
92
92
|
<div class="wiki-storybook-item wiki-storybook-item--squared--md">
|
|
93
93
|
<div class="wiki-storybook-item__label">x, y</div>
|
|
94
|
-
<DesignComponent :value="image1" x="20" y="-10"/>
|
|
94
|
+
<DesignComponent :value="image1" x="20%" y="-10%" tag-img/>
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
`
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: 'ImageTagImg',
|
|
101
|
+
name: {
|
|
102
|
+
en: 'Using img tag',
|
|
103
|
+
ru: 'Использование тега img'
|
|
104
|
+
},
|
|
105
|
+
setup: `
|
|
106
|
+
return {
|
|
107
|
+
image1
|
|
108
|
+
}
|
|
109
|
+
`,
|
|
110
|
+
template: `
|
|
111
|
+
<div class="wiki-storybook-group">
|
|
112
|
+
<div class="wiki-storybook-item wiki-storybook-item--squared--md">
|
|
113
|
+
<div class="wiki-storybook-item__label">Background (default)</div>
|
|
114
|
+
<DesignComponent :value="image1"/>
|
|
115
|
+
</div>
|
|
116
|
+
<div class="wiki-storybook-item wiki-storybook-item--squared--md">
|
|
117
|
+
<div class="wiki-storybook-item__label">tag-img + alt</div>
|
|
118
|
+
<DesignComponent :value="image1" tag-img alt="Example image"/>
|
|
119
|
+
</div>
|
|
120
|
+
<div class="wiki-storybook-item wiki-storybook-item--squared--md">
|
|
121
|
+
<div class="wiki-storybook-item__label">tag-img + lazy + srcset</div>
|
|
122
|
+
<DesignComponent :value="image1" tag-img lazy alt="Responsive image" :srcset="{ '1x': image1, '2x': image1 }"/>
|
|
123
|
+
</div>
|
|
124
|
+
<div class="wiki-storybook-item wiki-storybook-item--squared--md">
|
|
125
|
+
<div class="wiki-storybook-item__label">tag-img + picture</div>
|
|
126
|
+
<DesignComponent :value="image1" tag-img alt="Adaptive image" :picture="{ 768: image1, 1024: image1 }"/>
|
|
95
127
|
</div>
|
|
96
128
|
</div>
|
|
97
129
|
`
|
|
@@ -118,7 +150,7 @@ export const wikiDescriptionsImage: StorybookComponentsDescriptionItem = {
|
|
|
118
150
|
<DesignComponent :value="phone2" adaptive object-width="71.9"/>
|
|
119
151
|
</div>
|
|
120
152
|
<div class="wiki-storybook-item wiki-storybook-item--squared--md">
|
|
121
|
-
<DesignComponent :value="phone3" adaptive object-width="129.9"/>
|
|
153
|
+
<DesignComponent :value="phone3" adaptive object-width="129.9" tag-img/>
|
|
122
154
|
</div>
|
|
123
155
|
</div>
|
|
124
156
|
`
|
|
@@ -128,8 +160,12 @@ export const wikiDescriptionsImage: StorybookComponentsDescriptionItem = {
|
|
|
128
160
|
body: `
|
|
129
161
|
<StorybookDescriptions componentName={'Image'} type={'image'}/>
|
|
130
162
|
<StorybookDescriptions componentName={'Image'} type={'value'}/>
|
|
163
|
+
<StorybookDescriptions componentName={'Image'} type={'flag'}/>
|
|
131
164
|
<Canvas of={Component.ImageType}/>
|
|
132
165
|
|
|
166
|
+
<StorybookDescriptions componentName={'Image'} type={'img-tag'}/>
|
|
167
|
+
<Canvas of={Component.ImageTagImg}/>
|
|
168
|
+
|
|
133
169
|
<StorybookDescriptions componentName={'Image'} type={'size'}/>
|
|
134
170
|
<Canvas of={Component.ImageSize}/>
|
|
135
171
|
|
|
@@ -142,5 +178,53 @@ export const wikiDescriptionsImage: StorybookComponentsDescriptionItem = {
|
|
|
142
178
|
expose: `
|
|
143
179
|
<StorybookDescriptions componentName={'Image'} type={'expose'}/>
|
|
144
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
|
+
`
|
|
145
229
|
}
|
|
146
230
|
}
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
import type { StorybookComponentsDescriptionItem } from '../../types/storybookTypes'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Descriptions for Input component
|
|
5
|
+
*
|
|
6
|
+
* Описания свойств компонента Input
|
|
7
|
+
*/
|
|
8
|
+
export const wikiDescriptionsInput: StorybookComponentsDescriptionItem = {
|
|
9
|
+
name: 'Input',
|
|
10
|
+
description: {
|
|
11
|
+
en: 'Text input field component with validation, masking and formatting support',
|
|
12
|
+
ru: 'Компонент текстового поля ввода с поддержкой валидации, маскирования и форматирования'
|
|
13
|
+
},
|
|
14
|
+
possibilities: {
|
|
15
|
+
en: [
|
|
16
|
+
'multiple input types: text, number, email, password, tel, url, date, time and more',
|
|
17
|
+
'built-in validation with custom messages',
|
|
18
|
+
'mask support for formatted input (phone, date, custom patterns)',
|
|
19
|
+
'currency and number formatting',
|
|
20
|
+
'password visibility toggle',
|
|
21
|
+
'prefix and suffix support',
|
|
22
|
+
'counter for character limits',
|
|
23
|
+
'navigation arrows for numeric and selection inputs',
|
|
24
|
+
'autocomplete, spellcheck and autocorrect support',
|
|
25
|
+
'integrated with Field component for consistent styling'
|
|
26
|
+
],
|
|
27
|
+
ru: [
|
|
28
|
+
'множественные типы ввода: text, number, email, password, tel, url, date, time и другие',
|
|
29
|
+
'встроенная валидация с пользовательскими сообщениями',
|
|
30
|
+
'поддержка маскирования для форматированного ввода (телефон, дата, пользовательские паттерны)',
|
|
31
|
+
'форматирование валюты и чисел',
|
|
32
|
+
'переключатель видимости пароля',
|
|
33
|
+
'поддержка префикса и суффикса',
|
|
34
|
+
'счётчик для ограничения символов',
|
|
35
|
+
'стрелки навигации для числовых и выборочных полей',
|
|
36
|
+
'поддержка автозаполнения, проверки орфографии и автокоррекции',
|
|
37
|
+
'интегрирован с компонентом Field для единообразной стилизации'
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
import: [
|
|
41
|
+
'import { ref } from \'vue\''
|
|
42
|
+
],
|
|
43
|
+
render: `
|
|
44
|
+
<DesignComponent v-bind="args" />
|
|
45
|
+
`,
|
|
46
|
+
stories: [
|
|
47
|
+
{
|
|
48
|
+
id: 'InputTypes',
|
|
49
|
+
name: {
|
|
50
|
+
en: 'Input types',
|
|
51
|
+
ru: 'Типы ввода'
|
|
52
|
+
},
|
|
53
|
+
template: `
|
|
54
|
+
<div class="wiki-storybook-flex-column">
|
|
55
|
+
<DesignComponent type="text" label="Text" placeholder="Enter text" />
|
|
56
|
+
<DesignComponent type="email" label="Email" placeholder="email@example.com" />
|
|
57
|
+
<DesignComponent type="password" label="Password" placeholder="Enter password" />
|
|
58
|
+
<DesignComponent type="number" label="Number" placeholder="0" />
|
|
59
|
+
<DesignComponent type="text" label="Phone" mask="+1 (***) ***-****" placeholder="+1 (555) 000-0000" />
|
|
60
|
+
<DesignComponent type="date" label="Date" />
|
|
61
|
+
<DesignComponent type="search" label="Search" placeholder="Search..." />
|
|
62
|
+
</div>
|
|
63
|
+
`
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: 'InputNumber',
|
|
67
|
+
name: {
|
|
68
|
+
en: 'Number formatting',
|
|
69
|
+
ru: 'Форматирование чисел'
|
|
70
|
+
},
|
|
71
|
+
template: `
|
|
72
|
+
<div class="wiki-storybook-flex-column">
|
|
73
|
+
<DesignComponent type="number" value="1234567" label="Number" />
|
|
74
|
+
<DesignComponent type="number-format" value="1234567" language="en-US" label="Formatted" />
|
|
75
|
+
<DesignComponent type="number" value="50" :min="0" :max="100" label="From 0 to 100" />
|
|
76
|
+
<DesignComponent type="number" value="10" arrow="stepper" :step="5" :arrow-step="10" label="Step 5/10" />
|
|
77
|
+
<DesignComponent type="number-format" value="1234567.89" align="center" :fraction="2" label="Centered" />
|
|
78
|
+
</div>
|
|
79
|
+
`
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: 'InputCurrency',
|
|
83
|
+
name: {
|
|
84
|
+
en: 'Currency & number formatting',
|
|
85
|
+
ru: 'Валюта и форматирование чисел'
|
|
86
|
+
},
|
|
87
|
+
template: `
|
|
88
|
+
<div class="wiki-storybook-flex-column">
|
|
89
|
+
<DesignComponent
|
|
90
|
+
type="currency"
|
|
91
|
+
label="Price (USD)"
|
|
92
|
+
currency="USD"
|
|
93
|
+
/>
|
|
94
|
+
<DesignComponent
|
|
95
|
+
type="currency"
|
|
96
|
+
label="Price (USD)"
|
|
97
|
+
currency="USD"
|
|
98
|
+
value="1234.56"
|
|
99
|
+
/>
|
|
100
|
+
<DesignComponent
|
|
101
|
+
type="currency"
|
|
102
|
+
label="Price (currency-hide)"
|
|
103
|
+
currency="EUR"
|
|
104
|
+
currency-hide
|
|
105
|
+
value="1234.56"
|
|
106
|
+
/>
|
|
107
|
+
</div>
|
|
108
|
+
`
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
id: 'InputDate',
|
|
112
|
+
name: {
|
|
113
|
+
en: 'Date and time',
|
|
114
|
+
ru: 'Дата и время'
|
|
115
|
+
},
|
|
116
|
+
template: `
|
|
117
|
+
<div class="wiki-storybook-flex-column">
|
|
118
|
+
<DesignComponent type="date" label="Date" language="ru-RU" />
|
|
119
|
+
<DesignComponent type="datetime" label="Date and Time" language="en-US" />
|
|
120
|
+
<DesignComponent type="year-month" label="Period" language="ru-RU" />
|
|
121
|
+
<DesignComponent type="time" label="Time" />
|
|
122
|
+
<DesignComponent type="hour-minute" label="Hours:Minutes" />
|
|
123
|
+
<DesignComponent type="date" label="Limited Date" language="ru-RU" min="2024-01-01" max="2024-12-31" />
|
|
124
|
+
</div>
|
|
125
|
+
`
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: 'InputMask',
|
|
129
|
+
name: {
|
|
130
|
+
en: 'Masked input',
|
|
131
|
+
ru: 'Маскированный ввод'
|
|
132
|
+
},
|
|
133
|
+
template: `
|
|
134
|
+
<div class="wiki-storybook-flex-column">
|
|
135
|
+
<DesignComponent type="tel" mask="+1 (###) ###-####" placeholder="+1 (555) 000-0000" label="Phone" />
|
|
136
|
+
<DesignComponent type="text" mask="#### #### #### ####" placeholder="0000 0000 0000 0000" label="Card" />
|
|
137
|
+
<DesignComponent type="tel" mask="+1 (###) ###-####" :mask-visible="false" label="No placeholder" />
|
|
138
|
+
</div>
|
|
139
|
+
`
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
id: 'InputVModel',
|
|
143
|
+
name: {
|
|
144
|
+
en: 'Two-way binding (v-model)',
|
|
145
|
+
ru: 'Двусторонняя привязка (v-model)'
|
|
146
|
+
},
|
|
147
|
+
setup: `
|
|
148
|
+
return {
|
|
149
|
+
inputValue: ref('Initial value'),
|
|
150
|
+
maskValue: ref(''),
|
|
151
|
+
numberValue: ref(42)
|
|
152
|
+
}
|
|
153
|
+
`,
|
|
154
|
+
template: `
|
|
155
|
+
<div class="wiki-storybook-flex-column">
|
|
156
|
+
<div class="wiki-storybook-flex">
|
|
157
|
+
<button class="wiki-storybook-button" @click="inputValue = 'Changed value'">Set text</button>
|
|
158
|
+
<button class="wiki-storybook-button" @click="inputValue = ''">Clear</button>
|
|
159
|
+
</div>
|
|
160
|
+
<DesignComponent
|
|
161
|
+
v-model="inputValue"
|
|
162
|
+
type="text"
|
|
163
|
+
label="Text input"
|
|
164
|
+
placeholder="Enter text"
|
|
165
|
+
/>
|
|
166
|
+
<div>Value: {{ inputValue }}</div>
|
|
167
|
+
|
|
168
|
+
<div class="wiki-storybook-flex">
|
|
169
|
+
<button class="wiki-storybook-button" @click="maskValue = '2022-05-13'">Set date</button>
|
|
170
|
+
<button class="wiki-storybook-button" @click="maskValue = ''">Clear</button>
|
|
171
|
+
</div>
|
|
172
|
+
<DesignComponent
|
|
173
|
+
v-model="maskValue"
|
|
174
|
+
type="date"
|
|
175
|
+
label="Date input"
|
|
176
|
+
/>
|
|
177
|
+
<div>Mask: {{ maskValue }}</div>
|
|
178
|
+
|
|
179
|
+
<div class="wiki-storybook-flex">
|
|
180
|
+
<button class="wiki-storybook-button" @click="numberValue += 10">+10</button>
|
|
181
|
+
<button class="wiki-storybook-button" @click="numberValue -= 10">-10</button>
|
|
182
|
+
</div>
|
|
183
|
+
<DesignComponent
|
|
184
|
+
v-model="numberValue"
|
|
185
|
+
type="number"
|
|
186
|
+
label="Number input"
|
|
187
|
+
:step="1"
|
|
188
|
+
/>
|
|
189
|
+
<div>Number: {{ numberValue }}</div>
|
|
190
|
+
</div>
|
|
191
|
+
`
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
id: 'InputSkeleton',
|
|
195
|
+
name: {
|
|
196
|
+
en: 'Skeleton',
|
|
197
|
+
ru: 'Скелетон'
|
|
198
|
+
},
|
|
199
|
+
components: ['Skeleton'],
|
|
200
|
+
template: `
|
|
201
|
+
<DesignSkeleton :active="true" style="max-width:320px">
|
|
202
|
+
<div class="wiki-storybook-flex-column">
|
|
203
|
+
<DesignComponent
|
|
204
|
+
isSkeleton
|
|
205
|
+
label="Loading field"
|
|
206
|
+
helperMessage="This field is loading..."
|
|
207
|
+
/>
|
|
208
|
+
<DesignComponent
|
|
209
|
+
isSkeleton
|
|
210
|
+
label="Another field"
|
|
211
|
+
counterShow
|
|
212
|
+
/>
|
|
213
|
+
</div>
|
|
214
|
+
</DesignSkeleton>
|
|
215
|
+
`
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
documentation: {
|
|
219
|
+
body: `
|
|
220
|
+
<StorybookDescriptions componentName={'Input'} type={'input'}/>
|
|
221
|
+
|
|
222
|
+
<StorybookDescriptions componentName={'Input'} type={'type'}/>
|
|
223
|
+
<Canvas of={Component.InputTypes}/>
|
|
224
|
+
|
|
225
|
+
<StorybookDescriptions componentName={'Input'} type={'number'}/>
|
|
226
|
+
<Canvas of={Component.InputNumber}/>
|
|
227
|
+
|
|
228
|
+
<StorybookDescriptions componentName={'Input'} type={'currency'}/>
|
|
229
|
+
<Canvas of={Component.InputCurrency}/>
|
|
230
|
+
|
|
231
|
+
<StorybookDescriptions componentName={'Input'} type={'date'}/>
|
|
232
|
+
<Canvas of={Component.InputDate}/>
|
|
233
|
+
|
|
234
|
+
<StorybookDescriptions componentName={'Input'} type={'mask'}/>
|
|
235
|
+
<Canvas of={Component.InputMask}/>
|
|
236
|
+
|
|
237
|
+
<StorybookDescriptions componentName={'Value'} type={'value'}/>
|
|
238
|
+
<StorybookDescriptions componentName={'Value'} type={'v-model'}/>
|
|
239
|
+
<Canvas of={Component.InputVModel}/>
|
|
240
|
+
|
|
241
|
+
<StorybookDescriptions componentName={'Style'} type={'isSkeleton'}/>
|
|
242
|
+
<Canvas of={Component.InputSkeleton}/>
|
|
243
|
+
`,
|
|
244
|
+
events: `
|
|
245
|
+
<StorybookDescriptions componentName={'Event'} type={'input'}/>
|
|
246
|
+
<StorybookDescriptions componentName={'Event'} type={'change'}/>
|
|
247
|
+
`,
|
|
248
|
+
slots: `
|
|
249
|
+
<StorybookDescriptions componentName={'Slot'} type={'label'} />
|
|
250
|
+
<StorybookDescriptions componentName={'Slot'} type={'prefix'} />
|
|
251
|
+
<StorybookDescriptions componentName={'Slot'} type={'suffix'} />
|
|
252
|
+
<StorybookDescriptions componentName={'Slot'} type={'caption'} />
|
|
253
|
+
<StorybookDescriptions componentName={'Slot'} type={'leading'} />
|
|
254
|
+
<StorybookDescriptions componentName={'Slot'} type={'trailing'} />
|
|
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
|
+
`
|
|
312
|
+
}
|
|
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
|
}
|