@webstudio-is/sdk-components-react 0.79.0 → 0.80.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 (118) hide show
  1. package/lib/blockquote.ws.js +2 -1
  2. package/lib/body.ws.js +2 -1
  3. package/lib/bold.ws.js +2 -1
  4. package/lib/box.ws.js +1 -1
  5. package/lib/button.ws.js +1 -1
  6. package/lib/checkbox.ws.js +2 -1
  7. package/lib/cjs/blockquote.ws.js +2 -1
  8. package/lib/cjs/body.ws.js +2 -1
  9. package/lib/cjs/bold.ws.js +2 -1
  10. package/lib/cjs/box.ws.js +1 -1
  11. package/lib/cjs/button.ws.js +1 -1
  12. package/lib/cjs/checkbox.ws.js +2 -1
  13. package/lib/cjs/code-text.ws.js +1 -1
  14. package/lib/cjs/form.ws.js +1 -1
  15. package/lib/cjs/heading.ws.js +1 -1
  16. package/lib/cjs/html-embed.js +1 -1
  17. package/lib/cjs/html-embed.ws.js +2 -1
  18. package/lib/cjs/image.ws.js +1 -1
  19. package/lib/cjs/input.ws.js +9 -2
  20. package/lib/cjs/italic.ws.js +2 -1
  21. package/lib/cjs/label.ws.js +2 -1
  22. package/lib/cjs/link.ws.js +1 -1
  23. package/lib/cjs/list-item.ws.js +2 -1
  24. package/lib/cjs/list.ws.js +1 -1
  25. package/lib/cjs/paragraph.ws.js +2 -1
  26. package/lib/cjs/radio-button.ws.js +2 -1
  27. package/lib/cjs/separator.ws.js +1 -1
  28. package/lib/cjs/span.ws.js +2 -1
  29. package/lib/cjs/subscript.ws.js +2 -1
  30. package/lib/cjs/superscript.ws.js +2 -1
  31. package/lib/cjs/text.ws.js +1 -1
  32. package/lib/cjs/textarea.ws.js +6 -2
  33. package/lib/cjs/vimeo-play-button.ws.js +2 -1
  34. package/lib/cjs/vimeo-spinner.ws.js +2 -1
  35. package/lib/cjs/vimeo.js +1 -1
  36. package/lib/cjs/vimeo.ws.js +1 -0
  37. package/lib/code-text.ws.js +1 -1
  38. package/lib/form.ws.js +1 -1
  39. package/lib/heading.ws.js +1 -1
  40. package/lib/html-embed.js +1 -1
  41. package/lib/html-embed.ws.js +2 -1
  42. package/lib/image.ws.js +1 -1
  43. package/lib/input.ws.js +9 -2
  44. package/lib/italic.ws.js +2 -1
  45. package/lib/label.ws.js +2 -1
  46. package/lib/link.ws.js +1 -1
  47. package/lib/list-item.ws.js +2 -1
  48. package/lib/list.ws.js +1 -1
  49. package/lib/paragraph.ws.js +2 -1
  50. package/lib/radio-button.ws.js +2 -1
  51. package/lib/separator.ws.js +1 -1
  52. package/lib/span.ws.js +2 -1
  53. package/lib/subscript.ws.js +2 -1
  54. package/lib/superscript.ws.js +2 -1
  55. package/lib/text.ws.js +1 -1
  56. package/lib/textarea.ws.js +6 -2
  57. package/lib/vimeo-play-button.ws.js +2 -1
  58. package/lib/vimeo-spinner.ws.js +2 -1
  59. package/lib/vimeo.js +1 -1
  60. package/lib/vimeo.ws.js +1 -0
  61. package/package.json +7 -7
  62. package/src/blockquote.stories.tsx +6 -9
  63. package/src/blockquote.ws.tsx +1 -0
  64. package/src/body.stories.tsx +7 -5
  65. package/src/body.ws.tsx +1 -0
  66. package/src/bold.stories.tsx +6 -9
  67. package/src/bold.ws.tsx +1 -0
  68. package/src/box.stories.tsx +7 -11
  69. package/src/box.ws.ts +1 -1
  70. package/src/button.stories.tsx +7 -7
  71. package/src/button.ws.tsx +1 -1
  72. package/src/checkbox.ws.tsx +2 -1
  73. package/src/code-text.stories.tsx +6 -9
  74. package/src/code-text.ws.tsx +1 -1
  75. package/src/form.stories.tsx +7 -8
  76. package/src/form.ws.tsx +1 -1
  77. package/src/heading.stories.tsx +6 -9
  78. package/src/heading.ws.tsx +1 -1
  79. package/src/html-embed.stories.tsx +6 -9
  80. package/src/html-embed.tsx +1 -1
  81. package/src/html-embed.ws.ts +1 -0
  82. package/src/image.stories.tsx +3 -9
  83. package/src/image.ws.tsx +1 -1
  84. package/src/input.stories.tsx +5 -8
  85. package/src/input.ws.tsx +9 -2
  86. package/src/italic.stories.tsx +6 -9
  87. package/src/italic.ws.tsx +1 -0
  88. package/src/label.ws.tsx +2 -1
  89. package/src/link.stories.tsx +6 -9
  90. package/src/link.ws.tsx +1 -1
  91. package/src/list-item.stories.tsx +6 -9
  92. package/src/list-item.ws.tsx +1 -0
  93. package/src/list.stories.tsx +6 -9
  94. package/src/list.ws.tsx +1 -1
  95. package/src/paragraph.stories.tsx +6 -9
  96. package/src/paragraph.ws.tsx +1 -0
  97. package/src/radio-button.ws.tsx +2 -1
  98. package/src/rich-text-link.stories.tsx +6 -9
  99. package/src/separator.stories.tsx +3 -8
  100. package/src/separator.ws.tsx +1 -1
  101. package/src/slot.stories.tsx +6 -9
  102. package/src/span.stories.tsx +6 -9
  103. package/src/span.ws.tsx +1 -0
  104. package/src/subscript.stories.tsx +6 -9
  105. package/src/subscript.ws.tsx +1 -0
  106. package/src/superscript.stories.tsx +6 -9
  107. package/src/superscript.ws.tsx +1 -0
  108. package/src/text.stories.tsx +6 -9
  109. package/src/text.ws.tsx +1 -1
  110. package/src/textarea.ws.tsx +5 -1
  111. package/src/vimeo-play-button.stories.tsx +8 -12
  112. package/src/vimeo-play-button.ws.ts +1 -0
  113. package/src/vimeo-preview-image.stories.tsx +7 -11
  114. package/src/vimeo-spinner.stories.tsx +8 -12
  115. package/src/vimeo-spinner.ws.ts +1 -0
  116. package/src/vimeo.stories.tsx +7 -11
  117. package/src/vimeo.tsx +3 -2
  118. package/src/vimeo.ws.ts +4 -2
