@salesforce/design-system-react 0.10.41 → 0.10.45

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 (109) hide show
  1. package/components/brand-band/__docs__/__snapshots__/storybook-stories.storyshot +47 -157
  2. package/components/brand-band/__docs__/storybook-stories.jsx +4 -2
  3. package/components/brand-band/__examples__/{lightning-blue-theme.jsx → group-image.jsx} +1 -11
  4. package/components/brand-band/__examples__/no-image.jsx +1 -2
  5. package/{lib/components/brand-band/__examples__/lightning-blue-theme.jsx → components/brand-band/__examples__/user-image.jsx} +1 -11
  6. package/components/brand-band/check-props.js +18 -0
  7. package/components/brand-band/component.json +8 -4
  8. package/components/brand-band/index.jsx +23 -66
  9. package/components/brand-band.d.ts +1 -26
  10. package/components/button/__tests__/button.browser-test.jsx +0 -1
  11. package/components/combobox/__tests__/combobox.browser-test.jsx +18 -0
  12. package/components/combobox/combobox.jsx +4 -1
  13. package/components/component-docs.json +13 -38
  14. package/components/data-table/cell.jsx +2 -2
  15. package/components/data-table/index.jsx +130 -85
  16. package/components/data-table/private/context-helper.js +26 -14
  17. package/components/data-table/private/head.jsx +269 -260
  18. package/components/data-table/private/header-cell.jsx +204 -230
  19. package/components/data-table/private/row.jsx +140 -105
  20. package/components/data-table/row-actions.jsx +2 -2
  21. package/components/icon/__docs__/__snapshots__/storybook-stories.storyshot +49 -2
  22. package/components/icon/__docs__/storybook-stories.jsx +2 -0
  23. package/components/icon/__examples__/color-success.jsx +24 -0
  24. package/components/icon/__examples__/colors.jsx +10 -2
  25. package/components/icon/index.jsx +2 -0
  26. package/components/icon.d.ts +1 -1
  27. package/components/site-stories.js +8 -4
  28. package/components/utilities/truncate/index.jsx +1 -1
  29. package/lib/components/brand-band/__docs__/__snapshots__/storybook-stories.storyshot +47 -157
  30. package/lib/components/brand-band/__docs__/storybook-stories.jsx +4 -2
  31. package/lib/components/brand-band/__examples__/group-image.jsx +12 -0
  32. package/lib/components/brand-band/__examples__/no-image.jsx +1 -2
  33. package/lib/components/brand-band/__examples__/user-image.jsx +12 -0
  34. package/lib/components/brand-band/check-props.js +29 -0
  35. package/lib/components/brand-band/component.json +8 -4
  36. package/lib/components/brand-band/index.js +9 -50
  37. package/lib/components/brand-band.d.ts +1 -26
  38. package/lib/components/button/__tests__/button.browser-test.jsx +0 -1
  39. package/lib/components/combobox/__tests__/combobox.browser-test.jsx +18 -0
  40. package/lib/components/combobox/combobox.js +6 -2
  41. package/lib/components/component-docs.json +13 -38
  42. package/lib/components/data-table/cell.js +6 -6
  43. package/lib/components/data-table/index.js +127 -99
  44. package/lib/components/data-table/private/context-helper.js +13 -14
  45. package/lib/components/data-table/private/head.js +233 -252
  46. package/lib/components/data-table/private/header-cell.js +185 -221
  47. package/lib/components/data-table/private/row.js +97 -89
  48. package/lib/components/data-table/row-actions.js +6 -6
  49. package/lib/components/icon/__docs__/__snapshots__/storybook-stories.storyshot +49 -2
  50. package/lib/components/icon/__docs__/storybook-stories.jsx +2 -0
  51. package/lib/components/icon/__examples__/color-success.jsx +24 -0
  52. package/lib/components/icon/__examples__/colors.jsx +10 -2
  53. package/lib/components/icon/index.js +2 -1
  54. package/lib/components/icon.d.ts +1 -1
  55. package/lib/components/site-stories.js +6 -3
  56. package/lib/components/utilities/truncate/index.js +2 -2
  57. package/lib/package.json +13 -9
  58. package/module/components/brand-band/__docs__/__snapshots__/storybook-stories.storyshot +47 -157
  59. package/module/components/brand-band/__docs__/storybook-stories.js +6 -3
  60. package/module/components/brand-band/__docs__/storybook-stories.js.map +1 -1
  61. package/module/components/brand-band/__examples__/{lightning-blue-theme.js → group-image.js} +4 -9
  62. package/module/components/brand-band/__examples__/group-image.js.map +1 -0
  63. package/module/components/brand-band/__examples__/no-image.js +2 -4
  64. package/module/components/brand-band/__examples__/no-image.js.map +1 -1
  65. package/module/components/brand-band/__examples__/user-image.js +52 -0
  66. package/module/components/brand-band/__examples__/user-image.js.map +1 -0
  67. package/module/components/brand-band/check-props.js +20 -0
  68. package/module/components/brand-band/check-props.js.map +1 -0
  69. package/module/components/brand-band/component.json +8 -4
  70. package/module/components/brand-band/index.js +10 -51
  71. package/module/components/brand-band/index.js.map +1 -1
  72. package/module/components/brand-band.d.ts +1 -26
  73. package/module/components/button/__tests__/button.browser-test.js +0 -1
  74. package/module/components/button/__tests__/button.browser-test.js.map +1 -1
  75. package/module/components/combobox/__tests__/combobox.browser-test.js +22 -0
  76. package/module/components/combobox/__tests__/combobox.browser-test.js.map +1 -1
  77. package/module/components/combobox/combobox.js +6 -2
  78. package/module/components/combobox/combobox.js.map +1 -1
  79. package/module/components/component-docs.json +13 -38
  80. package/module/components/data-table/cell.js +6 -6
  81. package/module/components/data-table/cell.js.map +1 -1
  82. package/module/components/data-table/index.js +120 -95
  83. package/module/components/data-table/index.js.map +1 -1
  84. package/module/components/data-table/private/context-helper.js +12 -12
  85. package/module/components/data-table/private/context-helper.js.map +1 -1
  86. package/module/components/data-table/private/head.js +230 -255
  87. package/module/components/data-table/private/head.js.map +1 -1
  88. package/module/components/data-table/private/header-cell.js +184 -225
  89. package/module/components/data-table/private/header-cell.js.map +1 -1
  90. package/module/components/data-table/private/row.js +95 -87
  91. package/module/components/data-table/private/row.js.map +1 -1
  92. package/module/components/data-table/row-actions.js +6 -6
  93. package/module/components/data-table/row-actions.js.map +1 -1
  94. package/module/components/icon/__docs__/__snapshots__/storybook-stories.storyshot +49 -2
  95. package/module/components/icon/__docs__/storybook-stories.js +3 -0
  96. package/module/components/icon/__docs__/storybook-stories.js.map +1 -1
  97. package/module/components/icon/__examples__/color-success.js +64 -0
  98. package/module/components/icon/__examples__/color-success.js.map +1 -0
  99. package/module/components/icon/__examples__/colors.js +11 -2
  100. package/module/components/icon/__examples__/colors.js.map +1 -1
  101. package/module/components/icon/index.js +2 -1
  102. package/module/components/icon/index.js.map +1 -1
  103. package/module/components/icon.d.ts +1 -1
  104. package/module/components/site-stories.js +6 -3
  105. package/module/components/site-stories.js.map +1 -1
  106. package/module/components/utilities/truncate/index.js +1 -1
  107. package/module/components/utilities/truncate/index.js.map +1 -1
  108. package/package.json +13 -9
  109. package/module/components/brand-band/__examples__/lightning-blue-theme.js.map +0 -1
