@salesforce/design-system-react 0.10.46 → 0.10.47

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 (32) hide show
  1. package/components/combobox/combobox.jsx +1 -1
  2. package/components/component-docs.json +1 -2
  3. package/components/popover/__tests__/popover.browser-test.jsx +28 -0
  4. package/components/progress-indicator.d.ts +29 -8
  5. package/design-system-react-components.js +62406 -0
  6. package/design-system-react-components.js.map +1 -0
  7. package/design-system-react-components.min.js +3 -0
  8. package/design-system-react-components.min.js.LICENSE.txt +83 -0
  9. package/design-system-react-components.min.js.map +1 -0
  10. package/design-system-react.js +73800 -0
  11. package/design-system-react.js.map +1 -0
  12. package/design-system-react.min.js +3 -0
  13. package/design-system-react.min.js.LICENSE.txt +83 -0
  14. package/design-system-react.min.js.map +1 -0
  15. package/lib/components/combobox/combobox.js +1 -1
  16. package/lib/components/component-docs.json +1 -2
  17. package/lib/components/popover/__tests__/popover.browser-test.jsx +28 -0
  18. package/lib/components/progress-indicator.d.ts +29 -8
  19. package/lib/design-system-react-components.min.js.LICENSE.txt +83 -0
  20. package/lib/design-system-react.min.js.LICENSE.txt +83 -0
  21. package/lib/package.json +1 -1
  22. package/lib/utilities/keyboard-navigable-dialog.js +6 -1
  23. package/module/components/combobox/combobox.js +1 -1
  24. package/module/components/combobox/combobox.js.map +1 -1
  25. package/module/components/component-docs.json +1 -2
  26. package/module/components/popover/__tests__/popover.browser-test.js +25 -0
  27. package/module/components/popover/__tests__/popover.browser-test.js.map +1 -1
  28. package/module/components/progress-indicator.d.ts +29 -8
  29. package/module/utilities/keyboard-navigable-dialog.js +4 -1
  30. package/module/utilities/keyboard-navigable-dialog.js.map +1 -1
  31. package/package.json +1 -1
  32. package/utilities/keyboard-navigable-dialog.js +3 -0
@@ -260,7 +260,7 @@ const propTypes = {
260
260
  subTitle: PropTypes.string,
261
261
  title: PropTypes.string,
262
262
  type: PropTypes.string,
263
- disabled: PropTypes.boolean,
263
+ disabled: PropTypes.bool,
264
264
  tooltipContent: PropTypes.node,
265
265
  })
266
266
  ),
@@ -4967,8 +4967,7 @@
4967
4967
  "required": false
4968
4968
  },
4969
4969
  "disabled": {
4970
- "name": "custom",
4971
- "raw": "PropTypes.boolean",
4970
+ "name": "bool",
4972
4971
  "required": false
4973
4972
  },
4974
4973
  "tooltipContent": {
@@ -238,6 +238,34 @@ describe('SLDSPopover', function () {
238
238
  const trigger = wrapper.find(defaultIds.trigger);
239
239
  trigger.simulate('click');
240
240
  });
241
+
242
+ it('stops event propagation after closing on ESC', function (done) {
243
+ const mockEvent = {
244
+ key: 'Esc',
245
+ keyCode: 27,
246
+ which: 27,
247
+ stopPropagation: sinon.spy(),
248
+ };
249
+ wrapper = mount(
250
+ <DemoComponent
251
+ onOpen={() => {
252
+ wrapper.update();
253
+ const popover = wrapper.find(`#${defaultIds.popover}`);
254
+ popover.simulate('keyDown', mockEvent);
255
+ }}
256
+ onKeyDown={() => {
257
+ setTimeout(() => {
258
+ expect(mockEvent.stopPropagation.callCount).to.equal(1);
259
+ done();
260
+ }, 0);
261
+ }}
262
+ />,
263
+ { attachTo: mountNode }
264
+ );
265
+
266
+ const trigger = wrapper.find(defaultIds.trigger);
267
+ trigger.simulate('click');
268
+ });
241
269
  });
