Skip to content

Commit

Permalink
chore(kcodeblock): merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
Justineo committed Jan 16, 2025
2 parents 339f040 + 084dc80 commit 5a061a6
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 28 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## [9.16.4](https://github.com/Kong/kongponents/compare/v9.16.3...v9.16.4) (2025-01-16)


### Bug Fixes

* **ktabs:** add data-testid to list items ([#2574](https://github.com/Kong/kongponents/issues/2574)) ([bf80d75](https://github.com/Kong/kongponents/commit/bf80d7586493b53075f0ac43f07ef10eb1bd3c8c))

## [9.16.3](https://github.com/Kong/kongponents/compare/v9.16.2...v9.16.3) (2025-01-15)


### Bug Fixes

* **kalert:** kbutton text color within kalerts [KHCP-14565] ([#2571](https://github.com/Kong/kongponents/issues/2571)) ([195ce77](https://github.com/Kong/kongponents/commit/195ce7759fe94e7b36b78fdc7eb3a52805c9ee5f))

## [9.16.2](https://github.com/Kong/kongponents/compare/v9.16.1...v9.16.2) (2025-01-15)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kong/kongponents",
"version": "9.16.2",
"version": "9.16.4",
"description": "Kong Component library",
"type": "module",
"repository": {
Expand Down
8 changes: 5 additions & 3 deletions src/components/KAlert/KAlert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,12 @@ const getAlertIcon = computed((): AlertIcon => {
.alert-message {
:slotted(a),
:deep(a) {
color: $textColor;
&:not([type='button']) {
color: $textColor;
&:hover {
color: $hoverColor;
&:hover {
color: $hoverColor;
}
}
}
Expand Down
67 changes: 43 additions & 24 deletions src/components/KCodeBlock/KCodeBlock.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,21 +148,23 @@
-->
<div
v-if="showCopyButton || slots['secondary-actions']"
class="code-block-secondary-actions"
class="secondary-actions-wrapper"
>
<KCodeBlockIconButton
v-if="showCopyButton"
:aria-label="`Copy (${ALT_SHORTCUT_LABEL}+C)`"
class="code-block-copy-button"
:copy-tooltip="`Copy (${ALT_SHORTCUT_LABEL}+C)`"
data-testid="code-block-copy-button"
:theme="theme"
@click="copyCode"
>
<CopyIcon decorative />
</KCodeBlockIconButton>
<div class="code-block-secondary-actions">
<KCodeBlockIconButton
v-if="showCopyButton"
:aria-label="`Copy (${ALT_SHORTCUT_LABEL}+C)`"
class="code-block-copy-button"
:copy-tooltip="`Copy (${ALT_SHORTCUT_LABEL}+C)`"
data-testid="code-block-copy-button"
:theme="theme"
@click="copyCode"
>
<CopyIcon decorative />
</KCodeBlockIconButton>

<slot name="secondary-actions" />
<slot name="secondary-actions" />
</div>
</div>

<!--
Expand Down Expand Up @@ -864,6 +866,34 @@ $kCodeBlockDarkLineMatchBackgroundColor: rgba(255, 255, 255, 0.12); // we don't
padding: var(--kui-space-40, $kui-space-40);
position: relative;
@media (min-width: $kui-breakpoint-laptop) {
.secondary-actions-wrapper {
opacity: 0;
transition: opacity $kongponentsTransitionDurTimingFunc, border $kongponentsTransitionDurTimingFunc;
}
.secondary-actions-wrapper:focus-within,
&:hover .secondary-actions-wrapper {
opacity: 1;
}
}
.secondary-actions-wrapper {
height: 100%;
position: sticky;
right: 0px;
top: 0px;
z-index: 2;
.code-block-secondary-actions {
display: flex;
gap: var(--kui-space-40, $kui-space-40);
position: absolute;
right: 0;
top: 0;
}
}
pre {
display: grid;
margin: var(--kui-space-0, $kui-space-0);
Expand Down Expand Up @@ -945,17 +975,6 @@ $kCodeBlockDarkLineMatchBackgroundColor: rgba(255, 255, 255, 0.12); // we don't
}
}
}
.code-block-secondary-actions {
display: flex;
gap: var(--kui-space-40, $kui-space-40);
margin-right: var(--kui-space-40, $kui-space-40);
margin-top: var(--kui-space-40, $kui-space-40);
position: absolute;
right: 0;
top: 0;
z-index: 1;
}
}
&.theme-dark {
Expand Down
1 change: 1 addition & 0 deletions src/components/KTabs/KTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
:key="tab.hash"
class="tab-item"
:class="{ active: activeTab === tab.hash }"
:data-testid="`${tab.hash.replace('#','')}-tab`"
>
<component
:is="tabComponent(tab).tag"
Expand Down

0 comments on commit 5a061a6

Please sign in to comment.