@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.
Files changed (61) hide show
  1. package/build/app.css +1 -1
  2. package/build/app.css.map +1 -1
  3. package/build/app.js +1 -1
  4. package/build/app.js.map +1 -1
  5. package/build/asset-manifest.json +1 -1
  6. package/build/components/Alert/index.js +1 -1
  7. package/build/components/Alert/index.js.map +1 -1
  8. package/build/components/Alert/style.css +1 -1
  9. package/build/components/Alert/style.css.map +1 -1
  10. package/build/components/CartTable/index.js +1 -1
  11. package/build/components/CartTable/index.js.map +1 -1
  12. package/build/components/Forms/Autocomplete/style.css +1 -1
  13. package/build/components/Forms/Autocomplete/style.css.map +1 -1
  14. package/build/components/Forms/Field/style.css +1 -1
  15. package/build/components/Forms/Field/style.css.map +1 -1
  16. package/build/components/Forms/Group/style.css +1 -1
  17. package/build/components/Forms/Group/style.css.map +1 -1
  18. package/build/components/Forms/Select/style.css +1 -1
  19. package/build/components/Forms/Select/style.css.map +1 -1
  20. package/build/components/Forms/style.css +1 -1
  21. package/build/components/Forms/style.css.map +1 -1
  22. package/build/components/Table/index.js +1 -1
  23. package/build/components/Table/index.js.map +1 -1
  24. package/build/components/index.js +1 -1
  25. package/build/components/index.js.map +1 -1
  26. package/build/components/style.css +1 -1
  27. package/build/components/style.css.map +1 -1
  28. package/build/index.css +1 -1
  29. package/build/index.css.map +1 -1
  30. package/build/index.js +1 -1
  31. package/build/index.js.map +1 -1
  32. package/build/lib/components.css +1 -1
  33. package/build/lib/components.css.map +1 -1
  34. package/build/lib/scripts.js +1 -1
  35. package/build/lib/style.css +1 -1
  36. package/build/lib/style.css.map +1 -1
  37. package/build/lib/testingIframe.js +1 -1
  38. package/build/{precache-manifest.0d7dc03429ddd3ea2f6a224750ba57a9.js → precache-manifest.4b7a16f685454e3c539ae6e4e5520336.js} +18 -18
  39. package/build/{precache-manifest.726de66e3b25011c90fb350f15dd075e.js → precache-manifest.9566b2af93a03b37b102a4444d2a514f.js} +25 -25
  40. package/build/service-worker.js +1 -1
  41. package/build/static.js +1 -1
  42. package/build/tests/carttable/base.test.html +1 -1
  43. package/build/tests/carttable/discount-hide-first.test.html +1 -1
  44. package/build/tests/carttable/editable-with-optional.test.html +1 -1
  45. package/build/tests/carttable/large.test.html +1 -1
  46. package/build/tests/carttable/simple.test.html +1 -1
  47. package/build/tests/table/cellsize.test.html +1 -1
  48. package/build/tests/table/expandable.test.html +1 -1
  49. package/build/tests/table/footer.test.html +1 -1
  50. package/build/tests/table/scrollable.test.html +1 -1
  51. package/build/tests/table/sortable.test.html +1 -1
  52. package/build/tests/table/striped.test.html +1 -1
  53. package/package.json +1 -1
  54. package/src/components/Alert/Alert.js +5 -1
  55. package/src/components/Alert/Alert.mdx +33 -45
  56. package/src/components/Alert/styles/config.scss +1 -0
  57. package/src/components/Alert/styles/style.scss +4 -0
  58. package/src/components/Alert/tests/Alert.test.js +7 -0
  59. package/src/components/Forms/Select/styles/config.scss +1 -0
  60. package/src/components/Table/Table.js +19 -15
  61. package/src/components/Table/tests/Table.unit.test.js +1 -1
@@ -12,6 +12,7 @@ $base: (
12
12
  appearance: none,
13
13
  -webkit-appearance: none,
14
14
  color: color.$black,
15
+ overflow: hidden,
15
16
  );
16
17
 
17
18
  $states: (
@@ -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
- expandableRowsCaptions: shape({
37
- /** Text for screenreader in header of column with expandable button */
38
- header: string,
39
- /** Text for screenreader when row is not expandable*/
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={captionId}
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
- <caption id={captionId}>{caption}</caption>
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(