@faststore/components 2.0.16-alpha.0 → 2.0.18-alpha.0
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 +18 -0
- package/dist/atoms/List/List.d.ts +1 -1
- package/dist/atoms/List/List.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/molecules/LinkButton/LinkButton.d.ts +5 -0
- package/dist/molecules/LinkButton/LinkButton.js +17 -0
- package/dist/molecules/LinkButton/LinkButton.js.map +1 -0
- package/dist/molecules/LinkButton/index.d.ts +2 -0
- package/dist/molecules/LinkButton/index.js +2 -0
- package/dist/molecules/LinkButton/index.js.map +1 -0
- package/dist/molecules/SelectField/SelectField.js +3 -4
- package/dist/molecules/SelectField/SelectField.js.map +1 -1
- package/package.json +2 -2
- package/src/atoms/List/List.tsx +2 -4
- package/src/index.ts +2 -0
- package/src/molecules/LinkButton/LinkButton.tsx +51 -0
- package/src/molecules/LinkButton/index.ts +2 -0
- package/src/molecules/SelectField/SelectField.tsx +19 -16
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
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
|
+
## [2.0.18-alpha.0](https://github.com/vtex/faststore/compare/v2.0.17-alpha.0...v2.0.18-alpha.0) (2022-12-15)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Starter's Integration tests ([#1559](https://github.com/vtex/faststore/issues/1559)) ([d597d98](https://github.com/vtex/faststore/commit/d597d981079448ca46588a8e32964c4e5dcc84f8)), closes [#323](https://github.com/vtex/faststore/issues/323)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [2.0.17-alpha.0](https://github.com/vtex/faststore/compare/v2.0.16-alpha.0...v2.0.17-alpha.0) (2022-12-15)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* Create `LinkButton` component ([#1558](https://github.com/vtex/faststore/issues/1558)) ([bbbebdb](https://github.com/vtex/faststore/commit/bbbebdb081f9c40315d8b661461e3b09a34b84b6))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [2.0.16-alpha.0](https://github.com/vtex/faststore/compare/v2.0.15-alpha.0...v2.0.16-alpha.0) (2022-12-15)
|
|
7
25
|
|
|
8
26
|
|
|
@@ -10,7 +10,7 @@ interface BaseProps {
|
|
|
10
10
|
*/
|
|
11
11
|
marker?: boolean;
|
|
12
12
|
}
|
|
13
|
-
export declare type ListProps<T extends ElementType> = PolymorphicComponentPropsWithRef<T, BaseProps>;
|
|
13
|
+
export declare type ListProps<T extends ElementType = 'ul'> = PolymorphicComponentPropsWithRef<T, BaseProps>;
|
|
14
14
|
declare type ListComponent = <T extends ElementType = 'ul'>(props: ListProps<T>) => ReactElement | null;
|
|
15
15
|
declare const List: ListComponent;
|
|
16
16
|
export default List;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/atoms/List/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/atoms/List/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AA0BzC,MAAM,IAAI,GAAkB,UAAU,CAAC,SAAS,IAAI,CAGlD,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,UAAU,EAAgB,EAC/D,GAAsB;IAEtB,MAAM,SAAS,GAAG,EAAE,IAAI,IAAI,CAAA;IAE5B,OAAO,CACL,oBAAC,SAAS,IACR,GAAG,EAAE,GAAG,uCAEK,MAAM,yBACE,MAAM,KACvB,UAAU,GACd,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,IAAI,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -33,6 +33,8 @@ export { default as DiscountBadge } from './molecules/DiscountBadge';
|
|
|
33
33
|
export type { DiscountBadgeProps } from './molecules/DiscountBadge';
|
|
34
34
|
export { default as InputField } from './molecules/InputField';
|
|
35
35
|
export type { InputFieldProps } from './molecules/InputField';
|
|
36
|
+
export { default as LinkButton } from './molecules/LinkButton';
|
|
37
|
+
export type { LinkButtonProps } from './molecules/LinkButton';
|
|
36
38
|
export { default as RadioField } from './molecules/RadioField';
|
|
37
39
|
export type { RadioFieldProps } from './molecules/RadioField';
|
|
38
40
|
export { default as SelectField } from './molecules/SelectField';
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ export { default as CheckboxField } from './molecules/CheckboxField';
|
|
|
20
20
|
export { default as IconButton } from './molecules/IconButton';
|
|
21
21
|
export { default as DiscountBadge } from './molecules/DiscountBadge';
|
|
22
22
|
export { default as InputField } from './molecules/InputField';
|
|
23
|
+
export { default as LinkButton } from './molecules/LinkButton';
|
|
23
24
|
export { default as RadioField } from './molecules/RadioField';
|
|
24
25
|
export { default as SelectField } from './molecules/SelectField';
|
|
25
26
|
export { default as Tag } from './molecules/Tag';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,SAAS;AACT,cAAc,UAAU,CAAA;AAExB,QAAQ;AACR,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,eAAe,CAAA;AAEhD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAElD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAEtD,OAAO,EAAE,OAAO,IA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AAU,EAAE,MAAM,wBAAwB,CAAA;AAE9D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAE9D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAE9D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAEhE,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAEtD,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { AnchorHTMLAttributes } from 'react';
|
|
2
|
+
import type { ButtonProps } from '../..';
|
|
3
|
+
export declare type LinkButtonProps = AnchorHTMLAttributes<HTMLAnchorElement> & ButtonProps;
|
|
4
|
+
declare function LinkButton({ icon, inverse, children, disabled, iconPosition, size, variant, testId, ...otherProps }: LinkButtonProps): JSX.Element;
|
|
5
|
+
export default LinkButton;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { useRef } from 'react';
|
|
2
|
+
import { Icon } from '../..';
|
|
3
|
+
function LinkButton({ icon, inverse, children, disabled, iconPosition, size = 'regular', variant = 'primary', testId = 'fs-link-button', ...otherProps }) {
|
|
4
|
+
const linkRef = useRef(null);
|
|
5
|
+
function onFocus(e) {
|
|
6
|
+
e.preventDefault();
|
|
7
|
+
if (disabled) {
|
|
8
|
+
linkRef.current?.blur();
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return (React.createElement("a", { ref: linkRef, onFocus: onFocus, "data-fs-button": true, "data-fs-link-button": true, "data-testid": testId, "data-fs-button-size": size, "data-fs-button-variant": variant, "data-fs-button-inverse": inverse, "data-fs-button-disabled": disabled, ...otherProps },
|
|
12
|
+
iconPosition === 'left' && React.createElement(Icon, { component: icon }),
|
|
13
|
+
children,
|
|
14
|
+
iconPosition === 'right' && React.createElement(Icon, { component: icon })));
|
|
15
|
+
}
|
|
16
|
+
export default LinkButton;
|
|
17
|
+
//# sourceMappingURL=LinkButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LinkButton.js","sourceRoot":"","sources":["../../../src/molecules/LinkButton/LinkButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAGrC,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAA;AAM5B,SAAS,UAAU,CAAC,EAClB,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,IAAI,GAAG,SAAS,EAChB,OAAO,GAAG,SAAS,EACnB,MAAM,GAAG,gBAAgB,EACzB,GAAG,UAAU,EACG;IAChB,MAAM,OAAO,GAAG,MAAM,CAA2B,IAAI,CAAC,CAAA;IAEtD,SAAS,OAAO,CAAC,CAAa;QAC5B,CAAC,CAAC,cAAc,EAAE,CAAA;QAElB,IAAI,QAAQ,EAAE;YACZ,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,CAAA;SACxB;IACH,CAAC;IAED,OAAO,CACL,2BACE,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,OAAO,sEAGH,MAAM,yBACE,IAAI,4BACD,OAAO,4BACP,OAAO,6BACN,QAAQ,KAC7B,UAAU;QAEb,YAAY,KAAK,MAAM,IAAI,oBAAC,IAAI,IAAC,SAAS,EAAE,IAAI,GAAI;QACpD,QAAQ;QACR,YAAY,KAAK,OAAO,IAAI,oBAAC,IAAI,IAAC,SAAS,EAAE,IAAI,GAAI,CACpD,CACL,CAAA;AACH,CAAC;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/molecules/LinkButton/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react';
|
|
2
|
-
import Select from '
|
|
3
|
-
import Label from '../../atoms/Label';
|
|
2
|
+
import { Label, Select } from '../..';
|
|
4
3
|
const SelectField = forwardRef(function SelectField({ id, label, options, testId = 'fs-select-field', ...otherProps }, ref) {
|
|
5
|
-
return (React.createElement("div", { ref: ref, "data-fs-select-field": true
|
|
4
|
+
return (React.createElement("div", { ref: ref, "data-fs-select-field": true },
|
|
6
5
|
React.createElement(Label, { "data-fs-select-field-label": true, htmlFor: id }, label),
|
|
7
|
-
React.createElement(Select, { id: id, options: options, ...otherProps })));
|
|
6
|
+
React.createElement(Select, { id: id, options: options, "data-testid": testId, ...otherProps })));
|
|
8
7
|
});
|
|
9
8
|
export default SelectField;
|
|
10
9
|
//# sourceMappingURL=SelectField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectField.js","sourceRoot":"","sources":["../../../src/molecules/SelectField/SelectField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"SelectField.js","sourceRoot":"","sources":["../../../src/molecules/SelectField/SelectField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAGzC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAUrC,MAAM,WAAW,GAAG,UAAU,CAG5B,SAAS,WAAW,CACpB,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,GAAG,iBAAiB,EAAE,GAAG,UAAU,EAAE,EACjE,GAAG;IAEH,OAAO,CACL,6BAAK,GAAG,EAAE,GAAG;QACX,oBAAC,KAAK,wCAA4B,OAAO,EAAE,EAAE,IAC1C,KAAK,CACA;QACR,oBAAC,MAAM,IAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,OAAO,iBAAe,MAAM,KAAM,UAAU,GAAI,CACrE,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,WAAW,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/components",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.18-alpha.0",
|
|
4
4
|
"module": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
6
6
|
"author": "Emerson Laurentino @emersonlaurentino",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"node": "16.18.0",
|
|
29
29
|
"yarn": "1.19.1"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "f6117ac7008ebb70368642c145bab4e1f18be831"
|
|
32
32
|
}
|
package/src/atoms/List/List.tsx
CHANGED
|
@@ -17,10 +17,8 @@ interface BaseProps {
|
|
|
17
17
|
marker?: boolean
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export type ListProps<T extends ElementType> =
|
|
21
|
-
T,
|
|
22
|
-
BaseProps
|
|
23
|
-
>
|
|
20
|
+
export type ListProps<T extends ElementType = 'ul'> =
|
|
21
|
+
PolymorphicComponentPropsWithRef<T, BaseProps>
|
|
24
22
|
|
|
25
23
|
type ListComponent = <T extends ElementType = 'ul'>(
|
|
26
24
|
props: ListProps<T>
|
package/src/index.ts
CHANGED
|
@@ -38,6 +38,8 @@ export { default as DiscountBadge } from './molecules/DiscountBadge'
|
|
|
38
38
|
export type { DiscountBadgeProps } from './molecules/DiscountBadge'
|
|
39
39
|
export { default as InputField } from './molecules/InputField'
|
|
40
40
|
export type { InputFieldProps } from './molecules/InputField'
|
|
41
|
+
export { default as LinkButton } from './molecules/LinkButton'
|
|
42
|
+
export type { LinkButtonProps } from './molecules/LinkButton'
|
|
41
43
|
export { default as RadioField } from './molecules/RadioField'
|
|
42
44
|
export type { RadioFieldProps } from './molecules/RadioField'
|
|
43
45
|
export { default as SelectField } from './molecules/SelectField'
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { useRef } from 'react'
|
|
2
|
+
import type { FocusEvent, AnchorHTMLAttributes } from 'react'
|
|
3
|
+
|
|
4
|
+
import { Icon } from '../..'
|
|
5
|
+
import type { ButtonProps } from '../..'
|
|
6
|
+
|
|
7
|
+
export type LinkButtonProps = AnchorHTMLAttributes<HTMLAnchorElement> &
|
|
8
|
+
ButtonProps
|
|
9
|
+
|
|
10
|
+
function LinkButton({
|
|
11
|
+
icon,
|
|
12
|
+
inverse,
|
|
13
|
+
children,
|
|
14
|
+
disabled,
|
|
15
|
+
iconPosition,
|
|
16
|
+
size = 'regular',
|
|
17
|
+
variant = 'primary',
|
|
18
|
+
testId = 'fs-link-button',
|
|
19
|
+
...otherProps
|
|
20
|
+
}: LinkButtonProps) {
|
|
21
|
+
const linkRef = useRef<HTMLAnchorElement | null>(null)
|
|
22
|
+
|
|
23
|
+
function onFocus(e: FocusEvent) {
|
|
24
|
+
e.preventDefault()
|
|
25
|
+
|
|
26
|
+
if (disabled) {
|
|
27
|
+
linkRef.current?.blur()
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<a
|
|
33
|
+
ref={linkRef}
|
|
34
|
+
onFocus={onFocus}
|
|
35
|
+
data-fs-button
|
|
36
|
+
data-fs-link-button
|
|
37
|
+
data-testid={testId}
|
|
38
|
+
data-fs-button-size={size}
|
|
39
|
+
data-fs-button-variant={variant}
|
|
40
|
+
data-fs-button-inverse={inverse}
|
|
41
|
+
data-fs-button-disabled={disabled}
|
|
42
|
+
{...otherProps}
|
|
43
|
+
>
|
|
44
|
+
{iconPosition === 'left' && <Icon component={icon} />}
|
|
45
|
+
{children}
|
|
46
|
+
{iconPosition === 'right' && <Icon component={icon} />}
|
|
47
|
+
</a>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default LinkButton
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { forwardRef } from 'react'
|
|
2
2
|
import type { PropsWithChildren } from 'react'
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
|
|
4
|
+
import { Label, Select } from '../..'
|
|
5
|
+
import type { SelectProps } from '../../atoms/Select'
|
|
6
6
|
|
|
7
7
|
export interface SelectFieldProps extends SelectProps {
|
|
8
8
|
/**
|
|
@@ -11,18 +11,21 @@ export interface SelectFieldProps extends SelectProps {
|
|
|
11
11
|
label: string
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
const SelectField = forwardRef<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
const SelectField = forwardRef<
|
|
15
|
+
HTMLDivElement,
|
|
16
|
+
PropsWithChildren<SelectFieldProps>
|
|
17
|
+
>(function SelectField(
|
|
18
|
+
{ id, label, options, testId = 'fs-select-field', ...otherProps },
|
|
19
|
+
ref
|
|
20
|
+
) {
|
|
21
|
+
return (
|
|
22
|
+
<div ref={ref} data-fs-select-field>
|
|
23
|
+
<Label data-fs-select-field-label htmlFor={id}>
|
|
24
|
+
{label}
|
|
25
|
+
</Label>
|
|
26
|
+
<Select id={id} options={options} data-testid={testId} {...otherProps} />
|
|
27
|
+
</div>
|
|
28
|
+
)
|
|
29
|
+
})
|
|
27
30
|
|
|
28
31
|
export default SelectField
|