@soroka282/migrant.ui-kit 0.0.5
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/.editorconfig +18 -0
- package/.eslintignore +5 -0
- package/.eslintrc.cjs +51 -0
- package/.nvmrc +1 -0
- package/.prettierrc +10 -0
- package/.storybook/common.scss +4 -0
- package/.storybook/main.ts +23 -0
- package/.storybook/preview.ts +25 -0
- package/.stylelintignore +6 -0
- package/.stylelintrc.cjs +54 -0
- package/README.md +5 -0
- package/dist/App.vue.d.ts +2 -0
- package/dist/components/UI/button/UIButton.stories.d.ts +86 -0
- package/dist/components/UI/button/UIButton.vue.d.ts +33 -0
- package/dist/components/UI/card/UICard.stories.d.ts +63 -0
- package/dist/components/UI/card/UICard.vue.d.ts +25 -0
- package/dist/components/UI/inputs/BaseMaskedInput.vue.d.ts +24 -0
- package/dist/components/UI/inputs/UIInput.stories.d.ts +36 -0
- package/dist/components/UI/inputs/UIInput.vue.d.ts +33 -0
- package/dist/components/UI/loader/UILoader.stories.d.ts +18 -0
- package/dist/components/UI/loader/UILoader.vue.d.ts +12 -0
- package/dist/components/UI/modal/UIModal.stories.d.ts +5 -0
- package/dist/components/UI/modal/UIModal.vue.d.ts +19 -0
- package/dist/components/UI/modal/UIModalContainer.vue.d.ts +2 -0
- package/dist/components/UI/swiper/UISwiper.stories.d.ts +35 -0
- package/dist/components/UI/swiper/UISwiper.vue.d.ts +16 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/useIframeHandlers.d.ts +16 -0
- package/dist/composables/useRequestHandler.d.ts +15 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/ui-color.constant.d.ts +15 -0
- package/dist/main.d.ts +0 -0
- package/dist/migrant.ui-kit.es.d.ts +1 -0
- package/dist/migrant.ui-kit.es.ts +4172 -0
- package/dist/migrant.ui-kit.umd.ts +13 -0
- package/dist/plugins/formatter.d.ts +5 -0
- package/dist/plugins/plural-endings.d.ts +5 -0
- package/dist/store/index.d.ts +1 -0
- package/dist/store/modal.store.d.ts +831 -0
- package/dist/style.css +1 -0
- package/dist/types/UI/ui-color.type.d.ts +18 -0
- package/dist/types/UI/ui-input.type.d.ts +59 -0
- package/dist/types/UI/ui-modal.type.d.ts +7 -0
- package/dist/types/UI/ui-size.type.d.ts +7 -0
- package/dist/types/common.type.d.ts +2 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/plugin.type.d.ts +6 -0
- package/dist/utils/debounce.util.d.ts +2 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/vite.svg +1 -0
- package/index.html +13 -0
- package/package.json +65 -0
- package/postcss-sorting.config.cjs +32 -0
- package/postcss-sorting.config.cts +30 -0
- package/public/vite.svg +1 -0
- package/src/App.vue +5 -0
- package/src/App.vue.d.ts +23 -0
- package/src/assets/scss/common/swiper.scss +20 -0
- package/src/assets/scss/common/variables.scss +15 -0
- package/src/assets/scss/index.scss +10 -0
- package/src/assets/scss/mixins/flex.minix.scss +7 -0
- package/src/assets/scss/mixins/identation.mixin.scss +17 -0
- package/src/assets/scss/mixins/index.mixin.scss +3 -0
- package/src/assets/scss/mixins/typograph.mixin.scss +5 -0
- package/src/components/UI/button/UIButton.stories.js +57 -0
- package/src/components/UI/button/UIButton.stories.ts +60 -0
- package/src/components/UI/button/UIButton.vue +118 -0
- package/src/components/UI/button/UIButton.vue.js +94 -0
- package/src/components/UI/card/UICard.stories.js +54 -0
- package/src/components/UI/card/UICard.stories.ts +57 -0
- package/src/components/UI/card/UICard.vue +52 -0
- package/src/components/UI/card/UICard.vue.js +59 -0
- package/src/components/UI/inputs/BaseMaskedInput.vue +101 -0
- package/src/components/UI/inputs/BaseMaskedInput.vue.js +100 -0
- package/src/components/UI/inputs/UIInput.stories.js +89 -0
- package/src/components/UI/inputs/UIInput.stories.ts +92 -0
- package/src/components/UI/inputs/UIInput.vue +184 -0
- package/src/components/UI/inputs/UIInput.vue.js +206 -0
- package/src/components/UI/loader/UILoader.stories.js +28 -0
- package/src/components/UI/loader/UILoader.stories.ts +31 -0
- package/src/components/UI/loader/UILoader.vue +76 -0
- package/src/components/UI/loader/UILoader.vue.js +47 -0
- package/src/components/UI/modal/UIModal.stories.js +34 -0
- package/src/components/UI/modal/UIModal.stories.ts +39 -0
- package/src/components/UI/modal/UIModal.vue +254 -0
- package/src/components/UI/modal/UIModal.vue.js +141 -0
- package/src/components/UI/modal/UIModalContainer.vue +20 -0
- package/src/components/UI/modal/UIModalContainer.vue.js +44 -0
- package/src/components/UI/swiper/UISwiper.stories.js +30 -0
- package/src/components/UI/swiper/UISwiper.stories.ts +33 -0
- package/src/components/UI/swiper/UISwiper.vue +47 -0
- package/src/components/UI/swiper/UISwiper.vue.js +82 -0
- package/src/components/index.js +8 -0
- package/src/components/index.ts +9 -0
- package/src/composables/index.js +2 -0
- package/src/composables/index.ts +2 -0
- package/src/composables/useIframeHandlers.js +43 -0
- package/src/composables/useIframeHandlers.ts +52 -0
- package/src/composables/useRequestHandler.js +24 -0
- package/src/composables/useRequestHandler.ts +49 -0
- package/src/constants/index.js +1 -0
- package/src/constants/index.ts +1 -0
- package/src/constants/ui-color.constant.js +16 -0
- package/src/constants/ui-color.constant.ts +19 -0
- package/src/main.js +9 -0
- package/src/main.ts +12 -0
- package/src/plugins/formatter.js +118 -0
- package/src/plugins/formatter.ts +136 -0
- package/src/plugins/plural-endings.js +15 -0
- package/src/plugins/plural-endings.ts +19 -0
- package/src/store/index.js +1 -0
- package/src/store/index.ts +1 -0
- package/src/store/modal.store.js +36 -0
- package/src/store/modal.store.ts +76 -0
- package/src/style.css +79 -0
- package/src/types/UI/ui-color.type.js +16 -0
- package/src/types/UI/ui-color.type.ts +22 -0
- package/src/types/UI/ui-input.type.js +41 -0
- package/src/types/UI/ui-input.type.ts +63 -0
- package/src/types/UI/ui-modal.type.js +8 -0
- package/src/types/UI/ui-modal.type.ts +7 -0
- package/src/types/UI/ui-size.type.js +8 -0
- package/src/types/UI/ui-size.type.ts +7 -0
- package/src/types/common.type.js +1 -0
- package/src/types/common.type.ts +2 -0
- package/src/types/index.js +6 -0
- package/src/types/index.ts +6 -0
- package/src/types/plugin.type.js +1 -0
- package/src/types/plugin.type.ts +6 -0
- package/src/utils/debounce.util.js +7 -0
- package/src/utils/debounce.util.ts +7 -0
- package/src/utils/index.js +1 -0
- package/src/utils/index.ts +1 -0
- package/tsconfig.json +18 -0
- package/tsconfig.tsbuildinfo +1 -0
- package/vite-env.d.ts +7 -0
- package/vite.config.js +33 -0
- package/vite.config.js.timestamp-1753347662244-f753ce7e4747b.mjs +38 -0
- package/vite.config.ts +41 -0
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ui-loader[data-v-5356c8e0]{width:24px;height:24px;border-radius:100%;border-width:4px;border-style:solid;border-color:var(--8184283c);border-left-color:var(--563581ee);animation:loader-spin-5356c8e0 1s infinite linear}.ui-loader.--xs-size[data-v-5356c8e0]{width:12px;height:12px;border-width:2px}.ui-loader.--s-size[data-v-5356c8e0]{width:22px;height:22px}.ui-loader.--m-size[data-v-5356c8e0]{width:32px;height:32px}.ui-loader.--l-size[data-v-5356c8e0]{width:42px;height:42px}.ui-loader.--custom-size[data-v-5356c8e0]{width:inherit;height:inherit}@keyframes loader-spin-5356c8e0{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ui-card[data-v-dffadc00]{padding:var(--7c8f68df);border-radius:var(--23ed9fd0);background-color:var(--bf2d7a28);border:1px solid transparent}.ui-card.--border[data-v-dffadc00]{border:1px solid rgba(255,255,255,.5)}.ui-card.--box-shadow[data-v-dffadc00]{box-shadow:0 0 13.5px #b4b4b426}@font-face{font-family:swiper-icons;src:url(data:application/font-woff;charset=utf-8;base64,\ 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);font-weight:400;font-style:normal}:root{--swiper-theme-color: #007aff}:host{position:relative;display:block;margin-left:auto;margin-right:auto;z-index:1}.swiper{margin-left:auto;margin-right:auto;position:relative;overflow:hidden;list-style:none;padding:0;z-index:1;display:block}.swiper-vertical>.swiper-wrapper{flex-direction:column}.swiper-wrapper{position:relative;width:100%;height:100%;z-index:1;display:flex;transition-property:transform;transition-timing-function:var(--swiper-wrapper-transition-timing-function, initial);box-sizing:content-box}.swiper-android .swiper-slide,.swiper-ios .swiper-slide,.swiper-wrapper{transform:translateZ(0)}.swiper-horizontal{touch-action:pan-y}.swiper-vertical{touch-action:pan-x}.swiper-slide{flex-shrink:0;width:100%;height:100%;position:relative;transition-property:transform;display:block}.swiper-slide-invisible-blank{visibility:hidden}.swiper-autoheight,.swiper-autoheight .swiper-slide{height:auto}.swiper-autoheight .swiper-wrapper{align-items:flex-start;transition-property:transform,height}.swiper-backface-hidden .swiper-slide{transform:translateZ(0);-webkit-backface-visibility:hidden;backface-visibility:hidden}.swiper-3d.swiper-css-mode .swiper-wrapper{perspective:1200px}.swiper-3d .swiper-wrapper{transform-style:preserve-3d}.swiper-3d{perspective:1200px}.swiper-3d .swiper-slide,.swiper-3d .swiper-cube-shadow{transform-style:preserve-3d}.swiper-css-mode>.swiper-wrapper{overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.swiper-css-mode>.swiper-wrapper::-webkit-scrollbar{display:none}.swiper-css-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:start start}.swiper-css-mode.swiper-horizontal>.swiper-wrapper{scroll-snap-type:x mandatory}.swiper-css-mode.swiper-vertical>.swiper-wrapper{scroll-snap-type:y mandatory}.swiper-css-mode.swiper-free-mode>.swiper-wrapper{scroll-snap-type:none}.swiper-css-mode.swiper-free-mode>.swiper-wrapper>.swiper-slide{scroll-snap-align:none}.swiper-css-mode.swiper-centered>.swiper-wrapper:before{content:"";flex-shrink:0;order:9999}.swiper-css-mode.swiper-centered>.swiper-wrapper>.swiper-slide{scroll-snap-align:center center;scroll-snap-stop:always}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper>.swiper-slide:first-child{margin-inline-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-horizontal>.swiper-wrapper:before{height:100%;min-height:1px;width:var(--swiper-centered-offset-after)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper>.swiper-slide:first-child{margin-block-start:var(--swiper-centered-offset-before)}.swiper-css-mode.swiper-centered.swiper-vertical>.swiper-wrapper:before{width:100%;min-width:1px;height:var(--swiper-centered-offset-after)}.swiper-3d .swiper-slide-shadow,.swiper-3d .swiper-slide-shadow-left,.swiper-3d .swiper-slide-shadow-right,.swiper-3d .swiper-slide-shadow-top,.swiper-3d .swiper-slide-shadow-bottom{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;z-index:10}.swiper-3d .swiper-slide-shadow{background:#00000026}.swiper-3d .swiper-slide-shadow-left{background-image:linear-gradient(to left,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-right{background-image:linear-gradient(to right,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-top{background-image:linear-gradient(to top,#00000080,#0000)}.swiper-3d .swiper-slide-shadow-bottom{background-image:linear-gradient(to bottom,#00000080,#0000)}.swiper-lazy-preloader{width:42px;height:42px;position:absolute;left:50%;top:50%;margin-left:-21px;margin-top:-21px;z-index:10;transform-origin:50%;box-sizing:border-box;border:4px solid var(--swiper-preloader-color, var(--swiper-theme-color));border-radius:50%;border-top-color:transparent}.swiper:not(.swiper-watch-progress) .swiper-lazy-preloader,.swiper-watch-progress .swiper-slide-visible .swiper-lazy-preloader{animation:swiper-preloader-spin 1s infinite linear}.swiper-lazy-preloader-white{--swiper-preloader-color: #fff}.swiper-lazy-preloader-black{--swiper-preloader-color: #000}@keyframes swiper-preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}:root{--swiper-navigation-size: 44px}.swiper-button-prev,.swiper-button-next{position:absolute;top:var(--swiper-navigation-top-offset, 50%);width:calc(var(--swiper-navigation-size) / 44 * 27);height:var(--swiper-navigation-size);margin-top:calc(0px - (var(--swiper-navigation-size) / 2));z-index:10;cursor:pointer;display:flex;align-items:center;justify-content:center;color:var(--swiper-navigation-color, var(--swiper-theme-color))}.swiper-button-prev.swiper-button-disabled,.swiper-button-next.swiper-button-disabled{opacity:.35;cursor:auto;pointer-events:none}.swiper-button-prev.swiper-button-hidden,.swiper-button-next.swiper-button-hidden{opacity:0;cursor:auto;pointer-events:none}.swiper-navigation-disabled .swiper-button-prev,.swiper-navigation-disabled .swiper-button-next{display:none!important}.swiper-button-prev svg,.swiper-button-next svg{width:100%;height:100%;object-fit:contain;transform-origin:center}.swiper-rtl .swiper-button-prev svg,.swiper-rtl .swiper-button-next svg{transform:rotate(180deg)}.swiper-button-prev,.swiper-rtl .swiper-button-next{left:var(--swiper-navigation-sides-offset, 10px);right:auto}.swiper-button-lock{display:none}.swiper-button-prev:after,.swiper-button-next:after{font-family:swiper-icons;font-size:var(--swiper-navigation-size);text-transform:none!important;letter-spacing:0;font-variant:initial;line-height:1}.swiper-button-prev:after,.swiper-rtl .swiper-button-next:after{content:"prev"}.swiper-button-next,.swiper-rtl .swiper-button-prev{right:var(--swiper-navigation-sides-offset, 10px);left:auto}.swiper-button-next:after,.swiper-rtl .swiper-button-prev:after{content:"next"}.swiper{width:95vw;height:100%;overflow:visible}.swiper-slide{display:flex;justify-content:start;align-items:center;flex-shrink:0;max-width:100%;text-align:center;font-size:18px;padding-right:10px}@media (min-width: 368px){.swiper-slide{max-width:84%}}.ui-swiper[data-v-018d07fb]{width:100%}.ui-swiper__container[data-v-018d07fb]{width:100%;overflow:hidden}.ui-swiper__slide[data-v-018d07fb]{width:auto;flex-shrink:0}.ui-input[data-v-3e7ba650]{font-size:15px;font-weight:600;line-height:100%;display:inline-block;width:100%;height:48px;padding:0 16px;background:var(--0222724a);color:var(--d552b89a);border:1px solid var(--826cde58);transition:all .25s;border-radius:8px;text-align:left;-webkit-appearance:unset;-moz-appearance:unset;appearance:unset;box-sizing:border-box;outline:0}.ui-input[data-v-3e7ba650]::placeholder{filter:opacity(90%)}.ui-input[data-v-3e7ba650]:hover,.ui-input[data-v-3e7ba650]:focus{filter:brightness(96%)}.ui-input.--error[data-v-3e7ba650]{border-color:var(--98ce34ba)}.ui-input.--capitalize[data-v-3e7ba650]{text-transform:capitalize}.ui-input.--textarea[data-v-3e7ba650]{resize:none;height:100px}.ui-input__label[data-v-3e7ba650]{font-size:13px;font-weight:500;line-height:20px}.ui-input__wrap[data-v-3e7ba650]{display:flex;align-items:flex-start;justify-content:flex-start;flex-direction:column;gap:12px;width:100%;gap:3px}.ui-input__inner[data-v-3e7ba650]{position:relative;width:100%}.ui-input__error[data-v-3e7ba650]{text-align:left;color:var(--98ce34ba);font-size:10px}.ui-modal[data-v-3fe926bc]{position:absolute;top:20px;left:50%;max-height:calc(100vh - 200px);width:100%;padding-bottom:max(env(safe-area-inset-top),20px);background:var(--white);transition:all .25s;animation:opacity-3fe926bc .3s ease-out;border-color:transparent;border-radius:12px 12px 0 0;overflow-y:auto;transform:translate(-50%)}.ui-modal.--center[data-v-3fe926bc]{top:50%;transform:translate(-50%,-50%)}.ui-modal.--bottom[data-v-3fe926bc]{top:initial;bottom:0}.ui-modal.--link-style[data-v-3fe926bc] a{text-decoration:underline;text-decoration-style:dotted;text-decoration-thickness:2px;text-underline-offset:3px;text-decoration-skip-ink:none;color:var(--blue);word-break:break-word}.ui-modal--anim-hide[data-v-3fe926bc]{animation:opacity-reverse-3fe926bc .4s ease-out}.ui-modal__box[data-v-3fe926bc]{position:fixed;top:50%;left:50%;z-index:5;width:100%;height:100%;background:#0000004d;transform:translate(-50%,-50%)}.ui-modal__handle[data-v-3fe926bc]{display:inline-block;width:104px;height:4px;margin:0 auto;background:#c7c7c7;border-radius:12px}.ui-modal__handle-wrap[data-v-3fe926bc]{position:sticky;top:0;bottom:100%;z-index:99;display:block;width:100%;height:20px;background:var(--white);border:none;border-radius:12px;outline:none}.ui-modal__wrap[data-v-3fe926bc]{position:relative;display:flex;padding:0 16px 16px;transition:all .25s;overflow-x:hidden;flex-direction:column;gap:14px}.ui-modal__title[data-v-3fe926bc]{margin:0;color:#2b2b2b;font-weight:800;font-size:20px;line-height:24px}.ui-modal__title-inner[data-v-3fe926bc]{position:relative;z-index:3}.ui-modal__title-wrap[data-v-3fe926bc]{display:flex;justify-content:space-between;gap:10px;padding:16px 16px 14px;background:inherit}.ui-modal__header[data-v-3fe926bc]{position:sticky;top:0;bottom:0;z-index:99;background:var(--white)}.ui-modal__btn-back[data-v-3fe926bc]{width:28px;height:28px;background:transparent;border:none;outline:none;border-radius:100%;cursor:pointer}@keyframes opacity-3fe926bc{0%{opacity:0;transform:translateY(100%) translate(-50%)}25%{opacity:.8}to{opacity:1;transform:initial translate(-50%)}}@keyframes opacity-reverse-3fe926bc{0%{opacity:1;transform:translateY(0) translate(-50%)}25%{opacity:.6}to{opacity:0;transform:translateY(100%) translate(-50%)}}.ui-button[data-v-c532b6b0]{font-size:14px;font-weight:700;line-height:100%;width:100%;background:var(--0fe40156);color:var(--5d1c0b4c);border:none;transition:filter .25s;border-radius:8px;outline:none;cursor:pointer}.ui-button.is-box-shadow[data-v-c532b6b0]{box-shadow:0 4px 29px #0000001a}.ui-button[data-v-c532b6b0]:hover{filter:brightness(90%)}.ui-button[data-v-c532b6b0]:disabled{filter:opacity(70%)}.ui-button__loader[data-v-c532b6b0]{margin:0 auto}.ui-button.--xs-size[data-v-c532b6b0]{min-height:33px}.ui-button.--s-size[data-v-c532b6b0]{min-height:44px}.ui-button.--m-size[data-v-c532b6b0]{font-size:15px;font-weight:700;line-height:100%;min-height:54px}.ui-button.--l-size[data-v-c532b6b0]{min-height:64px}.ui-button.--custom-size[data-v-c532b6b0]{min-height:inherit}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { UIColor } from '../../constants';
|
|
2
|
+
import { valueof } from '..';
|
|
3
|
+
export declare enum UIColorName {
|
|
4
|
+
Transparent = "transparent",
|
|
5
|
+
White = "white",
|
|
6
|
+
Black = "black",
|
|
7
|
+
PurpleMain = "purple-main",
|
|
8
|
+
GrayText = "gray-text",
|
|
9
|
+
GrayBorder = "gray-border",
|
|
10
|
+
Gray = "gray",
|
|
11
|
+
Purple_66 = "purple-66",
|
|
12
|
+
Danger_1 = "danger-1",
|
|
13
|
+
Danger_2 = "danger-2",
|
|
14
|
+
Danger_3 = "danger-3",
|
|
15
|
+
Danger_4 = "danger-4",
|
|
16
|
+
Danger_5 = "danger-5"
|
|
17
|
+
}
|
|
18
|
+
export type UIColorValues = valueof<typeof UIColor>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { UISize } from '..';
|
|
2
|
+
export declare enum EInputType {
|
|
3
|
+
button = "button",
|
|
4
|
+
checkbox = "checkbox",
|
|
5
|
+
color = "color",
|
|
6
|
+
date = "date",
|
|
7
|
+
datetimelocal = "datetime-local",
|
|
8
|
+
email = "email",
|
|
9
|
+
file = "file",
|
|
10
|
+
hidden = "hidden",
|
|
11
|
+
image = "image",
|
|
12
|
+
month = "month",
|
|
13
|
+
number = "number",
|
|
14
|
+
password = "password",
|
|
15
|
+
radio = "radio",
|
|
16
|
+
range = "range",
|
|
17
|
+
reset = "reset",
|
|
18
|
+
search = "search",
|
|
19
|
+
submit = "submit",
|
|
20
|
+
tel = "tel",
|
|
21
|
+
text = "text",
|
|
22
|
+
time = "time",
|
|
23
|
+
url = "url",
|
|
24
|
+
week = "week"
|
|
25
|
+
}
|
|
26
|
+
export declare enum EInputInputmode {
|
|
27
|
+
text = "text",
|
|
28
|
+
tel = "tel",
|
|
29
|
+
url = "url",
|
|
30
|
+
email = "email",
|
|
31
|
+
numeric = "numeric",
|
|
32
|
+
decimal = "decimal",
|
|
33
|
+
search = "search"
|
|
34
|
+
}
|
|
35
|
+
export declare enum EInputComponentType {
|
|
36
|
+
mask = "mask",
|
|
37
|
+
textarea = "textarea",
|
|
38
|
+
input = "input"
|
|
39
|
+
}
|
|
40
|
+
export interface IInputProps {
|
|
41
|
+
component?: EInputComponentType;
|
|
42
|
+
id?: string;
|
|
43
|
+
label?: string;
|
|
44
|
+
mask?: string;
|
|
45
|
+
placeholder?: string;
|
|
46
|
+
type?: EInputType;
|
|
47
|
+
inputmode?: EInputInputmode;
|
|
48
|
+
modelValue?: string | number;
|
|
49
|
+
errorMessage?: string;
|
|
50
|
+
isError?: boolean;
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
readonly?: boolean;
|
|
53
|
+
masked?: boolean;
|
|
54
|
+
isCapitalize?: boolean;
|
|
55
|
+
isSetInputFocus?: boolean;
|
|
56
|
+
delay?: number;
|
|
57
|
+
size?: UISize;
|
|
58
|
+
isBoxShadow?: boolean;
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as debounce } from './debounce.util';
|
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/index.html
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Vite + Vue + TS</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="app"></div>
|
|
11
|
+
<script type="module" src="/src/main.ts"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@soroka282/migrant.ui-kit",
|
|
3
|
+
"private": false,
|
|
4
|
+
"version": "0.0.5",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vue-tsc -b && vite build",
|
|
9
|
+
"preview": "vite preview",
|
|
10
|
+
"storybook": "storybook dev -p 6006",
|
|
11
|
+
"build-storybook": "storybook build",
|
|
12
|
+
"publish": "npm run build && npm publish --access public"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"maska": "^1.5.2",
|
|
16
|
+
"pinia": "^3.0.3",
|
|
17
|
+
"swiper": "^11.2.10",
|
|
18
|
+
"vue": "^3.5.17"
|
|
19
|
+
},
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@storybook/vue3-vite": "^9.0.17",
|
|
22
|
+
"@types/node": "24.0.15",
|
|
23
|
+
"@types/react": "^19.1.8",
|
|
24
|
+
"@types/react-dom": "^19.1.6",
|
|
25
|
+
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
|
26
|
+
"@typescript-eslint/parser": "^6.21.0",
|
|
27
|
+
"@vitejs/plugin-vue": "^4.6.2",
|
|
28
|
+
"@vue/eslint-config-typescript": "^12.0.0",
|
|
29
|
+
"@vue/tsconfig": "^0.7.0",
|
|
30
|
+
"eslint": "^8.57.1",
|
|
31
|
+
"eslint-config-prettier": "^8.10.0",
|
|
32
|
+
"eslint-config-standard": "^17.0.1",
|
|
33
|
+
"eslint-import-resolver-alias": "^1.1.2",
|
|
34
|
+
"eslint-plugin-import": "^2.28.1",
|
|
35
|
+
"eslint-plugin-node": "^11.1.0",
|
|
36
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
37
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
38
|
+
"eslint-plugin-standard": "^5.0.0",
|
|
39
|
+
"eslint-plugin-storybook": "^9.0.17",
|
|
40
|
+
"eslint-plugin-unicorn": "^48.0.1",
|
|
41
|
+
"eslint-plugin-vue": "^9.33.0",
|
|
42
|
+
"postcss": "^8.5.4",
|
|
43
|
+
"postcss-cli": "^11.0.1",
|
|
44
|
+
"postcss-html": "^1.8.0",
|
|
45
|
+
"postcss-scss": "^4.0.9",
|
|
46
|
+
"postcss-sorting": "^9.1.0",
|
|
47
|
+
"prettier": "^3.5.2",
|
|
48
|
+
"react": "^19.1.0",
|
|
49
|
+
"react-dom": "^19.1.0",
|
|
50
|
+
"sass": "^1.89.2",
|
|
51
|
+
"sass-loader": "^16.0.5",
|
|
52
|
+
"storybook": "^9.0.17",
|
|
53
|
+
"stylelint": "^16.20.0",
|
|
54
|
+
"stylelint-config-html": "^1.1.0",
|
|
55
|
+
"stylelint-config-standard": "^38.0.0",
|
|
56
|
+
"stylelint-config-standard-scss": "^15.0.1",
|
|
57
|
+
"stylelint-config-standard-vue": "^1.0.0",
|
|
58
|
+
"stylelint-order": "^6.0.4",
|
|
59
|
+
"stylelint-scss": "^6.12.0",
|
|
60
|
+
"typescript": "^5.4.5",
|
|
61
|
+
"vite": "^5.4.19",
|
|
62
|
+
"vite-plugin-dts": "^4.5.4",
|
|
63
|
+
"vue-tsc": "^2.2.12"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/** @type {import('postcss-sorting').SortingConfig} */
|
|
4
|
+
module.exports = {
|
|
5
|
+
order: ['custom-properties', 'dollar-variables', 'declarations', 'rules', 'at-rules'],
|
|
6
|
+
'properties-order': {
|
|
7
|
+
order: [
|
|
8
|
+
'position',
|
|
9
|
+
'top',
|
|
10
|
+
'right',
|
|
11
|
+
'bottom',
|
|
12
|
+
'left',
|
|
13
|
+
'z-index',
|
|
14
|
+
'display',
|
|
15
|
+
'flex',
|
|
16
|
+
'justify-content',
|
|
17
|
+
'align-items',
|
|
18
|
+
'width',
|
|
19
|
+
'height',
|
|
20
|
+
'margin',
|
|
21
|
+
'padding',
|
|
22
|
+
'background',
|
|
23
|
+
'color',
|
|
24
|
+
'font',
|
|
25
|
+
'border',
|
|
26
|
+
'box-shadow',
|
|
27
|
+
'transition',
|
|
28
|
+
'animation',
|
|
29
|
+
],
|
|
30
|
+
unspecified: 'bottom',
|
|
31
|
+
},
|
|
32
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** @type {import('postcss-sorting').SortingConfig} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
order: ['custom-properties', 'dollar-variables', 'declarations', 'rules', 'at-rules'],
|
|
4
|
+
'properties-order': {
|
|
5
|
+
order: [
|
|
6
|
+
'position',
|
|
7
|
+
'top',
|
|
8
|
+
'right',
|
|
9
|
+
'bottom',
|
|
10
|
+
'left',
|
|
11
|
+
'z-index',
|
|
12
|
+
'display',
|
|
13
|
+
'flex',
|
|
14
|
+
'justify-content',
|
|
15
|
+
'align-items',
|
|
16
|
+
'width',
|
|
17
|
+
'height',
|
|
18
|
+
'margin',
|
|
19
|
+
'padding',
|
|
20
|
+
'background',
|
|
21
|
+
'color',
|
|
22
|
+
'font',
|
|
23
|
+
'border',
|
|
24
|
+
'box-shadow',
|
|
25
|
+
'transition',
|
|
26
|
+
'animation',
|
|
27
|
+
],
|
|
28
|
+
unspecified: 'bottom',
|
|
29
|
+
},
|
|
30
|
+
};
|
package/public/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/src/App.vue
ADDED
package/src/App.vue.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<
|
|
2
|
+
{},
|
|
3
|
+
{},
|
|
4
|
+
{},
|
|
5
|
+
{},
|
|
6
|
+
{},
|
|
7
|
+
import('vue').ComponentOptionsMixin,
|
|
8
|
+
import('vue').ComponentOptionsMixin,
|
|
9
|
+
{},
|
|
10
|
+
string,
|
|
11
|
+
import('vue').PublicProps,
|
|
12
|
+
Readonly<{}> & Readonly<{}>,
|
|
13
|
+
{},
|
|
14
|
+
{},
|
|
15
|
+
{},
|
|
16
|
+
{},
|
|
17
|
+
string,
|
|
18
|
+
import('vue').ComponentProvideOptions,
|
|
19
|
+
true,
|
|
20
|
+
{},
|
|
21
|
+
any
|
|
22
|
+
>;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.swiper {
|
|
2
|
+
width: 95vw;
|
|
3
|
+
height: 100%;
|
|
4
|
+
overflow: visible;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.swiper-slide {
|
|
8
|
+
display: flex;
|
|
9
|
+
justify-content: start;
|
|
10
|
+
align-items: center;
|
|
11
|
+
flex-shrink: 0;
|
|
12
|
+
max-width: 100%;
|
|
13
|
+
text-align: center;
|
|
14
|
+
font-size: 18px;
|
|
15
|
+
padding-right: 10px;
|
|
16
|
+
|
|
17
|
+
@media (min-width: 368px) {
|
|
18
|
+
max-width: 84%;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--transparent: transparent;
|
|
3
|
+
--white: #fff;
|
|
4
|
+
--black: #000;
|
|
5
|
+
--purple-main: #666EE4;
|
|
6
|
+
--purple-66: #DDDEF5A8;
|
|
7
|
+
--gray-text: #3A3A3A;
|
|
8
|
+
--gray-border: #d8d8d8;
|
|
9
|
+
--gray: #323232;
|
|
10
|
+
--danger-1: #FD324E;
|
|
11
|
+
--danger-2: #EA4242;
|
|
12
|
+
--danger-3: #FFE9E9;
|
|
13
|
+
--danger-4: #FFDCDC;
|
|
14
|
+
--danger-5: #DA363C;
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@use "sass:string";
|
|
2
|
+
|
|
3
|
+
@mixin indentation-creator ($className, $indentationName, $direction, $maxCount: 200) {
|
|
4
|
+
@for $i from 1 through $maxCount {
|
|
5
|
+
.#{$className}-#{$i} {
|
|
6
|
+
#{$indentationName}-#{$direction}: #{$i}px;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@mixin indentation-creator-list ($indentationName) {
|
|
12
|
+
$directionNameList: (top, left, bottom, right);
|
|
13
|
+
|
|
14
|
+
@each $direction in $directionNameList {
|
|
15
|
+
@include indentation-creator(#{string.slice($indentationName, 0, 1)}#{string.slice($direction, 0, 1)}, $indentationName, $direction);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { UIColorName, UISize } from '@/types';
|
|
2
|
+
import { UIButton } from '@/components';
|
|
3
|
+
import { UIColor } from '@/constants';
|
|
4
|
+
export default {
|
|
5
|
+
title: 'UIButton',
|
|
6
|
+
component: UIButton,
|
|
7
|
+
argTypes: {
|
|
8
|
+
isLoading: {
|
|
9
|
+
control: { type: 'boolean' },
|
|
10
|
+
},
|
|
11
|
+
disabled: {
|
|
12
|
+
control: { type: 'boolean' },
|
|
13
|
+
},
|
|
14
|
+
isBoxShadow: {
|
|
15
|
+
control: { type: 'boolean' },
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
control: { type: 'select' },
|
|
19
|
+
options: Object.values(UISize),
|
|
20
|
+
},
|
|
21
|
+
color: {
|
|
22
|
+
control: { type: 'select' },
|
|
23
|
+
options: Object.keys(UIColorName),
|
|
24
|
+
},
|
|
25
|
+
bgColor: {
|
|
26
|
+
control: { type: 'select' },
|
|
27
|
+
options: Object.keys(UIColorName),
|
|
28
|
+
},
|
|
29
|
+
loaderBorderColor: {
|
|
30
|
+
control: { type: 'select' },
|
|
31
|
+
options: Object.keys(UIColorName),
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
args: {
|
|
35
|
+
size: UISize.M,
|
|
36
|
+
color: UIColorName.White,
|
|
37
|
+
bgColor: UIColorName.PurpleMain,
|
|
38
|
+
loaderBorderColor: 'transparent',
|
|
39
|
+
disabled: false,
|
|
40
|
+
isLoading: false,
|
|
41
|
+
isBoxShadow: true,
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
export const DefaultButton = (args) => ({
|
|
45
|
+
components: { UIButton },
|
|
46
|
+
setup() {
|
|
47
|
+
return { args, UIColor };
|
|
48
|
+
},
|
|
49
|
+
template: `<UIButton
|
|
50
|
+
v-bind="args"
|
|
51
|
+
:color="UIColor[args.color]"
|
|
52
|
+
:bg-color="UIColor[args.bgColor]"
|
|
53
|
+
:loader-border-color="UIColor[args.loaderBorderColor]"
|
|
54
|
+
>
|
|
55
|
+
Кнопка
|
|
56
|
+
</UIButton>`,
|
|
57
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Meta, StoryFn } from '@storybook/vue3-vite';
|
|
2
|
+
import { UIColorName, UISize } from '@/types';
|
|
3
|
+
import { UIButton } from '@/components';
|
|
4
|
+
import { UIColor } from '@/constants';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title: 'UIButton',
|
|
8
|
+
component: UIButton,
|
|
9
|
+
argTypes: {
|
|
10
|
+
isLoading: {
|
|
11
|
+
control: { type: 'boolean' },
|
|
12
|
+
},
|
|
13
|
+
disabled: {
|
|
14
|
+
control: { type: 'boolean' },
|
|
15
|
+
},
|
|
16
|
+
isBoxShadow: {
|
|
17
|
+
control: { type: 'boolean' },
|
|
18
|
+
},
|
|
19
|
+
size: {
|
|
20
|
+
control: { type: 'select' },
|
|
21
|
+
options: Object.values(UISize),
|
|
22
|
+
},
|
|
23
|
+
color: {
|
|
24
|
+
control: { type: 'select' },
|
|
25
|
+
options: Object.keys(UIColorName),
|
|
26
|
+
},
|
|
27
|
+
bgColor: {
|
|
28
|
+
control: { type: 'select' },
|
|
29
|
+
options: Object.keys(UIColorName),
|
|
30
|
+
},
|
|
31
|
+
loaderBorderColor: {
|
|
32
|
+
control: { type: 'select' },
|
|
33
|
+
options: Object.keys(UIColorName),
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
args: {
|
|
37
|
+
size: UISize.M,
|
|
38
|
+
color: UIColorName.White,
|
|
39
|
+
bgColor: UIColorName.PurpleMain,
|
|
40
|
+
loaderBorderColor: 'transparent',
|
|
41
|
+
disabled: false,
|
|
42
|
+
isLoading: false,
|
|
43
|
+
isBoxShadow: true,
|
|
44
|
+
},
|
|
45
|
+
} as Meta<typeof UIButton>;
|
|
46
|
+
|
|
47
|
+
export const DefaultButton: StoryFn<typeof UIButton> = (args) => ({
|
|
48
|
+
components: { UIButton },
|
|
49
|
+
setup() {
|
|
50
|
+
return { args, UIColor };
|
|
51
|
+
},
|
|
52
|
+
template: `<UIButton
|
|
53
|
+
v-bind="args"
|
|
54
|
+
:color="UIColor[args.color]"
|
|
55
|
+
:bg-color="UIColor[args.bgColor]"
|
|
56
|
+
:loader-border-color="UIColor[args.loaderBorderColor]"
|
|
57
|
+
>
|
|
58
|
+
Кнопка
|
|
59
|
+
</UIButton>`,
|
|
60
|
+
});
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue';
|
|
3
|
+
import { Nullable, UIColorName, UIColorValues, UISize } from '@/types';
|
|
4
|
+
import { UILoader } from '@/components';
|
|
5
|
+
import { UIColor } from '@/constants';
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(
|
|
8
|
+
defineProps<{
|
|
9
|
+
text?: string;
|
|
10
|
+
isLoading?: boolean;
|
|
11
|
+
isBoxShadow?: boolean;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
size?: UISize;
|
|
14
|
+
color?: UIColorValues;
|
|
15
|
+
bgColor?: UIColorValues;
|
|
16
|
+
loaderBorderColor: UIColorValues;
|
|
17
|
+
}>(),
|
|
18
|
+
{
|
|
19
|
+
text: '',
|
|
20
|
+
isLoading: false,
|
|
21
|
+
isBoxShadow: true,
|
|
22
|
+
disabled: false,
|
|
23
|
+
size: UISize.M,
|
|
24
|
+
color: UIColor[UIColorName.PurpleMain],
|
|
25
|
+
bgColor: UIColor[UIColorName.White],
|
|
26
|
+
loaderBorderColor: UIColor[UIColorName.Transparent],
|
|
27
|
+
},
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const emit = defineEmits<{
|
|
31
|
+
click: [void];
|
|
32
|
+
}>();
|
|
33
|
+
|
|
34
|
+
const classList = computed(() => ({
|
|
35
|
+
[`--${props.size}-size`]: props.size,
|
|
36
|
+
'is-box-shadow': props.isBoxShadow,
|
|
37
|
+
}));
|
|
38
|
+
|
|
39
|
+
const borderColor = computed<Nullable<UIColorValues>>(
|
|
40
|
+
() => (props.color as UIColorValues) || null,
|
|
41
|
+
);
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<template>
|
|
45
|
+
<button
|
|
46
|
+
:class="classList"
|
|
47
|
+
:disabled="disabled || isLoading"
|
|
48
|
+
class="ui-button"
|
|
49
|
+
@click="emit('click')"
|
|
50
|
+
>
|
|
51
|
+
<UILoader
|
|
52
|
+
v-if="isLoading"
|
|
53
|
+
:border-color="borderColor"
|
|
54
|
+
:loader-border-color="loaderBorderColor"
|
|
55
|
+
class="ui-button__loader"
|
|
56
|
+
/>
|
|
57
|
+
<slot v-else>
|
|
58
|
+
<span v-html="text" />
|
|
59
|
+
</slot>
|
|
60
|
+
</button>
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<style scoped lang="scss">
|
|
64
|
+
@use '@/assets/scss/mixins/index.mixin';
|
|
65
|
+
|
|
66
|
+
.ui-button {
|
|
67
|
+
@include index.text(14px, 700, 100%);
|
|
68
|
+
|
|
69
|
+
width: 100%;
|
|
70
|
+
background: v-bind(bgColor);
|
|
71
|
+
color: v-bind(color);
|
|
72
|
+
border: none;
|
|
73
|
+
transition: filter 0.25s;
|
|
74
|
+
border-radius: 8px;
|
|
75
|
+
outline: none;
|
|
76
|
+
cursor: pointer;
|
|
77
|
+
|
|
78
|
+
&.is-box-shadow {
|
|
79
|
+
box-shadow: 0 4px 29px rgb(0 0 0 / 10%);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// button state
|
|
83
|
+
&:hover {
|
|
84
|
+
filter: brightness(90%);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&:disabled {
|
|
88
|
+
filter: opacity(70%);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&__loader {
|
|
92
|
+
margin: 0 auto;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// button size
|
|
96
|
+
&.--xs-size {
|
|
97
|
+
min-height: 33px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&.--s-size {
|
|
101
|
+
min-height: 44px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&.--m-size {
|
|
105
|
+
@include index.text(15px, 700, 100%);
|
|
106
|
+
|
|
107
|
+
min-height: 54px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&.--l-size {
|
|
111
|
+
min-height: 64px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&.--custom-size {
|
|
115
|
+
min-height: inherit;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
</style>
|