From e2a18929f070bd78fca4550002b145499233f472 Mon Sep 17 00:00:00 2001 From: Igor Shevchik Date: Sun, 13 Oct 2024 12:41:43 +0300 Subject: [PATCH] add new ver --- CHANGELOG.md | 12 ++++ .../theme/components/icons/CopyButton.vue | 61 ++++++++++++++++++- .../theme/components/icons/IconView.vue | 4 ++ .../theme/components/icons/SlideoverIcon.vue | 4 ++ docs/.vitepress/theme/types.ts | 2 + package-lock.json | 12 ++-- package.json | 4 +- 7 files changed, 88 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f35a2c7..974361b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 0.1.3 (2024-10-13) + +### Bugs + +- fix BtnSpinnerIcon +- fix CopyBtn + +### New + +- add specialized::LetCatInIcon +- add specialized::SpinnerIcon + ## 0.1.2 (2024-09-30) ### Bugs diff --git a/docs/.vitepress/theme/components/icons/CopyButton.vue b/docs/.vitepress/theme/components/icons/CopyButton.vue index f8da696..0345502 100644 --- a/docs/.vitepress/theme/components/icons/CopyButton.vue +++ b/docs/.vitepress/theme/components/icons/CopyButton.vue @@ -46,11 +46,66 @@ function copyComponentName() success() } +function prepareBySpecializedClassNameList(): string[] +{ + const className = [] + + if(props.icon.specialized.animateSpin) + { + className.push('animate-spin-slow') + } + + if(props.icon.specialized.animateSpinNormal) + { + className.push('animate-spin') + } + + if(props.icon.specialized.stroke === 'stroke-bold') + { + className.push('stroke-[6px]') + } + else if(props.icon.specialized.stroke === 'stroke-normal') + { + className.push('stroke-2') + } + else if(props.icon.specialized.stroke === 'stroke-thin') + { + className.push('stroke-1') + } + + if(props.icon.specialized.width === 'w-lg') + { + className.push('w-lg') + } + else if(props.icon.specialized.width === 'w-[21px]') + { + className.push('w-[21px]') + } + else + { + className.push('w-3') + } + + if(props.icon.specialized.height === 'h-lg') + { + className.push('h-lg') + } + else if(props.icon.specialized.height === 'h-[21px]') + { + className.push('h-[21px]') + } + else + { + className.push('h-3') + } + + return className +} + function copyVue() { const attrs = [''] - - attrs.push('class="w-3 h-3"') + attrs.push(`class="${prepareBySpecializedClassNameList().join(' ')}"`) const code = [ `import #icon# from '@bitrix24/b24icons-vue/#type#/#icon#'`, @@ -72,7 +127,7 @@ function copyVueB24Icon() const attrs = [''] attrs.push(`name="${getIconFullName()}"`) - attrs.push('class="w-3 h-3"') + attrs.push(`class="${prepareBySpecializedClassNameList().join(' ')}"`) const code = [ `import { B24Icon } from '@bitrix24/b24icons-vue'`, diff --git a/docs/.vitepress/theme/components/icons/IconView.vue b/docs/.vitepress/theme/components/icons/IconView.vue index 39a0c78..4f9a291 100644 --- a/docs/.vitepress/theme/components/icons/IconView.vue +++ b/docs/.vitepress/theme/components/icons/IconView.vue @@ -46,6 +46,10 @@ function openSlideover () class="size-14" :class="[ icon.specialized?.animateSpin ? 'animate-spin-slow' : '', + icon.specialized?.animateSpinNormal ? 'animate-spin' : '', + icon.specialized?.stroke === 'stroke-bold' ? 'stroke-[6px]' : '', + icon.specialized?.stroke === 'stroke-normal' ? 'stroke-2' : '', + icon.specialized?.stroke === 'stroke-thin' ? 'stroke-1' : '', icon.specialized?.width === 'w-lg' ? 'w-lg' : '', icon.specialized?.height === 'h-lg' ? 'h-lg' : '', diff --git a/docs/.vitepress/theme/components/icons/SlideoverIcon.vue b/docs/.vitepress/theme/components/icons/SlideoverIcon.vue index 805f181..c19ba00 100644 --- a/docs/.vitepress/theme/components/icons/SlideoverIcon.vue +++ b/docs/.vitepress/theme/components/icons/SlideoverIcon.vue @@ -46,6 +46,10 @@ function toUpperFirstChar(value: string): string class="size-24 text-base-master dark:text-base-200" :class="[ icon.specialized?.animateSpin ? 'animate-spin-slow' : '', + icon.specialized?.animateSpinNormal ? 'animate-spin' : '', + icon.specialized?.stroke === 'stroke-bold' ? 'stroke-[6px]' : '', + icon.specialized?.stroke === 'stroke-normal' ? 'stroke-2' : '', + icon.specialized?.stroke === 'stroke-thin' ? 'stroke-1' : '', icon.specialized?.width === 'w-lg' ? 'w-lg' : '', icon.specialized?.height === 'h-lg' ? 'h-lg' : '', diff --git a/docs/.vitepress/theme/types.ts b/docs/.vitepress/theme/types.ts index 706e46f..dc65f3e 100644 --- a/docs/.vitepress/theme/types.ts +++ b/docs/.vitepress/theme/types.ts @@ -14,6 +14,8 @@ export type InfoIconRow = { icon: string, specialized?: { animateSpin?: boolean, + animateSpinNormal?: boolean, + stroke?: 'stroke-bold'|'stroke-normal'|'stroke-thin', width?: 'auto'|'w-lg'|'w-[21px]', height?: 'auto'|'h-lg'|'h-[21px]', }, diff --git a/package-lock.json b/package-lock.json index 86b24d9..15b0151 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@bitrix24/b24icons", - "version": "0.1.1", + "version": "0.1.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@bitrix24/b24icons", - "version": "0.1.1", + "version": "0.1.3", "license": "MIT", "dependencies": { - "@bitrix24/b24icons-vue": "^0.1.1", + "@bitrix24/b24icons-vue": "^0.1.3", "@headlessui/vue": "^1.7.23", "@vueuse/core": "^11.1.0", "fuse.js": "^7" @@ -428,9 +428,9 @@ } }, "node_modules/@bitrix24/b24icons-vue": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@bitrix24/b24icons-vue/-/b24icons-vue-0.1.1.tgz", - "integrity": "sha512-oN6Y096IvtQ5pd2Yd7QQw1XEYotbfhiZ21AYQbk6U/d+GVSBAsl8FDMRK8P9zeY0bfpoxsIgm7AQk5h+r8Bztw==", + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@bitrix24/b24icons-vue/-/b24icons-vue-0.1.3.tgz", + "integrity": "sha512-cG8zPkCM24VhcywzmAjRMgK+jQeRbHEyziljcp0DfebdKPFTs/uyhGg4q8Au51Xu4Po1M2YV6JbSSbk50YtZYQ==", "license": "MIT", "peerDependencies": { "vue": "^3.2.37" diff --git a/package.json b/package.json index e41392c..1488974 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bitrix24/b24icons", - "version": "0.1.2", + "version": "0.1.3", "author": "Bitrix", "license": "MIT", "description": "Документация: Битрикс24 SVG иконки для разработки веб-приложений", @@ -42,7 +42,7 @@ "vue-router": "^4.3.2" }, "dependencies": { - "@bitrix24/b24icons-vue": "^0.1.1", + "@bitrix24/b24icons-vue": "^0.1.3", "@headlessui/vue": "^1.7.23", "@vueuse/core": "^11.1.0", "fuse.js": "^7"