-
Notifications
You must be signed in to change notification settings - Fork 2
toast: стилизация и сторисы #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
khaliulin
wants to merge
20
commits into
storybook-update
Choose a base branch
from
messages/toast
base: storybook-update
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
84339d5
toast: стилизация и сторисы
3fe1364
фикс наложения при вызове компонента в Docs
8f3f50e
фикс изменения ширины при вызове компонентов в разделе Width
1a1ba46
добавлен блок с примерами для сторис с размерами
2c543b0
фикс конфликтов
5d542cc
toast: ширина через CSS-классы вместо перезаписи переменной
afb7ed1
toast: исправить форматирование prettier в SIZES
f6989d1
toast: размеры через дизайн-токены messages.{sm,lg,xlg}.width
eaa8ade
message/toast: Полная настройка (донастройка) компонента, обёртки и S…
anatoly-rodin fd5f0c0
toast: экспорт usePBlockToast и PBlockToastMessageIcon из primeBlocks…
3d7e50d
toast: импорты из @cdek-it/vue-ui-kit в примерах кода и из @/primeBlo…
13f04fe
message/toast: Донастройка icon в конфиге вызова toast.
anatoly-rodin f493c3b
toast: fix detailColor — использовать токен соответствующего severity…
b758556
message/toast: Донастройка интерактива для пропса width.
anatoly-rodin 931474a
файл лицензии MIT
3078e9d
message/toast: Добавил иконки таблера.
anatoly-rodin 2402407
message/toast: Перенастройка иконок, Stories, стилей.
anatoly-rodin 14171cf
Merge branch 'main' into messages/toast
anatoly-rodin 2d2dc6c
Merge remote-tracking branch 'origin/storybook-update' into messages/…
anatoly-rodin 221496f
Merge remote-tracking branch 'origin/storybook-update' into messages/…
anatoly-rodin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2026 CDEK-IT | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining a copy | ||
| of this software and associated documentation files (the "Software"), to deal | ||
| in the Software without restriction, including without limitation the rights | ||
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
| copies of the Software, and to permit persons to whom the Software is | ||
| furnished to do so, subject to the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included in all | ||
| copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
| SOFTWARE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| import { Meta, Canvas, Controls, Title, Description } from '@storybook/addon-docs/blocks'; | ||
| import * as ToastStories from './Toast.stories'; | ||
|
|
||
| <Meta of={ToastStories} /> | ||
|
|
||
| <Title /> | ||
| <Description /> | ||
|
|
||
| ## Варианты использования | ||
|
|
||
| <br /> | ||
|
|
||
| ### Базовый | ||
| Базовый вариант `Toast`. Используйте таблицу ниже для настройки пропсов. Кнопки внизу позволяют показать живые тосты. | ||
| Иконки для каждого типа `Toast` уже "вшиты", но это поведение можно изменить (см. ниже). | ||
| <Canvas of={ToastStories.Default} /> | ||
|
|
||
| #### Полный список аргументов и событий компонента. | ||
| <Controls of={ToastStories.Default} /> | ||
|
|
||
| <hr /> | ||
|
|
||
| ### С кнопкой закрытия | ||
| Базовый вариант `Toast` с кнопкой закрытия. | ||
| <Canvas of={ToastStories.DefaultButton} /> | ||
|
|
||
| ### Кастомный контент | ||
| `Toast` с кастомным контейнером. | ||
| <Canvas of={ToastStories.WithContent} /> | ||
|
|
||
| #### Аргументы и события | ||
| <Controls of={ToastStories.WithContent}/> | ||
|
|
||
| <hr /> | ||
|
|
||
| ### С кастомным контейнером и кнопкой закрытия | ||
| `Toast` с кастомным контейнером и кнопкой закрытия. | ||
| <Canvas of={ToastStories.WithContentAndCloseButton} /> | ||
|
|
||
| #### Аргументы и события | ||
| <Controls of={ToastStories.WithContentAndCloseButton} /> | ||
|
|
||
| <hr /> | ||
|
|
||
| ### Ширина Toast | ||
| Ширина `Toast` задаётся через `props` — `width`. Доступные значения: | ||
| <details> | ||
| <summary>Примеры кода</summary> | ||
|
|
||
| - `sm` (20rem) | ||
| ```html dark | ||
| <PBlockToast width="sm" /> | ||
| ``` | ||
| - `md` (25rem, по умолчанию) | ||
| ```html dark | ||
| <PBlockToast /> | ||
| ``` | ||
| - `lg` (30rem) | ||
| ```html dark | ||
| <PBlockToast width="lg" /> | ||
| ``` | ||
| - `xlg` (45rem) | ||
| ```html dark | ||
| <PBlockToast width="xlg" /> | ||
| ``` | ||
| </details> | ||
|
|
||
| <Canvas of={ToastStories.Width} /> | ||
|
|
||
| #### Аргументы и события | ||
| <Controls of={ToastStories.Width} /> | ||
|
|
||
| ### Позиция | ||
| Демонстрация всех доступных позиций `Toast`. Каждая кнопка показывает уведомление в соответствующей позиции. | ||
| <Canvas of={ToastStories.Position} /> | ||
|
|
||
| #### Аргументы и события | ||
| <Controls of={ToastStories.Position} /> | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут можно сделать width селектором? Чтобы рукчами не вводить
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
сейчас вообще объект ждёт
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Skosov Доработал этот момент. Теперь интерактивно на всех Story можно менять размер
Toast.