Skip to content

Commit

Permalink
fixing focus ring on action buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
zamoore committed Dec 24, 2024
1 parent caf29a1 commit 904ef46
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Hds::CodeEditor::Button
<Hds::Button
class={{this.className}}
aria-pressed={{@isFullScreen}}
@isIconOnly={{true}}
@color="secondary"
@size="small"
@icon={{this.icon}}
@text="Toggle full screen view"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@
display: flex;
gap: 8px;
align-items: center;

.hds-button {
outline-offset: 0;
}
}

.hds-code-editor__editor {
Expand Down
3 changes: 0 additions & 3 deletions packages/components/src/template-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import type HdsCardContainerComponent from './components/hds/card/container.ts';
import type HdsCodeEditorComponent from './components/hds/code-editor/index.ts';
import type HdsCodeEditorDescriptionComponent from './components/hds/code-editor/description.ts';
import type HdsCodeEditorTitleComponent from './components/hds/code-editor/title.ts';
import type HdsCodeEditorButtonComponent from './components/hds/code-editor/button.ts';
import type HdsCodeEditorFullScreenButtonComponent from './components/hds/code-editor/full-screen-button.ts';
import type HdsCodeBlockComponent from './components/hds/code-block';
import type HdsCodeBlockCopyButtonComponent from './components/hds/code-block/copy-button';
Expand Down Expand Up @@ -384,8 +383,6 @@ export default interface HdsComponentsRegistry {
'hds/code-editor/description': typeof HdsCodeEditorDescriptionComponent;
'Hds::CodeEditor::Title': typeof HdsCodeEditorTitleComponent;
'hds/code-editor/title': typeof HdsCodeEditorTitleComponent;
'Hds::CodeEditor::Button': typeof HdsCodeEditorButtonComponent;
'hds/code-editor/button': typeof HdsCodeEditorButtonComponent;
'Hds::CodeEditor::FullScreenButton': typeof HdsCodeEditorFullScreenButtonComponent;
'hds/code-editor/full-screen-button': typeof HdsCodeEditorFullScreenButtonComponent;

Expand Down
6 changes: 3 additions & 3 deletions showcase/app/templates/components/code-editor.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<Shw::Grid @columns={{2}} @gap="2rem" as |SG|>
<SG.Item @label="With custom header content">
<Hds::CodeEditor>
<Hds::Button @text="Custom button" />
<Hds::Button @text="Custom button" @size="small" />
</Hds::CodeEditor>
</SG.Item>
</Shw::Grid>
Expand All @@ -74,15 +74,15 @@
<Hds::CodeEditor as |CE|>
<CE.Title>Code editor with title</CE.Title>
<CE.Description>This is a code editor with a description</CE.Description>
<Hds::Button @text="Custom button" />
<Hds::Button @text="Custom button" @size="small" />
<Hds::Icon @name="code" @color="#fff" />
</Hds::CodeEditor>
</SG.Item>
<SG.Item @label="With title, description, internal actions, and custom content">
<Hds::CodeEditor @hasFullScreenButton={{true}} @hasCopyButton={{true}} as |CE|>
<CE.Title>Code editor with title</CE.Title>
<CE.Description>This is a code editor with a description</CE.Description>
<Hds::Button @text="Custom button" />
<Hds::Button @text="Custom button" @size="small" />
<Hds::Icon @name="code" @color="#fff" />
</Hds::CodeEditor>
</SG.Item>
Expand Down

0 comments on commit 904ef46

Please sign in to comment.