242
270
  });
243
271
 
@@ -1,5 +1,20 @@
1
1
  declare module '@salesforce/design-system-react/components/progress-indicator' {
2
2
  import React from 'react';
3
+
4
+ type Step = {
5
+ id: string | number;
6
+ label: string | JSX.Element;
7
+ assistiveText?: string;
8
+ };
9
+
10
+ type StepState = {
11
+ isCompleted: boolean;
12
+ isDisabled: boolean;
13
+ isError: boolean;
14
+ isSelected: boolean;
15
+ step: Step;
16
+ };
17
+
3
18
  type Props = {
4
19
  /**
5
20
  * **Assistive text for accessibility**
@@ -23,16 +38,16 @@ declare module '@salesforce/design-system-react/components/progress-indicator' {
23
38
  /**
24
39
  * Stores all completed steps. It is an array of step objects.
25
40
  */
26
- completedSteps?: any[];
41
+ completedSteps?: Step[];
27
42
  /**
28
43
  * Stores all disabled steps. It is an array of step objects. Steps are still clickable/focusable,
29
44
  * this only disables cursor change and removes onClick and onFocus event callbacks.
30
45
  */
31
- disabledSteps?: any[];
46
+ disabledSteps?: Step[];
32
47
  /**
33
48
  * Stores all error steps. It is an array of step objects and usually there is only one error step, the current step. If an error occurs a second error icon should be placed to the left of related confirmation buttons (e.g. Cancel, Save) and an Error Popover should appear indicating there are errors. These additional items are NOT part of this component. This note was included for visibility purposes. Please refer to [SLDS website](https://www.lightningdesignsystem.com/components/progress-indicator/) for full details **
34
49
  */
35
- errorSteps?: any[];
50
+ errorSteps?: Step[];
36
51
  /**
37
52
  * HTML id for component.
38
53
  */
@@ -48,7 +63,10 @@ declare module '@salesforce/design-system-react/components/progress-indicator' {
48
63
  * <ProgressIndicator onStepClick={handleStepClick} />
49
64
  * ```
50
65
  */
51
- onStepClick?: (v: any) => any;
66
+ onStepClick?: (
67
+ event: React.ChangeEvent<HTMLInputElement>,
68
+ data: StepState
69
+ ) => void;
52
70
  /**
53
71
  * Triggered when an individual step is focused. By default, it receives an event and returns step state and the step object clicked: `{ isCompleted, isDisabled, isError, isSelected, step }`. Users are able to pass a callback handleClick function in forms of: <function name>(event, data) where data is the callback result.
54
72
  * ```
@@ -56,11 +74,14 @@ declare module '@salesforce/design-system-react/components/progress-indicator' {
56
74
  * <ProgressIndicator onStepFocus={handleStepFocus} />
57
75
  * ```
58
76
  */
59
- onStepFocus?: (v: any) => any;
77
+ onStepFocus?: (
78
+ event: React.ChangeEvent<HTMLInputElement>,
79
+ data: StepState
80
+ ) => void;
60
81
  /**
61
82
  * Represents the currently selected or active step. It is a step object.
62
83
  */
63
- selectedStep: Record<string, any> /*.isRequired*/;
84
+ selectedStep: Step /* .isRequired */;
64
85
  /**
65
86
  * It is an array of step objects in the following form:
66
87
  * ```
@@ -71,11 +92,11 @@ declare module '@salesforce/design-system-react/components/progress-indicator' {
71
92
  * }],
72
93
  * ```
73
94
  */
74
- steps: any[] /*.isRequired*/;
95
+ steps: Step[] /* .isRequired */;
75
96
  /**
76
97
  * Stores all steps with opened tooltips. This property is mainly for development purposes. The tooltip should only show on hover for the user.
77
98
  */
78
- tooltipIsOpenSteps?: any[];
99
+ tooltipIsOpenSteps?: Step[];
79
100
  /**
80
101
  * Determines component style.
81
102
  */