Skip to content

Commit 53ddbb6

Browse files
Add isPending prop to Button component which triggers a spinner. (#4900)
* Add `isPending` prop to `Button` component which triggers a spinner. * Fix lint errors * Added test * Only import the necessary package from react-aria * Remove unnecessary timeout ref. * Remove pointer events override * Update test * Add hook to filter out interactions during pending * Added cases to story * update pending story * whitespace fix * update pending story * update pending story * remove spacing override on loader icon * make anchor button-like things disabled when pending * update button docs * Simplify button story * Update isPending tests * Apply progressCircle overBackground to static color buttons * Style display with visibility instead of opacity * Improve vertical centering of spinner * Remove extra dependency * Added more disabled props while pending * Update Pending docs * Rename function so it doesn't sound like a hook * Defense * Use proper naming convention * Simplify story naming * Update test * Add aria-live to pending button when pending * Add check that spinner isn't in document * Remove cruft * Move progressCircle props to component * Fix typos Co-authored-by: Robert Snow <[email protected]> * change story action * fix typo * Add additional info to isPending type comment * Fix lint problem * Remove focus and blur from blocked events * prefix isPending with UNSTABLE * remove doc changes for now * Revert unintended change --------- Co-authored-by: Robert Snow <[email protected]>
1 parent e02d205 commit 53ddbb6

40 files changed

+311
-6
lines changed

packages/@adobe/spectrum-css-temp/components/button/index.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,20 @@ governing permissions and limitations under the License.
157157
min-inline-size: unset;
158158
padding: var(--spectrum-global-dimension-size-65);
159159
}
160+
161+
&.spectrum-Button--pending {
162+
.spectrum-Button-circleLoader {
163+
position: absolute;
164+
left: 50%;
165+
top: 50%;
166+
transform: translate(-50%, -50%);
167+
}
168+
169+
.spectrum-Button-label,
170+
.spectrum-Icon {
171+
visibility: hidden;
172+
}
173+
}
160174
}
161175

162176
a.spectrum-Button,
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"loading": "جارٍ التحميل..."
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"loading": "Зареждане..."
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"loading": "Načítání..."
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"loading": "Indlæser ..."
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"loading": "Laden..."
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"loading": "Φόρτωση..."
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"loading": "Loading…"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"loading": "Cargando…"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"loading": "Laadimine..."
3+
}

0 commit comments

Comments
 (0)