Skip to content

Commit ac9100a

Browse files
authored
fix(CopySnippet): border radius in action buttons (#635)
1 parent b4df4a5 commit ac9100a

File tree

7 files changed

+47
-18
lines changed

7 files changed

+47
-18
lines changed

.changeset/dry-donuts-prove.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+
Fix outline styles after migration in various components.

.changeset/pink-frogs-raise.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+
Fix border radius in Action buttons in CopySnippet.

src/components/content/CopyPasteBlock/CopyPasteBlock.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,16 @@ const CopyButton = tasty(Button, {
9898
styles: {
9999
placeSelf: 'stretch',
100100
border: '#clear',
101-
outline: {
102-
'': '#purple-03.0',
103-
'focused & focus-visible': '#purple-03 inset',
101+
shadow: {
102+
'': '0 0 0 1ow #purple-03.0 inset',
103+
focused: '0 0 0 1ow #purple-03 inset',
104104
},
105105
radius: {
106106
'': '0 1r 1r 0',
107107
'multiline | with-scroll': '0 1r 0 0',
108108
},
109109
height: 'auto',
110+
outline: false,
110111
},
111112
});
112113

src/components/content/CopySnippet/CopySnippet.tsx

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,19 @@ const ButtonContainer = tasty({
6969
multiline: '4x',
7070
},
7171

72-
'@button-radius': {
72+
'@first-button-radius': {
73+
'': '0 1r 1r 0',
74+
multiline: '0 1r 0 0',
75+
},
76+
77+
'@last-button-radius': {
7378
'': '0',
74-
multiline: '1r',
79+
multiline: '0 0 0 1r',
80+
},
81+
82+
'@first-and-last-button-radius': {
83+
'': '0 1r 1r 0',
84+
multiline: '0 1r 0 1r',
7585
},
7686

7787
// Make sure there's a small gap between buttons and the content
@@ -110,16 +120,17 @@ const ActionButton = tasty(Button, {
110120
padding: 0,
111121
placeSelf: 'stretch',
112122
border: '#clear',
113-
outline: {
114-
'': '#purple-03.0',
115-
'focused & focus-visible': '#purple-03 inset',
123+
shadow: {
124+
'': 'inset 0 0 0 1ow #purple-03.0',
125+
focused: 'inset 0 0 0 1ow #purple-03',
116126
},
127+
outline: false,
117128
height: '@button-size',
118129
radius: {
119-
'': '0',
120-
':last-child': '0 0 0 @button-radius',
121-
':first-child': '0 @button-radius 0 0',
122-
':last-child & :first-child': '0 @button-radius 0 @button-radius',
130+
'': 0,
131+
':last-child': '@last-button-radius',
132+
':first-child': '@first-button-radius',
133+
':first-child & :last-child': '@first-and-last-button-radius',
123134
},
124135
},
125136
});

src/components/organisms/FileTabs/FileTabs.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,6 @@ const TabElement = tasty(Action, {
108108
fontWeight: 500,
109109
opacity: 1,
110110
preset: 'default',
111-
shadow: {
112-
'': 'inset 0 0 0 1ow #purple-03.0',
113-
'focused & focus-visible': 'inset 0 0 0 1ow #purple-03',
114-
},
115111
transform: {
116112
'': 'translate(0, 0)',
117113
'[disabled]': 'translate(0, 1bw)',
@@ -150,7 +146,7 @@ const CloseButton = tasty(Button, {
150146
padding: '.25x',
151147
outline: {
152148
'': '#purple-03.0',
153-
'focused & focus-visible': '#purple-03',
149+
focused: '#purple-03',
154150
},
155151
radius: '1r',
156152
},

src/components/pickers/Menu/MenuButton.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ const StyledButton = tasty(Block, {
4646
flow: 'row',
4747
justifyContent: 'start',
4848
gap: '.75x',
49+
outline: {
50+
'': '#purple-03.0',
51+
'focused & focus-visible': '#purple-03',
52+
},
4953

5054
ButtonIcon: {
5155
display: 'grid',

src/tasty/styles/transition.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@ const MAP = {
2020
'font-style',
2121
],
2222
text: ['font-weight', 'text-decoration-color'],
23-
theme: ['color', 'background-color', 'box-shadow', 'border', 'border-radius'],
23+
theme: [
24+
'color',
25+
'background-color',
26+
'box-shadow',
27+
'border',
28+
'border-radius',
29+
'outline',
30+
],
2431
inset: ['box-shadow'],
2532
mark: ['box-shadow'],
2633
width: ['max-width', 'min-width', 'width'],

0 commit comments

Comments
 (0)