@@ -1,16 +1,13 @@
1
- import type { ComponentStory, ComponentMeta } from "@storybook/react";
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { RichTextLink as LinkPrimitive } from "./rich-text-link";
3
3
 
4
4
  export default {
5
5
  title: "Components/RichTextLink",
6
6
  component: LinkPrimitive,
7
- } as ComponentMeta<typeof LinkPrimitive>;
7
+ } satisfies Meta<typeof LinkPrimitive>;
8
8
 
9
- const Template: ComponentStory<typeof LinkPrimitive> = (args) => (
10
- <LinkPrimitive {...args} />
11
- );
12
-
13
- export const RichTextLink = Template.bind({});
14
- RichTextLink.args = {
15
- children: "RichTextLink",
9
+ export const RichTextLink: StoryObj<typeof LinkPrimitive> = {
10
+ args: {
11
+ children: "RichTextLink",
12
+ },
16
13
  };
@@ -1,14 +1,9 @@
1
- import type { ComponentStory, ComponentMeta } from "@storybook/react";
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { Separator as SeparatorPrimitive } from "./separator";
3
3
 
4
4
  export default {
5
5
  title: "Components/Separator",
6
6
  component: SeparatorPrimitive,
7
- } as ComponentMeta<typeof SeparatorPrimitive>;
7
+ } satisfies Meta<typeof SeparatorPrimitive>;
8
8
 
