@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,5 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
2
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" id="_24x24_On_Light_Sound" data-name="24x24/On Light/Sound" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<rect id="view-box" width="24" height="24" fill="none"/>
|
|
4
|
+
<path id="Shape" d="M5.12,15.573a7.786,7.786,0,0,1-1.507-1.59H2.751A2.754,2.754,0,0,1,0,11.232V6.269a2.754,2.754,0,0,1,2.751-2.75H3.6A7.288,7.288,0,0,1,5.053,1.931,8.67,8.67,0,0,1,10.75,0,.751.751,0,0,1,11.5.75v16a.751.751,0,0,1-.751.75A8.681,8.681,0,0,1,5.12,15.573ZM1.5,6.269v4.964a1.252,1.252,0,0,0,1.251,1.25H4.028a.752.752,0,0,1,.658.389A4,4,0,0,0,5,13.322a6.74,6.74,0,0,0,1.069,1.087A7.09,7.09,0,0,0,10,15.969V1.529A7,7,0,0,0,6.009,3.086,6.166,6.166,0,0,0,4.985,4.163,3.6,3.6,0,0,0,4.7,4.6a.748.748,0,0,1-.67.413H2.751A1.253,1.253,0,0,0,1.5,6.269ZM15,17.059A.751.751,0,0,1,15,16,10.249,10.249,0,0,0,15,1.5.75.75,0,1,1,16.059.442a11.749,11.749,0,0,1,0,16.617.751.751,0,0,1-1.061,0ZM13.17,14.23a.749.749,0,0,1,0-1.06,6.25,6.25,0,0,0,0-8.839A.75.75,0,1,1,14.23,3.27a7.75,7.75,0,0,1,0,10.96.749.749,0,0,1-1.06,0Z" transform="translate(2.25 3.25)" fill="#141124"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
2
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" id="_24x24_On_Light_Spectacles" data-name="24x24/On Light/Spectacles" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<rect id="view-box" width="24" height="24" fill="none"/>
|
|
4
|
+
<path id="Shape" d="M10,13.75a1.25,1.25,0,1,0-2.5,0,3.75,3.75,0,0,1-7.5,0c0-.022,0-.044,0-.065s0-.02,0-.029V2.75A2.75,2.75,0,0,1,2.75,0h1a.75.75,0,0,1,0,1.5h-1A1.249,1.249,0,0,0,1.5,2.75v8a3.745,3.745,0,0,1,5.4.965,2.75,2.75,0,0,1,3.7,0,3.746,3.746,0,0,1,5.4-.964v-8A1.25,1.25,0,0,0,14.75,1.5h-1a.75.75,0,1,1,0-1.5h1A2.75,2.75,0,0,1,17.5,2.75V13.656c0,.01,0,.02,0,.029s0,.043,0,.065a3.75,3.75,0,0,1-7.5,0Zm1.5,0a2.25,2.25,0,1,0,2.25-2.25A2.253,2.253,0,0,0,11.5,13.75Zm-10,0A2.25,2.25,0,1,0,3.75,11.5,2.252,2.252,0,0,0,1.5,13.75Z" transform="translate(3.25 3.25)" fill="#141124"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
2
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" id="_24x24_On_Light_Star" data-name="24x24/On Light/Star" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<rect id="view-box" width="24" height="24" fill="none"/>
|
|
4
|
+
<path id="Shape" d="M15.791,19.5,10.262,16.6,4.732,19.5a.75.75,0,0,1-1.088-.79L4.7,12.557.228,8.2a.75.75,0,0,1,.415-1.28l6.182-.9L9.589.419a.75.75,0,0,1,1.345,0l2.764,5.6,6.182.9A.751.751,0,0,1,20.3,8.2l-4.473,4.36,1.056,6.157a.748.748,0,0,1-1.088.79Z" transform="translate(1.739 1.25)" fill="#141124"/>
|
|
5
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
2
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" id="_24x24_On_Light_User-Alert" data-name="24x24/On Light/User-Alert" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<rect id="view-box" width="24" height="24" fill="none"/>
|
|
4
|
+
<path id="Shape" d="M9.75,19.5A9.75,9.75,0,1,1,11.68.192,5.479,5.479,0,0,0,11,1.6,8.254,8.254,0,0,0,1.5,9.75a8.163,8.163,0,0,0,1.713,5.027A5.594,5.594,0,0,1,5.135,13.7c.141-.052.288-.1.475-.167l.443-.149c.855-.293,1.169-.481,1.244-.747l0-.009.005-.024a.771.771,0,0,0-.058-.519.907.907,0,0,0-.237-.271A4.359,4.359,0,0,1,5.5,8.417,4.29,4.29,0,0,1,9.75,4a4.1,4.1,0,0,1,1.072.143,5.505,5.505,0,0,0,.937,2.28A2.7,2.7,0,0,0,9.75,5.5,2.807,2.807,0,0,0,7,8.417a2.848,2.848,0,0,0,1,2.274,2.28,2.28,0,0,1,.571.695,2.208,2.208,0,0,1,.2,1.537,1.41,1.41,0,0,1-.045.171c-.244.9-.9,1.271-2.188,1.711l-.445.15c-.166.056-.3.1-.437.154a4.286,4.286,0,0,0-1.419.77,8.234,8.234,0,0,0,11.03,0,4.3,4.3,0,0,0-1.421-.751c-.112-.041-.229-.081-.377-.13l-.386-.13c-1.332-.45-2.015-.825-2.293-1.742a1.863,1.863,0,0,1-.055-.223,2.36,2.36,0,0,1,.138-1.4,2.122,2.122,0,0,1,.589-.795,2.815,2.815,0,0,0,1.042-2.3,3.018,3.018,0,0,0-.489-1.666A5.557,5.557,0,0,0,14,8.268q0,.074,0,.149a4.3,4.3,0,0,1-1.559,3.427.673.673,0,0,0-.194.255.92.92,0,0,0-.043.527c.006.031.01.046.013.055.08.26.431.461,1.342.769l.384.129c.147.05.279.095.408.141a5.6,5.6,0,0,1,1.935,1.058A8.169,8.169,0,0,0,18,9.75,8.308,8.308,0,0,0,17.9,8.5a5.478,5.478,0,0,0,1.4-.676A9.755,9.755,0,0,1,9.75,19.5ZM17.362,6.569h0a8.342,8.342,0,0,0-4.431-4.43,3.527,3.527,0,0,1,.782-1.3,9.774,9.774,0,0,1,4.946,4.945,3.525,3.525,0,0,1-1.3.781Z" transform="translate(2.25 2.25)" fill="#141124"/>
|
|
5
|
+
<path id="Shape-2" data-name="Shape" d="M3.5,7A3.5,3.5,0,1,1,7,3.5,3.5,3.5,0,0,1,3.5,7Z" transform="translate(15 2)" fill="#ff6359"/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
2
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" id="_24x24_On_Light_User" data-name="24x24/On Light/User" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<rect id="view-box" width="24" height="24" fill="none"/>
|
|
4
|
+
<path id="Shape" d="M0,9.75A9.75,9.75,0,1,1,9.75,19.5,9.761,9.761,0,0,1,0,9.75ZM9.75,18a8.218,8.218,0,0,0,5.515-2.119,4.328,4.328,0,0,0-1.421-.75c-.112-.04-.229-.081-.377-.13l-.386-.13c-1.4-.471-2.023-.851-2.293-1.742a1.876,1.876,0,0,1-.055-.223,2.369,2.369,0,0,1,.138-1.4,2.123,2.123,0,0,1,.589-.795,2.823,2.823,0,0,0,1.042-2.3A2.832,2.832,0,0,0,9.75,5.5,2.8,2.8,0,0,0,7,8.417a2.843,2.843,0,0,0,1,2.274,2.278,2.278,0,0,1,.571.695,2.224,2.224,0,0,1,.2,1.537,1.152,1.152,0,0,1-.045.17c-.237.877-.847,1.254-2.188,1.712l-.445.15c-.173.059-.308.106-.437.154a4.312,4.312,0,0,0-1.419.771A8.216,8.216,0,0,0,9.75,18ZM14,8.417a4.32,4.32,0,0,1-1.559,3.427.672.672,0,0,0-.193.255.928.928,0,0,0-.043.527c.006.031.01.046.013.055.077.253.408.454,1.342.769l.384.129c.157.053.284.1.408.141a5.645,5.645,0,0,1,1.935,1.058,8.25,8.25,0,1,0-13.074,0A5.672,5.672,0,0,1,5.135,13.7c.144-.053.291-.1.475-.167l.443-.149c.863-.3,1.17-.484,1.244-.747,0,.006,0-.005.007-.033a.769.769,0,0,0-.058-.519.9.9,0,0,0-.237-.271A4.346,4.346,0,0,1,5.5,8.417,4.3,4.3,0,0,1,9.75,4,4.332,4.332,0,0,1,14,8.417Z" transform="translate(2.25 2.25)" fill="#abadb7"/>
|
|
5
|
+
<path id="Shape-2" data-name="Shape" d="M2.626.657.006,21.551a.75.75,0,0,0,1.488.187L4.115.843A.75.75,0,0,0,2.626.657Z" transform="translate(2.458 5.527) rotate(-45)" fill="#141124"/>
|
|
6
|
+
</svg>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?><!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
|
2
|
+
<svg width="800px" height="800px" viewBox="0 0 24 24" id="_24x24_On_Light_User" data-name="24x24/On Light/User" xmlns="http://www.w3.org/2000/svg">
|
|
3
|
+
<rect id="view-box" width="24" height="24" fill="none"/>
|
|
4
|
+
<path id="Shape" d="M0,9.75A9.75,9.75,0,1,1,9.75,19.5,9.761,9.761,0,0,1,0,9.75ZM9.75,18a8.218,8.218,0,0,0,5.515-2.119,4.328,4.328,0,0,0-1.421-.75c-.112-.04-.229-.081-.377-.13l-.386-.13c-1.4-.471-2.023-.851-2.293-1.742a1.876,1.876,0,0,1-.055-.223,2.369,2.369,0,0,1,.138-1.4,2.123,2.123,0,0,1,.589-.795,2.823,2.823,0,0,0,1.042-2.3A2.832,2.832,0,0,0,9.75,5.5,2.8,2.8,0,0,0,7,8.417a2.843,2.843,0,0,0,1,2.274,2.278,2.278,0,0,1,.571.695,2.224,2.224,0,0,1,.2,1.537,1.152,1.152,0,0,1-.045.17c-.237.877-.847,1.254-2.188,1.712l-.445.15c-.173.059-.308.106-.437.154a4.312,4.312,0,0,0-1.419.771A8.216,8.216,0,0,0,9.75,18ZM14,8.417a4.32,4.32,0,0,1-1.559,3.427.672.672,0,0,0-.193.255.928.928,0,0,0-.043.527c.006.031.01.046.013.055.077.253.408.454,1.342.769l.384.129c.157.053.284.1.408.141a5.645,5.645,0,0,1,1.935,1.058,8.25,8.25,0,1,0-13.074,0A5.672,5.672,0,0,1,5.135,13.7c.144-.053.291-.1.475-.167l.443-.149c.863-.3,1.17-.484,1.244-.747,0,.006,0-.005.007-.033a.769.769,0,0,0-.058-.519.9.9,0,0,0-.237-.271A4.346,4.346,0,0,1,5.5,8.417,4.3,4.3,0,0,1,9.75,4,4.332,4.332,0,0,1,14,8.417Z" transform="translate(2.25 2.25)" fill="#141124"/>
|
|
5
|
+
</svg>
|
|
Binary file
|
package/readme.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Button } from './Button';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Example Button',
|
|
6
|
+
component: Button,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered'
|
|
9
|
+
},
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
decorators: [
|
|
12
|
+
(Story) => {
|
|
13
|
+
const script = document.createElement('script')
|
|
14
|
+
script.src = '/style_setter.js'
|
|
15
|
+
script.type = 'module'
|
|
16
|
+
document.head.appendChild(script)
|
|
17
|
+
|
|
18
|
+
return Story()
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<typeof meta>;
|
|
25
|
+
|
|
26
|
+
export const CustomButton: Story = {
|
|
27
|
+
args: {
|
|
28
|
+
text: 'Button Example',
|
|
29
|
+
type: 'primary',
|
|
30
|
+
size: 'medium',
|
|
31
|
+
corners: 'standard',
|
|
32
|
+
disabled: false,
|
|
33
|
+
cls: '',
|
|
34
|
+
onClick: () => console.log('CustomButton')
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const IconButton: Story = {
|
|
39
|
+
args: {
|
|
40
|
+
text: 'Exit',
|
|
41
|
+
type: 'secondary',
|
|
42
|
+
size: 'medium',
|
|
43
|
+
corners: 'standard',
|
|
44
|
+
disabled: false,
|
|
45
|
+
cls: '',
|
|
46
|
+
onClick: () => console.log('IconButton'),
|
|
47
|
+
iconPath: 'svg-lib/alert-square.svg',
|
|
48
|
+
labelAlign: 'bottom'
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const Icon: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
onClick: () => console.log('Icon'),
|
|
55
|
+
iconPath: 'svg-lib/checkmark-svgrepo-com.svg',
|
|
56
|
+
type: 'transparent',
|
|
57
|
+
size: 'large',
|
|
58
|
+
corners: 'round',
|
|
59
|
+
disabled: false,
|
|
60
|
+
cls: '',
|
|
61
|
+
staticIcon: true
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Box } from "../Container";
|
|
3
|
+
import './button.scss';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Компонент кнопки
|
|
7
|
+
* - разные состояния
|
|
8
|
+
* - разные типы
|
|
9
|
+
* - разные размеры
|
|
10
|
+
* - разные углы
|
|
11
|
+
* - добавление иконки
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export interface ButtonProps {
|
|
15
|
+
/** Основная / Только текст / Вспомогательная */
|
|
16
|
+
type: 'primary' | 'transparent' | 'secondary';
|
|
17
|
+
|
|
18
|
+
/** Маленькая / Средняя / Большая */
|
|
19
|
+
size?: 'small' | 'medium' | 'large';
|
|
20
|
+
|
|
21
|
+
/** Углы прямые / Закругленные / Круглые */
|
|
22
|
+
corners?: 'square' | 'standard' | 'round';
|
|
23
|
+
|
|
24
|
+
/** Доступность кнопки */
|
|
25
|
+
disabled?: boolean,
|
|
26
|
+
|
|
27
|
+
/** Текст кнопки */
|
|
28
|
+
text?: string;
|
|
29
|
+
|
|
30
|
+
/** Событие при нажатии */
|
|
31
|
+
onClick?: (e?: MouseEvent) => void;
|
|
32
|
+
|
|
33
|
+
/** Дополнительные классы */
|
|
34
|
+
cls?: string;
|
|
35
|
+
|
|
36
|
+
/** Путь до иконки из assets */
|
|
37
|
+
iconPath?: string;
|
|
38
|
+
|
|
39
|
+
/** Расположение текста относительно иконки */
|
|
40
|
+
labelAlign?: 'right' | 'left' | 'bottom' | 'top';
|
|
41
|
+
|
|
42
|
+
/** Это просто информационная иконка */
|
|
43
|
+
staticIcon?: boolean;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Элемент кнопки */
|
|
47
|
+
export const Button = ({
|
|
48
|
+
type = 'primary',
|
|
49
|
+
size = 'medium',
|
|
50
|
+
corners = 'standard',
|
|
51
|
+
disabled = false,
|
|
52
|
+
staticIcon = false,
|
|
53
|
+
cls = '',
|
|
54
|
+
text = '',
|
|
55
|
+
iconPath = '',
|
|
56
|
+
labelAlign = '',
|
|
57
|
+
onClick,
|
|
58
|
+
...props
|
|
59
|
+
}: ButtonProps) => {
|
|
60
|
+
const isIconCls = iconPath != '' && text === '' ? 'kit-btn--icon' : '';
|
|
61
|
+
|
|
62
|
+
let Content;
|
|
63
|
+
const IconContainer = () => (iconPath ? <div
|
|
64
|
+
className='kit-btn--svg'
|
|
65
|
+
style={{
|
|
66
|
+
maskImage: `url(assets/${iconPath})`,
|
|
67
|
+
WebkitMaskImage: `url(assets/${iconPath})`
|
|
68
|
+
}}
|
|
69
|
+
/> : null);
|
|
70
|
+
|
|
71
|
+
/** текст + иконка */
|
|
72
|
+
switch(labelAlign) {
|
|
73
|
+
case 'right': Content = () => (<Box direction='row'><IconContainer />{text as string}</Box>); break;
|
|
74
|
+
case 'left': Content = () => (<Box direction='row'>{text as string}<IconContainer /></Box>); break;
|
|
75
|
+
case 'top': Content = () => (<Box direction='column'>{text as string}<IconContainer /></Box>); break;
|
|
76
|
+
case 'bottom': Content = () => (<Box direction='column'><IconContainer />{text as string}</Box>); break;
|
|
77
|
+
default: Content = () => (<Box direction='row'>{ isIconCls ? <IconContainer /> : text as string}</Box>); break;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<button
|
|
82
|
+
type="button"
|
|
83
|
+
onClick={disabled || !onClick ? null : onClick}
|
|
84
|
+
className={[
|
|
85
|
+
'kit-btn',
|
|
86
|
+
`kit-btn--${size}`,
|
|
87
|
+
`kit-btn--${corners}`,
|
|
88
|
+
`kit-btn--${type}`,
|
|
89
|
+
disabled ? 'kit-btn--disabled' : '',
|
|
90
|
+
staticIcon ? 'kit-icon' : '',
|
|
91
|
+
isIconCls,
|
|
92
|
+
cls
|
|
93
|
+
].join(' ')}
|
|
94
|
+
{...props}
|
|
95
|
+
>
|
|
96
|
+
<Content />
|
|
97
|
+
</button>
|
|
98
|
+
);
|
|
99
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
@import '../../main.scss';
|
|
2
|
+
|
|
3
|
+
.kit-btn {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
cursor: pointer;
|
|
6
|
+
border: 0;
|
|
7
|
+
font-weight: 700;
|
|
8
|
+
line-height: 1;
|
|
9
|
+
font-family: var(--font-family);
|
|
10
|
+
transition: background-color 0.3s ease;
|
|
11
|
+
padding: 8px 16px;
|
|
12
|
+
& > .kit-box {
|
|
13
|
+
width: fit-content;
|
|
14
|
+
}
|
|
15
|
+
&:active {
|
|
16
|
+
transform: translateY(0.5px);
|
|
17
|
+
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3) inset;
|
|
18
|
+
}
|
|
19
|
+
&.kit-icon {
|
|
20
|
+
pointer-events: none;
|
|
21
|
+
}
|
|
22
|
+
&.kit-btn--disabled {
|
|
23
|
+
opacity: 0.5;
|
|
24
|
+
pointer-events: none;
|
|
25
|
+
user-select: none;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// type
|
|
30
|
+
.kit-btn--primary {
|
|
31
|
+
background-color: var(--primary-btn-color);
|
|
32
|
+
color: var(--secondary-btn-color);
|
|
33
|
+
& > div > .kit-btn--svg {
|
|
34
|
+
background-color: var(--secondary-btn-color);
|
|
35
|
+
}
|
|
36
|
+
&:hover {
|
|
37
|
+
background-color: var(--hover-btn-color);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
.kit-btn--secondary {
|
|
41
|
+
border: 1px var(--primary-btn-color) solid;
|
|
42
|
+
background-color: transparent;
|
|
43
|
+
color: var(--primary-btn-color);
|
|
44
|
+
& > div > .kit-btn--svg {
|
|
45
|
+
background-color: var(--primary-btn-color);
|
|
46
|
+
}
|
|
47
|
+
&:hover {
|
|
48
|
+
background-color: var(--hover-btn-color);
|
|
49
|
+
color: var(--secondary-btn-color);
|
|
50
|
+
border: 1px var(--hover-btn-color) solid;
|
|
51
|
+
& > div > .kit-btn--svg {
|
|
52
|
+
background-color: var(--secondary-btn-color);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
.kit-btn--transparent {
|
|
57
|
+
border: none;
|
|
58
|
+
background-color: transparent;
|
|
59
|
+
color: var(--primary-btn-color);
|
|
60
|
+
& > div > .kit-btn--svg {
|
|
61
|
+
background-color: var(--primary-btn-color);
|
|
62
|
+
}
|
|
63
|
+
&:hover {
|
|
64
|
+
color: var(--hover-btn-color);
|
|
65
|
+
& > div > .kit-btn--svg {
|
|
66
|
+
background-color: var(--hover-btn-color);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
&:active {
|
|
70
|
+
box-shadow: unset;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// size
|
|
75
|
+
.kit-btn--small {
|
|
76
|
+
font-size: 12px;
|
|
77
|
+
& > div > .kit-btn--svg {
|
|
78
|
+
width: 20px;
|
|
79
|
+
height: 20px;
|
|
80
|
+
}
|
|
81
|
+
&:not(.kit-btn--icon) > .kit-container--h > .kit-btn--svg {
|
|
82
|
+
width: 16px;
|
|
83
|
+
height: 16px;
|
|
84
|
+
}
|
|
85
|
+
&:not(.kit-btn--icon) > .kit-container--v > .kit-btn--svg {
|
|
86
|
+
width: 24px;
|
|
87
|
+
height: 24px;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
.kit-btn--medium {
|
|
91
|
+
font-size: 14px;
|
|
92
|
+
& > div > .kit-btn--svg {
|
|
93
|
+
width: 24px;
|
|
94
|
+
height: 24px;
|
|
95
|
+
}
|
|
96
|
+
&:not(.kit-btn--icon) > .kit-container--h > .kit-btn--svg {
|
|
97
|
+
width: 20px;
|
|
98
|
+
height: 20px;
|
|
99
|
+
}
|
|
100
|
+
&:not(.kit-btn--icon) > .kit-container--v > .kit-btn--svg {
|
|
101
|
+
width: 28px;
|
|
102
|
+
height: 28px;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
.kit-btn--large {
|
|
106
|
+
font-size: 16px;
|
|
107
|
+
& > div > .kit-btn--svg {
|
|
108
|
+
width: 32px;
|
|
109
|
+
height: 32px;
|
|
110
|
+
}
|
|
111
|
+
&:not(.kit-btn--icon) > .kit-container--h > .kit-btn--svg {
|
|
112
|
+
width: 24px;
|
|
113
|
+
height: 24px;
|
|
114
|
+
}
|
|
115
|
+
&:not(.kit-btn--icon) > .kit-container--v > .kit-btn--svg {
|
|
116
|
+
width: 32px;
|
|
117
|
+
height: 32px;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// border-radius
|
|
122
|
+
.kit-btn--standard {
|
|
123
|
+
border-radius: var(--corners-standard);
|
|
124
|
+
}
|
|
125
|
+
.kit-btn--round {
|
|
126
|
+
border-radius: var(--corners-round);
|
|
127
|
+
}
|
|
128
|
+
.kit-btn--square {
|
|
129
|
+
border-radius: var(--corners-square);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// icons
|
|
133
|
+
.kit-btn--icon {
|
|
134
|
+
padding: 8px;
|
|
135
|
+
overflow: hidden;
|
|
136
|
+
white-space: nowrap;
|
|
137
|
+
text-overflow: ellipsis;
|
|
138
|
+
}
|
|
139
|
+
.kit-btn--svg {
|
|
140
|
+
background-repeat: no-repeat;
|
|
141
|
+
background-position: center;
|
|
142
|
+
background-size: contain;
|
|
143
|
+
mask-size: contain;
|
|
144
|
+
mask-repeat: no-repeat;
|
|
145
|
+
-webkit-mask-size: contain;
|
|
146
|
+
-webkit-mask-repeat: no-repeat;
|
|
147
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Button";
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import './box.scss';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Компоненты контейнеры
|
|
6
|
+
* - разные направления
|
|
7
|
+
* - семантические обертки
|
|
8
|
+
* - позиционирование
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
export interface BoxProps {
|
|
13
|
+
/** Направление строка или столбец */
|
|
14
|
+
direction?: 'row' | 'column';
|
|
15
|
+
|
|
16
|
+
/** Горизонтальное выравнивание **/
|
|
17
|
+
align?: 'top' | 'center' | 'bottom';
|
|
18
|
+
|
|
19
|
+
/** Горизонтальное распределение **/
|
|
20
|
+
justify?: 'start' | 'end' | 'center' | 'space';
|
|
21
|
+
|
|
22
|
+
/** Перенос блоков внутри контейнера **/
|
|
23
|
+
wrapContent?: boolean;
|
|
24
|
+
|
|
25
|
+
/** Дополнительные классы */
|
|
26
|
+
cls?: string;
|
|
27
|
+
|
|
28
|
+
/** Расстояние между дочерними элементами */
|
|
29
|
+
gap?: number;
|
|
30
|
+
|
|
31
|
+
/** Внешние отступы */
|
|
32
|
+
margin?: number[];
|
|
33
|
+
|
|
34
|
+
/** Внутренние отступы */
|
|
35
|
+
padding?: number[];
|
|
36
|
+
|
|
37
|
+
/** Родительский тег для семантики */
|
|
38
|
+
parent?: 'header' | 'footer' | 'article' | 'section' | 'main' | 'div';
|
|
39
|
+
|
|
40
|
+
/** Содержимое контейнера **/
|
|
41
|
+
children: ReactNode | string;
|
|
42
|
+
|
|
43
|
+
/** Маска загрузки **/
|
|
44
|
+
mask?: boolean
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Элемент контейнера */
|
|
48
|
+
export const Box = ({
|
|
49
|
+
direction = 'row',
|
|
50
|
+
align = 'center',
|
|
51
|
+
justify = 'center',
|
|
52
|
+
wrapContent = false,
|
|
53
|
+
cls = '',
|
|
54
|
+
gap = 8,
|
|
55
|
+
margin = [0],
|
|
56
|
+
padding = [0],
|
|
57
|
+
parent = 'div',
|
|
58
|
+
mask = false, // TODO loader
|
|
59
|
+
children,
|
|
60
|
+
...props
|
|
61
|
+
}: BoxProps) => {
|
|
62
|
+
const Parent = parent;
|
|
63
|
+
const margins = margin?.map(m => m + 'px').join(' ');
|
|
64
|
+
const paddings = padding?.map(m => m + 'px').join(' ');
|
|
65
|
+
|
|
66
|
+
return(
|
|
67
|
+
<Parent
|
|
68
|
+
className={[
|
|
69
|
+
'kit-box',
|
|
70
|
+
`kit-box--${direction}`,
|
|
71
|
+
`kit-box--align-${align}`,
|
|
72
|
+
`kit-box--justify-${justify}`,
|
|
73
|
+
wrapContent && 'kit-box--wrap',
|
|
74
|
+
cls
|
|
75
|
+
].join(' ')}
|
|
76
|
+
style={{ gap: `${gap}px`, margin: `${margins}`, padding: `${paddings}` }}
|
|
77
|
+
{...props}
|
|
78
|
+
>
|
|
79
|
+
{children}
|
|
80
|
+
</Parent>
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.kit-box {
|
|
2
|
+
margin: 0;
|
|
3
|
+
padding: 0;
|
|
4
|
+
display: flex;
|
|
5
|
+
width: 100%;
|
|
6
|
+
flex-wrap: nowrap;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.kit-box--row {
|
|
10
|
+
flex-direction: row;
|
|
11
|
+
}
|
|
12
|
+
.kit-box--column {
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.kit-box--align-top {
|
|
17
|
+
align-items: flex-start;
|
|
18
|
+
}
|
|
19
|
+
.kit-box--align-center {
|
|
20
|
+
align-items: center;
|
|
21
|
+
}
|
|
22
|
+
.kit-box--align-bottom {
|
|
23
|
+
align-items: flex-end;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.kit-box--justify-start {
|
|
27
|
+
justify-content: flex-start;
|
|
28
|
+
}
|
|
29
|
+
.kit-box--justify-end {
|
|
30
|
+
justify-content: flex-end;
|
|
31
|
+
}
|
|
32
|
+
.kit-box--justify-center {
|
|
33
|
+
justify-content: center;
|
|
34
|
+
}
|
|
35
|
+
.kit-box--justify-space {
|
|
36
|
+
justify-content: space-between;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.kit-box--wrap {
|
|
40
|
+
flex-wrap: wrap;
|
|
41
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Box";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Input } from './Input';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Example Input',
|
|
6
|
+
component: Input,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered'
|
|
9
|
+
},
|
|
10
|
+
tags: ['autodocs'],
|
|
11
|
+
decorators: [
|
|
12
|
+
(Story) => {
|
|
13
|
+
const script = document.createElement('script')
|
|
14
|
+
script.src = '/style_setter.js'
|
|
15
|
+
script.type = 'module'
|
|
16
|
+
document.head.appendChild(script)
|
|
17
|
+
|
|
18
|
+
return Story()
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default meta;
|
|
24
|
+
type Story = StoryObj<typeof meta>;
|
|
25
|
+
|
|
26
|
+
export const TextField: Story = {
|
|
27
|
+
args: {
|
|
28
|
+
label: 'Год вашего рождения',
|
|
29
|
+
value: '2026',
|
|
30
|
+
type: 'text',
|
|
31
|
+
bottomText: 'Пишите только цифры',
|
|
32
|
+
placeholder: 'Год в формате YYYY',
|
|
33
|
+
errorText: 'Допустимы только цифры',
|
|
34
|
+
mask: /^[0-9]+$/,
|
|
35
|
+
width: 300
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const Search: Story = {
|
|
40
|
+
args: {
|
|
41
|
+
value: '',
|
|
42
|
+
type: 'text',
|
|
43
|
+
placeholder: 'Найти по имени или году',
|
|
44
|
+
width: 250,
|
|
45
|
+
live: true,
|
|
46
|
+
isSearch: true
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
|