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

style: update loader tokens to pine #2056

Merged
merged 4 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<%# Success/Complete SVG %>
<% if component.type === "success" %>
<svg class="sage-loader__success" width="48" height="48" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="24" cy="24" r="21" fill="#0072EF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M34.707 17.293a1 1 0 0 1 0 1.414l-13 13a1 1 0 0 1-1.414 0l-7-7a1 1 0 0 1 1.414-1.414L21 29.586l12.293-12.293a1 1 0 0 1 1.414 0Z" fill="#fff"/></svg>
<svg class="sage-loader__success" width="48" height="48" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="24" cy="24" r="21" fill="#6b62f2"/><path fill-rule="evenodd" clip-rule="evenodd" d="M34.707 17.293a1 1 0 0 1 0 1.414l-13 13a1 1 0 0 1-1.414 0l-7-7a1 1 0 0 1 1.414-1.414L21 29.586l12.293-12.293a1 1 0 0 1 1.414 0Z" fill="#fff"/></svg>
Copy link
Member Author

Choose a reason for hiding this comment

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

verified with design that this should become accent color in sage. there is no equivalent in pine.

<% end %>
<% if component.text %>
<p class="sage-loader__text <%= SageClassnames::TYPE::BODY_SMALL %>"><%= component_description %></p>
Expand Down
56 changes: 28 additions & 28 deletions packages/sage-assets/lib/stylesheets/components/_loader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
/// @group sage
////

$-loader-bar-bg-color: sage-color(grey, 500);
$-loader-bar-height: rem(6px);
$-loader-bar-bg-color: var(--pine-color-neutral);
$-loader-bar-height: calc(var(--pine-dimension-2xs) * 1.5); // 4px * 1.5 = 6px
$-loader-bar-speed: 1.2s;
$-loader-bar-speed-delay: 0.5s;
$-loader-bar-width: rem(300px);
$-loader-spinner-size: rem(48px);
$-loader-bar-width: calc(var(--pine-dimension-2xl) * 6.25); // 48px * 6.25 = 300px
$-loader-spinner-size: var(--pine-dimension-2xl);
$-loader-spinner-speed: 1.5s;
$-loader-typing-size: rem(6px);
$-loader-typing-size: calc(var(--pine-dimension-2xs) * 1.5); // 4px * 1.5 = 6px
$-loader-lower-opacity: 0.4;

