Skip to content

Commit

Permalink
refactor: switch <AutoFieldPrivate> to <AutoField> (#98)
Browse files Browse the repository at this point in the history
AutoFieldPrivate will be removed in a future version of Puck as it was
never supposed to be exported.

![Screenshot 2024-10-21 at 5 30
34 PM](https://github.com/user-attachments/assets/3d6a3051-a420-4cf3-adf9-156cb51f5e72)
  • Loading branch information
benlife5 authored Oct 22, 2024
1 parent 2305fae commit c5e80f4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/internal/puck/components/ThemeSidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AutoFieldPrivate } from "@measured/puck";
import { AutoField, FieldLabel } from "@measured/puck";
import React from "react";
import { Alert, AlertDescription } from "../../components/atoms/Alert.tsx";
import { ThemeConfig } from "../../../utils/themeResolver.ts";
Expand Down Expand Up @@ -45,12 +45,17 @@ const ThemeSidebar = (props: ThemeSidebarProps) => {
);

return (
<AutoFieldPrivate
<FieldLabel
label={field.label ?? ""}
className="theme-field"
key={parentStyleKey}
field={field}
onChange={(value) => onThemeChange(parentStyleKey, value)}
value={values}
/>
>
<AutoField
field={field}
onChange={(value) => onThemeChange(parentStyleKey, value)}
value={values}
/>
</FieldLabel>
);
})}
</div>
Expand Down
14 changes: 14 additions & 0 deletions src/internal/puck/ui/puck.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,17 @@
height: 1rem;
width: 1rem;
}

.theme-field {
padding: 16px 16px 0 16px;
}

.theme-field > fieldset {
padding: 16px 15px;
}

.theme-field fieldset > div,
.theme-field fieldset > label {
padding: 0;
border: none !important;
}

0 comments on commit c5e80f4

Please sign in to comment.