@orangesk/orange-design-system 1.4.0 → 1.5.1
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/build/app.css +1 -1
- package/build/app.css.map +1 -1
- package/build/app.js +1 -1
- package/build/app.js.map +1 -1
- package/build/asset-manifest.json +1 -1
- package/build/components/Alert/index.js +1 -1
- package/build/components/Alert/index.js.map +1 -1
- package/build/components/Alert/style.css +1 -1
- package/build/components/Alert/style.css.map +1 -1
- package/build/components/CartTable/index.js +1 -1
- package/build/components/CartTable/index.js.map +1 -1
- package/build/components/Forms/Autocomplete/style.css +1 -1
- package/build/components/Forms/Autocomplete/style.css.map +1 -1
- package/build/components/Forms/Field/style.css +1 -1
- package/build/components/Forms/Field/style.css.map +1 -1
- package/build/components/Forms/Group/style.css +1 -1
- package/build/components/Forms/Group/style.css.map +1 -1
- package/build/components/Forms/Select/style.css +1 -1
- package/build/components/Forms/Select/style.css.map +1 -1
- package/build/components/Forms/style.css +1 -1
- package/build/components/Forms/style.css.map +1 -1
- package/build/components/Table/index.js +1 -1
- package/build/components/Table/index.js.map +1 -1
- package/build/components/index.js +1 -1
- package/build/components/index.js.map +1 -1
- package/build/components/style.css +1 -1
- package/build/components/style.css.map +1 -1
- package/build/index.css +1 -1
- package/build/index.css.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/lib/components.css +1 -1
- package/build/lib/components.css.map +1 -1
- package/build/lib/scripts.js +1 -1
- package/build/lib/style.css +1 -1
- package/build/lib/style.css.map +1 -1
- package/build/lib/testingIframe.js +1 -1
- package/build/{precache-manifest.0d7dc03429ddd3ea2f6a224750ba57a9.js → precache-manifest.4b7a16f685454e3c539ae6e4e5520336.js} +18 -18
- package/build/{precache-manifest.726de66e3b25011c90fb350f15dd075e.js → precache-manifest.9566b2af93a03b37b102a4444d2a514f.js} +25 -25
- package/build/service-worker.js +1 -1
- package/build/static.js +1 -1
- package/build/tests/carttable/base.test.html +1 -1
- package/build/tests/carttable/discount-hide-first.test.html +1 -1
- package/build/tests/carttable/editable-with-optional.test.html +1 -1
- package/build/tests/carttable/large.test.html +1 -1
- package/build/tests/carttable/simple.test.html +1 -1
- package/build/tests/table/cellsize.test.html +1 -1
- package/build/tests/table/expandable.test.html +1 -1
- package/build/tests/table/footer.test.html +1 -1
- package/build/tests/table/scrollable.test.html +1 -1
- package/build/tests/table/sortable.test.html +1 -1
- package/build/tests/table/striped.test.html +1 -1
- package/package.json +1 -1
- package/src/components/Alert/Alert.js +5 -1
- package/src/components/Alert/Alert.mdx +33 -45
- package/src/components/Alert/styles/config.scss +1 -0
- package/src/components/Alert/styles/style.scss +4 -0
- package/src/components/Alert/tests/Alert.test.js +7 -0
- package/src/components/Forms/Select/styles/config.scss +1 -0
- package/src/components/Table/Table.js +19 -15
- package/src/components/Table/tests/Table.unit.test.js +1 -1
|
@@ -14,6 +14,14 @@ import TableStatic from './Table.static';
|
|
|
14
14
|
const propTypes = {
|
|
15
15
|
/** Caption helps users with screen readers to find a table and understand what it’s about and decide if they want to read it. */
|
|
16
16
|
caption: node,
|
|
17
|
+
expandableRowsCaptions: shape({
|
|
18
|
+
/** Text for screenreader in header of column with expandable button */
|
|
19
|
+
header: string,
|
|
20
|
+
/** Text for screenreader when row is not expandable*/
|
|
21
|
+
emptyRow: string,
|
|
22
|
+
}),
|
|
23
|
+
/** Foot element for table */
|
|
24
|
+
footers: arrayOf(object),
|
|
17
25
|
/** Labels for headers in the table. Value of the key in headers match with the key name in rows */
|
|
18
26
|
headers: arrayOf(
|
|
19
27
|
shape({
|
|
@@ -23,22 +31,14 @@ const propTypes = {
|
|
|
23
31
|
headCellProps: object,
|
|
24
32
|
})
|
|
25
33
|
).isRequired,
|
|
26
|
-
/** rows to print out in the table. */
|
|
27
|
-
rows: arrayOf(object).isRequired,
|
|
28
|
-
/** Foot element for table */
|
|
29
|
-
footers: arrayOf(object),
|
|
30
34
|
/** Compact table only takes spaced needed to display its content */
|
|
31
35
|
isCompact: bool,
|
|
32
|
-
/** Different colors for even and odd rows. */
|
|
33
|
-
isStriped: bool,
|
|
34
36
|
/** If table has horizontal scrollbar */
|
|
35
37
|
isScrollable: bool,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
emptyRow: string,
|
|
41
|
-
}),
|
|
38
|
+
/** Different colors for even and odd rows. */
|
|
39
|
+
isStriped: bool,
|
|
40
|
+
/** rows to print out in the table. */
|
|
41
|
+
rows: arrayOf(object).isRequired,
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
const defaultProps = {
|
|
@@ -119,7 +119,7 @@ const Table = ({
|
|
|
119
119
|
<div
|
|
120
120
|
className={`${CLASS_ROOT}-scrollable`}
|
|
121
121
|
role="group"
|
|
122
|
-
aria-labelledby
|
|
122
|
+
{...(caption && { 'aria-labelledby': captionId })}
|
|
123
123
|
/>
|
|
124
124
|
}
|
|
125
125
|
>
|
|
@@ -131,7 +131,11 @@ const Table = ({
|
|
|
131
131
|
className={classes}
|
|
132
132
|
{...other}
|
|
133
133
|
>
|
|
134
|
-
|
|
134
|
+
{caption && (
|
|
135
|
+
<caption {...(isScrollable && { id: captionId })}>
|
|
136
|
+
{caption}
|
|
137
|
+
</caption>
|
|
138
|
+
)}
|
|
135
139
|
<Header />
|
|
136
140
|
<Rows />
|
|
137
141
|
<Footer />
|
|
@@ -143,8 +147,8 @@ const Table = ({
|
|
|
143
147
|
return table;
|
|
144
148
|
};
|
|
145
149
|
|
|
146
|
-
Table.displayName = 'Table';
|
|
147
150
|
Table.propTypes = propTypes;
|
|
148
151
|
Table.defaultProps = defaultProps;
|
|
152
|
+
Table.displayName = 'Table';
|
|
149
153
|
|
|
150
154
|
export default Table;
|
|
@@ -227,7 +227,7 @@ describe('rendering Table', () => {
|
|
|
227
227
|
});
|
|
228
228
|
it('div wrapper with class table-scrollable has generated aria-labelledby', () => {
|
|
229
229
|
const { container } = render(
|
|
230
|
-
<Table headers={[]} rows={[]} isScrollable />
|
|
230
|
+
<Table headers={[]} rows={[]} isScrollable caption="text-caption" />
|
|
231
231
|
);
|
|
232
232
|
const pattern = /id-caption-\d+/;
|
|
233
233
|
expect(container.getElementsByClassName('table-scrollable').length).toBe(
|