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
open menu when clicking the button icon
Sultan75598ebe10ec
diff --git a/apps/designer/app/designer/features/style-panel/style-section.tsx b/apps/designer/app/designer/features/style-panel/style-section.tsxindex c71699dc8e..bba5781538 100644--- a/apps/designer/app/designer/features/style-panel/style-section.tsx+++ b/apps/designer/app/designer/features/style-panel/style-section.tsx@@ -269,22 +269,17 @@ const ComboiconControl = ({const setValue = setProperty(styleConfig.property);const currentValue = value.value as string;const Icon = (icons as any)[styleConfig.property]?.[currentValue];-- if (Icon === undefined) return null;-+ console.log(currentValue);return (- <IconButton>- <Icon />- </IconButton>+ <Comboicon+ id={styleConfig.property}+ items={styleConfig.items}+ value={String(currentValue)}+ onChange={setValue}+ >+ {Icon && <Icon />}+ </Comboicon>);- // return (- // <Comboicon- // id={styleConfig.property}- // items={styleConfig.items}- // value={String(value.value)}- // onChange={setValue}- // />- // );};const GridControl = ({ css, currentStyle }: any) => {@@ -377,7 +372,6 @@ export const renderCategory = ({switch (category) {case "layout": {const display = currentStyle.display?.value;- console.log(display);switch (currentStyle.display?.value) {case "flex": {styleConfigsByCategory = [diff --git a/apps/designer/app/shared/design-system/components/comboicon.tsx b/apps/designer/app/shared/design-system/components/comboicon.tsxindex 30ac10777b..a7941cca4d 100644--- a/apps/designer/app/shared/design-system/components/comboicon.tsx+++ b/apps/designer/app/shared/design-system/components/comboicon.tsx@@ -57,13 +57,11 @@ const IconButton = styled("button", {"&:hover": { backgroundColor: "$colors$gray6" },});-export const Comboicon = ({ id, value, items, onChange }: any) => {+export const Comboicon = ({ id, value, items, onChange, children }: any) => {return (<DropdownMenuPrimitive.Root><DropdownMenuPrimitive.Trigger asChild>- <IconButton aria-label={id}>- <HamburgerMenuIcon />- </IconButton>+ <IconButton aria-label={id}>{children}</IconButton></DropdownMenuPrimitive.Trigger><StyledContent>diff --git a/apps/designer/app/shared/icons/align-content.tsx b/apps/designer/app/shared/icons/align-content.tsxindex 04d328808a..1a9f45a53b 100644--- a/apps/designer/app/shared/icons/align-content.tsx+++ b/apps/designer/app/shared/icons/align-content.tsx@@ -40,8 +40,8 @@ export const AlignContentCenter = React.forwardRef<SVGSVGElement, IconProps>(fill="white"/><path- fill-rule="evenodd"- clip-rule="evenodd"+ fillRule="evenodd"+ clipRule="evenodd"d="M8 6H11V9H8V6ZM4 11.5H20V12.5H4V11.5ZM16 6H13V9H16V6ZM13 15H16V18H13V15ZM11 15H8V18H11V15Z"fill="#11181C"/>@@ -65,8 +65,8 @@ export const AlignContentEnd = React.forwardRef<SVGSVGElement, IconProps>(fill="white"/><path- fill-rule="evenodd"- clip-rule="evenodd"+ fillRule="evenodd"+ clipRule="evenodd"d="M8 8H11V11H8V8ZM4 18H20V19H4V18ZM16 8H13V11H16V8ZM13 13H16V16H13V13ZM11 13H8V16H11V13Z"fill="#11181C"/>@@ -90,8 +90,8 @@ export const AlignContentStretch = React.forwardRef<SVGSVGElement, IconProps>(fill="white"/><path- fill-rule="evenodd"- clip-rule="evenodd"+ fillRule="evenodd"+ clipRule="evenodd"d="M19 5H5V6H19V5ZM19 18H5V19H19V18ZM8 8H11V11H8V8ZM16 8H13V11H16V8ZM13 13H16V16H13V13ZM11 13H8V16H11V13Z"fill="#11181C"/>@@ -117,8 +117,8 @@ export const AlignContentSpaceAround = React.forwardRef<fill="white"/><path- fill-rule="evenodd"- clip-rule="evenodd"+ fillRule="evenodd"+ clipRule="evenodd"d="M19 5H5V6H19V5ZM19 18H5V19H19V18ZM8 8H11V11H8V8ZM16 8H13V11H16V8ZM13 13H16V16H13V13ZM11 13H8V16H11V13Z"fill="#11181C"/>@@ -143,8 +143,8 @@ export const AlignContentSpaceBetween = React.forwardRef<fill="white"/><path- fill-rule="evenodd"- clip-rule="evenodd"+ fillRule="evenodd"+ clipRule="evenodd"d="M19 5H5V6H19V5ZM19 18H5V19H19V18ZM8 8H11V11H8V8ZM16 8H13V11H16V8ZM13 13H16V16H13V13ZM11 13H8V16H11V13Z"fill="#11181C"/>@@ -158,6 +158,6 @@ export const alignContent = {end: AlignContentEnd,center: AlignContentCenter,stretch: AlignContentStretch,- spaceAround: AlignContentSpaceAround,- spaceBetween: AlignContentSpaceBetween,+ "space-around": AlignContentSpaceAround,+ "space-between": AlignContentSpaceBetween,};diff --git a/apps/designer/app/shared/icons/align-items.tsx b/apps/designer/app/shared/icons/align-items.tsxindex 011a1dd4cd..a165294b1c 100644--- a/apps/designer/app/shared/icons/align-items.tsx+++ b/apps/designer/app/shared/icons/align-items.tsx@@ -142,7 +142,7 @@ export const AlignItemsStretch = React.forwardRef<SVGSVGElement, IconProps>(fill="white"/><path- fill-rule="evenodd"+ fillRule="evenodd"clipRule="evenodd"d="M16 16H19.2V17.6H4.80005V16H8.00005V7.99999H4.80005V6.39999H19.2V7.99999H16V16ZM12.8 16V7.99999H11.2V16H12.8Z"fill="#11181C"diff --git a/apps/designer/app/shared/icons/flex-direction.tsx b/apps/designer/app/shared/icons/flex-direction.tsxindex e52cd82f6b..5da2044520 100644--- a/apps/designer/app/shared/icons/flex-direction.tsx+++ b/apps/designer/app/shared/icons/flex-direction.tsx@@ -47,8 +47,60 @@ export const FlexDirectionColumn = React.forwardRef<SVGSVGElement, IconProps>(});+export const FlexDirectionRowReverse = React.forwardRef<+ SVGSVGElement,+ IconProps+>(({ color = "currentColor", ...props }, forwardedRef) => {+ return (+ <svg+ viewBox="0 0 24 24"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ {...props}+ ref={forwardedRef}+ style={{ transform: "rotate(180deg)" }}+ >+ <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"+ />+ <path+ d="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"+ />+ </svg>+ );+});++export const FlexDirectionColumnReverse = React.forwardRef<+ SVGSVGElement,+ IconProps+>(({ color = "currentColor", ...props }, forwardedRef) => {+ return (+ <svg+ viewBox="0 0 24 24"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ {...props}+ ref={forwardedRef}+ style={{ transform: "rotate(180deg)" }}+ >+ <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"+ />+ <path+ d="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"+ />+ </svg>+ );+});+export const flexDirection = {normal: FlexDirectionRow,row: FlexDirectionRow,column: FlexDirectionColumn,+ "row-reverse": FlexDirectionRowReverse,+ "column-reverse": FlexDirectionColumnReverse,};diff --git a/apps/designer/app/shared/icons/gap.tsx b/apps/designer/app/shared/icons/gap.tsxindex b16883c417..1c2b05fd18 100644--- a/apps/designer/app/shared/icons/gap.tsx+++ b/apps/designer/app/shared/icons/gap.tsx@@ -28,3 +28,8 @@ export const ColumnGap = React.forwardRef<SVGSVGElement, IconProps>();});++export const gap = {+ "row-gap": RowGap,+ "column-gap": ColumnGap,+};diff --git a/apps/designer/app/shared/icons/justify-content.tsx b/apps/designer/app/shared/icons/justify-content.tsxindex 3caf0f7cf4..6acf4c9599 100644--- a/apps/designer/app/shared/icons/justify-content.tsx+++ b/apps/designer/app/shared/icons/justify-content.tsx@@ -129,6 +129,6 @@ export const justifyContent = {start: JustifyContentStart,end: JustifyContentEnd,center: JustifyContentCenter,- spaceBetween: JustifyContentSpaceBetween,- spaceAround: JustifyContentSpaceAround,+ "space-between": JustifyContentSpaceBetween,+ "space-around": JustifyContentSpaceAround,};