diff --git a/assets/js/base/components/filter-reset-button/index.tsx b/assets/js/base/components/filter-reset-button/index.tsx new file mode 100644 index 00000000000..17bbb3434b3 --- /dev/null +++ b/assets/js/base/components/filter-reset-button/index.tsx @@ -0,0 +1,40 @@ +/** + * External dependencies + */ +import { __ } from '@wordpress/i18n'; +import classNames from 'classnames'; +import Label from '@woocommerce/base-components/label'; + +/** + * Internal dependencies + */ +import './style.scss'; + +interface FilterResetButtonProps { + className?: string; + label?: string; + onClick: () => void; + screenReaderLabel?: string; +} + +const FilterResetButton = ( { + className, + /* translators: Reset button text for filters. */ + label = __( 'Reset', 'woo-gutenberg-products-block' ), + onClick, + screenReaderLabel = __( 'Reset filter', 'woo-gutenberg-products-block' ), +}: FilterResetButtonProps ): JSX.Element => { + return ( + + ); +}; + +export default FilterResetButton; diff --git a/assets/js/base/components/filter-reset-button/style.scss b/assets/js/base/components/filter-reset-button/style.scss new file mode 100644 index 00000000000..3375f7c77e9 --- /dev/null +++ b/assets/js/base/components/filter-reset-button/style.scss @@ -0,0 +1,14 @@ +.wc-block-components-filter-reset-button { + background: transparent; + border: none; + cursor: pointer; + font-size: inherit; + + &:not([disabled]):hover { + text-decoration: underline; + } + + &[disabled] { + cursor: not-allowed; + } +} diff --git a/assets/js/base/components/filter-submit-button/index.tsx b/assets/js/base/components/filter-submit-button/index.tsx index 3dc739eb2d2..4a320aa68e2 100644 --- a/assets/js/base/components/filter-submit-button/index.tsx +++ b/assets/js/base/components/filter-submit-button/index.tsx @@ -22,7 +22,7 @@ const FilterSubmitButton = ( { className, disabled, /* translators: Submit button text for filters. */ - label = __( 'Go', 'woo-gutenberg-products-block' ), + label = __( 'Apply', 'woo-gutenberg-products-block' ), onClick, screenReaderLabel = __( 'Apply filter', 'woo-gutenberg-products-block' ), }: FilterSubmitButtonProps ): JSX.Element => { @@ -30,6 +30,7 @@ const FilterSubmitButton = ( {