) => (
-
- {iconBefore && (
-
-
-
- )}
+}: IChip, ref: ForwardedRef
) => {
+ const [isSelected, setIsSelected] = useState(false);
+
+ const handleClick = () => {
+ setIsSelected(!isSelected);
+ };
+
+ return (
- {children}
-
- {iconAfter && (
+ {iconBefore && (
+
+ {onIconBeforeClick ? (
+
+ ) : (
+
+ )}
+
+ )}
-
+ {children}
- )}
-
-));
+ {iconAfter && (
+
+ {onIconAfterClick ? (
+
+ ) : (
+
+ )}
+
+ )}
+
+ );
+});
Chip.propTypes = {
/** Specifies the content of the `Chip`. */
diff --git a/src/Chip/mixins.scss b/src/Chip/mixins.scss
new file mode 100644
index 00000000000..5611132d101
--- /dev/null
+++ b/src/Chip/mixins.scss
@@ -0,0 +1,12 @@
+@mixin chip-outline($ring-color: $white, $distance-to-border: 0, $border-radius: 50%, $border-width: .125rem) {
+ &::before {
+ content: "";
+ position: absolute;
+ top: $distance-to-border;
+ right: $distance-to-border;
+ bottom: $distance-to-border;
+ left: $distance-to-border;
+ border: solid $border-width $ring-color;
+ border-radius: $border-radius;
+ }
+}
diff --git a/src/SelectableBox/tests/SelectableBoxSet.test.jsx b/src/SelectableBox/tests/SelectableBoxSet.test.jsx
index 934220403b3..e010d69d69b 100644
--- a/src/SelectableBox/tests/SelectableBoxSet.test.jsx
+++ b/src/SelectableBox/tests/SelectableBoxSet.test.jsx
@@ -68,10 +68,13 @@ describe('
', () => {
expect(screen.getByTestId('checkbox-set')).toBeInTheDocument();
});
it('renders with radio type if neither checkbox nor radio is passed', () => {
+ // eslint-disable-next-line no-console
const originalError = console.error;
+ // eslint-disable-next-line no-console
console.error = jest.fn();
render(
);
expect(screen.getByTestId('radio-set')).toBeInTheDocument();
+ // eslint-disable-next-line no-console
console.error = originalError;
});
it('renders with radio type', () => {