-
Notifications
You must be signed in to change notification settings - Fork 219
Implement Stripe CC and Stripe ApplePay payment methods #1983
Changes from 21 commits
55eadeb
bdade01
42f1f8a
bb67ffe
070023a
c96a16b
e7f3939
28268ae
ae5ed30
d18776b
fefa852
4166ee8
6cff2f3
a2e855e
1eaa888
a17f3b9
a89e811
39378f9
3082d4c
e8d94fc
b461b87
b43e759
17ec991
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -36,6 +36,7 @@ | |||||
width: 50%; | ||||||
> img { | ||||||
width: 100%; | ||||||
height: 48px; | ||||||
} | ||||||
} | ||||||
> li:nth-child(even) { | ||||||
|
@@ -46,3 +47,107 @@ | |||||
} | ||||||
} | ||||||
} | ||||||
|
||||||
.wc-block-card-elements { | ||||||
display: flex; | ||||||
width: 100%; | ||||||
} | ||||||
|
||||||
.wc-block-gateway-container { | ||||||
position: relative; | ||||||
margin-bottom: $gap-large; | ||||||
white-space: nowrap; | ||||||
|
||||||
&.wc-card-number-element { | ||||||
flex: auto; | ||||||
} | ||||||
|
||||||
&.wc-card-expiry-element, | ||||||
&.wc-card-cvc-element { | ||||||
width: $card-element-width; | ||||||
margin-left: $gap-small; | ||||||
} | ||||||
|
||||||
.wc-block-gateway-input { | ||||||
background-color: #fff; | ||||||
padding: $gap-small $gap; | ||||||
border-radius: 4px; | ||||||
border: 1px solid $input-border-gray; | ||||||
width: 100%; | ||||||
font-size: 16px; | ||||||
line-height: 22px; | ||||||
font-family: inherit; | ||||||
margin: 0; | ||||||
box-sizing: border-box; | ||||||
height: 48px; | ||||||
color: $input-text-active; | ||||||
|
||||||
&:focus { | ||||||
background-color: #fff; | ||||||
} | ||||||
} | ||||||
|
||||||
&:focus { | ||||||
background-color: #fff; | ||||||
} | ||||||
|
||||||
label { | ||||||
position: absolute; | ||||||
transform: translateY(#{$gap-small}); | ||||||
left: 0; | ||||||
top: 0; | ||||||
transform-origin: top left; | ||||||
font-size: 16px; | ||||||
line-height: 22px; | ||||||
color: $gray-50; | ||||||
transition: transform 200ms ease; | ||||||
margin: 0 $gap; | ||||||
overflow: hidden; | ||||||
text-overflow: ellipsis; | ||||||
max-width: calc(100% - #{ 2 * $gap }); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There seems to be a double space before the
Suggested change
I don't know why stylelint didn't catch those. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yup no idea. |
||||||
|
||||||
@media screen and (prefers-reduced-motion: reduce) { | ||||||
transition: none; | ||||||
} | ||||||
} | ||||||
|
||||||
&.wc-inline-card-element { | ||||||
label { | ||||||
margin-left: $gap-largest; | ||||||
} | ||||||
.wc-block-gateway-input.focused.empty, | ||||||
.wc-block-gateway-input:not(.empty) { | ||||||
& + label { | ||||||
margin-left: $gap; | ||||||
transform: translateY(#{$gap-smallest}) scale(0.75); | ||||||
} | ||||||
} | ||||||
& + .wc-block-form-input-validation-error { | ||||||
position: static; | ||||||
margin-top: -$gap-large; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this working? I've had issues with this before (values became positive) and found a SO thread saying interpolation should be used. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Working for me, maybe the webpack plugin handles it better than it used to? |
||||||
} | ||||||
} | ||||||
|
||||||
.wc-block-gateway-input.focused.empty, | ||||||
.wc-block-gateway-input:not(.empty) { | ||||||
padding: $gap-large $gap $gap-smallest; | ||||||
& + label { | ||||||
transform: translateY(#{$gap-smallest}) scale(0.75); | ||||||
} | ||||||
} | ||||||
|
||||||
.wc-block-gateway-input.has-error { | ||||||
border-color: $error-red; | ||||||
&:focus { | ||||||
outline-color: $error-red; | ||||||
} | ||||||
} | ||||||
|
||||||
.wc-block-gateway-input.has-error + label { | ||||||
color: $error-red; | ||||||
} | ||||||
} | ||||||
|
||||||
.wc-blocks-credit-card-images { | ||||||
padding-top: $gap-small; | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ const Tabs = ( { | |
instanceId, | ||
ariaLabel = __( 'Tabbed Content', 'woo-gutenberg-products-block' ), | ||
children, | ||
id, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we generate a default fallback for ID like on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is mostly just an optional id for the entire tabs container. There's an issue (#1474) for reviewing/improving/replacing this tabs component I added, when we get to that at some point, we can use the opportunity to review whether this id is even needed (or improve). |
||
} ) => { | ||
const [ selected, setSelected ] = useState( | ||
initialTabName || ( tabs.length > 0 ? tabs[ 0 ].name : '' ) | ||
|
@@ -38,7 +39,10 @@ const Tabs = ( { | |
} | ||
const selectedId = `${ instanceId }-${ selectedTab.name }`; | ||
return ( | ||
<div className={ classnames( 'wc-block-components-tabs', className ) }> | ||
<div | ||
className={ classnames( 'wc-block-components-tabs', className ) } | ||
id={ id } | ||
> | ||
<div | ||
role="tablist" | ||
aria-label={ ariaLabel } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be max-height? Are we setting an expected/standard dimensions for gateways to use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to ensure that there's some consistency in styling here. Otherwise multiple express payment methods could risk being varying heights?