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
add reverse icons and lock icon from figma
Sultand769a789a97b
diff --git a/apps/designer/app/designer/features/style-panel/style-section.tsx b/apps/designer/app/designer/features/style-panel/style-section.tsxindex 6e91517947..524cebda2b 100644--- a/apps/designer/app/designer/features/style-panel/style-section.tsx+++ b/apps/designer/app/designer/features/style-panel/style-section.tsx@@ -1,4 +1,4 @@-import { ChangeEvent, ChangeEventHandler, useState } from "react";+import { ChangeEvent, ChangeEventHandler, useState, useEffect } from "react";import {Box,Flex,@@ -197,7 +197,7 @@ const ComboboxControl = ({return (<inputtype="number"- value={String(value.value)}+ value={value.value}onChange={(event: ChangeEvent<HTMLInputElement>) =>setValue(event.target.value)}@@ -314,6 +314,14 @@ const GridControl = ({ css, currentStyle }: any) => {return <></>;};+const LockControl = ({ css, currentStyle, setProperty }: any) => {+ return (+ <IconButton css={{ width: "100%", ...css }}>+ <icons.lock.closed />+ </IconButton>+ );+};+const ShowMore = ({ styleConfigs }: { styleConfigs: Array<JSX.Element> }) => {const [isOpen, setIsOpen] = useState(false);if (styleConfigs.length === 0) return null;@@ -371,14 +379,16 @@ export const renderProperty = ({};type RenderCategoryProps = {+ setProperty: SetProperty;currentStyle: Style;category: Category;styleConfigsByCategory: JSX.Element[];moreStyleConfigsByCategory: JSX.Element[];};-// Categories should render themselves because most Categories will not be dump un-ordered lists with+// Categories should render themselves because most Categories will not be flat un-ordered lists with// the new designs, refactor ColorControl, SpacingControl if needed.export const renderCategory = ({+ setProperty,currentStyle,category,styleConfigsByCategory,@@ -389,26 +399,6 @@ export const renderCategory = ({const display = currentStyle.display?.value;switch (currentStyle.display?.value) {case "flex": {- styleConfigsByCategory = [- <GridControl- key="grid"- css={{ gridArea: "grid" }}- currentStyle={currentStyle}- />,- <Box- key="lock"- css={{- gridArea: "lock",- display: "flex",- justifyContent: "center",- }}- >- <IconButton>- <LockClosedIcon />- </IconButton>- </Box>,- ...styleConfigsByCategory,- ];return (<><Grid@@ -417,13 +407,26 @@ export const renderCategory = ({gridTemplateColumns: "repeat(12, 1fr);",gridTemplateRows: "auto auto auto auto",gridTemplateAreas: `- "display display display display display display display display display display display display"- "grid grid grid grid flexDirection flexDirection flexWrap flexWrap justifyItems justifyItems . ."- "grid grid grid grid alignItems alignItems justifyContent justifyContent alignContent alignContent . ."- "rowGap rowGap rowGap rowGap rowGap lock lock columnGap columnGap columnGap columnGap columnGap"- `,+ "display display display display display display display display display display display display"+ "grid grid grid grid flexDirection flexDirection flexWrap flexWrap justifyItems justifyItems . ."+ "grid grid grid grid alignItems alignItems justifyContent justifyContent alignContent alignContent . ."+ "rowGap rowGap rowGap rowGap rowGap lock lock columnGap columnGap columnGap columnGap columnGap"+ `,+ "[data-property=placeContent]": {+ display: "none",+ },}}>+ <GridControl+ css={{ gridArea: "grid" }}+ currentStyle={currentStyle}+ setProperty={setProperty}+ />+ <LockControl+ css={{ gridArea: "lock" }}+ currentStyle={currentStyle}+ setProperty={setProperty}+ />{styleConfigsByCategory}</Grid><ShowMore styleConfigs={moreStyleConfigsByCategory} />diff --git a/apps/designer/app/designer/features/style-panel/style-settings.tsx b/apps/designer/app/designer/features/style-panel/style-settings.tsxindex c4a0d19a4f..97a2e55160 100644--- a/apps/designer/app/designer/features/style-panel/style-settings.tsx+++ b/apps/designer/app/designer/features/style-panel/style-settings.tsx@@ -74,6 +74,7 @@ type StyleSettingsProps = {};export const StyleSettings = ({+ setProperty,currentStyle,search,...rest@@ -102,6 +103,7 @@ export const StyleSettings = ({if (isInCategory && isApplicable && isRendered === false) {const element = renderProperty({...rest,+ setProperty,currentStyle,styleConfig,category,@@ -132,6 +134,7 @@ export const StyleSettings = ({><>{renderCategory({+ setProperty,currentStyle,category,styleConfigsByCategory,diff --git a/apps/designer/app/shared/icons/flex-wrap.tsx b/apps/designer/app/shared/icons/flex-wrap.tsxindex a5fce7ac80..a8641acaf8 100644--- a/apps/designer/app/shared/icons/flex-wrap.tsx+++ b/apps/designer/app/shared/icons/flex-wrap.tsx@@ -54,8 +54,38 @@ export const FlexWrapNowrap = React.forwardRef<SVGSVGElement, IconProps>(});+export const FlexWrapWrapReverse = 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="M0 2C0 0.89543 0.895431 0 2 0H22C23.1046 0 24 0.895431 24 2V22C24 23.1046 23.1046 24 22 24H2C0.89543 24 0 23.1046 0 22V2Z"+ fill="white"+ />+ <path d="M16 13H20V20H16V13Z" fill="#11181C" />+ <path d="M4 13H8V20H4V13Z" fill="#11181C" />+ <path d="M10 13H14V20H10V13Z" fill="#11181C" />+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="M13 5H11V10H13V5ZM19 5H17V10H19V5ZM7 5H5V10H7V5ZM19 14H17V19H19V14ZM7 14H5V19H7V14ZM13 14H11V19H13V14ZM8 4V11H4V4H8ZM10 4V11H14V4H10ZM16 4V11H20V4H16ZM16 13V20H20V13H16ZM8 13V20H4V13H8ZM10 13V20H14V13H10Z"+ fill="#11181C"+ />+ </svg>+ );+ }+);+export const flexWrap = {normal: FlexWrapNowrap,nowrap: FlexWrapNowrap,wrap: FlexWrapWrap,+ "wrap-reverse": FlexWrapWrapReverse,};diff --git a/apps/designer/app/shared/icons/index.ts b/apps/designer/app/shared/icons/index.tsindex 0e75322adc..be4aaf6036 100644--- a/apps/designer/app/shared/icons/index.ts+++ b/apps/designer/app/shared/icons/index.ts@@ -15,3 +15,4 @@ export * from "./flex-direction";export * from "./flex-wrap";export * from "./gap";export * from "./justify-content";+export * from "./lock";diff --git a/apps/designer/app/shared/icons/lock.tsx b/apps/designer/app/shared/icons/lock.tsxnew file mode 100644index 0000000000..59e24aebf4--- /dev/null+++ b/apps/designer/app/shared/icons/lock.tsx@@ -0,0 +1,88 @@+import * as React from "react";+import { IconProps } from "./types";++export const LockOpened = React.forwardRef<SVGSVGElement, IconProps>(+ ({ color = "currentColor", ...props }, forwardedRef) => {+ return (+ <svg+ width="8"+ height="10"+ viewBox="0 0 8 10"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ {...props}+ ref={forwardedRef}+ >+ <g clipPath="url(#clip0_561_9202)">+ <rect+ width="8"+ height="9"+ transform="translate(0 0.5)"+ fill="white"+ />+ <path+ d="M4 0.5C3.24224 0.5 2.51551 0.80102 1.97969 1.33684C1.44388 1.87266 1.14286 2.59938 1.14286 3.35714V4.5C0.839753 4.5 0.549062 4.62041 0.334735 4.83474C0.120408 5.04906 0 5.33975 0 5.64286V8.5C0 8.8031 0.120408 9.09379 0.334735 9.30812C0.549062 9.52245 0.839753 9.64286 1.14286 9.64286H6.85714C7.16025 9.64286 7.45094 9.52245 7.66527 9.30812C7.87959 9.09379 8 8.8031 8 8.5V5.64286C8 5.33975 7.87959 5.04906 7.66527 4.83474C7.45094 4.62041 7.16025 4.5 6.85714 4.5H2.28571V3.35714C2.28557 2.9398 2.43768 2.53673 2.71352 2.22353C2.98936 1.91034 3.36998 1.70852 3.784 1.65594C4.19802 1.60335 4.61701 1.70361 4.96239 1.9379C5.30776 2.1722 5.5558 2.52444 5.66 2.92857C5.69789 3.07535 5.79253 3.20107 5.92311 3.27806C5.98777 3.31619 6.0593 3.3412 6.13362 3.35168C6.20795 3.36216 6.28361 3.3579 6.35629 3.33914C6.42896 3.32038 6.49723 3.28749 6.5572 3.24235C6.61717 3.1972 6.66765 3.14069 6.70578 3.07603C6.7439 3.01138 6.76892 2.93984 6.7794 2.86552C6.78988 2.7912 6.78562 2.71553 6.76686 2.64286C6.60831 2.02958 6.25053 1.48634 5.74972 1.09848C5.24891 0.710614 4.63344 0.500099 4 0.5V0.5Z"+ fill="#11181C"+ />+ </g>+ <defs>+ <clipPath id="clip0_561_9202">+ <rect+ width="8"+ height="9"+ fill="white"+ transform="translate(0 0.5)"+ />+ </clipPath>+ </defs>+ </svg>+ );+ }+);++export const LockClosed = React.forwardRef<SVGSVGElement, IconProps>(+ ({ color = "currentColor", ...props }, forwardedRef) => {+ return (+ <svg+ width="8"+ height="10"+ viewBox="0 0 8 10"+ fill="none"+ xmlns="http://www.w3.org/2000/svg"+ {...props}+ ref={forwardedRef}+ >+ <g clipPath="url(#clip0_561_9202)">+ <rect+ width="8"+ height="9"+ transform="translate(0 0.5)"+ fill="white"+ />+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="M1.14286 4.4375V3.3125C1.14286 2.56658 1.44388 1.85121 1.97969 1.32376C2.51551 0.796316 3.24224 0.5 4 0.5C4.75776 0.5 5.48449 0.796316 6.02031 1.32376C6.55612 1.85121 6.85714 2.56658 6.85714 3.3125V4.4375C7.16025 4.4375 7.45094 4.55603 7.66527 4.767C7.87959 4.97798 8 5.26413 8 5.5625V8.375C8 8.67337 7.87959 8.95952 7.66527 9.1705C7.45094 9.38147 7.16025 9.5 6.85714 9.5H1.14286C0.839753 9.5 0.549062 9.38147 0.334735 9.1705C0.120408 8.95952 0 8.67337 0 8.375V5.5625C0 5.26413 0.120408 4.97798 0.334735 4.767C0.549062 4.55603 0.839753 4.4375 1.14286 4.4375ZM5.71429 3.3125V4.4375H2.28571V3.3125C2.28571 2.86495 2.46633 2.43572 2.78782 2.11926C3.10931 1.80279 3.54534 1.625 4 1.625C4.45466 1.625 4.89069 1.80279 5.21218 2.11926C5.53367 2.43572 5.71429 2.86495 5.71429 3.3125Z"+ fill="#11181C"+ />+ </g>+ <defs>+ <clipPath id="clip0_561_9202">+ <rect+ width="8"+ height="9"+ fill="white"+ transform="translate(0 0.5)"+ />+ </clipPath>+ </defs>+ </svg>+ );+ }+);++export const lock = {+ normal: LockOpened,+ opened: LockOpened,+ closed: LockClosed,+};