@webstudio-is/react-sdk 0.62.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.
Files changed (121) hide show
  1. package/lib/cjs/components/blockquote.ws.js +2 -0
  2. package/lib/cjs/components/body.ws.js +2 -0
  3. package/lib/cjs/components/bold.ws.js +2 -0
  4. package/lib/cjs/components/box.ws.js +2 -0
  5. package/lib/cjs/components/button.ws.js +2 -1
  6. package/lib/cjs/components/checkbox-field.ws.js +2 -0
  7. package/lib/cjs/components/checkbox.ws.js +2 -0
  8. package/lib/cjs/components/code.ws.js +2 -0
  9. package/lib/cjs/components/component-meta.js +12 -1
  10. package/lib/cjs/components/form.ws.js +2 -0
  11. package/lib/cjs/components/heading.ws.js +2 -0
  12. package/lib/cjs/components/image.ws.js +2 -0
  13. package/lib/cjs/components/input.ws.js +2 -0
  14. package/lib/cjs/components/italic.ws.js +2 -0
  15. package/lib/cjs/components/label.ws.js +2 -0
  16. package/lib/cjs/components/link.ws.js +13 -1
  17. package/lib/cjs/components/list-item.ws.js +2 -0
  18. package/lib/cjs/components/list.ws.js +2 -0
  19. package/lib/cjs/components/paragraph.ws.js +2 -0
  20. package/lib/cjs/components/radio-button-field.ws.js +2 -0
  21. package/lib/cjs/components/radio-button.ws.js +2 -0
  22. package/lib/cjs/components/separator.ws.js +2 -0
  23. package/lib/cjs/components/span.ws.js +2 -0
  24. package/lib/cjs/components/subscript.ws.js +2 -0
  25. package/lib/cjs/components/superscript.ws.js +2 -0
  26. package/lib/cjs/components/text-block.ws.js +2 -0
  27. package/lib/cjs/components/textarea.ws.js +2 -0
  28. package/lib/cjs/css/normalize.js +1 -1
  29. package/lib/cjs/css/presets.js +19 -1
  30. package/lib/cjs/index.js +2 -1
  31. package/lib/components/blockquote.ws.js +4 -0
  32. package/lib/components/body.ws.js +4 -0
  33. package/lib/components/bold.ws.js +4 -0
  34. package/lib/components/box.ws.js +4 -0
  35. package/lib/components/button.ws.js +4 -1
  36. package/lib/components/checkbox-field.ws.js +4 -0
  37. package/lib/components/checkbox.ws.js +4 -0
  38. package/lib/components/code.ws.js +4 -0
  39. package/lib/components/component-meta.js +12 -1
  40. package/lib/components/form.ws.js +4 -0
  41. package/lib/components/heading.ws.js +4 -0
  42. package/lib/components/image.ws.js +4 -0
  43. package/lib/components/input.ws.js +4 -0
  44. package/lib/components/italic.ws.js +4 -0
  45. package/lib/components/label.ws.js +4 -0
  46. package/lib/components/link.ws.js +15 -1
  47. package/lib/components/list-item.ws.js +4 -0
  48. package/lib/components/list.ws.js +4 -0
  49. package/lib/components/paragraph.ws.js +4 -0
  50. package/lib/components/radio-button-field.ws.js +4 -0
  51. package/lib/components/radio-button.ws.js +4 -0
  52. package/lib/components/separator.ws.js +4 -0
  53. package/lib/components/span.ws.js +4 -0
  54. package/lib/components/subscript.ws.js +4 -0
  55. package/lib/components/superscript.ws.js +4 -0
  56. package/lib/components/text-block.ws.js +4 -0
  57. package/lib/components/textarea.ws.js +4 -0
  58. package/lib/css/normalize.js +2 -2
  59. package/lib/css/presets.js +19 -1
  60. package/lib/index.js +4 -2
  61. package/lib/types/components/blockquote.ws.d.ts +1 -1
  62. package/lib/types/components/body.ws.d.ts +1 -1
  63. package/lib/types/components/bold.ws.d.ts +1 -1
  64. package/lib/types/components/box.ws.d.ts +1 -1
  65. package/lib/types/components/button.ws.d.ts +1 -1
  66. package/lib/types/components/checkbox-field.ws.d.ts +1 -1
  67. package/lib/types/components/checkbox.ws.d.ts +1 -1
  68. package/lib/types/components/code.ws.d.ts +1 -1
  69. package/lib/types/components/component-meta.d.ts +16 -6
  70. package/lib/types/components/form.ws.d.ts +1 -1
  71. package/lib/types/components/heading.ws.d.ts +1 -1
  72. package/lib/types/components/image.ws.d.ts +1 -1
  73. package/lib/types/components/input.ws.d.ts +1 -1
  74. package/lib/types/components/italic.ws.d.ts +1 -1
  75. package/lib/types/components/label.ws.d.ts +1 -1
  76. package/lib/types/components/link.ws.d.ts +1 -1
  77. package/lib/types/components/list-item.ws.d.ts +1 -1
  78. package/lib/types/components/list.ws.d.ts +1 -1
  79. package/lib/types/components/paragraph.ws.d.ts +1 -1
  80. package/lib/types/components/radio-button-field.ws.d.ts +1 -1
  81. package/lib/types/components/radio-button.ws.d.ts +1 -1
  82. package/lib/types/components/separator.ws.d.ts +1 -1
  83. package/lib/types/components/span.ws.d.ts +1 -1
  84. package/lib/types/components/subscript.ws.d.ts +1 -1
  85. package/lib/types/components/superscript.ws.d.ts +1 -1
  86. package/lib/types/components/text-block.ws.d.ts +1 -1
  87. package/lib/types/components/textarea.ws.d.ts +1 -1
  88. package/lib/types/css/normalize.d.ts +2 -0
  89. package/lib/types/css/presets.d.ts +3 -2
  90. package/lib/types/index.d.ts +1 -1
  91. package/package.json +11 -11
  92. package/src/components/blockquote.ws.tsx +6 -4
  93. package/src/components/body.ws.tsx +6 -4
  94. package/src/components/bold.ws.tsx +6 -4
  95. package/src/components/box.ws.ts +6 -4
  96. package/src/components/button.ws.tsx +6 -5
  97. package/src/components/checkbox-field.ws.tsx +6 -4
  98. package/src/components/checkbox.ws.tsx +6 -4
  99. package/src/components/code.ws.tsx +6 -4
  100. package/src/components/component-meta.ts +11 -0
  101. package/src/components/form.ws.tsx +6 -4
  102. package/src/components/heading.ws.tsx +6 -4
  103. package/src/components/image.ws.tsx +6 -4
  104. package/src/components/input.ws.tsx +6 -4
  105. package/src/components/italic.ws.tsx +6 -4
  106. package/src/components/label.ws.tsx +6 -4
  107. package/src/components/link.ws.tsx +17 -5
  108. package/src/components/list-item.ws.tsx +6 -4
  109. package/src/components/list.ws.tsx +6 -4
  110. package/src/components/paragraph.ws.tsx +6 -4
  111. package/src/components/radio-button-field.ws.tsx +6 -4
  112. package/src/components/radio-button.ws.tsx +6 -4
  113. package/src/components/separator.ws.tsx +6 -4
  114. package/src/components/span.ws.tsx +6 -4
  115. package/src/components/subscript.ws.tsx +6 -4
  116. package/src/components/superscript.ws.tsx +6 -4
  117. package/src/components/text-block.ws.tsx +6 -4
  118. package/src/components/textarea.ws.tsx +6 -4
  119. package/src/css/normalize.ts +20 -18
  120. package/src/css/presets.ts +20 -2
  121. package/src/index.ts +1 -0
