@spothero/ui 14.3.4-beta.0 → 14.3.4-beta.1
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/CHANGELOG.md +10 -0
- package/CHANGELOG.tmp +7 -2
- package/package.json +1 -1
- package/styles/v2/components/Checkbox/Checkbox.stories.js +2 -4
- package/styles/v2/components/Container/Container.stories.js +29 -10
- package/styles/v2/components/ImageCarousel/ImageCarousel.jsx +2 -1
- package/v2/index-bundled.cjs.js +1 -1
- package/v2/index-bundled.cjs.js.map +1 -1
- package/v2/index-bundled.esm.js +1 -1
- package/v2/index-bundled.esm.js.map +1 -1
- package/v2/index-unbundled.cjs.js +3 -2
- package/v2/index-unbundled.cjs.js.map +1 -1
- package/v2/index-unbundled.esm.js +3 -2
- package/v2/index-unbundled.esm.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
# 14.3.4-beta.1 - 04/11/2022
|
|
2
|
+
|
|
3
|
+
## Miscellaneous Updates
|
|
4
|
+
* [[629fd70](https://github.com/spothero/fe-ui/commit/629fd70)] - `fix:` Try passing Button as prop (Gru Singh)
|
|
5
|
+
* [[18ee171](https://github.com/spothero/fe-ui/commit/18ee171)] - `refactor:` Add controls to container stories ([#280](https://github.com/spothero/fe-ui/pull/280)) (annaliarosed)
|
|
6
|
+
* `refactor:` Add controls to Container stories
|
|
7
|
+
* `refactor:` Extract all colors to utils
|
|
8
|
+
* `refactor:` Extract get all sizes to utils and use it in container stories
|
|
9
|
+
* `fix:` Remove unused importsCo-authored-by: Annalia Destefano <annalia.destefano@spothero.com>
|
|
10
|
+
|
|
1
11
|
# 14.3.4-beta.0 - 04/11/2022
|
|
2
12
|
|
|
3
13
|
## Miscellaneous Updates
|
package/CHANGELOG.tmp
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
# 14.3.4-beta.
|
|
1
|
+
# 14.3.4-beta.1 - 04/11/2022
|
|
2
2
|
|
|
3
3
|
## Miscellaneous Updates
|
|
4
|
-
* [[
|
|
4
|
+
* [[629fd70](https://github.com/spothero/fe-ui/commit/629fd70)] - `fix:` Try passing Button as prop (Gru Singh)
|
|
5
|
+
* [[18ee171](https://github.com/spothero/fe-ui/commit/18ee171)] - `refactor:` Add controls to container stories ([#280](https://github.com/spothero/fe-ui/pull/280)) (annaliarosed)
|
|
6
|
+
* `refactor:` Add controls to Container stories
|
|
7
|
+
* `refactor:` Extract all colors to utils
|
|
8
|
+
* `refactor:` Extract get all sizes to utils and use it in container stories
|
|
9
|
+
* `fix:` Remove unused importsCo-authored-by: Annalia Destefano <annalia.destefano@spothero.com>
|
|
5
10
|
|
package/package.json
CHANGED
|
@@ -11,16 +11,14 @@ export default {
|
|
|
11
11
|
},
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
const CheckboxTemplate = props => {
|
|
15
|
-
return <Component {...props} />;
|
|
16
|
-
};
|
|
14
|
+
const CheckboxTemplate = props => <Component {...props} />;
|
|
17
15
|
|
|
18
16
|
CheckboxTemplate.propTypes = {
|
|
19
17
|
isChecked: PropTypes.bool,
|
|
20
18
|
isDisabled: PropTypes.bool,
|
|
21
19
|
isIndeterminate: PropTypes.bool,
|
|
22
20
|
defaultIsChecked: PropTypes.bool,
|
|
23
|
-
size: PropTypes.
|
|
21
|
+
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
24
22
|
children: PropTypes.node,
|
|
25
23
|
};
|
|
26
24
|
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Component from './Container';
|
|
3
3
|
import {useTheme, useToken, useBreakpointValue} from '@chakra-ui/react';
|
|
4
|
+
import {createSelectControl} from 'storybook/utils/create-control';
|
|
5
|
+
import {getAllColors} from 'storybook/utils/get-all-colors';
|
|
6
|
+
import {getAllSizes} from 'storybook/utils/get-all-sizes';
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
4
8
|
|
|
5
9
|
import styleProps from './Container.styles';
|
|
6
10
|
|
|
7
|
-
import Heading from 'v2/components/Heading/Heading';
|
|
8
|
-
|
|
9
11
|
export default {
|
|
10
12
|
title: 'v2/Container',
|
|
11
13
|
component: Component,
|
|
@@ -14,20 +16,37 @@ export default {
|
|
|
14
16
|
},
|
|
15
17
|
};
|
|
16
18
|
|
|
17
|
-
const
|
|
19
|
+
const ContainerTemplate = props => {
|
|
18
20
|
const {remToPixels} = useTheme();
|
|
19
21
|
const breakpoint = useBreakpointValue(styleProps.maxW);
|
|
20
22
|
const size = useToken('sizes', breakpoint);
|
|
21
|
-
const isMobile =
|
|
23
|
+
const isMobile = breakpoint?.includes('base');
|
|
22
24
|
const headingText = size
|
|
23
25
|
? `Container: ${size}${isMobile ? '' : ` - ${remToPixels(size)}px`}`
|
|
24
26
|
: '';
|
|
25
27
|
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
)
|
|
28
|
+
return <Component {...props}>{headingText}</Component>;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
ContainerTemplate.propTypes = {
|
|
32
|
+
color: PropTypes.oneOf(getAllColors),
|
|
33
|
+
bg: PropTypes.oneOf(getAllColors),
|
|
34
|
+
h: PropTypes.oneOf(getAllSizes),
|
|
35
|
+
centerContent: PropTypes.bool,
|
|
36
|
+
children: PropTypes.node,
|
|
31
37
|
};
|
|
32
38
|
|
|
33
|
-
export const Container =
|
|
39
|
+
export const Container = ContainerTemplate.bind({});
|
|
40
|
+
|
|
41
|
+
Container.argTypes = {
|
|
42
|
+
...createSelectControl('color', getAllColors),
|
|
43
|
+
...createSelectControl('bg', getAllColors),
|
|
44
|
+
...createSelectControl('h', getAllSizes),
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
Container.args = {
|
|
48
|
+
color: 'white',
|
|
49
|
+
bg: 'secondary.default',
|
|
50
|
+
h: '20',
|
|
51
|
+
centerContent: true,
|
|
52
|
+
};
|
|
@@ -4,11 +4,12 @@ import {Box} from '@chakra-ui/react';
|
|
|
4
4
|
import useEmblaCarousel from 'embla-carousel-react';
|
|
5
5
|
import IconChevronLeft from '@spothero/icons/chevron-left';
|
|
6
6
|
import IconChevronRight from '@spothero/icons/chevron-right';
|
|
7
|
-
import
|
|
7
|
+
import V2Button from 'v2/components/Button/Button';
|
|
8
8
|
|
|
9
9
|
const ImageCarousel = ({images, width, height, ...props}) => {
|
|
10
10
|
const imgWidth = width ? `${width}rem` : '100%';
|
|
11
11
|
const imgHeight = `${height}rem`;
|
|
12
|
+
const Button = props.Button || V2Button;
|
|
12
13
|
|
|
13
14
|
const [viewportRef, embla] = useEmblaCarousel({
|
|
14
15
|
skipSnaps: false,
|