- { icon }
-
-
- { label }
-
- { description &&
-
- { description }
-
- }
- { isCurrentStep && isVertical && this.renderCurrentStepContent() }
-
+
+
+
onClick( key ) : null }
+ >
+ { icon }
+
+ { label }
+ { description && (
+
+ { description }
+
+ ) }
+
+
+ { isCurrentStep && isVertical && this.renderCurrentStepContent() }
- { ! isVertical && }
+ { ! isVertical && }
);
} ) }
@@ -101,13 +103,9 @@ Stepper.propTypes = {
steps: PropTypes.arrayOf(
PropTypes.shape( {
/**
- * Key used to identify step.
+ * Content displayed when the step is active.
*/
- key: PropTypes.string.isRequired,
- /**
- * Label displayed in stepper.
- */
- label: PropTypes.string.isRequired,
+ content: PropTypes.node,
/**
* Description displayed beneath the label.
*/
@@ -117,9 +115,17 @@ Stepper.propTypes = {
*/
isComplete: PropTypes.bool,
/**
- * Content displayed when the step is active.
+ * Key used to identify step.
*/
- content: PropTypes.node,
+ key: PropTypes.string.isRequired,
+ /**
+ * Label displayed in stepper.
+ */
+ label: PropTypes.string.isRequired,
+ /**
+ * A function to be called when the step label is clicked.
+ */
+ onClick: PropTypes.func,
} )
).isRequired,
diff --git a/plugins/woocommerce-admin/packages/components/src/stepper/style.scss b/plugins/woocommerce-admin/packages/components/src/stepper/style.scss
index 178c4ef9bde..971e9cc5e4e 100644
--- a/plugins/woocommerce-admin/packages/components/src/stepper/style.scss
+++ b/plugins/woocommerce-admin/packages/components/src/stepper/style.scss
@@ -1,3 +1,5 @@
+/** @format */
+
.woocommerce-stepper {
$step-icon-size: 24px;
@@ -8,11 +10,27 @@
}
.woocommerce-stepper__step {
- display: inline-flex;
padding: $gap-smaller;
font-weight: 400;
position: relative;
+ .woocommerce-stepper__step-label-wrapper {
+ display: flex;
+ text-align: left;
+ border: 0;
+ background-color: transparent;
+ padding: 0;
+
+ &:focus {
+ outline: none;
+ box-shadow: none;
+ }
+ }
+
+ button.woocommerce-stepper__step-label-wrapper {
+ cursor: pointer;
+ }
+
.woocommerce-stepper__step-text {
width: 100%;
}
@@ -39,7 +57,7 @@
display: block;
margin-right: $gap-small;
max-height: $step-icon-size;
- min-width: auto;
+ min-width: 24px;
width: 24px;
border-radius: 50%;
background: $studio-blue-50;
@@ -127,7 +145,7 @@
content: '';
position: absolute;
left: $step-icon-size / 2 + $gap-smaller;
- top: $step-icon-size + ( $gap-smaller * 2 );
+ top: $step-icon-size + ($gap-smaller * 2);
height: calc(100% - #{$step-icon-size} - #{ $gap-smaller * 2 });
border-left: 1px solid $studio-gray-5;
}
@@ -153,6 +171,7 @@
.woocommerce-stepper_content {
margin-top: $gap-smaller;
+ margin-left: $gap-small + $step-icon-size;
}
}
}