Files
webstudio/packages/sdk-components-react/src/checkbox.ws.ts
T
Bogdan Chadkin 8b60ff7988 feat: infer states from tags in style panel (#5229)
Ref https://github.com/webstudio-is/webstudio/issues/3632

Now states are always inferred from tags. User action states work for
all tags.

<img width="233" alt="Screenshot 2025-05-22 at 19 27 18"
src="https://github.com/user-attachments/assets/f0dc6a07-8a01-4878-950e-61b6e489da7a"
/>
2025-05-22 21:16:40 +03:00

23 lines
665 B
TypeScript

import { CheckboxCheckedIcon } from "@webstudio-is/icons/svg";
import type { WsComponentMeta, PresetStyle } from "@webstudio-is/sdk";
import { checkbox } from "@webstudio-is/sdk/normalize.css";
import type { defaultTag } from "./checkbox";
import { props } from "./__generated__/checkbox.props";
const presetStyle = {
input: [
...checkbox,
{
property: "margin-right",
value: { type: "unit", unit: "em", value: 0.5 },
},
],
} satisfies PresetStyle<typeof defaultTag>;
export const meta: WsComponentMeta = {
icon: CheckboxCheckedIcon,
presetStyle,
initialProps: ["id", "class", "name", "value", "required", "checked"],
props,
};