.sage-loader {
Expand Down Expand Up @@ -53,7 +53,7 @@ $-loader-lower-opacity: 0.4;
width: 100%;
max-width: $-loader-bar-width;
height: $-loader-bar-height;
border-radius: sage-border(radius);
border-radius: var(--pine-dimension-xs);
background-color: $-loader-bar-bg-color;

[dir="rtl"] & {
Expand All @@ -65,41 +65,41 @@ $-loader-lower-opacity: 0.4;
&::before,
&::after {
content: "";
z-index: sage-z-index(default, 2);
z-index: calc(var(--pine-dimension-none) + 2); // 0 + 2 = 2
position: absolute;
top: 0;
left: 0;
width: 0;
height: $-loader-bar-height;
border-radius: sage-border(radius);
border-radius: var(--pine-dimension-xs);
}

&::before {
background-color: sage-color(primary, 300);
background-color: var(--pine-color-accent);
Copy link
Member Author

Choose a reason for hiding this comment

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

verified with design that this should become accent since primary does not exist as a pine semantic token

animation: loader-bar $-loader-bar-speed linear infinite;
}

&::after {
background-color: sage-color(primary, 300);
background-color: var(--pine-color-accent);
Copy link
Member Author

Choose a reason for hiding this comment

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

verified with design that this should become accent since primary does not exist as a pine semantic token

animation: loader-bar $-loader-bar-speed $-loader-bar-speed-delay linear
infinite;
}
}

.sage-loader__spinner {
width: sage-spacing(xl);
height: sage-spacing(xl);
width: var(--pine-dimension-2xl);
height: var(--pine-dimension-2xl);
animation: loader-rotate $-loader-spinner-speed linear infinite;
}

.sage-loader__spinner--loading-button {
width: sage-spacing(sm);
height: sage-spacing(sm);
margin-inline-end: sage-spacing(xs);
width: var(--pine-dimension-sm);
height: var(--pine-dimension-sm);
margin-inline-end: var(--pine-dimension-xs);
}

.sage-loader__spinner-path {
stroke-width: 8px;
stroke-width: var(--pine-dimension-xs);
}

.sage-loader__spinner-secondHalf {
Expand All @@ -120,26 +120,26 @@ $-loader-lower-opacity: 0.4;
}

.sage-loader__success {
width: sage-spacing(xl);
height: sage-spacing(xl);
width: var(--pine-dimension-2xl);
height: var(--pine-dimension-2xl);
}

.sage-loader__success-path {
stroke-dasharray: 150, 200;
stroke-linecap: round;
stroke: sage-color(sage, 300);
stroke: var(--pine-color-success-hover);
}

.sage-loader__success-check {
transform: translate(76%, 84%);
stroke-linecap: round;
stroke-linejoin: round;
stroke-miterlimit: 10;
stroke: sage-color(sage, 300);
stroke: var(--pine-color-success-hover)
}

.sage-loader__text {
margin-block-start: sage-spacing(sm);
margin-block-start: var(--pine-dimension-sm);
}

@keyframes loader-bar {
Expand Down Expand Up @@ -173,20 +173,20 @@ $-loader-lower-opacity: 0.4;
.sage-loader__typing {
display: flex;
align-items: center;
gap: sage-spacing(2xs);
gap: var(--pine-dimension-2xs);
position: relative;
margin: 0 auto;
padding: rem(15px) rem(20px);
background-color: sage-color(grey, 150);
padding: calc(var(--pine-dimension-xs) * 1.875) calc(var(--pine-dimension-xs) * 2.5); // 8px * 1.875 = 15px, 8px * 2.5 = 20px
background-color: var(--pine-color-background-container-disabled);
will-change: transform;
border-radius: sage-border(radius-large);
box-shadow: sage-shadow(sm);
border-radius: var(--pine-dimension-sm);
box-shadow: var(--pine-box-shadow);

span {
height: $-loader-typing-size;
width: $-loader-typing-size;
background-color: sage-color(grey, 500);
border-radius: sage-border(radius-round);
background-color: var(--pine-color-neutral);
border-radius: var(--pine-border-radius-full);
opacity: $-loader-lower-opacity;

@for $i from 1 through 3 {
Expand Down
2 changes: 1 addition & 1 deletion packages/sage-react/lib/Loader/Loader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const Loader = ({
</svg>
)}
{(type === LOADER_TYPES.SUCCESS) && (
<svg className="sage-loader__success" width="48" height="48" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="24" cy="24" r="21" fill="#0072EF" /><path fillRule="evenodd" clipRule="evenodd" d="M34.707 17.293a1 1 0 0 1 0 1.414l-13 13a1 1 0 0 1-1.414 0l-7-7a1 1 0 0 1 1.414-1.414L21 29.586l12.293-12.293a1 1 0 0 1 1.414 0Z" fill="#fff" /></svg>
<svg className="sage-loader__success" width="48" height="48" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="24" cy="24" r="21" fill="#6b62f2" /><path fillRule="evenodd" clipRule="evenodd" d="M34.707 17.293a1 1 0 0 1 0 1.414l-13 13a1 1 0 0 1-1.414 0l-7-7a1 1 0 0 1 1.414-1.414L21 29.586l12.293-12.293a1 1 0 0 1 1.414 0Z" fill="#fff" /></svg>
Copy link
Member Author

Choose a reason for hiding this comment

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

verified with design that this should become accent color in sage. there is no equivalent in pine.

)}
{(type === LOADER_TYPES.TYPING) && (
<div className="sage-loader__typing">
Expand Down
Loading