Skip to content

Commit 3f1a6fa

Browse files
author
mrmrs
committed
Changes a variety of visual styles in sidebar
- Cleaner alignment - Additional spacing in subnav with new interaction styles
1 parent 85152c5 commit 3f1a6fa

File tree

11 files changed

+42
-44
lines changed

11 files changed

+42
-44
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,12 @@ export const Editor = ({
216216
hideResponsiveControls={hideResponsiveControls}
217217
>
218218
{showRegenerate && (
219-
<div sx={{ display: 'flex' }}>
219+
<div sx={{ ml: 'auto', display: 'flex' }}>
220220
<IconButton
221221
onClick={() => onChange(regenerateAll())}
222-
sx={{ ml: 'auto', display: 'flex', gap: 2 }}
222+
sx={{ ml: 'auto', }}
223223
>
224-
Regenerate <RefreshCw size={14} />
224+
<RefreshCw size={15} />
225225
</IconButton>
226226
</div>
227227
)}

packages/gui/src/components/FieldArray.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ export default function FieldArray<T>(props: FieldArrayProps<T>) {
4444
<div
4545
key={i}
4646
sx={{
47-
display: 'grid',
48-
gridTemplateColumns: '1fr max-content',
49-
gap: 1,
5047
my: 1,
5148
backgroundColor:
5249
i === dragIndex ? 'backgroundOffset' : 'transparent',
@@ -91,7 +88,7 @@ export default function FieldArray<T>(props: FieldArrayProps<T>) {
9188
m: 0,
9289
border: '1px solid',
9390
borderColor: 'border',
94-
borderRadius: '0.5rem',
91+
borderRadius: '6px',
9592
background: 'none',
9693
cursor: 'pointer',
9794
color: 'text',

packages/gui/src/components/Layers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default function Layers<T>(props: LayersProps<T>) {
5454
sx={{
5555
border: '1px solid',
5656
borderColor: 'border',
57-
borderRadius: 8,
57+
borderRadius: '6px',
5858
}}
5959
>
6060
<Accordion.Root

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,24 @@ const TABS_TRIGGER_STYLES: any = {
1414
cursor: 'pointer',
1515
fontSize: 0,
1616
fontWeight: 500,
17-
px: 2,
17+
px: 3,
1818
py: 1,
19+
my: 2,
20+
borderRadius: '6px',
1921
color: 'muted',
2022
display: 'inline-flex',
2123
gap: '.5em',
2224
alignItems: 'center',
25+
filter: 'grayscale(100%)',
26+
transition: 'all .2s ease-in-out',
2327
'&[data-state="active"]': {
2428
color: 'text',
29+
filter: 'grayscale(0%)',
30+
bg: 'backgroundOffset',
31+
},
32+
':hover': {
33+
color: 'text',
34+
filter: 'grayscale(0%)',
2535
},
2636
}
2737
const TABS_CONTENT_STYLES: any = {
@@ -79,12 +89,13 @@ export function HtmlEditor() {
7989
borderColor: 'border',
8090
display: 'flex',
8191
alignItems: 'center',
92+
justifyContent: 'space-between',
8293
flexWrap: 'nowrap',
8394
overflowX: 'auto',
8495
}}
8596
>
8697
<Tabs.Trigger sx={TABS_TRIGGER_STYLES} value="node">
87-
🎨 Styles
98+
<span>🎨</span> Styles
8899
</Tabs.Trigger>
89100
<Tabs.Trigger sx={TABS_TRIGGER_STYLES} value="tree">
90101
<Layers size={12} /> Layers

packages/gui/src/components/inputs/Dimension/Input.tsx

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { EditorPropsWithLabel } from '../../../types/editor'
44
import { UnitConversions } from '../../../lib/convert'
55
import { convertUnits } from '../../../lib/convert'
66
import { X } from 'react-feather'
7+
import IconButton from '../../ui/IconButton'
78

89
// Mapping of units to [min, max] tuple
910
type UnitRanges = Record<string, [min: number, max: number]>
@@ -85,25 +86,10 @@ interface DeleteProps {
8586
}
8687
export const DeletePropButton = ({ onRemove }: DeleteProps) => {
8788
return (
88-
<button
89-
sx={{
90-
cursor: 'pointer',
91-
appearance: 'none',
92-
display: 'flex',
93-
alignItems: 'center',
94-
justifyContent: 'right',
95-
p: 0,
96-
bg: 'rgba(0,0,0,0)',
97-
border: 0,
98-
color: 'muted',
99-
transition: '.2s color ease-in-out',
100-
':hover': {
101-
color: 'text',
102-
},
103-
}}
89+
<IconButton
10490
onClick={() => onRemove()}
10591
>
106-
<X size={14} strokeWidth={3} color="currentColor" />
107-
</button>
92+
<X size={16} strokeWidth={3} color="currentColor" />
93+
</IconButton>
10894
)
10995
}

packages/gui/src/components/inputs/SchemaInput.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export function SchemaInput<T>({
5656
<Collapsible.Trigger asChild>
5757
<IconButton
5858
sx={{
59+
mr: 2,
5960
transform: 'rotate(0deg)',
6061
transition: 'transform 250ms',
6162
'&[data-state=closed]': {
@@ -69,7 +70,7 @@ export function SchemaInput<T>({
6970
)}
7071
{InlineInput && (
7172
<InlineInput
72-
label=""
73+
label=''
7374
value={value}
7475
onChange={onChange}
7576
ruleset={ruleset}

packages/gui/src/components/schemas/object.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ export function objectSchema<T extends object>({
5959
sx={{
6060
display: 'grid',
6161
gap: 2,
62-
borderLeft: '4px solid',
62+
borderLeft: '1px solid',
6363
borderColor: 'border',
6464
pl: 2,
65+
my: 2,
6566
}}
6667
>
6768
{keyOrder.map((key) => {

packages/gui/src/components/schemas/primitives.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export function keyword<T extends string>(
251251
function literal<T extends string>(value: T): DataTypeSchema<T> {
252252
return {
253253
type: value,
254-
inlineInput: () => <div sx={{ fontSize: 1 }}>{value}</div>,
254+
inlineInput: () => <pre sx={{ fontSize: 0 }}>{value}</pre>,
255255
stringify: (value) => value,
256256
defaultValue: value,
257257
regenerate: () => value,

packages/gui/src/components/schemas/responsive.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export function responsive<T>(
1010
type: 'responsive',
1111
inlineInput({ value }) {
1212
return (
13-
<div sx={{ fontSize: 1 }}>
13+
<pre sx={{ fontSize: 0 }}>
1414
{value.values.map((item) => itemSchema.stringify(item)).join(', ')}
15-
</div>
15+
</pre>
1616
)
1717
},
1818
input({ value, onChange }) {

packages/gui/src/components/ui/IconButton.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ export default function IconButton(props: Props) {
66
return (
77
<button
88
sx={{
9-
p: 0,
9+
p: 1,
1010
m: 0,
1111
appearance: 'none',
1212
WebkitAppearance: 'none',
13-
background: 'none',
13+
background: 'backgroundOffset',
1414
border: 'none',
15+
borderRadius: '6px',
1516
cursor: 'pointer',
1617
color: 'muted',
1718
display: 'flex',

0 commit comments

Comments
 (0)