@webstudio-is/react-sdk 0.61.0 → 0.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/custom-components/__generated__/form.props.js +412 -0
- package/lib/app/custom-components/__generated__/image.props.js +442 -0
- package/lib/app/custom-components/__generated__/link-block.props.js +432 -0
- package/lib/app/custom-components/__generated__/link.props.js +432 -0
- package/lib/app/custom-components/__generated__/rich-text-link.props.js +432 -0
- package/lib/app/custom-components/form.js +54 -0
- package/lib/app/custom-components/form.ws.js +81 -0
- package/lib/app/custom-components/index.js +10 -4
- package/lib/cjs/app/custom-components/__generated__/form.props.js +432 -0
- package/lib/cjs/app/custom-components/__generated__/image.props.js +462 -0
- package/lib/cjs/app/custom-components/__generated__/link-block.props.js +452 -0
- package/lib/cjs/app/custom-components/__generated__/link.props.js +452 -0
- package/lib/cjs/app/custom-components/__generated__/rich-text-link.props.js +452 -0
- package/lib/cjs/app/custom-components/form.js +70 -0
- package/lib/cjs/app/custom-components/form.ws.js +101 -0
- package/lib/cjs/app/custom-components/index.js +12 -6
- package/lib/cjs/components/__generated__/checkbox-field.props.js +419 -0
- package/lib/cjs/components/__generated__/checkbox.props.js +459 -0
- package/lib/cjs/components/__generated__/error-message.props.js +418 -0
- package/lib/cjs/components/__generated__/input.props.js +8 -3
- package/lib/cjs/components/__generated__/label.props.js +420 -0
- package/lib/cjs/components/__generated__/radio-button-field.props.js +419 -0
- package/lib/cjs/components/__generated__/radio-button.props.js +459 -0
- package/lib/cjs/components/__generated__/success-message.props.js +418 -0
- package/lib/cjs/components/__generated__/textarea.props.js +432 -0
- package/lib/cjs/components/blockquote.ws.js +2 -0
- package/lib/cjs/components/body.ws.js +2 -0
- package/lib/cjs/components/bold.ws.js +2 -0
- package/lib/cjs/components/box.ws.js +2 -0
- package/lib/cjs/components/button.ws.js +8 -2
- package/lib/cjs/components/checkbox-field.js +29 -0
- package/lib/cjs/components/checkbox-field.ws.js +55 -0
- package/lib/cjs/components/checkbox.js +29 -0
- package/lib/cjs/components/checkbox.ws.js +57 -0
- package/lib/cjs/components/code.ws.js +2 -0
- package/lib/cjs/components/component-meta.js +13 -1
- package/lib/cjs/components/components-utils.js +9 -1
- package/lib/cjs/components/components.js +17 -1
- package/lib/cjs/components/error-message.js +29 -0
- package/lib/cjs/components/error-message.ws.js +40 -0
- package/lib/cjs/components/form.js +1 -1
- package/lib/cjs/components/form.ws.js +27 -6
- package/lib/cjs/components/heading.ws.js +2 -0
- package/lib/cjs/components/image.ws.js +2 -0
- package/lib/cjs/components/index.js +43 -2
- package/lib/cjs/components/input.ws.js +17 -3
- package/lib/cjs/components/italic.ws.js +2 -0
- package/lib/cjs/components/label.js +29 -0
- package/lib/cjs/components/label.ws.js +56 -0
- package/lib/cjs/components/link-block.ws.js +1 -1
- package/lib/cjs/components/link.ws.js +13 -1
- package/lib/cjs/components/list-item.ws.js +3 -0
- package/lib/cjs/components/list.ws.js +2 -0
- package/lib/cjs/components/paragraph.ws.js +2 -0
- package/lib/cjs/components/radio-button-field.js +29 -0
- package/lib/cjs/components/radio-button-field.ws.js +55 -0
- package/lib/cjs/components/radio-button.js +29 -0
- package/lib/cjs/components/radio-button.ws.js +57 -0
- package/lib/cjs/components/separator.ws.js +2 -0
- package/lib/cjs/components/span.ws.js +2 -0
- package/lib/cjs/components/subscript.ws.js +2 -0
- package/lib/cjs/components/success-message.js +29 -0
- package/lib/cjs/components/success-message.ws.js +40 -0
- package/lib/cjs/components/superscript.ws.js +2 -0
- package/lib/cjs/components/text-block.ws.js +2 -0
- package/lib/cjs/components/textarea.js +29 -0
- package/lib/cjs/components/textarea.ws.js +58 -0
- package/lib/cjs/css/normalize.js +3 -1
- package/lib/cjs/css/presets.js +19 -1
- package/lib/cjs/index.js +2 -1
- package/lib/components/__generated__/checkbox-field.props.js +399 -0
- package/lib/components/__generated__/checkbox.props.js +439 -0
- package/lib/components/__generated__/error-message.props.js +398 -0
- package/lib/components/__generated__/input.props.js +8 -3
- package/lib/components/__generated__/label.props.js +400 -0
- package/lib/components/__generated__/radio-button-field.props.js +399 -0
- package/lib/components/__generated__/radio-button.props.js +439 -0
- package/lib/components/__generated__/success-message.props.js +398 -0
- package/lib/components/__generated__/textarea.props.js +412 -0
- package/lib/components/blockquote.ws.js +4 -0
- package/lib/components/body.ws.js +4 -0
- package/lib/components/bold.ws.js +4 -0
- package/lib/components/box.ws.js +4 -0
- package/lib/components/button.ws.js +10 -2
- package/lib/components/checkbox-field.js +9 -0
- package/lib/components/checkbox-field.ws.js +37 -0
- package/lib/components/checkbox.js +9 -0
- package/lib/components/checkbox.ws.js +39 -0
- package/lib/components/code.ws.js +4 -0
- package/lib/components/component-meta.js +13 -1
- package/lib/components/components-utils.js +9 -1
- package/lib/components/components.js +17 -1
- package/lib/components/error-message.js +9 -0
- package/lib/components/error-message.ws.js +20 -0
- package/lib/components/form.js +1 -1
- package/lib/components/form.ws.js +29 -6
- package/lib/components/heading.ws.js +4 -0
- package/lib/components/image.ws.js +4 -0
- package/lib/components/index.js +43 -2
- package/lib/components/input.ws.js +19 -3
- package/lib/components/italic.ws.js +4 -0
- package/lib/components/label.js +9 -0
- package/lib/components/label.ws.js +38 -0
- package/lib/components/link-block.ws.js +2 -2
- package/lib/components/link.ws.js +15 -1
- package/lib/components/list-item.ws.js +5 -0
- package/lib/components/list.ws.js +4 -0
- package/lib/components/paragraph.ws.js +4 -0
- package/lib/components/radio-button-field.js +9 -0
- package/lib/components/radio-button-field.ws.js +37 -0
- package/lib/components/radio-button.js +9 -0
- package/lib/components/radio-button.ws.js +39 -0
- package/lib/components/separator.ws.js +4 -0
- package/lib/components/span.ws.js +4 -0
- package/lib/components/subscript.ws.js +4 -0
- package/lib/components/success-message.js +9 -0
- package/lib/components/success-message.ws.js +20 -0
- package/lib/components/superscript.ws.js +4 -0
- package/lib/components/text-block.ws.js +4 -0
- package/lib/components/textarea.js +9 -0
- package/lib/components/textarea.ws.js +40 -0
- package/lib/css/normalize.js +4 -2
- package/lib/css/presets.js +19 -1
- package/lib/index.js +4 -2
- package/lib/types/app/custom-components/__generated__/form.props.d.ts +2 -0
- package/lib/types/app/custom-components/__generated__/image.props.d.ts +2 -0
- package/lib/types/app/custom-components/__generated__/link-block.props.d.ts +2 -0
- package/lib/types/app/custom-components/__generated__/link.props.d.ts +2 -0
- package/lib/types/app/custom-components/__generated__/rich-text-link.props.d.ts +2 -0
- package/lib/types/app/custom-components/form.d.ts +5 -0
- package/lib/types/app/custom-components/form.ws.d.ts +3 -0
- package/lib/types/app/custom-components/index.d.ts +6 -1
- package/lib/types/components/__generated__/checkbox-field.props.d.ts +2 -0
- package/lib/types/components/__generated__/checkbox.props.d.ts +2 -0
- package/lib/types/components/__generated__/error-message.props.d.ts +2 -0
- package/lib/types/components/__generated__/label.props.d.ts +2 -0
- package/lib/types/components/__generated__/radio-button-field.props.d.ts +2 -0
- package/lib/types/components/__generated__/radio-button.props.d.ts +2 -0
- package/lib/types/components/__generated__/success-message.props.d.ts +2 -0
- package/lib/types/components/__generated__/textarea.props.d.ts +2 -0
- package/lib/types/components/blockquote.ws.d.ts +1 -1
- package/lib/types/components/body.ws.d.ts +1 -1
- package/lib/types/components/bold.ws.d.ts +1 -1
- package/lib/types/components/box.ws.d.ts +1 -1
- package/lib/types/components/button.ws.d.ts +1 -1
- package/lib/types/components/checkbox-field.d.ts +3 -0
- package/lib/types/components/checkbox-field.ws.d.ts +3 -0
- package/lib/types/components/checkbox.d.ts +3 -0
- package/lib/types/components/checkbox.ws.d.ts +3 -0
- package/lib/types/components/code.ws.d.ts +1 -1
- package/lib/types/components/component-meta.d.ts +17 -4
- package/lib/types/components/components-utils.d.ts +5 -20
- package/lib/types/components/components.d.ts +8 -0
- package/lib/types/components/error-message.d.ts +3 -0
- package/lib/types/components/error-message.ws.d.ts +3 -0
- package/lib/types/components/form.ws.d.ts +1 -1
- package/lib/types/components/heading.ws.d.ts +1 -1
- package/lib/types/components/image.ws.d.ts +1 -1
- package/lib/types/components/index.d.ts +1 -0
- package/lib/types/components/input.d.ts +3 -1
- package/lib/types/components/input.stories.d.ts +6 -2
- package/lib/types/components/input.ws.d.ts +1 -1
- package/lib/types/components/italic.ws.d.ts +1 -1
- package/lib/types/components/label.d.ts +3 -0
- package/lib/types/components/label.ws.d.ts +3 -0
- package/lib/types/components/link.ws.d.ts +1 -1
- package/lib/types/components/list-item.ws.d.ts +1 -1
- package/lib/types/components/list.ws.d.ts +1 -1
- package/lib/types/components/paragraph.ws.d.ts +1 -1
- package/lib/types/components/radio-button-field.d.ts +3 -0
- package/lib/types/components/radio-button-field.ws.d.ts +3 -0
- package/lib/types/components/radio-button.d.ts +3 -0
- package/lib/types/components/radio-button.ws.d.ts +3 -0
- package/lib/types/components/separator.ws.d.ts +1 -1
- package/lib/types/components/span.ws.d.ts +1 -1
- package/lib/types/components/subscript.ws.d.ts +1 -1
- package/lib/types/components/success-message.d.ts +3 -0
- package/lib/types/components/success-message.ws.d.ts +3 -0
- package/lib/types/components/superscript.ws.d.ts +1 -1
- package/lib/types/components/text-block.ws.d.ts +1 -1
- package/lib/types/components/textarea.d.ts +3 -0
- package/lib/types/components/textarea.ws.d.ts +3 -0
- package/lib/types/css/normalize.d.ts +239 -46
- package/lib/types/css/presets.d.ts +3 -2
- package/lib/types/css/style-rules.d.ts +1 -1
- package/lib/types/embed-template.d.ts +4 -4
- package/lib/types/index.d.ts +1 -1
- package/package.json +12 -12
- package/src/app/custom-components/__generated__/form.props.ts +457 -0
- package/src/app/custom-components/__generated__/image.props.ts +487 -0
- package/src/app/custom-components/__generated__/link-block.props.ts +477 -0
- package/src/app/custom-components/__generated__/link.props.ts +477 -0
- package/src/app/custom-components/__generated__/rich-text-link.props.ts +477 -0
- package/src/app/custom-components/form.tsx +94 -0
- package/src/app/custom-components/form.ws.tsx +86 -0
- package/src/app/custom-components/index.ts +9 -4
- package/src/components/__generated__/checkbox-field.props.ts +444 -0
- package/src/components/__generated__/checkbox.props.ts +484 -0
- package/src/components/__generated__/error-message.props.ts +443 -0
- package/src/components/__generated__/input.props.ts +8 -3
- package/src/components/__generated__/label.props.ts +445 -0
- package/src/components/__generated__/radio-button-field.props.ts +444 -0
- package/src/components/__generated__/radio-button.props.ts +484 -0
- package/src/components/__generated__/success-message.props.ts +443 -0
- package/src/components/__generated__/textarea.props.ts +457 -0
- package/src/components/blockquote.ws.tsx +6 -4
- package/src/components/body.ws.tsx +6 -4
- package/src/components/bold.ws.tsx +6 -4
- package/src/components/box.ws.ts +6 -4
- package/src/components/button.ws.tsx +11 -5
- package/src/components/checkbox-field.tsx +10 -0
- package/src/components/checkbox-field.ws.tsx +40 -0
- package/src/components/checkbox.tsx +13 -0
- package/src/components/checkbox.ws.tsx +42 -0
- package/src/components/code.ws.tsx +6 -4
- package/src/components/component-meta.ts +12 -0
- package/src/components/components-utils.ts +16 -10
- package/src/components/components.ts +8 -0
- package/src/components/error-message.tsx +10 -0
- package/src/components/error-message.ws.tsx +24 -0
- package/src/components/form.tsx +5 -1
- package/src/components/form.ws.tsx +30 -9
- package/src/components/heading.ws.tsx +6 -4
- package/src/components/image.ws.tsx +6 -4
- package/src/components/index.ts +47 -0
- package/src/components/input.tsx +3 -1
- package/src/components/input.ws.tsx +19 -5
- package/src/components/italic.ws.tsx +6 -4
- package/src/components/label.tsx +10 -0
- package/src/components/label.ws.tsx +41 -0
- package/src/components/link-block.ws.tsx +2 -2
- package/src/components/link.ws.tsx +17 -5
- package/src/components/list-item.ws.tsx +7 -4
- package/src/components/list.ws.tsx +6 -4
- package/src/components/paragraph.ws.tsx +6 -4
- package/src/components/radio-button-field.tsx +10 -0
- package/src/components/radio-button-field.ws.tsx +40 -0
- package/src/components/radio-button.tsx +13 -0
- package/src/components/radio-button.ws.tsx +42 -0
- package/src/components/separator.ws.tsx +6 -4
- package/src/components/span.ws.tsx +6 -4
- package/src/components/subscript.ws.tsx +6 -4
- package/src/components/success-message.tsx +10 -0
- package/src/components/success-message.ws.tsx +24 -0
- package/src/components/superscript.ws.tsx +6 -4
- package/src/components/text-block.ws.tsx +6 -4
- package/src/components/textarea.tsx +13 -0
- package/src/components/textarea.ws.tsx +43 -0
- package/src/css/normalize.ts +21 -18
- package/src/css/presets.ts +20 -2
- package/src/index.ts +1 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { CodeIcon } from "@webstudio-is/icons";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import {
|
|
3
|
+
defaultStates,
|
|
4
|
+
type PresetStyle,
|
|
5
|
+
type WsComponentMeta,
|
|
6
|
+
type WsComponentPropsMeta,
|
|
6
7
|
} from "./component-meta";
|
|
7
8
|
import { type defaultTag, displayVarNamespace } from "./code";
|
|
8
9
|
import { props } from "./__generated__/code.props";
|
|
@@ -39,6 +40,7 @@ export const meta: WsComponentMeta = {
|
|
|
39
40
|
type: "rich-text",
|
|
40
41
|
label: "Code",
|
|
41
42
|
Icon: CodeIcon,
|
|
43
|
+
states: defaultStates,
|
|
42
44
|
presetStyle,
|
|
43
45
|
children: [{ type: "text", value: "Code you can edit" }],
|
|
44
46
|
};
|
|
@@ -25,13 +25,24 @@ export const componentCategories = [
|
|
|
25
25
|
"forms",
|
|
26
26
|
] as const;
|
|
27
27
|
|
|
28
|
+
export const stateCategories = ["states", "component-states"] as const;
|
|
29
|
+
|
|
28
30
|
export const ComponentState = z.object({
|
|
31
|
+
category: z.enum(stateCategories).optional(),
|
|
29
32
|
selector: z.string(),
|
|
30
33
|
label: z.string(),
|
|
31
34
|
});
|
|
32
35
|
|
|
33
36
|
export type ComponentState = z.infer<typeof ComponentState>;
|
|
34
37
|
|
|
38
|
+
export const defaultStates: ComponentState[] = [
|
|
39
|
+
{ selector: ":hover", label: "Hover" },
|
|
40
|
+
{ selector: ":active", label: "Active" },
|
|
41
|
+
{ selector: ":focus", label: "Focus" },
|
|
42
|
+
{ selector: ":focus-visible", label: "Focus Visible" },
|
|
43
|
+
{ selector: ":focus-within", label: "Focus Within" },
|
|
44
|
+
];
|
|
45
|
+
|
|
35
46
|
const WsComponentMeta = z.object({
|
|
36
47
|
category: z.enum(componentCategories).optional(),
|
|
37
48
|
// container - can accept other components with dnd
|
|
@@ -46,6 +57,7 @@ const WsComponentMeta = z.object({
|
|
|
46
57
|
"rich-text",
|
|
47
58
|
"rich-text-child",
|
|
48
59
|
]),
|
|
60
|
+
acceptedParents: z.optional(z.array(z.string())),
|
|
49
61
|
label: z.string(),
|
|
50
62
|
Icon: z.function(),
|
|
51
63
|
presetStyle: z.optional(z.any()),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { forwardRef } from "react";
|
|
1
2
|
import * as components from "./components";
|
|
2
3
|
import { registeredComponents } from "./index";
|
|
3
4
|
|
|
@@ -34,6 +35,14 @@ const componentNames = Object.keys({
|
|
|
34
35
|
ListItem: 1,
|
|
35
36
|
Separator: 1,
|
|
36
37
|
Code: 1,
|
|
38
|
+
Label: 1,
|
|
39
|
+
SuccessMessage: 1,
|
|
40
|
+
ErrorMessage: 1,
|
|
41
|
+
Textarea: 1,
|
|
42
|
+
RadioButtonField: 1,
|
|
43
|
+
RadioButton: 1,
|
|
44
|
+
CheckboxField: 1,
|
|
45
|
+
Checkbox: 1,
|
|
37
46
|
} satisfies { [K in keyof typeof components]: 1 }) as Array<
|
|
38
47
|
keyof typeof components
|
|
39
48
|
>;
|
|
@@ -47,17 +56,16 @@ export const getComponentNames = (): ComponentName[] => {
|
|
|
47
56
|
return Array.from(uniqueNames) as ComponentName[];
|
|
48
57
|
};
|
|
49
58
|
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60
|
+
type AnyComponent = ReturnType<typeof forwardRef<any, any>>;
|
|
61
|
+
|
|
50
62
|
/**
|
|
51
63
|
* Now used only in builder app
|
|
52
64
|
* @todo Consider using the same approach in the builder app as in the published apps . A dynamic import is needed
|
|
53
65
|
*/
|
|
54
|
-
export const getComponent = (
|
|
55
|
-
name: string
|
|
56
|
-
): undefined | (typeof components)[ComponentName] => {
|
|
66
|
+
export const getComponent = (name: string): undefined | AnyComponent => {
|
|
57
67
|
return registeredComponents != null && name in registeredComponents
|
|
58
|
-
? (registeredComponents[
|
|
59
|
-
name as ComponentName
|
|
60
|
-
] as (typeof components)[ComponentName])
|
|
68
|
+
? (registeredComponents[name as ComponentName] as AnyComponent)
|
|
61
69
|
: components[name as ComponentName];
|
|
62
70
|
};
|
|
63
71
|
|
|
@@ -68,11 +76,9 @@ export const getComponent = (
|
|
|
68
76
|
* see example /packages/sdk-size-test/app/routes/$.tsx
|
|
69
77
|
**/
|
|
70
78
|
export const createGetComponent = (comps: Partial<typeof components>) => {
|
|
71
|
-
return (name: string) => {
|
|
79
|
+
return (name: string): undefined | AnyComponent => {
|
|
72
80
|
return registeredComponents != null && name in registeredComponents
|
|
73
|
-
? (registeredComponents[
|
|
74
|
-
name as ComponentName
|
|
75
|
-
] as (typeof components)[ComponentName])
|
|
81
|
+
? (registeredComponents[name as ComponentName] as AnyComponent)
|
|
76
82
|
: comps[name as ComponentName];
|
|
77
83
|
};
|
|
78
84
|
};
|
|
@@ -29,3 +29,11 @@ export { List } from "./list";
|
|
|
29
29
|
export { ListItem } from "./list-item";
|
|
30
30
|
export { Separator } from "./separator";
|
|
31
31
|
export { Code } from "./code";
|
|
32
|
+
export { Label } from "./label";
|
|
33
|
+
export { SuccessMessage } from "./success-message";
|
|
34
|
+
export { ErrorMessage } from "./error-message";
|
|
35
|
+
export { Textarea } from "./textarea";
|
|
36
|
+
export { RadioButtonField } from "./radio-button-field";
|
|
37
|
+
export { RadioButton } from "./radio-button";
|
|
38
|
+
export { CheckboxField } from "./checkbox-field";
|
|
39
|
+
export { Checkbox } from "./checkbox";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { forwardRef, type ElementRef, type ComponentProps } from "react";
|
|
2
|
+
|
|
3
|
+
export const defaultTag = "div";
|
|
4
|
+
|
|
5
|
+
export const ErrorMessage = forwardRef<
|
|
6
|
+
ElementRef<typeof defaultTag>,
|
|
7
|
+
ComponentProps<typeof defaultTag>
|
|
8
|
+
>((props, ref) => <div {...props} ref={ref} />);
|
|
9
|
+
|
|
10
|
+
ErrorMessage.displayName = "ErrorMessage";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BoxIcon } from "@webstudio-is/icons";
|
|
2
|
+
import type {
|
|
3
|
+
WsComponentMeta,
|
|
4
|
+
WsComponentPropsMeta,
|
|
5
|
+
PresetStyle,
|
|
6
|
+
} from "./component-meta";
|
|
7
|
+
import { props } from "./__generated__/error-message.props";
|
|
8
|
+
import { div } from "../css/normalize";
|
|
9
|
+
|
|
10
|
+
const presetStyle = {
|
|
11
|
+
div,
|
|
12
|
+
} satisfies PresetStyle<"div">;
|
|
13
|
+
|
|
14
|
+
export const meta: WsComponentMeta = {
|
|
15
|
+
type: "container",
|
|
16
|
+
label: "Error Message",
|
|
17
|
+
Icon: BoxIcon,
|
|
18
|
+
presetStyle,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const propsMeta: WsComponentPropsMeta = {
|
|
22
|
+
props,
|
|
23
|
+
initialProps: [],
|
|
24
|
+
};
|
package/src/components/form.tsx
CHANGED
|
@@ -5,6 +5,10 @@ export const defaultTag = "form";
|
|
|
5
5
|
export const Form = forwardRef<
|
|
6
6
|
ElementRef<typeof defaultTag>,
|
|
7
7
|
ComponentProps<typeof defaultTag>
|
|
8
|
-
>((props, ref) =>
|
|
8
|
+
>(({ children, ...props }, ref) => (
|
|
9
|
+
<form {...props} ref={ref}>
|
|
10
|
+
{children}
|
|
11
|
+
</form>
|
|
12
|
+
));
|
|
9
13
|
|
|
10
14
|
Form.displayName = "Form";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { FormIcon } from "@webstudio-is/icons";
|
|
2
2
|
import { form } from "../css/normalize";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import {
|
|
4
|
+
defaultStates,
|
|
5
|
+
type PresetStyle,
|
|
6
|
+
type WsComponentMeta,
|
|
7
|
+
type WsComponentPropsMeta,
|
|
7
8
|
} from "./component-meta";
|
|
8
9
|
import type { defaultTag } from "./form";
|
|
9
10
|
import { props } from "./__generated__/form.props";
|
|
@@ -11,10 +12,7 @@ import { props } from "./__generated__/form.props";
|
|
|
11
12
|
const presetStyle = {
|
|
12
13
|
form: [
|
|
13
14
|
...form,
|
|
14
|
-
{
|
|
15
|
-
property: "minHeight",
|
|
16
|
-
value: { type: "unit", unit: "px", value: 20 },
|
|
17
|
-
},
|
|
15
|
+
{ property: "minHeight", value: { type: "unit", unit: "px", value: 20 } },
|
|
18
16
|
],
|
|
19
17
|
} satisfies PresetStyle<typeof defaultTag>;
|
|
20
18
|
|
|
@@ -23,9 +21,31 @@ export const meta: WsComponentMeta = {
|
|
|
23
21
|
type: "container",
|
|
24
22
|
label: "Form",
|
|
25
23
|
Icon: FormIcon,
|
|
24
|
+
states: defaultStates,
|
|
26
25
|
presetStyle,
|
|
27
26
|
children: [
|
|
28
|
-
{
|
|
27
|
+
{
|
|
28
|
+
type: "instance",
|
|
29
|
+
component: "Label",
|
|
30
|
+
children: [{ type: "text", value: "Name" }],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: "instance",
|
|
34
|
+
component: "Input",
|
|
35
|
+
props: [{ type: "string", name: "name", value: "name" }],
|
|
36
|
+
children: [],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: "instance",
|
|
40
|
+
component: "Label",
|
|
41
|
+
children: [{ type: "text", value: "Email" }],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
type: "instance",
|
|
45
|
+
component: "Input",
|
|
46
|
+
props: [{ type: "string", name: "email", value: "email" }],
|
|
47
|
+
children: [],
|
|
48
|
+
},
|
|
29
49
|
{
|
|
30
50
|
type: "instance",
|
|
31
51
|
component: "Button",
|
|
@@ -36,4 +56,5 @@ export const meta: WsComponentMeta = {
|
|
|
36
56
|
|
|
37
57
|
export const propsMeta: WsComponentPropsMeta = {
|
|
38
58
|
props,
|
|
59
|
+
initialProps: [],
|
|
39
60
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { HeadingIcon } from "@webstudio-is/icons";
|
|
2
2
|
import type { ComponentProps } from "react";
|
|
3
3
|
import { h1, h2, h3, h4, h5, h6 } from "../css/normalize";
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import {
|
|
5
|
+
defaultStates,
|
|
6
|
+
type PresetStyle,
|
|
7
|
+
type WsComponentMeta,
|
|
8
|
+
type WsComponentPropsMeta,
|
|
8
9
|
} from "./component-meta";
|
|
9
10
|
import type { Heading } from "./heading";
|
|
10
11
|
import { props } from "./__generated__/heading.props";
|
|
@@ -26,6 +27,7 @@ export const meta: WsComponentMeta = {
|
|
|
26
27
|
label: "Heading",
|
|
27
28
|
Icon: HeadingIcon,
|
|
28
29
|
children: [{ type: "text", value: "Heading you can edit" }],
|
|
30
|
+
states: defaultStates,
|
|
29
31
|
presetStyle,
|
|
30
32
|
};
|
|
31
33
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ImageIcon } from "@webstudio-is/icons";
|
|
2
2
|
import { img } from "../css/normalize";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import {
|
|
4
|
+
defaultStates,
|
|
5
|
+
type PresetStyle,
|
|
6
|
+
type WsComponentMeta,
|
|
7
|
+
type WsComponentPropsMeta,
|
|
7
8
|
} from "./component-meta";
|
|
8
9
|
import type { defaultTag } from "./image";
|
|
9
10
|
import { props } from "./__generated__/image.props";
|
|
@@ -31,6 +32,7 @@ export const meta: WsComponentMeta = {
|
|
|
31
32
|
type: "embed",
|
|
32
33
|
label: "Image",
|
|
33
34
|
Icon: ImageIcon,
|
|
35
|
+
states: defaultStates,
|
|
34
36
|
presetStyle,
|
|
35
37
|
};
|
|
36
38
|
|
package/src/components/index.ts
CHANGED
|
@@ -25,6 +25,14 @@ import { meta as ListMeta } from "./list.ws";
|
|
|
25
25
|
import { meta as ListItemMeta } from "./list-item.ws";
|
|
26
26
|
import { meta as SeparatorMeta } from "./separator.ws";
|
|
27
27
|
import { meta as CodeMeta } from "./code.ws";
|
|
28
|
+
import { meta as LabelMeta } from "./label.ws";
|
|
29
|
+
import { meta as SuccessMessageMeta } from "./success-message.ws";
|
|
30
|
+
import { meta as ErrorMessageMeta } from "./error-message.ws";
|
|
31
|
+
import { meta as TextareaMeta } from "./textarea.ws";
|
|
32
|
+
import { meta as RadioButtonFieldMeta } from "./radio-button-field.ws";
|
|
33
|
+
import { meta as RadioButtonMeta } from "./radio-button.ws";
|
|
34
|
+
import { meta as CheckboxFieldMeta } from "./checkbox-field.ws";
|
|
35
|
+
import { meta as CheckboxMeta } from "./checkbox.ws";
|
|
28
36
|
|
|
29
37
|
// these are huge JSON objects that we want to be tree-shaken when not used!
|
|
30
38
|
import { propsMeta as SlotMetaPropsMeta } from "./slot.ws";
|
|
@@ -51,6 +59,14 @@ import { propsMeta as ListPropsMeta } from "./list.ws";
|
|
|
51
59
|
import { propsMeta as ListItemPropsMeta } from "./list-item.ws";
|
|
52
60
|
import { propsMeta as SeparatorPropsMeta } from "./separator.ws";
|
|
53
61
|
import { propsMeta as CodePropsMeta } from "./code.ws";
|
|
62
|
+
import { propsMeta as LabelPropsMeta } from "./label.ws";
|
|
63
|
+
import { propsMeta as SuccessMessagePropsMeta } from "./success-message.ws";
|
|
64
|
+
import { propsMeta as ErrorMessagePropsMeta } from "./error-message.ws";
|
|
65
|
+
import { propsMeta as TextareaPropsMeta } from "./textarea.ws";
|
|
66
|
+
import { propsMeta as RadioButtonFieldPropsMeta } from "./radio-button-field.ws";
|
|
67
|
+
import { propsMeta as RadioButtonPropsMeta } from "./radio-button.ws";
|
|
68
|
+
import { propsMeta as CheckboxFieldPropsMeta } from "./checkbox-field.ws";
|
|
69
|
+
import { propsMeta as CheckboxPropsMeta } from "./checkbox.ws";
|
|
54
70
|
|
|
55
71
|
// @todo this list should not be hardcoded!
|
|
56
72
|
const defaultMetas: Record<string, WsComponentMeta> = {
|
|
@@ -78,6 +94,14 @@ const defaultMetas: Record<string, WsComponentMeta> = {
|
|
|
78
94
|
ListItem: ListItemMeta,
|
|
79
95
|
Separator: SeparatorMeta,
|
|
80
96
|
Code: CodeMeta,
|
|
97
|
+
Label: LabelMeta,
|
|
98
|
+
SuccessMessage: SuccessMessageMeta,
|
|
99
|
+
ErrorMessage: ErrorMessageMeta,
|
|
100
|
+
Textarea: TextareaMeta,
|
|
101
|
+
RadioButtonField: RadioButtonFieldMeta,
|
|
102
|
+
RadioButton: RadioButtonMeta,
|
|
103
|
+
CheckboxField: CheckboxFieldMeta,
|
|
104
|
+
Checkbox: CheckboxMeta,
|
|
81
105
|
};
|
|
82
106
|
|
|
83
107
|
let currentMetas = defaultMetas;
|
|
@@ -122,6 +146,14 @@ const defaultPropsMetasRaw = {
|
|
|
122
146
|
ListItem: ListItemPropsMeta,
|
|
123
147
|
Separator: SeparatorPropsMeta,
|
|
124
148
|
Code: CodePropsMeta,
|
|
149
|
+
Label: LabelPropsMeta,
|
|
150
|
+
SuccessMessage: SuccessMessagePropsMeta,
|
|
151
|
+
ErrorMessage: ErrorMessagePropsMeta,
|
|
152
|
+
Textarea: TextareaPropsMeta,
|
|
153
|
+
RadioButtonField: RadioButtonFieldPropsMeta,
|
|
154
|
+
RadioButton: RadioButtonPropsMeta,
|
|
155
|
+
CheckboxField: CheckboxFieldPropsMeta,
|
|
156
|
+
Checkbox: CheckboxPropsMeta,
|
|
125
157
|
} as const;
|
|
126
158
|
|
|
127
159
|
const defaultPropsMetas: Record<string, WsComponentPropsMeta> =
|
|
@@ -219,3 +251,18 @@ const computeInitialProps = (
|
|
|
219
251
|
// order of initialProps must be preserved
|
|
220
252
|
return [...initialProps, ...requiredProps];
|
|
221
253
|
};
|
|
254
|
+
|
|
255
|
+
export const canAcceptComponent = (
|
|
256
|
+
parentComponent: string,
|
|
257
|
+
childComponent: string
|
|
258
|
+
) => {
|
|
259
|
+
const parentMeta = getComponentMeta(parentComponent);
|
|
260
|
+
const childMeta = getComponentMeta(childComponent);
|
|
261
|
+
if (parentMeta?.type !== "container" || childMeta === undefined) {
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
return (
|
|
265
|
+
childMeta.acceptedParents === undefined ||
|
|
266
|
+
childMeta.acceptedParents.includes(parentComponent)
|
|
267
|
+
);
|
|
268
|
+
};
|
package/src/components/input.tsx
CHANGED
|
@@ -4,7 +4,9 @@ export const defaultTag = "input";
|
|
|
4
4
|
|
|
5
5
|
export const Input = forwardRef<
|
|
6
6
|
ElementRef<typeof defaultTag>,
|
|
7
|
-
ComponentProps<typeof defaultTag>
|
|
7
|
+
ComponentProps<typeof defaultTag> & {
|
|
8
|
+
type?: "text" | "email" | "password" | "number" | "tel" | "url";
|
|
9
|
+
}
|
|
8
10
|
// Make sure children are not passed down to an input, because this will result in error.
|
|
9
11
|
>(({ children: _children, ...props }, ref) => <input {...props} ref={ref} />);
|
|
10
12
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { FormTextFieldIcon } from "@webstudio-is/icons";
|
|
2
2
|
import { input } from "../css/normalize";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import {
|
|
4
|
+
defaultStates,
|
|
5
|
+
type PresetStyle,
|
|
6
|
+
type WsComponentMeta,
|
|
7
|
+
type WsComponentPropsMeta,
|
|
7
8
|
} from "./component-meta";
|
|
8
9
|
import type { defaultTag } from "./input";
|
|
9
10
|
import { props } from "./__generated__/input.props";
|
|
@@ -15,11 +16,24 @@ const presetStyle = {
|
|
|
15
16
|
export const meta: WsComponentMeta = {
|
|
16
17
|
category: "forms",
|
|
17
18
|
type: "control",
|
|
18
|
-
label: "
|
|
19
|
+
label: "Text Field",
|
|
19
20
|
Icon: FormTextFieldIcon,
|
|
20
21
|
presetStyle,
|
|
22
|
+
states: [
|
|
23
|
+
...defaultStates,
|
|
24
|
+
{ selector: "::placeholder", label: "Placeholder" },
|
|
25
|
+
{ selector: ":valid", label: "Valid" },
|
|
26
|
+
{ selector: ":invalid", label: "Invalid" },
|
|
27
|
+
{ selector: ":required", label: "Required" },
|
|
28
|
+
{ selector: ":optional", label: "Optional" },
|
|
29
|
+
{ selector: ":disabled", label: "Disabled" },
|
|
30
|
+
{ selector: ":enabled", label: "Enabled" },
|
|
31
|
+
{ selector: ":read-only", label: "Read Only" },
|
|
32
|
+
{ selector: ":read-write", label: "Read Write" },
|
|
33
|
+
],
|
|
21
34
|
};
|
|
22
35
|
|
|
23
36
|
export const propsMeta: WsComponentPropsMeta = {
|
|
24
37
|
props,
|
|
38
|
+
initialProps: ["name", "type", "placeholder", "required", "autoFocus"],
|
|
25
39
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { TextItalicIcon } from "@webstudio-is/icons";
|
|
2
2
|
import type { defaultTag } from "./italic";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import {
|
|
4
|
+
defaultStates,
|
|
5
|
+
type PresetStyle,
|
|
6
|
+
type WsComponentMeta,
|
|
7
|
+
type WsComponentPropsMeta,
|
|
7
8
|
} from "./component-meta";
|
|
8
9
|
import { props } from "./__generated__/italic.props";
|
|
9
10
|
import { i } from "../css/normalize";
|
|
@@ -22,6 +23,7 @@ export const meta: WsComponentMeta = {
|
|
|
22
23
|
type: "rich-text-child",
|
|
23
24
|
label: "Italic Text",
|
|
24
25
|
Icon: TextItalicIcon,
|
|
26
|
+
states: defaultStates,
|
|
25
27
|
presetStyle,
|
|
26
28
|
};
|
|
27
29
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { forwardRef, type ElementRef, type ComponentProps } from "react";
|
|
2
|
+
|
|
3
|
+
export const defaultTag = "label";
|
|
4
|
+
|
|
5
|
+
export const Label = forwardRef<
|
|
6
|
+
ElementRef<typeof defaultTag>,
|
|
7
|
+
ComponentProps<typeof defaultTag>
|
|
8
|
+
>((props, ref) => <label {...props} ref={ref} />);
|
|
9
|
+
|
|
10
|
+
Label.displayName = "Label";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { TextBlockIcon } from "@webstudio-is/icons";
|
|
2
|
+
import {
|
|
3
|
+
type WsComponentMeta,
|
|
4
|
+
type WsComponentPropsMeta,
|
|
5
|
+
type PresetStyle,
|
|
6
|
+
defaultStates,
|
|
7
|
+
} from "./component-meta";
|
|
8
|
+
import { props } from "./__generated__/label.props";
|
|
9
|
+
import type { defaultTag } from "./label";
|
|
10
|
+
import { label } from "../css/normalize";
|
|
11
|
+
|
|
12
|
+
const presetStyle = {
|
|
13
|
+
label: [
|
|
14
|
+
...label,
|
|
15
|
+
{ property: "display", value: { type: "keyword", value: "block" } },
|
|
16
|
+
],
|
|
17
|
+
} satisfies PresetStyle<typeof defaultTag>;
|
|
18
|
+
|
|
19
|
+
export const meta: WsComponentMeta = {
|
|
20
|
+
category: "forms",
|
|
21
|
+
type: "rich-text",
|
|
22
|
+
label: "Input Label",
|
|
23
|
+
Icon: TextBlockIcon,
|
|
24
|
+
states: defaultStates,
|
|
25
|
+
presetStyle,
|
|
26
|
+
children: [{ type: "text", value: "Form Label" }],
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const propsMeta: WsComponentPropsMeta = {
|
|
30
|
+
props: {
|
|
31
|
+
...props,
|
|
32
|
+
htmlFor: {
|
|
33
|
+
required: false,
|
|
34
|
+
control: "text",
|
|
35
|
+
type: "string",
|
|
36
|
+
rows: 0,
|
|
37
|
+
label: "For",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
initialProps: ["htmlFor"],
|
|
41
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LinkBlockIcon } from "@webstudio-is/icons";
|
|
2
2
|
import type {
|
|
3
3
|
PresetStyle,
|
|
4
4
|
WsComponentMeta,
|
|
@@ -23,7 +23,7 @@ export const meta: WsComponentMeta = {
|
|
|
23
23
|
category: "general",
|
|
24
24
|
type: "container",
|
|
25
25
|
label: "Link Block",
|
|
26
|
-
Icon:
|
|
26
|
+
Icon: LinkBlockIcon,
|
|
27
27
|
states: linkMeta.states,
|
|
28
28
|
presetStyle,
|
|
29
29
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { LinkIcon } from "@webstudio-is/icons";
|
|
2
2
|
import { a } from "../css/normalize";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import {
|
|
4
|
+
defaultStates,
|
|
5
|
+
type PresetStyle,
|
|
6
|
+
type WsComponentMeta,
|
|
7
|
+
type WsComponentPropsMeta,
|
|
7
8
|
} from "./component-meta";
|
|
8
9
|
import type { defaultTag } from "./link";
|
|
9
10
|
import { props } from "./__generated__/link.props";
|
|
@@ -28,7 +29,18 @@ export const meta: WsComponentMeta = {
|
|
|
28
29
|
label: "Link Text",
|
|
29
30
|
Icon: LinkIcon,
|
|
30
31
|
presetStyle,
|
|
31
|
-
states: [
|
|
32
|
+
states: [
|
|
33
|
+
...defaultStates,
|
|
34
|
+
{
|
|
35
|
+
selector: ":visited",
|
|
36
|
+
label: "Visited",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
category: "component-states",
|
|
40
|
+
selector: "[aria-current=page]",
|
|
41
|
+
label: "Current page",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
32
44
|
children: [{ type: "text", value: "Link text you can edit" }],
|
|
33
45
|
};
|
|
34
46
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ListItemIcon } from "@webstudio-is/icons";
|
|
2
2
|
import { li } from "../css/normalize";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import {
|
|
4
|
+
defaultStates,
|
|
5
|
+
type PresetStyle,
|
|
6
|
+
type WsComponentMeta,
|
|
7
|
+
type WsComponentPropsMeta,
|
|
7
8
|
} from "./component-meta";
|
|
8
9
|
import type { defaultTag } from "./list-item";
|
|
9
10
|
import { props } from "./__generated__/list-item.props";
|
|
@@ -15,9 +16,11 @@ const presetStyle = {
|
|
|
15
16
|
export const meta: WsComponentMeta = {
|
|
16
17
|
category: "typography",
|
|
17
18
|
type: "rich-text",
|
|
19
|
+
acceptedParents: ["List"],
|
|
18
20
|
label: "List Item",
|
|
19
21
|
Icon: ListItemIcon,
|
|
20
22
|
children: [{ type: "text", value: "List Item you can edit" }],
|
|
23
|
+
states: defaultStates,
|
|
21
24
|
presetStyle,
|
|
22
25
|
};
|
|
23
26
|
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ListIcon } from "@webstudio-is/icons";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import {
|
|
3
|
+
defaultStates,
|
|
4
|
+
type PresetStyle,
|
|
5
|
+
type WsComponentMeta,
|
|
6
|
+
type WsComponentPropsMeta,
|
|
6
7
|
} from "./component-meta";
|
|
7
8
|
import { props } from "./__generated__/list.props";
|
|
8
9
|
import type { ListTag } from "./list";
|
|
@@ -46,6 +47,7 @@ export const meta: WsComponentMeta = {
|
|
|
46
47
|
type: "container",
|
|
47
48
|
label: "List",
|
|
48
49
|
Icon: ListIcon,
|
|
50
|
+
states: defaultStates,
|
|
49
51
|
presetStyle,
|
|
50
52
|
children: [],
|
|
51
53
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { TextAlignLeftIcon } from "@webstudio-is/icons";
|
|
2
2
|
import { p } from "../css/normalize";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import {
|
|
4
|
+
defaultStates,
|
|
5
|
+
type PresetStyle,
|
|
6
|
+
type WsComponentMeta,
|
|
7
|
+
type WsComponentPropsMeta,
|
|
7
8
|
} from "./component-meta";
|
|
8
9
|
import type { defaultTag } from "./paragraph";
|
|
9
10
|
import { props } from "./__generated__/paragraph.props";
|
|
@@ -18,6 +19,7 @@ export const meta: WsComponentMeta = {
|
|
|
18
19
|
label: "Paragraph",
|
|
19
20
|
Icon: TextAlignLeftIcon,
|
|
20
21
|
children: [{ type: "text", value: "Pragraph you can edit" }],
|
|
22
|
+
states: defaultStates,
|
|
21
23
|
presetStyle,
|
|
22
24
|
};
|
|
23
25
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { forwardRef, type ElementRef, type ComponentProps } from "react";
|
|
2
|
+
|
|
3
|
+
export const defaultTag = "label";
|
|
4
|
+
|
|
5
|
+
export const RadioButtonField = forwardRef<
|
|
6
|
+
ElementRef<typeof defaultTag>,
|
|
7
|
+
Omit<ComponentProps<typeof defaultTag>, "htmlFor">
|
|
8
|
+
>((props, ref) => <label {...props} ref={ref} />);
|
|
9
|
+
|
|
10
|
+
RadioButtonField.displayName = "RadioButtonField";
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { RadioCheckedIcon } from "@webstudio-is/icons";
|
|
2
|
+
import {
|
|
3
|
+
type WsComponentMeta,
|
|
4
|
+
type WsComponentPropsMeta,
|
|
5
|
+
type PresetStyle,
|
|
6
|
+
defaultStates,
|
|
7
|
+
} from "./component-meta";
|
|
8
|
+
import { props } from "./__generated__/radio-button-field.props";
|
|
9
|
+
import type { defaultTag } from "./radio-button-field";
|
|
10
|
+
import { label } from "../css/normalize";
|
|
11
|
+
|
|
12
|
+
const presetStyle = {
|
|
13
|
+
label: [
|
|
14
|
+
...label,
|
|
15
|
+
{ property: "display", value: { type: "keyword", value: "flex" } },
|
|
16
|
+
],
|
|
17
|
+
} satisfies PresetStyle<typeof defaultTag>;
|
|
18
|
+
|
|
19
|
+
export const meta: WsComponentMeta = {
|
|
20
|
+
category: "forms",
|
|
21
|
+
type: "container",
|
|
22
|
+
label: "Radio Button Field",
|
|
23
|
+
Icon: RadioCheckedIcon,
|
|
24
|
+
states: defaultStates,
|
|
25
|
+
presetStyle,
|
|
26
|
+
children: [
|
|
27
|
+
{ type: "instance", component: "RadioButton", props: [], children: [] },
|
|
28
|
+
{
|
|
29
|
+
type: "instance",
|
|
30
|
+
component: "TextBlock",
|
|
31
|
+
props: [],
|
|
32
|
+
children: [{ type: "text", value: "Radio" }],
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const propsMeta: WsComponentPropsMeta = {
|
|
38
|
+
props,
|
|
39
|
+
initialProps: [],
|
|
40
|
+
};
|