@webstudio-is/sdk-components-react 0.70.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/LICENSE +21 -0
- package/README.md +3 -0
- package/lib/__generated__/blockquote.props.js +399 -0
- package/lib/__generated__/body.props.js +398 -0
- package/lib/__generated__/bold.props.js +398 -0
- package/lib/__generated__/box.props.js +416 -0
- package/lib/__generated__/button.props.js +420 -0
- package/lib/__generated__/checkbox-field.props.js +399 -0
- package/lib/__generated__/checkbox.props.js +439 -0
- package/lib/__generated__/code-text.props.js +405 -0
- package/lib/__generated__/error-message.props.js +398 -0
- package/lib/__generated__/form.props.js +406 -0
- package/lib/__generated__/fragment.props.js +4 -0
- package/lib/__generated__/heading.props.js +405 -0
- package/lib/__generated__/html-embed.props.js +11 -0
- package/lib/__generated__/image.props.js +442 -0
- package/lib/__generated__/input.props.js +445 -0
- package/lib/__generated__/italic.props.js +398 -0
- package/lib/__generated__/label.props.js +400 -0
- package/lib/__generated__/link-block.props.js +432 -0
- package/lib/__generated__/link.props.js +432 -0
- package/lib/__generated__/list-item.props.js +399 -0
- package/lib/__generated__/list.props.js +412 -0
- package/lib/__generated__/paragraph.props.js +398 -0
- package/lib/__generated__/radio-button-field.props.js +399 -0
- package/lib/__generated__/radio-button.props.js +439 -0
- package/lib/__generated__/rich-text-link.props.js +432 -0
- package/lib/__generated__/separator.props.js +398 -0
- package/lib/__generated__/slot.props.js +4 -0
- package/lib/__generated__/span.props.js +398 -0
- package/lib/__generated__/subscript.props.js +398 -0
- package/lib/__generated__/success-message.props.js +398 -0
- package/lib/__generated__/superscript.props.js +398 -0
- package/lib/__generated__/text-block.props.js +405 -0
- package/lib/__generated__/textarea.props.js +412 -0
- package/lib/blockquote.js +15 -0
- package/lib/blockquote.ws.js +76 -0
- package/lib/body.js +9 -0
- package/lib/body.ws.js +47 -0
- package/lib/bold.js +9 -0
- package/lib/bold.ws.js +23 -0
- package/lib/box.js +14 -0
- package/lib/box.ws.js +46 -0
- package/lib/button.js +16 -0
- package/lib/button.ws.js +31 -0
- package/lib/checkbox-field.js +9 -0
- package/lib/checkbox-field.ws.js +44 -0
- package/lib/checkbox.js +9 -0
- package/lib/checkbox.ws.js +40 -0
- package/lib/cjs/__generated__/blockquote.props.js +419 -0
- package/lib/cjs/__generated__/body.props.js +418 -0
- package/lib/cjs/__generated__/bold.props.js +418 -0
- package/lib/cjs/__generated__/box.props.js +436 -0
- package/lib/cjs/__generated__/button.props.js +440 -0
- package/lib/cjs/__generated__/checkbox-field.props.js +419 -0
- package/lib/cjs/__generated__/checkbox.props.js +459 -0
- package/lib/cjs/__generated__/code-text.props.js +425 -0
- package/lib/cjs/__generated__/error-message.props.js +418 -0
- package/lib/cjs/__generated__/form.props.js +426 -0
- package/lib/cjs/__generated__/fragment.props.js +24 -0
- package/lib/cjs/__generated__/heading.props.js +425 -0
- package/lib/cjs/__generated__/html-embed.props.js +31 -0
- package/lib/cjs/__generated__/image.props.js +462 -0
- package/lib/cjs/__generated__/input.props.js +465 -0
- package/lib/cjs/__generated__/italic.props.js +418 -0
- package/lib/cjs/__generated__/label.props.js +420 -0
- package/lib/cjs/__generated__/link-block.props.js +452 -0
- package/lib/cjs/__generated__/link.props.js +452 -0
- package/lib/cjs/__generated__/list-item.props.js +419 -0
- package/lib/cjs/__generated__/list.props.js +432 -0
- package/lib/cjs/__generated__/paragraph.props.js +418 -0
- package/lib/cjs/__generated__/radio-button-field.props.js +419 -0
- package/lib/cjs/__generated__/radio-button.props.js +459 -0
- package/lib/cjs/__generated__/rich-text-link.props.js +452 -0
- package/lib/cjs/__generated__/separator.props.js +418 -0
- package/lib/cjs/__generated__/slot.props.js +24 -0
- package/lib/cjs/__generated__/span.props.js +418 -0
- package/lib/cjs/__generated__/subscript.props.js +418 -0
- package/lib/cjs/__generated__/success-message.props.js +418 -0
- package/lib/cjs/__generated__/superscript.props.js +418 -0
- package/lib/cjs/__generated__/text-block.props.js +425 -0
- package/lib/cjs/__generated__/textarea.props.js +432 -0
- package/lib/cjs/blockquote.js +32 -0
- package/lib/cjs/blockquote.ws.js +94 -0
- package/lib/cjs/body.js +29 -0
- package/lib/cjs/body.ws.js +65 -0
- package/lib/cjs/bold.js +29 -0
- package/lib/cjs/bold.ws.js +41 -0
- package/lib/cjs/box.js +31 -0
- package/lib/cjs/box.ws.js +53 -0
- package/lib/cjs/button.js +36 -0
- package/lib/cjs/button.ws.js +49 -0
- package/lib/cjs/checkbox-field.js +29 -0
- package/lib/cjs/checkbox-field.ws.js +62 -0
- package/lib/cjs/checkbox.js +29 -0
- package/lib/cjs/checkbox.ws.js +58 -0
- package/lib/cjs/code-text.js +39 -0
- package/lib/cjs/code-text.ws.js +74 -0
- package/lib/cjs/components.js +88 -0
- package/lib/cjs/error-message.js +29 -0
- package/lib/cjs/error-message.ws.js +40 -0
- package/lib/cjs/form.js +29 -0
- package/lib/cjs/form.ws.js +82 -0
- package/lib/cjs/fragment.js +29 -0
- package/lib/cjs/fragment.ws.js +33 -0
- package/lib/cjs/heading.js +31 -0
- package/lib/cjs/heading.ws.js +56 -0
- package/lib/cjs/html-embed.js +80 -0
- package/lib/cjs/html-embed.ws.js +45 -0
- package/lib/cjs/image.js +76 -0
- package/lib/cjs/image.ws.js +66 -0
- package/lib/cjs/input.js +29 -0
- package/lib/cjs/input.ws.js +55 -0
- package/lib/cjs/italic.js +29 -0
- package/lib/cjs/italic.ws.js +47 -0
- package/lib/cjs/label.js +29 -0
- package/lib/cjs/label.ws.js +63 -0
- package/lib/cjs/link-block.js +30 -0
- package/lib/cjs/link-block.ws.js +53 -0
- package/lib/cjs/link.js +48 -0
- package/lib/cjs/link.ws.js +79 -0
- package/lib/cjs/list-item.js +32 -0
- package/lib/cjs/list-item.ws.js +51 -0
- package/lib/cjs/list.js +31 -0
- package/lib/cjs/list.ws.js +73 -0
- package/lib/cjs/metas.js +88 -0
- package/lib/cjs/package.json +1 -0
- package/lib/cjs/paragraph.js +29 -0
- package/lib/cjs/paragraph.ws.js +50 -0
- package/lib/cjs/props.js +88 -0
- package/lib/cjs/radio-button-field.js +29 -0
- package/lib/cjs/radio-button-field.ws.js +62 -0
- package/lib/cjs/radio-button.js +29 -0
- package/lib/cjs/radio-button.ws.js +58 -0
- package/lib/cjs/rich-text-link.js +28 -0
- package/lib/cjs/rich-text-link.ws.js +39 -0
- package/lib/cjs/separator.js +32 -0
- package/lib/cjs/separator.ws.js +70 -0
- package/lib/cjs/slot.js +36 -0
- package/lib/cjs/slot.ws.js +36 -0
- package/lib/cjs/span.js +29 -0
- package/lib/cjs/span.ws.js +41 -0
- package/lib/cjs/subscript.js +29 -0
- package/lib/cjs/subscript.ws.js +41 -0
- package/lib/cjs/success-message.js +29 -0
- package/lib/cjs/success-message.ws.js +40 -0
- package/lib/cjs/superscript.js +29 -0
- package/lib/cjs/superscript.ws.js +41 -0
- package/lib/cjs/text-block.js +32 -0
- package/lib/cjs/text-block.ws.js +57 -0
- package/lib/cjs/textarea.js +29 -0
- package/lib/cjs/textarea.ws.js +59 -0
- package/lib/code-text.js +22 -0
- package/lib/code-text.ws.js +56 -0
- package/lib/components.js +68 -0
- package/lib/error-message.js +9 -0
- package/lib/error-message.ws.js +20 -0
- package/lib/form.js +9 -0
- package/lib/form.ws.js +64 -0
- package/lib/fragment.js +9 -0
- package/lib/fragment.ws.js +13 -0
- package/lib/heading.js +14 -0
- package/lib/heading.ws.js +38 -0
- package/lib/html-embed.js +65 -0
- package/lib/html-embed.ws.js +25 -0
- package/lib/image.js +66 -0
- package/lib/image.ws.js +48 -0
- package/lib/input.js +9 -0
- package/lib/input.ws.js +37 -0
- package/lib/italic.js +9 -0
- package/lib/italic.ws.js +29 -0
- package/lib/label.js +9 -0
- package/lib/label.ws.js +45 -0
- package/lib/link-block.js +10 -0
- package/lib/link-block.ws.js +33 -0
- package/lib/link.js +32 -0
- package/lib/link.ws.js +61 -0
- package/lib/list-item.js +15 -0
- package/lib/list-item.ws.js +33 -0
- package/lib/list.js +14 -0
- package/lib/list.ws.js +55 -0
- package/lib/metas.js +68 -0
- package/lib/paragraph.js +9 -0
- package/lib/paragraph.ws.js +32 -0
- package/lib/props.js +68 -0
- package/lib/radio-button-field.js +9 -0
- package/lib/radio-button-field.ws.js +44 -0
- package/lib/radio-button.js +9 -0
- package/lib/radio-button.ws.js +40 -0
- package/lib/rich-text-link.js +8 -0
- package/lib/rich-text-link.ws.js +19 -0
- package/lib/separator.js +15 -0
- package/lib/separator.ws.js +52 -0
- package/lib/slot.js +16 -0
- package/lib/slot.ws.js +16 -0
- package/lib/span.js +9 -0
- package/lib/span.ws.js +23 -0
- package/lib/subscript.js +9 -0
- package/lib/subscript.ws.js +23 -0
- package/lib/success-message.js +9 -0
- package/lib/success-message.ws.js +20 -0
- package/lib/superscript.js +9 -0
- package/lib/superscript.ws.js +23 -0
- package/lib/text-block.js +15 -0
- package/lib/text-block.ws.js +39 -0
- package/lib/textarea.js +9 -0
- package/lib/textarea.ws.js +41 -0
- package/lib/types/__generated__/blockquote.props.d.ts +2 -0
- package/lib/types/__generated__/body.props.d.ts +2 -0
- package/lib/types/__generated__/bold.props.d.ts +2 -0
- package/lib/types/__generated__/box.props.d.ts +2 -0
- package/lib/types/__generated__/button.props.d.ts +2 -0
- package/lib/types/__generated__/checkbox-field.props.d.ts +2 -0
- package/lib/types/__generated__/checkbox.props.d.ts +2 -0
- package/lib/types/__generated__/code-text.props.d.ts +2 -0
- package/lib/types/__generated__/error-message.props.d.ts +2 -0
- package/lib/types/__generated__/form.props.d.ts +2 -0
- package/lib/types/__generated__/fragment.props.d.ts +2 -0
- package/lib/types/__generated__/heading.props.d.ts +2 -0
- package/lib/types/__generated__/html-embed.props.d.ts +2 -0
- package/lib/types/__generated__/image.props.d.ts +2 -0
- package/lib/types/__generated__/input.props.d.ts +2 -0
- package/lib/types/__generated__/italic.props.d.ts +2 -0
- package/lib/types/__generated__/label.props.d.ts +2 -0
- package/lib/types/__generated__/link-block.props.d.ts +2 -0
- package/lib/types/__generated__/link.props.d.ts +2 -0
- package/lib/types/__generated__/list-item.props.d.ts +2 -0
- package/lib/types/__generated__/list.props.d.ts +2 -0
- package/lib/types/__generated__/paragraph.props.d.ts +2 -0
- package/lib/types/__generated__/radio-button-field.props.d.ts +2 -0
- package/lib/types/__generated__/radio-button.props.d.ts +2 -0
- package/lib/types/__generated__/rich-text-link.props.d.ts +2 -0
- package/lib/types/__generated__/separator.props.d.ts +2 -0
- package/lib/types/__generated__/slot.props.d.ts +2 -0
- package/lib/types/__generated__/span.props.d.ts +2 -0
- package/lib/types/__generated__/subscript.props.d.ts +2 -0
- package/lib/types/__generated__/success-message.props.d.ts +2 -0
- package/lib/types/__generated__/superscript.props.d.ts +2 -0
- package/lib/types/__generated__/text-block.props.d.ts +2 -0
- package/lib/types/__generated__/textarea.props.d.ts +2 -0
- package/lib/types/blockquote.d.ts +3 -0
- package/lib/types/blockquote.stories.d.ts +5 -0
- package/lib/types/blockquote.ws.d.ts +3 -0
- package/lib/types/body.d.ts +3 -0
- package/lib/types/body.stories.d.ts +6 -0
- package/lib/types/body.ws.d.ts +3 -0
- package/lib/types/bold.d.ts +3 -0
- package/lib/types/bold.stories.d.ts +5 -0
- package/lib/types/bold.ws.d.ts +3 -0
- package/lib/types/box.d.ts +7 -0
- package/lib/types/box.stories.d.ts +9 -0
- package/lib/types/box.ws.d.ts +3 -0
- package/lib/types/button.d.ts +7 -0
- package/lib/types/button.stories.d.ts +9 -0
- package/lib/types/button.ws.d.ts +3 -0
- package/lib/types/checkbox-field.d.ts +3 -0
- package/lib/types/checkbox-field.ws.d.ts +3 -0
- package/lib/types/checkbox.d.ts +3 -0
- package/lib/types/checkbox.ws.d.ts +3 -0
- package/lib/types/code-text.d.ts +9 -0
- package/lib/types/code-text.stories.d.ts +11 -0
- package/lib/types/code-text.ws.d.ts +3 -0
- package/lib/types/components.d.ts +33 -0
- package/lib/types/error-message.d.ts +3 -0
- package/lib/types/error-message.ws.d.ts +3 -0
- package/lib/types/form.d.ts +3 -0
- package/lib/types/form.stories.d.ts +5 -0
- package/lib/types/form.ws.d.ts +3 -0
- package/lib/types/fragment.d.ts +6 -0
- package/lib/types/fragment.ws.d.ts +3 -0
- package/lib/types/heading.d.ts +7 -0
- package/lib/types/heading.stories.d.ts +9 -0
- package/lib/types/heading.ws.d.ts +3 -0
- package/lib/types/html-embed.d.ts +7 -0
- package/lib/types/html-embed.stories.d.ts +11 -0
- package/lib/types/html-embed.ws.d.ts +3 -0
- package/lib/types/image.d.ts +7 -0
- package/lib/types/image.stories.d.ts +13 -0
- package/lib/types/image.ws.d.ts +3 -0
- package/lib/types/input.d.ts +5 -0
- package/lib/types/input.stories.d.ts +9 -0
- package/lib/types/input.ws.d.ts +3 -0
- package/lib/types/italic.d.ts +3 -0
- package/lib/types/italic.stories.d.ts +5 -0
- package/lib/types/italic.ws.d.ts +3 -0
- package/lib/types/label.d.ts +3 -0
- package/lib/types/label.ws.d.ts +3 -0
- package/lib/types/link-block.d.ts +3 -0
- package/lib/types/link-block.stories.d.ts +13 -0
- package/lib/types/link-block.ws.d.ts +3 -0
- package/lib/types/link.d.ts +9 -0
- package/lib/types/link.stories.d.ts +13 -0
- package/lib/types/link.ws.d.ts +3 -0
- package/lib/types/list-item.d.ts +3 -0
- package/lib/types/list-item.stories.d.ts +5 -0
- package/lib/types/list-item.ws.d.ts +3 -0
- package/lib/types/list.d.ts +9 -0
- package/lib/types/list.stories.d.ts +9 -0
- package/lib/types/list.ws.d.ts +3 -0
- package/lib/types/metas.d.ts +33 -0
- package/lib/types/paragraph.d.ts +3 -0
- package/lib/types/paragraph.stories.d.ts +5 -0
- package/lib/types/paragraph.ws.d.ts +3 -0
- package/lib/types/props.d.ts +33 -0
- package/lib/types/radio-button-field.d.ts +3 -0
- package/lib/types/radio-button-field.ws.d.ts +3 -0
- package/lib/types/radio-button.d.ts +3 -0
- package/lib/types/radio-button.ws.d.ts +3 -0
- package/lib/types/rich-text-link.d.ts +2 -0
- package/lib/types/rich-text-link.stories.d.ts +13 -0
- package/lib/types/rich-text-link.ws.d.ts +3 -0
- package/lib/types/separator.d.ts +3 -0
- package/lib/types/separator.stories.d.ts +5 -0
- package/lib/types/separator.ws.d.ts +3 -0
- package/lib/types/slot.d.ts +6 -0
- package/lib/types/slot.stories.d.ts +9 -0
- package/lib/types/slot.ws.d.ts +3 -0
- package/lib/types/span.d.ts +3 -0
- package/lib/types/span.stories.d.ts +5 -0
- package/lib/types/span.ws.d.ts +3 -0
- package/lib/types/subscript.d.ts +3 -0
- package/lib/types/subscript.stories.d.ts +5 -0
- package/lib/types/subscript.ws.d.ts +3 -0
- package/lib/types/success-message.d.ts +3 -0
- package/lib/types/success-message.ws.d.ts +3 -0
- package/lib/types/superscript.d.ts +3 -0
- package/lib/types/superscript.stories.d.ts +5 -0
- package/lib/types/superscript.ws.d.ts +3 -0
- package/lib/types/text-block.d.ts +7 -0
- package/lib/types/text-block.stories.d.ts +9 -0
- package/lib/types/text-block.ws.d.ts +3 -0
- package/lib/types/textarea.d.ts +3 -0
- package/lib/types/textarea.ws.d.ts +3 -0
- package/package.json +69 -0
- package/src/__generated__/blockquote.props.ts +444 -0
- package/src/__generated__/body.props.ts +443 -0
- package/src/__generated__/bold.props.ts +443 -0
- package/src/__generated__/box.props.ts +461 -0
- package/src/__generated__/button.props.ts +465 -0
- package/src/__generated__/checkbox-field.props.ts +444 -0
- package/src/__generated__/checkbox.props.ts +484 -0
- package/src/__generated__/code-text.props.ts +450 -0
- package/src/__generated__/error-message.props.ts +443 -0
- package/src/__generated__/form.props.ts +451 -0
- package/src/__generated__/fragment.props.ts +3 -0
- package/src/__generated__/heading.props.ts +450 -0
- package/src/__generated__/html-embed.props.ts +10 -0
- package/src/__generated__/image.props.ts +487 -0
- package/src/__generated__/input.props.ts +490 -0
- package/src/__generated__/italic.props.ts +443 -0
- package/src/__generated__/label.props.ts +445 -0
- package/src/__generated__/link-block.props.ts +477 -0
- package/src/__generated__/link.props.ts +477 -0
- package/src/__generated__/list-item.props.ts +444 -0
- package/src/__generated__/list.props.ts +457 -0
- package/src/__generated__/paragraph.props.ts +443 -0
- package/src/__generated__/radio-button-field.props.ts +444 -0
- package/src/__generated__/radio-button.props.ts +484 -0
- package/src/__generated__/rich-text-link.props.ts +477 -0
- package/src/__generated__/separator.props.ts +443 -0
- package/src/__generated__/slot.props.ts +3 -0
- package/src/__generated__/span.props.ts +443 -0
- package/src/__generated__/subscript.props.ts +443 -0
- package/src/__generated__/success-message.props.ts +443 -0
- package/src/__generated__/superscript.props.ts +443 -0
- package/src/__generated__/text-block.props.ts +450 -0
- package/src/__generated__/textarea.props.ts +457 -0
- package/src/blockquote.stories.tsx +16 -0
- package/src/blockquote.tsx +18 -0
- package/src/blockquote.ws.tsx +81 -0
- package/src/body.stories.tsx +11 -0
- package/src/body.tsx +10 -0
- package/src/body.ws.tsx +51 -0
- package/src/bold.stories.tsx +16 -0
- package/src/bold.tsx +10 -0
- package/src/bold.ws.tsx +26 -0
- package/src/box.stories.tsx +17 -0
- package/src/box.tsx +31 -0
- package/src/box.ws.ts +52 -0
- package/src/button.stories.tsx +13 -0
- package/src/button.tsx +23 -0
- package/src/button.ws.tsx +34 -0
- package/src/checkbox-field.tsx +10 -0
- package/src/checkbox-field.ws.tsx +47 -0
- package/src/checkbox.tsx +13 -0
- package/src/checkbox.ws.tsx +43 -0
- package/src/code-text.stories.tsx +16 -0
- package/src/code-text.tsx +31 -0
- package/src/code-text.ws.tsx +58 -0
- package/src/components.ts +33 -0
- package/src/error-message.tsx +10 -0
- package/src/error-message.ws.tsx +24 -0
- package/src/form.stories.tsx +14 -0
- package/src/form.tsx +14 -0
- package/src/form.ws.tsx +67 -0
- package/src/fragment.tsx +11 -0
- package/src/fragment.ws.ts +15 -0
- package/src/heading.stories.tsx +16 -0
- package/src/heading.tsx +20 -0
- package/src/heading.ws.tsx +44 -0
- package/src/html-embed.stories.tsx +16 -0
- package/src/html-embed.tsx +96 -0
- package/src/html-embed.ws.ts +27 -0
- package/src/image.stories.tsx +15 -0
- package/src/image.tsx +83 -0
- package/src/image.ws.tsx +54 -0
- package/src/input.stories.tsx +14 -0
- package/src/input.tsx +13 -0
- package/src/input.ws.tsx +40 -0
- package/src/italic.stories.tsx +16 -0
- package/src/italic.tsx +10 -0
- package/src/italic.ws.tsx +32 -0
- package/src/label.tsx +10 -0
- package/src/label.ws.tsx +48 -0
- package/src/link-block.stories.tsx +16 -0
- package/src/link-block.tsx +9 -0
- package/src/link-block.ws.tsx +38 -0
- package/src/link.stories.tsx +16 -0
- package/src/link.tsx +44 -0
- package/src/link.ws.tsx +64 -0
- package/src/list-item.stories.tsx +16 -0
- package/src/list-item.tsx +18 -0
- package/src/list-item.ws.tsx +36 -0
- package/src/list.stories.tsx +17 -0
- package/src/list.tsx +26 -0
- package/src/list.ws.tsx +58 -0
- package/src/metas.ts +33 -0
- package/src/paragraph.stories.tsx +16 -0
- package/src/paragraph.tsx +10 -0
- package/src/paragraph.ws.tsx +35 -0
- package/src/props.ts +33 -0
- package/src/radio-button-field.tsx +10 -0
- package/src/radio-button-field.ws.tsx +47 -0
- package/src/radio-button.tsx +13 -0
- package/src/radio-button.ws.tsx +43 -0
- package/src/rich-text-link.stories.tsx +16 -0
- package/src/rich-text-link.tsx +8 -0
- package/src/rich-text-link.ws.tsx +22 -0
- package/src/separator.stories.tsx +14 -0
- package/src/separator.tsx +18 -0
- package/src/separator.ws.tsx +56 -0
- package/src/slot.stories.tsx +16 -0
- package/src/slot.tsx +17 -0
- package/src/slot.ws.ts +18 -0
- package/src/span.stories.tsx +16 -0
- package/src/span.tsx +10 -0
- package/src/span.ws.tsx +26 -0
- package/src/subscript.stories.tsx +16 -0
- package/src/subscript.tsx +10 -0
- package/src/subscript.ws.tsx +26 -0
- package/src/success-message.tsx +10 -0
- package/src/success-message.ws.tsx +24 -0
- package/src/superscript.stories.tsx +16 -0
- package/src/superscript.tsx +10 -0
- package/src/superscript.ws.tsx +26 -0
- package/src/text-block.stories.tsx +16 -0
- package/src/text-block.tsx +21 -0
- package/src/text-block.ws.tsx +42 -0
- package/src/textarea.tsx +13 -0
- package/src/textarea.ws.tsx +44 -0
package/src/link.ws.tsx
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { LinkIcon } from "@webstudio-is/icons/svg";
|
|
2
|
+
import {
|
|
3
|
+
defaultStates,
|
|
4
|
+
type PresetStyle,
|
|
5
|
+
type WsComponentMeta,
|
|
6
|
+
type WsComponentPropsMeta,
|
|
7
|
+
} from "@webstudio-is/react-sdk";
|
|
8
|
+
import { a } from "@webstudio-is/react-sdk/css-normalize";
|
|
9
|
+
import type { defaultTag } from "./link";
|
|
10
|
+
import { props } from "./__generated__/link.props";
|
|
11
|
+
|
|
12
|
+
const presetStyle = {
|
|
13
|
+
a: [
|
|
14
|
+
...a,
|
|
15
|
+
{
|
|
16
|
+
property: "minHeight",
|
|
17
|
+
value: { type: "unit", unit: "em", value: 1 },
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
property: "display",
|
|
21
|
+
value: { type: "keyword", value: "inline-block" },
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
} satisfies PresetStyle<typeof defaultTag>;
|
|
25
|
+
|
|
26
|
+
export const meta: WsComponentMeta = {
|
|
27
|
+
category: "general",
|
|
28
|
+
type: "rich-text",
|
|
29
|
+
label: "Link Text",
|
|
30
|
+
icon: LinkIcon,
|
|
31
|
+
presetStyle,
|
|
32
|
+
order: 1,
|
|
33
|
+
states: [
|
|
34
|
+
...defaultStates,
|
|
35
|
+
{
|
|
36
|
+
selector: ":visited",
|
|
37
|
+
label: "Visited",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
category: "component-states",
|
|
41
|
+
selector: "[aria-current=page]",
|
|
42
|
+
label: "Current page",
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
template: [
|
|
46
|
+
{
|
|
47
|
+
type: "instance",
|
|
48
|
+
component: "Link",
|
|
49
|
+
children: [{ type: "text", value: "Link text you can edit" }],
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const propsMeta: WsComponentPropsMeta = {
|
|
55
|
+
props: {
|
|
56
|
+
...props,
|
|
57
|
+
href: {
|
|
58
|
+
type: "string",
|
|
59
|
+
control: "url",
|
|
60
|
+
required: false,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
initialProps: ["href", "target", "prefetch"],
|
|
64
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
2
|
+
import { ListItem as ListItemPrimitive } from "./list-item";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/List Item",
|
|
6
|
+
component: ListItemPrimitive,
|
|
7
|
+
} as ComponentMeta<typeof ListItemPrimitive>;
|
|
8
|
+
|
|
9
|
+
const Template: ComponentStory<typeof ListItemPrimitive> = (args) => (
|
|
10
|
+
<ListItemPrimitive {...args} />
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export const ListItem = Template.bind({});
|
|
14
|
+
ListItem.args = {
|
|
15
|
+
children: "ListItem",
|
|
16
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
forwardRef,
|
|
3
|
+
createElement,
|
|
4
|
+
type ElementRef,
|
|
5
|
+
type ComponentProps,
|
|
6
|
+
} from "react";
|
|
7
|
+
|
|
8
|
+
export const defaultTag = "li";
|
|
9
|
+
|
|
10
|
+
type Props = ComponentProps<typeof defaultTag>;
|
|
11
|
+
|
|
12
|
+
export const ListItem = forwardRef<ElementRef<typeof defaultTag>, Props>(
|
|
13
|
+
(props, ref) => {
|
|
14
|
+
return createElement(defaultTag, { ...props, ref });
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
ListItem.displayName = "ListItem";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ListItemIcon } from "@webstudio-is/icons/svg";
|
|
2
|
+
import {
|
|
3
|
+
defaultStates,
|
|
4
|
+
type PresetStyle,
|
|
5
|
+
type WsComponentMeta,
|
|
6
|
+
type WsComponentPropsMeta,
|
|
7
|
+
} from "@webstudio-is/react-sdk";
|
|
8
|
+
import { li } from "@webstudio-is/react-sdk/css-normalize";
|
|
9
|
+
import type { defaultTag } from "./list-item";
|
|
10
|
+
import { props } from "./__generated__/list-item.props";
|
|
11
|
+
|
|
12
|
+
const presetStyle = {
|
|
13
|
+
li,
|
|
14
|
+
} satisfies PresetStyle<typeof defaultTag>;
|
|
15
|
+
|
|
16
|
+
export const meta: WsComponentMeta = {
|
|
17
|
+
category: "general",
|
|
18
|
+
type: "rich-text",
|
|
19
|
+
requiredAncestors: ["List"],
|
|
20
|
+
label: "List Item",
|
|
21
|
+
icon: ListItemIcon,
|
|
22
|
+
states: defaultStates,
|
|
23
|
+
presetStyle,
|
|
24
|
+
template: [
|
|
25
|
+
{
|
|
26
|
+
type: "instance",
|
|
27
|
+
component: "ListItem",
|
|
28
|
+
children: [{ type: "text", value: "List Item you can edit" }],
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
order: 4,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export const propsMeta: WsComponentPropsMeta = {
|
|
35
|
+
props,
|
|
36
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
2
|
+
import { List as ListPrimitive } from "./list";
|
|
3
|
+
import { ListItem } from "./list-item";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: "Components/List",
|
|
7
|
+
component: ListPrimitive,
|
|
8
|
+
} as ComponentMeta<typeof ListPrimitive>;
|
|
9
|
+
|
|
10
|
+
const Template: ComponentStory<typeof ListPrimitive> = (args) => (
|
|
11
|
+
<ListPrimitive {...args} />
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
export const List = Template.bind({});
|
|
15
|
+
List.args = {
|
|
16
|
+
children: <ListItem />,
|
|
17
|
+
};
|
package/src/list.tsx
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
forwardRef,
|
|
3
|
+
createElement,
|
|
4
|
+
type ElementRef,
|
|
5
|
+
type ComponentProps,
|
|
6
|
+
} from "react";
|
|
7
|
+
|
|
8
|
+
const unorderedTag = "ul";
|
|
9
|
+
const orderedTag = "ol";
|
|
10
|
+
|
|
11
|
+
export type ListTag = typeof unorderedTag | typeof orderedTag;
|
|
12
|
+
|
|
13
|
+
type Props = ComponentProps<typeof unorderedTag> &
|
|
14
|
+
ComponentProps<typeof orderedTag> & {
|
|
15
|
+
ordered?: boolean;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const List = forwardRef<
|
|
19
|
+
ElementRef<typeof unorderedTag | typeof orderedTag>,
|
|
20
|
+
Props
|
|
21
|
+
>(({ ordered = false, ...props }, ref) => {
|
|
22
|
+
const tag = ordered ? orderedTag : unorderedTag;
|
|
23
|
+
return createElement(tag, { ...props, ref });
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
List.displayName = "List";
|
package/src/list.ws.tsx
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ListIcon } from "@webstudio-is/icons/svg";
|
|
2
|
+
import {
|
|
3
|
+
defaultStates,
|
|
4
|
+
type PresetStyle,
|
|
5
|
+
type WsComponentMeta,
|
|
6
|
+
type WsComponentPropsMeta,
|
|
7
|
+
} from "@webstudio-is/react-sdk";
|
|
8
|
+
import { ol, ul } from "@webstudio-is/react-sdk/css-normalize";
|
|
9
|
+
import { props } from "./__generated__/list.props";
|
|
10
|
+
import type { ListTag } from "./list";
|
|
11
|
+
|
|
12
|
+
const presetStyle = {
|
|
13
|
+
ol: [
|
|
14
|
+
...ol,
|
|
15
|
+
{
|
|
16
|
+
property: "marginTop",
|
|
17
|
+
value: { type: "keyword", value: "0" },
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
property: "marginBottom",
|
|
21
|
+
value: { type: "keyword", value: "10px" },
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
property: "paddingLeft",
|
|
25
|
+
value: { type: "keyword", value: "40px" },
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
ul: [
|
|
29
|
+
...ul,
|
|
30
|
+
{
|
|
31
|
+
property: "marginTop",
|
|
32
|
+
value: { type: "keyword", value: "0" },
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
property: "marginBottom",
|
|
36
|
+
value: { type: "keyword", value: "10px" },
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
property: "paddingLeft",
|
|
40
|
+
value: { type: "keyword", value: "40px" },
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
} satisfies PresetStyle<ListTag>;
|
|
44
|
+
|
|
45
|
+
export const meta: WsComponentMeta = {
|
|
46
|
+
category: "general",
|
|
47
|
+
type: "container",
|
|
48
|
+
label: "List",
|
|
49
|
+
icon: ListIcon,
|
|
50
|
+
states: defaultStates,
|
|
51
|
+
presetStyle,
|
|
52
|
+
order: 3,
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const propsMeta: WsComponentPropsMeta = {
|
|
56
|
+
props,
|
|
57
|
+
initialProps: ["ordered", "type", "starts", "reversed"],
|
|
58
|
+
};
|
package/src/metas.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export { meta as Slot } from "./slot.ws";
|
|
2
|
+
export { meta as Fragment } from "./fragment.ws";
|
|
3
|
+
export { meta as HtmlEmbed } from "./html-embed.ws";
|
|
4
|
+
export { meta as Body } from "./body.ws";
|
|
5
|
+
export { meta as Box } from "./box.ws";
|
|
6
|
+
export { meta as TextBlock } from "./text-block.ws";
|
|
7
|
+
export { meta as Heading } from "./heading.ws";
|
|
8
|
+
export { meta as Paragraph } from "./paragraph.ws";
|
|
9
|
+
export { meta as Link } from "./link.ws";
|
|
10
|
+
export { meta as LinkBlock } from "./link-block.ws";
|
|
11
|
+
export { meta as RichTextLink } from "./rich-text-link.ws";
|
|
12
|
+
export { meta as Span } from "./span.ws";
|
|
13
|
+
export { meta as Bold } from "./bold.ws";
|
|
14
|
+
export { meta as Italic } from "./italic.ws";
|
|
15
|
+
export { meta as Superscript } from "./superscript.ws";
|
|
16
|
+
export { meta as Subscript } from "./subscript.ws";
|
|
17
|
+
export { meta as Button } from "./button.ws";
|
|
18
|
+
export { meta as Input } from "./input.ws";
|
|
19
|
+
export { meta as Form } from "./form.ws";
|
|
20
|
+
export { meta as Image } from "./image.ws";
|
|
21
|
+
export { meta as Blockquote } from "./blockquote.ws";
|
|
22
|
+
export { meta as List } from "./list.ws";
|
|
23
|
+
export { meta as ListItem } from "./list-item.ws";
|
|
24
|
+
export { meta as Separator } from "./separator.ws";
|
|
25
|
+
export { meta as CodeText } from "./code-text.ws";
|
|
26
|
+
export { meta as Label } from "./label.ws";
|
|
27
|
+
export { meta as SuccessMessage } from "./success-message.ws";
|
|
28
|
+
export { meta as ErrorMessage } from "./error-message.ws";
|
|
29
|
+
export { meta as Textarea } from "./textarea.ws";
|
|
30
|
+
export { meta as RadioButtonField } from "./radio-button-field.ws";
|
|
31
|
+
export { meta as RadioButton } from "./radio-button.ws";
|
|
32
|
+
export { meta as CheckboxField } from "./checkbox-field.ws";
|
|
33
|
+
export { meta as Checkbox } from "./checkbox.ws";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
2
|
+
import { Paragraph as ParagraphPrimitive } from "./paragraph";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/Paragraph",
|
|
6
|
+
component: ParagraphPrimitive,
|
|
7
|
+
} as ComponentMeta<typeof ParagraphPrimitive>;
|
|
8
|
+
|
|
9
|
+
const Template: ComponentStory<typeof ParagraphPrimitive> = (args) => (
|
|
10
|
+
<ParagraphPrimitive {...args} />
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export const Paragraph = Template.bind({});
|
|
14
|
+
Paragraph.args = {
|
|
15
|
+
children: "paragraph",
|
|
16
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { forwardRef, type ElementRef, type ComponentProps } from "react";
|
|
2
|
+
|
|
3
|
+
export const defaultTag = "p";
|
|
4
|
+
|
|
5
|
+
export const Paragraph = forwardRef<
|
|
6
|
+
ElementRef<typeof defaultTag>,
|
|
7
|
+
ComponentProps<typeof defaultTag>
|
|
8
|
+
>((props, ref) => <p {...props} ref={ref} />);
|
|
9
|
+
|
|
10
|
+
Paragraph.displayName = "Paragraph";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { TextAlignLeftIcon } from "@webstudio-is/icons/svg";
|
|
2
|
+
import {
|
|
3
|
+
defaultStates,
|
|
4
|
+
type PresetStyle,
|
|
5
|
+
type WsComponentMeta,
|
|
6
|
+
type WsComponentPropsMeta,
|
|
7
|
+
} from "@webstudio-is/react-sdk";
|
|
8
|
+
import { p } from "@webstudio-is/react-sdk/css-normalize";
|
|
9
|
+
import type { defaultTag } from "./paragraph";
|
|
10
|
+
import { props } from "./__generated__/paragraph.props";
|
|
11
|
+
|
|
12
|
+
const presetStyle = {
|
|
13
|
+
p,
|
|
14
|
+
} satisfies PresetStyle<typeof defaultTag>;
|
|
15
|
+
|
|
16
|
+
export const meta: WsComponentMeta = {
|
|
17
|
+
category: "text",
|
|
18
|
+
type: "rich-text",
|
|
19
|
+
label: "Paragraph",
|
|
20
|
+
icon: TextAlignLeftIcon,
|
|
21
|
+
states: defaultStates,
|
|
22
|
+
presetStyle,
|
|
23
|
+
template: [
|
|
24
|
+
{
|
|
25
|
+
type: "instance",
|
|
26
|
+
component: "Paragraph",
|
|
27
|
+
children: [{ type: "text", value: "Pragraph you can edit" }],
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
order: 2,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const propsMeta: WsComponentPropsMeta = {
|
|
34
|
+
props,
|
|
35
|
+
};
|
package/src/props.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export { propsMeta as Slot } from "./slot.ws";
|
|
2
|
+
export { propsMeta as Fragment } from "./fragment.ws";
|
|
3
|
+
export { propsMeta as HtmlEmbed } from "./html-embed.ws";
|
|
4
|
+
export { propsMeta as Body } from "./body.ws";
|
|
5
|
+
export { propsMeta as Box } from "./box.ws";
|
|
6
|
+
export { propsMeta as TextBlock } from "./text-block.ws";
|
|
7
|
+
export { propsMeta as Heading } from "./heading.ws";
|
|
8
|
+
export { propsMeta as Paragraph } from "./paragraph.ws";
|
|
9
|
+
export { propsMeta as Link } from "./link.ws";
|
|
10
|
+
export { propsMeta as LinkBlock } from "./link-block.ws";
|
|
11
|
+
export { propsMeta as RichTextLink } from "./rich-text-link.ws";
|
|
12
|
+
export { propsMeta as Span } from "./span.ws";
|
|
13
|
+
export { propsMeta as Bold } from "./bold.ws";
|
|
14
|
+
export { propsMeta as Italic } from "./italic.ws";
|
|
15
|
+
export { propsMeta as Superscript } from "./superscript.ws";
|
|
16
|
+
export { propsMeta as Subscript } from "./subscript.ws";
|
|
17
|
+
export { propsMeta as Button } from "./button.ws";
|
|
18
|
+
export { propsMeta as Input } from "./input.ws";
|
|
19
|
+
export { propsMeta as Form } from "./form.ws";
|
|
20
|
+
export { propsMeta as Image } from "./image.ws";
|
|
21
|
+
export { propsMeta as Blockquote } from "./blockquote.ws";
|
|
22
|
+
export { propsMeta as List } from "./list.ws";
|
|
23
|
+
export { propsMeta as ListItem } from "./list-item.ws";
|
|
24
|
+
export { propsMeta as Separator } from "./separator.ws";
|
|
25
|
+
export { propsMeta as CodeText } from "./code-text.ws";
|
|
26
|
+
export { propsMeta as Label } from "./label.ws";
|
|
27
|
+
export { propsMeta as SuccessMessage } from "./success-message.ws";
|
|
28
|
+
export { propsMeta as ErrorMessage } from "./error-message.ws";
|
|
29
|
+
export { propsMeta as Textarea } from "./textarea.ws";
|
|
30
|
+
export { propsMeta as RadioButtonField } from "./radio-button-field.ws";
|
|
31
|
+
export { propsMeta as RadioButton } from "./radio-button.ws";
|
|
32
|
+
export { propsMeta as CheckboxField } from "./checkbox-field.ws";
|
|
33
|
+
export { propsMeta as Checkbox } from "./checkbox.ws";
|
|
@@ -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,47 @@
|
|
|
1
|
+
import { RadioCheckedIcon } from "@webstudio-is/icons/svg";
|
|
2
|
+
import {
|
|
3
|
+
type WsComponentMeta,
|
|
4
|
+
type WsComponentPropsMeta,
|
|
5
|
+
type PresetStyle,
|
|
6
|
+
defaultStates,
|
|
7
|
+
} from "@webstudio-is/react-sdk";
|
|
8
|
+
import { props } from "./__generated__/radio-button-field.props";
|
|
9
|
+
import type { defaultTag } from "./radio-button-field";
|
|
10
|
+
import { label } from "@webstudio-is/react-sdk/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",
|
|
23
|
+
icon: RadioCheckedIcon,
|
|
24
|
+
states: defaultStates,
|
|
25
|
+
presetStyle,
|
|
26
|
+
template: [
|
|
27
|
+
{
|
|
28
|
+
type: "instance",
|
|
29
|
+
component: "RadioButtonField",
|
|
30
|
+
children: [
|
|
31
|
+
{ type: "instance", component: "RadioButton", props: [], children: [] },
|
|
32
|
+
{
|
|
33
|
+
type: "instance",
|
|
34
|
+
component: "TextBlock",
|
|
35
|
+
label: "Radio Label",
|
|
36
|
+
props: [],
|
|
37
|
+
children: [{ type: "text", value: "Radio" }],
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const propsMeta: WsComponentPropsMeta = {
|
|
45
|
+
props,
|
|
46
|
+
initialProps: [],
|
|
47
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { forwardRef, type ElementRef, type ComponentProps } from "react";
|
|
2
|
+
|
|
3
|
+
export const defaultTag = "input";
|
|
4
|
+
|
|
5
|
+
export const RadioButton = forwardRef<
|
|
6
|
+
ElementRef<typeof defaultTag>,
|
|
7
|
+
Omit<ComponentProps<typeof defaultTag>, "type">
|
|
8
|
+
// Make sure children are not passed down to an input, because this will result in error.
|
|
9
|
+
>(({ children: _children, ...props }, ref) => (
|
|
10
|
+
<input {...props} type="radio" ref={ref} />
|
|
11
|
+
));
|
|
12
|
+
|
|
13
|
+
RadioButton.displayName = "RadioButton";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { RadioCheckedIcon } from "@webstudio-is/icons/svg";
|
|
2
|
+
import {
|
|
3
|
+
type WsComponentMeta,
|
|
4
|
+
type WsComponentPropsMeta,
|
|
5
|
+
type PresetStyle,
|
|
6
|
+
defaultStates,
|
|
7
|
+
} from "@webstudio-is/react-sdk";
|
|
8
|
+
import type { defaultTag } from "./radio-button";
|
|
9
|
+
import { input } from "@webstudio-is/react-sdk/css-normalize";
|
|
10
|
+
import { props } from "./__generated__/radio-button.props";
|
|
11
|
+
|
|
12
|
+
const presetStyle = {
|
|
13
|
+
input: [
|
|
14
|
+
...input,
|
|
15
|
+
{
|
|
16
|
+
property: "marginRight",
|
|
17
|
+
value: { type: "unit", unit: "em", value: 0.5 },
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
} satisfies PresetStyle<typeof defaultTag>;
|
|
21
|
+
|
|
22
|
+
export const meta: WsComponentMeta = {
|
|
23
|
+
type: "control",
|
|
24
|
+
label: "Radio Input",
|
|
25
|
+
icon: RadioCheckedIcon,
|
|
26
|
+
presetStyle,
|
|
27
|
+
order: 5,
|
|
28
|
+
states: [
|
|
29
|
+
...defaultStates,
|
|
30
|
+
{ selector: ":checked", label: "Checked" },
|
|
31
|
+
{ selector: ":required", label: "Required" },
|
|
32
|
+
{ selector: ":optional", label: "Optional" },
|
|
33
|
+
{ selector: ":disabled", label: "Disabled" },
|
|
34
|
+
{ selector: ":enabled", label: "Enabled" },
|
|
35
|
+
{ selector: ":read-only", label: "Read Only" },
|
|
36
|
+
{ selector: ":read-write", label: "Read Write" },
|
|
37
|
+
],
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const propsMeta: WsComponentPropsMeta = {
|
|
41
|
+
props,
|
|
42
|
+
initialProps: ["name"],
|
|
43
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
2
|
+
import { RichTextLink as LinkPrimitive } from "./rich-text-link";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/RichTextLink",
|
|
6
|
+
component: LinkPrimitive,
|
|
7
|
+
} as ComponentMeta<typeof LinkPrimitive>;
|
|
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",
|
|
16
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
WsComponentMeta,
|
|
3
|
+
WsComponentPropsMeta,
|
|
4
|
+
} from "@webstudio-is/react-sdk";
|
|
5
|
+
import { props } from "./__generated__/rich-text-link.props";
|
|
6
|
+
import { meta as linkMeta, propsMeta as linkPropsMeta } from "./link.ws";
|
|
7
|
+
|
|
8
|
+
const { category, ...linkMetaRest } = linkMeta;
|
|
9
|
+
|
|
10
|
+
export const meta: WsComponentMeta = {
|
|
11
|
+
...linkMetaRest,
|
|
12
|
+
type: "rich-text-child",
|
|
13
|
+
template: [],
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const propsMeta: WsComponentPropsMeta = {
|
|
17
|
+
initialProps: linkPropsMeta.initialProps,
|
|
18
|
+
props: {
|
|
19
|
+
...props,
|
|
20
|
+
href: linkPropsMeta.props.href,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
2
|
+
import { Separator as SeparatorPrimitive } from "./separator";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/Separator",
|
|
6
|
+
component: SeparatorPrimitive,
|
|
7
|
+
} as ComponentMeta<typeof SeparatorPrimitive>;
|
|
8
|
+
|
|
9
|
+
const Template: ComponentStory<typeof SeparatorPrimitive> = (args) => (
|
|
10
|
+
<SeparatorPrimitive {...args} />
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export const Separator = Template.bind({});
|
|
14
|
+
Separator.args = {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
forwardRef,
|
|
3
|
+
createElement,
|
|
4
|
+
type ElementRef,
|
|
5
|
+
type ComponentProps,
|
|
6
|
+
} from "react";
|
|
7
|
+
|
|
8
|
+
export const defaultTag = "hr";
|
|
9
|
+
|
|
10
|
+
type Props = ComponentProps<typeof defaultTag>;
|
|
11
|
+
|
|
12
|
+
export const Separator = forwardRef<ElementRef<typeof defaultTag>, Props>(
|
|
13
|
+
(props, ref) => {
|
|
14
|
+
return createElement(defaultTag, { ...props, ref });
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
Separator.displayName = "Separator";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { DashIcon } from "@webstudio-is/icons/svg";
|
|
2
|
+
import {
|
|
3
|
+
defaultStates,
|
|
4
|
+
type PresetStyle,
|
|
5
|
+
type WsComponentMeta,
|
|
6
|
+
type WsComponentPropsMeta,
|
|
7
|
+
} from "@webstudio-is/react-sdk";
|
|
8
|
+
import { hr } from "@webstudio-is/react-sdk/css-normalize";
|
|
9
|
+
import { props } from "./__generated__/separator.props";
|
|
10
|
+
import type { defaultTag } from "./separator";
|
|
11
|
+
|
|
12
|
+
const presetStyle = {
|
|
13
|
+
hr: [
|
|
14
|
+
...hr,
|
|
15
|
+
|
|
16
|
+
{
|
|
17
|
+
property: "height",
|
|
18
|
+
value: { type: "keyword", value: "1px" },
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
property: "backgroundColor",
|
|
22
|
+
value: { type: "keyword", value: "gray" },
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
property: "borderTopStyle",
|
|
26
|
+
value: { type: "keyword", value: "none" },
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
property: "borderRightStyle",
|
|
30
|
+
value: { type: "keyword", value: "none" },
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
property: "borderLeftStyle",
|
|
34
|
+
value: { type: "keyword", value: "none" },
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
property: "borderBottomStyle",
|
|
38
|
+
value: { type: "keyword", value: "none" },
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
} satisfies PresetStyle<typeof defaultTag>;
|
|
42
|
+
|
|
43
|
+
export const meta: WsComponentMeta = {
|
|
44
|
+
category: "general",
|
|
45
|
+
type: "embed",
|
|
46
|
+
label: "Separator",
|
|
47
|
+
icon: DashIcon,
|
|
48
|
+
states: defaultStates,
|
|
49
|
+
presetStyle,
|
|
50
|
+
order: 5,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const propsMeta: WsComponentPropsMeta = {
|
|
54
|
+
props,
|
|
55
|
+
initialProps: [],
|
|
56
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
2
|
+
import { Slot as SlotPrimitive } from "./slot";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/Slot",
|
|
6
|
+
component: SlotPrimitive,
|
|
7
|
+
} as ComponentMeta<typeof SlotPrimitive>;
|
|
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",
|
|
16
|
+
};
|
package/src/slot.tsx
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { forwardRef, type ElementRef, type ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
type Props = {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
export const Slot = forwardRef<ElementRef<"div">, Props>((props, ref) => {
|
|
8
|
+
return (
|
|
9
|
+
<div
|
|
10
|
+
{...props}
|
|
11
|
+
ref={ref}
|
|
12
|
+
style={{ display: props.children ? "contents" : "block" }}
|
|
13
|
+
/>
|
|
14
|
+
);
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
Slot.displayName = "Slot";
|