@faststore/ui 1.3.36 → 1.3.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 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.37 (2021-12-15)
7
+
8
+
9
+ ### Features
10
+
11
+ * **ui:** Card component ([#1079](https://github.com/vtex/faststore/issues/1079)) ([7f10a5d](https://github.com/vtex/faststore/commit/7f10a5dcec21f7c9d59ba645755fe298e96269df))
12
+
13
+
14
+
15
+
16
+
6
17
  ## 1.3.36 (2021-12-15)
7
18
 
8
19
 
package/dist/index.d.ts CHANGED
@@ -60,5 +60,7 @@ export { default as Form } from './molecules/Form';
60
60
  export type { FormProps } from './molecules/Form';
61
61
  export { default as Alert } from './molecules/Alert';
62
62
  export type { AlertProps } from './molecules/Alert';
63
+ export { default as Card, CardImage, CardContent, CardActions, } from './organisms/Card';
64
+ export type { CardProps, CardImageProps, CardContentProps, CardActionsProps, } from './organisms/Card';
63
65
  export { default as useSlider } from './hooks/useSlider';
64
66
  export type { UseSliderArgs, SliderState, SliderDispatch, SlideDirection, } from './hooks/useSlider';
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { HTMLAttributes } from 'react';
3
+ export interface CardProps 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 Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
10
+ export default Card;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { HTMLAttributes } from 'react';
3
+ export interface CardActionsProps 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 CardActions: React.ForwardRefExoticComponent<CardActionsProps & React.RefAttributes<HTMLDivElement>>;
10
+ export default CardActions;
@@ -0,0 +1,14 @@
1
+ import type { HTMLAttributes, AriaAttributes } from 'react';
2
+ import React from 'react';
3
+ export interface CardContentProps 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
+ * Defines a string value that labels the current element.
10
+ */
11
+ 'aria-label'?: AriaAttributes['aria-label'];
12
+ }
13
+ declare const CardContent: React.ForwardRefExoticComponent<CardContentProps & React.RefAttributes<HTMLDivElement>>;
14
+ export default CardContent;
@@ -0,0 +1,10 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ import React from 'react';
3
+ export interface CardImageProps 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 CardImage: React.ForwardRefExoticComponent<CardImageProps & React.RefAttributes<HTMLDivElement>>;
10
+ export default CardImage;
@@ -0,0 +1,8 @@
1
+ export { default } from './Card';
2
+ export type { CardProps } from './Card';
3
+ export { default as CardImage } from './CardImage';
4
+ export type { CardImageProps } from './CardImage';
5
+ export { default as CardContent } from './CardContent';
6
+ export type { CardContentProps } from './CardContent';
7
+ export { default as CardActions } from './CardActions';
8
+ export type { CardActionsProps } from './CardActions';
@@ -0,0 +1,4 @@
1
+ import type { CardProps } from '../Card';
2
+ export declare const Card: import("@storybook/csf").AnnotatedStoryFn<import("@storybook/react").ReactFramework, CardProps>;
3
+ declare const _default: import("@storybook/csf").ComponentAnnotations<import("@storybook/react").ReactFramework, import("@storybook/react").Args>;
4
+ export default _default;
@@ -1493,6 +1493,57 @@ const Alert = /*#__PURE__*/React.forwardRef(function Alert({
1493
1493
  }, otherProps), children);
1494
1494
  });
1495
1495
 
1496
+ const Card = /*#__PURE__*/React.forwardRef(function Card({
1497
+ testId = 'store-card',
1498
+ children,
1499
+ ...otherProps
1500
+ }, ref) {
1501
+ return React__default.createElement("article", Object.assign({
1502
+ ref: ref,
1503
+ "data-store-card": true,
1504
+ "data-testid": testId
1505
+ }, otherProps), children);
1506
+ });
1507
+
1508
+ const CardImage = /*#__PURE__*/React.forwardRef(function CardImage({
1509
+ testId = 'store-card-image',
1510
+ children,
1511
+ ...otherProps
1512
+ }, ref) {
1513
+ return React__default.createElement("div", Object.assign({
1514
+ ref: ref,
1515
+ "data-store-card-image": true,
1516
+ "data-testid": testId
1517
+ }, otherProps), children);
1518
+ });
1519
+
1520
+ const CardContent = /*#__PURE__*/React.forwardRef(function CardContent({
1521
+ testId = 'store-card-content',
1522
+ 'aria-label': ariaLabel = 'Card content',
1523
+ children,
1524
+ ...otherProps
1525
+ }, ref) {
1526
+ return React__default.createElement("div", Object.assign({
1527
+ ref: ref,
1528
+ role: "region",
1529
+ "aria-label": ariaLabel,
1530
+ "data-store-card-content": true,
1531
+ "data-testid": testId
1532
+ }, otherProps), children);
1533
+ });
1534
+
1535
+ const CardActions = /*#__PURE__*/React.forwardRef(function CardActions({
1536
+ testId = 'store-card-actions',
1537
+ children,
1538
+ ...otherProps
1539
+ }, ref) {
1540
+ return React__default.createElement("div", Object.assign({
1541
+ ref: ref,
1542
+ "data-store-card-actions": true,
1543
+ "data-testid": testId
1544
+ }, otherProps), children);
1545
+ });
1546
+
1496
1547
  exports.Accordion = Accordion;
1497
1548
  exports.AccordionButton = AccordionButton;
1498
1549
  exports.AccordionItem = AccordionItem;
@@ -1506,6 +1557,10 @@ exports.BannerLink = BannerLink;
1506
1557
  exports.Breadcrumb = Breadcrumb;
1507
1558
  exports.Bullets = Bullets;
1508
1559
  exports.Button = Button;
1560
+ exports.Card = Card;
1561
+ exports.CardActions = CardActions;
1562
+ exports.CardContent = CardContent;
1563
+ exports.CardImage = CardImage;
1509
1564
  exports.Carousel = Carousel;
1510
1565
  exports.Checkbox = Checkbox;
1511
1566
  exports.Form = Form;