@innovaccer/design-system 2.7.0-1 → 2.7.0

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 (47) hide show
  1. package/CHANGELOG.md +15 -1
  2. package/core/accessibility/utils/useAccessibilityProps.ts +30 -6
  3. package/core/components/atoms/_chip/__tests__/__snapshots__/_chip.test.tsx.snap +8 -0
  4. package/core/components/atoms/avatarGroup/AvatarGroup.tsx +1 -0
  5. package/core/components/atoms/avatarGroup/__stories__/index.story.tsx +1 -1
  6. package/core/components/atoms/button/__tests__/__snapshots__/Button.test.tsx.snap +9 -0
  7. package/core/components/atoms/checkbox/__tests__/__snapshots__/Checkbox.test.tsx.snap +6 -0
  8. package/core/components/atoms/chipGroup/__tests__/__snapshots__/chipGroup.test.tsx.snap +4 -0
  9. package/core/components/atoms/dropdown/__tests__/__snapshots__/Dropdown.test.tsx.snap +29 -0
  10. package/core/components/atoms/input/__tests__/__snapshots__/Input.test.tsx.snap +5 -0
  11. package/core/components/atoms/message/__tests__/__snapshots__/Message.test.tsx.snap +4 -0
  12. package/core/components/atoms/metaList/__tests__/__snapshots__/MetaList.test.tsx.snap +296 -0
  13. package/core/components/atoms/metricInput/__tests__/__snapshots__/MetricInput.test.tsx.snap +2 -0
  14. package/core/components/atoms/multiSlider/Handle.tsx +1 -0
  15. package/core/components/atoms/toast/__tests__/__snapshots__/Toast.test.tsx.snap +12 -0
  16. package/core/components/molecules/dialog/__tests__/__snapshots__/Dialog.test.tsx.snap +13 -0
  17. package/core/components/molecules/dropzone/Dropzone.tsx +16 -9
  18. package/core/components/molecules/dropzone/__stories__/index.story.tsx +15 -1
  19. package/core/components/molecules/dropzone/__tests__/__snapshots__/Dropzone.test.tsx.snap +68 -70
  20. package/core/components/molecules/editableDropdown/__tests__/__snapshots__/EditableDropdown.test.tsx.snap +1 -0
  21. package/core/components/molecules/fileList/__tests__/__snapshots__/FileList.test.tsx.snap +5 -0
  22. package/core/components/molecules/fileUploader/__tests__/__snapshots__/FileUploader.test.tsx.snap +6 -0
  23. package/core/components/molecules/fileUploader/__tests__/__snapshots__/FileUploaderList.test.tsx.snap +5 -0
  24. package/core/components/molecules/fullscreenModal/__tests__/__snapshots__/Fullscreen.test.tsx.snap +6 -0
  25. package/core/components/molecules/modal/__tests__/__snapshots__/Modal.test.tsx.snap +30 -0
  26. package/core/components/molecules/overlayHeader/__tests__/__snapshots__/OverlayHeader.test.tsx.snap +1 -0
  27. package/core/components/molecules/pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +8 -0
  28. package/core/components/molecules/sidesheet/__tests__/__snapshots__/Sidesheet.test.tsx.snap +2 -0
  29. package/core/components/molecules/stepper/__tests__/__snapshots__/Stepper.test.tsx.snap +4 -0
  30. package/core/components/molecules/tabs/__tests__/__snapshots__/Tabs.test.tsx.snap +2 -0
  31. package/core/components/organisms/calendar/__tests__/__snapshots__/Calendar.test.tsx.snap +98 -0
  32. package/core/components/organisms/datePicker/__tests__/__snapshots__/DatePicker.test.tsx.snap +34 -0
  33. package/core/components/organisms/dateRangePicker/__tests__/__snapshots__/DateRangePicker.test.tsx.snap +606 -0
  34. package/core/components/organisms/horizontalNav/__tests__/__snapshots__/HorizontalNav.test.tsx.snap +1 -0
  35. package/core/components/organisms/inlineMessage/__tests__/__snapshots__/InlineMessage.test.tsx.snap +4 -0
  36. package/core/components/organisms/navigation/__tests__/__snapshots__/Navigation.test.tsx.snap +2 -0
  37. package/core/components/organisms/table/__tests__/__snapshots__/Table.test.tsx.snap +1800 -0
  38. package/core/components/organisms/verticalNav/__tests__/__snapshots__/VerticalNav.test.tsx.snap +14 -0
  39. package/core/utils/__tests__/__snapshots__/TS.test.tsx.snap +19 -0
  40. package/dist/core/accessibility/utils/useAccessibilityProps.d.ts +4 -3
  41. package/dist/index.esm.js +40 -18
  42. package/dist/index.js +39 -17
  43. package/dist/index.js.map +1 -1
  44. package/dist/index.umd.js +1 -1
  45. package/dist/index.umd.js.br +0 -0
  46. package/dist/index.umd.js.gz +0 -0
  47. package/package.json +1 -1
