@faststore/ui 1.8.49 → 1.9.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
@@ -3,6 +3,36 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 1.9.1 (2022-06-09)
7
+
8
+ **Note:** Version bump only for package @faststore/ui
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.8.52](https://github.com/vtex/faststore/compare/v1.8.51...v1.8.52) (2022-06-03)
15
+
16
+
17
+ ### Features
18
+
19
+ * **ui:** Fix OutOfStock nested components ([#1341](https://github.com/vtex/faststore/issues/1341)) ([0bd85a6](https://github.com/vtex/faststore/commit/0bd85a6bd334c014559eced5a617a1476bfd8171))
20
+
21
+
22
+
23
+
24
+
25
+ ## 1.8.51 (2022-06-03)
26
+
27
+
28
+ ### Features
29
+
30
+ * **UI:** Add Hero component ([#1336](https://github.com/vtex/faststore/issues/1336)) ([767c0cd](https://github.com/vtex/faststore/commit/767c0cdc5eaf6bd56020d64fd7718b1379c09390))
31
+
32
+
33
+
34
+
35
+
6
36
  ## 1.8.49 (2022-05-31)
7
37
 
8
38
 
package/dist/index.d.ts CHANGED
@@ -74,5 +74,7 @@ export { default as Dropdown, DropdownButton, DropdownItem, DropdownMenu, } from
74
74
  export type { DropdownProps, DropdownButtonProps, DropdownItemProps, DropdownMenuProps, } from './molecules/Dropdown';
75
75
  export { default as OutOfStock, OutOfStockTitle, OutOfStockMessage, } from './organisms/OutOfStock';
76
76
  export type { OutOfStockProps, OutOfStockMessageProps, OutOfStockTitleProps, } from './organisms/OutOfStock';
77
+ export { default as Hero, HeroHeading, HeroImage } from './organisms/Hero';
78
+ export type { HeroProps, HeroHeadingProps, HeroImageProps, } from './organisms/Hero';
77
79
  export { default as useSlider } from './hooks/useSlider';
78
80
  export type { UseSliderArgs, SliderState, SliderDispatch, SlideDirection, } from './hooks/useSlider';
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import type { HTMLAttributes } from 'react';
3
+ export interface HeroProps extends HTMLAttributes<HTMLDivElement> {
4
+ /**
5
+ * ID to find this component in testing tools (e.g.: cypress,
6
+ * testing-library, and jest).
7
+ */
8
+ testId?: string;
9
+ }
10
+ declare const Hero: React.ForwardRefExoticComponent<HeroProps & React.RefAttributes<HTMLDivElement>>;
11
+ export default Hero;
@@ -0,0 +1,10 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ import React from 'react';
3
+ export interface HeroHeadingProps extends HTMLAttributes<HTMLDivElement> {
4
+ /**
5
+ * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
6
+ */
7
+ testId?: string;
8
+ }
9
+ declare const HeroHeading: React.ForwardRefExoticComponent<HeroHeadingProps & React.RefAttributes<HTMLDivElement>>;
10
+ export default HeroHeading;
@@ -0,0 +1,10 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ import React from 'react';
3
+ export interface HeroImageProps extends HTMLAttributes<HTMLDivElement> {
4
+ /**
5
+ * ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
6
+ */
7
+ testId?: string;
8
+ }
9
+ declare const HeroImage: React.ForwardRefExoticComponent<HeroImageProps & React.RefAttributes<HTMLDivElement>>;
10
+ export default HeroImage;
@@ -0,0 +1,6 @@
1
+ export { default } from './Hero';
2
+ export type { HeroProps } from './Hero';
3
+ export { default as HeroImage } from './HeroImage';
4
+ export type { HeroImageProps } from './HeroImage';
5
+ export { default as HeroHeading } from './HeroHeading';
6
+ export type { HeroHeadingProps } from './HeroHeading';
@@ -0,0 +1,4 @@
1
+ import type { HeroProps } from '../Hero';
2
+ export declare const Hero: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, HeroProps>;
3
+ declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, import("@storybook/react").Args>;
4
+ export default _default;
@@ -6,4 +6,4 @@ export declare type OutOfStockMessageProps = {
6
6
  */
7
7
  as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'div' | 'span';
8
8
  } & OutOfStockBaseProps;
9
- export declare const OutOfStockMessage: ({ as: MessageComponent, testId, children, }: OutOfStockMessageProps) => JSX.Element;
9
+ export declare const OutOfStockMessage: ({ as: MessageComponent, testId, children, ...otherProps }: OutOfStockMessageProps) => JSX.Element;
@@ -6,4 +6,4 @@ export declare type OutOfStockTitleProps = {
6
6
  */
7
7
  as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p';
8
8
  } & OutOfStockBaseProps;
9
- export declare const OutOfStockTitle: ({ as: TitleComponent, testId, children, }: OutOfStockTitleProps) => JSX.Element;
9
+ export declare const OutOfStockTitle: ({ as: TitleComponent, testId, children, ...otherProps }: OutOfStockTitleProps) => JSX.Element;
@@ -1984,25 +1984,63 @@ const OutOfStock = ({
1984
1984
  const OutOfStockMessage = ({
1985
1985
  as: MessageComponent = 'p',
1986
1986
  testId = 'store-out-of-stock-message',
1987
- children
1987
+ children,
1988
+ ...otherProps
1988
1989
  }) => {
1989
- return React__default.createElement(MessageComponent, {
1990
+ return React__default.createElement(MessageComponent, Object.assign({
1990
1991
  "data-out-of-stock-message": true,
1991
1992
  "data-testid": testId
1992
- }, children);
1993
+ }, otherProps), children);
1993
1994
  };
1994
1995
 
1995
1996
  const OutOfStockTitle = ({
1996
1997
  as: TitleComponent = 'h2',
1997
1998
  testId = 'store-out-of-stock-title',
1998
- children
1999
+ children,
2000
+ ...otherProps
1999
2001
  }) => {
2000
- return React__default.createElement(TitleComponent, {
2002
+ return React__default.createElement(TitleComponent, Object.assign({
2001
2003
  "data-out-of-stock-title": true,
2002
2004
  "data-testid": testId
2003
- }, children);
2005
+ }, otherProps), children);
2004
2006
  };
2005
2007
 
2008
+ const Hero = /*#__PURE__*/React.forwardRef(function Hero({
2009
+ testId = 'store-hero',
2010
+ children,
2011
+ ...otherProps
2012
+ }, ref) {
2013
+ return React__default.createElement("article", Object.assign({
2014
+ ref: ref,
2015
+ "data-store-hero": true,
2016
+ "data-testid": testId
2017
+ }, otherProps), children);
2018
+ });
2019
+
2020
+ const HeroImage = /*#__PURE__*/React.forwardRef(function HeroImage({
2021
+ testId = 'store-hero-image',
2022
+ children,
2023
+ ...otherProps
2024
+ }, ref) {
2025
+ return React__default.createElement("div", Object.assign({
2026
+ ref: ref,
2027
+ "data-hero-image": true,
2028
+ "data-testid": testId
2029
+ }, otherProps), children);
2030
+ });
2031
+
2032
+ const HeroHeading = /*#__PURE__*/React.forwardRef(function HeroHeading({
2033
+ testId = 'store-hero-heading',
2034
+ children,
2035
+ ...otherProps
2036
+ }, ref) {
2037
+ return React__default.createElement("header", Object.assign({
2038
+ ref: ref,
2039
+ "data-hero-heading": true,
2040
+ "data-testid": testId
2041
+ }, otherProps), children);
2042
+ });
2043
+
2006
2044
  exports.Accordion = Accordion;
2007
2045
  exports.AccordionButton = AccordionButton;
2008
2046
  exports.AccordionItem = AccordionItem;
@@ -2027,6 +2065,9 @@ exports.DropdownButton = DropdownButton;
2027
2065
  exports.DropdownItem = DropdownItem;
2028
2066
  exports.DropdownMenu = DropdownMenu;
2029
2067
  exports.Form = Form;
2068
+ exports.Hero = Hero;
2069
+ exports.HeroHeading = HeroHeading;
2070
+ exports.HeroImage = HeroImage;
2030
2071
  exports.Icon = Icon;
2031
2072
  exports.IconButton = IconButton;
2032
2073
  exports.Incentive = Incentive;