-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(kcodeblock): component reskin [KHCP-8975] #2100
Merged
portikM
merged 19 commits into
feat/reskin-phase-11
from
feat/khcp-8975-kcodeblock-reskin
Apr 9, 2024
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
8fd3318
chore(sandbox): add kcodeblock sandbox [KHCP-8975]
portikM 6b252fb
fix(kcodeblock): rename props [KHCP-8975]
portikM 6adc214
fix(kcodeblock): update selectors [KHCP-8975]
portikM f433c97
chore(deps): bump @kong/icons [KHCP-8975]
portikM f6a6d5a
fix(kcodeblock): reskin - theme light [KHCP-8975]
portikM 57bab48
fix(kcodeblock): reskin [KHCP-8975]
portikM f9cce86
fix(kcodeblock): fix filter and single line mode [KHCP-8975]
portikM b833f84
test(kcodeblock): update component tests [KHCP-8975]
portikM 396d699
fix(kcodeblock): misc fixes [KHCP-8975]
portikM f20ff97
docs(codeblock): update component docs [KHCP-8975]
portikM 198aa95
fix(kcodeblock): address PR feedback [KHCP-8975]
portikM 477e87a
fix(kcodeblock): export kcodeblockiconbutton component [KHCP-8975]
portikM 3567b4b
fix(kcodeblock): minor fix [KHCP-8975]
portikM 6c29516
fix(kcodeblock): use preview package tokens [KHCP-8975]
portikM fb02a00
fix: resolve conflicts
portikM 029cab7
fix(kcodeblock): bump tokens [KHCP-8975]
portikM 7a8cd5d
fix(kcodeblock): apply suggestions
portikM c49f3cc
fix(kcodeblock): clear query button styles [KHCP-8975]
portikM e77eb90
fix: resolve conflicts
portikM File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,219 @@ | ||
<template> | ||
<SandboxLayout | ||
:links="inject('app-links', [])" | ||
title="KCodeBlock" | ||
> | ||
<div class="kcodeblock-sandbox"> | ||
<!-- Figma --> | ||
<SandboxTitleComponent | ||
is-subtitle | ||
title="Figma" | ||
/> | ||
<KExternalLink href="https://www.figma.com/file/Yze0SWXl5nKjR0rFdilljK/Components?type=design&node-id=2020%3A11253&mode=dev&t=wfYkBJZ5Ry0OUS2m-1"> | ||
Figma | ||
</KExternalLink> | ||
|
||
<!-- Props --> | ||
<SandboxTitleComponent | ||
is-subtitle | ||
title="Props" | ||
/> | ||
<SandboxSectionComponent | ||
class="limited-width" | ||
title="code & language" | ||
> | ||
<KCodeBlock | ||
id="code-language-props" | ||
:code="code" | ||
language="json" | ||
/> | ||
</SandboxSectionComponent> | ||
<SandboxSectionComponent | ||
class="limited-width" | ||
title="initialFilterMode & initialRegExpMode & searchable" | ||
> | ||
<KCodeBlock | ||
id="filter-regex-modes-props" | ||
:code="code" | ||
initial-reg-exp-mode | ||
language="json" | ||
searchable | ||
/> | ||
</SandboxSectionComponent> | ||
<SandboxSectionComponent | ||
class="limited-width" | ||
title="singleLine" | ||
> | ||
<KCodeBlock | ||
id="single-line-prop" | ||
:code="singleLineCode" | ||
language="plaintext" | ||
single-line | ||
/> | ||
</SandboxSectionComponent> | ||
<SandboxSectionComponent | ||
class="limited-width" | ||
title="processing" | ||
> | ||
<KCodeBlock | ||
id="processing-prop" | ||
:code="code" | ||
language="json" | ||
processing | ||
searchable | ||
/> | ||
</SandboxSectionComponent> | ||
<SandboxSectionComponent | ||
class="limited-width" | ||
title="maxHeight" | ||
> | ||
<KCodeBlock | ||
id="max-height-prop" | ||
:code="code" | ||
language="json" | ||
max-height="200" | ||
searchable | ||
/> | ||
</SandboxSectionComponent> | ||
<SandboxSectionComponent | ||
class="limited-width" | ||
title="query" | ||
> | ||
<KCodeBlock | ||
id="query-prop" | ||
:code="code" | ||
language="json" | ||
max-height="200" | ||
query="compilerOptions" | ||
searchable | ||
/> | ||
</SandboxSectionComponent> | ||
<SandboxSectionComponent | ||
class="limited-width" | ||
title="showCopyButton" | ||
> | ||
<KCodeBlock | ||
id="show-copy-button-prop" | ||
:code="code" | ||
language="json" | ||
searchable | ||
:show-copy-button="false" | ||
/> | ||
</SandboxSectionComponent> | ||
<SandboxSectionComponent | ||
class="limited-width" | ||
title="showLineNumberLinks" | ||
> | ||
<KCodeBlock | ||
id="show-line-number-links-prop" | ||
:code="code" | ||
language="json" | ||
searchable | ||
show-line-number-links | ||
/> | ||
</SandboxSectionComponent> | ||
<SandboxSectionComponent | ||
class="limited-width" | ||
title="theme" | ||
> | ||
<KCodeBlock | ||
id="theme-prop" | ||
:code="code" | ||
initial-reg-exp-mode | ||
language="json" | ||
max-height="200" | ||
processing | ||
query="compilerOptions" | ||
searchable | ||
theme="dark" | ||
/> | ||
<KCodeBlock | ||
id="single-line-dark-prop" | ||
:code="singleLineCode" | ||
language="plaintext" | ||
single-line | ||
theme="dark" | ||
/> | ||
</SandboxSectionComponent> | ||
|
||
<!-- Slots --> | ||
<SandboxTitleComponent | ||
is-subtitle | ||
title="Slots" | ||
/> | ||
<SandboxSectionComponent | ||
class="limited-width" | ||
title="secondary-actions" | ||
> | ||
<KCodeBlock | ||
id="secondary-actions-slot" | ||
:code="code" | ||
language="json" | ||
> | ||
<template #secondary-actions> | ||
<KButton> | ||
Secondary Action | ||
</KButton> | ||
</template> | ||
</KCodeBlock> | ||
</SandboxSectionComponent> | ||
</div> | ||
</SandboxLayout> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { inject } from 'vue' | ||
import SandboxTitleComponent from '../components/SandboxTitleComponent.vue' | ||
import SandboxSectionComponent from '../components/SandboxSectionComponent.vue' | ||
|
||
const code = `{ | ||
"compilerOptions": { | ||
"target": "es2020", | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"allowUnreachableCode": false, | ||
"exactOptionalPropertyTypes": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitReturns": true, | ||
"noUncheckedIndexedAccess": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"strict": true, | ||
"jsx": "preserve" | ||
}, | ||
"include": [ | ||
"./src", | ||
"./types", | ||
"./particularly-long-value-that-will-inadvertently-cause-scrolling-for-narrower-containers" | ||
] | ||
}` | ||
|
||
const singleLineCode = `-----BEGIN CERTIFICATE----- | ||
MIIDlDCCAn6gAwIBAgIBATALBgkqhkiG9w0BAQ0wNDEyMAkGA1UEBhMCVVMwJQYD | ||
VQQDHh4AawBvAG4AbgBlAGMAdAAtAGQAZQBmAGEAdQBsAHQwHhcNMjMwMTAzMTg1 | ||
NDQxWhcNMzMwMTAzMTg1NDQxWjA0MTIwCQYDVQQGEwJVUzAlBgNVBAMeHgBrAG8A | ||
bgBuAGUAYwB0AC0AZABlAGYAYQB1AGwAdDCCASIwDQYJKoZIhvcNAQEBBQADggEP | ||
ADCCAQoCggEBAJ1dzsZKtwFniWQaxIEqrs2EH95fWQ4Jie+79jJL1unRJJu5oDnR | ||
5ontJZhPFSDdGZ1ZXhjQXIzaUk3BoFn7Zel7X25hzUdlKHoOTPf/KA7+isdvS89j | ||
nGoC5vHtXQmgzNFRdCjeKDOmfa/Arff7+41SNTT+DNitZun+V3diePoatotOT3tv | ||
puNqc5EjHLEGOdBwxSkO7qCvzsqOcFyBshT8AzFKU8aapErlILOIJKJIYHoAkS/A | ||
cUfm/MNNMzPBBI3p1jZKXnWCwXMWUi8jZvsALYwn8E65GE07jW2O+n9hWzC43yTu | ||
DYW0U8vcoTsdPmsZByIFDfERaxavQiEuhf0CAwEAAaOBtDCBsTASBgNVHRMBAf8E | ||
CDAGAQH/AgEDMAsGA1UdDwQEAwIABjAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYB | ||
BQUHAwIwFwYJKwYBBAGCNxQCBAoMCGNlcnRUeXBlMCMGCSsGAQQBgjcVAgQWBBQB | ||
AQEBAQEBAQEBAQEBAQEBAQEBATAcBgkrBgEEAYI3FQcEDzANBgUpAQEBAQIBCgIB | ||
FDATBgkrBgEEAYI3FQEEBgIEABQACjALBgkqhkiG9w0BAQ0DggEBABGVFc6DTlx7 | ||
SuKgT3OhQS94VyECnJjyk2eR6/MaZYvgw0Iz8nOyg7xTtj7DKl/uyHdJWwYn5R70 | ||
+YGF7GGbkk6rkRuHEVT+dhyYwO9fKzBZkLNnzdp900VSmTubx4j6WN0+gmQS0dLW | ||
uyBQdUiKvE/ZTjWHUAIYb3244VRRHBRLs3s40f2mJjBZ3Zm6XUxGtsnYudWOh4cv | ||
nYKRWqogwSBtKPYAe115DLDULxe86Cu5neYTt5/kU7VjnLxhOhguWTIrGMSV0Jle | ||
Rl1IG8evLu2zWxN3wb451/Kf5lRFLUjfjuLD8tHMlpwVIxoHct9GuKV4W14cf2Q/ | ||
cWMCwpGsAAE= | ||
-----END CERTIFICATE-----` | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.limited-width { | ||
max-width: 90%; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: Should this use a KCodeBlockIconButton? That would help verify that using it has the right styles just by looking at the sandbox.