@@ -5,40 +5,58 @@ import GiftCardOrCouponSubmit from "@commercelayer/react-components/gift_cards/G
55import { ButtonCss } from "components/ui/Button"
66import { ErrorCss } from "components/ui/form/Error"
77import { InputCss } from "components/ui/form/Input"
8- import styled from "styled-components"
9- import tw from "twin.macro"
10-
11- export const CouponFormWrapper = styled . div `
12- ${ tw `pb-8 mb-8 border-b` }
13- `
14- export const CouponFieldWrapper = styled . div `
15- ${ tw `flex mt-1` }
16- `
17- export const CouponRecap = styled . div `
18- ${ tw `flex flex-row justify-between pb-5 mb-6 border-b` }
19- `
20- export const CouponName = styled . p `
21- ${ tw `font-bold` }
22- `
23- export const StyledGiftCardOrCouponRemoveButton = styled (
24- GiftCardOrCouponRemoveButton ,
25- ) `
26- ${ tw `ml-2 text-sm font-bold text-primary border-b leading-none border-black border-opacity-10 transition ease-in duration-200 hover:border-opacity-50 hover:text-primary-dark focus:outline-none` }
27- `
28-
29- export const StyledGiftCardOrCouponInput = styled ( GiftCardOrCouponInput ) `
30- ${ InputCss }
31- ${ tw `rounded-none rounded-l-md z-10` }
32- &.hasError {
33- ${ tw `placeholder-red-400 border-red-400 border-2 focus:ring-offset-0 focus:ring-red-400 focus:ring-opacity-50` }
34- }
35- `
36- export const StyledGiftCardOrCouponSubmit = styled ( GiftCardOrCouponSubmit ) `
37- ${ ButtonCss }
38- ${ tw `w-auto -ml-px relative space-x-2 px-8 py-3 border-transparent rounded-none rounded-r-md` }
39- `
40-
41- export const StyledErrors = styled ( Errors ) `
42- ${ ErrorCss }
43- ${ tw `pl-0` }
44- `
8+ import type { FC } from "react"
9+
10+ export const CouponFormWrapper : FC < React . HTMLAttributes < HTMLDivElement > > = (
11+ props ,
12+ ) => < div { ...props } className = "pb-8 mb-8 border-b" />
13+
14+ export const CouponFieldWrapper : FC < React . HTMLAttributes < HTMLDivElement > > = (
15+ props ,
16+ ) => < div { ...props } className = "flex mt-1" />
17+
18+ export const CouponRecap : FC < React . HTMLAttributes < HTMLDivElement > > = (
19+ props ,
20+ ) => (
21+ < div
22+ { ...props }
23+ className = "flex flex-row justify-between pb-5 mb-6 border-b"
24+ />
25+ )
26+
27+ export const CouponName : FC < React . HTMLAttributes < HTMLParagraphElement > > = (
28+ props ,
29+ ) => < p { ...props } className = "font-bold" />
30+
31+ export const StyledGiftCardOrCouponRemoveButton : FC <
32+ React . ComponentProps < typeof GiftCardOrCouponRemoveButton >
33+ > = ( props ) => (
34+ < GiftCardOrCouponRemoveButton
35+ { ...props }
36+ className = { `ml-2 text-sm font-bold text-primary border-b leading-none border-black border-opacity-10 transition ease-in duration-200 hover:border-opacity-50 hover:text-primary-dark focus:outline-none ${ props . className || "" } ` }
37+ />
38+ )
39+
40+ export const StyledGiftCardOrCouponInput : FC <
41+ React . ComponentProps < typeof GiftCardOrCouponInput >
42+ > = ( props ) => (
43+ < GiftCardOrCouponInput
44+ { ...props }
45+ className = { `${ InputCss } rounded-none rounded-l-md z-10 [&.hasError]:placeholder-red-400 [&.hasError]:border-red-400 [&.hasError]:border-2 [&.hasError]:focus:ring-offset-0 [&.hasError]:focus:ring-red-400 [&.hasError]:focus:ring-opacity-50 ${ props . className || "" } ` }
46+ />
47+ )
48+
49+ export const StyledGiftCardOrCouponSubmit : FC <
50+ React . ComponentProps < typeof GiftCardOrCouponSubmit >
51+ > = ( props ) => (
52+ < GiftCardOrCouponSubmit
53+ { ...props }
54+ className = { `${ ButtonCss } w-auto -ml-px relative space-x-2 px-8 py-3 border-transparent rounded-none rounded-r-md ${ props . className || "" } ` }
55+ />
56+ )
57+
58+ export const StyledErrors : FC < React . ComponentProps < typeof Errors > > = (
59+ props ,
60+ ) => (
61+ < Errors { ...props } className = { `${ ErrorCss } pl-0 ${ props . className || "" } ` } />
62+ )
0 commit comments