9
- const Template: ComponentStory<typeof SeparatorPrimitive> = (args) => (
10
- <SeparatorPrimitive {...args} />
11
- );
12
-
13
- export const Separator = Template.bind({});
14
- Separator.args = {};
9
+ export const Separator: StoryObj<typeof SeparatorPrimitive> = {};
@@ -52,5 +52,5 @@ export const meta: WsComponentMeta = {
52
52
 
53
53
  export const propsMeta: WsComponentPropsMeta = {
54
54
  props,
55
- initialProps: [],
55
+ initialProps: ["id"],
56
56
  };
@@ -1,16 +1,13 @@
1
- import type { ComponentStory, ComponentMeta } from "@storybook/react";
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { Slot as SlotPrimitive } from "./slot";
3
3
 
4
4
  export default {
5
5
  title: "Components/Slot",
6
6
  component: SlotPrimitive,
7
- } as ComponentMeta<typeof SlotPrimitive>;
7
+ } satisfies Meta<typeof SlotPrimitive>;
8
8
 
9
- const Template: ComponentStory<typeof SlotPrimitive> = (args) => (
10
- <SlotPrimitive {...args} />
11
- );
12
-
13
- export const Slot = Template.bind({});
14
- Slot.args = {
15
- children: "Slot",
9
+ export const Slot: StoryObj<typeof SlotPrimitive> = {
10
+ args: {
11
+ children: "Slot",
12
+ },
16
13
  };
@@ -1,16 +1,13 @@
1
- import type { ComponentStory, ComponentMeta } from "@storybook/react";
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { Span as SpanPrimitive } from "./span";
3
3
 
4
4
  export default {
5
5
  title: "Components/Span",
6
6
  component: SpanPrimitive,
7
- } as ComponentMeta<typeof SpanPrimitive>;
7
+ } satisfies Meta<typeof SpanPrimitive>;
8
8
 