@@ -14,33 +14,13 @@ exports[`DOM snapshots SLDSBrandBand Default (medium) 1`] = `
14
14
  }
15
15
  >
16
16
  <div
17
- style={
18
- Object {
19
- "background": "rgb(176, 196, 223)",
20
- "height": "100%",
21
- "position": "relative",
22
- "width": "100%",
23
- "zIndex": 1,
24
- }
25
- }
26
- >
27
- <style>
28
- .slds-brand-band.dsr-brand-band_lightning-blue:before {
29
- background-image: url(/assets/images/themes/oneSalesforce/banner-brand-default.png), linear-gradient(to top, rgba(175, 197, 222, 0) 0, #1B5F9E);
30
- }
31
- .slds-brand-band.dsr-brand-band_lightning-blue:after {
32
- background-image: linear-gradient(to bottom, rgba(175, 197, 222, 0) 60%, #AFC5DE);
33
- }
34
- </style>
35
- <div
36
- className="slds-brand-band slds-brand-band_medium dsr-brand-band_lightning-blue"
37
- id="brand-band-default"
38
- />
39
- </div>
17
+ className="slds-brand-band slds-brand-band_medium"
18
+ id="brand-band-default"
19
+ />
40
20
  </div>
41
21
  `;
42
22
 
43
- exports[`DOM snapshots SLDSBrandBand Image with background size cover 1`] = `
23
+ exports[`DOM snapshots SLDSBrandBand Group Image 1`] = `
44
24
  <div
