diff --git a/package-lock.json b/package-lock.json
index d4f55677..04e446c4 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -3318,12 +3318,12 @@
}
},
"@quarkly/components": {
- "version": "0.2.50",
- "resolved": "https://registry.npmjs.org/@quarkly/components/-/components-0.2.50.tgz",
- "integrity": "sha512-BqwjUvgZKLm40LwjsXrVm6A0ItI3u0F/jsWzQ3MHjKX3vtNOivHDpMjcxk/IHBdWUefyCsnB7FrY3eDslOT3fg==",
+ "version": "0.2.68",
+ "resolved": "https://registry.npmjs.org/@quarkly/components/-/components-0.2.68.tgz",
+ "integrity": "sha512-o/IomgsEaISr1P6EdCDsUZFMSo8FLR4PTbsbxz4j9yRUdse1ZoW3/a4pIFtOoZrcas73PpD3glYQ+BohoP4dKw==",
"dev": true,
"requires": {
- "@quarkly/widgets": "^0.2.50",
+ "@quarkly/widgets": "^0.2.68",
"@reach/router": "^1.3.4"
}
},
diff --git a/package.json b/package.json
index 647bf76b..d0756393 100644
--- a/package.json
+++ b/package.json
@@ -29,7 +29,7 @@
"@babel/preset-env": "^7.14.2",
"@babel/preset-react": "^7.13.13",
"@quarkly/atomize": "^1.0.8",
- "@quarkly/components": "^0.2.50",
+ "@quarkly/components": "^0.2.68",
"@quarkly/sdk": "^0.5.4",
"@quarkly/theme": "^0.1.3",
"@quarkly/widgets": "^0.2.68",
diff --git a/preview/docs/Picture.md b/preview/docs/Picture.md
index c9aa2670..99eb678e 100644
--- a/preview/docs/Picture.md
+++ b/preview/docs/Picture.md
@@ -4,7 +4,7 @@ This container component provides an optimized image version for different scree
## ⚙️ Usage
-Add the component to the page, than add an Image and/or Source components (optionally) to it, and see how it works in the preview mode.
+Add the component to the page, than add an Source components (optionally) to it, and see how it works in the preview mode.
## 🗓 Changelog
diff --git a/preview/docs/Vimeo.md b/preview/docs/Vimeo.md
index db998bfa..5c2bb196 100644
--- a/preview/docs/Vimeo.md
+++ b/preview/docs/Vimeo.md
@@ -8,6 +8,12 @@ Use this component to add the Vimeo video player.
2. Specify the `Video link or ID` on the Props panel
3. See how it works in the preview mode
+### Setting up the video player
+
+Some video player settings are supported for Plus or PRO accounts.
+
+Learn more: [Supported Player Parameters](https://help.vimeo.com/hc/en-us/articles/360001494447-Using-Player-Parameters#h_01FNYA7F7GKWE17XDQJPMBC058)
+
### Playing in the background
If the `Play in the background` prop is enabled, the video will be played in the background. In this case, all the controls are hidden, automatic playback is enabled, and the video loops.
diff --git a/preview/docs/ru/Picture.md b/preview/docs/ru/Picture.md
index eaa5e011..075a011b 100644
--- a/preview/docs/ru/Picture.md
+++ b/preview/docs/ru/Picture.md
@@ -4,7 +4,7 @@
## ⚙️ Использование
-Добавьте компонент на страницу, поместите в него компоненты `Image` и `Source` (опционально), затем посмотрите как он работает в режиме превью.
+Добавьте компонент на страницу, поместите в него компоненты `Source` (опционально), затем посмотрите как он работает в режиме превью.
## 🗓 Changelog
diff --git a/src/BeforeAfterImage.js b/src/BeforeAfterImage.js
index 0baf825c..ddd46b6f 100644
--- a/src/BeforeAfterImage.js
+++ b/src/BeforeAfterImage.js
@@ -210,7 +210,11 @@ const BeforeAfterImage = ({
}}
>
-
+
-
+
+
- {children}
+
+ {children}
+ {!imageURL && (
+
+ )}
+
);
};
diff --git a/src/CardFlip/CardFlip.js b/src/CardFlip/CardFlip.js
index 1e34489d..04a1a650 100644
--- a/src/CardFlip/CardFlip.js
+++ b/src/CardFlip/CardFlip.js
@@ -1,7 +1,7 @@
-import React, { useCallback, useState, useEffect } from 'react';
+import React, { useCallback, useState, useEffect, useRef } from 'react';
import { useOverrides } from '@quarkly/components';
-import { Box, Image } from '@quarkly/widgets';
-import { parseTime } from '../utils';
+import { Box, Placeholder } from '@quarkly/widgets';
+import { isEmptyChildren, parseTime } from '../utils';
const overrides = {
'Card Flip Content': {
@@ -37,17 +37,6 @@ const overrides = {
position: 'absolute',
},
},
- 'Card Flip Item Face': {
- kind: 'Box',
- },
- 'Card Flip Item Back': {
- kind: 'Box',
- props: {
- padding: '24px 16px',
- background: '--color-lightD2',
- 'box-sizing': 'border-box',
- },
- },
};
const flipStyles = {
@@ -83,26 +72,50 @@ const CardFlip = ({
isFlippedProp,
...props
}) => {
- const { override, children, rest } = useOverrides(props, overrides);
+ const { override, ChildPlaceholder, rest } = useOverrides(props, overrides);
const [isFlipped, setFlipped] = useState(isFlippedProp);
+ const [isFlipEnd, setFlipEnd] = useState(true);
const flipTrigger = flipTriggerProp === 'click';
const flipDuration = parseTime(flipDurationProp);
const onClickFlip = useCallback(() => {
- if (flipTrigger) setFlipped((prevFlipped) => !prevFlipped);
+ if (flipTrigger) {
+ setFlipped((prevFlipped) => !prevFlipped);
+ setFlipEnd(false);
+ }
}, [flipTrigger]);
const onHoverFlip = useCallback(() => {
- if (!flipTrigger) setFlipped((prevFlipped) => !prevFlipped);
+ if (!flipTrigger) {
+ setFlipped((prevFlipped) => !prevFlipped);
+ setFlipEnd(false);
+ }
}, [flipTrigger]);
useEffect(() => {
setFlipped(isFlippedProp);
}, [isFlippedProp]);
+ const boxRef = useRef();
+
+ useEffect(() => {
+ if (!boxRef.current) return;
+ const box = boxRef.current;
+
+ const handle = () => {
+ setFlipEnd(true);
+ };
+
+ box.addEventListener('transitionend', handle);
+
+ return () => {
+ box.removeEventListener('transitionend', handle);
+ };
+ }, []);
+
return (
-
-
+
+
+ {isEmptyChildren(
+ override('Card Flip Item Face').children
+ ) && }
- {children}
+
+ {isEmptyChildren(
+ override('Card Flip Item Back').children
+ ) && }
diff --git a/src/Collapse/Collapse.js b/src/Collapse/Collapse.js
index f3503196..2b6f5f05 100644
--- a/src/Collapse/Collapse.js
+++ b/src/Collapse/Collapse.js
@@ -96,6 +96,10 @@ const Collapse = ({
ref.current.addEventListener('transitionend', handle);
}, [animFunction, collapsedHeight, destination, duration, handle, mode]);
+ const buttonOveride = `Button ${
+ isOpen !== isCollapsing ? ':open' : ':close'
+ }`;
+
return (
-
+
{
Create a form on{' '}
- {
href="https://formspree.io/"
>
formspree.io
- {' '}
+ {' '}
and fill in the endpoint field on the{' '}
props panel
diff --git a/src/Lottie/Lottie.js b/src/Lottie/Lottie.js
index a9405dbe..230a8692 100644
--- a/src/Lottie/Lottie.js
+++ b/src/Lottie/Lottie.js
@@ -96,7 +96,6 @@ const Lottie = ({
return (
{
);
return (
-
+
{!url ? (
) : (
@@ -70,7 +70,10 @@ const MailChimp = ({ url, ...props }) => {
>
{children}
{isEmptyChildren(children) && (
-
+
)}
)}
diff --git a/src/NetlifyForm/NetlifyForm.js b/src/NetlifyForm/NetlifyForm.js
index 197ced2a..f71bb0c7 100644
--- a/src/NetlifyForm/NetlifyForm.js
+++ b/src/NetlifyForm/NetlifyForm.js
@@ -4,6 +4,8 @@ import { Box, Text, Input } from '@quarkly/widgets';
import { useOverrides } from '@quarkly/components';
import { overrides, propInfo, defaultProps } from './props';
import { useForm, withForm } from '../Form/context';
+import ComponentNotice from '../ComponentNotice';
+import { isEmptyChildren } from '../utils';
const Form = atomize.form();
@@ -66,6 +68,9 @@ const NetlifyForm = ({ formName, successMessage, errorMessage, ...props }) => {
defaultValue={formName}
/>
{children}
+ {isEmptyChildren(children) && (
+
+ )}
{error && (
{errorMessage}
diff --git a/src/Picture.js b/src/Picture.js
index c1e5c04d..7f0fd152 100644
--- a/src/Picture.js
+++ b/src/Picture.js
@@ -1,55 +1,43 @@
-import React, { useState, useEffect, useRef } from 'react';
+import React from 'react';
import atomize from '@quarkly/atomize';
import { useOverrides } from '@quarkly/components';
-
-import ComponentNotice from './ComponentNotice';
+import { Image } from '@quarkly/widgets';
const overrides = {
'Picture Tag': {
kind: 'Picture Tag',
props: {
- width: '100%',
- height: 'auto',
+ display: 'inline-block',
+ },
+ },
+ Image: {
+ kind: 'Image',
+ props: {
+ src:
+ 'https://images.unsplash.com/photo-1454496522488-7a8e488e8606?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&w=200',
},
},
};
const Picture = atomize.picture();
const Wrapper = atomize.div();
-const Content = atomize.div();
-const PictureComponent = ({ children, ...props }) => {
- const { override, rest } = useOverrides(props, overrides);
-
- const [isEmpty, setEmpty] = useState(false);
- const contentRef = useRef(null);
-
- useEffect(() => {
- setEmpty(contentRef.current?.innerHTML === '');
- }, [children]);
+const PictureComponent = (props) => {
+ const { override, children, rest } = useOverrides(props, overrides);
return (
-
-
-
- {React.Children.map(
- children,
- (child) =>
- React.isValidElement(child) &&
- React.cloneElement(child, {
- container: 'picture',
- })
- )}
-
+
+
+ {React.Children.map(
+ children,
+ (child) =>
+ React.isValidElement(child) &&
+ React.cloneElement(child, {
+ container: 'picture',
+ })
+ )}
+
-
- {isEmpty && (
-
- )}
);
};
@@ -62,4 +50,5 @@ export default atomize(PictureComponent)({
ru:
'Контейнер для обеспечения оптимальной версии изображения для различных размеров экрана',
},
+ overrides,
});
diff --git a/src/Source.js b/src/Source.js
index 809de3fc..f249a1be 100644
--- a/src/Source.js
+++ b/src/Source.js
@@ -34,8 +34,8 @@ const SourceComponent = ({
src={src}
srcSet={srcSet}
type={type}
- media={container !== 'picture' ? mediaInput || mediaSelect : ''}
- sizes={container !== 'picture' ? sizes : ''}
+ media={container === 'picture' ? mediaInput || mediaSelect : ''}
+ sizes={container === 'picture' ? sizes : ''}
/>
) : (