Skip to content

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.

delete old combobox

Sultand40ecc8f44e1
diff --git a/apps/designer/app/designer/features/style-panel/style-section.tsx b/apps/designer/app/designer/features/style-panel/style-section.tsx
index e0d7da52e3..fb92684d06 100644
--- a/apps/designer/app/designer/features/style-panel/style-section.tsx
+++ b/apps/designer/app/designer/features/style-panel/style-section.tsx
@@ -70,8 +70,8 @@ const PropertyName = ({ property, label, css }: PropertyProps) => {
? {
color: propertyNameColorForSelectedBreakpoint,
backgroundColor: "$colors$blue4",
- padding: "2px 4px",
- borderRadius: "3px",
+ padding: "calc($radii$1 / 2) $radii$1",
+ borderRadius: "$radii$1",
}
: {
color: "$hiContrast",
@@ -630,12 +630,8 @@ export const renderCategory = ({
gridTemplateAreas: `
"${"display ".repeat(12)}"
"${"grid ".repeat(5)} . . . . . . ."
- "${"grid ".repeat(
- 5
- )} flexDirection flexDirection flexWrap flexWrap justifyItems justifyItems ."
- "${"grid ".repeat(
- 5
- )} alignItems alignItems justifyContent justifyContent alignContent alignContent ."
+ "grid grid grid grid grid flexDirection flexDirection flexWrap flexWrap justifyItems justifyItems ."
+ "grid grid grid grid grid alignItems alignItems justifyContent justifyContent alignContent alignContent ."
"${"grid ".repeat(5)} . . . . . . ."
"${"columnGap ".repeat(5)} lock lock ${"rowGap ".repeat(5)}"
`,
diff --git a/apps/designer/app/shared/design-system/components/combobox.tsx b/apps/designer/app/shared/design-system/components/combobox.tsx
deleted file mode 100644
index ecf7d5a7a7..0000000000
--- a/apps/designer/app/shared/design-system/components/combobox.tsx
+++ /dev/null
@@ -1,104 +0,0 @@
-import { type ComponentProps, useState, useEffect } from "react";
-import { ChevronDownIcon } from "@webstudio-is/icons";
-import { TextField } from "./text-field";
-import { IconButton } from "./icon-button";
-import { MenuAnchor, Menu, MenuContent, MenuItem } from "./menu";
-
-type Item = { label: string };
-
-type ComboboxProps = ComponentProps<typeof TextField> & {
- items: Array<Item>;
- onValueSelect: (value: string) => void;
- onValueEnter: (value: string) => void;
- onItemEnter: (value: string) => void;
- onItemLeave: (value: string) => void;
- value: string;
-};
-
-export const Combobox = ({
- items,
- onValueSelect,
- onValueEnter,
- onItemEnter,
- onItemLeave,
- value,
- css,
- ...rest
-}: ComboboxProps) => {
- const [isOpen, setIsOpen] = useState(false);
- const [currentValue, setCurrentValue] = useState(value);
-
- useEffect(() => {
- setCurrentValue(value);
- }, [value]);
-
- return (
- <Menu open={isOpen} modal={true} onOpenChange={setIsOpen}>
- <MenuAnchor asChild>
- <TextField
- {...rest}
- value={currentValue}
- autoComplete="off"
- // @todo avoid hardcoding padding
- css={{ ...css, paddingRight: 30 - 4 }}
- onChange={(event) => {
- setCurrentValue(event.target.value);
- }}
- onKeyDown={(event) => {
- switch (event.key) {
- case "ArrowDown":
- case "ArrowUp": {
- setIsOpen(true);
- break;
- }
- case "Enter": {
- onValueEnter(event.currentTarget.value);
- break;
- }
- }
- }}
- />
- </MenuAnchor>
- <IconButton
- variant="ghost"
- size="1"
- // @todo avoid hardcoding margin
- css={{
- marginLeft: -32 + 4,
- height: "$4",
- width: "$4",
- }}
- onClick={() => {
- setIsOpen(true);
- }}
- >
- <ChevronDownIcon />
- </IconButton>
- <MenuContent loop portalled asChild>
- <div>
- {items.map(({ label }, index) => {
- return (
- <MenuItem
- key={index}
- onMouseEnter={() => {
- onItemEnter(label);
- }}
- onMouseLeave={() => {
- onItemLeave(label);
- }}
- onFocus={() => {
- onItemEnter(label);
- }}
- onSelect={() => {
- onValueSelect(label);
- }}
- >
- {label}
- </MenuItem>
- );
- })}
- </div>
- </MenuContent>
- </Menu>
- );
-};