@faststore/components 2.0.96-alpha.0 → 2.0.99-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atoms/Button/Button.d.ts +1 -1
- package/dist/atoms/Button/Button.js +3 -3
- package/dist/atoms/Button/Button.js.map +1 -1
- package/dist/atoms/Icon/Icon.d.ts +15 -6
- package/dist/atoms/Icon/Icon.js +11 -3
- package/dist/atoms/Icon/Icon.js.map +1 -1
- package/dist/atoms/Select/Select.d.ts +1 -1
- package/dist/atoms/Select/Select.js +1 -2
- package/dist/atoms/Select/Select.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -2
- package/dist/index.js.map +1 -1
- package/dist/molecules/Accordion/AccordionButton.d.ts +1 -1
- package/dist/molecules/Accordion/AccordionButton.js +2 -2
- package/dist/molecules/Accordion/AccordionButton.js.map +1 -1
- package/dist/molecules/Alert/Alert.d.ts +1 -1
- package/dist/molecules/Alert/Alert.js +4 -6
- package/dist/molecules/Alert/Alert.js.map +1 -1
- package/dist/molecules/Breadcrumb/BreadcrumbBase.js +7 -5
- package/dist/molecules/Breadcrumb/BreadcrumbBase.js.map +1 -1
- package/dist/molecules/Breadcrumb/HomeLink.js +3 -3
- package/dist/molecules/Breadcrumb/HomeLink.js.map +1 -1
- package/dist/molecules/BuyButton/BuyButton.js +2 -3
- package/dist/molecules/BuyButton/BuyButton.js.map +1 -1
- package/dist/molecules/CartItem/CartItem.js +2 -3
- package/dist/molecules/CartItem/CartItem.js.map +1 -1
- package/dist/molecules/Dropdown/DropdownItem.d.ts +2 -3
- package/dist/molecules/Dropdown/DropdownItem.js +2 -3
- package/dist/molecules/Dropdown/DropdownItem.js.map +1 -1
- package/dist/molecules/Gift/Gift.js +3 -2
- package/dist/molecules/Gift/Gift.js.map +1 -1
- package/dist/molecules/InputField/InputField.js +2 -3
- package/dist/molecules/InputField/InputField.js.map +1 -1
- package/dist/molecules/LinkButton/LinkButton.js +2 -3
- package/dist/molecules/LinkButton/LinkButton.js.map +1 -1
- package/dist/molecules/Modal/ModalHeader.js +2 -2
- package/dist/molecules/Modal/ModalHeader.js.map +1 -1
- package/dist/molecules/ProductCard/ProductCardContent.d.ts +1 -1
- package/dist/molecules/ProductCard/ProductCardContent.js +3 -4
- package/dist/molecules/ProductCard/ProductCardContent.js.map +1 -1
- package/dist/molecules/ProductTitle/ProductTitle.d.ts +1 -1
- package/dist/molecules/QuantitySelector/QuantitySelector.js +4 -5
- package/dist/molecules/QuantitySelector/QuantitySelector.js.map +1 -1
- package/dist/molecules/Rating/Rating.d.ts +2 -4
- package/dist/molecules/Rating/Rating.js +5 -5
- package/dist/molecules/Rating/Rating.js.map +1 -1
- package/dist/molecules/RegionBar/RegionBar.d.ts +1 -1
- package/dist/molecules/RegionBar/RegionBar.js +2 -3
- package/dist/molecules/RegionBar/RegionBar.js.map +1 -1
- package/dist/molecules/SearchAutoComplete/SearchAutoCompleteTerm.d.ts +1 -1
- package/dist/molecules/SearchAutoComplete/SearchAutoCompleteTerm.js +4 -3
- package/dist/molecules/SearchAutoComplete/SearchAutoCompleteTerm.js.map +1 -1
- package/dist/molecules/SearchHistory/SearchHistoryTerm.d.ts +1 -1
- package/dist/molecules/SearchHistory/SearchHistoryTerm.js +4 -3
- package/dist/molecules/SearchHistory/SearchHistoryTerm.js.map +1 -1
- package/dist/molecules/SearchInputField/SearchInputField.d.ts +1 -1
- package/dist/molecules/SearchInputField/SearchInputField.js +2 -2
- package/dist/molecules/SearchInputField/SearchInputField.js.map +1 -1
- package/dist/molecules/Table/Table.d.ts +1 -1
- package/dist/molecules/Tag/Tag.d.ts +1 -1
- package/dist/molecules/Tag/Tag.js +2 -5
- package/dist/molecules/Tag/Tag.js.map +1 -1
- package/dist/molecules/Toast/Toast.js +1 -3
- package/dist/molecules/Toast/Toast.js.map +1 -1
- package/dist/molecules/Toggle/Toggle.d.ts +1 -1
- package/dist/molecules/Toggle/Toggle.js +2 -3
- package/dist/molecules/Toggle/Toggle.js.map +1 -1
- package/dist/organisms/Hero/HeroHeader.d.ts +1 -1
- package/dist/organisms/Hero/HeroHeader.js +4 -3
- package/dist/organisms/Hero/HeroHeader.js.map +1 -1
- package/dist/organisms/OutOfStock/OutOfStock.d.ts +1 -1
- package/dist/organisms/OutOfStock/OutOfStock.js +2 -3
- package/dist/organisms/OutOfStock/OutOfStock.js.map +1 -1
- package/dist/organisms/ShippingSimulation/ShippingSimulation.d.ts +1 -1
- package/dist/organisms/ShippingSimulation/ShippingSimulation.js +2 -3
- package/dist/organisms/ShippingSimulation/ShippingSimulation.js.map +1 -1
- package/dist/organisms/SlideOver/SlideOverHeader.d.ts +2 -2
- package/dist/organisms/SlideOver/SlideOverHeader.js +2 -3
- package/dist/organisms/SlideOver/SlideOverHeader.js.map +1 -1
- package/package.json +2 -2
- package/src/atoms/Button/Button.tsx +4 -4
- package/src/atoms/Icon/Icon.tsx +36 -10
- package/src/atoms/Select/Select.tsx +2 -3
- package/src/index.ts +0 -3
- package/src/molecules/Accordion/AccordionButton.tsx +4 -4
- package/src/molecules/Alert/Alert.tsx +5 -8
- package/src/molecules/Breadcrumb/BreadcrumbBase.tsx +43 -27
- package/src/molecules/Breadcrumb/HomeLink.tsx +3 -3
- package/src/molecules/BuyButton/BuyButton.tsx +2 -3
- package/src/molecules/CartItem/CartItem.tsx +2 -3
- package/src/molecules/Dropdown/DropdownItem.tsx +4 -5
- package/src/molecules/Gift/Gift.tsx +3 -2
- package/src/molecules/InputField/InputField.tsx +3 -4
- package/src/molecules/LinkButton/LinkButton.tsx +3 -4
- package/src/molecules/Modal/ModalHeader.tsx +2 -2
- package/src/molecules/ProductCard/ProductCardContent.tsx +3 -10
- package/src/molecules/QuantitySelector/QuantitySelector.tsx +4 -5
- package/src/molecules/Rating/Rating.tsx +12 -10
- package/src/molecules/RegionBar/RegionBar.tsx +3 -4
- package/src/molecules/SearchAutoComplete/SearchAutoCompleteTerm.tsx +10 -9
- package/src/molecules/SearchHistory/SearchHistoryTerm.tsx +9 -6
- package/src/molecules/SearchInputField/SearchInputField.tsx +4 -4
- package/src/molecules/Tag/Tag.tsx +3 -5
- package/src/molecules/Toast/Toast.tsx +1 -2
- package/src/molecules/Toggle/Toggle.tsx +3 -4
- package/src/organisms/Hero/HeroHeader.tsx +11 -5
- package/src/organisms/OutOfStock/OutOfStock.tsx +3 -4
- package/src/organisms/ShippingSimulation/ShippingSimulation.tsx +3 -11
- package/src/organisms/SlideOver/SlideOverHeader.tsx +3 -5
- package/dist/assets/ArrowElbowDownRight.d.ts +0 -4
- package/dist/assets/ArrowElbowDownRight.js +0 -8
- package/dist/assets/ArrowElbowDownRight.js.map +0 -1
- package/dist/assets/ArrowRight.d.ts +0 -3
- package/dist/assets/ArrowRight.js +0 -8
- package/dist/assets/ArrowRight.js.map +0 -1
- package/dist/assets/ArrowSquareOut.d.ts +0 -4
- package/dist/assets/ArrowSquareOut.js +0 -6
- package/dist/assets/ArrowSquareOut.js.map +0 -1
- package/dist/assets/BellRinging.d.ts +0 -4
- package/dist/assets/BellRinging.js +0 -6
- package/dist/assets/BellRinging.js.map +0 -1
- package/dist/assets/CaretDown.d.ts +0 -3
- package/dist/assets/CaretDown.js +0 -7
- package/dist/assets/CaretDown.js.map +0 -1
- package/dist/assets/CaretRight.d.ts +0 -4
- package/dist/assets/CaretRight.js +0 -7
- package/dist/assets/CaretRight.js.map +0 -1
- package/dist/assets/Checked.d.ts +0 -3
- package/dist/assets/Checked.js +0 -6
- package/dist/assets/Checked.js.map +0 -1
- package/dist/assets/ClockClockwise.d.ts +0 -3
- package/dist/assets/ClockClockwise.js +0 -10
- package/dist/assets/ClockClockwise.js.map +0 -1
- package/dist/assets/DotsThree.d.ts +0 -4
- package/dist/assets/DotsThree.js +0 -9
- package/dist/assets/DotsThree.js.map +0 -1
- package/dist/assets/FadersHorizontal.d.ts +0 -3
- package/dist/assets/FadersHorizontal.js +0 -12
- package/dist/assets/FadersHorizontal.js.map +0 -1
- package/dist/assets/Heart.d.ts +0 -3
- package/dist/assets/Heart.js +0 -7
- package/dist/assets/Heart.js.map +0 -1
- package/dist/assets/House.d.ts +0 -4
- package/dist/assets/House.js +0 -7
- package/dist/assets/House.js.map +0 -1
- package/dist/assets/IconProps.d.ts +0 -3
- package/dist/assets/IconProps.js +0 -2
- package/dist/assets/IconProps.js.map +0 -1
- package/dist/assets/MagnifyingGlass.d.ts +0 -4
- package/dist/assets/MagnifyingGlass.js +0 -7
- package/dist/assets/MagnifyingGlass.js.map +0 -1
- package/dist/assets/MapPin.d.ts +0 -4
- package/dist/assets/MapPin.js +0 -8
- package/dist/assets/MapPin.js.map +0 -1
- package/dist/assets/Minus.d.ts +0 -3
- package/dist/assets/Minus.js +0 -7
- package/dist/assets/Minus.js.map +0 -1
- package/dist/assets/MinusCircle.d.ts +0 -3
- package/dist/assets/MinusCircle.js +0 -8
- package/dist/assets/MinusCircle.js.map +0 -1
- package/dist/assets/PaymentFlags/ApplePay.d.ts +0 -3
- package/dist/assets/PaymentFlags/ApplePay.js +0 -7
- package/dist/assets/PaymentFlags/ApplePay.js.map +0 -1
- package/dist/assets/PaymentFlags/Diners.d.ts +0 -3
- package/dist/assets/PaymentFlags/Diners.js +0 -8
- package/dist/assets/PaymentFlags/Diners.js.map +0 -1
- package/dist/assets/PaymentFlags/EloCard.d.ts +0 -3
- package/dist/assets/PaymentFlags/EloCard.js +0 -11
- package/dist/assets/PaymentFlags/EloCard.js.map +0 -1
- package/dist/assets/PaymentFlags/GooglePay.d.ts +0 -3
- package/dist/assets/PaymentFlags/GooglePay.js +0 -11
- package/dist/assets/PaymentFlags/GooglePay.js.map +0 -1
- package/dist/assets/PaymentFlags/Mastercard.d.ts +0 -3
- package/dist/assets/PaymentFlags/Mastercard.js +0 -9
- package/dist/assets/PaymentFlags/Mastercard.js.map +0 -1
- package/dist/assets/PaymentFlags/PayPal.d.ts +0 -3
- package/dist/assets/PaymentFlags/PayPal.js +0 -10
- package/dist/assets/PaymentFlags/PayPal.js.map +0 -1
- package/dist/assets/PaymentFlags/Stripe.d.ts +0 -3
- package/dist/assets/PaymentFlags/Stripe.js +0 -7
- package/dist/assets/PaymentFlags/Stripe.js.map +0 -1
- package/dist/assets/PaymentFlags/Visa.d.ts +0 -3
- package/dist/assets/PaymentFlags/Visa.js +0 -7
- package/dist/assets/PaymentFlags/Visa.js.map +0 -1
- package/dist/assets/PaymentFlags/index.d.ts +0 -8
- package/dist/assets/PaymentFlags/index.js +0 -9
- package/dist/assets/PaymentFlags/index.js.map +0 -1
- package/dist/assets/Plus.d.ts +0 -3
- package/dist/assets/Plus.js +0 -8
- package/dist/assets/Plus.js.map +0 -1
- package/dist/assets/PlusCircle.d.ts +0 -3
- package/dist/assets/PlusCircle.js +0 -9
- package/dist/assets/PlusCircle.js.map +0 -1
- package/dist/assets/Ruler.d.ts +0 -3
- package/dist/assets/Ruler.js +0 -10
- package/dist/assets/Ruler.js.map +0 -1
- package/dist/assets/SealCheck.d.ts +0 -4
- package/dist/assets/SealCheck.js +0 -6
- package/dist/assets/SealCheck.js.map +0 -1
- package/dist/assets/SealWarning.d.ts +0 -4
- package/dist/assets/SealWarning.js +0 -6
- package/dist/assets/SealWarning.js.map +0 -1
- package/dist/assets/ShoppingCart.d.ts +0 -3
- package/dist/assets/ShoppingCart.js +0 -10
- package/dist/assets/ShoppingCart.js.map +0 -1
- package/dist/assets/Star.d.ts +0 -3
- package/dist/assets/Star.js +0 -7
- package/dist/assets/Star.js.map +0 -1
- package/dist/assets/TagIcon.d.ts +0 -3
- package/dist/assets/TagIcon.js +0 -8
- package/dist/assets/TagIcon.js.map +0 -1
- package/dist/assets/X.d.ts +0 -3
- package/dist/assets/X.js +0 -8
- package/dist/assets/X.js.map +0 -1
- package/dist/assets/XCircle.d.ts +0 -3
- package/dist/assets/XCircle.js +0 -9
- package/dist/assets/XCircle.js.map +0 -1
- package/dist/assets/index.d.ts +0 -27
- package/dist/assets/index.js +0 -29
- package/dist/assets/index.js.map +0 -1
- package/src/assets/ArrowElbowDownRight.tsx +0 -28
- package/src/assets/ArrowRight.tsx +0 -37
- package/src/assets/ArrowSquareOut.tsx +0 -19
- package/src/assets/BellRinging.tsx +0 -18
- package/src/assets/CaretDown.tsx +0 -26
- package/src/assets/CaretRight.tsx +0 -25
- package/src/assets/Checked.tsx +0 -24
- package/src/assets/ClockClockwise.tsx +0 -56
- package/src/assets/DotsThree.tsx +0 -21
- package/src/assets/FadersHorizontal.tsx +0 -84
- package/src/assets/Heart.tsx +0 -19
- package/src/assets/House.tsx +0 -26
- package/src/assets/IconProps.ts +0 -3
- package/src/assets/MagnifyingGlass.tsx +0 -22
- package/src/assets/MapPin.tsx +0 -34
- package/src/assets/Minus.tsx +0 -28
- package/src/assets/MinusCircle.tsx +0 -36
- package/src/assets/PaymentFlags/ApplePay.tsx +0 -20
- package/src/assets/PaymentFlags/Diners.tsx +0 -20
- package/src/assets/PaymentFlags/EloCard.tsx +0 -32
- package/src/assets/PaymentFlags/GooglePay.tsx +0 -41
- package/src/assets/PaymentFlags/Mastercard.tsx +0 -32
- package/src/assets/PaymentFlags/PayPal.tsx +0 -38
- package/src/assets/PaymentFlags/Stripe.tsx +0 -25
- package/src/assets/PaymentFlags/Visa.tsx +0 -20
- package/src/assets/PaymentFlags/index.ts +0 -8
- package/src/assets/Plus.tsx +0 -38
- package/src/assets/PlusCircle.tsx +0 -46
- package/src/assets/Ruler.tsx +0 -64
- package/src/assets/SealCheck.tsx +0 -17
- package/src/assets/SealWarning.tsx +0 -17
- package/src/assets/ShoppingCart.tsx +0 -50
- package/src/assets/Star.tsx +0 -19
- package/src/assets/TagIcon.tsx +0 -26
- package/src/assets/X.tsx +0 -38
- package/src/assets/XCircle.tsx +0 -46
- package/src/assets/index.ts +0 -29
package/src/atoms/Icon/Icon.tsx
CHANGED
|
@@ -1,25 +1,51 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import React, { forwardRef } from
|
|
1
|
+
import type { SVGProps } from 'react'
|
|
2
|
+
import React, { forwardRef } from "react"
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
type IconWeight = 'thin' | 'light' | 'regular' | 'bold'
|
|
5
|
+
|
|
6
|
+
const mapWeightToValue: Record<IconWeight, number> = {
|
|
7
|
+
bold: 24,
|
|
8
|
+
regular: 16,
|
|
9
|
+
light: 12,
|
|
10
|
+
thin: 8,
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface IconProps extends SVGProps<SVGSVGElement> {
|
|
5
14
|
/**
|
|
6
15
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
7
16
|
*/
|
|
8
17
|
testId?: string
|
|
9
18
|
/**
|
|
10
|
-
*
|
|
19
|
+
* Symbol id from element to render. Take a look at `/static/icons.svg`.
|
|
20
|
+
*
|
|
21
|
+
* Example: <Icon name="Bell" />
|
|
22
|
+
*/
|
|
23
|
+
name: string
|
|
24
|
+
/**
|
|
25
|
+
* SVG weight.
|
|
26
|
+
*
|
|
27
|
+
* @default 'regular'
|
|
11
28
|
*/
|
|
12
|
-
|
|
29
|
+
weight?: IconWeight
|
|
13
30
|
}
|
|
14
31
|
|
|
15
|
-
const Icon = forwardRef<
|
|
16
|
-
{
|
|
32
|
+
const Icon = forwardRef<SVGSVGElement, IconProps>(function Icon(
|
|
33
|
+
{ testId = 'fs-icon', name, weight = 'regular', ...otherProps }: IconProps,
|
|
17
34
|
ref
|
|
18
35
|
) {
|
|
36
|
+
const {width, height} = otherProps
|
|
19
37
|
return (
|
|
20
|
-
<
|
|
21
|
-
{
|
|
22
|
-
|
|
38
|
+
<svg
|
|
39
|
+
ref={ref}
|
|
40
|
+
data-fs-icon
|
|
41
|
+
data-testid={testId}
|
|
42
|
+
width={width ?? 24}
|
|
43
|
+
height={height ?? 24}
|
|
44
|
+
strokeWidth={mapWeightToValue[weight]}
|
|
45
|
+
{...otherProps}
|
|
46
|
+
>
|
|
47
|
+
<use href={`/icons.svg#${name}`} />
|
|
48
|
+
</svg>
|
|
23
49
|
)
|
|
24
50
|
})
|
|
25
51
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react'
|
|
2
1
|
import type { SelectHTMLAttributes } from 'react'
|
|
2
|
+
import React, { forwardRef } from 'react'
|
|
3
3
|
import { Icon } from '../..'
|
|
4
|
-
import { CaretDown } from '../../assets'
|
|
5
4
|
|
|
6
5
|
export interface SelectProps extends SelectHTMLAttributes<HTMLSelectElement> {
|
|
7
6
|
/**
|
|
@@ -33,7 +32,7 @@ const Select = forwardRef<HTMLSelectElement, SelectProps>(function Select(
|
|
|
33
32
|
</option>
|
|
34
33
|
))}
|
|
35
34
|
</select>
|
|
36
|
-
<Icon data-fs-select-icon
|
|
35
|
+
<Icon data-fs-select-icon name="CaretDown" />
|
|
37
36
|
</div>
|
|
38
37
|
)
|
|
39
38
|
})
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react'
|
|
2
1
|
import type { ReactNode } from 'react'
|
|
2
|
+
import React, { forwardRef } from 'react'
|
|
3
3
|
|
|
4
4
|
import { useAccordion } from './Accordion'
|
|
5
5
|
import { useAccordionItem } from './AccordionItem'
|
|
6
6
|
|
|
7
|
-
import { Button, MinusCircle, PlusCircle } from '../..'
|
|
8
7
|
import type { ButtonProps } from '../..'
|
|
8
|
+
import { Button, Icon } from '../..'
|
|
9
9
|
|
|
10
10
|
export interface AccordionButtonProps extends ButtonProps {
|
|
11
11
|
/**
|
|
@@ -26,8 +26,8 @@ const AccordionButton = forwardRef<HTMLButtonElement, AccordionButtonProps>(
|
|
|
26
26
|
function AccordionButton(
|
|
27
27
|
{
|
|
28
28
|
testId = 'fs-accordion-button',
|
|
29
|
-
expandedIcon = <MinusCircle data-icon="expanded" />,
|
|
30
|
-
collapsedIcon = <PlusCircle data-icon="collapsed" />,
|
|
29
|
+
expandedIcon = <Icon name="MinusCircle" data-icon="expanded" />,
|
|
30
|
+
collapsedIcon = <Icon name="PlusCircle" data-icon="collapsed" />,
|
|
31
31
|
children,
|
|
32
32
|
...otherProps
|
|
33
33
|
},
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react'
|
|
2
|
-
import React, { forwardRef } from 'react'
|
|
3
|
-
import { useCallback } from 'react'
|
|
2
|
+
import React, { forwardRef, useCallback } from 'react'
|
|
4
3
|
|
|
5
|
-
import { Button,
|
|
4
|
+
import { Button, Icon, Link, LinkProps } from '../../'
|
|
6
5
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import type { ReactNode, MouseEvent } from 'react'
|
|
6
|
+
import type { MouseEvent, ReactNode } from 'react'
|
|
10
7
|
|
|
11
8
|
export interface AlertProps
|
|
12
9
|
extends Omit<HTMLAttributes<HTMLDivElement>, 'role'> {
|
|
@@ -64,7 +61,7 @@ const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
|
|
64
61
|
data-fs-alert-dismissible={dismissible}
|
|
65
62
|
{...otherProps}
|
|
66
63
|
>
|
|
67
|
-
{icon &&
|
|
64
|
+
{React.isValidElement(icon) && icon}
|
|
68
65
|
|
|
69
66
|
<p data-fs-alert-content>{children}</p>
|
|
70
67
|
|
|
@@ -73,7 +70,7 @@ const Alert = forwardRef<HTMLDivElement, AlertProps>(function Alert(
|
|
|
73
70
|
{dismissible && (
|
|
74
71
|
<Button data-fs-alert-button aria-label="Close" onClick={handleClose}>
|
|
75
72
|
<span>
|
|
76
|
-
<Icon
|
|
73
|
+
<Icon name="X" />
|
|
77
74
|
</span>
|
|
78
75
|
</Button>
|
|
79
76
|
)}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
|
|
1
|
+
import React, {
|
|
2
|
+
cloneElement,
|
|
3
|
+
forwardRef,
|
|
4
|
+
ReactElement,
|
|
5
|
+
ReactNode,
|
|
6
|
+
useCallback,
|
|
7
|
+
} from 'react'
|
|
3
8
|
import Icon from '../../atoms/Icon'
|
|
4
9
|
import Link from '../../atoms/Link'
|
|
5
10
|
import Dropdown, {
|
|
6
11
|
DropdownButton,
|
|
7
|
-
DropdownMenu,
|
|
8
12
|
DropdownItem,
|
|
13
|
+
DropdownMenu,
|
|
9
14
|
} from '../Dropdown'
|
|
10
15
|
import BreadcrumbPure, { BreadcrumbPureProps } from './BreadcrumbPure'
|
|
11
16
|
import HomeLink from './HomeLink'
|
|
@@ -66,8 +71,10 @@ const BreadcrumbBase = forwardRef<HTMLDivElement, BreadcrumbBaseProps>(
|
|
|
66
71
|
isDesktop = false,
|
|
67
72
|
renderLink,
|
|
68
73
|
homeLink = <HomeLink />,
|
|
69
|
-
dropdownButtonIcon = <Icon
|
|
70
|
-
collapsedItemsIcon =
|
|
74
|
+
dropdownButtonIcon = <Icon name="DotsThree" />,
|
|
75
|
+
collapsedItemsIcon = (
|
|
76
|
+
<Icon data-fs-dropdown-item-icon name="ArrowElbowDownRight" />
|
|
77
|
+
),
|
|
71
78
|
...otherProps
|
|
72
79
|
},
|
|
73
80
|
ref
|
|
@@ -90,23 +97,33 @@ const BreadcrumbBase = forwardRef<HTMLDivElement, BreadcrumbBaseProps>(
|
|
|
90
97
|
|
|
91
98
|
const collapseBreadcrumb = breadcrumbList.length > 4
|
|
92
99
|
|
|
93
|
-
const breadcrumbLink = useCallback(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
100
|
+
const breadcrumbLink = useCallback(
|
|
101
|
+
(renderLinkProps: RenderLinkProps) => {
|
|
102
|
+
const breadcrumbItem = renderLink?.(renderLinkProps)
|
|
103
|
+
const itemProps = renderLinkProps.collapsed
|
|
104
|
+
? {
|
|
105
|
+
'data-fs-breadcrumb-dropdown-link': true,
|
|
106
|
+
}
|
|
107
|
+
: {
|
|
108
|
+
'data-fs-breadcrumb-link': true,
|
|
109
|
+
}
|
|
110
|
+
return breadcrumbItem ? (
|
|
111
|
+
cloneElement(breadcrumbItem, {
|
|
112
|
+
...itemProps,
|
|
113
|
+
key: renderLinkProps.itemProps.position,
|
|
114
|
+
})
|
|
115
|
+
) : (
|
|
116
|
+
<Link
|
|
117
|
+
{...itemProps}
|
|
118
|
+
href={renderLinkProps.itemProps.item}
|
|
119
|
+
key={renderLinkProps.itemProps.position}
|
|
120
|
+
>
|
|
121
|
+
{renderLinkProps.itemProps.name}
|
|
122
|
+
</Link>
|
|
123
|
+
)
|
|
124
|
+
},
|
|
125
|
+
[renderLink]
|
|
126
|
+
)
|
|
110
127
|
|
|
111
128
|
return (
|
|
112
129
|
<BreadcrumbPure
|
|
@@ -115,7 +132,7 @@ const BreadcrumbBase = forwardRef<HTMLDivElement, BreadcrumbBaseProps>(
|
|
|
115
132
|
{...otherProps}
|
|
116
133
|
>
|
|
117
134
|
{homeLinkWithProps}
|
|
118
|
-
|
|
135
|
+
|
|
119
136
|
{!collapseBreadcrumb &&
|
|
120
137
|
breadcrumbList.map((item, index) => {
|
|
121
138
|
return breadcrumbList.length === index + 1 ? (
|
|
@@ -131,10 +148,9 @@ const BreadcrumbBase = forwardRef<HTMLDivElement, BreadcrumbBaseProps>(
|
|
|
131
148
|
|
|
132
149
|
{collapseBreadcrumb && (
|
|
133
150
|
<Dropdown>
|
|
134
|
-
<DropdownButton
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
>{dropdownButtonIcon}</DropdownButton>
|
|
151
|
+
<DropdownButton data-fs-breadcrumb-dropdown-button size="small">
|
|
152
|
+
{dropdownButtonIcon}
|
|
153
|
+
</DropdownButton>
|
|
138
154
|
<DropdownMenu data-fs-breadcrumb-dropdown-menu>
|
|
139
155
|
{mediumItems.map((item) => (
|
|
140
156
|
<DropdownItem
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Icon, Link } from '../..'
|
|
3
3
|
|
|
4
4
|
const HomeLink = () => (
|
|
5
5
|
<Link
|
|
@@ -8,7 +8,7 @@ const HomeLink = () => (
|
|
|
8
8
|
aria-label="Go to homepage"
|
|
9
9
|
href="/"
|
|
10
10
|
>
|
|
11
|
-
<Icon
|
|
11
|
+
<Icon name="House" width={18} height={18} />
|
|
12
12
|
</Link>
|
|
13
13
|
)
|
|
14
14
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
|
-
import { Button } from '../../'
|
|
4
3
|
import type { ButtonProps } from '../../'
|
|
5
|
-
import {
|
|
4
|
+
import { Button, Icon } from '../../'
|
|
6
5
|
|
|
7
6
|
type BuyButtonProps = ButtonProps
|
|
8
7
|
|
|
@@ -15,7 +14,7 @@ function BuyButton({
|
|
|
15
14
|
return (
|
|
16
15
|
<Button
|
|
17
16
|
data-fs-buy-button
|
|
18
|
-
icon={<ShoppingCart />}
|
|
17
|
+
icon={<Icon name="ShoppingCart" />}
|
|
19
18
|
iconPosition="left"
|
|
20
19
|
data-testid={testId}
|
|
21
20
|
{...otherProps}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
import { IconButton, IconButtonProps, Price, QuantitySelector } from '../../'
|
|
4
|
+
import { Icon, IconButton, IconButtonProps, Price, QuantitySelector } from '../../'
|
|
6
5
|
|
|
7
6
|
import type { PriceDefinition } from '../../typings/PriceDefinition'
|
|
8
7
|
|
|
@@ -56,7 +55,7 @@ const CartItem = forwardRef<HTMLDivElement, CartItemProps>(function CartItem(
|
|
|
56
55
|
<div data-fs-cart-item-content>{children}</div>
|
|
57
56
|
<IconButton
|
|
58
57
|
data-fs-cart-item-remove-button
|
|
59
|
-
icon={<XCircle />}
|
|
58
|
+
icon={<Icon name="XCircle" />}
|
|
60
59
|
aria-label="Remove"
|
|
61
60
|
{...removeBtnProps}
|
|
62
61
|
/>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { ButtonHTMLAttributes } from 'react'
|
|
2
|
-
import
|
|
3
|
-
import React, { useImperativeHandle, forwardRef, useRef, useState } from 'react'
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from 'react'
|
|
2
|
+
import React, { forwardRef, useImperativeHandle, useRef, useState } from 'react'
|
|
4
3
|
|
|
5
4
|
import { useDropdown } from './hooks/useDropdown'
|
|
6
5
|
|
|
@@ -13,7 +12,7 @@ export interface DropdownItemProps
|
|
|
13
12
|
/**
|
|
14
13
|
* A React component that will be rendered as an icon.
|
|
15
14
|
*/
|
|
16
|
-
icon?:
|
|
15
|
+
icon?: ReactNode
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
const DropdownItem = forwardRef<HTMLButtonElement, DropdownItemProps>(
|
|
@@ -65,7 +64,7 @@ const DropdownItem = forwardRef<HTMLButtonElement, DropdownItemProps>(
|
|
|
65
64
|
data-index={dropdownItemIndex}
|
|
66
65
|
{...otherProps}
|
|
67
66
|
>
|
|
68
|
-
{icon &&
|
|
67
|
+
{React.isValidElement(icon) && icon}
|
|
69
68
|
{children}
|
|
70
69
|
</button>
|
|
71
70
|
)
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { HTMLAttributes, ReactNode } from 'react'
|
|
2
2
|
import React, { forwardRef } from 'react'
|
|
3
3
|
|
|
4
|
-
import { Icon } from '../..'
|
|
5
4
|
|
|
6
5
|
export interface GiftProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
6
|
/**
|
|
@@ -19,9 +18,11 @@ const Gift = forwardRef<HTMLDivElement, GiftProps>(function Gift(
|
|
|
19
18
|
{ icon, testId = 'fs-gift', children, ...otherProps },
|
|
20
19
|
ref
|
|
21
20
|
) {
|
|
21
|
+
const iconProps = { "data-fs-gift-icon": true }
|
|
22
|
+
const giftIcon = React.isValidElement(icon) ? React.cloneElement(icon, iconProps) : icon
|
|
22
23
|
return (
|
|
23
24
|
<div ref={ref} data-fs-gift data-testid={testId} {...otherProps}>
|
|
24
|
-
{
|
|
25
|
+
{React.isValidElement(giftIcon) && giftIcon}
|
|
25
26
|
<div data-fs-gift-wrapper>{children}</div>
|
|
26
27
|
</div>
|
|
27
28
|
)
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
1
|
import type { MutableRefObject } from 'react'
|
|
2
|
+
import React from 'react'
|
|
3
3
|
|
|
4
|
-
import { Input, Label, IconButton, Button } from '../../'
|
|
5
4
|
import type { InputProps } from '../../'
|
|
6
|
-
import {
|
|
5
|
+
import { Button, Icon, IconButton, Input, Label } from '../../'
|
|
7
6
|
|
|
8
7
|
type DefaultProps = {
|
|
9
8
|
/**
|
|
@@ -110,7 +109,7 @@ const InputField = ({
|
|
|
110
109
|
<IconButton
|
|
111
110
|
data-fs-button-size="small"
|
|
112
111
|
aria-label="Clear Field"
|
|
113
|
-
icon={<XCircle />}
|
|
112
|
+
icon={<Icon name="XCircle" />}
|
|
114
113
|
onClick={() => {
|
|
115
114
|
onClear?.()
|
|
116
115
|
inputRef?.current?.focus()
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
+
import type { AnchorHTMLAttributes, FocusEvent } from 'react'
|
|
1
2
|
import React, { useRef } from 'react'
|
|
2
|
-
import type { FocusEvent, AnchorHTMLAttributes } from 'react'
|
|
3
3
|
|
|
4
|
-
import { Icon } from '../..'
|
|
5
4
|
import type { ButtonProps } from '../..'
|
|
6
5
|
|
|
7
6
|
export type LinkButtonProps = AnchorHTMLAttributes<HTMLAnchorElement> &
|
|
@@ -41,9 +40,9 @@ function LinkButton({
|
|
|
41
40
|
data-testid={testId}
|
|
42
41
|
{...otherProps}
|
|
43
42
|
>
|
|
44
|
-
{iconPosition === 'left' &&
|
|
43
|
+
{React.isValidElement(icon) && iconPosition === 'left' && icon}
|
|
45
44
|
{children}
|
|
46
|
-
{iconPosition === 'right' &&
|
|
45
|
+
{React.isValidElement(icon) && iconPosition === 'right' && icon}
|
|
47
46
|
</a>
|
|
48
47
|
)
|
|
49
48
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { HTMLAttributes } from 'react'
|
|
2
|
-
import
|
|
2
|
+
import Icon from '../../atoms/Icon'
|
|
3
3
|
import IconButton, { IconButtonProps } from '../IconButton'
|
|
4
4
|
|
|
5
5
|
export interface ModalHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -33,7 +33,7 @@ const ModalHeader = ({
|
|
|
33
33
|
<IconButton
|
|
34
34
|
onClick={() => onClose?.()}
|
|
35
35
|
data-fs-modal-header-close-button
|
|
36
|
-
icon={<X />}
|
|
36
|
+
icon={<Icon name="X" />}
|
|
37
37
|
aria-label="Close modal"
|
|
38
38
|
{...closeBtnProps}
|
|
39
39
|
/>
|
|
@@ -4,16 +4,9 @@ import React, { forwardRef } from 'react'
|
|
|
4
4
|
import type { PriceDefinition } from '../../typings/PriceDefinition'
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
-
Link,
|
|
8
|
-
Price,
|
|
9
7
|
Badge,
|
|
10
|
-
Button,
|
|
11
|
-
Rating,
|
|
12
|
-
DiscountBadge,
|
|
13
|
-
LinkProps,
|
|
14
|
-
LinkElementType,
|
|
8
|
+
Button, DiscountBadge, Icon, Link, LinkElementType, LinkProps, Price, Rating
|
|
15
9
|
} from '../../'
|
|
16
|
-
import { Star, ShoppingCart } from '../../assets'
|
|
17
10
|
|
|
18
11
|
export interface ProductCardContentProps extends HTMLAttributes<HTMLElement> {
|
|
19
12
|
/**
|
|
@@ -108,7 +101,7 @@ const ProductCardContent = forwardRef<HTMLElement, ProductCardContentProps>(
|
|
|
108
101
|
SRText="Sale Price:"
|
|
109
102
|
/>
|
|
110
103
|
</div>
|
|
111
|
-
{ratingValue && <Rating value={ratingValue} icon={<Star />} />}
|
|
104
|
+
{ratingValue && <Rating value={ratingValue} icon={<Icon name="Star" />} />}
|
|
112
105
|
</div>
|
|
113
106
|
{showDiscountBadge && !outOfStock && (
|
|
114
107
|
<DiscountBadge
|
|
@@ -121,7 +114,7 @@ const ProductCardContent = forwardRef<HTMLElement, ProductCardContentProps>(
|
|
|
121
114
|
<div data-fs-product-card-actions>
|
|
122
115
|
<Button
|
|
123
116
|
variant="primary"
|
|
124
|
-
icon={<ShoppingCart />}
|
|
117
|
+
icon={<Icon name="ShoppingCart" />}
|
|
125
118
|
iconPosition="left"
|
|
126
119
|
size="small"
|
|
127
120
|
onClick={onButtonClick}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
2
|
|
|
3
|
-
import { IconButton, Input } from '../../'
|
|
4
|
-
import { Minus, Plus } from '../../assets'
|
|
3
|
+
import { Icon, IconButton, Input } from '../../'
|
|
5
4
|
|
|
6
5
|
export interface QuantitySelectorProps {
|
|
7
6
|
/**
|
|
@@ -89,7 +88,7 @@ const QuantitySelector = ({
|
|
|
89
88
|
>
|
|
90
89
|
<IconButton
|
|
91
90
|
data-quantity-selector-button="left"
|
|
92
|
-
icon={<Minus />}
|
|
91
|
+
icon={<Icon name="Minus" width={16} height={16} weight="bold" />}
|
|
93
92
|
aria-label="Decrement Quantity"
|
|
94
93
|
aria-controls="quantity-selector-input"
|
|
95
94
|
disabled={isLeftDisabled || disabled}
|
|
@@ -109,7 +108,7 @@ const QuantitySelector = ({
|
|
|
109
108
|
aria-controls="quantity-selector-input"
|
|
110
109
|
aria-label="Increment Quantity"
|
|
111
110
|
disabled={isRightDisabled || disabled}
|
|
112
|
-
icon={<Plus />}
|
|
111
|
+
icon={<Icon name="Plus" width={16} height={16} weight="bold" />}
|
|
113
112
|
onClick={increase}
|
|
114
113
|
testId={`${testId}-right-button`}
|
|
115
114
|
/>
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import React, { forwardRef, useState } from 'react'
|
|
2
|
-
import { ReactNode } from 'react'
|
|
3
|
-
import { HTMLAttributes } from 'react'
|
|
1
|
+
import React, { forwardRef, HTMLAttributes, ReactNode, useState } from 'react'
|
|
4
2
|
|
|
3
|
+
import { Icon, IconButton } from '../..'
|
|
5
4
|
import List from '../../atoms/List'
|
|
6
|
-
import { Icon, IconButton, Star } from '../..'
|
|
7
5
|
|
|
8
6
|
export interface RatingProps
|
|
9
7
|
extends Omit<HTMLAttributes<HTMLUListElement>, 'onChange'> {
|
|
@@ -16,7 +14,7 @@ export interface RatingProps
|
|
|
16
14
|
*/
|
|
17
15
|
value: number
|
|
18
16
|
/**
|
|
19
|
-
* Icon to represent the rating score unit (e.g.: a <Star /> component)
|
|
17
|
+
* Icon to represent the rating score unit (e.g.: a <Icon name="Star" /> component)
|
|
20
18
|
*/
|
|
21
19
|
icon?: ReactNode
|
|
22
20
|
/**
|
|
@@ -47,7 +45,9 @@ const Rating = forwardRef<HTMLUListElement, RatingProps>(function Rating(
|
|
|
47
45
|
ref
|
|
48
46
|
) {
|
|
49
47
|
const [hover, setHover] = useState(0)
|
|
50
|
-
|
|
48
|
+
|
|
49
|
+
const outlineProps = { 'data-fs-rating-icon-outline': true }
|
|
50
|
+
const ratingIcon = React.isValidElement(icon) ? icon : <Icon name="Star" />
|
|
51
51
|
|
|
52
52
|
return (
|
|
53
53
|
<List
|
|
@@ -92,10 +92,12 @@ const Rating = forwardRef<HTMLUListElement, RatingProps>(function Rating(
|
|
|
92
92
|
/>
|
|
93
93
|
) : (
|
|
94
94
|
<>
|
|
95
|
-
<div data-fs-rating-icon-wrapper>
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
<div data-fs-rating-icon-wrapper>{ratingIcon}</div>
|
|
96
|
+
{React.isValidElement(icon) ? (
|
|
97
|
+
React.cloneElement(icon, outlineProps)
|
|
98
|
+
) : (
|
|
99
|
+
<Icon name="Star" data-fs-rating-icon-outline />
|
|
100
|
+
)}
|
|
99
101
|
</>
|
|
100
102
|
)}
|
|
101
103
|
</li>
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React, { forwardRef } from 'react'
|
|
2
1
|
import type { HTMLAttributes } from 'react'
|
|
2
|
+
import React, { forwardRef } from 'react'
|
|
3
3
|
|
|
4
4
|
import { Button, Icon } from '../../'
|
|
5
|
-
import { MapPin, CaretRight } from '../../'
|
|
6
5
|
|
|
7
6
|
export interface RegionBarProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
7
|
/**
|
|
@@ -22,7 +21,7 @@ const RegionBar = forwardRef<HTMLDivElement, RegionBarProps>(function RegionBar(
|
|
|
22
21
|
return (
|
|
23
22
|
<div ref={ref} data-fs-region-bar {...otherProps}>
|
|
24
23
|
<Button onClick={onButtonClick}>
|
|
25
|
-
<Icon
|
|
24
|
+
<Icon name="MapPin" />
|
|
26
25
|
{postalCode ? (
|
|
27
26
|
<>
|
|
28
27
|
<span data-fs-region-bar-postal-code>{postalCode}</span>
|
|
@@ -31,7 +30,7 @@ const RegionBar = forwardRef<HTMLDivElement, RegionBarProps>(function RegionBar(
|
|
|
31
30
|
) : (
|
|
32
31
|
<span data-fs-region-bar-message>Set your location</span>
|
|
33
32
|
)}
|
|
34
|
-
<Icon
|
|
33
|
+
<Icon name="CaretRight" />
|
|
35
34
|
</Button>
|
|
36
35
|
</div>
|
|
37
36
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react'
|
|
2
|
-
import React, {
|
|
3
|
-
import { Icon,
|
|
2
|
+
import React, { Fragment, HTMLAttributes } from 'react'
|
|
3
|
+
import { Icon, Link, LinkElementType, LinkProps } from '../..'
|
|
4
4
|
|
|
5
5
|
function formatSearchTerm(
|
|
6
6
|
indexSubstring: number,
|
|
@@ -52,7 +52,13 @@ const SearchAutoCompleteTerm = ({
|
|
|
52
52
|
linkProps,
|
|
53
53
|
icon,
|
|
54
54
|
}: SearchAutoCompleteTermProps) => {
|
|
55
|
-
|
|
55
|
+
|
|
56
|
+
const iconProps = {"data-fs-search-auto-complete-item-icon":true}
|
|
57
|
+
const autoCompleteIcon = React.isValidElement(icon) ? (
|
|
58
|
+
React.cloneElement(icon, iconProps)
|
|
59
|
+
) : (
|
|
60
|
+
<Icon name="MagnifyingGlass" data-fs-search-auto-complete-item-icon />
|
|
61
|
+
)
|
|
56
62
|
|
|
57
63
|
const suggestionSubstring = suggestion.toLowerCase().split(term.toLowerCase())
|
|
58
64
|
|
|
@@ -63,12 +69,7 @@ const SearchAutoCompleteTerm = ({
|
|
|
63
69
|
data-fs-search-auto-complete-item-link
|
|
64
70
|
variant="display"
|
|
65
71
|
>
|
|
66
|
-
{autoCompleteIcon
|
|
67
|
-
<Icon
|
|
68
|
-
component={autoCompleteIcon}
|
|
69
|
-
data-fs-search-auto-complete-item-icon
|
|
70
|
-
/>
|
|
71
|
-
)}
|
|
72
|
+
{autoCompleteIcon}
|
|
72
73
|
<p>
|
|
73
74
|
{suggestionSubstring.map((substring, indexSubstring) => (
|
|
74
75
|
<Fragment key={[substring, indexSubstring].join()}>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react'
|
|
2
2
|
import React, { HTMLAttributes } from 'react'
|
|
3
|
-
import { Icon,
|
|
3
|
+
import { Icon, Link, LinkElementType, LinkProps } from '../..'
|
|
4
4
|
|
|
5
5
|
export interface SearchHistoryTermProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
6
|
/**
|
|
@@ -27,14 +27,17 @@ const SearchHistoryTerm = ({
|
|
|
27
27
|
linkProps,
|
|
28
28
|
icon,
|
|
29
29
|
}: SearchHistoryTermProps) => {
|
|
30
|
-
const
|
|
31
|
-
|
|
30
|
+
const iconProps = {"data-fs-search-history-item-icon": true}
|
|
31
|
+
|
|
32
|
+
const historyIcon = React.isValidElement(icon) ? (
|
|
33
|
+
React.cloneElement(icon, iconProps)
|
|
34
|
+
) : (
|
|
35
|
+
<Icon name="ClockClockwise" data-fs-search-history-item-icon />
|
|
36
|
+
)
|
|
32
37
|
return (
|
|
33
38
|
<li data-fs-search-history-item data-testid={testId}>
|
|
34
39
|
<Link {...linkProps} data-fs-search-history-item-link variant="display">
|
|
35
|
-
{historyIcon
|
|
36
|
-
<Icon component={historyIcon} data-fs-search-history-item-icon />
|
|
37
|
-
)}
|
|
40
|
+
{historyIcon}
|
|
38
41
|
<span>{value}</span>
|
|
39
42
|
</Link>
|
|
40
43
|
</li>
|
|
@@ -2,11 +2,11 @@ import type {
|
|
|
2
2
|
AriaAttributes,
|
|
3
3
|
FormEvent,
|
|
4
4
|
InputHTMLAttributes,
|
|
5
|
-
ReactNode
|
|
5
|
+
ReactNode
|
|
6
6
|
} from 'react'
|
|
7
7
|
import React, { forwardRef, useImperativeHandle, useRef } from 'react'
|
|
8
8
|
|
|
9
|
-
import { IconButton, Input
|
|
9
|
+
import { Icon, IconButton, Input } from '../..'
|
|
10
10
|
|
|
11
11
|
type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'onSubmit'>
|
|
12
12
|
|
|
@@ -25,7 +25,7 @@ export interface SearchInputFieldProps extends InputProps {
|
|
|
25
25
|
buttonProps?: ButtonProps
|
|
26
26
|
/**
|
|
27
27
|
* A React component that will be rendered as an icon (submit button).
|
|
28
|
-
* @default <MagnifyingGlass />
|
|
28
|
+
* @default <Icon name="MagnifyingGlass" />
|
|
29
29
|
*/
|
|
30
30
|
buttonIcon?: ReactNode
|
|
31
31
|
/**
|
|
@@ -90,7 +90,7 @@ const SearchInputField = forwardRef<
|
|
|
90
90
|
<IconButton
|
|
91
91
|
type="submit"
|
|
92
92
|
aria-label="Submit Search"
|
|
93
|
-
icon={buttonIcon ?? <MagnifyingGlass />}
|
|
93
|
+
icon={buttonIcon ?? <Icon name="MagnifyingGlass" />}
|
|
94
94
|
{...buttonProps}
|
|
95
95
|
/>
|
|
96
96
|
</form>
|