Skip to content

Commit 26726f3

Browse files
author
mrmrs
committed
Changes visual styles for larger tap targets and more consistency
1 parent a3bd06b commit 26726f3

File tree

5 files changed

+56
-22
lines changed

5 files changed

+56
-22
lines changed

packages/gui/src/components/Editor/Controls.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,13 @@ const FieldsetControl = ({ field }: FieldsetControlProps) => {
338338
display: 'flex',
339339
alignItems: 'center',
340340
justifyContent: 'space-between',
341+
mt: 3,
341342
mb: 2,
342343
}}
343344
>
344345
<h3
345346
sx={{
347+
mt: 0,
346348
fontSize: 1,
347349
lineHeight: 1,
348350
mb: 0,
@@ -353,7 +355,7 @@ const FieldsetControl = ({ field }: FieldsetControlProps) => {
353355
<FieldsetDropdown onRemove={() => removeField(field)} />
354356
</div>
355357
<GenericFieldset field={field}>
356-
<div sx={{ pb: 3 }}>
358+
<div sx={{ mb: 3, p: 3, borderWidth: '1px', borderStyle: 'solid', borderColor: 'border', borderRadius: '6px', }}>
357359
<AddPropertyControl
358360
field={field}
359361
styles={styles}

packages/gui/src/components/html/Component/Editor.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ComponentData, Slot } from '../types'
77
import { useHtmlEditor } from '../Provider'
88
import { getSlots, isSlot } from '../../../lib/codegen/util'
99
import { mergeComponentAttributes } from './util'
10+
import IconButton from '../../ui/IconButton'
1011

1112
interface ComponentEditorProps {
1213
value: ComponentData
@@ -109,11 +110,13 @@ export const ComponentEditor = ({ value, onChange }: ComponentEditorProps) => {
109110
items={componentIds}
110111
/>
111112
{value.swappableComponentIds?.length ? (
112-
<RefreshCw
113-
size={12}
114-
onClick={handleSwap}
115-
sx={{ color: 'muted', ml: 2 }}
116-
/>
113+
<IconButton onClick={handleSwap}>
114+
<RefreshCw
115+
size={15}
116+
strokeWidth={2}
117+
sx={{ color: 'muted', ml: 2 }}
118+
/>
119+
</IconButton>
117120
) : null}
118121
</span>
119122
</div>

packages/gui/src/components/html/Editors/NodeEditor.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ export function NodeEditor({
4343
<div
4444
sx={{
4545
bg: 'background',
46-
height: '240px',
46+
minHeight: '4px',
47+
height: 'auto',
4748
resize: 'vertical',
4849
position: 'sticky',
4950
top: 0,

packages/gui/src/components/ui/dropdowns/FieldsetDropdown.tsx

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,29 @@ export const FieldsetDropdown = ({ onRemove }: FieldsetDropdownProps) => {
1010
<DropdownMenu.Root>
1111
<DropdownMenu.Trigger
1212
sx={{
13-
all: 'unset',
13+
p: 1,
14+
mr: 0,
15+
appearance: 'none',
16+
WebkitAppearance: 'none',
17+
background: 'backgroundOffset',
18+
border: 'none',
19+
borderRadius: '6px',
1420
cursor: 'pointer',
15-
px: 3,
16-
lineHeight: 1,
17-
position: 'relative',
18-
top: '1px',
1921
color: 'muted',
22+
display: 'flex',
23+
alignItems: 'center',
24+
justifyContent: 'center',
25+
transition: 'color .2s ease-in-out',
26+
':hover': {
27+
color: 'text',
28+
},
29+
':disabled': {
30+
opacity: '50%',
31+
cursor: 'initial',
32+
},
2033
}}
2134
>
22-
<MoreVertical size={12} />
35+
<MoreVertical size={15} strokeWidth={2} />
2336
</DropdownMenu.Trigger>
2437
<DropdownMenu.Content sx={DROPDOWN_STYLES}>
2538
<DropdownMenu.Item sx={DROPDOWN_ITEM_STYLES} onClick={onRemove}>

packages/gui/src/components/ui/dropdowns/NodeEditorDropdown.tsx

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as DropdownMenu from '@radix-ui/react-dropdown-menu'
22
import { Copy, Plus, MoreVertical, Trash } from 'react-feather'
33
import { DROPDOWN_ITEM_STYLES, DROPDOWN_STYLES } from './styles'
4+
import IconButton from '../IconButton'
45

56
type NodeEditorDropdownProps = {
67
onRemove(): void
@@ -15,16 +16,30 @@ export const NodeEditorDropdown = ({
1516
return (
1617
<DropdownMenu.Root>
1718
<DropdownMenu.Trigger
18-
sx={{
19-
all: 'unset',
20-
px: 3,
21-
lineHeight: 1,
22-
position: 'relative',
23-
top: '1px',
24-
color: 'muted',
25-
}}
19+
sx={{
20+
p: 1,
21+
mr: 2,
22+
appearance: 'none',
23+
WebkitAppearance: 'none',
24+
background: 'backgroundOffset',
25+
border: 'none',
26+
borderRadius: '6px',
27+
cursor: 'pointer',
28+
color: 'muted',
29+
display: 'flex',
30+
alignItems: 'center',
31+
justifyContent: 'center',
32+
transition: 'color .2s ease-in-out',
33+
':hover': {
34+
color: 'text',
35+
},
36+
':disabled': {
37+
opacity: '50%',
38+
cursor: 'initial',
39+
},
40+
}}
2641
>
27-
<MoreVertical size={12} />
42+
<MoreVertical size={15} />
2843
</DropdownMenu.Trigger>
2944
<DropdownMenu.Content sx={DROPDOWN_STYLES}>
3045
<DropdownMenu.Item sx={DROPDOWN_ITEM_STYLES} onClick={onDuplicate}>

0 commit comments

Comments
 (0)