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.

feat: Add titles in the binidngs panel (#2786)

Oleg Isonen7ebe625d8252
diff --git a/apps/builder/app/builder/features/breakpoints/breakpoints-selector.tsx b/apps/builder/app/builder/features/breakpoints/breakpoints-selector.tsx
index 5c4c3d5d41..735fa14aec 100644
--- a/apps/builder/app/builder/features/breakpoints/breakpoints-selector.tsx
+++ b/apps/builder/app/builder/features/breakpoints/breakpoints-selector.tsx
@@ -16,32 +16,32 @@ import { setInitialCanvasWidth } from "./use-set-initial-canvas-width";
const getTooltipContent = (breakpoint: Breakpoint) => {
if (isBaseBreakpoint(breakpoint)) {
return (
- <>
+ <Text>
<Text variant="regularBold">Base</Text>
<br />
Styles on Base apply to all viewport sizes unless overwritten by another
breakpoint. Start your styling here.
- </>
+ </Text>
);
}
if (breakpoint.maxWidth !== undefined) {
return (
- <>
+ <Text>
<Text variant="regularBold">{breakpoint.maxWidth}px and down</Text>
<br />
Styles on this breakpoint apply to viewport widths {breakpoint.maxWidth}
px and down, unless overwritten by a smaller breakpoint.
- </>
+ </Text>
);
}
if (breakpoint.minWidth !== undefined) {
return (
- <>
+ <Text>
<Text variant="regularBold">{breakpoint.minWidth}px and up</Text>
<br />
Styles on this breakpoint apply to viewport widths {breakpoint.minWidth}
px and up, unless overwritten by a larger breakpoint.
- </>
+ </Text>
);
}
};
diff --git a/apps/builder/app/builder/features/topbar/sync-status.tsx b/apps/builder/app/builder/features/topbar/sync-status.tsx
index 46cc1c151e..4deebaa058 100644
--- a/apps/builder/app/builder/features/topbar/sync-status.tsx
+++ b/apps/builder/app/builder/features/topbar/sync-status.tsx
@@ -1,6 +1,6 @@
import { useStore } from "@nanostores/react";
import { atom } from "nanostores";
-import { Flex, rawTheme, Tooltip } from "@webstudio-is/design-system";
+import { Flex, rawTheme, Text, Tooltip } from "@webstudio-is/design-system";
import { OfflineIcon } from "@webstudio-is/icons";
import { useEffect } from "react";
import { queueStatus } from "~/builder/shared/sync";
@@ -36,7 +36,7 @@ export const SyncStatus = () => {
<Tooltip
variant="wrapped"
content={
- <>
+ <Text>
{isOnline ? (
<>
Experiencing connectivity issues. Your changes will be synced
@@ -50,7 +50,7 @@ export const SyncStatus = () => {
Please check your internet connection.
</>
)}
- </>
+ </Text>
}
>
<OfflineIcon
diff --git a/apps/builder/app/builder/features/topbar/view-mode.tsx b/apps/builder/app/builder/features/topbar/view-mode.tsx
index 2fde3b7de6..47be8f4d70 100644
--- a/apps/builder/app/builder/features/topbar/view-mode.tsx
+++ b/apps/builder/app/builder/features/topbar/view-mode.tsx
@@ -4,6 +4,7 @@ import {
AccessibleIcon,
rawTheme,
Tooltip,
+ Text,
} from "@webstudio-is/design-system";
import { CloudIcon } from "@webstudio-is/icons";
import { $authPermit } from "~/shared/nano-states";
@@ -20,7 +21,7 @@ export const ViewMode = () => {
<AccessibleIcon label={`View mode`}>
<Tooltip
variant="wrapped"
- content={<>View mode. Your changes will not be saved</>}
+ content={<Text>View mode. Your changes will not be saved</Text>}
>
{/* @todo replace the icon, waiting for figma */}
<CloudIcon width={20} height={20} color={rawTheme.colors.yellow10} />
diff --git a/apps/builder/app/builder/shared/binding-popover.tsx b/apps/builder/app/builder/shared/binding-popover.tsx
index 29fc557587..345f0f8861 100644
--- a/apps/builder/app/builder/shared/binding-popover.tsx
+++ b/apps/builder/app/builder/shared/binding-popover.tsx
@@ -10,7 +10,13 @@ import {
type ReactNode,
} from "react";
import { isFeatureEnabled } from "@webstudio-is/feature-flags";
-import { DotIcon, PlusIcon, ResetIcon, TrashIcon } from "@webstudio-is/icons";
+import {
+ DotIcon,
+ InfoCircleIcon,
+ PlusIcon,
+ ResetIcon,
+ TrashIcon,
+} from "@webstudio-is/icons";
import {
Box,
Button,
@@ -139,7 +145,19 @@ const BindingPanel = ({
width: theme.spacing[30],
}}
>
- <Box css={{ padding: `${theme.spacing[5]} 0` }}>
+ <Box css={{ paddingBottom: theme.spacing[5] }}>
+ <Flex gap="1" css={{ px: theme.spacing[9], py: theme.spacing[5] }}>
+ <Text variant="labelsSentenceCase">Variables</Text>
+ <Tooltip
+ variant="wrapped"
+ content={
+ "Click on the available variables in this scope to insert them into the Expression Editor."
+ }
+ >
+ <InfoCircleIcon tabIndex={0} />
+ </Tooltip>
+ </Flex>
+
<CssValueListArrowFocus>
{Object.entries(scope).map(([identifier, value], index) => {
const name = aliases.get(identifier);
@@ -165,6 +183,25 @@ const BindingPanel = ({
})}
</CssValueListArrowFocus>
</Box>
+ <Flex gap="1" css={{ px: theme.spacing[9], py: theme.spacing[5] }}>
+ <Text variant="labelsSentenceCase">Expression Editor</Text>
+ <Tooltip
+ variant="wrapped"
+ content={
+ <Text>
+ Compose variables, do math; the result of the expression will be
+ used as a value.
+ <br />
+ Example: VariableA || VariableB || &quot;DefaultValue&quot;
+ <br />
+ Explanation: If VariableA is empty, use VariableB; otherwise use
+ &quot;DefaultValue&quot;.
+ </Text>
+ }
+ >
+ <InfoCircleIcon tabIndex={0} />
+ </Tooltip>
+ </Flex>
<Box css={{ padding: `0 ${theme.spacing[9]} ${theme.spacing[9]}` }}>
<InputErrorsTooltip
errors={