Skip to content
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

fix(Modal): animation update, new variant, close button always visible #1224

Merged
merged 6 commits into from
Jul 12, 2024

Conversation

marcinsawicki
Copy link
Contributor

@marcinsawicki marcinsawicki commented Jul 2, 2024

Resolves: #964

Description

  1. Modals close button will be always visible from now
  2. Added ActionModalContent sub-component to use as a modal children
  3. Updated animation of showing the modal (no scaling, faster animation)

Storybook

https://feature-964--613a8e945a5665003a05113b.chromatic.com

Checklist

Obligatory:

  • Self review (use this as your final check for proposed changes before requesting the review)
  • Add reviewers (livechat/design-system)
  • Add correct label
  • Assign pull request with the correct issue

@marcinsawicki marcinsawicki added bug Something isn't working design UI/UX oriented issue labels Jul 2, 2024
@marcinsawicki marcinsawicki added this to the Cycle #8 milestone Jul 2, 2024
@marcinsawicki marcinsawicki self-assigned this Jul 2, 2024
@vladko-uxds
Copy link

Please chnage icon color to color: var(--content-basic-disabled);
Monosnap Components : Modal - Action Modal ⋅ Storybook 2024-07-02 13-26-49

@vladko-uxds
Copy link

Spacing between title and Icon - spacing-3
image

@vladko-uxds
Copy link

CTA - always Large
Monosnap Components : Modal - Action Modal ⋅ Storybook 2024-07-02 13-29-56

Copy link

@vladko-uxds vladko-uxds left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

contentClassName?: string;
}

export const ActionModalContent: React.FC<IActionModalProps> = ({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a new component for external usage? We need to document it in our docs: what its purpose, when and how it should be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a sub-component used inside Modal (like Info or Interactive sub-components in Tooltip).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(replied on priv)
TLDR: we need a docs describing sub-components and their use-cases.

- <b>Invite</b> agents
- <b>Gather</b> necessary information for specific tasks

Modal includes:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Modal includes:
Modal should include:

- Submit (Primary button kind) and cancel buttons (Secondary, Plain buttons kinds)

<Canvas of={ModalStories.Modal} sourceState="none" />

#### Example implementation

```jsx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the import statements

- <b>Confirmation of actions</b> - Confirm that an action has been successfully completed (e.g., "Your changes have been saved").
- <b>Educational content</b> - Offer tutorials, walkthroughs, or additional information about how to use a feature.

Info modal includes:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Info modal includes:
Info modal should include:


#### Example implementation

```jsx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the import statements

- <b>Executing a Command</b>: Double-check significant commands (e.g., start/stop services).
- <b>Irreversible Actions</b>: Confirm actions that cannot be undone.

Confirmation modal includes:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Confirmation modal includes:
Confirmation modal should include:


<Canvas of={ModalStories.ModalWithFullSpaceContent} sourceState="none" />

```jsx
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the import statements

@@ -51,7 +53,15 @@ const StoryTemplate: StoryFn<ModalProps> = ({
const [isOpen, setIsOpen] = React.useState(true);

return (
<>
<div
style={{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move it to const, outside the component's body. Every inline object or a functions are recreated on each render and we do not want that :)

@marcinsawicki marcinsawicki merged commit 8d45cad into main Jul 12, 2024
5 checks passed
@marcinsawicki marcinsawicki deleted the feature/964 branch July 12, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working design UI/UX oriented issue
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Modal] - Close button should appear when onClose prop is defined
3 participants