-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE(web-twig): Remove old Modal and rename ModalComposed …
…to Modal #DS-616 Also remove ModalFooter alignment deprecation. ## Migration Guide 1. **Discontinue the old `Modal` component:** The old `Modal` component has been entirely removed and is no longer available for use. 2. **Adopt the new `Modal` in place of `ModalComposed`:** The `ModalComposed` component has been renamed to `Modal`. Thus, replace all instances of `ModalComposed` in your codebase with `Modal`. 3. **Update Component Tags:** Make sure to modify the component tags in your codebase as outlined below: - `<ModalComposed …>` → `<Modal …>` - `<ModalComposedBody …>` → `<ModalBody …>` - `<ModalComposedDialog …>` → `<ModalDialog …>` - `<ModalComposedFooter …>` → `<ModalFooter …>` - `<ModalComposedHeader …>` → `<ModalHeader …>` 4. **Rename `ModalFooter` Align prop:** Instead of `align` use `alignmentX`. - `<ModalFooter align="left" …>` → `<ModalFooter alignmentX="left" …>` Please refer back to this guide or reach out to our team if you encounter any issues during migration.
- Loading branch information
Showing
15 changed files
with
205 additions
and
460 deletions.
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
32 changes: 4 additions & 28 deletions
32
packages/web-twig/src/Resources/components/Modal/Modal.twig
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 |
---|---|---|
@@ -1,50 +1,26 @@ | ||
{# API #} | ||
{%- set props = props | default([]) -%} | ||
{%- set _closeLabel = props.closeLabel | default('Close') -%} | ||
{%- set _id = props.id -%} | ||
{%- set _titleId = props.titleId | default(null) -%} | ||
|
||
{# Class names #} | ||
{%- set _bodyClassName = _spiritClassPrefix ~ 'Modal__body' -%} | ||
{%- set _contentClassName = _spiritClassPrefix ~ 'Modal__content' -%} | ||
{%- set _dialogClassName = _spiritClassPrefix ~ 'Modal__dialog' -%} | ||
{%- set _headerClassName = _spiritClassPrefix ~ 'Modal__header' -%} | ||
{%- set _rootClassName = _spiritClassPrefix ~ 'Modal' -%} | ||
|
||
{# Attributes #} | ||
{%- set _idAttr = _id ? 'id="' ~ _id | escape('html_attr') ~ '"' : null -%} | ||
{%- set _ariaLabelledbyAttr = _id ? 'aria-labelledby="' ~ _titleId | escape('html_attr') ~ '"' : null -%} | ||
|
||
{# Miscellaneous #} | ||
{%- set _styleProps = useStyleProps(props) -%} | ||
{%- set _classNames = [ _rootClassName, _styleProps.className ] -%} | ||
{%- set _mainPropsWithoutId = props | filter((value, prop) => prop is not same as('id')) -%} | ||
|
||
{# Deprecations #} | ||
{% deprecated 'Modal: The "Modal" component is deprecated, it will be replaced by implementation of "ModalComposed".' %} | ||
|
||
<dialog | ||
{{ mainProps(_mainPropsWithoutId) }} | ||
{{ styleProp(_styleProps) }} | ||
{{ classProp(_classNames) }} | ||
{{ _idAttr | raw }} | ||
{{ _ariaLabelledbyAttr | raw }} | ||
> | ||
<div class="{{ _contentClassName }}"> | ||
<div class="{{ _dialogClassName }}"> | ||
<div class="{{ _headerClassName }}"> | ||
<Button | ||
aria-controls="{{ _id }}" | ||
aria-expanded="false" | ||
color="tertiary" | ||
data-dismiss="modal" | ||
data-target="{{ '#' ~ _id }}" | ||
isSquare | ||
> | ||
<Icon name="close" aria-hidden="true" /> | ||
<span class="accessibility-hidden">{{ _closeLabel }}</span> | ||
</Button> | ||
</div> | ||
<div class="{{ _bodyClassName }}"> | ||
{% block content %}{% endblock %} | ||
</div> | ||
</div> | ||
</div> | ||
{% block content %}{% endblock %} | ||
</dialog> |
30 changes: 0 additions & 30 deletions
30
packages/web-twig/src/Resources/components/Modal/ModalComposed.twig
This file was deleted.
Oops, something went wrong.
10 changes: 2 additions & 8 deletions
10
packages/web-twig/src/Resources/components/Modal/ModalFooter.twig
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.