9
- const Template: ComponentStory<typeof SpanPrimitive> = (args) => (
10
- <SpanPrimitive {...args} />
11
- );
12
-
13
- export const Span = Template.bind({});
14
- Span.args = {
15
- children: "some span text",
9
+ export const Span: StoryObj<typeof SpanPrimitive> = {
10
+ args: {
11
+ children: "some span text",
12
+ },
16
13
  };
package/src/span.ws.tsx CHANGED
@@ -23,4 +23,5 @@ export const meta: WsComponentMeta = {
23
23
 
24
24
  export const propsMeta: WsComponentPropsMeta = {
25
25
  props,
26
+ initialProps: ["id"],
26
27
  };
@@ -1,16 +1,13 @@
1
- import type { ComponentStory, ComponentMeta } from "@storybook/react";
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { Subscript as SubscriptPrimitive } from "./subscript";
3
3
 
4
4
  export default {
5
5
  title: "Components/Subscript",
6
6
  component: SubscriptPrimitive,
7
- } as ComponentMeta<typeof SubscriptPrimitive>;
7
+ } satisfies Meta<typeof SubscriptPrimitive>;
8
8
 
9
- const Template: ComponentStory<typeof SubscriptPrimitive> = (args) => (
10
- <SubscriptPrimitive {...args} />
11
- );
12
-
13
- export const Subscript = Template.bind({});
14
- Subscript.args = {
15
- children: "some subscript text",
9
+ export const Subscript: StoryObj<typeof SubscriptPrimitive> = {
10
+ args: {
11
+ children: "some subscript text",
12
+ },
16
13
  };
@@ -23,4 +23,5 @@ export const meta: WsComponentMeta = {
23
23
 
24
24
  export const propsMeta: WsComponentPropsMeta = {
25
25
  props,
26
+ initialProps: ["id"],
26
27
  };
@@ -1,16 +1,13 @@
1
- import type { ComponentStory, ComponentMeta } from "@storybook/react";
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { Superscript as SuperscriptPrimitive } from "./superscript";
3
3
 
4
4
  export default {
5
5
  title: "Components/Superscript",
6
6
  component: SuperscriptPrimitive,
7
- } as ComponentMeta<typeof SuperscriptPrimitive>;
7
+ } satisfies Meta<typeof SuperscriptPrimitive>;
8
8
 
9
- const Template: ComponentStory<typeof SuperscriptPrimitive> = (args) => (
10
- <SuperscriptPrimitive {...args} />
11
- );
12
-
13
- export const Superscript = Template.bind({});
14
- Superscript.args = {
15
- children: "some superscript text",
9
+ export const Superscript: StoryObj<typeof SuperscriptPrimitive> = {
10
+ args: {
11
+ children: "some superscript text",
12
+ },
16
13
  };
@@ -23,4 +23,5 @@ export const meta: WsComponentMeta = {
23
23
 
24
24
  export const propsMeta: WsComponentPropsMeta = {
25
25
  props,
26
+ initialProps: ["id"],
26
27
  };
@@ -1,16 +1,13 @@
1
- import type { ComponentStory, ComponentMeta } from "@storybook/react";
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { Text as TextPrimitive } from "./text";
3
3
 
4
4
  export default {
5
5
  title: "Components/Text",
6
6
  component: TextPrimitive,
7
- } as ComponentMeta<typeof TextPrimitive>;
7
+ } satisfies Meta<typeof TextPrimitive>;
8
8
 
9
- const Template: ComponentStory<typeof TextPrimitive> = (args) => (
10
- <TextPrimitive {...args} />
11
- );
12
-
13
- export const Text = Template.bind({});
14
- Text.args = {
15
- children: "text",
9
+ export const Text: StoryObj<typeof TextPrimitive> = {
10
+ args: {
11
+ children: "text",
12
+ },
16
13
  };
package/src/text.ws.tsx CHANGED
@@ -38,5 +38,5 @@ export const meta: WsComponentMeta = {
38
38
 
39
39
  export const propsMeta: WsComponentPropsMeta = {
40
40
  props,
41
- initialProps: ["tag"],
41
+ initialProps: ["id", "tag"],
42
42
  };
@@ -14,6 +14,10 @@ const presetStyle = {
14
14
  ...textarea,
15
15
  // resize doesn't work well while on canvas
16
16
  { property: "resize", value: { type: "keyword", value: "none" } },
17
+ {
18
+ property: "display",
19
+ value: { type: "keyword", value: "block" },
20
+ },
17
21
  ],
18
22
  } satisfies PresetStyle<typeof defaultTag>;
19
23
 
@@ -40,5 +44,5 @@ export const meta: WsComponentMeta = {
40
44
 
41
45
  export const propsMeta: WsComponentPropsMeta = {
42
46
  props,
43
- initialProps: ["name", "placeholder", "required", "autoFocus"],
47
+ initialProps: ["id", "name", "placeholder", "required", "autoFocus"],
44
48
  };
@@ -1,17 +1,13 @@
1
- import type { ComponentStory, ComponentMeta } from "@storybook/react";
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { VimeoPlayButton as VimeoPlayButtonPrimitive } from "./vimeo-play-button";
3
3
 
4
4
  export default {
5
- title: "Components/Vimeo Preview Image",
5
+ title: "Components/Vimeo Play Button",
6
6
  component: VimeoPlayButtonPrimitive,
7
- } as ComponentMeta<typeof VimeoPlayButtonPrimitive>;
7
+ } satisfies Meta<typeof VimeoPlayButtonPrimitive>;
8
8
 
9
- const Template: ComponentStory<typeof VimeoPlayButtonPrimitive> = (args) => (
10
- <VimeoPlayButtonPrimitive
11
- {...args}
12
- style={{ minHeight: 20, outline: "1px solid black" }}
13
- />
14
- );
15
-
16
- export const VimeoPlayButton = Template.bind({});
17
- VimeoPlayButton.args = {};
9
+ export const VimeoPlayButton: StoryObj<typeof VimeoPlayButtonPrimitive> = {
10
+ args: {
11
+ style: { minHeight: 20, outline: "1px solid black" },
12
+ },
13
+ };
@@ -26,4 +26,5 @@ export const meta: WsComponentMeta = {
26
26
 
27
27
  export const propsMeta: WsComponentPropsMeta = {
28
28
  props,
29
+ initialProps: ["id"],
29
30
  };
@@ -1,17 +1,13 @@
1
- import type { ComponentStory, ComponentMeta } from "@storybook/react";
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { VimeoPreviewImage as VimeoPreviewImagePrimitive } from "./vimeo-preview-image";
3
3
 
4
4
  export default {
5
5
  title: "Components/Vimeo Preview Image",
6
6
  component: VimeoPreviewImagePrimitive,
7
- } as ComponentMeta<typeof VimeoPreviewImagePrimitive>;
7
+ } satisfies Meta<typeof VimeoPreviewImagePrimitive>;
8
8
 
9
- const Template: ComponentStory<typeof VimeoPreviewImagePrimitive> = (args) => (
10
- <VimeoPreviewImagePrimitive
11
- {...args}
12
- style={{ minHeight: 20, outline: "1px solid black" }}
13
- />
14
- );
15
-
16
- export const VimeoPreviewImage = Template.bind({});
17
- VimeoPreviewImage.args = {};
9
+ export const VimeoPreviewImage: StoryObj<typeof VimeoPreviewImagePrimitive> = {
10
+ args: {
11
+ style: { minHeight: 20, outline: "1px solid black" },
12
+ },
13
+ };
@@ -1,17 +1,13 @@
1
- import type { ComponentStory, ComponentMeta } from "@storybook/react";
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { VimeoSpinner as VimeoSpinnerPrimitive } from "./vimeo-spinner";
3
3
 
4
4
  export default {
5
- title: "Components/Vimeo Preview Image",
5
+ title: "Components/Vimeo Spinner",
6
6
  component: VimeoSpinnerPrimitive,
7
- } as ComponentMeta<typeof VimeoSpinnerPrimitive>;
7
+ } satisfies Meta<typeof VimeoSpinnerPrimitive>;
8
8
 
9
- const Template: ComponentStory<typeof VimeoSpinnerPrimitive> = (args) => (
10
- <VimeoSpinnerPrimitive
11
- {...args}
12
- style={{ minHeight: 20, outline: "1px solid black" }}
13
- />
14
- );
15
-
16
- export const VimeoSpinner = Template.bind({});
17
- VimeoSpinner.args = {};
9
+ export const VimeoSpinner: StoryObj<typeof VimeoSpinnerPrimitive> = {
10
+ args: {
11
+ style: { minHeight: 20, outline: "1px solid black" },
12
+ },
13
+ };
@@ -24,4 +24,5 @@ export const meta: WsComponentMeta = {
24
24
 
25
25
  export const propsMeta: WsComponentPropsMeta = {
26
26
  props,
27
+ initialProps: ["id"],
27
28
  };
@@ -1,17 +1,13 @@
1
- import type { ComponentStory, ComponentMeta } from "@storybook/react";
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
2
  import { Vimeo as VimeoPrimitive } from "./vimeo";
3
3
 
4
4
  export default {
5
5
  title: "Components/Vimeo",
6
6
  component: VimeoPrimitive,
7
- } as ComponentMeta<typeof VimeoPrimitive>;
7
+ } satisfies Meta<typeof VimeoPrimitive>;
8
8
 
9
- const Template: ComponentStory<typeof VimeoPrimitive> = (args) => (
10
- <VimeoPrimitive
11
- {...args}
12
- style={{ minHeight: 20, outline: "1px solid black" }}
13
- />
14
- );
15
-
16
- export const Vimeo = Template.bind({});
17
- Vimeo.args = {};
9
+ export const Vimeo: StoryObj<typeof VimeoPrimitive> = {
10
+ args: {
11
+ style: { minHeight: 20, outline: "1px solid black" },
12
+ },
13
+ };
package/src/vimeo.tsx CHANGED
@@ -413,8 +413,9 @@ const EmptyState = () => {
413
413
  fontSize: "1.2em",
414
414
  }}
415
415
  >
416
- Open the Properties panel and paste a video URL, e.g.
417
- https://vimeo.com/831343124.
416
+ {
417
+ 'Open the "Settings" panel and paste a video URL, e.g. https://vimeo.com/831343124.'
418
+ }
418
419
  </div>
419
420
  );
420
421
  };
package/src/vimeo.ws.ts CHANGED
@@ -7,7 +7,8 @@ import {
7
7
  } from "@webstudio-is/react-sdk";
8
8
  import { div } from "@webstudio-is/react-sdk/css-normalize";
9
9
  import { props } from "./__generated__/vimeo.props";
10
- import { type VimeoOptions } from "./vimeo";
10
+ import { Vimeo } from "./vimeo";
11
+ import type { ComponentProps } from "react";
11
12
 
12
13
  const presetStyle = {
13
14
  div,
@@ -309,7 +310,8 @@ export const meta: WsComponentMeta = {
309
310
  ],
310
311
  };
311
312
 
312
- const initialProps: Array<keyof VimeoOptions> = [
313
+ const initialProps: Array<keyof ComponentProps<typeof Vimeo>> = [
314
+ "id",
313
315
  "url",
314
316
  "quality",
315
317
  "showPreview",