@spothero/ui 14.3.3 → 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 CHANGED
@@ -1,3 +1,18 @@
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
+
11
+ # 14.3.4-beta.0 - 04/11/2022
12
+
13
+ ## Miscellaneous Updates
14
+ * [[016347f](https://github.com/spothero/fe-ui/commit/016347f)] - `fix:` Use relative path for Button inorder to fix build issue in consumer (Gru Singh)
15
+
1
16
  # 14.3.3 - 04/07/2022
2
17
 
3
18
  ## Miscellaneous Updates
package/CHANGELOG.tmp CHANGED
@@ -1,6 +1,10 @@
1
- # 14.3.3 - 04/07/2022
1
+ # 14.3.4-beta.1 - 04/11/2022
2
2
 
3
3
  ## Miscellaneous Updates
4
- * [[8511f03](https://github.com/spothero/fe-ui/commit/8511f03)] - `refactor:` Add controls to checkbox stories ([#279](https://github.com/spothero/fe-ui/pull/279)) (annaliarosed)
5
- * `refactor:` Add controls to checkbox stories
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>
6
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spothero/ui",
3
- "version": "14.3.3",
3
+ "version": "14.3.4-beta.1",
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,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 Button from 'v2/components/Button/Button';
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,