mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-12-04 22:31:33 +09:00
Moved all component meta and embed template to sdk schema. Embed template generator is left in react-sdk, will probably be removed eventually.
52 lines
1.2 KiB
TypeScript
52 lines
1.2 KiB
TypeScript
import { SelectIcon } from "@webstudio-is/icons/svg";
|
|
import {
|
|
defaultStates,
|
|
type PresetStyle,
|
|
type WsComponentMeta,
|
|
type WsComponentPropsMeta,
|
|
} from "@webstudio-is/sdk";
|
|
import { select } from "@webstudio-is/sdk/normalize.css";
|
|
import type { defaultTag } from "./select";
|
|
import { props } from "./__generated__/select.props";
|
|
|
|
const presetStyle = {
|
|
select: [
|
|
...select,
|
|
{
|
|
property: "display",
|
|
value: { type: "keyword", value: "block" },
|
|
},
|
|
],
|
|
} satisfies PresetStyle<typeof defaultTag>;
|
|
|
|
export const meta: WsComponentMeta = {
|
|
constraints: {
|
|
relation: "ancestor",
|
|
component: { $nin: ["Button", "Link"] },
|
|
},
|
|
type: "container",
|
|
icon: SelectIcon,
|
|
presetStyle,
|
|
states: [
|
|
...defaultStates,
|
|
{ selector: "::placeholder", label: "Placeholder" },
|
|
{ selector: ":valid", label: "Valid" },
|
|
{ selector: ":invalid", label: "Invalid" },
|
|
{ selector: ":required", label: "Required" },
|
|
{ selector: ":optional", label: "Optional" },
|
|
],
|
|
};
|
|
|
|
export const propsMeta: WsComponentPropsMeta = {
|
|
props,
|
|
initialProps: [
|
|
"id",
|
|
"className",
|
|
"name",
|
|
"value",
|
|
"multiple",
|
|
"required",
|
|
"autoFocus",
|
|
],
|
|
};
|