Skip to content

Commit 792a907

Browse files
fix(calendar-web): update loading indicator style and add loading bar component
1 parent 06e2417 commit 792a907

2 files changed

Lines changed: 73 additions & 1 deletion

File tree

packages/pluggableWidgets/calendar-web/src/Calendar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default function MxCalendar(props: CalendarContainerProps): ReactElement
3030
return (
3131
<Fragment>
3232
{props.startDateAttribute && props.startDateAttribute.status !== "available" ? (
33-
<div className="mx-progress"></div>
33+
<div className="widget-calendar-loading-bar" />
3434
) : (
3535
<div className={classNames("widget-calendar", props.class)} style={wrapperStyle}>
3636
<DnDCalendar {...calendarProps} {...calendarEvents} />

packages/pluggableWidgets/calendar-web/src/ui/Calendar.scss

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@use "sass:color";
2+
$brand-primary: #264ae5 !default;
23

34
.widget-calendar {
45
$cal-form-group-margin-bottom: 15px !default;
@@ -79,4 +80,75 @@
7980
.rbc-event {
8081
background-color: var(--brand-primary, $cal-brand-primary);
8182
}
83+
84+
&-loading-bar {
85+
-webkit-appearance: none;
86+
-moz-appearance: none;
87+
appearance: none;
88+
background-color: var(--border-color-default, #ced0d3);
89+
border: none;
90+
border-radius: 2px;
91+
color: var(--brand-primary, $brand-primary);
92+
height: 4px;
93+
width: 100%;
94+
95+
&::-webkit-progress-bar {
96+
background-color: transparent;
97+
}
98+
99+
&::-webkit-progress-value {
100+
background-color: currentColor;
101+
transition: all 0.2s;
102+
}
103+
104+
&::-moz-progress-bar {
105+
background-color: currentColor;
106+
transition: all 0.2s;
107+
}
108+
109+
&::-ms-fill {
110+
border: none;
111+
background-color: currentColor;
112+
transition: all 0.2s;
113+
}
114+
115+
&:indeterminate {
116+
background-size: 200% 100%;
117+
background-image: linear-gradient(
118+
to right,
119+
transparent 50%,
120+
currentColor 50%,
121+
currentColor 60%,
122+
transparent 60%,
123+
transparent 71.5%,
124+
currentColor 71.5%,
125+
currentColor 84%,
126+
transparent 84%
127+
);
128+
animation: progress-linear 3s infinite linear;
129+
}
130+
131+
&:indeterminate::-moz-progress-bar {
132+
background-color: transparent;
133+
}
134+
135+
&:indeterminate::-ms-fill {
136+
animation-name: none;
137+
}
138+
139+
@keyframes progress-linear {
140+
0% {
141+
background-size: 200% 100%;
142+
background-position: left -31.25% top 0%;
143+
}
144+
50% {
145+
background-size: 800% 100%;
146+
background-position: left -49% top 0%;
147+
}
148+
100% {
149+
background-size: 400% 100%;
150+
background-position: left -102% top 0%;
151+
}
152+
}
153+
}
82154
}

0 commit comments

Comments
 (0)