Skip to content

Commit 9dc27fe

Browse files
authored
fix(Card): set border radius to large (#558)
1 parent 4cb5839 commit 9dc27fe

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

.changeset/shiny-eagles-hang.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cube-dev/ui-kit': patch
3+
---
4+
5+
Update border radius size for Card and CopySnippet components.

src/components/content/Card/Card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const CardElement = tasty({
1414
styles: {
1515
display: 'block',
1616
flow: 'column',
17-
radius: '1r',
17+
radius: '(@large-radius + 1bw)',
1818
fill: '#white',
1919
border: true,
2020
padding: '1.5x',

src/components/content/CopySnippet/CopySnippet.tsx

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ const CopySnippetElement = tasty(Card, {
7373
styles: {
7474
display: 'block',
7575
fill: '#grey-light',
76-
radius: '1r',
76+
radius: '@large-radius',
7777
border: 0,
7878
padding: 0,
7979

@@ -82,7 +82,7 @@ const CopySnippetElement = tasty(Card, {
8282
flow: 'row',
8383
gridColumns: 'minmax(0, 1fr) auto',
8484
width: 'min 20x',
85-
radius: '1r',
85+
radius: '@large-radius',
8686
position: 'relative',
8787
overflow: 'hidden',
8888
},
@@ -151,6 +151,10 @@ export interface CubeCopySnippetProps extends CubeCardProps {
151151
// const HIDDEN_SYMBOL = '●';
152152
const HIDDEN_SYMBOL = '•';
153153

154+
function replaceSymbolsToHidden(str: string) {
155+
return HIDDEN_SYMBOL.repeat(str.length);
156+
}
157+
154158
function CopySnippet(allProps: CubeCopySnippetProps) {
155159
const {
156160
code = '',
@@ -190,29 +194,17 @@ function CopySnippet(allProps: CubeCopySnippetProps) {
190194

191195
if (!showHidden) {
192196
if (hideText === true) {
193-
formattedCode = formattedCode
194-
.split('')
195-
.map((s) => HIDDEN_SYMBOL)
196-
.join('')
197-
.trim();
197+
formattedCode = replaceSymbolsToHidden(formattedCode);
198198
} else if (typeof hideText === 'string') {
199199
formattedCode = formattedCode.replaceAll(
200200
hideText,
201-
hideText
202-
.split('')
203-
.map((s) => HIDDEN_SYMBOL)
204-
.join('')
205-
.trim(),
201+
replaceSymbolsToHidden(hideText),
206202
);
207203
} else if (Array.isArray(hideText)) {
208204
hideText.forEach((text) => {
209205
formattedCode = formattedCode.replaceAll(
210206
text,
211-
text
212-
.split('')
213-
.map((s) => HIDDEN_SYMBOL)
214-
.join('')
215-
.trim(),
207+
replaceSymbolsToHidden(text),
216208
);
217209
});
218210
}

0 commit comments

Comments
 (0)