From 2616b822fac369166f0c5292e112a47e93725789 Mon Sep 17 00:00:00 2001 From: Anveshreddy mekala <anv11827@esri.com> Date: Mon, 31 Jul 2023 13:01:01 -0500 Subject: [PATCH] feat(switch): updates focus outline to be rounded (#7390) **Related Issue:** #4633 ## Summary This PR will replace the block focus outline of `calcite-switch` with a rounded one. Before the change:  After the change:  --- .../src/components/switch/switch.scss | 4 ++++ .../src/components/switch/switch.stories.ts | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/packages/calcite-components/src/components/switch/switch.scss b/packages/calcite-components/src/components/switch/switch.scss index a45fe50433b..cd3a2c843a9 100644 --- a/packages/calcite-components/src/components/switch/switch.scss +++ b/packages/calcite-components/src/components/switch/switch.scss @@ -52,6 +52,10 @@ @apply focus-base w-auto; } +.container { + @apply rounded-full; +} + .track { @apply bg-foreground-2 border-color-2 diff --git a/packages/calcite-components/src/components/switch/switch.stories.ts b/packages/calcite-components/src/components/switch/switch.stories.ts index ec993a493de..0fbbe3843e5 100644 --- a/packages/calcite-components/src/components/switch/switch.stories.ts +++ b/packages/calcite-components/src/components/switch/switch.stories.ts @@ -35,3 +35,20 @@ export const darkModeRTL_TestOnly = (): string => html` darkModeRTL_TestOnly.parameters = { modes: modesDarkDefault }; export const disabled_TestOnly = (): string => html`<calcite-switch disabled checked></calcite-switch>`; + +export const Focus_TestOnly = (): string => + html` + <div style="width:300px;height:300px; padding: 20px"> + <calcite-switch> </calcite-switch> + </div> + <script> + (async () => { + await customElements.whenDefined("calcite-switch"); + await document.querySelector("calcite-switch").setFocus(); + })(); + </script> + `; + +Focus_TestOnly.parameters = { + chromatic: { delay: 1000 }, +};