@spothero/ui 14.3.4-beta.0 → 14.3.4

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 CHANGED
@@ -1,7 +1,4 @@
1
- # 14.3.4-beta.0 - 04/11/2022
2
-
3
- ## Miscellaneous Updates
4
- * [[016347f](https://github.com/spothero/fe-ui/commit/016347f)] - `fix:` Use relative path for Button inorder to fix build issue in consumer (Gru Singh)
1
+ # 14.3.4 - 04/11/2022
5
2
 
6
3
  # 14.3.3 - 04/07/2022
7
4
 
package/CHANGELOG.tmp CHANGED
@@ -1,5 +1,2 @@
1
- # 14.3.4-beta.0 - 04/11/2022
2
-
3
- ## Miscellaneous Updates
4
- * [[016347f](https://github.com/spothero/fe-ui/commit/016347f)] - `fix:` Use relative path for Button inorder to fix build issue in consumer (Gru Singh)
1
+ # 14.3.4 - 04/11/2022
5
2
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spothero/ui",
3
- "version": "14.3.4-beta.0",
3
+ "version": "14.3.4",
4
4
  "description": "SpotHero's React component UI library.",
5
5
  "main": "v2/index-bundled.cjs.js",
6
6
  "module": "v2/index.js",
@@ -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.string,
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 Template = args => {
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 = (breakpoint || '').includes('mobile');
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
- <Component h="20" color="white" bg="secondary.default">
28
- {headingText && <Heading as="h1">{headingText}</Heading>}
29
- </Component>
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 = Template.bind({});
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,7 +4,7 @@ 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 {Button} from '../Button';
7
+ import Button from 'v2/components/Button/Button';
8
8
 
9
9
  const ImageCarousel = ({images, width, height, ...props}) => {
10
10
  const imgWidth = width ? `${width}rem` : '100%';