@@ -1,3 +1,3 @@
1
- import type { WsComponentMeta, WsComponentPropsMeta } from "./component-meta";
1
+ import { type WsComponentMeta, type WsComponentPropsMeta } from "./component-meta";
2
2
  export declare const meta: WsComponentMeta;
3
3
  export declare const propsMeta: WsComponentPropsMeta;
@@ -1,3 +1,3 @@
1
- import type { WsComponentMeta, WsComponentPropsMeta } from "./component-meta";
1
+ import { type WsComponentMeta, type WsComponentPropsMeta } from "./component-meta";
2
2
  export declare const meta: WsComponentMeta;
3
3
  export declare const propsMeta: WsComponentPropsMeta;
@@ -1,3 +1,3 @@
1
- import type { WsComponentMeta, WsComponentPropsMeta } from "./component-meta";
1
+ import { type WsComponentMeta, type WsComponentPropsMeta } from "./component-meta";
2
2
  export declare const meta: WsComponentMeta;
3
3
  export declare const propsMeta: WsComponentPropsMeta;
@@ -14,6 +14,8 @@
14
14
  *
15
15
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
16
16
  */
17
+ import type { EmbedTemplateStyleDecl } from "../embed-template";
18
+ export type Styles = EmbedTemplateStyleDecl[];
17
19
  export declare const div: ({
18
20
  state?: string | undefined;
19
21
  value: {
@@ -1,2 +1,3 @@
1
- import type { EmbedTemplateStyleDecl } from "../embed-template";
2
- export declare const borders: EmbedTemplateStyleDecl[];
1
+ import type { Styles } from "./normalize";
2
+ export declare const borders: Styles;
3
+ export declare const linkColors: Styles;
@@ -6,5 +6,5 @@ export * from "./app";
6
6
  export * from "./components/components";
7
7
  export * from "./components/components-utils";
8
8
  export { customComponents, customComponentMetas, customComponentPropsMetas, } from "./app/custom-components";
9
- export { type WsComponentPropsMeta, type WsComponentMeta, type ComponentState, componentCategories, } from "./components/component-meta";
9
+ export { type WsComponentPropsMeta, type WsComponentMeta, type ComponentState, componentCategories, stateCategories, } from "./components/component-meta";
10
10
  export * from "./embed-template";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/react-sdk",
3
- "version": "0.62.0",
3
+ "version": "0.63.0",
4
4
  "description": "Webstudio JavaScript / TypeScript API",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -35,16 +35,16 @@
35
35
  "nanoevents": "^7.0.1",
36
36
  "nanoid": "^3.2.0",
37
37
  "nanostores": "^0.7.1",
38
- "@webstudio-is/asset-uploader": "^0.62.0",
39
- "@webstudio-is/css-data": "^0.62.0",
40
- "@webstudio-is/css-engine": "^0.62.0",
41
- "@webstudio-is/css-vars": "^0.62.0",
42
- "@webstudio-is/fonts": "^0.62.0",
43
- "@webstudio-is/generate-arg-types": "^0.62.0",
44
- "@webstudio-is/icons": "^0.62.0",
45
- "@webstudio-is/image": "^0.62.0",
46
- "@webstudio-is/prisma-client": "^0.62.0",
47
- "@webstudio-is/project-build": "^0.62.0"
38
+ "@webstudio-is/asset-uploader": "^0.63.0",
39
+ "@webstudio-is/css-data": "^0.63.0",
40
+ "@webstudio-is/css-engine": "^0.63.0",
41
+ "@webstudio-is/css-vars": "^0.63.0",
42
+ "@webstudio-is/fonts": "^0.63.0",
43
+ "@webstudio-is/generate-arg-types": "^0.63.0",
44
+ "@webstudio-is/icons": "^0.63.0",
45
+ "@webstudio-is/image": "^0.63.0",
46
+ "@webstudio-is/prisma-client": "^0.63.0",
47
+ "@webstudio-is/project-build": "^0.63.0"
48
48
  },
49
49
  "exports": {
50
50
  ".": {
@@ -1,9 +1,10 @@
1
1
  import { BlockquoteIcon } from "@webstudio-is/icons";
2
2
  import type { defaultTag } from "./blockquote";
3
- import type {
4
- PresetStyle,
5
- WsComponentMeta,
6
- WsComponentPropsMeta,
3
+ import {
4
+ defaultStates,
5
+ type PresetStyle,
6
+ type WsComponentMeta,
7
+ type WsComponentPropsMeta,
7
8
  } from "./component-meta";
8
9
  import { props } from "./__generated__/blockquote.props";
9
10
 
@@ -63,6 +64,7 @@ export const meta: WsComponentMeta = {
63
64
  type: "rich-text",
64
65
  label: "Blockquote",
65
66
  Icon: BlockquoteIcon,
67
+ states: defaultStates,
66
68
  presetStyle,
67
69
  children: [{ type: "text", value: "Blockquote you can edit" }],
68
70
  };
@@ -1,9 +1,10 @@
1
1
  import { BodyIcon } from "@webstudio-is/icons";
2
2
  import { body } from "../css/normalize";
3
- import type {
4
- PresetStyle,
5
- WsComponentMeta,
6
- WsComponentPropsMeta,
3
+ import {
4
+ defaultStates,
5
+ type PresetStyle,
6
+ type WsComponentMeta,
7
+ type WsComponentPropsMeta,
7
8
  } from "./component-meta";
8
9
  import { props } from "./__generated__/body.props";
9
10
  import type { defaultTag } from "./body";
@@ -41,6 +42,7 @@ export const meta: WsComponentMeta = {
41
42
  type: "container",
42
43
  label: "Body",
43
44
  Icon: BodyIcon,
45
+ states: defaultStates,
44
46
  presetStyle,
45
47
  };
46
48
 
@@ -1,8 +1,9 @@
1
1
  import { BoldIcon } from "@webstudio-is/icons";
2
- import type {
3
- PresetStyle,
4
- WsComponentMeta,
5
- WsComponentPropsMeta,
2
+ import {
3
+ defaultStates,
4
+ type PresetStyle,
5
+ type WsComponentMeta,
6
+ type WsComponentPropsMeta,
6
7
  } from "./component-meta";
7
8
  import { props } from "./__generated__/bold.props";
8
9
  import { b } from "../css/normalize";
@@ -16,6 +17,7 @@ export const meta: WsComponentMeta = {
16
17
  type: "rich-text-child",
17
18
  label: "Bold Text",
18
19
  Icon: BoldIcon,
20
+ states: defaultStates,
19
21
  presetStyle,
20
22
  };
21
23
 
@@ -1,8 +1,9 @@
1
1
  import { BoxIcon } from "@webstudio-is/icons";
2
- import type {
3
- PresetStyle,
4
- WsComponentMeta,
5
- WsComponentPropsMeta,
2
+ import {
3
+ defaultStates,
4
+ type PresetStyle,
5
+ type WsComponentMeta,
6
+ type WsComponentPropsMeta,
6
7
  } from "./component-meta";
7
8
  import { props } from "./__generated__/box.props";
8
9
  import type { Box } from "./box";
@@ -40,6 +41,7 @@ export const meta: WsComponentMeta = {
40
41
  type: "container",
41
42
  label: "Box",
42
43
  Icon: BoxIcon,
44
+ states: defaultStates,
43
45
  presetStyle,
44
46
  };
45
47
 
@@ -1,9 +1,10 @@
1
1
  import { ButtonElementIcon } from "@webstudio-is/icons";
2
2
  import { button } from "../css/normalize";
3
- import type {
4
- PresetStyle,
5
- WsComponentMeta,
6
- WsComponentPropsMeta,
3
+ import {
4
+ defaultStates,
5
+ type PresetStyle,
6
+ type WsComponentMeta,
7
+ type WsComponentPropsMeta,
7
8
  } from "./component-meta";
8
9
  import { props } from "./__generated__/button.props";
9
10
  import type { defaultTag } from "./button";
@@ -19,7 +20,7 @@ export const meta: WsComponentMeta = {
19
20
  Icon: ButtonElementIcon,
20
21
  presetStyle,
21
22
  states: [
22
- { selector: ":active", label: "Active" },
23
+ ...defaultStates,
23
24
  { selector: ":disabled", label: "Disabled" },
24
25
  { selector: ":enabled", label: "Enabled" },
25
26
  ],
@@ -1,8 +1,9 @@
1
1
  import { CheckboxCheckedIcon } from "@webstudio-is/icons";
2
- import type {
3
- WsComponentMeta,
4
- WsComponentPropsMeta,
5
- PresetStyle,
2
+ import {
3
+ type WsComponentMeta,
4
+ type WsComponentPropsMeta,
5
+ type PresetStyle,
6
+ defaultStates,
6
7
  } from "./component-meta";
7
8
  import { props } from "./__generated__/checkbox-field.props";
8
9
  import type { defaultTag } from "./checkbox-field";
@@ -20,6 +21,7 @@ export const meta: WsComponentMeta = {
20
21
  type: "container",
21
22
  label: "Checkbox Field",
22
23
  Icon: CheckboxCheckedIcon,
24
+ states: defaultStates,
23
25
  presetStyle,
24
26
  children: [
25
27
  { type: "instance", component: "Checkbox", props: [], children: [] },
@@ -1,8 +1,9 @@
1
1
  import { CheckboxCheckedIcon } from "@webstudio-is/icons";
2
- import type {
3
- WsComponentMeta,
4
- WsComponentPropsMeta,
5
- PresetStyle,
2
+ import {
3
+ type WsComponentMeta,
4
+ type WsComponentPropsMeta,
5
+ type PresetStyle,
6
+ defaultStates,
6
7
  } from "./component-meta";
7
8
  import type { defaultTag } from "./checkbox";
8
9
  import { input } from "../css/normalize";
@@ -24,6 +25,7 @@ export const meta: WsComponentMeta = {
24
25
  Icon: CheckboxCheckedIcon,
25
26
  presetStyle,
26
27
  states: [
28
+ ...defaultStates,
27
29
  { selector: ":checked", label: "Checked" },
28
30
  { selector: ":required", label: "Required" },
29
31
  { selector: ":optional", label: "Optional" },
@@ -1,8 +1,9 @@
1
1
  import { CodeIcon } from "@webstudio-is/icons";
2
- import type {
3
- PresetStyle,
4
- WsComponentMeta,
5
- WsComponentPropsMeta,
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
@@ -1,9 +1,10 @@
1
1
  import { FormIcon } from "@webstudio-is/icons";
2
2
  import { form } from "../css/normalize";
3
- import type {
4
- PresetStyle,
5
- WsComponentMeta,
6
- WsComponentPropsMeta,
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";
@@ -20,6 +21,7 @@ export const meta: WsComponentMeta = {
20
21
  type: "container",
21
22
  label: "Form",
22
23
  Icon: FormIcon,
24
+ states: defaultStates,
23
25
  presetStyle,
24
26
  children: [
25
27
  {
@@ -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 type {
5
- PresetStyle,
6
- WsComponentMeta,
7
- WsComponentPropsMeta,
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 type {
4
- PresetStyle,
5
- WsComponentMeta,
6
- WsComponentPropsMeta,
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
 
@@ -1,9 +1,10 @@
1
1
  import { FormTextFieldIcon } from "@webstudio-is/icons";
2
2
  import { input } from "../css/normalize";
3
- import type {
4
- PresetStyle,
5
- WsComponentMeta,
6
- WsComponentPropsMeta,
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";
@@ -19,6 +20,7 @@ export const meta: WsComponentMeta = {
19
20
  Icon: FormTextFieldIcon,
20
21
  presetStyle,
21
22
  states: [
23
+ ...defaultStates,
22
24
  { selector: "::placeholder", label: "Placeholder" },
23
25
  { selector: ":valid", label: "Valid" },
24
26
  { selector: ":invalid", label: "Invalid" },
@@ -1,9 +1,10 @@
1
1
  import { TextItalicIcon } from "@webstudio-is/icons";
2
2
  import type { defaultTag } from "./italic";
3
- import type {
4
- PresetStyle,
5
- WsComponentMeta,
6
- WsComponentPropsMeta,
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
 
@@ -1,8 +1,9 @@
1
1
  import { TextBlockIcon } from "@webstudio-is/icons";
2
- import type {
3
- WsComponentMeta,
4
- WsComponentPropsMeta,
5
- PresetStyle,
2
+ import {
3
+ type WsComponentMeta,
4
+ type WsComponentPropsMeta,
5
+ type PresetStyle,
6
+ defaultStates,
6
7
  } from "./component-meta";
7
8
  import { props } from "./__generated__/label.props";
8
9
  import type { defaultTag } from "./label";
@@ -20,6 +21,7 @@ export const meta: WsComponentMeta = {
20
21
  type: "rich-text",
21
22
  label: "Input Label",
22
23
  Icon: TextBlockIcon,
24
+ states: defaultStates,
23
25
  presetStyle,
24
26
  children: [{ type: "text", value: "Form Label" }],
25
27
  };
@@ -1,9 +1,10 @@
1
1
  import { LinkIcon } from "@webstudio-is/icons";
2
2
  import { a } from "../css/normalize";
3
- import type {
4
- PresetStyle,
5
- WsComponentMeta,
6
- WsComponentPropsMeta,
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: [{ selector: "[aria-current=page]", label: "Current page" }],
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 type {
4
- PresetStyle,
5
- WsComponentMeta,
6
- WsComponentPropsMeta,
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";
@@ -19,6 +20,7 @@ export const meta: WsComponentMeta = {
19
20
  label: "List Item",
20
21
  Icon: ListItemIcon,
21
22
  children: [{ type: "text", value: "List Item you can edit" }],
23
+ states: defaultStates,
22
24
  presetStyle,
23
25
  };
24
26
 
@@ -1,8 +1,9 @@
1
1
  import { ListIcon } from "@webstudio-is/icons";
2
- import type {
3
- PresetStyle,
4
- WsComponentMeta,
5
- WsComponentPropsMeta,
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 type {
4
- PresetStyle,
5
- WsComponentMeta,
6
- WsComponentPropsMeta,
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
 
@@ -1,8 +1,9 @@
1
1
  import { RadioCheckedIcon } from "@webstudio-is/icons";
2
- import type {
3
- WsComponentMeta,
4
- WsComponentPropsMeta,
5
- PresetStyle,
2
+ import {
3
+ type WsComponentMeta,
4
+ type WsComponentPropsMeta,
5
+ type PresetStyle,
6
+ defaultStates,
6
7
  } from "./component-meta";
7
8
  import { props } from "./__generated__/radio-button-field.props";
8
9
  import type { defaultTag } from "./radio-button-field";
@@ -20,6 +21,7 @@ export const meta: WsComponentMeta = {
20
21
  type: "container",
21
22
  label: "Radio Button Field",
22
23
  Icon: RadioCheckedIcon,
24
+ states: defaultStates,
23
25
  presetStyle,
24
26
  children: [
25
27
  { type: "instance", component: "RadioButton", props: [], children: [] },
@@ -1,8 +1,9 @@
1
1
  import { RadioCheckedIcon } from "@webstudio-is/icons";
2
- import type {
3
- WsComponentMeta,
4
- WsComponentPropsMeta,
5
- PresetStyle,
2
+ import {
3
+ type WsComponentMeta,
4
+ type WsComponentPropsMeta,
5
+ type PresetStyle,
6
+ defaultStates,
6
7
  } from "./component-meta";
7
8
  import type { defaultTag } from "./radio-button";
8
9
  import { input } from "../css/normalize";
@@ -24,6 +25,7 @@ export const meta: WsComponentMeta = {
24
25
  Icon: RadioCheckedIcon,
25
26
  presetStyle,
26
27
  states: [
28
+ ...defaultStates,
27
29
  { selector: ":checked", label: "Checked" },
28
30
  { selector: ":required", label: "Required" },
29
31
  { selector: ":optional", label: "Optional" },
@@ -1,8 +1,9 @@
1
1
  import { DashIcon } from "@webstudio-is/icons";
2
- import type {
3
- PresetStyle,
4
- WsComponentMeta,
5
- WsComponentPropsMeta,
2
+ import {
3
+ defaultStates,
4
+ type PresetStyle,
5
+ type WsComponentMeta,
6
+ type WsComponentPropsMeta,
6
7
  } from "./component-meta";
7
8
  import { props } from "./__generated__/separator.props";
8
9
  import type { defaultTag } from "./separator";
@@ -44,6 +45,7 @@ export const meta: WsComponentMeta = {
44
45
  type: "embed",
45
46
  label: "Separator",
46
47
  Icon: DashIcon,
48
+ states: defaultStates,
47
49
  presetStyle,
48
50
  children: [],
49
51
  };
@@ -1,9 +1,10 @@
1
1
  import { PaintBrushIcon } from "@webstudio-is/icons";
2
2
  import { span } from "../css/normalize";
3
- import type {
4
- PresetStyle,
5
- WsComponentMeta,
6
- WsComponentPropsMeta,
3
+ import {
4
+ defaultStates,
5
+ type PresetStyle,
6
+ type WsComponentMeta,
7
+ type WsComponentPropsMeta,
7
8
  } from "./component-meta";
8
9
  import type { defaultTag } from "./span";
9
10
  import { props } from "./__generated__/span.props";
@@ -16,6 +17,7 @@ export const meta: WsComponentMeta = {
16
17
  type: "rich-text-child",
17
18
  label: "Styled Text",
18
19
  Icon: PaintBrushIcon,
20
+ states: defaultStates,
19
21
  presetStyle,
20
22
  };
21
23
 
@@ -1,9 +1,10 @@
1
1
  import { SubscriptIcon } from "@webstudio-is/icons";
2
2
  import { sub } from "../css/normalize";
3
- import type {
4
- PresetStyle,
5
- WsComponentMeta,
6
- WsComponentPropsMeta,
3
+ import {
4
+ defaultStates,
5
+ type PresetStyle,
6
+ type WsComponentMeta,
7
+ type WsComponentPropsMeta,
7
8
  } from "./component-meta";
8
9
  import type { defaultTag } from "./subscript";
9
10
  import { props } from "./__generated__/subscript.props";
@@ -16,6 +17,7 @@ export const meta: WsComponentMeta = {
16
17
  type: "rich-text-child",
17
18
  label: "Subscript Text",
18
19
  Icon: SubscriptIcon,
20
+ states: defaultStates,
19
21
  presetStyle,
20
22
  };
21
23