Skip to content

Commit

Permalink
Feat(web): Stabilization of PartnerLogo component #DS-1443
Browse files Browse the repository at this point in the history
  • Loading branch information
curdaj committed Sep 13, 2024
1 parent 1205288 commit f38671d
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,39 +1,36 @@
# UNSTABLE PartnerLogo

> ⚠️ This component is UNSTABLE. It may significantly change at any point in the future.
> Please use it with caution.
# PartnerLogo

PartnerLogo is a component designed to display the partner's logo (e.g. advertiser, business partner, etc.).

```html
<div class="UNSTABLE_PartnerLogo" aria-label="Logo of the partner">
<div class="PartnerLogo" aria-label="Logo of the partner">
<!-- Logo go here -->
</div>
```

## Sizes

The PartnerLogo component is available in [sizes][dictionary-size].
Use the `UNSTABLE_PartnerLogo--<size>` modifier class to change the size of the PartnerLogo component.
Use the `PartnerLogo--<size>` modifier class to change the size of the PartnerLogo component.

```html
<div class="UNSTABLE_PartnerLogo UNSTABLE_PartnerLogo--small" aria-label="Logo of the partner">
<div class="PartnerLogo PartnerLogo--small" aria-label="Logo of the partner">
<!-- Logo go here -->
</div>
<div class="UNSTABLE_PartnerLogo UNSTABLE_PartnerLogo--medium" aria-label="Logo of the partner">
<div class="PartnerLogo PartnerLogo--medium" aria-label="Logo of the partner">
<!-- Logo go here -->
</div>
<div class="UNSTABLE_PartnerLogo UNSTABLE_PartnerLogo--large" aria-label="Logo of the partner">
<div class="PartnerLogo PartnerLogo--large" aria-label="Logo of the partner">
<!-- Logo go here -->
</div>
```

## Enable Safe Area

The PartnerLogo component can be displayed with the safe area (padding). Use `UNSTABLE_PartnerLogo--safeArea` modifier to enable safe area around logo.
The PartnerLogo component can be displayed with the safe area (padding). Use `PartnerLogo--safeArea` modifier to enable safe area around logo.

```html
<div class="UNSTABLE_PartnerLogo UNSTABLE_PartnerLogo--medium UNSTABLE_PartnerLogo--safeArea">
<div class="PartnerLogo PartnerLogo--medium PartnerLogo--safeArea">
<!-- Logo go here -->
</div>
```
Expand All @@ -45,7 +42,7 @@ The content of the PartnerLogo component can be an image or svg.
### Image

```html
<div class="UNSTABLE_PartnerLogo" aria-label="Logo of the partner">
<div class="PartnerLogo" aria-label="Logo of the partner">
<img src="path-to-logo" alt="Partner Logo" aria-hidden="true" />
</div>
```
Expand All @@ -57,7 +54,7 @@ attribute is set on the container.
### SVG

```html
<div class="UNSTABLE_PartnerLogo" aria-label="Logo of the partner">
<div class="PartnerLogo" aria-label="Logo of the partner">
<svg width="300" height="130">
<rect width="200" height="100" x="10" y="10" rx="20" ry="20" fill="#fff" />
</svg>
Expand All @@ -67,11 +64,11 @@ attribute is set on the container.
## Full Example

```html
<div class="UNSTABLE_PartnerLogo UNSTABLE_PartnerLogo--medium" aria-label="Logo of the partner">
<div class="PartnerLogo PartnerLogo--medium" aria-label="Logo of the partner">
<img src="path-to-logo" alt="Partner Logo" aria-hidden="true" />
</div>

<div class="UNSTABLE_PartnerLogo UNSTABLE_PartnerLogo--large" aria-label="Logo of the partner">
<div class="PartnerLogo PartnerLogo--large" aria-label="Logo of the partner">
<svg width="300" height="130">
<rect width="200" height="100" x="10" y="10" rx="20" ry="20" fill="#fff" />
</svg>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@use '../../settings/globals';
@use '../../tools/dictionaries';

.UNSTABLE_PartnerLogo {
.PartnerLogo {
--#{globals.$prefix}partner-logo-padding: 0;

display: inline-block;
Expand All @@ -12,14 +12,14 @@
background: theme.$background-color;
}

.UNSTABLE_PartnerLogo > img,
.UNSTABLE_PartnerLogo > svg {
.PartnerLogo > img,
.PartnerLogo > svg {
width: fit-content;
height: var(--#{globals.$prefix}partner-logo-image-height);
}

@include dictionaries.generate-sizes($class-name: 'UNSTABLE_PartnerLogo', $sizes: theme.$sizes);
@include dictionaries.generate-sizes($class-name: 'PartnerLogo', $sizes: theme.$sizes);

.UNSTABLE_PartnerLogo--safeArea {
.PartnerLogo--safeArea {
padding: var(--#{globals.$prefix}partner-logo-padding);
}
1 change: 1 addition & 0 deletions packages/web/src/scss/components/PartnerLogo/index.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@forward 'PartnerLogo';

This file was deleted.

2 changes: 1 addition & 1 deletion packages/web/src/scss/components/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// @forward 'Item';
@forward 'Modal';
@forward 'Pagination';
@forward 'PartnerLogo';

// @forward 'Pill';
@forward 'ProductLogo';
Expand All @@ -38,7 +39,6 @@
@forward 'UNSTABLE_ActionLayout';
@forward 'UNSTABLE_Avatar';
@forward 'UNSTABLE_EmptyState';
@forward 'UNSTABLE_PartnerLogo';
@forward 'UNSTABLE_Section';

// @forward 'UNSTABLE_Slider';
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified tests/e2e/demo-homepages.spec.ts-snapshots/web-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f38671d

Please sign in to comment.