@faststore/ui 1.8.34 → 1.8.37
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/OutOfStock/OutOfStock.d.ts +21 -0
- package/dist/organisms/OutOfStock/OutOfStockMessage.d.ts +9 -0
- package/dist/organisms/OutOfStock/OutOfStockTitle.d.ts +9 -0
- package/dist/organisms/OutOfStock/index.d.ts +6 -0
- package/dist/organisms/OutOfStock/stories/OutOfStock.stories.d.ts +10 -0
- package/dist/ui.cjs.development.js +39 -0
- 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 +37 -1
- package/dist/ui.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +10 -0
- package/src/organisms/OutOfStock/OutOfStock.test.tsx +122 -0
- package/src/organisms/OutOfStock/OutOfStock.tsx +39 -0
- package/src/organisms/OutOfStock/OutOfStockMessage.tsx +22 -0
- package/src/organisms/OutOfStock/OutOfStockTitle.tsx +22 -0
- package/src/organisms/OutOfStock/index.tsx +6 -0
- package/src/organisms/OutOfStock/stories/OutOfStock.mdx +37 -0
- package/src/organisms/OutOfStock/stories/OutOfStock.stories.tsx +73 -0
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.37 (2022-05-27)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Increase NodeJS version ([#1323](https://github.com/vtex/faststore/issues/1323)) ([3a6fbe7](https://github.com/vtex/faststore/commit/3a6fbe7c230b7056582c783464bfb45cc5717bed))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 1.8.36 (2022-05-26)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* Top searches ([#1321](https://github.com/vtex/faststore/issues/1321)) ([e2ab99d](https://github.com/vtex/faststore/commit/e2ab99d4f443e013f3fd024fc83bb612fcb27f41))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## 1.8.35 (2022-05-26)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Features
|
|
32
|
+
|
|
33
|
+
* Add OutOfStock component ([#1314](https://github.com/vtex/faststore/issues/1314)) ([37eac86](https://github.com/vtex/faststore/commit/37eac86ede448ef68aef426f65f2d224694b2cfc))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
6
39
|
## 1.8.34 (2022-05-25)
|
|
7
40
|
|
|
8
41
|
**Note:** Version bump only for package @faststore/ui
|
package/dist/index.d.ts
CHANGED
|
@@ -72,5 +72,7 @@ export { default as QuantitySelector } from './molecules/QuantitySelector';
|
|
|
72
72
|
export type { QuantitySelectorProps } from './molecules/QuantitySelector';
|
|
73
73
|
export { default as Dropdown, DropdownButton, DropdownItem, DropdownMenu, } from './molecules/Dropdown';
|
|
74
74
|
export type { DropdownProps, DropdownButtonProps, DropdownItemProps, DropdownMenuProps, } from './molecules/Dropdown';
|
|
75
|
+
export { default as OutOfStock, OutOfStockTitle, OutOfStockMessage, } from './organisms/OutOfStock';
|
|
76
|
+
export type { OutOfStockProps, OutOfStockMessageProps, OutOfStockTitleProps, } from './organisms/OutOfStock';
|
|
75
77
|
export { default as useSlider } from './hooks/useSlider';
|
|
76
78
|
export type { UseSliderArgs, SliderState, SliderDispatch, SlideDirection, } from './hooks/useSlider';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode, FormHTMLAttributes } from 'react';
|
|
3
|
+
export declare type OutOfStockBaseProps = {
|
|
4
|
+
/**
|
|
5
|
+
* ID to find this component in testing tools (e.g.: cypress,
|
|
6
|
+
* testing-library, and jest).
|
|
7
|
+
*/
|
|
8
|
+
testId?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Children for Out of Stock components.
|
|
11
|
+
*/
|
|
12
|
+
children: string | ReactNode;
|
|
13
|
+
};
|
|
14
|
+
export declare type OutOfStockProps = OutOfStockBaseProps & {
|
|
15
|
+
/**
|
|
16
|
+
* Event emitted when form is submitted.
|
|
17
|
+
*/
|
|
18
|
+
onSubmit?: (event: React.FormEvent<HTMLFormElement>) => void;
|
|
19
|
+
} & FormHTMLAttributes<HTMLFormElement>;
|
|
20
|
+
declare const OutOfStock: ({ testId, children, ...otherProps }: OutOfStockProps) => JSX.Element;
|
|
21
|
+
export default OutOfStock;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { OutOfStockBaseProps } from './OutOfStock';
|
|
3
|
+
export declare type OutOfStockMessageProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Attribute used for polymorphic component.
|
|
6
|
+
*/
|
|
7
|
+
as?: 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'div' | 'span';
|
|
8
|
+
} & OutOfStockBaseProps;
|
|
9
|
+
export declare const OutOfStockMessage: ({ as: MessageComponent, testId, children, }: OutOfStockMessageProps) => JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { OutOfStockBaseProps } from './OutOfStock';
|
|
3
|
+
export declare type OutOfStockTitleProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Attribute used for polymorphic component.
|
|
6
|
+
*/
|
|
7
|
+
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p';
|
|
8
|
+
} & OutOfStockBaseProps;
|
|
9
|
+
export declare const OutOfStockTitle: ({ as: TitleComponent, testId, children, }: OutOfStockTitleProps) => JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { default } from './OutOfStock';
|
|
2
|
+
export { OutOfStockMessage } from './OutOfStockMessage';
|
|
3
|
+
export { OutOfStockTitle } from './OutOfStockTitle';
|
|
4
|
+
export type { OutOfStockProps } from './OutOfStock';
|
|
5
|
+
export type { OutOfStockMessageProps } from './OutOfStockMessage';
|
|
6
|
+
export type { OutOfStockTitleProps } from './OutOfStockTitle';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { OutOfStockMessageProps, OutOfStockTitleProps, OutOfStockProps } from '..';
|
|
2
|
+
declare type OutOfStockTemplateProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
message: string;
|
|
5
|
+
titleAs: OutOfStockTitleProps['as'];
|
|
6
|
+
messageAs: OutOfStockMessageProps['as'];
|
|
7
|
+
} & OutOfStockProps;
|
|
8
|
+
export declare const OutOfStock: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, OutOfStockTemplateProps>;
|
|
9
|
+
declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, import("@storybook/react").Args>;
|
|
10
|
+
export default _default;
|
|
@@ -1967,6 +1967,42 @@ const DropdownMenu = ({
|
|
|
1967
1967
|
}, otherProps), children)), document.body) : clearChildrenReferences();
|
|
1968
1968
|
};
|
|
1969
1969
|
|
|
1970
|
+
const OutOfStock = ({
|
|
1971
|
+
testId = 'store-out-of-stock',
|
|
1972
|
+
children,
|
|
1973
|
+
...otherProps
|
|
1974
|
+
}) => {
|
|
1975
|
+
return React__default.createElement("section", {
|
|
1976
|
+
"data-store-out-of-stock": true,
|
|
1977
|
+
"data-testid": testId
|
|
1978
|
+
}, React__default.createElement(Form, Object.assign({
|
|
1979
|
+
"data-out-of-stock-form": true,
|
|
1980
|
+
testId: `${testId}-form`
|
|
1981
|
+
}, otherProps), children));
|
|
1982
|
+
};
|
|
1983
|
+
|
|
1984
|
+
const OutOfStockMessage = ({
|
|
1985
|
+
as: MessageComponent = 'p',
|
|
1986
|
+
testId = 'store-out-of-stock-message',
|
|
1987
|
+
children
|
|
1988
|
+
}) => {
|
|
1989
|
+
return React__default.createElement(MessageComponent, {
|
|
1990
|
+
"data-out-of-stock-message": true,
|
|
1991
|
+
"data-testid": testId
|
|
1992
|
+
}, children);
|
|
1993
|
+
};
|
|
1994
|
+
|
|
1995
|
+
const OutOfStockTitle = ({
|
|
1996
|
+
as: TitleComponent = 'h2',
|
|
1997
|
+
testId = 'store-out-of-stock-title',
|
|
1998
|
+
children
|
|
1999
|
+
}) => {
|
|
2000
|
+
return React__default.createElement(TitleComponent, {
|
|
2001
|
+
"data-out-of-stock-title": true,
|
|
2002
|
+
"data-testid": testId
|
|
2003
|
+
}, children);
|
|
2004
|
+
};
|
|
2005
|
+
|
|
1970
2006
|
exports.Accordion = Accordion;
|
|
1971
2007
|
exports.AccordionButton = AccordionButton;
|
|
1972
2008
|
exports.AccordionItem = AccordionItem;
|
|
@@ -2000,6 +2036,9 @@ exports.Link = Link;
|
|
|
2000
2036
|
exports.List = List;
|
|
2001
2037
|
exports.LoadingButton = LoadingButton;
|
|
2002
2038
|
exports.Modal = Modal;
|
|
2039
|
+
exports.OutOfStock = OutOfStock;
|
|
2040
|
+
exports.OutOfStockMessage = OutOfStockMessage;
|
|
2041
|
+
exports.OutOfStockTitle = OutOfStockTitle;
|
|
2003
2042
|
exports.Overlay = Overlay;
|
|
2004
2043
|
exports.PaymentMethods = PaymentMethods;
|
|
2005
2044
|
exports.Popover = Popover;
|