@velumweb/ui-kit 1.0.0
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/.storybook/main.ts +14 -0
- package/.storybook/manager.ts +32 -0
- package/.storybook/preview.ts +14 -0
- package/dist/Button/Button.d.ts +32 -0
- package/dist/Button/Button.stories.d.ts +15 -0
- package/dist/Button/index.d.ts +1 -0
- package/dist/Container/Box.d.ts +33 -0
- package/dist/Container/index.d.ts +1 -0
- package/dist/Input/Input.d.ts +38 -0
- package/dist/Input/Input.stories.d.ts +14 -0
- package/dist/Input/index.d.ts +1 -0
- package/dist/Modal/Modal.d.ts +29 -0
- package/dist/Modal/Modal.stories.d.ts +13 -0
- package/dist/Modal/index.d.ts +1 -0
- package/dist/Toggle/Toggle.d.ts +18 -0
- package/dist/Toggle/Toggle.stories.d.ts +13 -0
- package/dist/Toggle/index.d.ts +1 -0
- package/dist/assets/svg-lib/3-dots-horizontal-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/about-empty-page-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/alert-square.svg +26 -0
- package/dist/assets/svg-lib/arrow-bottom-svgrepo-com.svg +9 -0
- package/dist/assets/svg-lib/arrow-left-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/arrow-right-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/arrow-top-svgrepo-com.svg +9 -0
- package/dist/assets/svg-lib/checkmark-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/clock-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/cross-svgrepo-com.svg +12 -0
- package/dist/assets/svg-lib/download-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/edit-pen-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/favorite-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/forbiden-svgrepo-com.svg +9 -0
- package/dist/assets/svg-lib/input-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/link-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/messages-alert-svgrepo-com.svg +6 -0
- package/dist/assets/svg-lib/messages-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/mic-off-svgrepo-com.svg +6 -0
- package/dist/assets/svg-lib/mic-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/music-svgrepo-com.svg +6 -0
- package/dist/assets/svg-lib/next-long-arrow-right-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/notification-alert-svgrepo-com.svg +6 -0
- package/dist/assets/svg-lib/notification-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/notifications-off-svgrepo-com.svg +6 -0
- package/dist/assets/svg-lib/party-simple-colored-svgrepo-com.svg +11 -0
- package/dist/assets/svg-lib/pattern-circles-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/play-button-simple-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/plus-outlined-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/previous-long-arrow-left-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/queue-listing-cards-svgrepo-com.svg +6 -0
- package/dist/assets/svg-lib/queue-remove-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/recent-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/remove-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/repeat-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/schedule-add-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/schedule-alert-svgrepo-com.svg +6 -0
- package/dist/assets/svg-lib/schedule-remove-svgrepo-com.svg +6 -0
- package/dist/assets/svg-lib/schedule-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/search-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/session-abandon-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/session-join-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/session-leave-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/settings-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/share-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/sound-off-svgrepo-com.svg +6 -0
- package/dist/assets/svg-lib/sound-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/spectacles-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/star-svgrepo-com.svg +5 -0
- package/dist/assets/svg-lib/user-avatar-with-alert-svgrepo-com.svg +6 -0
- package/dist/assets/svg-lib/user-banned-svgrepo-com.svg +6 -0
- package/dist/assets/svg-lib/user-svgrepo-com.svg +5 -0
- package/dist/assets/svglist.png +0 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.es.d.ts +2 -0
- package/dist/index.es.js +569 -0
- package/dist/index.umd.js +6 -0
- package/dist/ui-kit.css +1 -0
- package/docs/Button/Button.d.ts +32 -0
- package/docs/Button/Button.stories.d.ts +15 -0
- package/docs/Button/index.d.ts +1 -0
- package/docs/CNAME +1 -0
- package/docs/Container/Box.d.ts +33 -0
- package/docs/Container/index.d.ts +1 -0
- package/docs/Input/Input.d.ts +38 -0
- package/docs/Input/Input.stories.d.ts +14 -0
- package/docs/Input/index.d.ts +1 -0
- package/docs/Modal/Modal.d.ts +29 -0
- package/docs/Modal/Modal.stories.d.ts +13 -0
- package/docs/Modal/index.d.ts +1 -0
- package/docs/Toggle/Toggle.d.ts +18 -0
- package/docs/Toggle/Toggle.stories.d.ts +13 -0
- package/docs/Toggle/index.d.ts +1 -0
- package/docs/assets/Button-CfaZpHIg.css +1 -0
- package/docs/assets/Button-DBH2W8EG.js +1 -0
- package/docs/assets/Button.stories-uPwy2cWr.js +34 -0
- package/docs/assets/Input-D117xj27.js +1 -0
- package/docs/assets/Input-RjFZkyU_.css +1 -0
- package/docs/assets/Input.stories-Ck4AyV-4.js +21 -0
- package/docs/assets/Modal-CWKTs3Ep.css +1 -0
- package/docs/assets/Modal.stories-3HMpRqSx.js +7 -0
- package/docs/assets/Toggle-BmcBtVup.css +1 -0
- package/docs/assets/Toggle-DiHagfS3.js +1 -0
- package/docs/assets/Toggle.stories-d01loxLD.js +9 -0
- package/docs/assets/iframe-D7bwIom8.js +1062 -0
- package/docs/assets/jsx-runtime-u17CrQMm.js +1 -0
- package/docs/assets/preload-helper-PPVm8Dsz.js +1 -0
- package/docs/assets/react-18-CW3OMC0n.js +9 -0
- package/docs/assets/svg-lib/3-dots-horizontal-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/about-empty-page-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/alert-square.svg +26 -0
- package/docs/assets/svg-lib/arrow-bottom-svgrepo-com.svg +9 -0
- package/docs/assets/svg-lib/arrow-left-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/arrow-right-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/arrow-top-svgrepo-com.svg +9 -0
- package/docs/assets/svg-lib/checkmark-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/clock-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/cross-svgrepo-com.svg +12 -0
- package/docs/assets/svg-lib/download-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/edit-pen-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/favorite-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/forbiden-svgrepo-com.svg +9 -0
- package/docs/assets/svg-lib/input-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/link-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/messages-alert-svgrepo-com.svg +6 -0
- package/docs/assets/svg-lib/messages-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/mic-off-svgrepo-com.svg +6 -0
- package/docs/assets/svg-lib/mic-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/music-svgrepo-com.svg +6 -0
- package/docs/assets/svg-lib/next-long-arrow-right-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/notification-alert-svgrepo-com.svg +6 -0
- package/docs/assets/svg-lib/notification-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/notifications-off-svgrepo-com.svg +6 -0
- package/docs/assets/svg-lib/party-simple-colored-svgrepo-com.svg +11 -0
- package/docs/assets/svg-lib/pattern-circles-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/play-button-simple-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/plus-outlined-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/previous-long-arrow-left-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/queue-listing-cards-svgrepo-com.svg +6 -0
- package/docs/assets/svg-lib/queue-remove-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/recent-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/remove-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/repeat-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/schedule-add-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/schedule-alert-svgrepo-com.svg +6 -0
- package/docs/assets/svg-lib/schedule-remove-svgrepo-com.svg +6 -0
- package/docs/assets/svg-lib/schedule-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/search-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/session-abandon-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/session-join-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/session-leave-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/settings-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/share-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/sound-off-svgrepo-com.svg +6 -0
- package/docs/assets/svg-lib/sound-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/spectacles-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/star-svgrepo-com.svg +5 -0
- package/docs/assets/svg-lib/user-avatar-with-alert-svgrepo-com.svg +6 -0
- package/docs/assets/svg-lib/user-banned-svgrepo-com.svg +6 -0
- package/docs/assets/svg-lib/user-svgrepo-com.svg +5 -0
- package/docs/assets/svglist.png +0 -0
- package/docs/favicon-wrapper.svg +46 -0
- package/docs/favicon.svg +1 -0
- package/docs/iframe.html +686 -0
- package/docs/index.d.ts +5 -0
- package/docs/index.html +137 -0
- package/docs/index.json +1 -0
- package/docs/makeColors.ts +37 -0
- package/docs/notes.txt +11 -0
- package/docs/nunito-sans-bold-italic.woff2 +0 -0
- package/docs/nunito-sans-bold.woff2 +0 -0
- package/docs/nunito-sans-italic.woff2 +0 -0
- package/docs/nunito-sans-regular.woff2 +0 -0
- package/docs/project.json +1 -0
- package/docs/sb-addons/storybook-1/manager-bundle.js +3 -0
- package/docs/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +628 -0
- package/docs/sb-common-assets/favicon-wrapper.svg +46 -0
- package/docs/sb-common-assets/favicon.svg +1 -0
- package/docs/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/docs/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/docs/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/docs/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/docs/sb-manager/globals-runtime.js +75597 -0
- package/docs/sb-manager/globals.js +24 -0
- package/docs/sb-manager/manager-stores.js +23 -0
- package/docs/sb-manager/runtime.js +19698 -0
- package/docs/style_setter.js +19 -0
- package/docs/vite-inject-mocker-entry.js +2 -0
- package/index.html +7 -0
- package/package.json +37 -0
- package/public/assets/svg-lib/3-dots-horizontal-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/about-empty-page-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/alert-square.svg +26 -0
- package/public/assets/svg-lib/arrow-bottom-svgrepo-com.svg +9 -0
- package/public/assets/svg-lib/arrow-left-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/arrow-right-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/arrow-top-svgrepo-com.svg +9 -0
- package/public/assets/svg-lib/checkmark-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/clock-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/cross-svgrepo-com.svg +12 -0
- package/public/assets/svg-lib/download-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/edit-pen-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/favorite-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/forbiden-svgrepo-com.svg +9 -0
- package/public/assets/svg-lib/input-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/link-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/messages-alert-svgrepo-com.svg +6 -0
- package/public/assets/svg-lib/messages-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/mic-off-svgrepo-com.svg +6 -0
- package/public/assets/svg-lib/mic-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/music-svgrepo-com.svg +6 -0
- package/public/assets/svg-lib/next-long-arrow-right-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/notification-alert-svgrepo-com.svg +6 -0
- package/public/assets/svg-lib/notification-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/notifications-off-svgrepo-com.svg +6 -0
- package/public/assets/svg-lib/party-simple-colored-svgrepo-com.svg +11 -0
- package/public/assets/svg-lib/pattern-circles-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/play-button-simple-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/plus-outlined-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/previous-long-arrow-left-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/queue-listing-cards-svgrepo-com.svg +6 -0
- package/public/assets/svg-lib/queue-remove-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/recent-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/remove-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/repeat-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/schedule-add-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/schedule-alert-svgrepo-com.svg +6 -0
- package/public/assets/svg-lib/schedule-remove-svgrepo-com.svg +6 -0
- package/public/assets/svg-lib/schedule-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/search-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/session-abandon-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/session-join-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/session-leave-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/settings-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/share-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/sound-off-svgrepo-com.svg +6 -0
- package/public/assets/svg-lib/sound-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/spectacles-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/star-svgrepo-com.svg +5 -0
- package/public/assets/svg-lib/user-avatar-with-alert-svgrepo-com.svg +6 -0
- package/public/assets/svg-lib/user-banned-svgrepo-com.svg +6 -0
- package/public/assets/svg-lib/user-svgrepo-com.svg +5 -0
- package/public/assets/svglist.png +0 -0
- package/readme.md +9 -0
- package/src/components/Button/Button.stories.ts +64 -0
- package/src/components/Button/Button.tsx +99 -0
- package/src/components/Button/button.scss +147 -0
- package/src/components/Button/index.ts +1 -0
- package/src/components/Container/Box.tsx +83 -0
- package/src/components/Container/box.scss +41 -0
- package/src/components/Container/index.ts +1 -0
- package/src/components/Input/Input.stories.ts +49 -0
- package/src/components/Input/Input.tsx +172 -0
- package/src/components/Input/index.ts +1 -0
- package/src/components/Input/input.scss +69 -0
- package/src/components/Modal/Modal.stories.ts +33 -0
- package/src/components/Modal/Modal.tsx +125 -0
- package/src/components/Modal/index.ts +1 -0
- package/src/components/Modal/modal.scss +54 -0
- package/src/components/Toggle/Toggle.stories.ts +35 -0
- package/src/components/Toggle/Toggle.tsx +60 -0
- package/src/components/Toggle/index.ts +1 -0
- package/src/components/Toggle/toggle.scss +97 -0
- package/src/components/index.ts +5 -0
- package/src/main.scss +46 -0
- package/tsconfig.json +15 -0
- package/utils/makeColors.ts +37 -0
- package/utils/notes.txt +11 -0
- package/utils/style_setter.js +19 -0
- package/vite.config.ts +32 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Компоненты контейнеры
|
|
4
|
+
* - разные направления
|
|
5
|
+
* - семантические обертки
|
|
6
|
+
* - позиционирование
|
|
7
|
+
*/
|
|
8
|
+
export interface BoxProps {
|
|
9
|
+
/** Направление строка или столбец */
|
|
10
|
+
direction?: 'row' | 'column';
|
|
11
|
+
/** Горизонтальное выравнивание **/
|
|
12
|
+
align?: 'top' | 'center' | 'bottom';
|
|
13
|
+
/** Горизонтальное распределение **/
|
|
14
|
+
justify?: 'start' | 'end' | 'center' | 'space';
|
|
15
|
+
/** Перенос блоков внутри контейнера **/
|
|
16
|
+
wrapContent?: boolean;
|
|
17
|
+
/** Дополнительные классы */
|
|
18
|
+
cls?: string;
|
|
19
|
+
/** Расстояние между дочерними элементами */
|
|
20
|
+
gap?: number;
|
|
21
|
+
/** Внешние отступы */
|
|
22
|
+
margin?: number[];
|
|
23
|
+
/** Внутренние отступы */
|
|
24
|
+
padding?: number[];
|
|
25
|
+
/** Родительский тег для семантики */
|
|
26
|
+
parent?: 'header' | 'footer' | 'article' | 'section' | 'main' | 'div';
|
|
27
|
+
/** Содержимое контейнера **/
|
|
28
|
+
children: ReactNode | string;
|
|
29
|
+
/** Маска загрузки **/
|
|
30
|
+
mask?: boolean;
|
|
31
|
+
}
|
|
32
|
+
/** Элемент контейнера */
|
|
33
|
+
export declare const Box: ({ direction, align, justify, wrapContent, cls, gap, margin, padding, parent, mask, children, ...props }: BoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Box';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Компонент поля для ввода текста
|
|
3
|
+
* - тип (текст, цифры, пароль)
|
|
4
|
+
* - это поисковая строка (значок лупы)
|
|
5
|
+
* - валидация
|
|
6
|
+
*/
|
|
7
|
+
export interface InputProps {
|
|
8
|
+
/** Значение */
|
|
9
|
+
value?: string | number;
|
|
10
|
+
/** Текстовое поле \ цифровое \ пароль \ textarea */
|
|
11
|
+
type?: 'text' | 'number' | 'password' | 'email' | 'date' | 'tel' | 'time' | 'textarea';
|
|
12
|
+
/** Углы прямые / Закругленные / Круглые */
|
|
13
|
+
corners?: 'square' | 'standard' | 'round';
|
|
14
|
+
/** Доступность поля */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Текст над полем */
|
|
17
|
+
label?: string;
|
|
18
|
+
/** Текст под полем */
|
|
19
|
+
bottomText?: string;
|
|
20
|
+
/** Плейсхолдер */
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
/** Живой поиск */
|
|
23
|
+
live?: boolean;
|
|
24
|
+
/** Событие при изменении */
|
|
25
|
+
onChange?: (value?: string | number) => void;
|
|
26
|
+
/** Это поиск */
|
|
27
|
+
isSearch?: boolean;
|
|
28
|
+
/** Валидация */
|
|
29
|
+
mask?: RegExp;
|
|
30
|
+
/** Ошибки валидации */
|
|
31
|
+
errorText: string;
|
|
32
|
+
/** Ширина в px */
|
|
33
|
+
width?: number;
|
|
34
|
+
/** Дополнительные классы */
|
|
35
|
+
cls?: string;
|
|
36
|
+
}
|
|
37
|
+
/** Элемент кнопки */
|
|
38
|
+
export declare const Input: ({ value, type, corners, disabled, label, bottomText, placeholder, errorText, live, isSearch, mask, width, onChange, cls, ...props }: InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ value, type, corners, disabled, label, bottomText, placeholder, errorText, live, isSearch, mask, width, onChange, cls, ...props }: import('./Input').InputProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
decorators: ((Story: any) => any)[];
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const TextField: Story;
|
|
14
|
+
export declare const Search: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Input';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Компонент модальное окно
|
|
4
|
+
* - размеры
|
|
5
|
+
* - углы
|
|
6
|
+
* - тип непрозрачности фона
|
|
7
|
+
*/
|
|
8
|
+
export interface ModalProps {
|
|
9
|
+
/** Ширина */
|
|
10
|
+
width?: number | 'auto';
|
|
11
|
+
/** Углы прямые / Закругленные / Круглые */
|
|
12
|
+
corners?: 'square' | 'standard' | 'round';
|
|
13
|
+
/** Тип непрозрачности фона */
|
|
14
|
+
background?: 'blackout' | 'blur';
|
|
15
|
+
/** Содержимое контейнера **/
|
|
16
|
+
children: ReactNode | string;
|
|
17
|
+
/** Дополнительные классы */
|
|
18
|
+
cls?: string;
|
|
19
|
+
/** Операции при закрытии */
|
|
20
|
+
onClose: () => void;
|
|
21
|
+
/** Окно открыто */
|
|
22
|
+
isOpen?: boolean;
|
|
23
|
+
/** Title */
|
|
24
|
+
title?: string;
|
|
25
|
+
/** Кнопка закрытия в углу */
|
|
26
|
+
closeButton?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** Элемент модалки */
|
|
29
|
+
export declare const Modal: ({ width, corners, background, isOpen, closeButton, title, cls, children, onClose, ...props }: ModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ width, corners, background, isOpen, closeButton, title, cls, children, onClose, ...props }: import('./Modal').ModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
decorators: ((Story: any) => any)[];
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const ModalWindow: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Modal';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Компонент переключателя
|
|
4
|
+
*/
|
|
5
|
+
export interface ToggleProps {
|
|
6
|
+
/** Маленькая / Средняя / Большая */
|
|
7
|
+
size?: 'small' | 'medium' | 'large';
|
|
8
|
+
/** Доступность переключателя */
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/** Текст переключателя */
|
|
11
|
+
text?: string;
|
|
12
|
+
/** Событие при нажатии */
|
|
13
|
+
onClick?: (e?: MouseEvent) => void;
|
|
14
|
+
/** Дополнительные классы */
|
|
15
|
+
cls?: string;
|
|
16
|
+
}
|
|
17
|
+
/** Элемент кнопки */
|
|
18
|
+
export declare const Toggle: React.FC<ToggleProps>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').FC<import('./Toggle').ToggleProps>;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
};
|
|
8
|
+
tags: string[];
|
|
9
|
+
decorators: ((Story: any) => any)[];
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
type Story = StoryObj<typeof meta>;
|
|
13
|
+
export declare const CustomToggle: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Toggle';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.kit-box{margin:0;padding:0;display:flex;width:100%;flex-wrap:nowrap}.kit-box--row{flex-direction:row}.kit-box--column{flex-direction:column}.kit-box--align-top{align-items:flex-start}.kit-box--align-center{align-items:center}.kit-box--align-bottom{align-items:flex-end}.kit-box--justify-start{justify-content:flex-start}.kit-box--justify-end{justify-content:flex-end}.kit-box--justify-center{justify-content:center}.kit-box--justify-space{justify-content:space-between}.kit-box--wrap{flex-wrap:wrap}:root{--font-family: "Nunito Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;--text-color: #2e3242;--text-color-secondary: #94a3b8;--error-color: #ef4949;--bg-color: #fff;--primary-btn-color: #7C3AED;--secondary-btn-color: #FFFFFF;--hover-btn-color: #6D28D9;--corners-standard: .65em;--corners-round: 3em;--corners-square: 0}*,*:before,*:after{margin:0;padding:0;box-sizing:border-box;font-family:var(--font-family)}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.kit-btn{display:inline-block;cursor:pointer;border:0;font-weight:700;line-height:1;font-family:var(--font-family);transition:background-color .3s ease;padding:8px 16px}.kit-btn>.kit-box{width:fit-content}.kit-btn:active{transform:translateY(.5px);box-shadow:0 0 5px #0000004d inset}.kit-btn.kit-icon{pointer-events:none}.kit-btn.kit-btn--disabled{opacity:.5;pointer-events:none;-webkit-user-select:none;user-select:none}.kit-btn--primary{background-color:var(--primary-btn-color);color:var(--secondary-btn-color)}.kit-btn--primary>div>.kit-btn--svg{background-color:var(--secondary-btn-color)}.kit-btn--primary:hover{background-color:var(--hover-btn-color)}.kit-btn--secondary{border:1px var(--primary-btn-color) solid;background-color:transparent;color:var(--primary-btn-color)}.kit-btn--secondary>div>.kit-btn--svg{background-color:var(--primary-btn-color)}.kit-btn--secondary:hover{background-color:var(--hover-btn-color);color:var(--secondary-btn-color);border:1px var(--hover-btn-color) solid}.kit-btn--secondary:hover>div>.kit-btn--svg{background-color:var(--secondary-btn-color)}.kit-btn--transparent{border:none;background-color:transparent;color:var(--primary-btn-color)}.kit-btn--transparent>div>.kit-btn--svg{background-color:var(--primary-btn-color)}.kit-btn--transparent:hover{color:var(--hover-btn-color)}.kit-btn--transparent:hover>div>.kit-btn--svg{background-color:var(--hover-btn-color)}.kit-btn--transparent:active{box-shadow:unset}.kit-btn--small{font-size:12px}.kit-btn--small>div>.kit-btn--svg{width:20px;height:20px}.kit-btn--small:not(.kit-btn--icon)>.kit-container--h>.kit-btn--svg{width:16px;height:16px}.kit-btn--small:not(.kit-btn--icon)>.kit-container--v>.kit-btn--svg{width:24px;height:24px}.kit-btn--medium{font-size:14px}.kit-btn--medium>div>.kit-btn--svg{width:24px;height:24px}.kit-btn--medium:not(.kit-btn--icon)>.kit-container--h>.kit-btn--svg{width:20px;height:20px}.kit-btn--medium:not(.kit-btn--icon)>.kit-container--v>.kit-btn--svg{width:28px;height:28px}.kit-btn--large{font-size:16px}.kit-btn--large>div>.kit-btn--svg{width:32px;height:32px}.kit-btn--large:not(.kit-btn--icon)>.kit-container--h>.kit-btn--svg{width:24px;height:24px}.kit-btn--large:not(.kit-btn--icon)>.kit-container--v>.kit-btn--svg{width:32px;height:32px}.kit-btn--standard{border-radius:var(--corners-standard)}.kit-btn--round{border-radius:var(--corners-round)}.kit-btn--square{border-radius:var(--corners-square)}.kit-btn--icon{padding:8px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.kit-btn--svg{background-repeat:no-repeat;background-position:center;background-size:contain;mask-size:contain;mask-repeat:no-repeat;-webkit-mask-size:contain;-webkit-mask-repeat:no-repeat}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./jsx-runtime-u17CrQMm.js";const r=({direction:u="row",align:o="center",justify:d="center",wrapContent:s=!1,cls:m="",gap:c=8,margin:a=[0],padding:n=[0],parent:p="div",mask:f=!1,children:v,...i})=>{const l=p,t=a?.map(y=>y+"px").join(" "),b=n?.map(y=>y+"px").join(" ");return e.jsx(l,{className:["kit-box",`kit-box--${u}`,`kit-box--align-${o}`,`kit-box--justify-${d}`,s&&"kit-box--wrap",m].join(" "),style:{gap:`${c}px`,margin:`${t}`,padding:`${b}`},...i,children:v})};r.__docgenInfo={description:"Элемент контейнера",methods:[],displayName:"Box",props:{direction:{required:!1,tsType:{name:"union",raw:"'row' | 'column'",elements:[{name:"literal",value:"'row'"},{name:"literal",value:"'column'"}]},description:"Направление строка или столбец",defaultValue:{value:"'row'",computed:!1}},align:{required:!1,tsType:{name:"union",raw:"'top' | 'center' | 'bottom'",elements:[{name:"literal",value:"'top'"},{name:"literal",value:"'center'"},{name:"literal",value:"'bottom'"}]},description:"Горизонтальное выравнивание *",defaultValue:{value:"'center'",computed:!1}},justify:{required:!1,tsType:{name:"union",raw:"'start' | 'end' | 'center' | 'space'",elements:[{name:"literal",value:"'start'"},{name:"literal",value:"'end'"},{name:"literal",value:"'center'"},{name:"literal",value:"'space'"}]},description:"Горизонтальное распределение *",defaultValue:{value:"'center'",computed:!1}},wrapContent:{required:!1,tsType:{name:"boolean"},description:"Перенос блоков внутри контейнера *",defaultValue:{value:"false",computed:!1}},cls:{required:!1,tsType:{name:"string"},description:"Дополнительные классы",defaultValue:{value:"''",computed:!1}},gap:{required:!1,tsType:{name:"number"},description:"Расстояние между дочерними элементами",defaultValue:{value:"8",computed:!1}},margin:{required:!1,tsType:{name:"Array",elements:[{name:"number"}],raw:"number[]"},description:"Внешние отступы",defaultValue:{value:"[0]",computed:!1}},padding:{required:!1,tsType:{name:"Array",elements:[{name:"number"}],raw:"number[]"},description:"Внутренние отступы",defaultValue:{value:"[0]",computed:!1}},parent:{required:!1,tsType:{name:"union",raw:"'header' | 'footer' | 'article' | 'section' | 'main' | 'div'",elements:[{name:"literal",value:"'header'"},{name:"literal",value:"'footer'"},{name:"literal",value:"'article'"},{name:"literal",value:"'section'"},{name:"literal",value:"'main'"},{name:"literal",value:"'div'"}]},description:"Родительский тег для семантики",defaultValue:{value:"'div'",computed:!1}},children:{required:!0,tsType:{name:"union",raw:"ReactNode | string",elements:[{name:"ReactNode"},{name:"string"}]},description:"Содержимое контейнера *"},mask:{required:!1,tsType:{name:"boolean"},description:"Маска загрузки *",defaultValue:{value:"false",computed:!1}}}};const g=({type:u="primary",size:o="medium",corners:d="standard",disabled:s=!1,staticIcon:m=!1,cls:c="",text:a="",iconPath:n="",labelAlign:p="",onClick:f,...v})=>{const i=n!=""&&a===""?"kit-btn--icon":"";let l;const t=()=>n?e.jsx("div",{className:"kit-btn--svg",style:{maskImage:`url(assets/${n})`,WebkitMaskImage:`url(assets/${n})`}}):null;switch(p){case"right":l=()=>e.jsxs(r,{direction:"row",children:[e.jsx(t,{}),a]});break;case"left":l=()=>e.jsxs(r,{direction:"row",children:[a,e.jsx(t,{})]});break;case"top":l=()=>e.jsxs(r,{direction:"column",children:[a,e.jsx(t,{})]});break;case"bottom":l=()=>e.jsxs(r,{direction:"column",children:[e.jsx(t,{}),a]});break;default:l=()=>e.jsx(r,{direction:"row",children:i?e.jsx(t,{}):a});break}return e.jsx("button",{type:"button",onClick:s||!f?null:f,className:["kit-btn",`kit-btn--${o}`,`kit-btn--${d}`,`kit-btn--${u}`,s?"kit-btn--disabled":"",m?"kit-icon":"",i,c].join(" "),...v,children:e.jsx(l,{})})};g.__docgenInfo={description:"Элемент кнопки",methods:[],displayName:"Button",props:{type:{required:!1,tsType:{name:"union",raw:"'primary' | 'transparent' | 'secondary'",elements:[{name:"literal",value:"'primary'"},{name:"literal",value:"'transparent'"},{name:"literal",value:"'secondary'"}]},description:"Основная / Только текст / Вспомогательная",defaultValue:{value:"'primary'",computed:!1}},size:{required:!1,tsType:{name:"union",raw:"'small' | 'medium' | 'large'",elements:[{name:"literal",value:"'small'"},{name:"literal",value:"'medium'"},{name:"literal",value:"'large'"}]},description:"Маленькая / Средняя / Большая",defaultValue:{value:"'medium'",computed:!1}},corners:{required:!1,tsType:{name:"union",raw:"'square' | 'standard' | 'round'",elements:[{name:"literal",value:"'square'"},{name:"literal",value:"'standard'"},{name:"literal",value:"'round'"}]},description:"Углы прямые / Закругленные / Круглые",defaultValue:{value:"'standard'",computed:!1}},disabled:{required:!1,tsType:{name:"boolean"},description:"Доступность кнопки",defaultValue:{value:"false",computed:!1}},text:{required:!1,tsType:{name:"string"},description:"Текст кнопки",defaultValue:{value:"''",computed:!1}},onClick:{required:!1,tsType:{name:"signature",type:"function",raw:"(e?: MouseEvent) => void",signature:{arguments:[{type:{name:"MouseEvent"},name:"e"}],return:{name:"void"}}},description:"Событие при нажатии"},cls:{required:!1,tsType:{name:"string"},description:"Дополнительные классы",defaultValue:{value:"''",computed:!1}},iconPath:{required:!1,tsType:{name:"string"},description:"Путь до иконки из assets",defaultValue:{value:"''",computed:!1}},labelAlign:{required:!1,tsType:{name:"union",raw:"'right' | 'left' | 'bottom' | 'top'",elements:[{name:"literal",value:"'right'"},{name:"literal",value:"'left'"},{name:"literal",value:"'bottom'"},{name:"literal",value:"'top'"}]},description:"Расположение текста относительно иконки",defaultValue:{value:"''",computed:!1}},staticIcon:{required:!1,tsType:{name:"boolean"},description:"Это просто информационная иконка",defaultValue:{value:"false",computed:!1}}}};export{g as B,r as a};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import{B as r}from"./Button-DBH2W8EG.js";import"./jsx-runtime-u17CrQMm.js";const l={title:"Example Button",component:r,parameters:{layout:"centered"},tags:["autodocs"],decorators:[n=>{const t=document.createElement("script");return t.src="/style_setter.js",t.type="module",document.head.appendChild(t),n()}]},e={args:{text:"Button Example",type:"primary",size:"medium",corners:"standard",disabled:!1,cls:"",onClick:()=>console.log("CustomButton")}},o={args:{text:"Exit",type:"secondary",size:"medium",corners:"standard",disabled:!1,cls:"",onClick:()=>console.log("IconButton"),iconPath:"svg-lib/alert-square.svg",labelAlign:"bottom"}},s={args:{onClick:()=>console.log("Icon"),iconPath:"svg-lib/checkmark-svgrepo-com.svg",type:"transparent",size:"large",corners:"round",disabled:!1,cls:"",staticIcon:!0}};e.parameters={...e.parameters,docs:{...e.parameters?.docs,source:{originalSource:`{
|
|
2
|
+
args: {
|
|
3
|
+
text: 'Button Example',
|
|
4
|
+
type: 'primary',
|
|
5
|
+
size: 'medium',
|
|
6
|
+
corners: 'standard',
|
|
7
|
+
disabled: false,
|
|
8
|
+
cls: '',
|
|
9
|
+
onClick: () => console.log('CustomButton')
|
|
10
|
+
}
|
|
11
|
+
}`,...e.parameters?.docs?.source}}};o.parameters={...o.parameters,docs:{...o.parameters?.docs,source:{originalSource:`{
|
|
12
|
+
args: {
|
|
13
|
+
text: 'Exit',
|
|
14
|
+
type: 'secondary',
|
|
15
|
+
size: 'medium',
|
|
16
|
+
corners: 'standard',
|
|
17
|
+
disabled: false,
|
|
18
|
+
cls: '',
|
|
19
|
+
onClick: () => console.log('IconButton'),
|
|
20
|
+
iconPath: 'svg-lib/alert-square.svg',
|
|
21
|
+
labelAlign: 'bottom'
|
|
22
|
+
}
|
|
23
|
+
}`,...o.parameters?.docs?.source}}};s.parameters={...s.parameters,docs:{...s.parameters?.docs,source:{originalSource:`{
|
|
24
|
+
args: {
|
|
25
|
+
onClick: () => console.log('Icon'),
|
|
26
|
+
iconPath: 'svg-lib/checkmark-svgrepo-com.svg',
|
|
27
|
+
type: 'transparent',
|
|
28
|
+
size: 'large',
|
|
29
|
+
corners: 'round',
|
|
30
|
+
disabled: false,
|
|
31
|
+
cls: '',
|
|
32
|
+
staticIcon: true
|
|
33
|
+
}
|
|
34
|
+
}`,...s.parameters?.docs?.source}}};const i=["CustomButton","IconButton","Icon"];export{e as CustomButton,s as Icon,o as IconButton,i as __namedExportsOrder,l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./jsx-runtime-u17CrQMm.js";import{r as u}from"./iframe-D7bwIom8.js";import{B as g}from"./Button-DBH2W8EG.js";const I=({value:y="",type:n="text",corners:b="standard",disabled:k=!1,label:d="",bottomText:o="",placeholder:q="",errorText:h="",live:l=!1,isSearch:T=!1,mask:p,width:m,onChange:a,cls:j,...N})=>{const[s,c]=u.useState(y),[r,f]=u.useState(""),i=u.useId(),V=x=>{let t=x.target.value;n==="number"&&(t=t.toString().replace(/\D/g,"")),p&&!p.test(t.toString())?f(h||"Некорректное значение"):f(""),c(t),l&&a&&a(t)},w=()=>{c("")},v={value:s,placeholder:q,onChange:V,onBlur:x=>{!l&&a&&a(s)},className:["kit-input",`kit-input--${b}`,k?"kit-input--disabled":"",r?"kit-input--error":"",j].join(" ").trim()};return e.jsxs("div",{className:"kit-input--wrapper",children:[d&&e.jsx("div",{className:"w5rem",children:e.jsx("label",{for:i,className:"kit-input--label kit-input-secondary-text",children:d})}),e.jsxs("div",{className:"kit-input--container",style:{width:m?`${m}px`:"auto"},children:[n==="textarea"?e.jsx("textarea",{id:i,...v}):e.jsx("input",{...v,type:n,id:i}),e.jsxs("div",{className:"kit-input--icon-container",children:[s&&e.jsx(g,{type:"transparent",iconPath:"svg-lib/input-svgrepo-com.svg",size:"small",onClick:w,cls:"kit-input--icon"}),T&&e.jsx(g,{type:"transparent",iconPath:"svg-lib/search-svgrepo-com.svg",size:"small",staticIcon:l,onClick:()=>a&&a(s),cls:"kit-input--icon"})]})]}),!r&&o&&e.jsx("div",{className:"kit-input-bottomtext kit-input-secondary-text",children:o}),r&&e.jsx("div",{className:"kit-input-errortext kit-input-secondary-text",children:r})]})};I.__docgenInfo={description:"Элемент кнопки",methods:[],displayName:"Input",props:{value:{required:!1,tsType:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},description:"Значение",defaultValue:{value:"''",computed:!1}},type:{required:!1,tsType:{name:"union",raw:"'text' | 'number' | 'password' | 'email' | 'date' | 'tel' | 'time' | 'textarea'",elements:[{name:"literal",value:"'text'"},{name:"literal",value:"'number'"},{name:"literal",value:"'password'"},{name:"literal",value:"'email'"},{name:"literal",value:"'date'"},{name:"literal",value:"'tel'"},{name:"literal",value:"'time'"},{name:"literal",value:"'textarea'"}]},description:"Текстовое поле \\ цифровое \\ пароль \\ textarea",defaultValue:{value:"'text'",computed:!1}},corners:{required:!1,tsType:{name:"union",raw:"'square' | 'standard' | 'round'",elements:[{name:"literal",value:"'square'"},{name:"literal",value:"'standard'"},{name:"literal",value:"'round'"}]},description:"Углы прямые / Закругленные / Круглые",defaultValue:{value:"'standard'",computed:!1}},disabled:{required:!1,tsType:{name:"boolean"},description:"Доступность поля",defaultValue:{value:"false",computed:!1}},label:{required:!1,tsType:{name:"string"},description:"Текст над полем",defaultValue:{value:"''",computed:!1}},bottomText:{required:!1,tsType:{name:"string"},description:"Текст под полем",defaultValue:{value:"''",computed:!1}},placeholder:{required:!1,tsType:{name:"string"},description:"Плейсхолдер",defaultValue:{value:"''",computed:!1}},live:{required:!1,tsType:{name:"boolean"},description:"Живой поиск",defaultValue:{value:"false",computed:!1}},onChange:{required:!1,tsType:{name:"signature",type:"function",raw:"(value?: string | number) => void",signature:{arguments:[{type:{name:"union",raw:"string | number",elements:[{name:"string"},{name:"number"}]},name:"value"}],return:{name:"void"}}},description:"Событие при изменении"},isSearch:{required:!1,tsType:{name:"boolean"},description:"Это поиск",defaultValue:{value:"false",computed:!1}},mask:{required:!1,tsType:{name:"RegExp"},description:"Валидация"},errorText:{required:!1,tsType:{name:"string"},description:"Ошибки валидации",defaultValue:{value:"''",computed:!1}},width:{required:!1,tsType:{name:"number"},description:"Ширина в px"},cls:{required:!1,tsType:{name:"string"},description:"Дополнительные классы"}}};export{I};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";:root{--font-family: "Nunito Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;--text-color: #2e3242;--text-color-secondary: #94a3b8;--error-color: #ef4949;--bg-color: #fff;--primary-btn-color: #7C3AED;--secondary-btn-color: #FFFFFF;--hover-btn-color: #6D28D9;--corners-standard: .65em;--corners-round: 3em;--corners-square: 0}*,*:before,*:after{margin:0;padding:0;box-sizing:border-box;font-family:var(--font-family)}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.kit-input--container{display:flex;line-height:30px;align-items:center;position:relative}.kit-input{width:100%;height:36px;line-height:30px;padding:0 .6rem;border:1px solid var(--primary-btn-color);outline:none;background-color:#efefef;color:var(--text-color);transition:.3s ease}.kit-input.kit-input--disabled{opacity:.5;pointer-events:none;-webkit-user-select:none;user-select:none}.kit-input--error{border:1px solid var(--error-color)}.kit-input--standard{border-radius:var(--corners-standard)}.kit-input--round{border-radius:var(--corners-round)}.kit-input--square{border-radius:var(--corners-square)}.kit-input-secondary-text{font-size:12px;line-height:24px;margin-left:.8rem}.kit-input::placeholder,.kit-input-bottomtext{color:var(--text-color-secondary)}.kit-input-errortext{color:var(--error-color)}.kit-input--label{color:var(--text-color)}.kit-input:focus,.kit-input:hover{outline:none}.kit-input--icon-container{position:absolute;right:.4rem;fill:none;display:flex}.kit-input--icon{padding:4px}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{I as o}from"./Input-D117xj27.js";import"./jsx-runtime-u17CrQMm.js";import"./iframe-D7bwIom8.js";import"./preload-helper-PPVm8Dsz.js";import"./Button-DBH2W8EG.js";const d={title:"Example Input",component:o,parameters:{layout:"centered"},tags:["autodocs"],decorators:[a=>{const r=document.createElement("script");return r.src="/style_setter.js",r.type="module",document.head.appendChild(r),a()}]},e={args:{label:"Год вашего рождения",value:"2026",type:"text",bottomText:"Пишите только цифры",placeholder:"Год в формате YYYY",errorText:"Допустимы только цифры",mask:/^[0-9]+$/,width:300}},t={args:{value:"",type:"text",placeholder:"Найти по имени или году",width:250,live:!0,isSearch:!0}};e.parameters={...e.parameters,docs:{...e.parameters?.docs,source:{originalSource:`{
|
|
2
|
+
args: {
|
|
3
|
+
label: 'Год вашего рождения',
|
|
4
|
+
value: '2026',
|
|
5
|
+
type: 'text',
|
|
6
|
+
bottomText: 'Пишите только цифры',
|
|
7
|
+
placeholder: 'Год в формате YYYY',
|
|
8
|
+
errorText: 'Допустимы только цифры',
|
|
9
|
+
mask: /^[0-9]+$/,
|
|
10
|
+
width: 300
|
|
11
|
+
}
|
|
12
|
+
}`,...e.parameters?.docs?.source}}};t.parameters={...t.parameters,docs:{...t.parameters?.docs,source:{originalSource:`{
|
|
13
|
+
args: {
|
|
14
|
+
value: '',
|
|
15
|
+
type: 'text',
|
|
16
|
+
placeholder: 'Найти по имени или году',
|
|
17
|
+
width: 250,
|
|
18
|
+
live: true,
|
|
19
|
+
isSearch: true
|
|
20
|
+
}
|
|
21
|
+
}`,...t.parameters?.docs?.source}}};const m=["TextField","Search"];export{t as Search,e as TextField,m as __namedExportsOrder,d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";:root{--font-family: "Nunito Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;--text-color: #2e3242;--text-color-secondary: #94a3b8;--error-color: #ef4949;--bg-color: #fff;--primary-btn-color: #7C3AED;--secondary-btn-color: #FFFFFF;--hover-btn-color: #6D28D9;--corners-standard: .65em;--corners-round: 3em;--corners-square: 0}*,*:before,*:after{margin:0;padding:0;box-sizing:border-box;font-family:var(--font-family)}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.kit-modal--overlay{position:fixed;inset:0;width:100%;height:100%;background:#000c;z-index:9999;display:flex;align-items:center;justify-content:center;animation:fadeInOverlay .2s ease-out}.kit-modal{background-color:var(--bg-color);position:relative;max-width:420px;width:100%;min-height:200px;box-shadow:0 10px 30px #00000026;animation:fadeInModal .2s ease-out}.kit-modal>div{width:auto}.kit-modal-close{margin:-4px -16px 0 0}.kit-modal--standard{border-radius:var(--corners-standard)}.kit-modal--round{border-radius:var(--corners-round)}.kit-modal--square{border-radius:var(--corners-square)}@keyframes fadeInOverlay{0%{opacity:0}to{opacity:1}}@keyframes fadeInModal{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{j as e}from"./jsx-runtime-u17CrQMm.js";import{r as n}from"./iframe-D7bwIom8.js";import{a as d,B as b}from"./Button-DBH2W8EG.js";import"./Input-D117xj27.js";import"./Toggle-DiHagfS3.js";import"./preload-helper-PPVm8Dsz.js";const p=({width:a="auto",corners:t="standard",background:f="blackout",isOpen:l=!1,closeButton:k=!0,title:x="",cls:y="",children:v,onClose:u,...g})=>{const c=n.useRef(null),[i,m]=n.useState(l);function r(){m(!1),u&&u()}return n.useEffect(()=>{m(l)},[l]),n.useEffect(()=>{if(!i)return;function o(w){w.key==="Escape"&&r()}document.addEventListener("keydown",o);const h=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=h,document.removeEventListener("keydown",o)}},[i,r]),e.jsx(e.Fragment,{children:i?e.jsx("div",{className:"kit-modal--overlay",onClick:o=>{o.target===c.current&&r()},ref:c,children:e.jsx("div",{className:["kit-modal",`kit-modal--${t}`,`kit-modal--bg-${f}`,y].join(" "),style:{width:isNaN(a)?"fit-content":`${a}px`},...g,children:e.jsxs(d,{padding:[8,16],direction:"column",children:[e.jsx(d,{justify:"end",margin:[0,-16],children:e.jsx(b,{type:"transparent",size:"large",onClick:r,iconPath:"svg-lib/cross-svgrepo-com.svg",cls:"kit-modal-close"})}),e.jsx(d,{justify:"start",children:v})]})})}):e.jsx(e.Fragment,{})})};p.__docgenInfo={description:"Элемент модалки",methods:[],displayName:"Modal",props:{width:{required:!1,tsType:{name:"union",raw:"number | 'auto'",elements:[{name:"number"},{name:"literal",value:"'auto'"}]},description:"Ширина",defaultValue:{value:"'auto'",computed:!1}},corners:{required:!1,tsType:{name:"union",raw:"'square' | 'standard' | 'round'",elements:[{name:"literal",value:"'square'"},{name:"literal",value:"'standard'"},{name:"literal",value:"'round'"}]},description:"Углы прямые / Закругленные / Круглые",defaultValue:{value:"'standard'",computed:!1}},background:{required:!1,tsType:{name:"union",raw:"'blackout' | 'blur'",elements:[{name:"literal",value:"'blackout'"},{name:"literal",value:"'blur'"}]},description:"Тип непрозрачности фона",defaultValue:{value:"'blackout'",computed:!1}},children:{required:!0,tsType:{name:"union",raw:"ReactNode | string",elements:[{name:"ReactNode"},{name:"string"}]},description:"Содержимое контейнера *"},cls:{required:!1,tsType:{name:"string"},description:"Дополнительные классы",defaultValue:{value:"''",computed:!1}},onClose:{required:!0,tsType:{name:"signature",type:"function",raw:"() => void",signature:{arguments:[],return:{name:"void"}}},description:"Операции при закрытии"},isOpen:{required:!1,tsType:{name:"boolean"},description:"Окно открыто",defaultValue:{value:"false",computed:!1}},title:{required:!1,tsType:{name:"string"},description:"Title",defaultValue:{value:"''",computed:!1}},closeButton:{required:!1,tsType:{name:"boolean"},description:"Кнопка закрытия в углу",defaultValue:{value:"true",computed:!1}}}};const V={title:"Modal",component:p,parameters:{layout:"centered"},tags:["autodocs"],decorators:[a=>{const t=document.createElement("script");return t.src="/style_setter.js",t.type="module",document.head.appendChild(t),a()}]},s={args:{width:400,isOpen:!0,children:"This is modal window! You can close it."}};s.parameters={...s.parameters,docs:{...s.parameters?.docs,source:{originalSource:`{
|
|
2
|
+
args: {
|
|
3
|
+
width: 400,
|
|
4
|
+
isOpen: true,
|
|
5
|
+
children: 'This is modal window! You can close it.'
|
|
6
|
+
}
|
|
7
|
+
}`,...s.parameters?.docs?.source}}};const B=["ModalWindow"];export{s as ModalWindow,B as __namedExportsOrder,V as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";:root{--font-family: "Nunito Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;--text-color: #2e3242;--text-color-secondary: #94a3b8;--error-color: #ef4949;--bg-color: #fff;--primary-btn-color: #7C3AED;--secondary-btn-color: #FFFFFF;--hover-btn-color: #6D28D9;--corners-standard: .65em;--corners-round: 3em;--corners-square: 0}*,*:before,*:after{margin:0;padding:0;box-sizing:border-box;font-family:var(--font-family)}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.kit-toggle{display:inline-flex;align-items:center;gap:12px;cursor:pointer;-webkit-user-select:none;user-select:none;font-family:system-ui,sans-serif}.kit-toggle--input{position:absolute;opacity:0;pointer-events:none}.kit-toggle--slider{position:relative;border-radius:999px;transition:background .25s ease;background:#d1d5db}.kit-toggle--slider:before{content:"";position:absolute;top:3px;left:3px;border-radius:50%;transition:transform .25s ease,box-shadow .25s ease;box-shadow:0 2px 6px #00000026;background:#fff}.kit-toggle--input:checked+.kit-toggle--slider{background:var(--primary-btn-color)}.kit-toggle--input:checked+.kit-toggle--slider:before{transform:translate(20px)}.kit-toggle--input:focus-visible+.kit-toggle--slider{outline:2px solid var(--primary-btn-color);outline-offset:2px}.kit-toggle--disabled{opacity:.5;pointer-events:none;-webkit-user-select:none;user-select:none}.kit-toggle--disabled .kit-toggle--slider{background:#9ca3af}.kit-toggle--label{color:var(--text-color)}.kit-toggle--small>.kit-toggle--slider{width:38px;height:18px}.kit-toggle--small>.kit-toggle--slider:before{width:12px;height:12px}.kit-toggle--small>.kit-toggle--label{font-size:14px}.kit-toggle--medium>.kit-toggle--slider{width:42px;height:22px}.kit-toggle--medium>.kit-toggle--slider:before{width:16px;height:16px}.kit-toggle--medium>.kit-toggle--label{font-size:16px}.kit-toggle--large>.kit-toggle--slider{width:46px;height:26px}.kit-toggle--large>.kit-toggle--slider:before{width:20px;height:20px}.kit-toggle--large>.kit-toggle--label{font-size:18px}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./jsx-runtime-u17CrQMm.js";import{r as o}from"./iframe-D7bwIom8.js";const u=({size:s="medium",disabled:a=!1,cls:i="",text:l="",onClick:r,...d})=>{const t=o.useId();return e.jsxs("label",{htmlFor:t,className:["kit-toggle",a?"kit-toggle--disabled":"",`kit-toggle--${s}`,i].join(" "),children:[e.jsx("input",{id:t,type:"checkbox",className:"kit-toggle--input",disabled:a,defaultChecked:!1,onChange:n=>r?.(n.target.checked)}),e.jsx("span",{className:"kit-toggle--slider","aria-hidden":"true"}),l&&e.jsx("span",{className:"kit-toggle--label",children:l})]})};u.__docgenInfo={description:"Элемент кнопки",methods:[],displayName:"Toggle",props:{size:{required:!1,tsType:{name:"union",raw:"'small' | 'medium' | 'large'",elements:[{name:"literal",value:"'small'"},{name:"literal",value:"'medium'"},{name:"literal",value:"'large'"}]},description:"Маленькая / Средняя / Большая",defaultValue:{value:"'medium'",computed:!1}},disabled:{required:!1,tsType:{name:"boolean"},description:"Доступность переключателя",defaultValue:{value:"false",computed:!1}},text:{required:!1,tsType:{name:"string"},description:"Текст переключателя",defaultValue:{value:"''",computed:!1}},onClick:{required:!1,tsType:{name:"signature",type:"function",raw:"(e?: MouseEvent) => void",signature:{arguments:[{type:{name:"MouseEvent"},name:"e"}],return:{name:"void"}}},description:"Событие при нажатии"},cls:{required:!1,tsType:{name:"string"},description:"Дополнительные классы",defaultValue:{value:"''",computed:!1}}}};export{u as T};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{T as t}from"./Toggle-DiHagfS3.js";import"./jsx-runtime-u17CrQMm.js";import"./iframe-D7bwIom8.js";import"./preload-helper-PPVm8Dsz.js";const m={title:"Example Toggle",component:t,parameters:{layout:"centered"},tags:["autodocs"],decorators:[s=>{const o=document.createElement("script");return o.src="/style_setter.js",o.type="module",document.head.appendChild(o),s()}]},e={args:{text:"subscribe",size:"medium",disabled:!1,cls:"",onClick:()=>console.log("CustomToggle")}};e.parameters={...e.parameters,docs:{...e.parameters?.docs,source:{originalSource:`{
|
|
2
|
+
args: {
|
|
3
|
+
text: 'subscribe',
|
|
4
|
+
size: 'medium',
|
|
5
|
+
disabled: false,
|
|
6
|
+
cls: '',
|
|
7
|
+
onClick: () => console.log('CustomToggle')
|
|
8
|
+
}
|
|
9
|
+
}`,...e.parameters?.docs?.source}}};const n=["CustomToggle"];export{e as CustomToggle,n as __namedExportsOrder,m as default};
|