@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
@@ -294,6 +294,31 @@ describe('SLDSPopover', function () {
294
294
  var trigger = wrapper.find(defaultIds.trigger);
295
295
  trigger.simulate('click');
296
296
  });
297
+ it('stops event propagation after closing on ESC', function (done) {
298
+ var mockEvent = {
299
+ key: 'Esc',
300
+ keyCode: 27,
301
+ which: 27,
302
+ stopPropagation: sinon.spy()
303
+ };
304
+ wrapper = mount( /*#__PURE__*/React.createElement(DemoComponent, {
305
+ onOpen: function onOpen() {
306
+ wrapper.update();
307
+ var popover = wrapper.find("#".concat(defaultIds.popover));
308
+ popover.simulate('keyDown', mockEvent);
309
+ },
310
+ onKeyDown: function onKeyDown() {
311
+ setTimeout(function () {
312
+ expect(mockEvent.stopPropagation.callCount).to.equal(1);
313
+ done();
314
+ }, 0);
315
+ }
316
+ }), {
317
+ attachTo: mountNode
318
+ });
319
+ var trigger = wrapper.find(defaultIds.trigger);
320
+ trigger.simulate('click');
321
+ });
297
322
  });
298
323
  });
299
324
  describe('focus has moved to dialog', function () {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../.tmp-es/components/popover/__tests__/popover.browser-test.jsx"],"names":["React","PropTypes","chai","expect","chaiEnzyme","mount","createMountNode","destroyMountNode","Popover","Button","Dialog","IconSettings","use","defaultProps","id","body","heading","defaultIds","trigger","popover","DemoComponent","props","Component","isOpen","bool","describe","mountNode","wrapper","beforeEach","context","afterEach","it","attachTo","find","to","exist","have","attr","popoverBackgroundColor","containerBackgroundColor","optionalProps","className","assistiveText","closeButton","containerClassName","containerStyle","background","footer","style","text","prop","equal","triggerClicked","sinon","spy","done","setTimeout","not","update","callCount","simulate","key","keyCode","which","document","activeElement","popoverOpened"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,IAAeC,MAAf,QAA6B,MAA7B;AACA,OAAOC,UAAP,MAAuB,aAAvB;AACA,SAASC,KAAT,QAAsB,QAAtB;AAEA;AACA;AACA;AACA;AACA;;AACA,SACCC,eADD,EAECC,gBAFD,QAGO,+BAHP,C,CAKA;;AACA,OAAOC,OAAP,MAAoB,eAApB;A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B,MAAAA,gBAAgB,CAAC;AAAEoB,QAAAA,OAAO,EAAPA,OAAF;AAAWD,QAAAA,SAAS,EAATA;AAAX,OAAD,CAAhB;AACA,KAFQ,CAAT;AAIAK,IAAAA,EAAE,CAAC,oCAAD,EAAuC,YAAY;AACpDJ,MAAAA,OAAO,GAAGtB,KAAK,eACd,oBAAC,aAAD;AACC,QAAA,QAAQ,MADT;AAEC,QAAA,OAAO,EAAE+C,cAFV;AAGC,QAAA,MAAM,EAAEc;AAHT,QADc,EAMd;AAAElC,QAAAA,QAAQ,EAAEN;AAAZ,OANc,CAAf;AASA,UAAMR,OAAO,GAAGS,OAAO,CAACM,IAAR,CAAahB,UAAU,CAACC,OAAxB,CAAhB;AACAA,MAAAA,OAAO,CAAC0C,QAAR,CAAiB,OAAjB,EAA0B,EAA1B;AACAzD,MAAAA,MAAM,CAAC+D,aAAa,CAACP,SAAf,CAAN,CAAgCzB,EAAhC,CAAmCiB,KAAnC,CAAyC,CAAzC;AACA,KAbC,CAAF;AAcA,GA1BO,CAAR;AA2BA,CAxNO,CAAR","sourcesContent":["import React from 'react';\n\nimport PropTypes from 'prop-types';\nimport chai, { expect } from 'chai';\nimport chaiEnzyme from 'chai-enzyme';\nimport { mount } from 'enzyme';\n\n/* Enzyme Helpers that can mount and unmount React component instances to\n * the DOM and set `this.wrapper` and `this.dom` within Mocha's `this`\n * context [full source here](tests/enzyme-helpers.js). `this` can\n * only be referenced if inside `function () {}`.\n */\nimport {\n\tcreateMountNode,\n\tdestroyMountNode,\n} from '../../../tests/enzyme-helpers';\n\n// Import your internal dependencies (for example):\nimport Popover from '../../popover';\nimport Button from '../../button';\nimport Dialog from '../../utilities/dialog';\nimport IconSettings from '../../icon-settings';\n\n/* Set Chai to use chaiEnzyme for enzyme compatible assertions:\n * https://github.com/producthunt/chai-enzyme\n */\nchai.use(chaiEnzyme());\n\nconst defaultProps = {\n\tid: 'sample-popover',\n\tbody: <span id=\"sample-body\">This is the body</span>,\n\theading: <span id=\"sample-heading\">This is the heading</span>,\n};\n\nconst defaultIds = {\n\ttrigger: `button#${defaultProps.id}`,\n\tpopover: `${defaultProps.id}-popover`,\n\tbody: `${defaultProps.id}-dialog-body`,\n\theading: `${defaultProps.id}-dialog-heading`,\n};\n\n/* A re-usable demo component fixture outside of `describe` sections\n * can accept props within each test and be unmounted after each tests.\n * This wrapping component will be similar to your wrapping component\n * you will create in the React Storybook for manual testing.\n */\nclass DemoComponent extends React.Component {\n\tstatic displayName = 'PopoverDemoComponent';\n\n\tstatic propTypes = {\n\t\tisOpen: PropTypes.bool,\n\t};\n\n\tstatic defaultProps = defaultProps;\n\n\tstate = {};\n\n\t// event handlers\n\n\trender() {\n\t\treturn (\n\t\t\t<IconSettings iconPath=\"/assets/icons\">\n\t\t\t\t<div>\n\t\t\t\t\t<Popover {...this.props}>\n\t\t\t\t\t\t<Button label=\"Trigger Popover\" />\n\t\t\t\t\t</Popover>\n\t\t\t\t\t<Button id=\"not-the-trigger\" label=\"Not Trigger Popover\" />\n\t\t\t\t</div>\n\t\t\t</IconSettings>\n\t\t);\n\t}\n}\n\n/* All tests for component being tested should be wrapped in a root `describe`,\n * which should be named after the component being tested.\n * When read aloud, the cumulative `describe` and `it` names should form a coherent\n * sentence, eg \"Date Picker default structure and css is present with expected\n * attributes set\". If you are having trouble constructing a cumulative short\n * sentence, this may be an indicator that your test is poorly structured.\n * String provided as first parameter names the `describe` section. Limit to nouns\n * as much as possible/appropriate.`\n */\ndescribe('SLDSPopover', function () {\n\tlet mountNode;\n\tlet wrapper;\n\n\t// BASIC STRUCTURE\n\n\tdescribe('Default structure and css', function () {\n\t\tbeforeEach(() => {\n\t\t\tmountNode = createMountNode({ context: this });\n\t\t});\n\n\t\tafterEach(() => {\n\t\t\tdestroyMountNode({ wrapper, mountNode });\n\t\t});\n\n\t\tit('is open, has heading, body, close button', () => {\n\t\t\twrapper = mount(<DemoComponent isOpen />, { attachTo: mountNode });\n\n\t\t\texpect(wrapper.find(`#${defaultIds.heading}`)).to.exist;\n\t\t\texpect(wrapper.find(`#${defaultIds.body}`)).to.exist;\n\t\t\texpect(wrapper.find('.slds-popover__close')).to.exist;\n\t\t});\n\t});\n\n\tdescribe('Assistive technology', () => {\n\t\t/* Detect if presence of accessibility features such as ARIA\n\t\t * roles and screen reader text is present in the DOM.\n\t\t */\n\t\tbeforeEach(() => {\n\t\t\tmountNode = createMountNode({ context: this });\n\t\t});\n\n\t\tafterEach(() => {\n\t\t\tdestroyMountNode({ wrapper, mountNode });\n\t\t});\n\n\t\tit('has aria-labelledby/aria-describedby on popover', function () {\n\t\t\twrapper = mount(<DemoComponent isOpen />, { attachTo: mountNode });\n\n\t\t\tconst popover = wrapper.find(`#${defaultIds.popover}`);\n\t\t\texpect(popover).to.have.attr('aria-labelledby', defaultIds.heading);\n\t\t\texpect(popover).to.have.attr('aria-describedby', defaultIds.body);\n\t\t});\n\t});\n\n\t// PROPS AND CHILDREN\n\n\tdescribe('Optional props', () => {\n\t\tconst popoverBackgroundColor = 'rgb(255, 80, 121)';\n\t\tconst containerBackgroundColor = 'rgb(255, 127, 80)';\n\t\t// What should be present in the DOM when style and className are applied?\n\t\tconst optionalProps = {\n\t\t\tclassName: 'sample-classname',\n\t\t\tassistiveText: {\n\t\t\t\tcloseButton: 'Shut it now!',\n\t\t\t},\n\t\t\tcontainerClassName: 'sample-container-classname',\n\t\t\tcontainerStyle: { background: containerBackgroundColor },\n\t\t\tfooter: <p id=\"footer\">Footer</p>,\n\t\t\tstyle: { background: popoverBackgroundColor },\n\t\t};\n\n\t\tbeforeEach(() => {\n\t\t\tmountNode = createMountNode({ context: this });\n\t\t});\n\n\t\tafterEach(() => {\n\t\t\tdestroyMountNode({ wrapper, mountNode });\n\t\t});\n\n\t\tit('has correct className, assistiveText, style, and footer', function () {\n\t\t\twrapper = mount(<DemoComponent {...optionalProps} isOpen />, {\n\t\t\t\tattachTo: mountNode,\n\t\t\t});\n\n\t\t\tconst popover = wrapper.find(Dialog);\n\n\t\t\texpect(popover).to.have.className(optionalProps.className);\n\t\t\texpect(popover.find('button.slds-popover__close')).to.have.text(\n\t\t\t\toptionalProps.assistiveText.closeButton\n\t\t\t);\n\t\t\texpect(popover.find('#footer')).to.exist;\n\t\t\texpect(popover.prop('style').background).to.equal(popoverBackgroundColor);\n\t\t});\n\t});\n\n\t// EVENTS\n\n\tdescribe('Mouse and keyboard interactions', () => {\n\t\t/* Test event callback functions using Simulate. For more information, view\n\t\t * https://github.com/airbnb/enzyme/blob/master/docs/api/ReactWrapper/simulate.md\n\t\t */\n\t\tdescribe('onClick', function () {\n\t\t\tconst triggerClicked = sinon.spy();\n\n\t\t\tbeforeEach(() => {\n\t\t\t\tmountNode = createMountNode({ context: this });\n\t\t\t});\n\n\t\t\tafterEach(() => {\n\t\t\t\tdestroyMountNode({ wrapper, mountNode });\n\t\t\t});\n\n\t\t\tit('calls onClick handler on trigger, click on popover close closes', function (done) {\n\t\t\t\twrapper = mount(\n\t\t\t\t\t<DemoComponent\n\t\t\t\t\t\tonClick={triggerClicked}\n\t\t\t\t\t\tonClose={() => {\n\t\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\t\tconst popover = wrapper.find(`#${defaultIds.popover}`);\n\t\t\t\t\t\t\t\texpect(popover).to.not.exist;\n\t\t\t\t\t\t\t\tdone();\n\t\t\t\t\t\t\t}, 0);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonOpen={() => {\n\t\t\t\t\t\t\twrapper.update();\n\t\t\t\t\t\t\tconst popover = wrapper.find(`#${defaultIds.popover}`);\n\n\t\t\t\t\t\t\texpect(popover).to.exist;\n\t\t\t\t\t\t\texpect(triggerClicked.callCount).to.equal(1);\n\n\t\t\t\t\t\t\tpopover.find('button.slds-popover__close').simulate('click');\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tposition=\"absolute\"\n\t\t\t\t\t/>,\n\t\t\t\t\t{ attachTo: mountNode }\n\t\t\t\t);\n\n\t\t\t\tconst trigger = wrapper.find(defaultIds.trigger);\n\t\t\t\ttrigger.simulate('click');\n\t\t\t});\n\n\t\t\tit('opens on click, closes on ESC', function (done) {\n\t\t\t\twrapper = mount(\n\t\t\t\t\t<DemoComponent\n\t\t\t\t\t\tonClose={() => {\n\t\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\t\tconst popover = wrapper.find(`#${defaultIds.popover}`);\n\t\t\t\t\t\t\t\texpect(popover).to.not.exist;\n\t\t\t\t\t\t\t\tdone();\n\t\t\t\t\t\t\t}, 0);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonOpen={() => {\n\t\t\t\t\t\t\twrapper.update();\n\t\t\t\t\t\t\tconst popover = wrapper.find(`#${defaultIds.popover}`);\n\t\t\t\t\t\t\tpopover.simulate('keyDown', {\n\t\t\t\t\t\t\t\tkey: 'Esc',\n\t\t\t\t\t\t\t\tkeyCode: 27,\n\t\t\t\t\t\t\t\twhich: 27,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>,\n\t\t\t\t\t{ attachTo: mountNode }\n\t\t\t\t);\n\n\t\t\t\tconst trigger = wrapper.find(defaultIds.trigger);\n\t\t\t\ttrigger.simulate('click');\n\t\t\t});\n\t\t});\n\t});\n\n\tdescribe('focus has moved to dialog', function () {\n\t\tconst triggerClicked = sinon.spy();\n\n\t\tbeforeEach(() => {\n\t\t\tmountNode = createMountNode({ context: this });\n\t\t});\n\n\t\tafterEach(() => {\n\t\t\tdestroyMountNode({ wrapper, mountNode });\n\t\t});\n\n\t\tit('focus moves to correct node on open', function (done) {\n\t\t\twrapper = mount(\n\t\t\t\t<DemoComponent\n\t\t\t\t\tonClick={triggerClicked}\n\t\t\t\t\tonOpen={() => {\n\t\t\t\t\t\texpect(document.activeElement.id).to.equal(`${defaultIds.popover}`);\n\t\t\t\t\t\tdone();\n\t\t\t\t\t}}\n\t\t\t\t/>,\n\t\t\t\t{ attachTo: mountNode }\n\t\t\t);\n\n\t\t\tconst trigger = wrapper.find(defaultIds.trigger);\n\t\t\ttrigger.simulate('click', {});\n\t\t});\n\t});\n\n\tdescribe('Disabled', function () {\n\t\tconst triggerClicked = sinon.spy();\n\t\tconst popoverOpened = sinon.spy();\n\n\t\tbeforeEach(() => {\n\t\t\tmountNode = createMountNode({ context: this });\n\t\t});\n\n\t\tafterEach(() => {\n\t\t\tdestroyMountNode({ wrapper, mountNode });\n\t\t});\n\n\t\tit('onOpen is not called when disabled', function () {\n\t\t\twrapper = mount(\n\t\t\t\t<DemoComponent\n\t\t\t\t\tdisabled\n\t\t\t\t\tonClick={triggerClicked}\n\t\t\t\t\tonOpen={popoverOpened}\n\t\t\t\t/>,\n\t\t\t\t{ attachTo: mountNode }\n\t\t\t);\n\n\t\t\tconst trigger = wrapper.find(defaultIds.trigger);\n\t\t\ttrigger.simulate('click', {});\n\t\t\texpect(popoverOpened.callCount).to.equal(0);\n\t\t});\n\t});\n});\n"],"file":"popover.browser-test.js"}
1
+ {"version":3,"sources":["../../../../.tmp-es/components/popover/__tests__/popover.browser-test.jsx"],"names":["React","PropTypes","chai","expect","chaiEnzyme","mount","createMountNode","destroyMountNode","Popover","Button","Dialog","IconSettings","use","defaultProps","id","body","heading","defaultIds","trigger","popover","DemoComponent","props","Component","isOpen","bool","describe","mountNode","wrapper","beforeEach","context","afterEach","it","attachTo","find","to","exist","have","attr","popoverBackgroundColor","containerBackgroundColor","optionalProps","className","assistiveText","closeButton","containerClassName","containerStyle","background","footer","style","text","prop","equal","triggerClicked","sinon","spy","done","setTimeout","not","update","callCount","simulate","key","keyCode","which","mockEvent","stopPropagation","document","activeElement","popoverOpened"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AAEA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,IAAP,IAAeC,MAAf,QAA6B,MAA7B;AACA,OAAOC,UAAP,MAAuB,aAAvB;AACA,SAASC,KAAT,QAAsB,QAAtB;AAEA;AACA;AACA;AACA;A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AACpDJ,MAAAA,OAAO,GAAGtB,KAAK,eACd,oBAAC,aAAD;AACC,QAAA,QAAQ,MADT;AAEC,QAAA,OAAO,EAAE+C,cAFV;AAGC,QAAA,MAAM,EAAEgB;AAHT,QADc,EAMd;AAAEpC,QAAAA,QAAQ,EAAEN;AAAZ,OANc,CAAf;AASA,UAAMR,OAAO,GAAGS,OAAO,CAACM,IAAR,CAAahB,UAAU,CAACC,OAAxB,CAAhB;AACAA,MAAAA,OAAO,CAAC0C,QAAR,CAAiB,OAAjB,EAA0B,EAA1B;AACAzD,MAAAA,MAAM,CAACiE,aAAa,CAACT,SAAf,CAAN,CAAgCzB,EAAhC,CAAmCiB,KAAnC,CAAyC,CAAzC;AACA,KAbC,CAAF;AAcA,GA1BO,CAAR;AA2BA,CApPO,CAAR","sourcesContent":["import React from 'react';\n\nimport PropTypes from 'prop-types';\nimport chai, { expect } from 'chai';\nimport chaiEnzyme from 'chai-enzyme';\nimport { mount } from 'enzyme';\n\n/* Enzyme Helpers that can mount and unmount React component instances to\n * the DOM and set `this.wrapper` and `this.dom` within Mocha's `this`\n * context [full source here](tests/enzyme-helpers.js). `this` can\n * only be referenced if inside `function () {}`.\n */\nimport {\n\tcreateMountNode,\n\tdestroyMountNode,\n} from '../../../tests/enzyme-helpers';\n\n// Import your internal dependencies (for example):\nimport Popover from '../../popover';\nimport Button from '../../button';\nimport Dialog from '../../utilities/dialog';\nimport IconSettings from '../../icon-settings';\n\n/* Set Chai to use chaiEnzyme for enzyme compatible assertions:\n * https://github.com/producthunt/chai-enzyme\n */\nchai.use(chaiEnzyme());\n\nconst defaultProps = {\n\tid: 'sample-popover',\n\tbody: <span id=\"sample-body\">This is the body</span>,\n\theading: <span id=\"sample-heading\">This is the heading</span>,\n};\n\nconst defaultIds = {\n\ttrigger: `button#${defaultProps.id}`,\n\tpopover: `${defaultProps.id}-popover`,\n\tbody: `${defaultProps.id}-dialog-body`,\n\theading: `${defaultProps.id}-dialog-heading`,\n};\n\n/* A re-usable demo component fixture outside of `describe` sections\n * can accept props within each test and be unmounted after each tests.\n * This wrapping component will be similar to your wrapping component\n * you will create in the React Storybook for manual testing.\n */\nclass DemoComponent extends React.Component {\n\tstatic displayName = 'PopoverDemoComponent';\n\n\tstatic propTypes = {\n\t\tisOpen: PropTypes.bool,\n\t};\n\n\tstatic defaultProps = defaultProps;\n\n\tstate = {};\n\n\t// event handlers\n\n\trender() {\n\t\treturn (\n\t\t\t<IconSettings iconPath=\"/assets/icons\">\n\t\t\t\t<div>\n\t\t\t\t\t<Popover {...this.props}>\n\t\t\t\t\t\t<Button label=\"Trigger Popover\" />\n\t\t\t\t\t</Popover>\n\t\t\t\t\t<Button id=\"not-the-trigger\" label=\"Not Trigger Popover\" />\n\t\t\t\t</div>\n\t\t\t</IconSettings>\n\t\t);\n\t}\n}\n\n/* All tests for component being tested should be wrapped in a root `describe`,\n * which should be named after the component being tested.\n * When read aloud, the cumulative `describe` and `it` names should form a coherent\n * sentence, eg \"Date Picker default structure and css is present with expected\n * attributes set\". If you are having trouble constructing a cumulative short\n * sentence, this may be an indicator that your test is poorly structured.\n * String provided as first parameter names the `describe` section. Limit to nouns\n * as much as possible/appropriate.`\n */\ndescribe('SLDSPopover', function () {\n\tlet mountNode;\n\tlet wrapper;\n\n\t// BASIC STRUCTURE\n\n\tdescribe('Default structure and css', function () {\n\t\tbeforeEach(() => {\n\t\t\tmountNode = createMountNode({ context: this });\n\t\t});\n\n\t\tafterEach(() => {\n\t\t\tdestroyMountNode({ wrapper, mountNode });\n\t\t});\n\n\t\tit('is open, has heading, body, close button', () => {\n\t\t\twrapper = mount(<DemoComponent isOpen />, { attachTo: mountNode });\n\n\t\t\texpect(wrapper.find(`#${defaultIds.heading}`)).to.exist;\n\t\t\texpect(wrapper.find(`#${defaultIds.body}`)).to.exist;\n\t\t\texpect(wrapper.find('.slds-popover__close')).to.exist;\n\t\t});\n\t});\n\n\tdescribe('Assistive technology', () => {\n\t\t/* Detect if presence of accessibility features such as ARIA\n\t\t * roles and screen reader text is present in the DOM.\n\t\t */\n\t\tbeforeEach(() => {\n\t\t\tmountNode = createMountNode({ context: this });\n\t\t});\n\n\t\tafterEach(() => {\n\t\t\tdestroyMountNode({ wrapper, mountNode });\n\t\t});\n\n\t\tit('has aria-labelledby/aria-describedby on popover', function () {\n\t\t\twrapper = mount(<DemoComponent isOpen />, { attachTo: mountNode });\n\n\t\t\tconst popover = wrapper.find(`#${defaultIds.popover}`);\n\t\t\texpect(popover).to.have.attr('aria-labelledby', defaultIds.heading);\n\t\t\texpect(popover).to.have.attr('aria-describedby', defaultIds.body);\n\t\t});\n\t});\n\n\t// PROPS AND CHILDREN\n\n\tdescribe('Optional props', () => {\n\t\tconst popoverBackgroundColor = 'rgb(255, 80, 121)';\n\t\tconst containerBackgroundColor = 'rgb(255, 127, 80)';\n\t\t// What should be present in the DOM when style and className are applied?\n\t\tconst optionalProps = {\n\t\t\tclassName: 'sample-classname',\n\t\t\tassistiveText: {\n\t\t\t\tcloseButton: 'Shut it now!',\n\t\t\t},\n\t\t\tcontainerClassName: 'sample-container-classname',\n\t\t\tcontainerStyle: { background: containerBackgroundColor },\n\t\t\tfooter: <p id=\"footer\">Footer</p>,\n\t\t\tstyle: { background: popoverBackgroundColor },\n\t\t};\n\n\t\tbeforeEach(() => {\n\t\t\tmountNode = createMountNode({ context: this });\n\t\t});\n\n\t\tafterEach(() => {\n\t\t\tdestroyMountNode({ wrapper, mountNode });\n\t\t});\n\n\t\tit('has correct className, assistiveText, style, and footer', function () {\n\t\t\twrapper = mount(<DemoComponent {...optionalProps} isOpen />, {\n\t\t\t\tattachTo: mountNode,\n\t\t\t});\n\n\t\t\tconst popover = wrapper.find(Dialog);\n\n\t\t\texpect(popover).to.have.className(optionalProps.className);\n\t\t\texpect(popover.find('button.slds-popover__close')).to.have.text(\n\t\t\t\toptionalProps.assistiveText.closeButton\n\t\t\t);\n\t\t\texpect(popover.find('#footer')).to.exist;\n\t\t\texpect(popover.prop('style').background).to.equal(popoverBackgroundColor);\n\t\t});\n\t});\n\n\t// EVENTS\n\n\tdescribe('Mouse and keyboard interactions', () => {\n\t\t/* Test event callback functions using Simulate. For more information, view\n\t\t * https://github.com/airbnb/enzyme/blob/master/docs/api/ReactWrapper/simulate.md\n\t\t */\n\t\tdescribe('onClick', function () {\n\t\t\tconst triggerClicked = sinon.spy();\n\n\t\t\tbeforeEach(() => {\n\t\t\t\tmountNode = createMountNode({ context: this });\n\t\t\t});\n\n\t\t\tafterEach(() => {\n\t\t\t\tdestroyMountNode({ wrapper, mountNode });\n\t\t\t});\n\n\t\t\tit('calls onClick handler on trigger, click on popover close closes', function (done) {\n\t\t\t\twrapper = mount(\n\t\t\t\t\t<DemoComponent\n\t\t\t\t\t\tonClick={triggerClicked}\n\t\t\t\t\t\tonClose={() => {\n\t\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\t\tconst popover = wrapper.find(`#${defaultIds.popover}`);\n\t\t\t\t\t\t\t\texpect(popover).to.not.exist;\n\t\t\t\t\t\t\t\tdone();\n\t\t\t\t\t\t\t}, 0);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonOpen={() => {\n\t\t\t\t\t\t\twrapper.update();\n\t\t\t\t\t\t\tconst popover = wrapper.find(`#${defaultIds.popover}`);\n\n\t\t\t\t\t\t\texpect(popover).to.exist;\n\t\t\t\t\t\t\texpect(triggerClicked.callCount).to.equal(1);\n\n\t\t\t\t\t\t\tpopover.find('button.slds-popover__close').simulate('click');\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tposition=\"absolute\"\n\t\t\t\t\t/>,\n\t\t\t\t\t{ attachTo: mountNode }\n\t\t\t\t);\n\n\t\t\t\tconst trigger = wrapper.find(defaultIds.trigger);\n\t\t\t\ttrigger.simulate('click');\n\t\t\t});\n\n\t\t\tit('opens on click, closes on ESC', function (done) {\n\t\t\t\twrapper = mount(\n\t\t\t\t\t<DemoComponent\n\t\t\t\t\t\tonClose={() => {\n\t\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\t\tconst popover = wrapper.find(`#${defaultIds.popover}`);\n\t\t\t\t\t\t\t\texpect(popover).to.not.exist;\n\t\t\t\t\t\t\t\tdone();\n\t\t\t\t\t\t\t}, 0);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonOpen={() => {\n\t\t\t\t\t\t\twrapper.update();\n\t\t\t\t\t\t\tconst popover = wrapper.find(`#${defaultIds.popover}`);\n\t\t\t\t\t\t\tpopover.simulate('keyDown', {\n\t\t\t\t\t\t\t\tkey: 'Esc',\n\t\t\t\t\t\t\t\tkeyCode: 27,\n\t\t\t\t\t\t\t\twhich: 27,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>,\n\t\t\t\t\t{ attachTo: mountNode }\n\t\t\t\t);\n\n\t\t\t\tconst trigger = wrapper.find(defaultIds.trigger);\n\t\t\t\ttrigger.simulate('click');\n\t\t\t});\n\n\t\t\tit('stops event propagation after closing on ESC', function (done) {\n\t\t\t\tconst mockEvent = {\n\t\t\t\t\tkey: 'Esc',\n\t\t\t\t\tkeyCode: 27,\n\t\t\t\t\twhich: 27,\n\t\t\t\t\tstopPropagation: sinon.spy(),\n\t\t\t\t};\n\t\t\t\twrapper = mount(\n\t\t\t\t\t<DemoComponent\n\t\t\t\t\t\tonOpen={() => {\n\t\t\t\t\t\t\twrapper.update();\n\t\t\t\t\t\t\tconst popover = wrapper.find(`#${defaultIds.popover}`);\n\t\t\t\t\t\t\tpopover.simulate('keyDown', mockEvent);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonKeyDown={() => {\n\t\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\t\texpect(mockEvent.stopPropagation.callCount).to.equal(1);\n\t\t\t\t\t\t\t\tdone();\n\t\t\t\t\t\t\t}, 0);\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>,\n\t\t\t\t\t{ attachTo: mountNode }\n\t\t\t\t);\n\n\t\t\t\tconst trigger = wrapper.find(defaultIds.trigger);\n\t\t\t\ttrigger.simulate('click');\n\t\t\t});\n\t\t});\n\t});\n\n\tdescribe('focus has moved to dialog', function () {\n\t\tconst triggerClicked = sinon.spy();\n\n\t\tbeforeEach(() => {\n\t\t\tmountNode = createMountNode({ context: this });\n\t\t});\n\n\t\tafterEach(() => {\n\t\t\tdestroyMountNode({ wrapper, mountNode });\n\t\t});\n\n\t\tit('focus moves to correct node on open', function (done) {\n\t\t\twrapper = mount(\n\t\t\t\t<DemoComponent\n\t\t\t\t\tonClick={triggerClicked}\n\t\t\t\t\tonOpen={() => {\n\t\t\t\t\t\texpect(document.activeElement.id).to.equal(`${defaultIds.popover}`);\n\t\t\t\t\t\tdone();\n\t\t\t\t\t}}\n\t\t\t\t/>,\n\t\t\t\t{ attachTo: mountNode }\n\t\t\t);\n\n\t\t\tconst trigger = wrapper.find(defaultIds.trigger);\n\t\t\ttrigger.simulate('click', {});\n\t\t});\n\t});\n\n\tdescribe('Disabled', function () {\n\t\tconst triggerClicked = sinon.spy();\n\t\tconst popoverOpened = sinon.spy();\n\n\t\tbeforeEach(() => {\n\t\t\tmountNode = createMountNode({ context: this });\n\t\t});\n\n\t\tafterEach(() => {\n\t\t\tdestroyMountNode({ wrapper, mountNode });\n\t\t});\n\n\t\tit('onOpen is not called when disabled', function () {\n\t\t\twrapper = mount(\n\t\t\t\t<DemoComponent\n\t\t\t\t\tdisabled\n\t\t\t\t\tonClick={triggerClicked}\n\t\t\t\t\tonOpen={popoverOpened}\n\t\t\t\t/>,\n\t\t\t\t{ attachTo: mountNode }\n\t\t\t);\n\n\t\t\tconst trigger = wrapper.find(defaultIds.trigger);\n\t\t\ttrigger.simulate('click', {});\n\t\t\texpect(popoverOpened.callCount).to.equal(0);\n\t\t});\n\t});\n});\n"],"file":"popover.browser-test.js"}
@@ -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
  */
@@ -19,6 +19,7 @@
19
19
  import ReactDOM from 'react-dom'; // ### Event Helpers
20
20
 
21
21
  import KEYS from './key-code';
22
+ import EventUtil from './event';
22
23
  /* eslint-disable react/no-find-dom-node */
23
24
 
24
25
  var internalHandleClick = function internalHandleClick(_ref) {
@@ -33,7 +34,8 @@ var internalHandleClick = function internalHandleClick(_ref) {
33
34
  };
34
35
 
35
36
  var KeyboardNavigableDialog = function KeyboardNavigableDialog(_ref2) {
36
- var isOpen = _ref2.isOpen,
37
+ var event = _ref2.event,
38
+ isOpen = _ref2.isOpen,
37
39
  handleClick = _ref2.handleClick,
38
40
  keyCode = _ref2.keyCode,
39
41
  eventTarget = _ref2.eventTarget,
@@ -44,6 +46,7 @@ var KeyboardNavigableDialog = function KeyboardNavigableDialog(_ref2) {
44
46
  case KEYS.ESCAPE:
45
47
  if (isOpen) {
46
48
  toggleOpen();
49
+ EventUtil.trapEvent(event);
47
50
  }
48
51
 
49
52
  break;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../.tmp-es/utilities/keyboard-navigable-dialog.js"],"names":["ReactDOM","KEYS","internalHandleClick","trigger","eventTarget","handleClick","findDOMNode","event","KeyboardNavigableDialog","isOpen","keyCode","toggleOpen","ESCAPE","ENTER"],"mappings":"AAAA;;AACA;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;AACA,OAAOA,QAAP,MAAqB,WAArB,C,CAEA;;AACA,OAAOC,IAAP,MAAiB,YAAjB;AAEA;;AAEA,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAsB,OAA2C;AAAA,MAAxCC,OAAwC,QAAxCA,OAAwC;AAAA,MAA/BC,WAA+B,QAA/BA,WAA+B;AAAA,MAAlBC,WAAkB,QAAlBA,WAAkB;;AACtE,MAAIF,OAAO,IAAIH,QAAQ,CAACM,WAAT,CAAqBH,OAArB,MAAkCC,WAAjD,EAA8D;AAC7D;AACAC,IAAAA,WAAW,CAACE,KAAD,CAAX;AACA;AACD,CALD;;AAOA,IAAMC,uBAAuB,GAAG,SAA1BA,uBAA0B,QAO1B;AAAA,MANLC,MAMK,SANLA,MAMK;AAAA,MALLJ,WAKK,SALLA,WAKK;AAAA,MAJLK,OAIK,SAJLA,OAIK;AAAA,MAHLN,WAGK,SAHLA,WAGK;AAAA,MAFLD,OAEK,SAFLA,OAEK;AAAA,MADLQ,UACK,SADLA,UACK;;AACL,UAAQD,OAAR;AACC,SAAKT,IAAI,CAACW,MAAV;AACC,UAAIH,MAAJ,EAAY;AACXE,QAAAA,UAAU;AACV;;AACD;;AACD,SAAKV,IAAI,CAACY,KAAV;AACC,UAAI,CAACJ,MAAL,EAAa;AACZP,QAAAA,mBAAmB,CAAC;AACnBC,UAAAA,OAAO,EAAPA,OADmB;AAEnBC,UAAAA,WAAW,EAAXA,WAFmB;AAGnBC,UAAAA,WAAW,EAAXA;AAHmB,SAAD,CAAnB;AAKA;;AACD;;AACD;AACC;AAhBF;AAkBA,CA1BD;;AA4BA,eAAeG,uBAAf","sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// # Assistive Technology / Keyboard Navigable Trait for Dialogs with Tabbable content\n\n/*\n * Guidelines for Popover\n *\n * - Focus is trapped. Tabbing to an index outside of the dialog is not allowed. Popover must be closed first via ESC.\n * - There should always be a focusable element inside, to place user focus on such as a close button\n * - Must be dismissible via ESC and a close button\n * - Uses tabIndex in wrapper and has tabbable items within it despite being outside document flow.\n * - Entire popover receives focus when opened and has a aria-labelledby that points to the header id, so it will read the heading,\n * - Must return focus to trigger after closing.\n * - F6 will allow the user to keep popover open and go back to tabbing in “app-context” instead of “dialog-context.” (not implemented, yet)\n */\n\n// ## Dependencies\n\n// ### React\nimport ReactDOM from 'react-dom';\n\n// ### Event Helpers\nimport KEYS from './key-code';\n\n/* eslint-disable react/no-find-dom-node */\n\nconst internalHandleClick = ({ trigger, eventTarget, handleClick }) => {\n\tif (trigger && ReactDOM.findDOMNode(trigger) === eventTarget) {\n\t\t// eslint-disable-line react/no-find-dom-node\n\t\thandleClick(event);\n\t}\n};\n\nconst KeyboardNavigableDialog = ({\n\tisOpen,\n\thandleClick,\n\tkeyCode,\n\teventTarget,\n\ttrigger,\n\ttoggleOpen,\n}) => {\n\tswitch (keyCode) {\n\t\tcase KEYS.ESCAPE:\n\t\t\tif (isOpen) {\n\t\t\t\ttoggleOpen();\n\t\t\t}\n\t\t\tbreak;\n\t\tcase KEYS.ENTER:\n\t\t\tif (!isOpen) {\n\t\t\t\tinternalHandleClick({\n\t\t\t\t\ttrigger,\n\t\t\t\t\teventTarget,\n\t\t\t\t\thandleClick,\n\t\t\t\t});\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n};\n\nexport default KeyboardNavigableDialog;\n"],"file":"keyboard-navigable-dialog.js"}
1
+ {"version":3,"sources":["../../.tmp-es/utilities/keyboard-navigable-dialog.js"],"names":["ReactDOM","KEYS","EventUtil","internalHandleClick","trigger","eventTarget","handleClick","findDOMNode","event","KeyboardNavigableDial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BD;;AA8BA,eAAeG,uBAAf","sourcesContent":["/* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */\n/* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */\n\n// # Assistive Technology / Keyboard Navigable Trait for Dialogs with Tabbable content\n\n/*\n * Guidelines for Popover\n *\n * - Focus is trapped. Tabbing to an index outside of the dialog is not allowed. Popover must be closed first via ESC.\n * - There should always be a focusable element inside, to place user focus on such as a close button\n * - Must be dismissible via ESC and a close button\n * - Uses tabIndex in wrapper and has tabbable items within it despite being outside document flow.\n * - Entire popover receives focus when opened and has a aria-labelledby that points to the header id, so it will read the heading,\n * - Must return focus to trigger after closing.\n * - F6 will allow the user to keep popover open and go back to tabbing in “app-context” instead of “dialog-context.” (not implemented, yet)\n */\n\n// ## Dependencies\n\n// ### React\nimport ReactDOM from 'react-dom';\n\n// ### Event Helpers\nimport KEYS from './key-code';\nimport EventUtil from './event';\n\n/* eslint-disable react/no-find-dom-node */\n\nconst internalHandleClick = ({ trigger, eventTarget, handleClick }) => {\n\tif (trigger && ReactDOM.findDOMNode(trigger) === eventTarget) {\n\t\t// eslint-disable-line react/no-find-dom-node\n\t\thandleClick(event);\n\t}\n};\n\nconst KeyboardNavigableDialog = ({\n\tevent,\n\tisOpen,\n\thandleClick,\n\tkeyCode,\n\teventTarget,\n\ttrigger,\n\ttoggleOpen,\n}) => {\n\tswitch (keyCode) {\n\t\tcase KEYS.ESCAPE:\n\t\t\tif (isOpen) {\n\t\t\t\ttoggleOpen();\n\t\t\t\tEventUtil.trapEvent(event);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase KEYS.ENTER:\n\t\t\tif (!isOpen) {\n\t\t\t\tinternalHandleClick({\n\t\t\t\t\ttrigger,\n\t\t\t\t\teventTarget,\n\t\t\t\t\thandleClick,\n\t\t\t\t});\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n};\n\nexport default KeyboardNavigableDialog;\n"],"file":"keyboard-navigable-dialog.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/design-system-react",
3
- "version": "0.10.46",
3
+ "version": "0.10.47",
4
4
  "description": "Salesforce Lightning Design System for React",
5
5
  "license": "BSD-3-Clause",
6
6
  "engines": {},
@@ -22,6 +22,7 @@ import ReactDOM from 'react-dom';
22
22
 
23
23
  // ### Event Helpers
24
24
  import KEYS from './key-code';
25
+ import EventUtil from './event';
25
26
 
26
27
  /* eslint-disable react/no-find-dom-node */
27
28
 
@@ -33,6 +34,7 @@ const internalHandleClick = ({ trigger, eventTarget, handleClick }) => {
33
34
  };
34
35
 
35
36
  const KeyboardNavigableDialog = ({
37
+ event,
36
38
  isOpen,
37
39
  handleClick,
38
40
  keyCode,
@@ -44,6 +46,7 @@ const KeyboardNavigableDialog = ({
44
46
  case KEYS.ESCAPE:
45
47
  if (isOpen) {
46
48
  toggleOpen();
49
+ EventUtil.trapEvent(event);
47
50
  }
48
51
  break;
49
52
  case KEYS.ENTER: