Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
cleanup flex icons, highlight set icon states, update dropdown menu styles
Sultan2f867a16293a
diff --git a/apps/designer/app/designer/features/style-panel/style-section.tsx b/apps/designer/app/designer/features/style-panel/style-section.tsxindex 2a1f264215..0b195770b2 100644--- a/apps/designer/app/designer/features/style-panel/style-section.tsx+++ b/apps/designer/app/designer/features/style-panel/style-section.tsx@@ -37,6 +37,7 @@ import {} from "./lib/spacing-widget";import { useIsFromCurrentBreakpoint } from "./lib/use-is-from-current-breakpoint";import { propertyNameColorForSelectedBreakpoint } from "./lib/constants";+import { isCatchResponse } from "@remix-run/react/dist/data";const getFinalValue = ({currentStyle,@@ -204,7 +205,14 @@ const ComboboxControl = ({onChange={(event: ChangeEvent<HTMLInputElement>) =>setValue(event.target.value)}- style={{ width: "100%", boxSizing: "border-box" }}+ style={{+ width: "100%",+ boxSizing: "border-box",+ outline: "none",+ borderRadius: "4px",+ height: "28px",+ border: "1px solid var(--colors-slate8)",+ }}/>);}@@ -292,12 +300,28 @@ const ComboiconControl = ({const setValue = setProperty(styleConfig.property);const currentValue = value.value as string;const Icon = (icons as any)[styleConfig.property]?.[currentValue];+ const isCurrentBreakpoint = useIsFromCurrentBreakpoint(styleConfig.property);return (<Comboiconid={styleConfig.property}items={styleConfig.items}value={String(currentValue)}onChange={setValue}+ css={+ isCurrentBreakpoint+ ? {+ color: "$colors$blue11",+ backgroundColor: "$colors$blue4",+ "&:hover": {+ color: "$colors$blue11",+ backgroundColor: "$colors$blue4",+ },+ "& path": {+ fill: "$colors$blue11",+ },+ }+ : {}+ }>{Icon && <Icon />}</Comboicon>@@ -308,15 +332,15 @@ const GridControl = ({ css, currentStyle, ...rest }: any) => {return (<Boxcss={{- border: "2px solid $colors$blue9",+ border: "2px solid $colors$slate8",background: "#FFF",borderRadius: "4px",textAlign: "center",width: "100%",- height: "72px",+ aspectRatio: "1 / 1",+ padding: "30px",...css,}}- {...rest}></Box>);return <></>;@@ -413,17 +437,20 @@ export const renderCategory = ({css={{alignItems: "center",gridTemplateColumns: "repeat(12, 1fr);",- gridTemplateRows: "auto auto auto auto",+ gridTemplateRows: "auto 0px auto auto 0px auto",gridTemplateAreas: `"display display display display display display display display display display display display"+ "grid grid grid grid grid . . . . . . .""grid grid grid grid grid flexDirection flexDirection flexWrap flexWrap justifyItems justifyItems .""grid grid grid grid grid alignItems alignItems justifyContent justifyContent alignContent alignContent ."+ "grid grid grid grid grid . . . . . . .""rowGap rowGap rowGap rowGap rowGap lock lock columnGap columnGap columnGap columnGap columnGap"`,- gap: "8px 4px",+ gap: "8px","& > [data-type=comboicon]": {display: "flex",justifyContent: "center",+ alignItems: "center",height: "100%",},// @todo placeContent is shorthand prop for other properties, thus a duplicatediff --git a/apps/designer/app/shared/design-system/components/comboicon.tsx b/apps/designer/app/shared/design-system/components/comboicon.tsxindex 72abfa0061..39ff391a98 100644--- a/apps/designer/app/shared/design-system/components/comboicon.tsx+++ b/apps/designer/app/shared/design-system/components/comboicon.tsx@@ -4,12 +4,13 @@ import { HamburgerMenuIcon, CheckIcon } from "@radix-ui/react-icons";import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";const StyledContent = styled(DropdownMenuPrimitive.Content, {- minWidth: 220,- backgroundColor: "white",- borderRadius: 6,- padding: 5,+ maxWidth: "224px",+ backgroundColor: "$colors$gray4",+ borderRadius: "4px",+ padding: "8px",boxShadow:- "0px 10px 38px -10px rgba(22, 23, 24, 0.35), 0px 10px 20px -15px rgba(22, 23, 24, 0.2)",+ "0px 2px 7px rgba(0, 0, 0, 0.1), 0px 5px 17px rgba(0, 0, 0, 0.15), inset 0 0 0 1px $colors$gray1",+ border: "1px solid $colors$gray8",});const itemStyles = {@@ -40,29 +41,53 @@ const StyledItemIndicator = styled(DropdownMenuPrimitive.ItemIndicator, {});const StyledArrow = styled(DropdownMenuPrimitive.Arrow, {- fill: "white",+ fill: "$colors$gray4",+ // filter: 'drop-shadow(0px 2px 7px rgba(0, 0, 0, 0.1), 0px 5px 17px rgba(0, 0, 0, 0.15))',});const IconButton = styled("button", {all: "unset",fontFamily: "inherit",borderRadius: "2px",- height: "100%",width: "100%",+ height: "100%",display: "inline-flex",alignItems: "center",justifyContent: "center",color: "$colors$gray12",- backgroundColor: "white",- "&:hover": { backgroundColor: "$colors$gray3" },- "& svg": { width: "24px", height: "24px" },+ backgroundColor: "$colors$loContrast",+ "&:hover": {+ backgroundColor: "$colors$gray3",+ },+ "& svg": {+ width: "24px",+ height: "24px",+ },+ "&:not(:hover) path": {+ fill: "currentColor",+ },+ "&[data-state=open]": {+ backgroundColor: "$colors$blue10",+ "& path": {+ fill: "$colors$blue1",+ },+ },});-export const Comboicon = ({ id, value, items, onChange, children }: any) => {+export const Comboicon = ({+ id,+ value,+ items,+ onChange,+ children,+ css,+}: any) => {return (<DropdownMenuPrimitive.Root><DropdownMenuPrimitive.Trigger asChild>- <IconButton aria-label={id}>{children}</IconButton>+ <IconButton aria-label={id} css={css}>+ {children}+ </IconButton></DropdownMenuPrimitive.Trigger><StyledContent>diff --git a/apps/designer/app/shared/icons/flex-direction.tsx b/apps/designer/app/shared/icons/flex-direction.tsxindex 5823b6e01c..25a691d1af 100644--- a/apps/designer/app/shared/icons/flex-direction.tsx+++ b/apps/designer/app/shared/icons/flex-direction.tsx@@ -11,10 +11,6 @@ export const FlexDirectionRow = React.forwardRef<SVGSVGElement, IconProps>({...props}ref={forwardedRef}>- <path- d="M2 24C0.89543 24 -3.91405e-08 23.1046 -8.74228e-08 22L-9.61651e-07 2C-1.00993e-06 0.89543 0.89543 -3.91405e-08 2 -8.74228e-08L22 -9.61651e-07C23.1046 -1.00993e-06 24 0.89543 24 2L24 22C24 23.1046 23.1046 24 22 24L2 24Z"- fill="white"- /><pathd="M5 12.8334L14.8881 12.8334L11.9794 15.825L13.125 17L18 12L13.125 7.00003L11.9794 8.17503L14.8881 11.1667L5 11.1667V12.8334Z"fill="#11181C"@@ -34,10 +30,6 @@ export const FlexDirectionColumn = React.forwardRef<SVGSVGElement, IconProps>({...props}ref={forwardedRef}>- <path- d="M2 24C0.89543 24 -3.91405e-08 23.1046 -8.74228e-08 22L-9.61651e-07 2C-1.00993e-06 0.89543 0.89543 -3.91405e-08 2 -8.74228e-08L22 -9.61651e-07C23.1046 -1.00993e-06 24 0.89543 24 2L24 22C24 23.1046 23.1046 24 22 24L2 24Z"- fill="white"- /><pathd="M11.1667 6L11.1667 15.8881L8.175 12.9794L7 14.125L12 19L17 14.125L15.825 12.9794L12.8333 15.8881L12.8333 6L11.1667 6Z"fill="#11181C"