45
25
  style={
46
26
  Object {
@@ -54,39 +34,13 @@ exports[`DOM snapshots SLDSBrandBand Image with background size cover 1`] = `
54
34
  }
55
35
  >
56
36
  <div
57
- style={
58
- Object {
59
- "background": "rgb(176, 196, 223)",
60
- "height": "100%",
61
- "position": "relative",
62
- "width": "100%",
63
- "zIndex": 1,
64
- }
65
- }
66
- >
67
- <style>
68
- .slds-brand-band.dsr-brand-band_lightning-blue:before {
69
- background-image: url(/assets/images/themes/oneSalesforce/banner-brand-default.png), linear-gradient(to top, rgba(175, 197, 222, 0) 0, #1B5F9E);
70
- }
71
- .slds-brand-band.dsr-brand-band_lightning-blue:after {
72
- background-image: linear-gradient(to bottom, rgba(175, 197, 222, 0) 60%, #AFC5DE);
73
- }
74
- </style>
75
- <div
76
- className="slds-brand-band slds-brand-band_large slds-brand-band_cover dsr-brand-band_lightning-blue custom-brand-band-class"
77
- id="brand-band-large"
78
- >
79
- <span
80
- className="slds-assistive-text"
81
- >
82
- Hello World!
83
- </span>
84
- </div>
85
- </div>
37
+ className="slds-brand-band slds-brand-band_medium slds-brand-band_group"
38
+ id="brand-band-user-group"
39
+ />
86
40
  </div>
87
41
  `;
88
42
 
89
- exports[`DOM snapshots SLDSBrandBand Large 1`] = `
43
+ exports[`DOM snapshots SLDSBrandBand Image with background size cover 1`] = `
90
44
  <div
91
45
  style={
92
46
  Object {
@@ -100,39 +54,19 @@ exports[`DOM snapshots SLDSBrandBand Large 1`] = `
100
54
  }
101
55
  >
102
56
  <div
103
- style={
104
- Object {
105
- "background": "rgb(176, 196, 223)",
106
- "height": "100%",
107
- "position": "relative",
108
- "width": "100%",
109
- "zIndex": 1,
110
- }
111
- }
57
+ className="slds-brand-band slds-brand-band_large slds-brand-band_cover custom-brand-band-class"
58
+ id="brand-band-large"
112
59
  >
113
- <style>
114
- .slds-brand-band.dsr-brand-band_lightning-blue:before {
115
- background-image: url(/assets/images/themes/oneSalesforce/banner-brand-default.png), linear-gradient(to top, rgba(175, 197, 222, 0) 0, #1B5F9E);
116
- }
117
- .slds-brand-band.dsr-brand-band_lightning-blue:after {
118
- background-image: linear-gradient(to bottom, rgba(175, 197, 222, 0) 60%, #AFC5DE);
119
- }
120
- </style>
121
- <div
122
- className="slds-brand-band slds-brand-band_large dsr-brand-band_lightning-blue custom-brand-band-class"
123
- id="brand-band-large"
60
+ <span
61
+ className="slds-assistive-text"
124
62
  >
125
- <span
126
- className="slds-assistive-text"
127
- >
128
- Hello World!
129
- </span>
130
- </div>
63
+ Hello World!
64
+ </span>
131
65
  </div>
132
66
  </div>
133
67
  `;
134
68
 
135
- exports[`DOM snapshots SLDSBrandBand Lightning Blue Theme 1`] = `
69
+ exports[`DOM snapshots SLDSBrandBand Large 1`] = `
136
70
  <div
137
71
  style={
138
72
  Object {
@@ -146,38 +80,14 @@ exports[`DOM snapshots SLDSBrandBand Lightning Blue Theme 1`] = `
146
80
  }
147
81
  >
148
82
  <div
149
- style={
150
- Object {
151
- "background": "rgb(176, 196, 223)",
152
- "height": "100%",
153
- "position": "relative",
154
- "width": "100%",
155
- "zIndex": 1,
156
- }
157
- }
83
+ className="slds-brand-band slds-brand-band_large custom-brand-band-class"
84
+ id="brand-band-large"
158
85
  >
159
- <style>
160
- .slds-brand-band.dsr-brand-band_lightning-blue:before {
161
- background-image: url(/assets/images/themes/oneSalesforce/banner-brand-default.png), linear-gradient(to top, rgba(175, 197, 222, 0) 0, #1B5F9E);
162
- }
163
- .slds-brand-band.dsr-brand-band_lightning-blue:after {
164
- background-image: linear-gradient(to bottom, rgba(175, 197, 222, 0) 60%, #AFC5DE);
165
- }
166
- </style>
167
- <div
168
- className="slds-brand-band slds-brand-band_medium dsr-brand-band_lightning-blue slds-p-around_small"
169
- id="brand-band-lightning-blue"
86
+ <span
87
+ className="slds-assistive-text"
170
88
  >
171
- <div
172
- className="slds-box slds-theme_default"
173
- >
174
- <h3
175
- className="slds-text-heading_label slds-truncate"
176
- >
177
- My App
178
- </h3>
179
- </div>
180
- </div>
89
+ Hello World!
90
+ </span>
181
91
  </div>
182
92
  </div>
183
93
  `;
@@ -196,35 +106,15 @@ exports[`DOM snapshots SLDSBrandBand No Image 1`] = `
196
106
  }
197
107
  >
198
108
  <div
109
+ className="slds-brand-band slds-brand-band_medium slds-brand-band_none"
110
+ id="brand-band-no-image"
199
111
  style={
200
112
  Object {
201
- "background": "rgb(176, 196, 223)",
202
- "border": "1px solid #eee",
203
- "height": "100%",
204
- "position": "relative",
205
- "width": "100%",
113
+ "backgroundColor": "#eef4ff",
206
114
  "zIndex": 1,
207
115
  }
208
116
  }
209
- >
210
- <style>
211
- .slds-brand-band.dsr-brand-band_lightning-blue:before {
212
- background-image: url(/assets/images/themes/oneSalesforce/banner-brand-default.png), linear-gradient(to top, rgba(175, 197, 222, 0) 0, #1B5F9E);
213
- }
214
- .slds-brand-band.dsr-brand-band_lightning-blue:after {
215
- background-image: linear-gradient(to bottom, rgba(175, 197, 222, 0) 60%, #AFC5DE);
216
- }
217
- </style>
218
- <div
219
- className="slds-brand-band slds-brand-band_medium slds-brand-band_none dsr-brand-band_lightning-blue"
220
- id="brand-band-no-image"
221
- style={
222
- Object {
223
- "zIndex": 1,
224
- }
225
- }
226
- />
227
- </div>
117
+ />
228
118
  </div>
229
119
  `;
230
120
 
@@ -242,28 +132,28 @@ exports[`DOM snapshots SLDSBrandBand Small 1`] = `
242
132
  }
243
133
  >
244
134
  <div
245
- style={
246
- Object {
247
- "background": "rgb(176, 196, 223)",
248
- "height": "100%",
249
- "position": "relative",
250
- "width": "100%",
251
- "zIndex": 1,
252
- }
135
+ className="slds-brand-band slds-brand-band_small"
136
+ id="brand-band-small"
137
+ />
138
+ </div>
139
+ `;
140
+
141
+ exports[`DOM snapshots SLDSBrandBand User Image 1`] = `
142
+ <div
143
+ style={
144
+ Object {
145
+ "bottom": "1rem",
146
+ "left": "1rem",
147
+ "overflow": "auto",
148
+ "position": "absolute",
149
+ "right": "1rem",
150
+ "top": "1rem",
253
151
  }
254
- >
255
- <style>
256
- .slds-brand-band.dsr-brand-band_lightning-blue:before {
257
- background-image: url(/assets/images/themes/oneSalesforce/banner-brand-default.png), linear-gradient(to top, rgba(175, 197, 222, 0) 0, #1B5F9E);
258
- }
259
- .slds-brand-band.dsr-brand-band_lightning-blue:after {
260
- background-image: linear-gradient(to bottom, rgba(175, 197, 222, 0) 60%, #AFC5DE);
261
- }
262
- </style>
263
- <div
264
- className="slds-brand-band slds-brand-band_small dsr-brand-band_lightning-blue"
265
- id="brand-band-small"
266
- />
267
- </div>
152
+ }
153
+ >
154
+ <div
155
+ className="slds-brand-band slds-brand-band_medium slds-brand-band_user"
156
+ id="brand-band-user-image"
157
+ />
268
158
  </div>
269
159
  `;
@@ -5,10 +5,11 @@ import { storiesOf } from '@storybook/react';
5
5
  import { BRAND_BAND } from '../../../utilities/constants';
6
6
  import Default from '../__examples__/default';
7
7
  import Large from '../__examples__/large';
8
- import LightningBlueTheme from '../__examples__/lightning-blue-theme';
9
8
  import NoImage from '../__examples__/no-image';
10
9
  import Small from '../__examples__/small';
11
10
  import BackgroundCover from '../__examples__/background-cover';
11
+ import UserImage from '../__examples__/user-image';
12
+ import GroupImage from '../__examples__/group-image';
12
13
 
13
14
  storiesOf(BRAND_BAND, module)
14
15
  .addDecorator((getStory) => (
@@ -29,5 +30,6 @@ storiesOf(BRAND_BAND, module)
29
30
  .add('Small', () => <Small />)
30
31
  .add('Large', () => <Large />)
31
32
  .add('No Image', () => <NoImage />)
32
- .add('Lightning Blue Theme', () => <LightningBlueTheme />)
33
+ .add('User Image', () => <UserImage />)
34
+ .add('Group Image', () => <GroupImage />)
33
35
  .add('Image with background size cover', () => <BackgroundCover />);
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import BrandBand from '~/components/brand-band'; // `~` is replaced with design-system-react at runtime
3
+
4
+ class Example extends React.Component {
5
+ render() {
6
+ return <BrandBand id="brand-band-user-group" image="group" />;
7
+ }
8
+ }
9
+
10
+ Example.displayName = 'BrandBandExample';
11
+
12
+ export default Example; // export is replaced with `ReactDOM.render(<Example />, mountNode);` at runtime
@@ -7,8 +7,7 @@ class Example extends React.Component {
7
7
  <BrandBand
8
8
  id="brand-band-no-image"
9
9
  image="none"
10
- style={{ zIndex: 1 }}
11
- styleContainer={{ border: '1px solid #eee' }}
10
+ style={{ zIndex: 1, backgroundColor: '#eef4ff' }}
12
11
  />
13
12
  );
14
13
  }
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import BrandBand from '~/components/brand-band'; // `~` is replaced with design-system-react at runtime
3
+
4
+ class Example extends React.Component {
5
+ render() {
6
+ return <BrandBand id="brand-band-user-image" image="user" />;
7
+ }
8
+ }
9
+
10
+ Example.displayName = 'BrandBandExample';
11
+
12
+ export default Example; // export is replaced with `ReactDOM.render(<Example />, mountNode);` at runtime
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _sunsetProperty = _interopRequireDefault(require("../../utilities/warning/sunset-property"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ /* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
13
+
14
+ /* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
15
+
16
+ /* eslint-disable import/no-mutable-exports */
17
+
18
+ /* eslint-disable max-len */
19
+ var checkProps = function checkPropsFunction() {};
20
+
21
+ if (process.env.NODE_ENV !== 'production') {
22
+ checkProps = function checkPropsFunction(COMPONENT, props) {
23
+ (0, _sunsetProperty.default)(COMPONENT, props.styleContainer, 'styleContainer');
24
+ (0, _sunsetProperty.default)(COMPONENT, props.theme, 'theme');
25
+ };
26
+ }
27
+
28
+ var _default = checkProps;
29
+ exports.default = _default;
@@ -9,10 +9,6 @@
9
9
  },
10
10
  "SLDS-component-path": "/components/brand-band",
11
11
  "site-stories": [
12
- {
13
- "heading": "Lightning Blue",
14
- "path": "/__examples__/lightning-blue-theme.jsx"
15
- },
16
12
  {
17
13
  "heading": "Default",
18
14
  "path": "/__examples__/default.jsx"
@@ -28,6 +24,14 @@
28
24
  {
29
25
  "heading": "No Image",
30
26
  "path": "/__examples__/no-image.jsx"
27
+ },
28
+ {
29
+ "heading": "User Image",
30
+ "path": "/__examples__/user-image.jsx"
31
+ },
32
+ {
33
+ "heading": "Group Image",
34
+ "path": "/__examples__/group-image.jsx"
31
35
  }
32
36
  ],
33
37
  "url-slug": "brand-band"
@@ -15,16 +15,12 @@ var _shortid = _interopRequireDefault(require("shortid"));
15
15
 
16
16
  var _classNames = _interopRequireDefault(require("../../utilities/class-names"));
17
17
 
18
+ var _checkProps = _interopRequireDefault(require("./check-props"));
19
+
18
20
  var _constants = require("../../utilities/constants");
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
23
 
22
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
23
-
24
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
25
-
26
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
27
-
28
24
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
29
25
 
30
26
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -47,20 +43,6 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
47
43
 
48
44
  /**
49
45
  * The brand band provides theming capability that adds personality and improves information density and contrast.
50
- *
51
- * NOTE: you may find that themes other than 'default' fail to load the appropriate styling in your application.
52
- * If this occurs the cause is very likely to be CSP settings on the server hosting your application protecting against style injections.
53
- * Changing these settings is not recommended. Instead, add the following styles to any stylesheet provided by the server itself (such as an external stylesheet):
54
- *
55
- * When using 'lightning-theme':
56
- * .slds-brand-band.dsr-brand-band_lightning-blue:before {
57
- * background-image: url(/assets/images/themes/oneSalesforce/banner-brand-default.png), linear-gradient(to top, rgba(175, 197, 222, 0) 0, #1B5F9E);
58
- * }
59
- * .slds-brand-band.dsr-brand-band_lightning-blue:after {
60
- * background-image: linear-gradient(to bottom, rgba(175, 197, 222, 0) 60%, #AFC5DE);
61
- * }
62
- *
63
- * For more information on the problem, [see this Stack Overflow question](https://stackoverflow.com/questions/17766817/refused-to-apply-inline-style-because-it-violates-the-following-content-security)
64
46
  */
65
47
  var BrandBand = /*#__PURE__*/function (_React$Component) {
66
48
  _inherits(BrandBand, _React$Component);
@@ -73,6 +55,7 @@ var BrandBand = /*#__PURE__*/function (_React$Component) {
73
55
  _classCallCheck(this, BrandBand);
74
56
 
75
57
  _this = _super.call(this, props);
58
+ (0, _checkProps.default)(_constants.BRAND_BAND, _this.props);
76
59
  _this.generatedId = _shortid.default.generate();
77
60
  return _this;
78
61
  }
@@ -87,30 +70,18 @@ var BrandBand = /*#__PURE__*/function (_React$Component) {
87
70
  value: function render() {
88
71
  var props = this.props;
89
72
  return /*#__PURE__*/_react.default.createElement("div", {
90
- style: _objectSpread({
91
- background: 'rgb(176, 196, 223)',
92
- height: '100%',
93
- position: 'relative',
94
- width: '100%',
95
- zIndex: 1
96
- }, props.styleContainer)
97
- }, BrandBand.injectLightningBlueStyles(), /*#__PURE__*/_react.default.createElement("div", {
98
73
  className: (0, _classNames.default)('slds-brand-band', {
99
74
  'slds-brand-band_small': props.size === 'small',
100
75
  'slds-brand-band_medium': props.size === 'medium',
101
76
  'slds-brand-band_large': props.size === 'large',
102
77
  'slds-brand-band_cover': props.backgroundSize === 'cover',
103
78
  'slds-brand-band_none': props.image === 'none',
104
- 'dsr-brand-band_lightning-blue': true
79
+ 'slds-brand-band_group': props.image === 'group',
80
+ 'slds-brand-band_user': props.image === 'user'
105
81
  }, props.className),
106
82
  id: this.getId(),
107
83
  style: props.style
108
- }, props.children));
109
- }
110
- }], [{
111
- key: "injectLightningBlueStyles",
112
- value: function injectLightningBlueStyles() {
113
- return /*#__PURE__*/_react.default.createElement("style", null, ".slds-brand-band.dsr-brand-band_lightning-blue:before {\n\tbackground-image: url(/assets/images/themes/oneSalesforce/banner-brand-default.png), linear-gradient(to top, rgba(175, 197, 222, 0) 0, #1B5F9E);\n}\n.slds-brand-band.dsr-brand-band_lightning-blue:after {\n\tbackground-image: linear-gradient(to bottom, rgba(175, 197, 222, 0) 60%, #AFC5DE);\n}");
84
+ }, props.children);
114
85
  }
115
86
  }]);
116
87
 
@@ -137,7 +108,7 @@ BrandBand.propTypes = {
137
108
  /**
138
109
  * Image of the brand band
139
110
  */
140
- image: _propTypes.default.oneOf(['default', 'none']),
111
+ image: _propTypes.default.oneOf(['default', 'none', 'group', 'user']),
141
112
 
142
113
  /**
143
114
  * Background size of the brand band. Default is 'contain'
@@ -152,24 +123,12 @@ BrandBand.propTypes = {
152
123
  /**
153
124
  * Custom styles to be passed to the component
154
125
  */
155
- style: _propTypes.default.object,
156
-
157
- /**
158
- * Custom styles to be passed to the component container
159
- */
160
- styleContainer: _propTypes.default.object,
161
-
162
- /**
163
- * Different brand band styling.
164
- * NOTE: using 'lightning-blue' may result in incorrect styling depending on server CSP settings. See opening component documentation above for details.
165
- */
166
- theme: _propTypes.default.oneOf(['default', 'lightning-blue'])
126
+ style: _propTypes.default.object
167
127
  };
168
128
  BrandBand.defaultProps = {
169
129
  backgroundSize: 'contain',
170
130
  image: 'default',
171
- size: 'medium',
172
- theme: 'default'
131
+ size: 'medium'
173
132
  };
174
133
  var _default = BrandBand;
175
134
  exports.default = _default;
@@ -19,7 +19,7 @@ declare module '@salesforce/design-system-react/components/brand-band' {
19
19
  /**
20
20
  * Image of the brand band
21
21
  */
22
- image?: 'default' | 'none';
22
+ image?: 'default' | 'none' | 'user' | 'group';
23
23
 
24
24
  /**
25
25
  * Background size of the brand band. Default is 'contain'
@@ -34,34 +34,9 @@ declare module '@salesforce/design-system-react/components/brand-band' {
34
34
  * Custom styles to be passed to the component
35
35
  */
36
36
  style?: Record<string, any>;
37
-
38
- /**
39
- * Custom styles to be passed to the component container
40
- */
41
- styleContainer?: Record<string, any>;
42
-
43
- /**
44
- * Different brand band styling.
45
- * NOTE: using 'lightning-blue' may result in incorrect styling depending on server CSP settings. See opening component documentation above for details.
46
- */
47
- theme?: 'default' | 'lightning-blue';
48
37
  };
49
38
  /**
50
39
  * The brand band provides theming capability that adds personality and improves information density and contrast.
51
- *
52
- * NOTE: you may find that themes other than 'default' fail to load the appropriate styling in your application.
53
- * If this occurs the cause is very likely to be CSP settings on the server hosting your application protecting against style injections.
54
- * Changing these settings is not recommended. Instead, add the following styles to any stylesheet provided by the server itself (such as an external stylesheet):
55
- *
56
- * When using 'lightning-theme':
57
- * .slds-brand-band.dsr-brand-band_lightning-blue:before {
58
- * background-image: url(/assets/images/themes/oneSalesforce/banner-brand-default.png), linear-gradient(to top, rgba(175, 197, 222, 0) 0, #1B5F9E);
59
- * }
60
- * .slds-brand-band.dsr-brand-band_lightning-blue:after {
61
- * background-image: linear-gradient(to bottom, rgba(175, 197, 222, 0) 60%, #AFC5DE);
62
- * }
63
- *
64
- * For more information on the problem, [see this Stack Overflow question](https://stackoverflow.com/questions/17766817/refused-to-apply-inline-style-because-it-violates-the-following-content-security)
65
40
  */
66
41
  function Component(props: Props): JSX.Element;
67
42
  export default Component;
@@ -46,7 +46,6 @@ describe('SLDSButton: ', () => {
46
46
  style: { background: 'rgb(18, 49, 35)' },
47
47
  });
48
48
  [btn] = cmp.getElementsByClassName('slds-button');
49
- console.log('!!!!!', cmp, btn);
50
49
  });
51
50
 
52
51
  it('renders correct label', () => {
@@ -31,6 +31,8 @@ import IconSettings from '../../../components/icon-settings';
31
31
  */
32
32
  chai.use(chaiEnzyme());
33
33
 
34
+ const callbacks = require('../../../utilities/key-callbacks');
35
+
34
36
  const accounts = [
35
37
  {
36
38
  id: '1',
@@ -480,6 +482,22 @@ describe('SLDSCombobox', function describeFunction() {
480
482
  const { scrollTop: scrollTop2 } = nodes.menuListbox.instance();
481
483
  expect(scrollTop2 === 4 || scrollTop2 === 0).to.eql(true); // done because menu and menu item size in phantomjs is weird
482
484
  });
485
+
486
+ it('propagates keyboard events when menu is closed', function () {
487
+ const spiedCallbacks = sinon.spy(callbacks, 'default');
488
+ wrapper = mount(<DemoComponent variant="inline-listbox" />, {
489
+ attachTo: mountNode,
490
+ });
491
+ const nodes = getNodes({ wrapper });
492
+ // click in the input to open up menu
493
+ nodes.input.simulate('click', {});
494
+ // esc to close the menu and stop event propagation
495
+ nodes.input.simulate('keyDown', keyObjects.ESCAPE);
496
+ expect(spiedCallbacks.getCall(0).lastArg.stopPropagation).to.equal(true);
497
+ // esc to propagate the events further up
498
+ nodes.input.simulate('keyDown', keyObjects.ESCAPE);
499
+ expect(spiedCallbacks.getCall(1).lastArg.stopPropagation).to.equal(false);
500
+ });
483
501
  });
484
502
 
485
503
  describe('Variant-specific', () => {
@@ -760,11 +760,15 @@ var Combobox = /*#__PURE__*/function (_React$Component) {
760
760
  callback: _this.handleKeyDownOther,
761
761
  stopPropagation: false
762
762
  };
763
- } // Helper function that takes an object literal of callbacks that are triggered with a key event
763
+ } // Propagate events when menu is closed
764
+
765
+
766
+ var stopPropagation = _this.getIsOpen(); // Helper function that takes an object literal of callbacks that are triggered with a key event
764
767
 
765
768
 
766
769
  (0, _keyCallbacks.default)(event, {
767
- callbacks: callbacks
770
+ callbacks: callbacks,
771
+ stopPropagation: stopPropagation
768
772
  });
769
773
  });
770
774