Skip to content

Commit 3b11468

Browse files
committed
fix: issue with code docs
1 parent e947d5e commit 3b11468

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

showcases/patternhub/components/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ const VariantList = ({ examples, slotCode }: DefaultComponentVariants) => {
3030
<summary
3131
className="db-button code-button"
3232
data-size="small"
33-
data-variant="solid">
33+
data-variant="filled">
3434
{open ? 'Hide code' : 'Show code'}
3535
</summary>
36-
<div className="db-ui-functional">
36+
<div className="db-density-functional">
3737
<div className="backdrop" />
3838
<DBCard className="code" spacing="small">
3939
{slotCode}

showcases/patternhub/scripts/get-code-files.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ const getExamplesAsMDX = async (componentName, variant) => {
3737
'DBTabs\n' +
3838
"} from '../../../../../../output/react/src';\n" +
3939
`const ${variant.name} = () => {
40-
const [copied, setCopied] = useState<boolean>();
40+
const [copied, setCopied] = useState<string>();
4141
4242
useEffect(() => {
4343
if (copied) {
44-
setTimeout(() => setCopied(false), 1500);
44+
setTimeout(() => setCopied(""), 1500);
4545
}
4646
}, [copied]);
4747
return (
@@ -95,10 +95,10 @@ const getExamplesAsMDX = async (componentName, variant) => {
9595
<DBButton
9696
className="copy-button"
9797
noText
98-
icon={copied ? 'done' : 'copy'}
99-
variant="text"
98+
icon={copied === \`${exampleCode}\` ? 'done' : 'copy'}
99+
variant="ghost"
100100
onClick={()=>{
101-
setCopied(true);
101+
setCopied(\`${exampleCode}\`);
102102
navigator.clipboard.writeText(\`${exampleCode}\`);
103103
}}>
104104
Copy

showcases/patternhub/styles/globals.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ h6 {
392392
}
393393

394394
.backdrop {
395-
border-radius: variables.$db-border-radius-lg;
395+
border-radius: variables.$db-border-radius-sm;
396396
@extend %backdrop;
397397
position: absolute;
398398
inset: 0;

showcases/patternhub/styles/highlight.scss

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
@use "@db-ui/foundations/build/scss/colors";
33

44
pre:has(.hljs):not(:has(.language-shell)) {
5-
@extend %db-bg-neutral-transparent-full;
5+
@extend %db-neutral-bg-transparent-full;
66

77
.hljs {
8-
@extend %db-bg-neutral-transparent-full;
8+
@extend %db-neutral-bg-transparent-full;
99
}
1010
}
1111

@@ -17,15 +17,15 @@ pre:has(.hljs):not(:has(.language-shell)) {
1717
.hljs-type,
1818
.hljs-variable.language_ {
1919
/* prettylights-syntax-keyword */
20-
color: colors.$db-successful-text;
20+
color: colors.$db-successful-on-bg-weak-enabled;
2121
}
2222

2323
.hljs-title,
2424
.hljs-title.class_,
2525
.hljs-title.class_.inherited__,
2626
.hljs-title.function_ {
2727
/* prettylights-syntax-entity */
28-
color: colors.$db-successful-text;
28+
color: colors.$db-successful-on-bg-weak-enabled;
2929
}
3030
.hljs-attribute,
3131
.hljs-literal,
@@ -36,73 +36,73 @@ pre:has(.hljs):not(:has(.language-shell)) {
3636
.hljs-selector-class,
3737
.hljs-selector-id {
3838
/* prettylights-syntax-constant */
39-
color: colors.$db-successful-text;
39+
color: colors.$db-successful-on-bg-weak-enabled;
4040
}
4141
.hljs-regexp,
4242
.hljs-string,
4343
.hljs-meta .hljs-string {
4444
/* prettylights-syntax-string */
45-
color: colors.$db-successful-text;
45+
color: colors.$db-successful-on-bg-weak-enabled;
4646
}
4747
.hljs-built_in,
4848
.hljs-symbol {
4949
/* prettylights-syntax-variable */
50-
color: colors.$db-warning-text;
50+
color: colors.$db-warning-on-bg-weak-enabled;
5151
}
5252
.hljs-attr {
53-
color: colors.$db-informational-text;
53+
color: colors.$db-informational-on-bg-weak-enabled;
5454
}
5555
.hljs-meta,
5656
.hljs-comment,
5757
.hljs-code,
5858
.hljs-formula {
5959
/* prettylights-syntax-comment */
60-
color: colors.$db-current-color;
60+
color: colors.$db-current-color-enabled;
6161
}
6262

6363
.hljs-tag,
6464
.hljs-name {
65-
color: colors.$db-warning-text;
65+
color: colors.$db-warning-on-bg-weak-enabled;
6666
}
6767

6868
.hljs-quote,
6969
.hljs-selector-tag,
7070
.hljs-selector-pseudo {
7171
/* prettylights-syntax-entity-tag */
72-
color: colors.$db-successful-text;
72+
color: colors.$db-successful-on-bg-weak-enabled;
7373
}
7474
.hljs-subst {
7575
/* prettylights-syntax-storage-modifier-import */
76-
color: colors.$db-neutral-bg;
76+
color: colors.$db-neutral-bg-lvl-1-enabled;
7777
}
7878
.hljs-section {
7979
/* prettylights-syntax-markup-heading */
80-
color: colors.$db-informational-text;
80+
color: colors.$db-informational-on-bg-weak-enabled;
8181
font-weight: bold;
8282
}
8383
.hljs-bullet {
8484
/* prettylights-syntax-markup-list */
85-
color: colors.$db-warning-text;
85+
color: colors.$db-warning-on-bg-weak-enabled;
8686
}
8787
.hljs-emphasis {
8888
/* prettylights-syntax-markup-italic */
89-
color: colors.$db-current-color;
89+
color: colors.$db-current-color-enabled;
9090
font-style: italic;
9191
}
9292
.hljs-strong {
9393
/* prettylights-syntax-markup-bold */
94-
color: colors.$db-current-color;
94+
color: colors.$db-current-color-enabled;
9595
font-weight: bold;
9696
}
9797
.hljs-addition {
9898
/* prettylights-syntax-markup-inserted */
99-
color: colors.$db-successful-text;
100-
background-color: colors.$db-neutral-text;
99+
color: colors.$db-successful-on-bg-weak-enabled;
100+
background-color: colors.$db-neutral-on-bg-weak-enabled;
101101
}
102102
.hljs-deletion {
103103
/* prettylights-syntax-markup-deleted */
104-
color: colors.$db-critical-text;
105-
background-color: colors.$db-neutral-text;
104+
color: colors.$db-critical-on-bg-weak-enabled;
105+
background-color: colors.$db-neutral-on-bg-weak-enabled;
106106
}
107107
.hljs-char.escape_,
108108
.hljs-link,

0 commit comments

Comments
 (0)