-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: add slide animation for ActionPanel #110
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
780973b
feat: add slide animation for ActionPanel
flops ba5eec1
feat: chartkit editmode animation using CSSTransition
flops 783432b
feat: added animations and base styling is reverted to previous
flops 9f896cb
feat: css api for main colors and storybook case
flops ef55821
feat: dashkit and action panel toggle animations properties
flops 928d64b
feat: removed grid item animation
flops b99d04f
feat: removed overlay and controls transition classes
flops 33f3314
feat: css api examples
flops 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 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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,113 @@ | ||
import React from 'react'; | ||
import {Icon} from '@gravity-ui/uikit'; | ||
import { | ||
ChartColumn, | ||
Heading, | ||
Layers3Diagonal, | ||
PlugConnection, | ||
Sliders, | ||
TextAlignLeft, | ||
} from '@gravity-ui/icons'; | ||
|
||
import {Demo, DemoRow} from './Demo'; | ||
import {getConfig} from './utils'; | ||
import {DashKit, ActionPanel, MenuItems} from '../../..'; | ||
import i18n from '../../../i18n'; | ||
import {CogIcon} from '../../../icons/CogIcon'; | ||
import {CopyIcon} from '../../../icons/CopyIcon'; | ||
import {DeleteIcon} from '../../../icons/DeleteIcon'; | ||
|
||
export const CssApiShowcase: React.FC = () => { | ||
React.useEffect(() => { | ||
DashKit.setSettings({ | ||
menu: [ | ||
{ | ||
id: 'settings', | ||
title: 'Menu setting text', | ||
icon: <Icon data={CogIcon} size={16} />, | ||
}, | ||
{ | ||
id: MenuItems.Copy, | ||
title: 'Menu setting copy', | ||
icon: <Icon data={CopyIcon} size={16} />, | ||
}, | ||
{ | ||
id: MenuItems.Delete, | ||
title: i18n('label_delete'), // for language change check | ||
icon: <Icon data={DeleteIcon} size={16} />, | ||
className: 'dashkit-overlay-controls__item_danger', | ||
}, | ||
], | ||
}); | ||
}, []); | ||
|
||
const items = React.useMemo( | ||
() => [ | ||
{ | ||
id: 'chart', | ||
icon: <Icon data={ChartColumn} />, | ||
title: 'Chart', | ||
className: 'test', | ||
qa: 'chart', | ||
}, | ||
{ | ||
id: 'selector', | ||
icon: <Icon data={Sliders} />, | ||
title: 'Selector', | ||
qa: 'selector', | ||
}, | ||
{ | ||
id: 'text', | ||
icon: <Icon data={TextAlignLeft} />, | ||
title: 'Text', | ||
}, | ||
{ | ||
id: 'header', | ||
icon: <Icon data={Heading} />, | ||
title: 'Header', | ||
}, | ||
{ | ||
id: 'links', | ||
icon: <Icon data={PlugConnection} />, | ||
title: 'Links', | ||
}, | ||
{ | ||
id: 'tabs', | ||
icon: <Icon data={Layers3Diagonal} />, | ||
title: 'Tabs', | ||
}, | ||
], | ||
[], | ||
); | ||
|
||
return ( | ||
<> | ||
<style> | ||
{`.g-root { | ||
--dashkit-action-panel-border-color: var(--g-color-line-info); | ||
--dashkit-action-panel-color: var(--g-color-base-float-accent); | ||
--dashkit-action-panel-border-radius: var(--g-border-radius-xxl); | ||
|
||
--dashkit-action-panel-item-color: transparent; | ||
--dashkit-action-panel-item-text-color: var(--g-color-text-primary); | ||
|
||
--dashkit-action-panel-item-color-hover: var(--g-color-line-info); | ||
--dashkit-action-panel-item-text-color-hover: white; | ||
|
||
--dashkit-overlay-color: var(--g-color-line-info); | ||
--dashkit-overlay-border-color: var(--g-color-line-info); | ||
--dashkit-overlay-opacity: 0.5; | ||
|
||
--dashkit-placeholder-color: var(--g-color-line-positive); | ||
--dashkit-placeholder-opacity: 1; | ||
}`} | ||
</style> | ||
<Demo title="CSS API"> | ||
<DemoRow title="Component view"> | ||
<ActionPanel items={items} /> | ||
<DashKit editMode={true} config={getConfig()} /> | ||
</DemoRow> | ||
</Demo> | ||
</> | ||
); | ||
}; |
This file contains 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
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.
Can you add some caption? Like CSS Api. And would be good to add some recommendations how to use it.