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.

big refactor

Sultan5a1712908ba9
diff --git a/apps/designer/app/designer/features/style-panel/shared/color-picker.tsx b/apps/designer/app/designer/features/style-panel/controls/color-control.tsx
similarity index 66%
rename from apps/designer/app/designer/features/style-panel/shared/color-picker.tsx
rename to apps/designer/app/designer/features/style-panel/controls/color-control.tsx
index 48403714d5..fa5a8b9ba6 100644
--- a/apps/designer/app/designer/features/style-panel/shared/color-picker.tsx
+++ b/apps/designer/app/designer/features/style-panel/controls/color-control.tsx
@@ -2,12 +2,16 @@ import { useState } from "react";
import { ColorResult, RGBColor, SketchPicker } from "react-color";
import {
Box,
+ Grid,
Flex,
Popover,
PopoverTrigger,
PopoverContent,
TextField,
} from "@webstudio-is/design-system";
+import { PropertyName } from "./property-name";
+import { getFinalValue } from "../shared/get-final-value";
+import type { ControlProps } from "../style-sections";
const stringifyRGBA = (color: RGBColor) => {
const { r, g, b, a = 1 } = color;
@@ -22,7 +26,7 @@ type ColorPickerProps = {
id: string;
};
-export const ColorPicker = ({
+const ColorPicker = ({
value,
onChange,
onChangeComplete,
@@ -78,3 +82,36 @@ export const ColorPicker = ({
</Popover>
);
};
+
+const ColorControl = ({
+ currentStyle,
+ inheritedStyle,
+ setProperty,
+ styleConfig,
+}: ControlProps) => {
+ const value = getFinalValue({
+ currentStyle,
+ inheritedStyle,
+ property: styleConfig.property,
+ });
+ if (value === undefined) return null;
+ const setValue = setProperty(styleConfig.property);
+
+ return (
+ <Grid columns={2} align="center" gapX="1">
+ <PropertyName property={styleConfig.property} label={styleConfig.label} />
+ <Flex align="center" css={{ gridColumn: "2/4" }} gap="1">
+ <ColorPicker
+ id={styleConfig.property}
+ value={String(value.value)}
+ onChange={(value) => {
+ setValue(value, { isEphemeral: true });
+ }}
+ onChangeComplete={setValue}
+ />
+ </Flex>
+ </Grid>
+ );
+};
+
+export { ColorControl };
diff --git a/apps/designer/app/designer/features/style-panel/controls/combobox-control.tsx b/apps/designer/app/designer/features/style-panel/controls/combobox-control.tsx
new file mode 100644
index 0000000000..6143000fee
--- /dev/null
+++ b/apps/designer/app/designer/features/style-panel/controls/combobox-control.tsx
@@ -0,0 +1,145 @@
+import { KeyboardEvent } from "react";
+import type { StyleValue } from "@webstudio-is/react-sdk";
+import {
+ Flex,
+ Grid,
+ Text,
+ Combobox,
+ IconButton,
+ TextField,
+ Tooltip,
+} from "@webstudio-is/design-system";
+import { PropertyName } from "./property-name";
+import { getFinalValue } from "../shared/get-final-value";
+import { useIsFromCurrentBreakpoint } from "../shared/use-is-from-current-breakpoint";
+import { ControlProps } from "../style-sections";
+import { RowGap, ColumnGap } from "@webstudio-is/icons";
+
+const Unit = ({ value }: { value: StyleValue }) => {
+ if (value.type !== "unit" || value.unit === "number") return null;
+ return (
+ <Text
+ css={{
+ fontSize: "$1",
+ cursor: "default",
+ }}
+ >
+ {value.unit}
+ </Text>
+ );
+};
+
+const ComboboxControl = ({
+ currentStyle,
+ inheritedStyle,
+ setProperty,
+ styleConfig,
+ category,
+}: ControlProps) => {
+ const isCurrentBreakpoint = useIsFromCurrentBreakpoint(styleConfig.property);
+
+ const value = getFinalValue({
+ currentStyle,
+ inheritedStyle,
+ property: styleConfig.property,
+ });
+
+ if (value === undefined) return null;
+
+ const setValue = setProperty(styleConfig.property);
+
+ switch (styleConfig.property) {
+ case "rowGap":
+ case "columnGap": {
+ if (category == "layout") {
+ // @todo abstract to a variant of the combobox component
+ if (String(currentStyle.display?.value).includes("flex") !== true)
+ break;
+ const Icon = styleConfig.property == "rowGap" ? RowGap : ColumnGap;
+ return (
+ <Grid
+ css={{
+ gridTemplateColumns: "repeat(4, 1fr)",
+ gridTemplateRows: "repeat(1, 1fr)",
+ }}
+ >
+ <Tooltip
+ content={styleConfig.label}
+ delayDuration={700}
+ disableHoverableContent={true}
+ >
+ <IconButton
+ variant="ghost"
+ size="1"
+ css={{
+ zIndex: 1,
+ gridArea: "1 / 1 / 2 / 2",
+ marginLeft: 2,
+ marginTop: 2,
+ borderRadius: 1,
+ height: "calc($sizes$5 - 4px)",
+ width: "calc($sizes$5 - 4px)",
+ "&:focus": {
+ boxShadow: "none",
+ },
+ ...(isCurrentBreakpoint && {
+ bc: "$colors$blue4",
+ "& svg *": {
+ fill: "$colors$blue11",
+ },
+ }),
+ }}
+ >
+ <Icon />
+ </IconButton>
+ </Tooltip>
+ <TextField
+ type="number"
+ defaultValue={parseFloat(String(value.value)) || 0}
+ // @todo looses input state and focus
+ // onChange={(event: ChangeEvent<HTMLInputElement>) => setValue(event.target.value + "px")
+ onKeyDown={(event: KeyboardEvent<HTMLInputElement>) =>
+ event.key === "Enter" &&
+ setValue(event.currentTarget.value + "px")
+ }
+ css={{
+ fontWeight: "500",
+ paddingLeft: "calc($5 + 6px)",
+ gridArea: "1 / 1 / -1 / -1",
+ cursor: "default",
+ }}
+ />
+ </Grid>
+ );
+ }
+ }
+ }
+
+ return (
+ <Grid columns={2} align="center" gapX="1">
+ {/* @todo needs icon variant */}
+ <PropertyName property={styleConfig.property} label={styleConfig.label} />
+ <Flex align="center" css={{ gridColumn: "2/4" }} gap="1">
+ <Combobox
+ name={styleConfig.property}
+ label={styleConfig.property}
+ items={styleConfig.items}
+ value={{ label: String(value.value), name: value.type }}
+ // @todo new combobox doesn't include any of these event handlers
+ // state={value.type === "invalid" ? "invalid" : undefined}
+ // onValueSelect={setValue}
+ // onValueEnter={setValue}
+ // onItemEnter={(value: unknown) => {
+ // setValue(value as string, { isEphemeral: true });
+ // }}
+ // onItemLeave={() => {
+ // setValue(String(value.value), { isEphemeral: true });
+ // }}
+ />
+ <Unit value={value} />
+ </Flex>
+ </Grid>
+ );
+};
+
+export { ComboboxControl };
diff --git a/apps/designer/app/designer/features/style-panel/controls/grid-control.tsx b/apps/designer/app/designer/features/style-panel/controls/grid-control.tsx
new file mode 100644
index 0000000000..33b6fb107a
--- /dev/null
+++ b/apps/designer/app/designer/features/style-panel/controls/grid-control.tsx
@@ -0,0 +1,154 @@
+import { Flex, Grid, IconButton } from "@webstudio-is/design-system";
+import { DotFilledIcon } from "@webstudio-is/icons";
+import { useIsFromCurrentBreakpoint } from "../shared/use-is-from-current-breakpoint";
+import type { Style } from "@webstudio-is/react-sdk";
+import type { CreateBatchUpdate } from "../shared/use-style-data";
+
+const GridControl = ({
+ name,
+ currentStyle,
+ batchUpdate,
+}: {
+ name: string;
+ currentStyle: Style;
+ batchUpdate: ReturnType<CreateBatchUpdate>;
+}) => {
+ const isCurrentBreakpoint = useIsFromCurrentBreakpoint([
+ "flexDirection",
+ "justifyContent",
+ "justifyItems",
+ "alignContent",
+ "alignItems",
+ ]);
+ const flexDirection = currentStyle.flexDirection?.value as string;
+ const justifyContent = currentStyle.justifyContent?.value as string;
+ const alignItems = currentStyle.alignItems?.value as string;
+ const direction = Number(flexDirection.includes("column"));
+ const cells = [
+ "_0_0",
+ "_0_1",
+ "_0_2",
+ "_1_0",
+ "_1_1",
+ "_1_2",
+ "_2_0",
+ "_2_1",
+ "_2_2",
+ ];
+ const rowOptions: Record<string, number> = {
+ stretch: 0,
+ normal: 0,
+ start: 0,
+ center: 1,
+ end: 2,
+ };
+ const columnOptions: Record<string, number> = {
+ "space-around": 0,
+ normal: 0,
+ start: 0,
+ center: 1,
+ end: 2,
+ };
+ const rowValue = rowOptions[alignItems];
+ const columnValue = columnOptions[justifyContent];
+ const currentPosition = rowValue * 3 + columnValue;
+ const setAlignItems = batchUpdate.setProperty("alignItems");
+ const setJustifyContent = batchUpdate.setProperty("justifyContent");
+ return (
+ <Grid
+ data-property={name}
+ css={{
+ width: "100%",
+ aspectRatio: "1 / 1",
+ padding: "6px",
+ borderRadius: "4px",
+ background: "$loContrast",
+ border: "2px solid currentColor",
+ alignItems: "center",
+ gap: "1px",
+ gridArea: name,
+ gridTemplateColumns: "repeat(3, 1fr)",
+ gridTemplateRows: "repeat(3, 1fr)",
+ gridTemplateAreas: `
+ "${cells.slice(0, 0 + 3).join(" ")}"
+ "${cells.slice(3, 3 + 3).join(" ")}"
+ "${cells.slice(6, 6 + 3).join(" ")}"
+ `,
+ color: isCurrentBreakpoint ? "$colors$blue9" : "$colors$slate8",
+ transform: direction
+ ? "rotate(-90deg) scaleX(-1)"
+ : "rotate(0deg) scaleX(1)",
+ }}
+ >
+ {cells.map((value, index) => (
+ <Flex
+ justify="center"
+ align="center"
+ key={index}
+ css={{
+ gridArea: value,
+ width: "100%",
+ height: "100%",
+ }}
+ >
+ <IconButton
+ css={{
+ width: "100%",
+ height: "100%",
+ color: "$colors$gray8",
+ "&:focus": { boxShadow: "none" },
+ }}
+ onClick={() => {
+ const [alignItems, justifyContent] = cells[index]
+ .slice(1)
+ .split("_")
+ .map((value) => ["start", "center", "end"][parseFloat(value)]);
+ setAlignItems(alignItems);
+ setJustifyContent(justifyContent);
+ batchUpdate.publish();
+ }}
+ >
+ <DotFilledIcon />
+ </IconButton>
+ </Flex>
+ ))}
+ <Flex
+ css={{
+ gridArea: cells[currentPosition],
+ ...(alignItems === "stretch" && {
+ gridColumnEnd: "none",
+ }),
+ ...(justifyContent === "space-around" && {
+ gridRowEnd: "none",
+ justifyContent: "space-around",
+ }),
+ alignItems:
+ `start center end start center end start center end`.split(" ")[
+ currentPosition
+ ],
+ pointerEvents: "none",
+ flexDirection: "column",
+ width: "100%",
+ height: "100%",
+ gap: "calc($sizes$1 / 2)",
+ color: "currentColor",
+ }}
+ >
+ {["60%", "100%", "60%"].map((value, index) => (
+ <Flex
+ key={index}
+ css={{
+ inlineSize: value,
+ blockSize: "calc(100% / 3)",
+ maxBlockSize: "6px",
+ background: "currentColor",
+ borderRadius: "calc($radii$1 / 2)",
+ }}
+ ></Flex>
+ ))}
+ </Flex>
+ </Grid>
+ );
+};
+
+export { GridControl };
diff --git a/apps/designer/app/designer/features/style-panel/controls/icon-button-with-menu-control.tsx b/apps/designer/app/designer/features/style-panel/controls/icon-button-with-menu-control.tsx
new file mode 100644
index 0000000000..fef8db0189
--- /dev/null
+++ b/apps/designer/app/designer/features/style-panel/controls/icon-button-with-menu-control.tsx
@@ -0,0 +1,148 @@
+import React from "react";
+import { IconButtonWithMenu } from "@webstudio-is/design-system";
+import { ComboboxControl } from "./combobox-control";
+import { getFinalValue } from "../shared/get-final-value";
+import { useIsFromCurrentBreakpoint } from "../shared/use-is-from-current-breakpoint";
+import type { ControlProps } from "../style-sections";
+import {
+ AlignContentStart,
+ AlignContentEnd,
+ AlignContentCenter,
+ AlignContentStretch,
+ AlignContentSpaceAround,
+ AlignContentSpaceBetween,
+ AlignItemsStart,
+ AlignItemsEnd,
+ AlignItemsCenter,
+ AlignItemsBaseline,
+ AlignItemsStretch,
+ FlexDirectionRow,
+ FlexDirectionColumn,
+ FlexDirectionRowReverse,
+ FlexDirectionColumnReverse,
+ FlexWrapNowrap,
+ FlexWrapWrap,
+ FlexWrapWrapReverse,
+ JustifyContentStart,
+ JustifyContentEnd,
+ JustifyContentCenter,
+ JustifyContentSpaceBetween,
+ JustifyContentSpaceAround,
+ JustifyItemsStart,
+ JustifyItemsEnd,
+ JustifyItemsCenter,
+ IconRecords,
+} from "@webstudio-is/icons";
+
+const icons: IconRecords = {
+ alignContent: {
+ normal: AlignContentStart,
+ start: AlignContentStart,
+ end: AlignContentEnd,
+ center: AlignContentCenter,
+ stretch: AlignContentStretch,
+ "space-around": AlignContentSpaceAround,
+ "space-between": AlignContentSpaceBetween,
+ },
+ alignItems: {
+ normal: AlignItemsStart,
+ start: AlignItemsStart,
+ end: AlignItemsEnd,
+ center: AlignItemsCenter,
+ baseline: AlignItemsBaseline,
+ stretch: AlignItemsStretch,
+ },
+ flexDirection: {
+ normal: FlexDirectionRow,
+ row: FlexDirectionRow,
+ column: FlexDirectionColumn,
+ "row-reverse": FlexDirectionRowReverse,
+ "column-reverse": FlexDirectionColumnReverse,
+ },
+ flexWrap: {
+ normal: FlexWrapNowrap,
+ nowrap: FlexWrapNowrap,
+ wrap: FlexWrapWrap,
+ "wrap-reverse": FlexWrapWrapReverse,
+ },
+ justifyContent: {
+ normal: JustifyContentStart,
+ start: JustifyContentStart,
+ end: JustifyContentEnd,
+ center: JustifyContentCenter,
+ "space-between": JustifyContentSpaceBetween,
+ "space-around": JustifyContentSpaceAround,
+ },
+ justifyItems: {
+ normal: JustifyItemsStart,
+ start: JustifyItemsStart,
+ end: JustifyItemsEnd,
+ center: JustifyItemsCenter,
+ },
+};
+
+const IconButtonWithMenuControl = ({
+ currentStyle,
+ inheritedStyle,
+ setProperty,
+ styleConfig,
+ category,
+}: ControlProps) => {
+ const value = getFinalValue({
+ currentStyle,
+ inheritedStyle,
+ property: styleConfig.property,
+ });
+ const isFromCurrentBreakpoint = useIsFromCurrentBreakpoint(
+ styleConfig.property
+ );
+
+ if (value === undefined) return null;
+
+ const setValue = setProperty(styleConfig.property);
+ const currentValue = value.value as string;
+
+ if (String(currentStyle.display?.value).includes("flex") !== true) {
+ return (
+ <ComboboxControl
+ currentStyle={currentStyle}
+ inheritedStyle={inheritedStyle}
+ setProperty={setProperty}
+ styleConfig={styleConfig}
+ category={category}
+ />
+ );
+ }
+
+ const iconProps = icons[styleConfig.property];
+ const iconStyle =
+ styleConfig.property === "flexDirection"
+ ? {}
+ : {
+ transform: `rotate(${
+ currentStyle.flexDirection?.value === "column"
+ ? 90 * (styleConfig.property === "alignItems" ? -1 : 1)
+ : 0
+ }deg)`,
+ };
+ const items = styleConfig.items
+ .map((item) => {
+ const ItemIcon = iconProps[item.name];
+ return {
+ ...item,
+ icon: ItemIcon && <ItemIcon style={iconStyle} />,
+ };
+ })
+ .filter((item) => item.icon);
+ return (
+ <IconButtonWithMenu
+ label={styleConfig.label}
+ items={items}
+ value={String(currentValue)}
+ onChange={setValue}
+ isFromCurrentBreakpoint={isFromCurrentBreakpoint}
+ ></IconButtonWithMenu>
+ );
+};
+
+export { IconButtonWithMenuControl };
diff --git a/apps/designer/app/designer/features/style-panel/controls/index.ts b/apps/designer/app/designer/features/style-panel/controls/index.ts
new file mode 100644
index 0000000000..eb1343d030
--- /dev/null
+++ b/apps/designer/app/designer/features/style-panel/controls/index.ts
@@ -0,0 +1,9 @@
+export * from "./color-control";
+export * from "./combobox-control";
+export * from "./grid-control";
+export * from "./icon-button-with-menu-control";
+export * from "./lock-control";
+export * from "./property-name";
+export * from "./select-control";
+export * from "./show-more";
+export * from "./spacing-control";
diff --git a/apps/designer/app/designer/features/style-panel/controls/lock-control.tsx b/apps/designer/app/designer/features/style-panel/controls/lock-control.tsx
new file mode 100644
index 0000000000..49b05ed0c0
--- /dev/null
+++ b/apps/designer/app/designer/features/style-panel/controls/lock-control.tsx
@@ -0,0 +1,20 @@
+import { IconButton } from "@webstudio-is/design-system";
+import { LockOpened } from "@webstudio-is/icons";
+import type { Style } from "@webstudio-is/react-sdk";
+import type { CreateBatchUpdate } from "../shared/use-style-data";
+
+const LockControl = ({
+ name,
+}: {
+ name: string;
+ currentStyle: Style;
+ batchUpdate: ReturnType<CreateBatchUpdate>;
+}) => {
+ return (
+ <IconButton data-property={name} css={{ width: "100%", gridArea: name }}>
+ <LockOpened />
+ </IconButton>
+ );
+};
+
+export { LockControl };
diff --git a/apps/designer/app/designer/features/style-panel/controls/property-name.tsx b/apps/designer/app/designer/features/style-panel/controls/property-name.tsx
new file mode 100644
index 0000000000..203e9e13b8
--- /dev/null
+++ b/apps/designer/app/designer/features/style-panel/controls/property-name.tsx
@@ -0,0 +1,34 @@
+import { Label } from "@webstudio-is/design-system";
+import { useIsFromCurrentBreakpoint } from "../shared/use-is-from-current-breakpoint";
+import { propertyNameColorForSelectedBreakpoint } from "../shared/constants";
+import type { PropertyProps } from "../style-sections";
+
+const PropertyName = ({ property, label, css }: PropertyProps) => {
+ const isCurrentBreakpoint = useIsFromCurrentBreakpoint(property);
+
+ return (
+ <Label
+ css={{
+ gridColumn: "1",
+ ...(isCurrentBreakpoint
+ ? {
+ color: propertyNameColorForSelectedBreakpoint,
+ backgroundColor: "$colors$blue4",
+ padding: "calc($radii$1 / 2) $radii$1",
+ borderRadius: "$radii$1",
+ }
+ : {
+ color: "$hiContrast",
+ }),
+ ...css,
+ }}
+ variant="contrast"
+ size="1"
+ htmlFor={property}
+ >
+ {label}
+ </Label>
+ );
+};
+
+export { PropertyName };
diff --git a/apps/designer/app/designer/features/style-panel/controls/select-control.tsx b/apps/designer/app/designer/features/style-panel/controls/select-control.tsx
new file mode 100644
index 0000000000..9bf4752a2e
--- /dev/null
+++ b/apps/designer/app/designer/features/style-panel/controls/select-control.tsx
@@ -0,0 +1,50 @@
+import { Flex, Select } from "@webstudio-is/design-system";
+import { getFinalValue } from "../shared/get-final-value";
+import { PropertyName } from "./property-name";
+import type { ControlProps } from "../style-sections";
+
+const SelectControl = ({
+ currentStyle,
+ inheritedStyle,
+ setProperty,
+ styleConfig,
+}: ControlProps) => {
+ // @todo show which instance we inherited the value from
+ const value = getFinalValue({
+ currentStyle,
+ inheritedStyle,
+ property: styleConfig.property,
+ });
+
+ if (value === undefined) return null;
+
+ const setValue = setProperty(styleConfig.property);
+
+ return (
+ <Flex align="center">
+ <PropertyName
+ property={styleConfig.property}
+ label={styleConfig.label}
+ css={{
+ fontWeight: "500",
+ marginRight: "$sizes$1",
+ }}
+ />
+ <Select
+ options={styleConfig.items.map(({ label }) => label)}
+ value={String(value.value)}
+ onChange={setValue}
+ ghost
+ css={{
+ gap: "calc($sizes$1 / 2)",
+ px: "$sizes$1",
+ fontWeight: "500",
+ textTransform: "capitalize",
+ "&:hover": { background: "none" },
+ }}
+ />
+ </Flex>
+ );
+};
+
+export { SelectControl };
diff --git a/apps/designer/app/designer/features/style-panel/controls/show-more.tsx b/apps/designer/app/designer/features/style-panel/controls/show-more.tsx
new file mode 100644
index 0000000000..b7291c1868
--- /dev/null
+++ b/apps/designer/app/designer/features/style-panel/controls/show-more.tsx
@@ -0,0 +1,30 @@
+import { useState } from "react";
+import { Flex, Button, Collapsible } from "@webstudio-is/design-system";
+import { TriangleDownIcon, TriangleRightIcon } from "@webstudio-is/icons";
+
+const ShowMore = ({
+ styleConfigs,
+}: {
+ styleConfigs: Array<JSX.Element | null>;
+}) => {
+ const [isOpen, setIsOpen] = useState(false);
+ if (styleConfigs.length === 0) return null;
+ return (
+ <Collapsible.Root asChild onOpenChange={setIsOpen}>
+ <Flex direction="column" gap="3">
+ <Collapsible.Trigger asChild>
+ <Button css={{ width: "100%", gap: "$1" }}>
+ {isOpen ? <TriangleDownIcon /> : <TriangleRightIcon />}Show more
+ </Button>
+ </Collapsible.Trigger>
+ <Collapsible.Content asChild>
+ <Flex direction="column" gap="3">
+ {styleConfigs}
+ </Flex>
+ </Collapsible.Content>
+ </Flex>
+ </Collapsible.Root>
+ );
+};
+
+export { ShowMore };
diff --git a/apps/designer/app/designer/features/style-panel/shared/spacing-widget.tsx b/apps/designer/app/designer/features/style-panel/controls/spacing-control.tsx
similarity index 81%
rename from apps/designer/app/designer/features/style-panel/shared/spacing-widget.tsx
rename to apps/designer/app/designer/features/style-panel/controls/spacing-control.tsx
index 215bd58258..9598acd7be 100644
--- a/apps/designer/app/designer/features/style-panel/shared/spacing-widget.tsx
+++ b/apps/designer/app/designer/features/style-panel/controls/spacing-control.tsx
@@ -1,22 +1,25 @@
import { useEffect, useState } from "react";
import {
+ categories,
toValue,
type StyleProperty,
type StyleValue,
} from "@webstudio-is/react-sdk";
import { Box } from "@webstudio-is/design-system";
-import { SetProperty } from "./use-style-data";
-import { useIsFromCurrentBreakpoint } from "./use-is-from-current-breakpoint";
-import { propertyNameColorForSelectedBreakpoint } from "./constants";
+import { SetProperty } from "../shared/use-style-data";
+import { useIsFromCurrentBreakpoint } from "../shared/use-is-from-current-breakpoint";
+import { propertyNameColorForSelectedBreakpoint } from "../shared/constants";
+import { getFinalValue } from "../shared/get-final-value";
+import type { ControlProps } from "../style-sections";
type SpacingSingularStyle = { [property in SpacingProperty]?: StyleValue };
-export type SpacingStyles = {
+type SpacingStyles = {
paddings: SpacingSingularStyle;
margins: SpacingSingularStyle;
};
-export type SpacingProperty = Margin | Padding;
+type SpacingProperty = Margin | Padding;
type Margin = "marginTop" | "marginRight" | "marginBottom" | "marginLeft";
@@ -158,7 +161,7 @@ type SpacingWidgetProps = {
values: SpacingStyles;
};
-export const SpacingWidget = ({ setProperty, values }: SpacingWidgetProps) => {
+const SpacingWidget = ({ setProperty, values }: SpacingWidgetProps) => {
const margins = toCss(values.margins);
const paddings = toCss(values.paddings);
@@ -239,3 +242,36 @@ export const SpacingWidget = ({ setProperty, values }: SpacingWidgetProps) => {
</Box>
);
};
+
+const SpacingControl = ({
+ currentStyle,
+ inheritedStyle,
+ setProperty,
+ styleConfig,
+}: ControlProps) => {
+ if (styleConfig.control !== "Spacing") return null;
+
+ const styles = categories.spacing.properties.reduce(
+ (acc: SpacingStyles, property: SpacingProperty): SpacingStyles => {
+ const value = getFinalValue({
+ currentStyle,
+ inheritedStyle,
+ property,
+ });
+ if (value !== undefined) {
+ if (property.includes("margin")) {
+ acc.margins[property] = value;
+ } else {
+ acc.paddings[property] = value;
+ }
+ }
+
+ return acc;
+ },
+ { margins: {}, paddings: {} } as SpacingStyles
+ );
+
+ return <SpacingWidget setProperty={setProperty} values={styles} />;
+};
+
+export { SpacingControl };
diff --git a/apps/designer/app/designer/features/style-panel/index.ts b/apps/designer/app/designer/features/style-panel/index.ts
index 65659c0a0a..6dba64fb78 100644
--- a/apps/designer/app/designer/features/style-panel/index.ts
+++ b/apps/designer/app/designer/features/style-panel/index.ts
@@ -1 +1 @@
-export { StylePanel } from "./style-panel";
+export * from "./style-panel";
diff --git a/apps/designer/app/designer/features/style-panel/sections/index.ts b/apps/designer/app/designer/features/style-panel/sections/index.ts
new file mode 100644
index 0000000000..eec9d1e67d
--- /dev/null
+++ b/apps/designer/app/designer/features/style-panel/sections/index.ts
@@ -0,0 +1 @@
+export * from "./layout";
diff --git a/apps/designer/app/designer/features/style-panel/sections/layout.tsx b/apps/designer/app/designer/features/style-panel/sections/layout.tsx
new file mode 100644
index 0000000000..bc0b391a78
--- /dev/null
+++ b/apps/designer/app/designer/features/style-panel/sections/layout.tsx
@@ -0,0 +1,101 @@
+import { Grid } from "@webstudio-is/design-system";
+import type { RenderCategoryProps } from "../style-sections";
+import { GridControl, LockControl, ShowMore } from "../controls";
+
+const CSSLayoutSection = {
+ alignItems: "center",
+ gap: "$space$styleSection",
+ "& > [data-type=iconbuttonwithmenu]": {
+ display: "flex",
+ justifyContent: "center",
+ alignItems: "center",
+ height: "100%",
+ },
+};
+
+const CSSLayoutSectionFlex = {
+ ...CSSLayoutSection,
+ gridTemplateColumns: "repeat(12, 1fr)",
+ 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 . . . . . . ."
+ "columnGap columnGap columnGap columnGap columnGap lock lock rowGap rowGap rowGap rowGap rowGap"
+ `,
+ // @todo justifyItems icons are using justifycontent icons atm
+ "& > [data-property=justifyItems]": {
+ display: "none",
+ },
+};
+
+const LayoutSectionFlex = ({
+ currentStyle,
+ createBatchUpdate,
+ styleConfigsByCategory,
+}: RenderCategoryProps) => {
+ const batchUpdate = createBatchUpdate();
+ return (
+ <Grid css={CSSLayoutSectionFlex}>
+ {styleConfigsByCategory}
+ <LockControl
+ name="lock"
+ currentStyle={{
+ columnGap: currentStyle.columnGap,
+ rowGap: currentStyle.rowGap,
+ }}
+ batchUpdate={batchUpdate}
+ />
+ <GridControl
+ name="grid"
+ currentStyle={currentStyle}
+ batchUpdate={batchUpdate}
+ />
+ </Grid>
+ );
+};
+
+const LayoutSection = ({
+ setProperty,
+ createBatchUpdate,
+ currentStyle,
+ category,
+ styleConfigsByCategory,
+ moreStyleConfigsByCategory,
+}: RenderCategoryProps) => {
+ const ActiveLayout = layouts.get(String(currentStyle.display?.value));
+
+ if (ActiveLayout) {
+ return (
+ <ActiveLayout
+ setProperty={setProperty}
+ createBatchUpdate={createBatchUpdate}
+ currentStyle={currentStyle}
+ category={category}
+ styleConfigsByCategory={styleConfigsByCategory}
+ moreStyleConfigsByCategory={moreStyleConfigsByCategory}
+ />
+ );
+ }
+
+ return (
+ <>
+ <ShowMore styleConfigs={moreStyleConfigsByCategory} />
+ {styleConfigsByCategory}
+ </>
+ );
+};
+
+const layouts = new Map([
+ ["none", null],
+ ["block", null],
+ ["inline-block", null],
+ ["flex", LayoutSectionFlex],
+ ["inline-flex", LayoutSectionFlex],
+ ["grid", null],
+ ["inline-grid", null],
+]);
+
+export { LayoutSection };
diff --git a/apps/designer/app/designer/features/style-panel/shared/get-final-value.ts b/apps/designer/app/designer/features/style-panel/shared/get-final-value.ts
new file mode 100644
index 0000000000..67b3c5db0c
--- /dev/null
+++ b/apps/designer/app/designer/features/style-panel/shared/get-final-value.ts
@@ -0,0 +1,23 @@
+import type { Style, StyleValue, StyleProperty } from "@webstudio-is/react-sdk";
+import type { InheritedStyle } from "./get-inherited-style";
+
+// @todo expose which instance we inherited the value from
+const getFinalValue = ({
+ currentStyle,
+ inheritedStyle,
+ property,
+}: {
+ currentStyle: Style;
+ inheritedStyle: InheritedStyle;
+ property: StyleProperty;
+}): StyleValue | void => {
+ const currentValue = currentStyle[property];
+ const inheritedValue =
+ property in inheritedStyle ? inheritedStyle[property].value : undefined;
+ if (currentValue?.value === "inherit" && inheritedValue !== undefined) {
+ return inheritedValue;
+ }
+ return currentValue;
+};
+
+export { getFinalValue };
diff --git a/apps/designer/app/designer/features/style-panel/style-panel.tsx b/apps/designer/app/designer/features/style-panel/style-panel.tsx
index d8a4bfb79c..48871cc673 100644
--- a/apps/designer/app/designer/features/style-panel/style-panel.tsx
+++ b/apps/designer/app/designer/features/style-panel/style-panel.tsx
@@ -17,10 +17,7 @@ type StylePanelProps = {
selectedInstanceData?: SelectedInstanceData;
};
-export const StylePanel = ({
- selectedInstanceData,
- publish,
-}: StylePanelProps) => {
+const StylePanel = ({ selectedInstanceData, publish }: StylePanelProps) => {
const { currentStyle, inheritedStyle, setProperty, createBatchUpdate } =
useStyleData({
selectedInstanceData,
@@ -75,3 +72,5 @@ export const StylePanel = ({
</>
);
};
+
+export { StylePanel };
diff --git a/apps/designer/app/designer/features/style-panel/style-section.tsx b/apps/designer/app/designer/features/style-panel/style-section.tsx
deleted file mode 100644
index 9151744011..0000000000
--- a/apps/designer/app/designer/features/style-panel/style-section.tsx
+++ /dev/null
@@ -1,777 +0,0 @@
-import {
- useState,
- KeyboardEvent,
- // useCallback,
-} from "react";
-import {
- Box,
- Flex,
- Grid,
- Label,
- Text,
- Button,
- Collapsible,
- Combobox,
- IconButtonWithMenu,
- Select,
- IconButton,
- TextField,
- Tooltip,
- // numericScrubControl,
-} from "@webstudio-is/design-system";
-import { TriangleRightIcon, TriangleDownIcon } from "@webstudio-is/icons";
-import * as icons from "@webstudio-is/icons";
-import type { StyleConfig } from "./shared/configs";
-import {
- categories,
- type Style,
- type StyleProperty,
- type Category,
- type StyleValue,
- type CSS,
-} from "@webstudio-is/react-sdk";
-import type { SetProperty, CreateBatchUpdate } from "./shared/use-style-data";
-import type { InheritedStyle } from "./shared/get-inherited-style";
-import { ColorPicker } from "./shared/color-picker";
-import {
- SpacingWidget,
- type SpacingProperty,
- type SpacingStyles,
-} from "./shared/spacing-widget";
-import { useIsFromCurrentBreakpoint } from "./shared/use-is-from-current-breakpoint";
-import { propertyNameColorForSelectedBreakpoint } from "./shared/constants";
-
-const getFinalValue = ({
- currentStyle,
- inheritedStyle,
- property,
-}: {
- currentStyle: Style;
- inheritedStyle: InheritedStyle;
- property: StyleProperty;
-}): StyleValue | void => {
- const currentValue = currentStyle[property];
- const inheritedValue =
- property in inheritedStyle ? inheritedStyle[property].value : undefined;
- if (currentValue?.value === "inherit" && inheritedValue !== undefined) {
- return inheritedValue;
- }
- return currentValue;
-};
-
-type PropertyProps = {
- property: StyleProperty;
- label: string;
- css?: CSS;
-};
-
-const PropertyName = ({ property, label, css }: PropertyProps) => {
- const isCurrentBreakpoint = useIsFromCurrentBreakpoint(property);
-
- return (
- <Label
- css={{
- gridColumn: "1",
- ...(isCurrentBreakpoint
- ? {
- color: propertyNameColorForSelectedBreakpoint,
- backgroundColor: "$colors$blue4",
- padding: "calc($radii$1 / 2) $radii$1",
- borderRadius: "$radii$1",
- }
- : {
- color: "$hiContrast",
- }),
- ...css,
- }}
- variant="contrast"
- size="1"
- htmlFor={property}
- >
- {label}
- </Label>
- );
-};
-
-const Unit = ({ value }: { value: StyleValue }) => {
- if (value.type !== "unit" || value.unit === "number") return null;
- return (
- <Text
- css={{
- fontSize: "$1",
- cursor: "default",
- }}
- >
- {value.unit}
- </Text>
- );
-};
-
-type ControlProps = {
- setProperty: SetProperty;
- currentStyle: Style;
- inheritedStyle: InheritedStyle;
- styleConfig: StyleConfig;
- category: Category;
-};
-
-const ColorControl = ({
- currentStyle,
- inheritedStyle,
- setProperty,
- styleConfig,
-}: ControlProps) => {
- if (styleConfig.control !== "Color") return null;
- // @todo show which instance we inherited the value from
- const value = getFinalValue({
- currentStyle,
- inheritedStyle,
- property: styleConfig.property,
- });
- if (value === undefined) return null;
- const setValue = setProperty(styleConfig.property);
-
- return (
- <Grid columns={2} align="center" gapX="1">
- <PropertyName property={styleConfig.property} label={styleConfig.label} />
- <Flex align="center" css={{ gridColumn: "2/4" }} gap="1">
- <ColorPicker
- id={styleConfig.property}
- value={String(value.value)}
- onChange={(value) => {
- setValue(value, { isEphemeral: true });
- }}
- onChangeComplete={setValue}
- />
- </Flex>
- </Grid>
- );
-};
-
-const SpacingControl = ({
- currentStyle,
- inheritedStyle,
- setProperty,
- styleConfig,
-}: ControlProps) => {
- if (styleConfig.control !== "Spacing") return null;
-
- const styles = categories.spacing.properties.reduce(
- (acc: SpacingStyles, property: SpacingProperty): SpacingStyles => {
- const value = getFinalValue({
- currentStyle,
- inheritedStyle,
- property,
- });
- if (value !== undefined) {
- if (property.includes("margin")) {
- acc.margins[property] = value;
- } else {
- acc.paddings[property] = value;
- }
- }
-
- return acc;
- },
- { margins: {}, paddings: {} } as SpacingStyles
- );
-
- return <SpacingWidget setProperty={setProperty} values={styles} />;
-};
-
-// @todo
-// This is a cursor image for drag&drop value changing on the input by dragging horizontally
-//const svgCursor =
-// '<svg width="15" height="15" viewBox="0 0 15 15" xmlns="http://www.w3.org/2000/svg"><path d="M8.00012 1.5C8.00012 1.22386 7.77626 1 7.50012 1C7.22398 1 7.00012 1.22386 7.00012 1.5V13.5C7.00012 13.7761 7.22398 14 7.50012 14C7.77626 14 8.00012 13.7761 8.00012 13.5V1.5ZM3.31812 5.818C3.49386 5.64227 3.49386 5.35734 3.31812 5.18161C3.14239 5.00587 2.85746 5.00587 2.68173 5.18161L0.681729 7.18161C0.505993 7.35734 0.505993 7.64227 0.681729 7.818L2.68173 9.818C2.85746 9.99374 3.14239 9.99374 3.31812 9.818C3.49386 9.64227 3.49386 9.35734 3.31812 9.18161L2.08632 7.9498H5.50017C5.7487 7.9498 5.95017 7.74833 5.95017 7.4998C5.95017 7.25128 5.7487 7.0498 5.50017 7.0498H2.08632L3.31812 5.818ZM12.3181 5.18161C12.1424 5.00587 11.8575 5.00587 11.6817 5.18161C11.506 5.35734 11.506 5.64227 11.6817 5.818L12.9135 7.0498H9.50017C9.25164 7.0498 9.05017 7.25128 9.05017 7.4998C9.05017 7.74833 9.25164 7.9498 9.50017 7.9498H12.9135L11.6817 9.18161C11.506 9.35734 11.506 9.64227 11.6817 9.818C11.8575 9.99374 12.1424 9.99374 12.3181 9.818L14.3181 7.818C14.4939 7.64227 14.4939 7.35734 14.3181 7.18161L12.3181 5.18161Z" fill="#fff"></path></svg>';
-
-//const cursorUrl = `data:image/svg+xml;base64,${btoa(svgCursor)}`;
-
-const ComboboxControl = ({
- currentStyle,
- inheritedStyle,
- setProperty,
- styleConfig,
- category,
-}: ControlProps) => {
- const isCurrentBreakpoint = useIsFromCurrentBreakpoint(styleConfig.property);
-
- // @todo, better hook abstraction(use effects), update value, should be part of the updated(per next todo below) combobox abstraction
- // const refCallback = useCallback((node: HTMLElement) => {
- // let disconnectedCallback = () => {};
- // if (node) {
- // disconnectedCallback = numericScrubControl(node, {
- // minValue: 0,
- // initialValue: parseFloat(String(value?.value)) || 0,
- // onValueChange: (event) => {
- // event.target.parentNode.querySelector("input").value = event.value;
- // },
- // }).disconnectedCallback;
- // } else {
- // disconnectedCallback?.();
- // }
- // }, []);
-
- // if (styleConfig.control !== "Combobox") return null;
-
- // @todo show which instance we inherited the value from
- const value = getFinalValue({
- currentStyle,
- inheritedStyle,
- property: styleConfig.property,
- });
-
- if (value === undefined) return null;
-
- const setValue = setProperty(styleConfig.property);
-
- switch (styleConfig.property) {
- case "rowGap":
- case "columnGap": {
- switch (category) {
- case "layout": {
- // @todo display sectons should filter what they render instead of relying on MDN data
- if (String(currentStyle.display?.value).includes("flex") !== true)
- break;
- const Icon = (
- icons as unknown as {
- gap: Record<string, (props: unknown) => JSX.Element>;
- }
- ).gap[styleConfig.property];
- // @todo abstract to a variant of the combobox component
- return (
- <Grid
- css={{
- gridTemplateColumns: "repeat(4, 1fr)",
- gridTemplateRows: "repeat(1, 1fr)",
- }}
- >
- <Tooltip
- content={styleConfig.label}
- delayDuration={700}
- disableHoverableContent={true}
- >
- <IconButton
- // ref={refCallback}
- variant="ghost"
- size="1"
- css={{
- zIndex: 1,
- gridArea: "1 / 1 / 2 / 2",
- marginLeft: 2,
- marginTop: 2,
- borderRadius: 1,
- height: "calc($sizes$5 - 4px)",
- width: "calc($sizes$5 - 4px)",
- "&:focus": {
- boxShadow: "none",
- },
- ...(isCurrentBreakpoint && {
- bc: "$colors$blue4",
- "& svg *": {
- fill: "$colors$blue11",
- },
- }),
- }}
- >
- <Icon />
- </IconButton>
- </Tooltip>
- <TextField
- type="number"
- defaultValue={parseFloat(String(value.value)) || 0}
- // @todo looses input state and focus
- // onChange={(event: ChangeEvent<HTMLInputElement>) => setValue(event.target.value + "px")
- onKeyDown={(event: KeyboardEvent<HTMLInputElement>) =>
- event.key === "Enter" &&
- setValue(event.currentTarget.value + "px")
- }
- css={{
- fontWeight: "500",
- paddingLeft: "calc($5 + 6px)",
- gridArea: "1 / 1 / -1 / -1",
- cursor: "default",
- }}
- />
- </Grid>
- );
- }
- }
- }
- }
-
- return (
- <Grid columns={2} align="center" gapX="1">
- {/* @todo needs icon variant */}
- <PropertyName property={styleConfig.property} label={styleConfig.label} />
- <Flex align="center" css={{ gridColumn: "2/4" }} gap="1">
- <Combobox
- label={styleConfig.property}
- items={styleConfig.items}
- // state={value.type === "invalid" ? "invalid" : undefined}
- value={String(value.value)}
- // @todo new combobox doesn't include any of these event handlers
- // onValueSelect={setValue}
- // onValueEnter={setValue}
- // onItemEnter={(value: unknown) => {
- // setValue(value as string, { isEphemeral: true });
- // }}
- // onItemLeave={() => {
- // setValue(String(value.value), { isEphemeral: true });
- // }}
- />
- <Unit value={value} />
- </Flex>
- </Grid>
- );
-};
-
-const SelectControl = ({
- currentStyle,
- inheritedStyle,
- setProperty,
- styleConfig,
-}: ControlProps) => {
- // @todo show which instance we inherited the value from
- const value = getFinalValue({
- currentStyle,
- inheritedStyle,
- property: styleConfig.property,
- });
-
- if (value === undefined) return null;
-
- const setValue = setProperty(styleConfig.property);
-
- return (
- <Flex align="center">
- <PropertyName
- property={styleConfig.property}
- label={styleConfig.label}
- css={{
- fontWeight: "500",
- marginRight: "$sizes$1",
- }}
- />
- <Select
- options={styleConfig.items.map(({ label }) => label)}
- value={String(value.value)}
- onChange={setValue}
- ghost
- css={{
- gap: "calc($sizes$1 / 2)",
- px: "$sizes$1",
- fontWeight: "500",
- textTransform: "capitalize",
- "&:hover": { background: "none" },
- }}
- />
- </Flex>
- );
-};
-
-const IconButtonWithMenuControl = ({
- currentStyle,
- inheritedStyle,
- setProperty,
- styleConfig,
- category,
-}: ControlProps) => {
- const value = getFinalValue({
- currentStyle,
- inheritedStyle,
- property: styleConfig.property,
- });
- const isCurrentBreakpoint = useIsFromCurrentBreakpoint(styleConfig.property);
-
- if (value === undefined) return null;
-
- const setValue = setProperty(styleConfig.property);
- const currentValue = value.value as string;
-
- if (String(currentStyle.display?.value).includes("flex") !== true) {
- return (
- <ComboboxControl
- currentStyle={currentStyle}
- inheritedStyle={inheritedStyle}
- setProperty={setProperty}
- styleConfig={styleConfig}
- category={category}
- />
- );
- }
-
- return (
- <IconButtonWithMenu
- label={styleConfig.label}
- items={styleConfig.items}
- value={String(currentValue)}
- onChange={setValue}
- icons={
- (
- icons as unknown as Record<
- string,
- Record<string, (props: unknown) => JSX.Element>
- >
- )[styleConfig.property]
- }
- css={{
- ...(styleConfig.property !== "flexDirection" && {
- svg: {
- transform: `rotate(${
- currentStyle.flexDirection?.value === "column"
- ? 90 * (styleConfig.property === "alignItems" ? -1 : 1)
- : 0
- }deg)`,
- },
- }),
- ...(isCurrentBreakpoint && {
- color: "$colors$blue11",
- backgroundColor: "$colors$blue4",
- "&:not([data-state=open]):hover": {
- backgroundColor: "$colors$blue4",
- },
- }),
- }}
- ></IconButtonWithMenu>
- );
-};
-
-const GridControl = ({
- name,
- currentStyle,
- createBatchUpdate,
-}: {
- name: string;
- currentStyle: Style;
- createBatchUpdate: CreateBatchUpdate;
-}) => {
- const isCurrentBreakpoint = useIsFromCurrentBreakpoint([
- "flexDirection",
- "flexWrap",
- "justifyContent",
- "justifyItems",
- "alignContent",
- "alignItems",
- "rowGap",
- "columnGap",
- ]);
- const flexDirection = currentStyle.flexDirection?.value as string;
- const justifyContent = currentStyle.justifyContent?.value as string;
- const alignItems = currentStyle.alignItems?.value as string;
- const direction = Number(flexDirection.includes("column"));
- const cells = [
- "_0_0",
- "_0_1",
- "_0_2",
- "_1_0",
- "_1_1",
- "_1_2",
- "_2_0",
- "_2_1",
- "_2_2",
- ];
- const row = (
- { normal: 0, start: 0, center: 1, end: 2 } as Record<string, number>
- )[alignItems];
- const column = (
- { normal: 0, start: 0, center: 1, end: 2 } as Record<string, number>
- )[justifyContent];
- const position = row * 3 + column;
- const batch = createBatchUpdate();
- const setAlignItems = batch.setProperty("alignItems");
- const setJustifyContent = batch.setProperty("justifyContent");
-
- return (
- <Grid
- data-property={name}
- css={{
- gridArea: name,
- alignItems: "center",
- gridTemplateColumns: "repeat(3, 1fr)",
- gridTemplateRows: "repeat(3, 1fr)",
- gridTemplateAreas: `
- "${cells.slice(0, 0 + 3).join(" ")}"
- "${cells.slice(3, 3 + 3).join(" ")}"
- "${cells.slice(6, 6 + 3).join(" ")}"
- `,
- gap: "1px",
- width: "100%",
- aspectRatio: "1 / 1",
- padding: "6px",
- borderRadius: "4px",
- color: isCurrentBreakpoint ? "$colors$blue9" : "$colors$slate8",
- background: "$loContrast",
- border: "2px solid currentColor",
- transform: direction
- ? "rotate(-90deg) scaleX(-1)"
- : "rotate(0deg) scaleX(1)",
- }}
- >
- {cells.map((value, index) => (
- <Flex
- justify="center"
- align="center"
- key={index}
- css={{
- gridArea: value,
- width: "100%",
- height: "100%",
- }}
- >
- <IconButton
- css={{
- width: "100%",
- height: "100%",
- color: "$colors$gray8",
- "&:focus": { boxShadow: "none" },
- }}
- onClick={() => {
- const [alignItems, justifyContent] = cells[index]
- .slice(1)
- .split("_")
- .map((value) => ["start", "center", "end"][parseFloat(value)]);
- setAlignItems(alignItems);
- setJustifyContent(justifyContent);
- batch.publish();
- }}
- >
- <icons.DotFilledIcon></icons.DotFilledIcon>
- </IconButton>
- </Flex>
- ))}
- <Flex
- css={{
- gridArea: cells[position],
- alignItems:
- `start center end start center end start center end`.split(" ")[
- position
- ],
- flexDirection: "column",
- width: "100%",
- height: "100%",
- gap: "calc($sizes$1 / 2)",
- color: "currentColor",
- }}
- >
- {["60%", "100%", "60%"].map((value, index) => (
- <Flex
- key={index}
- css={{
- blockSize: "calc(100% / 3)",
- inlineSize: value,
- background: "currentColor",
- borderRadius: "calc($radii$1 / 2)",
- }}
- ></Flex>
- ))}
- </Flex>
- </Grid>
- );
-};
-
-const LockControl = ({
- name,
-}: // currentStyle,
-// setProperty,
-{
- name: string;
- currentStyle: Style;
- setProperty: SetProperty;
-}) => {
- return (
- <IconButton data-property={name} css={{ width: "100%", gridArea: name }}>
- <icons.lock.opened />
- </IconButton>
- );
-};
-
-const ShowMore = ({
- styleConfigs,
-}: {
- styleConfigs: Array<JSX.Element | null>;
-}) => {
- const [isOpen, setIsOpen] = useState(false);
- if (styleConfigs.length === 0) return null;
- return (
- <Collapsible.Root asChild onOpenChange={setIsOpen}>
- <Flex direction="column" gap="3">
- <Collapsible.Trigger asChild>
- <Button css={{ width: "100%", gap: "$1" }}>
- {isOpen ? <TriangleDownIcon /> : <TriangleRightIcon />}Show more
- </Button>
- </Collapsible.Trigger>
- <Collapsible.Content asChild>
- <Flex direction="column" gap="3">
- {styleConfigs}
- </Flex>
- </Collapsible.Content>
- </Flex>
- </Collapsible.Root>
- );
-};
-
-type RenderPropertyProps = {
- setProperty: SetProperty;
- currentStyle: Style;
- inheritedStyle: InheritedStyle;
- styleConfig: StyleConfig;
- category: Category;
-};
-
-export const renderProperty = ({
- currentStyle,
- inheritedStyle,
- setProperty,
- styleConfig,
- category,
-}: RenderPropertyProps) => {
- const Control = controls[styleConfig.control];
- const { property } = styleConfig;
- const key = category + "-" + property;
- if (!Control) return null;
- return (
- <Box
- key={key}
- data-type={styleConfig.control.toLowerCase()}
- data-property={property}
- css={{ gridArea: property }}
- >
- <Control
- currentStyle={currentStyle}
- inheritedStyle={inheritedStyle}
- setProperty={setProperty}
- styleConfig={styleConfig}
- category={category}
- />
- </Box>
- );
-};
-
-type RenderCategoryProps = {
- setProperty: SetProperty;
- createBatchUpdate: CreateBatchUpdate;
- currentStyle: Style;
- category: Category;
- styleConfigsByCategory: Array<JSX.Element | null>;
- moreStyleConfigsByCategory: Array<JSX.Element | null>;
-};
-// 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,
- createBatchUpdate,
- currentStyle,
- category,
- styleConfigsByCategory,
- moreStyleConfigsByCategory,
-}: RenderCategoryProps) => {
- switch (category) {
- case "layout": {
- const css = {
- alignItems: "center",
- gap: "$space$styleSection",
- "& > [data-type=iconbuttonwithmenu]": {
- display: "flex",
- justifyContent: "center",
- alignItems: "center",
- height: "100%",
- },
- };
- switch (currentStyle.display?.value) {
- case "inline-flex":
- case "flex": {
- return (
- <>
- <Grid
- css={{
- ...css,
- gridTemplateColumns: "repeat(12, 1fr)",
- gridTemplateRows: "auto 0px auto auto 0px auto",
- gridTemplateAreas: `
- "${"display ".repeat(12)}"
- "${"grid ".repeat(5)} . . . . . . ."
- "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)}"
- `,
- // @todo justifyItems icons are using justifycontent icons atm
- "& > [data-property=justifyItems]": {
- display: "none",
- },
- }}
- >
- {styleConfigsByCategory}
- <LockControl
- name="lock"
- currentStyle={currentStyle}
- setProperty={setProperty}
- />
- <GridControl
- name="grid"
- currentStyle={currentStyle}
- createBatchUpdate={createBatchUpdate}
- />
- </Grid>
- <ShowMore styleConfigs={moreStyleConfigsByCategory} />
- </>
- );
- }
- case "grid": {
- // @todo general structure of how other sections would be layed out, commented for now because we don't yet have a design for the grid section
- // return (
- // <>
- // <Grid
- // css={{
- // ...css,
- // gridTemplateColumns: "repeat(12, 1fr)",
- // gridTemplateRows: "repeat(11, auto)",
- // gridTemplateAreas: `
- // "${"display ".repeat(12)}"
- // "${"gridTemplateAreas ".repeat(12)}"
- // "${"gridAutoRows ".repeat(12)}"
- // "${"gridAutoColumns ".repeat(12)}"
- // "${"gridTemplateColumns ".repeat(12)}"
- // "${"gridTemplateRows ".repeat(12)}"
- // "${"gridAutoFlow ".repeat(12)}"
- // "${"alignItems ".repeat(12)}"
- // "${"justifyItems ".repeat(12)}"
- // "${"alignContent ".repeat(12)}"
- // "${"columnGap ".repeat(5)} lock lock ${"rowGap ".repeat(5)}"
- // `,
- // }}
- // >
- // {styleConfigsByCategory}
- // <LockControl
- // data-property="lock"
- // css={{ gridArea: "lock" }}
- // currentStyle={currentStyle}
- // setProperty={setProperty}
- // />
- // </Grid>
- // <ShowMore styleConfigs={moreStyleConfigsByCategory} />
- // </>
- // );
- }
- }
- }
- }
-
- return (
- <>
- {styleConfigsByCategory}
- <ShowMore styleConfigs={moreStyleConfigsByCategory} />
- </>
- );
-};
-
-const controls: {
- [key: string]: ((props: ControlProps) => JSX.Element | null) | null;
-} = {
- Empty: null,
- Color: ColorControl,
- Spacing: SpacingControl,
- Combobox: ComboboxControl,
- IconButtonWithMenu: IconButtonWithMenuControl,
- Select: SelectControl,
-};
diff --git a/apps/designer/app/designer/features/style-panel/style-sections.tsx b/apps/designer/app/designer/features/style-panel/style-sections.tsx
new file mode 100644
index 0000000000..c72d375523
--- /dev/null
+++ b/apps/designer/app/designer/features/style-panel/style-sections.tsx
@@ -0,0 +1,131 @@
+import { Box } from "@webstudio-is/design-system";
+import type { StyleConfig } from "./shared/configs";
+import {
+ type Style,
+ type StyleProperty,
+ type Category,
+ type CSS,
+} from "@webstudio-is/react-sdk";
+import type { SetProperty, CreateBatchUpdate } from "./shared/use-style-data";
+import type { InheritedStyle } from "./shared/get-inherited-style";
+import {
+ ColorControl,
+ SpacingControl,
+ ComboboxControl,
+ SelectControl,
+ IconButtonWithMenuControl,
+ ShowMore,
+} from "./controls";
+import { LayoutSection } from "./sections";
+
+type PropertyProps = {
+ property: StyleProperty;
+ label: string;
+ css?: CSS;
+};
+
+type ControlProps = {
+ setProperty: SetProperty;
+ currentStyle: Style;
+ inheritedStyle: InheritedStyle;
+ styleConfig: StyleConfig;
+ category: Category;
+};
+
+type RenderCategoryProps = {
+ setProperty: SetProperty;
+ createBatchUpdate: CreateBatchUpdate;
+ currentStyle: Style;
+ category: Category;
+ styleConfigsByCategory: Array<JSX.Element | null>;
+ moreStyleConfigsByCategory: Array<JSX.Element | null>;
+};
+
+type RenderPropertyProps = {
+ setProperty: SetProperty;
+ currentStyle: Style;
+ inheritedStyle: InheritedStyle;
+ styleConfig: StyleConfig;
+ category: Category;
+};
+
+const renderProperty = ({
+ currentStyle,
+ inheritedStyle,
+ setProperty,
+ styleConfig,
+ category,
+}: RenderPropertyProps) => {
+ const Control = controls[styleConfig.control];
+ const { property } = styleConfig;
+ if (!Control) return null;
+ return (
+ <Box
+ key={category + property}
+ data-control={styleConfig.control.toLowerCase()}
+ data-property={property}
+ css={{ gridArea: property }}
+ >
+ <Control
+ currentStyle={currentStyle}
+ inheritedStyle={inheritedStyle}
+ setProperty={setProperty}
+ styleConfig={styleConfig}
+ category={category}
+ />
+ </Box>
+ );
+};
+
+const renderCategory = ({
+ setProperty,
+ createBatchUpdate,
+ currentStyle,
+ category,
+ styleConfigsByCategory,
+ moreStyleConfigsByCategory,
+}: RenderCategoryProps) => {
+ const Category = sections[category];
+ if (!Category) {
+ return (
+ <>
+ {styleConfigsByCategory}
+ <ShowMore styleConfigs={moreStyleConfigsByCategory} />
+ </>
+ );
+ }
+
+ return (
+ <Category
+ setProperty={setProperty}
+ createBatchUpdate={createBatchUpdate}
+ currentStyle={currentStyle}
+ category={category}
+ styleConfigsByCategory={styleConfigsByCategory}
+ moreStyleConfigsByCategory={moreStyleConfigsByCategory}
+ />
+ );
+};
+
+const sections: {
+ [key: string]: (props: RenderCategoryProps) => JSX.Element | null;
+} = {
+ layout: LayoutSection,
+};
+const controls: {
+ [key: string]: (props: ControlProps) => JSX.Element | null;
+} = {
+ Color: ColorControl,
+ Spacing: SpacingControl,
+ Combobox: ComboboxControl,
+ IconButtonWithMenu: IconButtonWithMenuControl,
+ Select: SelectControl,
+};
+
+export { renderCategory, renderProperty };
+export type {
+ PropertyProps,
+ ControlProps,
+ RenderCategoryProps,
+ RenderPropertyProps,
+};
diff --git a/apps/designer/app/designer/features/style-panel/style-settings.tsx b/apps/designer/app/designer/features/style-panel/style-settings.tsx
index b59b0268e4..9728fbcb52 100644
--- a/apps/designer/app/designer/features/style-panel/style-settings.tsx
+++ b/apps/designer/app/designer/features/style-panel/style-settings.tsx
@@ -8,7 +8,7 @@ import {
import { type StyleConfig, styleConfigs } from "./shared/configs";
import { CollapsibleSection } from "~/designer/shared/inspector";
-import { renderProperty, renderCategory } from "./style-section";
+import { renderProperty, renderCategory } from "./style-sections";
import { dependencies } from "./shared/dependencies";
import { type InheritedStyle } from "./shared/get-inherited-style";
import {
@@ -77,7 +77,7 @@ type StyleSettingsProps = {
search: string;
};
-export const StyleSettings = ({
+const StyleSettings = ({
setProperty,
createBatchUpdate,
currentStyle,
@@ -152,3 +152,5 @@ export const StyleSettings = ({
}
return <>{all}</>;
};
+
+export { StyleSettings };
diff --git a/packages/design-system/src/components/icon-button-with-menu.tsx b/packages/design-system/src/components/icon-button-with-menu.tsx
index d87f2477e6..7190be06e0 100644
--- a/packages/design-system/src/components/icon-button-with-menu.tsx
+++ b/packages/design-system/src/components/icon-button-with-menu.tsx
@@ -1,8 +1,7 @@
import React from "react";
-import { CheckIcon } from "@webstudio-is/icons";
+import { CheckIcon, IconComponent } from "@webstudio-is/icons";
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
-import { styled, CSS } from "../stitches.config";
-import { Box } from "./box";
+import { styled } from "../stitches.config";
import { Tooltip } from "./tooltip";
const StyledContent = styled(DropdownMenuPrimitive.Content, {
@@ -85,17 +84,20 @@ export const IconButtonWithMenu = ({
value,
items,
onChange,
- icons,
- css,
+ isFromCurrentBreakpoint,
}: {
label: string;
value: string;
- items: Array<{ label: string; name: string }>;
+ items: Array<{
+ label: string;
+ name: string;
+ icon: ReturnType<IconComponent>;
+ }>;
onChange: (value: string) => void;
- icons: Record<string, (props: unknown) => JSX.Element>;
- css: CSS;
+ isFromCurrentBreakpoint: boolean;
}) => {
- const TriggerIcon = icons?.[value];
+ const activeItem = items.find(({ name }) => name === value);
+ const TriggerIcon = activeItem?.icon;
return (
<DropdownMenuPrimitive.Root modal={false}>
<Tooltip
@@ -104,7 +106,21 @@ export const IconButtonWithMenu = ({
disableHoverableContent={true}
>
<DropdownMenuPrimitive.Trigger asChild>
- <IconButton css={css}>{TriggerIcon && <TriggerIcon />}</IconButton>
+ <IconButton
+ css={
+ isFromCurrentBreakpoint
+ ? {
+ color: "$colors$blue11",
+ backgroundColor: "$colors$blue4",
+ "&:not([data-state=open]):hover": {
+ backgroundColor: "$colors$blue4",
+ },
+ }
+ : {}
+ }
+ >
+ {TriggerIcon}
+ </IconButton>
</DropdownMenuPrimitive.Trigger>
</Tooltip>
@@ -113,17 +129,13 @@ export const IconButtonWithMenu = ({
value={value}
onValueChange={onChange}
>
- {items.map(({ name, label }: { name: string; label: string }) => {
- const ItemIcon = icons[name];
- if (!ItemIcon) return null;
+ {items.map(({ name, label, icon }) => {
return (
<StyledRadioItem key={name} value={label}>
<StyledItemIndicator>
<CheckIcon />
</StyledItemIndicator>
- <Box css={{ svg: css.svg }}>
- <ItemIcon />
- </Box>
+ {icon}
{label}
</StyledRadioItem>
);
diff --git a/packages/icons/src/align-content-center.tsx b/packages/icons/src/align-content-center.tsx
new file mode 100644
index 0000000000..b3721515f1
--- /dev/null
+++ b/packages/icons/src/align-content-center.tsx
@@ -0,0 +1,26 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const AlignContentCenter = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M8 6H11V9H8V6ZM4 11.5H20V12.5H4V11.5ZM16 6H13V9H16V6ZM13 15H16V18H13V15ZM11 15H8V18H11V15Z"
+ fill={color}
+ />
+ </svg>
+ );
+ }
+);
+AlignContentCenter.displayName = "AlignContentCenter";
diff --git a/packages/icons/src/align-content-end.tsx b/packages/icons/src/align-content-end.tsx
new file mode 100644
index 0000000000..07fc83ec7b
--- /dev/null
+++ b/packages/icons/src/align-content-end.tsx
@@ -0,0 +1,26 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const AlignContentEnd = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M8 8H11V11H8V8ZM4 18H20V19H4V18ZM16 8H13V11H16V8ZM13 13H16V16H13V13ZM11 13H8V16H11V13Z"
+ fill={color}
+ />
+ </svg>
+ );
+ }
+);
+AlignContentEnd.displayName = "AlignContentEnd";
diff --git a/packages/icons/src/align-content-space-around.tsx b/packages/icons/src/align-content-space-around.tsx
new file mode 100644
index 0000000000..42f8572fde
--- /dev/null
+++ b/packages/icons/src/align-content-space-around.tsx
@@ -0,0 +1,27 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const AlignContentSpaceAround = React.forwardRef<
+ SVGSVGElement,
+ IconProps
+>(({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M19 5H5V6H19V5ZM19 18H5V19H19V18ZM8 8H11V11H8V8ZM16 8H13V11H16V8ZM13 13H16V16H13V13ZM11 13H8V16H11V13Z"
+ fill={color}
+ />
+ </svg>
+ );
+});
+AlignContentSpaceAround.displayName = "AlignContentSpaceAround";
diff --git a/packages/icons/src/align-content-space-between.tsx b/packages/icons/src/align-content-space-between.tsx
new file mode 100644
index 0000000000..24e18919c7
--- /dev/null
+++ b/packages/icons/src/align-content-space-between.tsx
@@ -0,0 +1,27 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const AlignContentSpaceBetween = React.forwardRef<
+ SVGSVGElement,
+ IconProps
+>(({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M19 5H5V6H19V5ZM19 18H5V19H19V18ZM8 8H11V11H8V8ZM16 8H13V11H16V8ZM13 13H16V16H13V13ZM11 13H8V16H11V13Z"
+ fill={color}
+ />
+ </svg>
+ );
+});
+AlignContentSpaceBetween.displayName = "AlignContentSpaceBetween";
diff --git a/packages/icons/src/align-content-start.tsx b/packages/icons/src/align-content-start.tsx
new file mode 100644
index 0000000000..16e6170c7a
--- /dev/null
+++ b/packages/icons/src/align-content-start.tsx
@@ -0,0 +1,25 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const AlignContentStart = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path d="M4 6H20V7H4V6Z" fill={color} />
+ <path d="M8 9H11V12H8V9Z" fill={color} />
+ <path d="M16 9H13V12H16V9Z" fill={color} />
+ <path d="M13 14H16V17H13V14Z" fill={color} />
+ <path d="M11 14H8V17H11V14Z" fill={color} />
+ </svg>
+ );
+ }
+);
+AlignContentStart.displayName = "AlignContentStart";
diff --git a/packages/icons/src/align-content-stretch.tsx b/packages/icons/src/align-content-stretch.tsx
new file mode 100644
index 0000000000..950d8efca8
--- /dev/null
+++ b/packages/icons/src/align-content-stretch.tsx
@@ -0,0 +1,26 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const AlignContentStretch = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M19 5H5V6H19V5ZM19 18H5V19H19V18ZM8 8H11V11H8V8ZM16 8H13V11H16V8ZM13 13H16V16H13V13ZM11 13H8V16H11V13Z"
+ fill={color}
+ />
+ </svg>
+ );
+ }
+);
+AlignContentStretch.displayName = "AlignContentStretch";
diff --git a/packages/icons/src/align-content.tsx b/packages/icons/src/align-content.tsx
deleted file mode 100644
index 8208b58b57..0000000000
--- a/packages/icons/src/align-content.tsx
+++ /dev/null
@@ -1,157 +0,0 @@
-import * as React from "react";
-import { IconProps } from "./types";
-
-export const AlignContentStart = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path d="M4 6H20V7H4V6Z" fill={color} />
- <path d="M8 9H11V12H8V9Z" fill={color} />
- <path d="M16 9H13V12H16V9Z" fill={color} />
- <path d="M13 14H16V17H13V14Z" fill={color} />
- <path d="M11 14H8V17H11V14Z" fill={color} />
- </svg>
- );
- }
-);
-AlignContentStart.displayName = "AlignContentStart";
-
-export const AlignContentCenter = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M8 6H11V9H8V6ZM4 11.5H20V12.5H4V11.5ZM16 6H13V9H16V6ZM13 15H16V18H13V15ZM11 15H8V18H11V15Z"
- fill={color}
- />
- </svg>
- );
- }
-);
-AlignContentCenter.displayName = "AlignContentCenter";
-
-export const AlignContentEnd = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M8 8H11V11H8V8ZM4 18H20V19H4V18ZM16 8H13V11H16V8ZM13 13H16V16H13V13ZM11 13H8V16H11V13Z"
- fill={color}
- />
- </svg>
- );
- }
-);
-AlignContentEnd.displayName = "AlignContentEnd";
-
-export const AlignContentStretch = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M19 5H5V6H19V5ZM19 18H5V19H19V18ZM8 8H11V11H8V8ZM16 8H13V11H16V8ZM13 13H16V16H13V13ZM11 13H8V16H11V13Z"
- fill={color}
- />
- </svg>
- );
- }
-);
-AlignContentStretch.displayName = "AlignContentStretch";
-
-export const AlignContentSpaceAround = React.forwardRef<
- SVGSVGElement,
- IconProps
->(({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M19 5H5V6H19V5ZM19 18H5V19H19V18ZM8 8H11V11H8V8ZM16 8H13V11H16V8ZM13 13H16V16H13V13ZM11 13H8V16H11V13Z"
- fill={color}
- />
- </svg>
- );
-});
-AlignContentSpaceAround.displayName = "AlignContentSpaceAround";
-
-export const AlignContentSpaceBetween = React.forwardRef<
- SVGSVGElement,
- IconProps
->(({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M19 5H5V6H19V5ZM19 18H5V19H19V18ZM8 8H11V11H8V8ZM16 8H13V11H16V8ZM13 13H16V16H13V13ZM11 13H8V16H11V13Z"
- fill={color}
- />
- </svg>
- );
-});
-AlignContentSpaceBetween.displayName = "AlignContentSpaceBetween";
-
-export const alignContent = {
- normal: AlignContentStart,
- start: AlignContentStart,
- end: AlignContentEnd,
- center: AlignContentCenter,
- stretch: AlignContentStretch,
- "space-around": AlignContentSpaceAround,
- "space-between": AlignContentSpaceBetween,
-};
diff --git a/packages/icons/src/align-items-baseline.tsx b/packages/icons/src/align-items-baseline.tsx
new file mode 100644
index 0000000000..5ff05b6d9e
--- /dev/null
+++ b/packages/icons/src/align-items-baseline.tsx
@@ -0,0 +1,52 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const AlignItemsBaseline = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M10 6H8V15H10V6ZM7 5V16H11V5H7Z"
+ fill={color}
+ />
+ <path d="M7 12H11V18H7V12Z" fill={color} />
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M10 13H8V17H10V13ZM7 12V18H11V12H7Z"
+ fill={color}
+ />
+ <path d="M13 12H16V15H13V12Z" fill={color} />
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M15 13H14V14H15V13ZM13 12V15H16V12H13Z"
+ fill={color}
+ />
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M16 8H14V15H16V8ZM13 7V16H17V7H13Z"
+ fill={color}
+ />
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M20 13H4V11.5H20V13Z"
+ fill={color}
+ />
+ </svg>
+ );
+ }
+);
+AlignItemsBaseline.displayName = "AlignItemsBaseline";
diff --git a/packages/icons/src/align-items-center.tsx b/packages/icons/src/align-items-center.tsx
new file mode 100644
index 0000000000..74acabb236
--- /dev/null
+++ b/packages/icons/src/align-items-center.tsx
@@ -0,0 +1,26 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const AlignItemsCenter = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M10.4 11H12.8V5L15 5V11H20V12.6H15V19H12.8V12.6H10.4V17H8.2V12.6H4V11H8.2V7H10.4V11Z"
+ fill={color}
+ />
+ </svg>
+ );
+ }
+);
+AlignItemsCenter.displayName = "AlignItemsCenter";
diff --git a/packages/icons/src/align-items-end.tsx b/packages/icons/src/align-items-end.tsx
new file mode 100644
index 0000000000..bfde2b5a0d
--- /dev/null
+++ b/packages/icons/src/align-items-end.tsx
@@ -0,0 +1,26 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const AlignItemsEnd = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M16 16H19.2V17.6H4.80005V16H8.00005V9.59999H11.2V16H12.8V6.39999H16V16Z"
+ fill={color}
+ />
+ </svg>
+ );
+ }
+);
+AlignItemsEnd.displayName = "AlignItemsEnd";
diff --git a/packages/icons/src/align-items-start.tsx b/packages/icons/src/align-items-start.tsx
new file mode 100644
index 0000000000..f16864f2cb
--- /dev/null
+++ b/packages/icons/src/align-items-start.tsx
@@ -0,0 +1,26 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const AlignItemsStart = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M12.8 7.99999H11.2V14.4H8.00005V7.99999H4.80005V6.39999H19.2V7.99999H16V17.6H12.8V7.99999Z"
+ fill={color}
+ />
+ </svg>
+ );
+ }
+);
+AlignItemsStart.displayName = "AlignItemsStart";
diff --git a/packages/icons/src/align-items-stretch.tsx b/packages/icons/src/align-items-stretch.tsx
new file mode 100644
index 0000000000..0dd9c57d70
--- /dev/null
+++ b/packages/icons/src/align-items-stretch.tsx
@@ -0,0 +1,26 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const AlignItemsStretch = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M16 16H19.2V17.6H4.80005V16H8.00005V7.99999H4.80005V6.39999H19.2V7.99999H16V16ZM12.8 16V7.99999H11.2V16H12.8Z"
+ fill={color}
+ />
+ </svg>
+ );
+ }
+);
+AlignItemsStretch.displayName = "AlignItemsStretch";
diff --git a/packages/icons/src/align-items.tsx b/packages/icons/src/align-items.tsx
deleted file mode 100644
index 705e3f0f15..0000000000
--- a/packages/icons/src/align-items.tsx
+++ /dev/null
@@ -1,157 +0,0 @@
-import * as React from "react";
-import { IconProps } from "./types";
-
-export const AlignItemsStart = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M12.8 7.99999H11.2V14.4H8.00005V7.99999H4.80005V6.39999H19.2V7.99999H16V17.6H12.8V7.99999Z"
- fill={color}
- />
- </svg>
- );
- }
-);
-AlignItemsStart.displayName = "AlignItemsStart";
-
-export const AlignItemsEnd = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M16 16H19.2V17.6H4.80005V16H8.00005V9.59999H11.2V16H12.8V6.39999H16V16Z"
- fill={color}
- />
- </svg>
- );
- }
-);
-AlignItemsEnd.displayName = "AlignItemsEnd";
-
-export const AlignItemsCenter = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M10.4 11H12.8V5L15 5V11H20V12.6H15V19H12.8V12.6H10.4V17H8.2V12.6H4V11H8.2V7H10.4V11Z"
- fill={color}
- />
- </svg>
- );
- }
-);
-AlignItemsCenter.displayName = "AlignItemsCenter";
-
-export const AlignItemsBaseline = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M10 6H8V15H10V6ZM7 5V16H11V5H7Z"
- fill={color}
- />
- <path d="M7 12H11V18H7V12Z" fill={color} />
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M10 13H8V17H10V13ZM7 12V18H11V12H7Z"
- fill={color}
- />
- <path d="M13 12H16V15H13V12Z" fill={color} />
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M15 13H14V14H15V13ZM13 12V15H16V12H13Z"
- fill={color}
- />
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M16 8H14V15H16V8ZM13 7V16H17V7H13Z"
- fill={color}
- />
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M20 13H4V11.5H20V13Z"
- fill={color}
- />
- </svg>
- );
- }
-);
-AlignItemsBaseline.displayName = "AlignItemsBaseline";
-
-export const AlignItemsStretch = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M16 16H19.2V17.6H4.80005V16H8.00005V7.99999H4.80005V6.39999H19.2V7.99999H16V16ZM12.8 16V7.99999H11.2V16H12.8Z"
- fill={color}
- />
- </svg>
- );
- }
-);
-AlignItemsStretch.displayName = "AlignItemsStretch";
-
-export const alignItems = {
- normal: AlignItemsStart,
- start: AlignItemsStart,
- end: AlignItemsEnd,
- center: AlignItemsCenter,
- baseline: AlignItemsBaseline,
- stretch: AlignItemsStretch,
-};
diff --git a/packages/icons/src/flex-direction-column-reverse.tsx b/packages/icons/src/flex-direction-column-reverse.tsx
new file mode 100644
index 0000000000..f9f4d2414f
--- /dev/null
+++ b/packages/icons/src/flex-direction-column-reverse.tsx
@@ -0,0 +1,26 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const FlexDirectionColumnReverse = React.forwardRef<
+ SVGSVGElement,
+ IconProps
+>(({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ style={{ transform: "rotate(180deg)" }}
+ >
+ <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={color}
+ />
+ </svg>
+ );
+});
+FlexDirectionColumnReverse.displayName = "FlexDirectionColumnReverse";
diff --git a/packages/icons/src/flex-direction-column.tsx b/packages/icons/src/flex-direction-column.tsx
new file mode 100644
index 0000000000..77704598f0
--- /dev/null
+++ b/packages/icons/src/flex-direction-column.tsx
@@ -0,0 +1,24 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const FlexDirectionColumn = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <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={color}
+ />
+ </svg>
+ );
+ }
+);
+FlexDirectionColumn.displayName = "FlexDirectionColumn";
diff --git a/packages/icons/src/flex-direction-row-reverse.tsx b/packages/icons/src/flex-direction-row-reverse.tsx
new file mode 100644
index 0000000000..8acbbb5c2b
--- /dev/null
+++ b/packages/icons/src/flex-direction-row-reverse.tsx
@@ -0,0 +1,26 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const FlexDirectionRowReverse = React.forwardRef<
+ SVGSVGElement,
+ IconProps
+>(({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ style={{ transform: "rotate(180deg)" }}
+ >
+ <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={color}
+ />
+ </svg>
+ );
+});
+FlexDirectionRowReverse.displayName = "FlexDirectionRowReverse";
diff --git a/packages/icons/src/flex-direction-row.tsx b/packages/icons/src/flex-direction-row.tsx
new file mode 100644
index 0000000000..c364bb3abe
--- /dev/null
+++ b/packages/icons/src/flex-direction-row.tsx
@@ -0,0 +1,24 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const FlexDirectionRow = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <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={color}
+ />
+ </svg>
+ );
+ }
+);
+FlexDirectionRow.displayName = "FlexDirectionRow";
diff --git a/packages/icons/src/flex-direction.tsx b/packages/icons/src/flex-direction.tsx
deleted file mode 100644
index 92f03df27a..0000000000
--- a/packages/icons/src/flex-direction.tsx
+++ /dev/null
@@ -1,102 +0,0 @@
-import * as React from "react";
-import { IconProps } from "./types";
-
-export const FlexDirectionRow = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <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={color}
- />
- </svg>
- );
- }
-);
-FlexDirectionRow.displayName = "FlexDirectionRow";
-
-export const FlexDirectionColumn = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <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={color}
- />
- </svg>
- );
- }
-);
-FlexDirectionColumn.displayName = "FlexDirectionColumn";
-
-export const FlexDirectionRowReverse = React.forwardRef<
- SVGSVGElement,
- IconProps
->(({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- style={{ transform: "rotate(180deg)" }}
- >
- <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={color}
- />
- </svg>
- );
-});
-FlexDirectionRowReverse.displayName = "FlexDirectionRowReverse";
-
-export const FlexDirectionColumnReverse = React.forwardRef<
- SVGSVGElement,
- IconProps
->(({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- style={{ transform: "rotate(180deg)" }}
- >
- <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={color}
- />
- </svg>
- );
-});
-FlexDirectionColumnReverse.displayName = "FlexDirectionColumnReverse";
-
-export const flexDirection = {
- normal: FlexDirectionRow,
- row: FlexDirectionRow,
- column: FlexDirectionColumn,
- "row-reverse": FlexDirectionRowReverse,
- "column-reverse": FlexDirectionColumnReverse,
-};
diff --git a/packages/icons/src/flex-wrap-no-wrap.tsx b/packages/icons/src/flex-wrap-no-wrap.tsx
new file mode 100644
index 0000000000..0ad1886faf
--- /dev/null
+++ b/packages/icons/src/flex-wrap-no-wrap.tsx
@@ -0,0 +1,26 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const FlexWrapNowrap = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M13 9H11V15H13V9ZM19 9H17V15H19V9ZM7 9H5V15H7V9ZM4 8V16H8V8H4ZM14 8V16H10V8H14ZM20 8V16H16V8H20Z"
+ fill={color}
+ />
+ </svg>
+ );
+ }
+);
+FlexWrapNowrap.displayName = "FlexWrapNowrap";
diff --git a/packages/icons/src/flex-wrap-wrap-reverse.tsx b/packages/icons/src/flex-wrap-wrap-reverse.tsx
new file mode 100644
index 0000000000..efe50f7cfd
--- /dev/null
+++ b/packages/icons/src/flex-wrap-wrap-reverse.tsx
@@ -0,0 +1,30 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const FlexWrapWrapReverse = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ style={{ transform: "rotate(180deg)" }}
+ >
+ <path d="M16 13H20V20H16V13Z" fill={color} />
+ <path d="M4 13H8V20H4V13Z" fill={color} />
+ <path d="M10 13H14V20H10V13Z" fill={color} />
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M13 5H11V10H13V5ZM19 5H17V10H19V5ZM7 5H5V10H7V5ZM19 14H17V19H19V14ZM7 14H5V19H7V14ZM13 14H11V19H13V14ZM8 4V11H4V4H8ZM10 4V11H14V4H10ZM16 4V11H20V4H16ZM16 13V20H20V13H16ZM8 13V20H4V13H8ZM10 13V20H14V13H10Z"
+ fill={color}
+ />
+ </svg>
+ );
+ }
+);
+FlexWrapWrapReverse.displayName = "FlexWrapWrapReverse";
diff --git a/packages/icons/src/flex-wrap-wrap.tsx b/packages/icons/src/flex-wrap-wrap.tsx
new file mode 100644
index 0000000000..33977d3754
--- /dev/null
+++ b/packages/icons/src/flex-wrap-wrap.tsx
@@ -0,0 +1,29 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const FlexWrapWrap = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path d="M16 13H20V20H16V13Z" fill={color} />
+ <path d="M4 13H8V20H4V13Z" fill={color} />
+ <path d="M10 13H14V20H10V13Z" fill={color} />
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M13 5H11V10H13V5ZM19 5H17V10H19V5ZM7 5H5V10H7V5ZM19 14H17V19H19V14ZM7 14H5V19H7V14ZM13 14H11V19H13V14ZM8 4V11H4V4H8ZM10 4V11H14V4H10ZM16 4V11H20V4H16ZM16 13V20H20V13H16ZM8 13V20H4V13H8ZM10 13V20H14V13H10Z"
+ fill={color}
+ />
+ </svg>
+ );
+ }
+);
+FlexWrapWrap.displayName = "FlexWrapWrap";
diff --git a/packages/icons/src/flex-wrap.tsx b/packages/icons/src/flex-wrap.tsx
deleted file mode 100644
index cd1a670f67..0000000000
--- a/packages/icons/src/flex-wrap.tsx
+++ /dev/null
@@ -1,88 +0,0 @@
-import * as React from "react";
-import { IconProps } from "./types";
-
-export const FlexWrapWrap = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path d="M16 13H20V20H16V13Z" fill={color} />
- <path d="M4 13H8V20H4V13Z" fill={color} />
- <path d="M10 13H14V20H10V13Z" fill={color} />
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M13 5H11V10H13V5ZM19 5H17V10H19V5ZM7 5H5V10H7V5ZM19 14H17V19H19V14ZM7 14H5V19H7V14ZM13 14H11V19H13V14ZM8 4V11H4V4H8ZM10 4V11H14V4H10ZM16 4V11H20V4H16ZM16 13V20H20V13H16ZM8 13V20H4V13H8ZM10 13V20H14V13H10Z"
- fill={color}
- />
- </svg>
- );
- }
-);
-FlexWrapWrap.displayName = "FlexWrapWrap";
-
-export const FlexWrapNowrap = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M13 9H11V15H13V9ZM19 9H17V15H19V9ZM7 9H5V15H7V9ZM4 8V16H8V8H4ZM14 8V16H10V8H14ZM20 8V16H16V8H20Z"
- fill={color}
- />
- </svg>
- );
- }
-);
-FlexWrapNowrap.displayName = "FlexWrapNowrap";
-
-export const FlexWrapWrapReverse = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- style={{ transform: "rotate(180deg)" }}
- >
- <path d="M16 13H20V20H16V13Z" fill={color} />
- <path d="M4 13H8V20H4V13Z" fill={color} />
- <path d="M10 13H14V20H10V13Z" fill={color} />
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M13 5H11V10H13V5ZM19 5H17V10H19V5ZM7 5H5V10H7V5ZM19 14H17V19H19V14ZM7 14H5V19H7V14ZM13 14H11V19H13V14ZM8 4V11H4V4H8ZM10 4V11H14V4H10ZM16 4V11H20V4H16ZM16 13V20H20V13H16ZM8 13V20H4V13H8ZM10 13V20H14V13H10Z"
- fill={color}
- />
- </svg>
- );
- }
-);
-FlexWrapWrapReverse.displayName = "FlexWrapWrapReverse";
-
-export const flexWrap = {
- normal: FlexWrapNowrap,
- nowrap: FlexWrapNowrap,
- wrap: FlexWrapWrap,
- "wrap-reverse": FlexWrapWrapReverse,
-};
diff --git a/packages/icons/src/gap-column.tsx b/packages/icons/src/gap-column.tsx
new file mode 100644
index 0000000000..20ec1d3f40
--- /dev/null
+++ b/packages/icons/src/gap-column.tsx
@@ -0,0 +1,33 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const ColumnGap = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ d="M14.4704 6H13.4407L13.4407 18L14.4704 18L14.4704 6Z"
+ fill={color}
+ />
+ <path d="M14.4704 6H17.5593V7H14.4704L14.4704 6Z" fill={color} />
+ <path
+ d="M14.4704 17L17.5593 17V18L14.4704 18L14.4704 17Z"
+ fill={color}
+ />
+ <path
+ d="M6.44074 6L10.5296 6L10.5296 18L6.44073 18L6.44073 17L9.5 17L9.5 7L6.44074 7L6.44074 6Z"
+ fill={color}
+ />
+ </svg>
+ );
+ }
+);
+ColumnGap.displayName = "ColumnGap";
diff --git a/packages/icons/src/gap-row.tsx b/packages/icons/src/gap-row.tsx
new file mode 100644
index 0000000000..fcdd144790
--- /dev/null
+++ b/packages/icons/src/gap-row.tsx
@@ -0,0 +1,34 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const RowGap = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ style={{ transform: "rotate(90deg)" }}
+ >
+ <path
+ d="M14.4704 6H13.4407L13.4407 18L14.4704 18L14.4704 6Z"
+ fill={color}
+ />
+ <path d="M14.4704 6H17.5593V7H14.4704L14.4704 6Z" fill={color} />
+ <path
+ d="M14.4704 17L17.5593 17V18L14.4704 18L14.4704 17Z"
+ fill={color}
+ />
+ <path
+ d="M6.44074 6L10.5296 6L10.5296 18L6.44073 18L6.44073 17L9.5 17L9.5 7L6.44074 7L6.44074 6Z"
+ fill={color}
+ />
+ </svg>
+ );
+ }
+);
+RowGap.displayName = "RowGap";
diff --git a/packages/icons/src/gap.tsx b/packages/icons/src/gap.tsx
deleted file mode 100644
index 53162097a0..0000000000
--- a/packages/icons/src/gap.tsx
+++ /dev/null
@@ -1,72 +0,0 @@
-import * as React from "react";
-import { IconProps } from "./types";
-
-export const RowGap = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- style={{ transform: "rotate(90deg)" }}
- >
- <path
- d="M14.4704 6H13.4407L13.4407 18L14.4704 18L14.4704 6Z"
- fill={color}
- />
- <path d="M14.4704 6H17.5593V7H14.4704L14.4704 6Z" fill={color} />
- <path
- d="M14.4704 17L17.5593 17V18L14.4704 18L14.4704 17Z"
- fill={color}
- />
- <path
- d="M6.44074 6L10.5296 6L10.5296 18L6.44073 18L6.44073 17L9.5 17L9.5 7L6.44074 7L6.44074 6Z"
- fill={color}
- />
- </svg>
- );
- }
-);
-RowGap.displayName = "RowGap";
-
-export const ColumnGap = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- d="M14.4704 6H13.4407L13.4407 18L14.4704 18L14.4704 6Z"
- fill={color}
- />
- <path d="M14.4704 6H17.5593V7H14.4704L14.4704 6Z" fill={color} />
- <path
- d="M14.4704 17L17.5593 17V18L14.4704 18L14.4704 17Z"
- fill={color}
- />
- <path
- d="M6.44074 6L10.5296 6L10.5296 18L6.44073 18L6.44073 17L9.5 17L9.5 7L6.44074 7L6.44074 6Z"
- fill={color}
- />
- </svg>
- );
- }
-);
-ColumnGap.displayName = "ColumnGap";
-
-export const gap = {
- rowGap: RowGap,
- columnGap: ColumnGap,
- "row-gap": RowGap,
- "column-gap": ColumnGap,
-};
diff --git a/packages/icons/src/index.ts b/packages/icons/src/index.ts
index 5b5c8e23e6..22a576824c 100644
--- a/packages/icons/src/index.ts
+++ b/packages/icons/src/index.ts
@@ -9,11 +9,35 @@ export * from "./github";
export * from "./devices";
export * from "./tablet";
export * from "./types";
-export * from "./align-content";
-export * from "./align-items";
-export * from "./flex-direction";
-export * from "./flex-wrap";
-export * from "./justify-content";
-export * from "./justify-items";
-export * from "./gap";
-export * from "./lock";
+export * from "./align-content-center";
+export * from "./align-content-end";
+export * from "./align-content-space-around";
+export * from "./align-content-space-between";
+export * from "./align-content-start";
+export * from "./align-content-stretch";
+export * from "./align-items-baseline";
+export * from "./align-items-center";
+export * from "./align-items-end";
+export * from "./align-items-start";
+export * from "./align-items-stretch";
+export * from "./flex-direction-row";
+export * from "./flex-direction-column";
+export * from "./flex-direction-row-reverse";
+export * from "./flex-direction-column-reverse";
+export * from "./flex-wrap-wrap";
+export * from "./flex-wrap-no-wrap";
+export * from "./flex-wrap-wrap-reverse";
+export * from "./justify-content-center";
+export * from "./justify-content-end";
+export * from "./justify-content-space-around";
+export * from "./justify-content-space-between";
+export * from "./justify-content-start";
+export * from "./justify-items-center";
+export * from "./justify-items-end";
+export * from "./justify-items-space-around";
+export * from "./justify-items-space-between";
+export * from "./justify-items-start";
+export * from "./gap-row";
+export * from "./gap-column";
+export * from "./lock-opened";
+export * from "./lock-closed";
diff --git a/packages/icons/src/justify-content-center.tsx b/packages/icons/src/justify-content-center.tsx
new file mode 100644
index 0000000000..fbc67af6f5
--- /dev/null
+++ b/packages/icons/src/justify-content-center.tsx
@@ -0,0 +1,26 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const JustifyContentCenter = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M12.7999 4.79999V19.2H11.1999V4.79999H12.7999ZM16.5999 15.8H14.3999V8.19999H16.5999V15.8ZM7.3999 15.8H9.5999V8.19999H7.3999V15.8Z"
+ fill={color}
+ />
+ </svg>
+ );
+ }
+);
+JustifyContentCenter.displayName = "JustifyContentCenter";
diff --git a/packages/icons/src/justify-content-end.tsx b/packages/icons/src/justify-content-end.tsx
new file mode 100644
index 0000000000..85a7de7e8f
--- /dev/null
+++ b/packages/icons/src/justify-content-end.tsx
@@ -0,0 +1,25 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const JustifyContentEnd = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ d="M12 16.8H15.2V19.2H16.8V4.79999H15.2V7.19999H12V16.8Z"
+ fill={color}
+ />
+ <path d="M7.19995 16.8H10.4V7.19999H7.19995V16.8Z" fill={color} />
+ </svg>
+ );
+ }
+);
+JustifyContentEnd.displayName = "JustifyContentEnd";
diff --git a/packages/icons/src/justify-content-space-around.tsx b/packages/icons/src/justify-content-space-around.tsx
new file mode 100644
index 0000000000..40ab8d50ee
--- /dev/null
+++ b/packages/icons/src/justify-content-space-around.tsx
@@ -0,0 +1,25 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const JustifyContentSpaceAround = React.forwardRef<
+ SVGSVGElement,
+ IconProps
+>(({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path d="M7.9999 19.2V4.79999H6.3999V19.2H7.9999Z" fill={color} />
+ <path d="M17.5999 19.2V4.79999H15.9999V19.2H17.5999Z" fill={color} />
+ <path d="M15.1999 16.8H12.7999V7.19999H15.1999V16.8Z" fill={color} />
+ <path d="M8.7999 16.8H11.1999V7.19999H8.7999V16.8Z" fill={color} />
+ </svg>
+ );
+});
+JustifyContentSpaceAround.displayName = "JustifyContentSpaceAround";
diff --git a/packages/icons/src/justify-content-space-between.tsx b/packages/icons/src/justify-content-space-between.tsx
new file mode 100644
index 0000000000..006213f57a
--- /dev/null
+++ b/packages/icons/src/justify-content-space-between.tsx
@@ -0,0 +1,27 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const JustifyContentSpaceBetween = React.forwardRef<
+ SVGSVGElement,
+ IconProps
+>(({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M11.1999 7.19999H7.9999V4.79999H6.3999V19.2H7.9999V16.8H11.1999V7.19999ZM12.7999 16.8H15.9999V19.2H17.5999V4.79999H15.9999V7.19999H12.7999V16.8Z"
+ fill={color}
+ />
+ </svg>
+ );
+});
+JustifyContentSpaceBetween.displayName = "JustifyContentSpaceBetween";
diff --git a/packages/icons/src/justify-content-start.tsx b/packages/icons/src/justify-content-start.tsx
new file mode 100644
index 0000000000..12fcb4a4e9
--- /dev/null
+++ b/packages/icons/src/justify-content-start.tsx
@@ -0,0 +1,25 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+export const JustifyContentStart = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ d="M10.9999 7.19999H8.79995V4.79999H7.19995V19.2H8.79995V16.8H10.9999V7.19999Z"
+ fill={color}
+ />
+ <path d="M16.8 7.19999H13.6V16.8H16.8V7.19999Z" fill={color} />
+ </svg>
+ );
+ }
+);
+JustifyContentStart.displayName = "JustifyContentStart";
diff --git a/packages/icons/src/justify-content.tsx b/packages/icons/src/justify-content.tsx
deleted file mode 100644
index ed4f705d08..0000000000
--- a/packages/icons/src/justify-content.tsx
+++ /dev/null
@@ -1,129 +0,0 @@
-import * as React from "react";
-import { IconProps } from "./types";
-
-export const JustifyContentStart = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- d="M10.9999 7.19999H8.79995V4.79999H7.19995V19.2H8.79995V16.8H10.9999V7.19999Z"
- fill={color}
- />
- <path d="M16.8 7.19999H13.6V16.8H16.8V7.19999Z" fill={color} />
- </svg>
- );
- }
-);
-JustifyContentStart.displayName = "JustifyContentStart";
-
-export const JustifyContentCenter = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M12.7999 4.79999V19.2H11.1999V4.79999H12.7999ZM16.5999 15.8H14.3999V8.19999H16.5999V15.8ZM7.3999 15.8H9.5999V8.19999H7.3999V15.8Z"
- fill={color}
- />
- </svg>
- );
- }
-);
-JustifyContentCenter.displayName = "JustifyContentCenter";
-
-export const JustifyContentEnd = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- d="M12 16.8H15.2V19.2H16.8V4.79999H15.2V7.19999H12V16.8Z"
- fill={color}
- />
- <path d="M7.19995 16.8H10.4V7.19999H7.19995V16.8Z" fill={color} />
- </svg>
- );
- }
-);
-JustifyContentEnd.displayName = "JustifyContentEnd";
-
-export const JustifyContentSpaceBetween = React.forwardRef<
- SVGSVGElement,
- IconProps
->(({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M11.1999 7.19999H7.9999V4.79999H6.3999V19.2H7.9999V16.8H11.1999V7.19999ZM12.7999 16.8H15.9999V19.2H17.5999V4.79999H15.9999V7.19999H12.7999V16.8Z"
- fill={color}
- />
- </svg>
- );
-});
-JustifyContentSpaceBetween.displayName = "JustifyContentSpaceBetween";
-
-export const JustifyContentSpaceAround = React.forwardRef<
- SVGSVGElement,
- IconProps
->(({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path d="M7.9999 19.2V4.79999H6.3999V19.2H7.9999Z" fill={color} />
- <path d="M17.5999 19.2V4.79999H15.9999V19.2H17.5999Z" fill={color} />
- <path d="M15.1999 16.8H12.7999V7.19999H15.1999V16.8Z" fill={color} />
- <path d="M8.7999 16.8H11.1999V7.19999H8.7999V16.8Z" fill={color} />
- </svg>
- );
-});
-JustifyContentSpaceAround.displayName = "JustifyContentSpaceAround";
-
-export const justifyContent = {
- normal: JustifyContentStart,
- start: JustifyContentStart,
- end: JustifyContentEnd,
- center: JustifyContentCenter,
- "space-between": JustifyContentSpaceBetween,
- "space-around": JustifyContentSpaceAround,
-};
diff --git a/packages/icons/src/justify-items-center.tsx b/packages/icons/src/justify-items-center.tsx
new file mode 100644
index 0000000000..ab0e9f88da
--- /dev/null
+++ b/packages/icons/src/justify-items-center.tsx
@@ -0,0 +1,27 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+// @todo this is just a copy of justifyContent icons for now
+export const JustifyItemsCenter = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M12.7999 4.79999V19.2H11.1999V4.79999H12.7999ZM16.5999 15.8H14.3999V8.19999H16.5999V15.8ZM7.3999 15.8H9.5999V8.19999H7.3999V15.8Z"
+ fill={color}
+ />
+ </svg>
+ );
+ }
+);
+JustifyItemsCenter.displayName = "JustifyItemsCenter";
diff --git a/packages/icons/src/justify-items-end.tsx b/packages/icons/src/justify-items-end.tsx
new file mode 100644
index 0000000000..de4f514117
--- /dev/null
+++ b/packages/icons/src/justify-items-end.tsx
@@ -0,0 +1,26 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+// @todo this is just a copy of justifyContent icons for now
+export const JustifyItemsEnd = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ d="M12 16.8H15.2V19.2H16.8V4.79999H15.2V7.19999H12V16.8Z"
+ fill={color}
+ />
+ <path d="M7.19995 16.8H10.4V7.19999H7.19995V16.8Z" fill={color} />
+ </svg>
+ );
+ }
+);
+JustifyItemsEnd.displayName = "JustifyItemsEnd";
diff --git a/packages/icons/src/justify-items-space-around.tsx b/packages/icons/src/justify-items-space-around.tsx
new file mode 100644
index 0000000000..12e81296c6
--- /dev/null
+++ b/packages/icons/src/justify-items-space-around.tsx
@@ -0,0 +1,26 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+// @todo this is just a copy of justifyContent icons for now
+export const JustifyItemsSpaceAround = React.forwardRef<
+ SVGSVGElement,
+ IconProps
+>(({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path d="M7.9999 19.2V4.79999H6.3999V19.2H7.9999Z" fill={color} />
+ <path d="M17.5999 19.2V4.79999H15.9999V19.2H17.5999Z" fill={color} />
+ <path d="M15.1999 16.8H12.7999V7.19999H15.1999V16.8Z" fill={color} />
+ <path d="M8.7999 16.8H11.1999V7.19999H8.7999V16.8Z" fill={color} />
+ </svg>
+ );
+});
+JustifyItemsSpaceAround.displayName = "JustifyItemsSpaceAround";
diff --git a/packages/icons/src/justify-items-space-between.tsx b/packages/icons/src/justify-items-space-between.tsx
new file mode 100644
index 0000000000..f0a10b0235
--- /dev/null
+++ b/packages/icons/src/justify-items-space-between.tsx
@@ -0,0 +1,28 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+// @todo this is just a copy of justifyContent icons for now
+export const JustifyItemsSpaceBetween = React.forwardRef<
+ SVGSVGElement,
+ IconProps
+>(({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M11.1999 7.19999H7.9999V4.79999H6.3999V19.2H7.9999V16.8H11.1999V7.19999ZM12.7999 16.8H15.9999V19.2H17.5999V4.79999H15.9999V7.19999H12.7999V16.8Z"
+ fill={color}
+ />
+ </svg>
+ );
+});
+JustifyItemsSpaceBetween.displayName = "JustifyItemsSpaceBetween";
diff --git a/packages/icons/src/justify-items-start.tsx b/packages/icons/src/justify-items-start.tsx
new file mode 100644
index 0000000000..4e732d0679
--- /dev/null
+++ b/packages/icons/src/justify-items-start.tsx
@@ -0,0 +1,26 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+// @todo this is just a copy of justifyContent icons for now
+export const JustifyItemsStart = React.forwardRef<SVGSVGElement, IconProps>(
+ ({ color = "currentColor", ...props }, forwardedRef) => {
+ return (
+ <svg
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ d="M10.9999 7.19999H8.79995V4.79999H7.19995V19.2H8.79995V16.8H10.9999V7.19999Z"
+ fill={color}
+ />
+ <path d="M16.8 7.19999H13.6V16.8H16.8V7.19999Z" fill={color} />
+ </svg>
+ );
+ }
+);
+JustifyItemsStart.displayName = "JustifyItemsStart";
diff --git a/packages/icons/src/justify-items.tsx b/packages/icons/src/justify-items.tsx
deleted file mode 100644
index 280f1fd05a..0000000000
--- a/packages/icons/src/justify-items.tsx
+++ /dev/null
@@ -1,128 +0,0 @@
-import * as React from "react";
-import { IconProps } from "./types";
-
-// @todo this is just a copy of justifyContent icons for now
-export const JustifyItemsStart = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- d="M10.9999 7.19999H8.79995V4.79999H7.19995V19.2H8.79995V16.8H10.9999V7.19999Z"
- fill={color}
- />
- <path d="M16.8 7.19999H13.6V16.8H16.8V7.19999Z" fill={color} />
- </svg>
- );
- }
-);
-JustifyItemsStart.displayName = "JustifyItemsStart";
-
-export const JustifyItemsCenter = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M12.7999 4.79999V19.2H11.1999V4.79999H12.7999ZM16.5999 15.8H14.3999V8.19999H16.5999V15.8ZM7.3999 15.8H9.5999V8.19999H7.3999V15.8Z"
- fill={color}
- />
- </svg>
- );
- }
-);
-JustifyItemsCenter.displayName = "JustifyItemsCenter";
-
-export const JustifyItemsEnd = React.forwardRef<SVGSVGElement, IconProps>(
- ({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- d="M12 16.8H15.2V19.2H16.8V4.79999H15.2V7.19999H12V16.8Z"
- fill={color}
- />
- <path d="M7.19995 16.8H10.4V7.19999H7.19995V16.8Z" fill={color} />
- </svg>
- );
- }
-);
-JustifyItemsEnd.displayName = "JustifyItemsEnd";
-
-export const JustifyItemsSpaceBetween = React.forwardRef<
- SVGSVGElement,
- IconProps
->(({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M11.1999 7.19999H7.9999V4.79999H6.3999V19.2H7.9999V16.8H11.1999V7.19999ZM12.7999 16.8H15.9999V19.2H17.5999V4.79999H15.9999V7.19999H12.7999V16.8Z"
- fill={color}
- />
- </svg>
- );
-});
-JustifyItemsSpaceBetween.displayName = "JustifyItemsSpaceBetween";
-
-export const JustifyItemsSpaceAround = React.forwardRef<
- SVGSVGElement,
- IconProps
->(({ color = "currentColor", ...props }, forwardedRef) => {
- return (
- <svg
- width="24"
- height="24"
- viewBox="0 0 24 24"
- fill="none"
- xmlns="http://www.w3.org/2000/svg"
- {...props}
- ref={forwardedRef}
- >
- <path d="M7.9999 19.2V4.79999H6.3999V19.2H7.9999Z" fill={color} />
- <path d="M17.5999 19.2V4.79999H15.9999V19.2H17.5999Z" fill={color} />
- <path d="M15.1999 16.8H12.7999V7.19999H15.1999V16.8Z" fill={color} />
- <path d="M8.7999 16.8H11.1999V7.19999H8.7999V16.8Z" fill={color} />
- </svg>
- );
-});
-JustifyItemsSpaceAround.displayName = "JustifyItemsSpaceAround";
-
-export const justifyItems = {
- normal: JustifyItemsStart,
- start: JustifyItemsStart,
- end: JustifyItemsEnd,
- center: JustifyItemsCenter,
-};
diff --git a/packages/icons/src/lock-closed.tsx b/packages/icons/src/lock-closed.tsx
new file mode 100644
index 0000000000..1efcb5328b
--- /dev/null
+++ b/packages/icons/src/lock-closed.tsx
@@ -0,0 +1,39 @@
+import * as React from "react";
+import { IconProps } from "./types";
+
+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="none" />
+ <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={color}
+ />
+ </g>
+ <defs>
+ <clipPath id="clip0_561_9202">
+ <rect
+ width="8"
+ height="9"
+ fill="none"
+ transform="translate(0 0.5)"
+ />
+ </clipPath>
+ </defs>
+ </svg>
+ );
+ }
+);
+LockClosed.displayName = "LockClosed";
diff --git a/packages/icons/src/lock.tsx b/packages/icons/src/lock-opened.tsx
similarity index 52%
rename from packages/icons/src/lock.tsx
rename to packages/icons/src/lock-opened.tsx
index b9b7fe7eb1..9a849a8e91 100644
--- a/packages/icons/src/lock.tsx
+++ b/packages/icons/src/lock-opened.tsx
@@ -35,46 +35,3 @@ export const LockOpened = React.forwardRef<SVGSVGElement, IconProps>(
}
);
LockOpened.displayName = "LockOpened";
-
-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="none" />
- <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={color}
- />
- </g>
- <defs>
- <clipPath id="clip0_561_9202">
- <rect
- width="8"
- height="9"
- fill="none"
- transform="translate(0 0.5)"
- />
- </clipPath>
- </defs>
- </svg>
- );
- }
-);
-LockClosed.displayName = "LockClosed";
-
-export const lock = {
- normal: LockOpened,
- opened: LockOpened,
- closed: LockClosed,
-};
diff --git a/packages/icons/src/types.ts b/packages/icons/src/types.ts
index 2268f89f79..e5aee6334d 100644
--- a/packages/icons/src/types.ts
+++ b/packages/icons/src/types.ts
@@ -12,3 +12,6 @@ export interface IconProps extends SVGAttributes<SVGElement> {
export type IconComponent = ForwardRefExoticComponent<
IconProps & RefAttributes<SVGSVGElement>
>;
+
+export type IconRecord = Record<string, IconComponent>;
+export type IconRecords = Record<string, IconRecord>;