@faststore/ui 1.3.39 → 1.3.40
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 +11 -0
- package/dist/atoms/Link/Link.d.ts +19 -0
- package/dist/atoms/Link/index.d.ts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/typings/PolymorphicGenerics.d.ts +1 -0
- package/dist/typings/index.d.ts +1 -1
- package/dist/ui.cjs.development.js +15 -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 +15 -1
- package/dist/ui.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/atoms/Link/Link.test.tsx +53 -0
- package/src/atoms/Link/Link.tsx +47 -0
- package/src/atoms/Link/index.tsx +2 -0
- package/src/atoms/Link/stories/Link.mdx +35 -0
- package/src/atoms/Link/stories/Link.stories.tsx +30 -0
- package/src/index.ts +3 -0
- package/src/typings/PolymorphicGenerics.ts +5 -0
- package/src/typings/index.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.3.40 (2021-12-18)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **ui:** Link atom ([#1067](https://github.com/vtex/faststore/issues/1067)) ([c49b2dd](https://github.com/vtex/faststore/commit/c49b2ddc31ba4184bed19a8934fbf4d5f0b47a5f))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## 1.3.39 (2021-12-17)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @faststore/ui
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ElementType, ReactElement } from 'react';
|
|
3
|
+
import type { PolymorphicComponentPropsWithRef } from '../../typings';
|
|
4
|
+
interface Props {
|
|
5
|
+
/**
|
|
6
|
+
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
7
|
+
*/
|
|
8
|
+
testId?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare type LinkProps<C extends ElementType> = PolymorphicComponentPropsWithRef<C, Props>;
|
|
11
|
+
declare type LinkComponent = <C extends ElementType = 'a'>(props: LinkProps<C>) => ReactElement | null;
|
|
12
|
+
declare const Link: LinkComponent;
|
|
13
|
+
/**
|
|
14
|
+
* This is only being exported to make it easier to use in Storybook.
|
|
15
|
+
* **DON'T** import this directly to use this component, use the default export
|
|
16
|
+
* instead.
|
|
17
|
+
*/
|
|
18
|
+
export declare const StorybookLink: React.FC<Props>;
|
|
19
|
+
export default Link;
|
package/dist/index.d.ts
CHANGED
|
@@ -24,4 +24,5 @@ export declare type PolymorphicComponentProps<C extends ElementType, Props = Rec
|
|
|
24
24
|
export declare type PolymorphicComponentPropsWithRef<C extends ElementType, P = Record<string, never>> = PolymorphicComponentProps<C, P> & {
|
|
25
25
|
ref?: ComponentPropsWithRef<C>['ref'];
|
|
26
26
|
};
|
|
27
|
+
export declare type PolymorphicRef<C extends ElementType> = PolymorphicComponentPropsWithRef<C>['ref'];
|
|
27
28
|
export {};
|
package/dist/typings/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { PolymorphicComponentProps, PolymorphicComponentPropsWithRef, } from './PolymorphicGenerics';
|
|
1
|
+
export type { PolymorphicComponentProps, PolymorphicComponentPropsWithRef, PolymorphicRef, } from './PolymorphicGenerics';
|
|
@@ -12,6 +12,20 @@ var reactSwipeable = require('react-swipeable');
|
|
|
12
12
|
var reactDom = require('react-dom');
|
|
13
13
|
var tabbable = require('tabbable');
|
|
14
14
|
|
|
15
|
+
const Link = /*#__PURE__*/React.forwardRef(function Link({
|
|
16
|
+
as,
|
|
17
|
+
children,
|
|
18
|
+
testId = 'store-link',
|
|
19
|
+
...otherProps
|
|
20
|
+
}, ref) {
|
|
21
|
+
const Component = as != null ? as : 'a';
|
|
22
|
+
return React__default.createElement(Component, Object.assign({
|
|
23
|
+
ref: ref,
|
|
24
|
+
"data-store-link": true,
|
|
25
|
+
"data-testid": testId
|
|
26
|
+
}, otherProps), children);
|
|
27
|
+
});
|
|
28
|
+
|
|
15
29
|
const Button = /*#__PURE__*/React.forwardRef(function Button({
|
|
16
30
|
children,
|
|
17
31
|
testId = 'store-button',
|
|
@@ -1569,6 +1583,7 @@ exports.Icon = Icon;
|
|
|
1569
1583
|
exports.IconButton = IconButton;
|
|
1570
1584
|
exports.Input = Input;
|
|
1571
1585
|
exports.Label = Label;
|
|
1586
|
+
exports.Link = Link;
|
|
1572
1587
|
exports.List = List;
|
|
1573
1588
|
exports.LoadingButton = LoadingButton;
|
|
1574
1589
|
exports.Modal = Modal;
|