@faststore/ui 1.4.3 → 1.4.7
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 +38 -0
- package/dist/molecules/IconButton/IconButton.d.ts +5 -1
- package/dist/molecules/QuantitySelector/QuantitySelector.d.ts +2 -2
- package/dist/ui.cjs.development.js +26 -27
- 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 +26 -27
- package/dist/ui.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/atoms/Checkbox/stories/Checkbox.stories.tsx +13 -8
- package/src/atoms/List/List.test.tsx +21 -2
- package/src/atoms/List/List.tsx +1 -2
- package/src/atoms/List/stories/List.mdx +2 -11
- package/src/atoms/Radio/stories/Radio.stories.tsx +6 -1
- package/src/atoms/Select/stories/Select.stories.tsx +12 -9
- package/src/atoms/Slider/Slider.tsx +3 -3
- package/src/atoms/Slider/stories/Slider.mdx +2 -2
- package/src/atoms/TextArea/stories/TextArea.stories.tsx +1 -1
- package/src/molecules/Accordion/Accordion.test.tsx +6 -6
- package/src/molecules/Accordion/AccordionButton.tsx +1 -1
- package/src/molecules/Accordion/AccordionItem.tsx +1 -6
- package/src/molecules/Accordion/AccordionPanel.tsx +1 -1
- package/src/molecules/Accordion/stories/Accordion.mdx +3 -3
- package/src/molecules/Banner/Banner.test.tsx +6 -6
- package/src/molecules/Banner/BannerContent.tsx +1 -6
- package/src/molecules/Banner/BannerImage.tsx +1 -6
- package/src/molecules/Banner/BannerLink.tsx +1 -6
- package/src/molecules/Banner/stories/Banner.mdx +4 -4
- package/src/molecules/Breadcrumb/Breadcrumb.test.tsx +12 -7
- package/src/molecules/Breadcrumb/Breadcrumb.tsx +3 -3
- package/src/molecules/Breadcrumb/stories/Breadcrumb.mdx +4 -2
- package/src/molecules/Carousel/Carousel.tsx +2 -2
- package/src/molecules/IconButton/IconButton.test.tsx +6 -2
- package/src/molecules/IconButton/IconButton.tsx +6 -1
- package/src/molecules/IconButton/stories/IconButton.stories.tsx +7 -2
- package/src/molecules/PriceRange/PriceRange.tsx +3 -3
- package/src/molecules/PriceRange/stories/PriceRange.mdx +2 -2
- package/src/molecules/QuantitySelector/QuantitySelector.tsx +2 -2
- package/src/molecules/Table/Table.test.tsx +7 -11
- package/src/molecules/Table/TableBody.tsx +1 -6
- package/src/molecules/Table/TableCell.tsx +1 -1
- package/src/molecules/Table/TableFooter.tsx +1 -6
- package/src/molecules/Table/TableHead.tsx +1 -6
- package/src/molecules/Table/TableRow.tsx +1 -1
- package/src/molecules/Table/stories/Table.mdx +5 -7
- package/src/organisms/Card/Card.test.tsx +6 -6
- package/src/organisms/Card/CardActions.tsx +1 -6
- package/src/organisms/Card/CardContent.tsx +1 -6
- package/src/organisms/Card/CardImage.tsx +1 -1
- package/src/organisms/Card/stories/Card.mdx +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,44 @@
|
|
|
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.4.7 (2022-01-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* fix accessibility on storybook ([#1096](https://github.com/vtex/faststore/issues/1096)) ([55805b1](https://github.com/vtex/faststore/commit/55805b1b2cffd111ef64857321c20e0a001a93b2))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 1.4.6 (2022-01-05)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @faststore/ui
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## 1.4.5 (2022-01-04)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @faststore/ui
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## 1.4.4 (2022-01-04)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Bug Fixes
|
|
37
|
+
|
|
38
|
+
* adjust data attributes pattern on multiple components ([#1093](https://github.com/vtex/faststore/issues/1093)) ([ca9172f](https://github.com/vtex/faststore/commit/ca9172fb353cfce7011f9144c1e94ed7e6b73f5f))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
6
44
|
## 1.4.3 (2022-01-03)
|
|
7
45
|
|
|
8
46
|
**Note:** Version bump only for package @faststore/ui
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { ButtonProps } from '../../atoms/Button';
|
|
4
|
-
export interface Props extends Omit<ButtonProps, 'children'> {
|
|
4
|
+
export interface Props extends Omit<ButtonProps, 'children' | 'aria-label'> {
|
|
5
5
|
/**
|
|
6
6
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
7
7
|
*/
|
|
@@ -10,6 +10,10 @@ export interface Props extends Omit<ButtonProps, 'children'> {
|
|
|
10
10
|
* A React component that will be rendered as an icon.
|
|
11
11
|
*/
|
|
12
12
|
icon: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Label to be required for accessibility.
|
|
15
|
+
*/
|
|
16
|
+
'aria-label': string;
|
|
13
17
|
}
|
|
14
18
|
declare const IconButton: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
|
|
15
19
|
export default IconButton;
|
|
@@ -10,7 +10,7 @@ export interface QuantitySelectorProps extends InputHTMLAttributes<HTMLDivElemen
|
|
|
10
10
|
/**
|
|
11
11
|
* Object with properties that will be passed forward the inner IconButton atom at the left of the input.
|
|
12
12
|
*/
|
|
13
|
-
leftButtonProps: IconButtonProps
|
|
13
|
+
leftButtonProps: Omit<IconButtonProps, 'aria-label'>;
|
|
14
14
|
/**
|
|
15
15
|
* Object with properties that will be passed forward the inner Input atom between the two buttons.
|
|
16
16
|
*/
|
|
@@ -18,7 +18,7 @@ export interface QuantitySelectorProps extends InputHTMLAttributes<HTMLDivElemen
|
|
|
18
18
|
/**
|
|
19
19
|
* Object with properties that will be passed forward the inner IconButton atom at the right of the input.
|
|
20
20
|
*/
|
|
21
|
-
rightButtonProps: IconButtonProps
|
|
21
|
+
rightButtonProps: Omit<IconButtonProps, 'aria-label'>;
|
|
22
22
|
/**
|
|
23
23
|
* ID to find this component in testing tools (e.g.: cypress, testing library, and jest).
|
|
24
24
|
*
|
|
@@ -222,7 +222,7 @@ const Slider = ({
|
|
|
222
222
|
className: className
|
|
223
223
|
}, React__default.createElement("div", {
|
|
224
224
|
ref: range,
|
|
225
|
-
"data-
|
|
225
|
+
"data-slider-range": true
|
|
226
226
|
}), React__default.createElement("input", {
|
|
227
227
|
type: "range",
|
|
228
228
|
min: min,
|
|
@@ -233,7 +233,7 @@ const Slider = ({
|
|
|
233
233
|
setMinVal(value);
|
|
234
234
|
minValRef.current = value;
|
|
235
235
|
},
|
|
236
|
-
"data-
|
|
236
|
+
"data-slider-thumb": "left",
|
|
237
237
|
"aria-valuemin": min,
|
|
238
238
|
"aria-valuemax": max,
|
|
239
239
|
"aria-valuenow": minVal,
|
|
@@ -249,7 +249,7 @@ const Slider = ({
|
|
|
249
249
|
setMaxVal(value);
|
|
250
250
|
maxValRef.current = value;
|
|
251
251
|
},
|
|
252
|
-
"data-
|
|
252
|
+
"data-slider-thumb": "right",
|
|
253
253
|
"aria-valuemin": min,
|
|
254
254
|
"aria-valuemax": max,
|
|
255
255
|
"aria-valuenow": maxVal,
|
|
@@ -273,8 +273,7 @@ const List = /*#__PURE__*/React.forwardRef(function List({
|
|
|
273
273
|
|
|
274
274
|
const dataAttributes = {
|
|
275
275
|
'data-testid': testId,
|
|
276
|
-
'data-store-list':
|
|
277
|
-
[`data-${variant}`]: true
|
|
276
|
+
'data-store-list': variant
|
|
278
277
|
};
|
|
279
278
|
const Component = (_ref = MaybeComponent != null ? MaybeComponent : variantToElement[variant]) != null ? _ref : 'ul';
|
|
280
279
|
return React__default.createElement(Component, Object.assign({
|
|
@@ -813,15 +812,15 @@ function Carousel({
|
|
|
813
812
|
}, shouldRenderItem(idx - Number(infiniteMode)) ? currentSlide : null)))), showNavigationArrows && React__default.createElement("div", {
|
|
814
813
|
"data-carousel-controls": true
|
|
815
814
|
}, React__default.createElement(IconButton, {
|
|
815
|
+
"aria-label": "previous",
|
|
816
816
|
"data-arrow": "left",
|
|
817
817
|
"aria-controls": id,
|
|
818
|
-
"aria-label": "previous",
|
|
819
818
|
onClick: slidePrevious,
|
|
820
819
|
icon: React__default.createElement(LeftArrowIcon, null)
|
|
821
820
|
}), React__default.createElement(IconButton, {
|
|
821
|
+
"aria-label": "next",
|
|
822
822
|
"data-arrow": "right",
|
|
823
823
|
"aria-controls": id,
|
|
824
|
-
"aria-label": "next",
|
|
825
824
|
onClick: slideNext,
|
|
826
825
|
icon: React__default.createElement(RightArrowIcon, null)
|
|
827
826
|
})), showPaginationBullets && React__default.createElement("div", {
|
|
@@ -1047,7 +1046,7 @@ const BannerImage = /*#__PURE__*/React.forwardRef(function BannerImage({
|
|
|
1047
1046
|
}, ref) {
|
|
1048
1047
|
return React__default.createElement("div", Object.assign({
|
|
1049
1048
|
ref: ref,
|
|
1050
|
-
"data-
|
|
1049
|
+
"data-banner-image": true,
|
|
1051
1050
|
"data-testid": testId
|
|
1052
1051
|
}, otherProps), children);
|
|
1053
1052
|
});
|
|
@@ -1059,7 +1058,7 @@ const BannerContent = /*#__PURE__*/React.forwardRef(function BannerContent({
|
|
|
1059
1058
|
}, ref) {
|
|
1060
1059
|
return React__default.createElement("div", Object.assign({
|
|
1061
1060
|
ref: ref,
|
|
1062
|
-
"data-
|
|
1061
|
+
"data-banner-content": true,
|
|
1063
1062
|
"data-testid": testId
|
|
1064
1063
|
}, otherProps), children);
|
|
1065
1064
|
});
|
|
@@ -1071,7 +1070,7 @@ const BannerLink = /*#__PURE__*/React.forwardRef(function BannerLink({
|
|
|
1071
1070
|
}, ref) {
|
|
1072
1071
|
return React__default.createElement("div", Object.assign({
|
|
1073
1072
|
ref: ref,
|
|
1074
|
-
"data-
|
|
1073
|
+
"data-banner-link": true,
|
|
1075
1074
|
"data-testid": testId
|
|
1076
1075
|
}, otherProps), children);
|
|
1077
1076
|
});
|
|
@@ -1098,7 +1097,7 @@ const Divider = ({
|
|
|
1098
1097
|
testId
|
|
1099
1098
|
}) => {
|
|
1100
1099
|
const props = {
|
|
1101
|
-
'data-
|
|
1100
|
+
'data-breadcrumb-divider': true,
|
|
1102
1101
|
'aria-hidden': true,
|
|
1103
1102
|
'data-testid': `${testId}-divider`
|
|
1104
1103
|
};
|
|
@@ -1117,7 +1116,7 @@ const ListItem = ({
|
|
|
1117
1116
|
}) => {
|
|
1118
1117
|
const props = {
|
|
1119
1118
|
'data-testid': `${testId}-item`,
|
|
1120
|
-
'data-
|
|
1119
|
+
'data-breadcrumb-item': isLastItem ? 'current' : true,
|
|
1121
1120
|
'aria-current': isLastItem ? 'page' : undefined
|
|
1122
1121
|
};
|
|
1123
1122
|
|
|
@@ -1142,7 +1141,7 @@ const Breadcrumb = /*#__PURE__*/React.forwardRef(function Breadcrumb({
|
|
|
1142
1141
|
"data-store-breadcrumb": true,
|
|
1143
1142
|
"data-testid": testId
|
|
1144
1143
|
}, otherProps), React__default.createElement(List, {
|
|
1145
|
-
"data-
|
|
1144
|
+
"data-breadcrumb-list": true,
|
|
1146
1145
|
variant: "ordered"
|
|
1147
1146
|
}, React__default.Children.map(children, (child, index) => {
|
|
1148
1147
|
const isLastItem = index === lastIndex - 1;
|
|
@@ -1206,15 +1205,15 @@ const PriceRange = ({
|
|
|
1206
1205
|
onChange: handleChange,
|
|
1207
1206
|
"aria-label": ariaLabel
|
|
1208
1207
|
}), React__default.createElement("div", {
|
|
1209
|
-
"data-
|
|
1208
|
+
"data-price-range-values": true
|
|
1210
1209
|
}, React__default.createElement(Price, {
|
|
1211
1210
|
formatter: formatter,
|
|
1212
|
-
"data-
|
|
1211
|
+
"data-price-range-value": "min",
|
|
1213
1212
|
value: minVal,
|
|
1214
1213
|
variant: variant
|
|
1215
1214
|
}), React__default.createElement(Price, {
|
|
1216
1215
|
formatter: formatter,
|
|
1217
|
-
"data-
|
|
1216
|
+
"data-price-range-value": "max",
|
|
1218
1217
|
value: maxVal,
|
|
1219
1218
|
variant: variant
|
|
1220
1219
|
})));
|
|
@@ -1330,7 +1329,7 @@ const AccordionItem = /*#__PURE__*/React.forwardRef(function AccordionItem({
|
|
|
1330
1329
|
value: context
|
|
1331
1330
|
}, React__default.createElement("div", Object.assign({
|
|
1332
1331
|
ref: ref,
|
|
1333
|
-
"data-
|
|
1332
|
+
"data-accordion-item": true,
|
|
1334
1333
|
"data-testid": testId
|
|
1335
1334
|
}, otherProps), children));
|
|
1336
1335
|
});
|
|
@@ -1395,7 +1394,7 @@ const AccordionButton = /*#__PURE__*/React.forwardRef(function AccordionButton({
|
|
|
1395
1394
|
id: button,
|
|
1396
1395
|
"aria-expanded": indices.has(index),
|
|
1397
1396
|
"aria-controls": panel,
|
|
1398
|
-
"data-
|
|
1397
|
+
"data-accordion-button": true,
|
|
1399
1398
|
"data-testid": testId,
|
|
1400
1399
|
onKeyDown: onKeyDown,
|
|
1401
1400
|
onClick: () => {
|
|
@@ -1422,7 +1421,7 @@ const AccordionPanel = /*#__PURE__*/React.forwardRef(function AccordionPanel({
|
|
|
1422
1421
|
id: panel,
|
|
1423
1422
|
"aria-labelledby": button,
|
|
1424
1423
|
role: "region",
|
|
1425
|
-
"data-
|
|
1424
|
+
"data-accordion-panel": true,
|
|
1426
1425
|
"data-testid": testId,
|
|
1427
1426
|
hidden: !indices.has(index)
|
|
1428
1427
|
}, otherProps), children);
|
|
@@ -1447,7 +1446,7 @@ const TableRow = /*#__PURE__*/React.forwardRef(function TableRow({
|
|
|
1447
1446
|
}, ref) {
|
|
1448
1447
|
return React__default.createElement("tr", Object.assign({
|
|
1449
1448
|
ref: ref,
|
|
1450
|
-
"data-
|
|
1449
|
+
"data-table-row": true,
|
|
1451
1450
|
"data-testid": testId
|
|
1452
1451
|
}, otherProps), children);
|
|
1453
1452
|
});
|
|
@@ -1462,7 +1461,7 @@ const TableCell = /*#__PURE__*/React.forwardRef(function TableCell({
|
|
|
1462
1461
|
const Cell = variant === 'header' ? 'th' : 'td';
|
|
1463
1462
|
return React__default.createElement(Cell, Object.assign({
|
|
1464
1463
|
ref: ref,
|
|
1465
|
-
"data-
|
|
1464
|
+
"data-table-cell": variant,
|
|
1466
1465
|
"data-testid": testId,
|
|
1467
1466
|
scope: scope
|
|
1468
1467
|
}, otherProps), children);
|
|
@@ -1476,7 +1475,7 @@ const TableBody = /*#__PURE__*/React.forwardRef(function TableBody({
|
|
|
1476
1475
|
return React__default.createElement("tbody", Object.assign({
|
|
1477
1476
|
ref: ref,
|
|
1478
1477
|
"data-testid": testId,
|
|
1479
|
-
"data-
|
|
1478
|
+
"data-table-body": true
|
|
1480
1479
|
}, otherProps), children);
|
|
1481
1480
|
});
|
|
1482
1481
|
|
|
@@ -1488,7 +1487,7 @@ const TableHead = /*#__PURE__*/React.forwardRef(function TableHead({
|
|
|
1488
1487
|
return React__default.createElement("thead", Object.assign({
|
|
1489
1488
|
ref: ref,
|
|
1490
1489
|
"data-testid": testId,
|
|
1491
|
-
"data-
|
|
1490
|
+
"data-table-head": true
|
|
1492
1491
|
}, otherProps), children);
|
|
1493
1492
|
});
|
|
1494
1493
|
|
|
@@ -1500,7 +1499,7 @@ const TableFooter = /*#__PURE__*/React.forwardRef(function TableFooter({
|
|
|
1500
1499
|
return React__default.createElement("tfoot", Object.assign({
|
|
1501
1500
|
ref: ref,
|
|
1502
1501
|
"data-testid": testId,
|
|
1503
|
-
"data-
|
|
1502
|
+
"data-table-footer": true
|
|
1504
1503
|
}, otherProps), children);
|
|
1505
1504
|
});
|
|
1506
1505
|
|
|
@@ -1564,7 +1563,7 @@ const CardImage = /*#__PURE__*/React.forwardRef(function CardImage({
|
|
|
1564
1563
|
}, ref) {
|
|
1565
1564
|
return React__default.createElement("div", Object.assign({
|
|
1566
1565
|
ref: ref,
|
|
1567
|
-
"data-
|
|
1566
|
+
"data-card-image": true,
|
|
1568
1567
|
"data-testid": testId
|
|
1569
1568
|
}, otherProps), children);
|
|
1570
1569
|
});
|
|
@@ -1576,7 +1575,7 @@ const CardContent = /*#__PURE__*/React.forwardRef(function CardContent({
|
|
|
1576
1575
|
}, ref) {
|
|
1577
1576
|
return React__default.createElement("section", Object.assign({
|
|
1578
1577
|
ref: ref,
|
|
1579
|
-
"data-
|
|
1578
|
+
"data-card-content": true,
|
|
1580
1579
|
"data-testid": testId
|
|
1581
1580
|
}, otherProps), children);
|
|
1582
1581
|
});
|
|
@@ -1588,7 +1587,7 @@ const CardActions = /*#__PURE__*/React.forwardRef(function CardActions({
|
|
|
1588
1587
|
}, ref) {
|
|
1589
1588
|
return React__default.createElement("div", Object.assign({
|
|
1590
1589
|
ref: ref,
|
|
1591
|
-
"data-
|
|
1590
|
+
"data-card-actions": true,
|
|
1592
1591
|
"data-testid": testId
|
|
1593
1592
|
}, otherProps), children);
|
|
1594
1593
|
});
|