@faststore/ui 1.8.46 → 1.8.52
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 +33 -0
- package/dist/index.d.ts +2 -0
- package/dist/organisms/Hero/Hero.d.ts +11 -0
- package/dist/organisms/Hero/HeroHeading.d.ts +10 -0
- package/dist/organisms/Hero/HeroImage.d.ts +10 -0
- package/dist/organisms/Hero/index.d.ts +6 -0
- package/dist/organisms/Hero/stories/Hero.stories.d.ts +4 -0
- package/dist/organisms/OutOfStock/OutOfStockMessage.d.ts +1 -1
- package/dist/organisms/OutOfStock/OutOfStockTitle.d.ts +1 -1
- package/dist/ui.cjs.development.js +47 -6
- package/dist/ui.cjs.development.js.map +1 -1
- package/dist/ui.cjs.production.min.js +1 -1
- package/dist/ui.cjs.production.min.js.map +1 -1
- package/dist/ui.esm.js +45 -7
- package/dist/ui.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/index.ts +7 -0
- package/src/organisms/Hero/Hero.test.tsx +60 -0
- package/src/organisms/Hero/Hero.tsx +23 -0
- package/src/organisms/Hero/HeroHeading.tsx +24 -0
- package/src/organisms/Hero/HeroImage.tsx +22 -0
- package/src/organisms/Hero/index.tsx +8 -0
- package/src/organisms/Hero/stories/Hero.mdx +48 -0
- package/src/organisms/Hero/stories/Hero.stories.tsx +56 -0
- package/src/organisms/OutOfStock/OutOfStockMessage.tsx +6 -1
- package/src/organisms/OutOfStock/OutOfStockTitle.tsx +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,39 @@
|
|
|
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.8.52](https://github.com/vtex/faststore/compare/v1.8.51...v1.8.52) (2022-06-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **ui:** Fix OutOfStock nested components ([#1341](https://github.com/vtex/faststore/issues/1341)) ([0bd85a6](https://github.com/vtex/faststore/commit/0bd85a6bd334c014559eced5a617a1476bfd8171))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 1.8.51 (2022-06-03)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **UI:** Add Hero component ([#1336](https://github.com/vtex/faststore/issues/1336)) ([767c0cd](https://github.com/vtex/faststore/commit/767c0cdc5eaf6bd56020d64fd7718b1379c09390))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## 1.8.49 (2022-05-31)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* remove docs from build on codesandbox ([#1334](https://github.com/vtex/faststore/issues/1334)) ([c9eabde](https://github.com/vtex/faststore/commit/c9eabdea8d951d42a9b3898572719e1f45294b33))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
6
39
|
## 1.8.46 (2022-05-30)
|
|
7
40
|
|
|
8
41
|
|
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;
|