@@ -18,6 +18,7 @@ exports[`Vertical Navigation component
18
18
  <i
19
19
  class="material-icons material-icons-round Icon Icon--default"
20
20
  data-test="DesignSystem-VerticalNav--Icon"
21
+ role="button"
21
22
  style="font-size: 16px; width: 16px;"
22
23
  >
23
24
  assignment_ind_round
@@ -34,6 +35,7 @@ exports[`Vertical Navigation component
34
35
  <i
35
36
  class="material-icons material-icons-round Icon Icon--default"
36
37
  data-test="DesignSystem-VerticalNav--Icon"
38
+ role="button"
37
39
  style="font-size: 16px; width: 16px;"
38
40
  >
39
41
  forum_round
@@ -49,6 +51,7 @@ exports[`Vertical Navigation component
49
51
  <i
50
52
  class="material-icons material-icons-round Icon Icon--info"
51
53
  data-test="DesignSystem-VerticalNav--Icon"
54
+ role="button"
52
55
  style="font-size: 16px; width: 16px;"
53
56
  >
54
57
  assignment_ind_round
@@ -64,6 +67,7 @@ exports[`Vertical Navigation component
64
67
  <i
65
68
  class="material-icons material-icons-round Icon Icon--default"
66
69
  data-test="DesignSystem-VerticalNav--Icon"
70
+ role="button"
67
71
  style="font-size: 16px; width: 16px;"
68
72
  >
69
73
  events_round
@@ -80,6 +84,7 @@ exports[`Vertical Navigation component
80
84
  <i
81
85
  class="material-icons material-icons-round Icon Icon--disabled"
82
86
  data-test="DesignSystem-VerticalNav--Icon"
87
+ role="button"
83
88
  style="font-size: 16px; width: 16px;"
84
89
  >
85
90
  airline_seat_flat_angled_round
@@ -96,6 +101,7 @@ exports[`Vertical Navigation component
96
101
  <i
97
102
  class="material-icons material-icons-round Icon Icon--default"
98
103
  data-test="DesignSystem-VerticalNav--Icon"
104
+ role="button"
99
105
  style="font-size: 16px; width: 16px;"
100
106
  >
101
107
  favorite_round
@@ -135,6 +141,7 @@ exports[`Vertical Navigation component
135
141
  <i
136
142
  class="material-icons material-icons-round Icon Icon--default mr-4"
137
143
  data-test="DesignSystem-VerticalNav--Icon"
144
+ role="button"
138
145
  style="font-size: 16px; width: 16px;"
139
146
  >
140
147
  assignment_ind_round
@@ -173,6 +180,7 @@ exports[`Vertical Navigation component
173
180
  <i
174
181
  class="material-icons material-icons-round Icon Icon--default mr-4"
175
182
  data-test="DesignSystem-VerticalNav--Icon"
183
+ role="button"
176
184
  style="font-size: 16px; width: 16px;"
177
185
  >
178
186
  forum_round
@@ -186,6 +194,7 @@ exports[`Vertical Navigation component
186
194
  </div>
187
195
  <i
188
196
  class="material-icons material-icons-round Icon Icon--subtle mx-4"
197
+ role="button"
189
198
  style="font-size: 16px; width: 16px;"
190
199
  >
191
200
  keyboard_arrow_up_round
@@ -200,6 +209,7 @@ exports[`Vertical Navigation component
200
209
  <i
201
210
  class="material-icons material-icons-round Icon Icon--info mr-4"
202
211
  data-test="DesignSystem-VerticalNav--Icon"
212
+ role="button"
203
213
  style="font-size: 16px; width: 16px;"
204
214
  >
205
215
  assignment_ind_round
@@ -221,6 +231,7 @@ exports[`Vertical Navigation component
221
231
  <i
222
232
  class="material-icons material-icons-round Icon Icon--default mr-4"
223
233
  data-test="DesignSystem-VerticalNav--Icon"
234
+ role="button"
224
235
  style="font-size: 16px; width: 16px;"
225
236
  >
226
237
  events_round
@@ -243,6 +254,7 @@ exports[`Vertical Navigation component
243
254
  <i
244
255
  class="material-icons material-icons-round Icon Icon--disabled mr-4"
245
256
  data-test="DesignSystem-VerticalNav--Icon"
257
+ role="button"
246
258
  style="font-size: 16px; width: 16px;"
247
259
  >
248
260
  airline_seat_flat_angled_round
@@ -271,6 +283,7 @@ exports[`Vertical Navigation component
271
283
  <i
272
284
  class="material-icons material-icons-round Icon Icon--default mr-4"
273
285
  data-test="DesignSystem-VerticalNav--Icon"
286
+ role="button"
274
287
  style="font-size: 16px; width: 16px;"
275
288
  >
276
289
  favorite_round
@@ -284,6 +297,7 @@ exports[`Vertical Navigation component
284
297
  </div>
285
298
  <i
286
299
  class="material-icons material-icons-round Icon Icon--subtle mx-4"
300
+ role="button"
287
301
  style="font-size: 16px; width: 16px;"
288
302
  >
289
303
  keyboard_arrow_down_round
@@ -9,6 +9,7 @@ exports[`TS renders children 1`] = `
9
9
  <i
10
10
  class="material-icons material-icons-round Icon Icon--white Avatar-content--secondary"
11
11
  data-test="DesignSystem-Avatar--Icon"
12
+ role="button"
12
13
  style="font-size: 16px; width: 16px;"
13
14
  >
14
15
  person_round
@@ -114,6 +115,7 @@ exports[`TS renders children 1`] = `
114
115
  <i
115
116
  class="material-icons material-icons-round Icon Icon--default"
116
117
  data-test="DesignSystem-Button--Icon"
118
+ role="button"
117
119
  style="font-size: 16px; width: 16px;"
118
120
  >
119
121
  arrow_back_round
@@ -134,6 +136,7 @@ exports[`TS renders children 1`] = `
134
136
  </h5>
135
137
  <i
136
138
  class="material-icons material-icons-round Icon Icon--inverse pl-3"
139
+ role="button"
137
140
  style="font-size: 16px; width: 16px;"
138
141
  >
139
142
  keyboard_arrow_down_round
@@ -150,6 +153,7 @@ exports[`TS renders children 1`] = `
150
153
  </h5>
151
154
  <i
152
155
  class="material-icons material-icons-round Icon Icon--inverse pl-3"
156
+ role="button"
153
157
  style="font-size: 16px; width: 16px;"
154
158
  >
155
159
  keyboard_arrow_down_round
@@ -168,6 +172,7 @@ exports[`TS renders children 1`] = `
168
172
  <i
169
173
  class="material-icons material-icons-round Icon Icon--default"
170
174
  data-test="DesignSystem-Button--Icon"
175
+ role="button"
171
176
  style="font-size: 16px; width: 16px;"
172
177
  >
173
178
  arrow_forward_round
@@ -759,6 +764,7 @@ exports[`TS renders children 1`] = `
759
764
  </div>
760
765
  <i
761
766
  class="material-icons material-icons-round Icon Icon--default"
767
+ role="button"
762
768
  style="font-size: 16px; width: 16px;"
763
769
  >
764
770
  keyboard_arrow_down_round
@@ -796,6 +802,7 @@ exports[`TS renders children 1`] = `
796
802
  />
797
803
  <i
798
804
  class="material-icons material-icons-round Icon Icon--default"
805
+ role="button"
799
806
  style="font-size: 16px; width: 16px;"
800
807
  >
801
808
  keyboard_arrow_down_round
@@ -836,6 +843,7 @@ exports[`TS renders children 1`] = `
836
843
  </h4>
837
844
  <i
838
845
  class="material-icons material-icons-round Icon"
846
+ role="button"
839
847
  style="font-size: 16px; width: 16px;"
840
848
  >
841
849
  Hello World!_round
@@ -932,6 +940,7 @@ exports[`TS renders children 1`] = `
932
940
  <i
933
941
  class="material-icons material-icons-round Icon Icon--info Message-icon Message-icon--info"
934
942
  data-test="DesignSystem-Message--Icon"
943
+ role="button"
935
944
  style="font-size: 16px; width: 16px;"
936
945
  >
937
946
  info_round
@@ -1493,6 +1502,7 @@ exports[`TS renders children 1`] = `
1493
1502
  >
1494
1503
  <i
1495
1504
  class="material-icons material-icons-round Icon Toast-icon Toast-icon--left Toast-icon--info"
1505
+ role="button"
1496
1506
  style="font-size: 16px; width: 16px;"
1497
1507
  >
1498
1508
  info_round
@@ -1568,6 +1578,7 @@ exports[`TS renders children 1`] = `
1568
1578
  <i
1569
1579
  class="material-icons material-icons-round Icon Icon--default"
1570
1580
  data-test="DesignSystem-Button--Icon"
1581
+ role="button"
1571
1582
  style="font-size: 16px; width: 16px;"
1572
1583
  >
1573
1584
  close_round
@@ -1621,6 +1632,7 @@ exports[`TS renders children 1`] = `
1621
1632
  <i
1622
1633
  class="material-icons material-icons-round Icon Icon--disabled"
1623
1634
  data-test="DesignSystem-Button--Icon"
1635
+ role="button"
1624
1636
  style="font-size: 16px; width: 16px;"
1625
1637
  >
1626
1638
  first_page_round
@@ -1639,6 +1651,7 @@ exports[`TS renders children 1`] = `
1639
1651
  <i
1640
1652
  class="material-icons material-icons-round Icon Icon--disabled"
1641
1653
  data-test="DesignSystem-Button--Icon"
1654
+ role="button"
1642
1655
  style="font-size: 16px; width: 16px;"
1643
1656
  >
1644
1657
  navigate_before_round
@@ -1661,6 +1674,7 @@ exports[`TS renders children 1`] = `
1661
1674
  <i
1662
1675
  class="material-icons material-icons-round Icon Icon--disabled"
1663
1676
  data-test="DesignSystem-Button--Icon"
1677
+ role="button"
1664
1678
  style="font-size: 16px; width: 16px;"
1665
1679
  >
1666
1680
  navigate_next_round
@@ -1679,6 +1693,7 @@ exports[`TS renders children 1`] = `
1679
1693
  <i
1680
1694
  class="material-icons material-icons-round Icon Icon--disabled"
1681
1695
  data-test="DesignSystem-Button--Icon"
1696
+ role="button"
1682
1697
  style="font-size: 16px; width: 16px;"
1683
1698
  >
1684
1699
  last_page_round
@@ -1766,6 +1781,7 @@ exports[`TS renders children 1`] = `
1766
1781
  <i
1767
1782
  class="material-icons material-icons-round Icon Icon--default"
1768
1783
  data-test="DesignSystem-Button--Icon"
1784
+ role="button"
1769
1785
  style="font-size: 16px; width: 16px;"
1770
1786
  >
1771
1787
  arrow_back_round
@@ -1786,6 +1802,7 @@ exports[`TS renders children 1`] = `
1786
1802
  </h5>
1787
1803
  <i
1788
1804
  class="material-icons material-icons-round Icon Icon--inverse pl-3"
1805
+ role="button"
1789
1806
  style="font-size: 16px; width: 16px;"
1790
1807
  >
1791
1808
  keyboard_arrow_down_round
@@ -1802,6 +1819,7 @@ exports[`TS renders children 1`] = `
1802
1819
  </h5>
1803
1820
  <i
1804
1821
  class="material-icons material-icons-round Icon Icon--inverse pl-3"
1822
+ role="button"
1805
1823
  style="font-size: 16px; width: 16px;"
1806
1824
  >
1807
1825
  keyboard_arrow_down_round
@@ -1820,6 +1838,7 @@ exports[`TS renders children 1`] = `
1820
1838
  <i
1821
1839
  class="material-icons material-icons-round Icon Icon--default"
1822
1840
  data-test="DesignSystem-Button--Icon"
1841
+ role="button"
1823
1842
  style="font-size: 16px; width: 16px;"
1824
1843
  >
1825
1844
  arrow_forward_round
@@ -1,18 +1,19 @@
1
1
  import * as React from 'react';
2
+ declare type AriaRoleType = React.AriaRole;
2
3
  interface IProps {
3
4
  onClick?: (event: React.MouseEvent<HTMLElement>) => void;
4
5
  onKeyDown?: (event: React.KeyboardEvent<HTMLElement>) => void;
5
- role?: React.AriaRole;
6
+ role?: AriaRoleType;
6
7
  'aria-label'?: React.AriaAttributes['aria-label'];
7
8
  }
8
9
  declare const useAccessibilityProps: ({ onClick, onKeyDown, role, ...rest }: IProps) => {
9
10
  onClick: (event: React.MouseEvent<HTMLElement>) => void;
10
- role: string & {};
11
+ role: React.AriaRole;
11
12
  tabIndex: number;
12
13
  'aria-label': string | undefined;
13
14
  onKeyDown: (e: React.SyntheticEvent<HTMLElement>) => void;
14
15
  } | {
15
- role: "search" | "link" | "form" | "list" | "alert" | "article" | "button" | "dialog" | "figure" | "img" | "main" | "menu" | "menuitem" | "option" | "table" | "switch" | "tooltip" | (string & {}) | "none" | "alertdialog" | "application" | "banner" | "cell" | "checkbox" | "columnheader" | "combobox" | "complementary" | "contentinfo" | "definition" | "directory" | "document" | "feed" | "grid" | "gridcell" | "group" | "heading" | "listbox" | "listitem" | "log" | "marquee" | "math" | "menubar" | "menuitemcheckbox" | "menuitemradio" | "navigation" | "note" | "presentation" | "progressbar" | "radio" | "radiogroup" | "region" | "row" | "rowgroup" | "rowheader" | "scrollbar" | "searchbox" | "separator" | "slider" | "spinbutton" | "status" | "tab" | "tablist" | "tabpanel" | "term" | "textbox" | "timer" | "toolbar" | "tree" | "treegrid" | "treeitem" | undefined;
16
+ role: React.AriaRole;
16
17
  'aria-label': string | undefined;
17
18
  };
18
19
  export default useAccessibilityProps;
package/dist/index.esm.js CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  /**
3
- * Generated on: 1640111363670
3
+ * Generated on: 1640268334979
4
4
  * Package: @innovaccer/design-system
5
- * Version: v2.7.0-1
5
+ * Version: v2.7.0
6
6
  * License: MIT
7
7
  * Docs: https://innovaccer.github.io/design-system
8
8
  */
@@ -948,7 +948,8 @@ var AvatarGroup = function AvatarGroup(props) {
948
948
  trigger: trigger,
949
949
  position: position,
950
950
  appendToBody: appendToBody,
951
- className: popperClass
951
+ className: popperClass,
952
+ offset: "medium"
952
953
  }, renderPopper()));
953
954
  };
954
955
  AvatarGroup.displayName = 'AvatarGroup';
@@ -1342,25 +1343,38 @@ Text.defaultProps = {
1342
1343
  size: 'regular'
1343
1344
  };
1344
1345
 
1345
- var isEnterKey = function isEnterKey(e) {
1346
- return e.key === 'Enter';
1347
- };
1348
-
1349
1346
  var isSpaceKey = function isSpaceKey(e) {
1350
1347
  return e.key === 'Space';
1351
1348
  };
1352
1349
 
1353
1350
  var _excluded$x = ["onClick", "onKeyDown", "role"];
1351
+ var allowed = {
1352
+ button: new Set(['Enter', 'Space', 'Spacebar', ' ']),
1353
+ link: new Set(['Enter']),
1354
+ // onChange handles everything, no need for extra keyboard interaction
1355
+ checkbox: new Set([]),
1356
+ radio: new Set([])
1357
+ }; // Refer for keyboard interactions: https://webaim.org/techniques/keyboard/#testing
1358
+
1359
+ var isKeyboardInteractionAllowed = function isKeyboardInteractionAllowed(role, key) {
1360
+ if (!allowed[role]) {
1361
+ return false;
1362
+ }
1363
+
1364
+ var allowedKeys = allowed[role];
1365
+ return allowedKeys.has(key);
1366
+ };
1354
1367
 
1355
1368
  var useAccessibilityProps = function useAccessibilityProps(_ref) {
1356
1369
  var onClick = _ref.onClick,
1357
1370
  _onKeyDown = _ref.onKeyDown,
1358
- role = _ref.role,
1371
+ _ref$role = _ref.role,
1372
+ role = _ref$role === void 0 ? 'button' : _ref$role,
1359
1373
  rest = _objectWithoutProperties$1(_ref, _excluded$x);
1360
1374
 
1361
1375
  return _objectSpread2({}, onClick ? {
1362
1376
  onClick: onClick,
1363
- role: role || 'button',
1377
+ role: role,
1364
1378
  tabIndex: 0,
1365
1379
  'aria-label': rest['aria-label'],
1366
1380
  onKeyDown: function onKeyDown(e) {
@@ -1370,8 +1384,13 @@ var useAccessibilityProps = function useAccessibilityProps(_ref) {
1370
1384
  return;
1371
1385
  }
1372
1386
 
1373
- if (isEnterKey(e) && onClick) {
1374
- onClick(e);
1387
+ var key = e.key;
1388
+
1389
+ if (isKeyboardInteractionAllowed(role, key)) {
1390
+ if (onClick) {
1391
+ e.preventDefault();
1392
+ onClick(e);
1393
+ }
1375
1394
  }
1376
1395
  }
1377
1396
  } : {
@@ -6349,7 +6368,7 @@ var Handle = /*#__PURE__*/function (_React$Component) {
6349
6368
  var _this$props2 = _this.props,
6350
6369
  stepSize = _this$props2.stepSize,
6351
6370
  value = _this$props2.value;
6352
- var keyCode = event.keyCode;
6371
+ var keyCode = event.keyCode; // TODO(a11y): add ARROW_DOWN & ARROW_UP too
6353
6372
 
6354
6373
  if (keyCode === ARROW_LEFT) {
6355
6374
  _this.changeValue(value - stepSize);
@@ -16712,6 +16731,10 @@ var Dropzone = function Dropzone(props) {
16712
16731
  if (isDragActive) return /*#__PURE__*/React.createElement(DropzoneActive, {
16713
16732
  type: type
16714
16733
  });
16734
+ var buttonAccessibilityProps = useAccessibilityProps({
16735
+ onClick: open,
16736
+ 'aria-label': 'Drag your files here or click to select files'
16737
+ });
16715
16738
  return /*#__PURE__*/React.createElement(React.Fragment, null, type !== 'tight' && /*#__PURE__*/React.createElement(Icon, {
16716
16739
  name: "backup",
16717
16740
  size: 64,
@@ -16724,14 +16747,13 @@ var Dropzone = function Dropzone(props) {
16724
16747
  weight: "strong",
16725
16748
  className: "mr-2",
16726
16749
  appearance: disabled ? 'disabled' : 'default'
16727
- }, "Drag your files here or"), /*#__PURE__*/React.createElement("span", {
16728
- className: "cursor-pointer",
16729
- onClick: open
16730
- }, /*#__PURE__*/React.createElement(Text, {
16750
+ }, "Drag your files here or"), /*#__PURE__*/React.createElement(Text, _extends$3({
16751
+ tabIndex: disabled ? -1 : 0,
16752
+ className: "ml-2 cursor-pointer",
16731
16753
  size: "large",
16732
16754
  weight: "strong",
16733
16755
  appearance: disabled ? 'disabled' : 'link'
16734
- }, "browse files")), /*#__PURE__*/React.createElement("input", getInputProps())), formatLabel && /*#__PURE__*/React.createElement(Text, {
16756
+ }, buttonAccessibilityProps), "browse files"), /*#__PURE__*/React.createElement("input", getInputProps())), formatLabel && /*#__PURE__*/React.createElement(Text, {
16735
16757
  appearance: disabled ? 'disabled' : 'subtle'
16736
16758
  }, formatLabel), sizeLabel && /*#__PURE__*/React.createElement(Text, {
16737
16759
  appearance: disabled ? 'disabled' : 'subtle'
@@ -20324,6 +20346,6 @@ Divider.defaultProps = {
20324
20346
  vertical: false
20325
20347
  };
20326
20348
 
20327
- var version = "2.7.0-1";
20349
+ var version = "2.7.0";
20328
20350
 
20329
20351
  export { Avatar, AvatarGroup, Backdrop, Badge, Breadcrumbs, Button, Calendar, Caption, Card, CardBody, CardFooter, CardHeader, CardSubdued, ChatMessage, Checkbox, Chip, ChipGroup, ChipInput, ChoiceList, Collapsible, Column, DatePicker, DateRangePicker, Dialog, Divider, Dropdown, Dropzone, EditableChipInput, EditableDropdown, EditableInput, EmptyState, FileList, FileUploader, FileUploaderList, FullscreenModal, Grid, GridCell, Heading, HorizontalNav, Icon, InlineMessage, Input, X as InputMask, Label, Legend, Link, List, Message, MetaList, MetricInput, Modal, ModalBody, ModalDescription, ModalFooter, ModalHeader, MultiSlider, Navigation, OutsideClick, PageHeader, Pagination, Paragraph, Pills, Placeholder, PlaceholderParagraph, Popover, ProgressBar, ProgressRing, Radio, RangeSlider, Row, Sidesheet, Slider, Spinner, StatusHint, Stepper, Subheading, Switch, Tab, Table, Tabs, TabsWrapper, Text, Textarea, TimePicker, Toast, Tooltip, index$1 as Utils, VerificationCodeInput, VerticalNav, version };
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
 
2
2
  /**
3
- * Generated on: 1640111364015
3
+ * Generated on: 1640268335290
4
4
  * Package: @innovaccer/design-system
5
- * Version: v2.7.0-1
5
+ * Version: v2.7.0
6
6
  * License: MIT
7
7
  * Docs: https://innovaccer.github.io/design-system
8
8
  */
@@ -593,7 +593,8 @@
593
593
  trigger: trigger,
594
594
  position: position,
595
595
  appendToBody: appendToBody,
596
- className: popperClass
596
+ className: popperClass,
597
+ offset: "medium"
597
598
  }, renderPopper()));
598
599
  };
599
600
  AvatarGroup.displayName = 'AvatarGroup';
@@ -980,23 +981,36 @@
980
981
  size: 'regular'
981
982
  };
982
983
 
983
- var isEnterKey = function isEnterKey(e) {
984
- return e.key === 'Enter';
985
- };
986
-
987
984
  var isSpaceKey = function isSpaceKey(e) {
988
985
  return e.key === 'Space';
989
986
  };
990
987
 
988
+ var allowed = {
989
+ button: new Set(['Enter', 'Space', 'Spacebar', ' ']),
990
+ link: new Set(['Enter']),
991
+ checkbox: new Set([]),
992
+ radio: new Set([])
993
+ };
994
+
995
+ var isKeyboardInteractionAllowed = function isKeyboardInteractionAllowed(role, key) {
996
+ if (!allowed[role]) {
997
+ return false;
998
+ }
999
+
1000
+ var allowedKeys = allowed[role];
1001
+ return allowedKeys.has(key);
1002
+ };
1003
+
991
1004
  var useAccessibilityProps = function useAccessibilityProps(_a) {
992
1005
  var onClick = _a.onClick,
993
1006
  _onKeyDown = _a.onKeyDown,
994
- role = _a.role,
1007
+ _b = _a.role,
1008
+ role = _b === void 0 ? 'button' : _b,
995
1009
  rest = __rest(_a, ["onClick", "onKeyDown", "role"]);
996
1010
 
997
1011
  return __assign({}, onClick ? {
998
1012
  onClick: onClick,
999
- role: role || 'button',
1013
+ role: role,
1000
1014
  tabIndex: 0,
1001
1015
  'aria-label': rest['aria-label'],
1002
1016
  onKeyDown: function onKeyDown(e) {
@@ -1006,8 +1020,13 @@
1006
1020
  return;
1007
1021
  }
1008
1022
 
1009
- if (isEnterKey(e) && onClick) {
1010
- onClick(e);
1023
+ var key = e.key;
1024
+
1025
+ if (isKeyboardInteractionAllowed(role, key)) {
1026
+ if (onClick) {
1027
+ e.preventDefault();
1028
+ onClick(e);
1029
+ }
1011
1030
  }
1012
1031
  }
1013
1032
  } : {
@@ -11289,6 +11308,10 @@
11289
11308
  if (isDragActive) return /*#__PURE__*/React__namespace.createElement(DropzoneActive, {
11290
11309
  type: type
11291
11310
  });
11311
+ var buttonAccessibilityProps = useAccessibilityProps({
11312
+ onClick: open,
11313
+ 'aria-label': 'Drag your files here or click to select files'
11314
+ });
11292
11315
  return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, type !== 'tight' && /*#__PURE__*/React__namespace.createElement(Icon, {
11293
11316
  name: "backup",
11294
11317
  size: 64,
@@ -11301,14 +11324,13 @@
11301
11324
  weight: "strong",
11302
11325
  className: "mr-2",
11303
11326
  appearance: disabled ? 'disabled' : 'default'
11304
- }, "Drag your files here or"), /*#__PURE__*/React__namespace.createElement("span", {
11305
- className: "cursor-pointer",
11306
- onClick: open
11307
- }, /*#__PURE__*/React__namespace.createElement(Text, {
11327
+ }, "Drag your files here or"), /*#__PURE__*/React__namespace.createElement(Text, __assign({
11328
+ tabIndex: disabled ? -1 : 0,
11329
+ className: "ml-2 cursor-pointer",
11308
11330
  size: "large",
11309
11331
  weight: "strong",
11310
11332
  appearance: disabled ? 'disabled' : 'link'
11311
- }, "browse files")), /*#__PURE__*/React__namespace.createElement("input", __assign({}, getInputProps()))), formatLabel && /*#__PURE__*/React__namespace.createElement(Text, {
11333
+ }, buttonAccessibilityProps), "browse files"), /*#__PURE__*/React__namespace.createElement("input", __assign({}, getInputProps()))), formatLabel && /*#__PURE__*/React__namespace.createElement(Text, {
11312
11334
  appearance: disabled ? 'disabled' : 'subtle'
11313
11335
  }, formatLabel), sizeLabel && /*#__PURE__*/React__namespace.createElement(Text, {
11314
11336
  appearance: disabled ? 'disabled' : 'subtle'
@@ -14769,7 +14791,7 @@
14769
14791
  vertical: false
14770
14792
  };
14771
14793
 
14772
- var version = "2.7.0-1";
14794
+ var version = "2.7.0";
14773
14795
 
14774
14796
  exports.Avatar = Avatar;
14775
14797
  exports.AvatarGroup = AvatarGroup;