Skip to content

Commit 927897d

Browse files
authored
fix(ResizablePanel): thinner resizable handler (#670)
1 parent ab6ac5e commit 927897d

File tree

4 files changed

+27
-16
lines changed

4 files changed

+27
-16
lines changed

.changeset/modern-teachers-bathe.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+
Thinner resizable panel handler.

.changeset/tidy-steaks-occur.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 issue in Panel component when style property could be applied to both outer and inner containers.

src/components/layout/Panel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ function Panel(props: CubePanelProps, ref: ForwardedRef<HTMLDivElement>) {
135135
...COLOR_STYLES,
136136
...DIMENSION_STYLES,
137137
].forEach((style) => {
138-
if (style in props) {
139-
styles = { ...styles, [style]: props[style] };
138+
if (style in otherProps) {
139+
styles = { ...styles, [style]: otherProps[style] };
140140

141141
delete otherProps[style];
142142
}

src/components/layout/ResizablePanel.tsx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,40 +75,41 @@ const HandlerElement = tasty({
7575
horizontal: 'col-resize',
7676
disabled: 'not-allowed',
7777
},
78-
fill: {
79-
'': '#clear',
80-
drag: '#purple-02',
81-
},
8278
padding: 0,
8379
boxSizing: 'border-box',
8480
transition: 'theme',
8581
'--size-compensation': {
86-
'': '7px',
82+
'': '6px',
8783
disabled: '1bw',
8884
},
8985

9086
Track: {
9187
width: {
9288
'': 'initial',
93-
horizontal: '5px',
89+
horizontal: '3px',
9490
'disabled & horizontal': '1px',
9591
},
9692
height: {
97-
'': '5px',
93+
'': '3px',
9894
horizontal: 'initial',
9995
'disabled & !horizontal': '1px',
10096
},
10197
position: 'absolute',
10298
inset: {
103-
'': '2px 0',
104-
horizontal: '0 2px',
99+
'': '3px 0',
100+
horizontal: '0 3px',
105101
disabled: '0 0',
106102
},
107103
fill: {
108104
'': '#border-opaque',
109105
'(hovered | drag) & !disabled': '#purple-03',
110106
},
111107
transition: 'theme',
108+
outline: {
109+
'': '1bw #purple-text.0',
110+
drag: '1bw #purple-text',
111+
},
112+
outlineOffset: 1,
112113
},
113114

114115
Drag: {
@@ -128,15 +129,15 @@ const HandlerElement = tasty({
128129
},
129130
width: {
130131
'': 'auto',
131-
horizontal: '3px',
132+
horizontal: '1px',
132133
},
133134
height: {
134-
'': '3px',
135+
'': '1px',
135136
horizontal: 'auto',
136137
},
137138
inset: {
138-
'': '3px 50% auto auto',
139-
horizontal: '50% 3px auto auto',
139+
'': '4px 50% auto auto',
140+
horizontal: '50% 4px auto auto',
140141
},
141142
transform: {
142143
'': 'translate(-50%, 0)',
@@ -211,7 +212,7 @@ const StyledPanel = tasty(Panel, {
211212
touchAction: 'none',
212213

213214
'--indent-compensation': {
214-
'': '5px',
215+
'': '3px',
215216
disabled: '1bw',
216217
},
217218
},

0 commit comments

Comments
 (0)