Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
Add radix popover (#1997)
Ivan Starkov74092f66bf83
diff --git a/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx b/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsxindex 7e1b891a04..fc2ccc0f9c 100644--- a/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx+++ b/apps/builder/app/canvas/features/webstudio-component/webstudio-component.tsx@@ -226,11 +226,11 @@ export const WebstudioComponentDev = forwardRef<...readonlyProps,tabIndex: 0,onClick: (event: MouseEvent) => {- event.preventDefault();if (event.currentTarget instanceof HTMLAnchorElement) {// @todo use Navigation API once implemented everywhere// https://developer.mozilla.org/en-US/docs/Web/API/Navigation_APIhandleLinkClick(event);+ event.preventDefault();} else if (typeof userProps.onClick === "function") {// bypass onClick for non-link component, for example buttonuserProps.onClick(event);diff --git a/packages/sdk-components-react/package.json b/packages/sdk-components-react/package.jsonindex 235811f6ea..ce8cc25e7d 100644--- a/packages/sdk-components-react/package.json+++ b/packages/sdk-components-react/package.json@@ -47,6 +47,7 @@"react-dom": "^18.2.0"},"dependencies": {+ "@radix-ui/react-popover": "^1.0.6","@radix-ui/react-tooltip": "^1.0.6","@react-aria/utils": "^3.18.0","@webstudio-is/css-data": "workspace:^",diff --git a/packages/sdk-components-react/src/__generated__/radix-popover.props.ts b/packages/sdk-components-react/src/__generated__/radix-popover.props.tsnew file mode 100644index 0000000000..48efd94f4b--- /dev/null+++ b/packages/sdk-components-react/src/__generated__/radix-popover.props.ts@@ -0,0 +1,481 @@+import type { PropMeta } from "@webstudio-is/generate-arg-types";++export const propsPopover: Record<string, PropMeta> = {+ defaultOpen: { required: false, control: "boolean", type: "boolean" },+ isOpen: {+ required: true,+ control: "radio",+ type: "string",+ options: ["open", "initial", "closed"],+ },+ modal: { required: false, control: "boolean", type: "boolean" },+ open: { required: false, control: "boolean", type: "boolean" },+};+export const propsPopoverTrigger: Record<string, PropMeta> = {};+export const propsPopoverContent: Record<string, PropMeta> = {+ about: { required: false, control: "text", type: "string" },+ accessKey: { required: false, control: "text", type: "string" },+ align: {+ required: false,+ control: "radio",+ type: "string",+ defaultValue: "center",+ options: ["center", "start", "end"],+ },+ alignOffset: { required: false, control: "number", type: "number" },+ "aria-activedescendant": {+ description:+ "Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-atomic": {+ description:+ "Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-autocomplete": {+ description:+ "Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be\npresented if they are made.",+ required: false,+ control: "select",+ type: "string",+ options: ["list", "none", "inline", "both"],+ },+ "aria-busy": {+ description:+ "Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-checked": {+ description:+ 'Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.\n@see aria-pressed\n@see aria-selected.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-colcount": {+ description:+ "Defines the total number of columns in a table, grid, or treegrid.\n@see aria-colindex.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colindex": {+ description:+ "Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.\n@see aria-colcount\n@see aria-colspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-colspan": {+ description:+ "Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-colindex\n@see aria-rowspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-controls": {+ description:+ "Identifies the element (or elements) whose contents or presence are controlled by the current element.\n@see aria-owns.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-current": {+ description:+ "Indicates the element that represents the current item within a container or set of related elements.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-describedby": {+ description:+ "Identifies the element (or elements) that describes the object.\n@see aria-labelledby",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-details": {+ description:+ "Identifies the element that provides a detailed, extended description for the object.\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-disabled": {+ description:+ "Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.\n@see aria-hidden\n@see aria-readonly.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-dropeffect": {+ description:+ "Indicates what functions can be performed when a dragged object is released on the drop target.\n@deprecated in ARIA 1.1",+ required: false,+ control: "select",+ type: "string",+ options: ["link", "none", "copy", "execute", "move", "popup"],+ },+ "aria-errormessage": {+ description:+ "Identifies the element that provides an error message for the object.\n@see aria-invalid\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-expanded": {+ description:+ "Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-flowto": {+ description:+ "Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,\nallows assistive technology to override the general default of reading in document source order.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-grabbed": {+ description:+ 'Indicates an element\'s "grabbed" state in a drag-and-drop operation.\n@deprecated in ARIA 1.1',+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-haspopup": {+ description:+ "Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-hidden": {+ description:+ "Indicates whether the element is exposed to an accessibility API.\n@see aria-disabled.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-invalid": {+ description:+ "Indicates the entered value does not conform to the format expected by the application.\n@see aria-errormessage.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-keyshortcuts": {+ description:+ "Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-label": {+ description:+ "Defines a string value that labels the current element.\n@see aria-labelledby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-labelledby": {+ description:+ "Identifies the element (or elements) that labels the current element.\n@see aria-describedby.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-level": {+ description:+ "Defines the hierarchical level of an element within a structure.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-live": {+ description:+ "Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.",+ required: false,+ control: "radio",+ type: "string",+ options: ["off", "assertive", "polite"],+ },+ "aria-modal": {+ description: "Indicates whether an element is modal when displayed.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-multiline": {+ description:+ "Indicates whether a text box accepts multiple lines of input or only a single line.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-multiselectable": {+ description:+ "Indicates that the user may select more than one item from the current selectable descendants.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-orientation": {+ description:+ "Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.",+ required: false,+ control: "radio",+ type: "string",+ options: ["horizontal", "vertical"],+ },+ "aria-owns": {+ description:+ "Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship\nbetween DOM elements where the DOM hierarchy cannot be used to represent the relationship.\n@see aria-controls.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-placeholder": {+ description:+ "Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.\nA hint could be a sample value or a brief description of the expected format.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-posinset": {+ description:+ "Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-setsize.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-pressed": {+ description:+ 'Indicates the current "pressed" state of toggle buttons.\n@see aria-checked\n@see aria-selected.',+ required: false,+ control: "text",+ type: "string",+ },+ "aria-readonly": {+ description:+ "Indicates that the element is not editable, but is otherwise operable.\n@see aria-disabled.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-relevant": {+ description:+ "Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.\n@see aria-atomic.",+ required: false,+ control: "select",+ type: "string",+ options: [+ "text",+ "additions",+ "additions removals",+ "additions text",+ "all",+ "removals",+ "removals additions",+ "removals text",+ "text additions",+ "text removals",+ ],+ },+ "aria-required": {+ description:+ "Indicates that user input is required on the element before a form may be submitted.",+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-roledescription": {+ description:+ "Defines a human-readable, author-localized description for the role of an element.",+ required: false,+ control: "text",+ type: "string",+ },+ "aria-rowcount": {+ description:+ "Defines the total number of rows in a table, grid, or treegrid.\n@see aria-rowindex.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowindex": {+ description:+ "Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.\n@see aria-rowcount\n@see aria-rowspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-rowspan": {+ description:+ "Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.\n@see aria-rowindex\n@see aria-colspan.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-selected": {+ description:+ 'Indicates the current "selected" state of various widgets.\n@see aria-checked\n@see aria-pressed.',+ required: false,+ control: "boolean",+ type: "boolean",+ },+ "aria-setsize": {+ description:+ "Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.\n@see aria-posinset.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-sort": {+ description:+ "Indicates if items in a table or grid are sorted in ascending or descending order.",+ required: false,+ control: "select",+ type: "string",+ options: ["none", "ascending", "descending", "other"],+ },+ "aria-valuemax": {+ description: "Defines the maximum allowed value for a range widget.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuemin": {+ description: "Defines the minimum allowed value for a range widget.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuenow": {+ description:+ "Defines the current value for a range widget.\n@see aria-valuetext.",+ required: false,+ control: "number",+ type: "number",+ },+ "aria-valuetext": {+ description:+ "Defines the human readable text alternative of aria-valuenow for a range widget.",+ required: false,+ control: "text",+ type: "string",+ },+ arrowPadding: { required: false, control: "number", type: "number" },+ asChild: { required: false, control: "boolean", type: "boolean" },+ autoCapitalize: { required: false, control: "text", type: "string" },+ autoCorrect: { required: false, control: "text", type: "string" },+ autoFocus: { required: false, control: "boolean", type: "boolean" },+ autoSave: { required: false, control: "text", type: "string" },+ avoidCollisions: { required: false, control: "boolean", type: "boolean" },+ className: { required: false, control: "text", type: "string" },+ color: { required: false, control: "color", type: "string" },+ content: { required: false, control: "text", type: "string" },+ contextMenu: { required: false, control: "text", type: "string" },+ datatype: { required: false, control: "text", type: "string" },+ defaultChecked: { required: false, control: "boolean", type: "boolean" },+ dir: { required: false, control: "text", type: "string" },+ draggable: { required: false, control: "boolean", type: "boolean" },+ hidden: { required: false, control: "boolean", type: "boolean" },+ hideWhenDetached: { required: false, control: "boolean", type: "boolean" },+ id: { required: false, control: "text", type: "string" },+ inputMode: {+ description:+ "Hints at the type of data that might be entered by the user while editing the element or its contents\n@see https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute",+ required: false,+ control: "select",+ type: "string",+ options: [+ "text",+ "none",+ "search",+ "tel",+ "url",+ "email",+ "numeric",+ "decimal",+ ],+ },+ is: {+ description:+ "Specify that a standard HTML element should behave like a defined custom built-in element\n@see https://html.spec.whatwg.org/multipage/custom-elements.html#attr-is",+ required: false,+ control: "text",+ type: "string",+ },+ itemID: { required: false, control: "text", type: "string" },+ itemProp: { required: false, control: "text", type: "string" },+ itemRef: { required: false, control: "text", type: "string" },+ itemScope: { required: false, control: "boolean", type: "boolean" },+ itemType: { required: false, control: "text", type: "string" },+ lang: { required: false, control: "text", type: "string" },+ nonce: { required: false, control: "text", type: "string" },+ placeholder: { required: false, control: "text", type: "string" },+ prefix: { required: false, control: "text", type: "string" },+ property: { required: false, control: "text", type: "string" },+ radioGroup: { required: false, control: "text", type: "string" },+ rel: { required: false, control: "text", type: "string" },+ resource: { required: false, control: "text", type: "string" },+ results: { required: false, control: "number", type: "number" },+ rev: { required: false, control: "text", type: "string" },+ role: { required: false, control: "text", type: "string" },+ security: { required: false, control: "text", type: "string" },+ side: {+ required: false,+ control: "select",+ type: "string",+ options: ["top", "right", "bottom", "left"],+ },+ sideOffset: {+ required: false,+ control: "number",+ type: "number",+ defaultValue: 4,+ },+ slot: { required: false, control: "text", type: "string" },+ spellCheck: { required: false, control: "boolean", type: "boolean" },+ sticky: {+ required: false,+ control: "radio",+ type: "string",+ options: ["partial", "always"],+ },+ suppressContentEditableWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ suppressHydrationWarning: {+ required: false,+ control: "boolean",+ type: "boolean",+ },+ tabIndex: { required: false, control: "number", type: "number" },+ title: { required: false, control: "text", type: "string" },+ translate: {+ required: false,+ control: "radio",+ type: "string",+ options: ["yes", "no"],+ },+ typeof: { required: false, control: "text", type: "string" },+ unselectable: {+ required: false,+ control: "radio",+ type: "string",+ options: ["on", "off"],+ },+ vocab: { required: false, control: "text", type: "string" },+};diff --git a/packages/sdk-components-react/src/components.ts b/packages/sdk-components-react/src/components.tsindex 88beb0798e..5740c683e2 100644--- a/packages/sdk-components-react/src/components.ts+++ b/packages/sdk-components-react/src/components.ts@@ -31,3 +31,4 @@ export { VimeoPreviewImage } from "./vimeo-preview-image";export { VimeoPlayButton } from "./vimeo-play-button";export { VimeoSpinner } from "./vimeo-spinner";export { Tooltip, TooltipContent, TooltipTrigger } from "./radix-tooltip";+export { Popover, PopoverContent, PopoverTrigger } from "./radix-popover";diff --git a/packages/sdk-components-react/src/metas.ts b/packages/sdk-components-react/src/metas.tsindex 194f7267b3..2cad7a9dc8 100644--- a/packages/sdk-components-react/src/metas.ts+++ b/packages/sdk-components-react/src/metas.ts@@ -35,3 +35,9 @@ export {metaTooltipContent as TooltipContent,metaTooltipTrigger as TooltipTrigger,} from "./radix-tooltip.ws";++export {+ metaPopover as Popover,+ metaPopoverContent as PopoverContent,+ metaPopoverTrigger as PopoverTrigger,+} from "./radix-popover.ws";diff --git a/packages/sdk-components-react/src/props.ts b/packages/sdk-components-react/src/props.tsindex 18e0681512..11fcd108c9 100644--- a/packages/sdk-components-react/src/props.ts+++ b/packages/sdk-components-react/src/props.ts@@ -35,3 +35,8 @@ export {propsMetaTooltipContent as TooltipContent,propsMetaTooltipTrigger as TooltipTrigger,} from "./radix-tooltip.ws";+export {+ propsMetaPopover as Popover,+ propsMetaPopoverContent as PopoverContent,+ propsMetaPopoverTrigger as PopoverTrigger,+} from "./radix-popover.ws";diff --git a/packages/sdk-components-react/src/radix-popover.tsx b/packages/sdk-components-react/src/radix-popover.tsxnew file mode 100644index 0000000000..bc424ab4be--- /dev/null+++ b/packages/sdk-components-react/src/radix-popover.tsx@@ -0,0 +1,89 @@+/* eslint-disable react/display-name */+// We can't use .displayName until this is merged https://github.com/styleguidist/react-docgen-typescript/pull/449++import * as PopoverPrimitive from "@radix-ui/react-popover";+import {+ splitPropsWithWebstudioAttributes,+ type WebstudioAttributes,+} from "@webstudio-is/react-sdk";++import {+ forwardRef,+ type ElementRef,+ type ComponentPropsWithoutRef,+ Children,+ type ReactNode,+} from "react";++/**+ * We don't have support for boolean or undefined nor in UI not at Data variables,+ * instead of binding on "open" prop we bind variable on a isOpen prop to be able to show Popover in the builder+ **/+type BuilderPopoverProps = {+ isOpen: "initial" | "open" | "closed";+};++/**+ * Popover and PopoverTrigger are HTML-less components.+ * To make them work in our system, we wrap their attributes with a div that has a display: contents property.+ *+ * These divs function like fragments, with all web studio-related attributes attached to them.+ */+const DisplayContentsStyle = { display: "contents" };++export const Popover = forwardRef<+ ElementRef<"div">,+ WebstudioAttributes &+ ComponentPropsWithoutRef<typeof PopoverPrimitive.Root> &+ BuilderPopoverProps+>(({ open: openProp, isOpen, ...props }, ref) => {+ const [webstudioAttributes, restProps] =+ splitPropsWithWebstudioAttributes(props);++ const open =+ openProp ??+ (isOpen === "open" ? true : isOpen === "closed" ? false : undefined);++ return (+ <div ref={ref} style={DisplayContentsStyle} {...webstudioAttributes}>+ <PopoverPrimitive.Root open={open} {...restProps} />+ </div>+ );+});++/**+ * We're not exposing the 'asChild' property for the Trigger.+ * Instead, we're enforcing 'asChild=true' for the Trigger and making it style-less.+ * This avoids situations where the Trigger inadvertently passes all styles to its child,+ * which would prevent us from displaying styles properly in the builder.+ */+export const PopoverTrigger = forwardRef<+ ElementRef<"div">,+ WebstudioAttributes & { children: ReactNode }+>(({ children, ...props }, ref) => {+ const firstChild = Children.toArray(children)[0];+ const [webstudioAttributes, restProps] =+ splitPropsWithWebstudioAttributes(props);++ return (+ <div ref={ref} style={DisplayContentsStyle} {...webstudioAttributes}>+ <PopoverPrimitive.Trigger asChild={true} {...restProps}>+ {firstChild ?? <button>Add button or link</button>}+ </PopoverPrimitive.Trigger>+ </div>+ );+});++export const PopoverContent = forwardRef<+ ElementRef<typeof PopoverPrimitive.Content>,+ ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>+>(({ sideOffset = 4, align = "center", ...props }, ref) => (+ <PopoverPrimitive.Portal>+ <PopoverPrimitive.Content+ ref={ref}+ align="center"+ sideOffset={sideOffset}+ {...props}+ />+ </PopoverPrimitive.Portal>+));diff --git a/packages/sdk-components-react/src/radix-popover.ws.tsx b/packages/sdk-components-react/src/radix-popover.ws.tsxnew file mode 100644index 0000000000..8bdfbf4020--- /dev/null+++ b/packages/sdk-components-react/src/radix-popover.ws.tsx@@ -0,0 +1,123 @@+import { RadioCheckedIcon } from "@webstudio-is/icons/svg";+import {+ type WsComponentMeta,+ type WsComponentPropsMeta,+} from "@webstudio-is/react-sdk";+import * as tc from "./theme/tailwind-classes";++import {+ propsPopover,+ propsPopoverContent,+ propsPopoverTrigger,+} from "./__generated__/radix-popover.props";++// @todo add [data-state] to button and link+export const metaPopoverTrigger: WsComponentMeta = {+ category: "hidden",+ invalidAncestors: [],+ type: "container",+ label: "PopoverTrigger",+ icon: RadioCheckedIcon,+ stylable: false,+};++export const metaPopoverContent: WsComponentMeta = {+ category: "hidden",+ invalidAncestors: [],+ type: "container",+ label: "PopoverContent",+ icon: RadioCheckedIcon,+};++/**+ * Styles source without animations:+ * https://github.com/shadcn-ui/ui/blob/main/apps/www/registry/default/ui/popover.tsx+ *+ * Attributions+ * MIT License+ * Copyright (c) 2023 shadcn+ **/+export const metaPopover: WsComponentMeta = {+ category: "radix",+ invalidAncestors: [],+ type: "container",+ label: "Popover",+ icon: RadioCheckedIcon,+ order: 15,+ stylable: false,+ template: [+ {+ type: "instance",+ component: "Popover",+ label: "Popover",+ props: [+ {+ name: "isOpen",+ // We don't have support for boolean or undefined, instead of binding on open we bind on a string+ type: "string",+ value: "initial",+ dataSourceRef: {+ type: "variable",+ name: "isOpen",+ },+ },+ ],+ children: [+ {+ type: "instance",+ component: "PopoverTrigger",+ props: [],+ children: [+ {+ type: "instance",+ component: "Button",+ children: [{ type: "text", value: "Button" }],+ },+ ],+ },+ {+ type: "instance",+ component: "PopoverContent",+ label: "Popover Content",+ props: [],+ /**+ * z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none+ * z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md+ **/+ styles: [+ tc.z(50),+ tc.w(72),+ tc.rounded("md"),+ tc.border(),+ tc.bg("popover"),+ tc.p(4),+ tc.text("popoverForeground"),+ tc.shadow("md"),+ tc.outline("none"),+ ].flat(),+ children: [+ {+ type: "instance",+ component: "Text",+ children: [{ type: "text", value: "The text you can edit" }],+ },+ ],+ },+ ],+ },+ ],+};++export const propsMetaPopover: WsComponentPropsMeta = {+ props: propsPopover,+ initialProps: ["isOpen", "modal"],+};++export const propsMetaPopoverTrigger: WsComponentPropsMeta = {+ props: propsPopoverTrigger,+};++export const propsMetaPopoverContent: WsComponentPropsMeta = {+ props: propsPopoverContent,+ initialProps: ["side", "sideOffset", "align", "alignOffset"],+};diff --git a/packages/sdk-components-react/src/theme/tailwind-classes.ts b/packages/sdk-components-react/src/theme/tailwind-classes.tsindex 52fe89ff53..740808b3c4 100644--- a/packages/sdk-components-react/src/theme/tailwind-classes.ts+++ b/packages/sdk-components-react/src/theme/tailwind-classes.ts@@ -150,6 +150,16 @@ export const p = (return [...px(padding), ...py(padding)];};+export const w = (+ spacing: StringEnumToNumeric<keyof EvaluatedDefaultTheme["spacing"]>+): EmbedTemplateStyleDecl[] => {+ const key = `${spacing}` as const;+ const valueString = theme("spacing")?.[key] ?? "0";+ const value = parseCssValue("width", valueString);++ return [{ property: "width", value }];+};+export const bg = (color: keyof EvaluatedDefaultTheme["colors"]): EmbedTemplateStyleDecl[] => {@@ -162,6 +172,27 @@ export const bg = (];};+export const outline = (value: "none"): EmbedTemplateStyleDecl[] => {+ return [+ {+ property: "outlineWidth",+ value: { type: "unit", value: 2, unit: "px" },+ },+ {+ property: "outlineStyle",+ value: { type: "keyword", value: "solid" },+ },+ {+ property: "outlineColor",+ value: { type: "keyword", value: "transparent" },+ },+ {+ property: "outlineOffset",+ value: { type: "unit", value: 2, unit: "px" },+ },+ ];+};+const textSizes = ["sm","base",diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 9cd01f4d79..c9845f4605 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -1261,6 +1261,9 @@ importers:packages/sdk-components-react:dependencies:+ '@radix-ui/react-popover':+ specifier: ^1.0.6+ version: 1.0.6(@types/[email protected])(@types/[email protected])([email protected])([email protected])'@radix-ui/react-tooltip':specifier: ^1.0.6version: 1.0.6(@types/[email protected])(@types/[email protected])([email protected])([email protected])