@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 />);
@@ -3,17 +3,7 @@ import BrandBand from '~/components/brand-band'; // `~` is replaced with design-
3
3
 
4
4
  class Example extends React.Component {
5
5
  render() {
6
- return (
7
- <BrandBand
8
- id="brand-band-lightning-blue"
9
- className="slds-p-around_small"
10
- theme="lightning-blue"
11
- >
12
- <div className="slds-box slds-theme_default">
13
- <h3 className="slds-text-heading_label slds-truncate">My App</h3>
14
- </div>
15
- </BrandBand>
16
- );
6
+ return <BrandBand id="brand-band-user-group" image="group" />;
17
7
  }
18
8
  }
19
9
 
@@ -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
  }
@@ -3,17 +3,7 @@ import BrandBand from '~/components/brand-band'; // `~` is replaced with design-
3
3
 
4
4
  class Example extends React.Component {
5
5
  render() {
6
- return (
7
- <BrandBand
8
- id="brand-band-lightning-blue"
9
- className="slds-p-around_small"
10
- theme="lightning-blue"
11
- >
12
- <div className="slds-box slds-theme_default">
13
- <h3 className="slds-text-heading_label slds-truncate">My App</h3>
14
- </div>
15
- </BrandBand>
16
- );
6
+ return <BrandBand id="brand-band-user-image" image="user" />;
17
7
  }
18
8
  }
19
9
 
@@ -0,0 +1,18 @@
1
+ /* Copyright (c) 2015-present, salesforce.com, inc. All rights reserved */
2
+ /* Licensed under BSD 3-Clause - see LICENSE.txt or git.io/sfdc-license */
3
+ /* eslint-disable import/no-mutable-exports */
4
+ /* eslint-disable max-len */
5
+
6
+ import sunsetProperty from '../../utilities/warning/sunset-property';
7
+
8
+ let checkProps = function checkPropsFunction() {};
9
+
10
+ if (process.env.NODE_ENV !== 'production') {
11
+ checkProps = function checkPropsFunction(COMPONENT, props) {
12
+ sunsetProperty(COMPONENT, props.styleContainer, 'styleContainer');
13
+
14
+ sunsetProperty(COMPONENT, props.theme, 'theme');
15
+ };
16
+ }
17
+
18
+ export default checkProps;
@@ -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"
@@ -21,40 +21,20 @@ import shortid from 'shortid';
21
21
  // A simple javascript utility for conditionally joining classNames together.
22
22
  import classNames from '../../utilities/class-names';
23
23
 
24
+ // This component's `checkProps` which issues warnings to developers about properties when in development mode (similar to React's built in development tools)
25
+ import checkProps from './check-props';
26
+
24
27
  // ## Constants
25
28
  import { BRAND_BAND } from '../../utilities/constants';
26
29
 
27
30
  /**
28
31
  * The brand band provides theming capability that adds personality and improves information density and contrast.
29
- *
30
- * NOTE: you may find that themes other than 'default' fail to load the appropriate styling in your application.
31
- * If this occurs the cause is very likely to be CSP settings on the server hosting your application protecting against style injections.
32
- * Changing these settings is not recommended. Instead, add the following styles to any stylesheet provided by the server itself (such as an external stylesheet):
33
- *
34
- * When using 'lightning-theme':
35
- * .slds-brand-band.dsr-brand-band_lightning-blue:before {
36
- * background-image: url(/assets/images/themes/oneSalesforce/banner-brand-default.png), linear-gradient(to top, rgba(175, 197, 222, 0) 0, #1B5F9E);
37
- * }
38
- * .slds-brand-band.dsr-brand-band_lightning-blue:after {
39
- * background-image: linear-gradient(to bottom, rgba(175, 197, 222, 0) 60%, #AFC5DE);
40
- * }
41
- *
42
- * 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)
43
32
  */
44
33
  class BrandBand extends React.Component {
45
- static injectLightningBlueStyles() {
46
- return (
47
- <style>{`.slds-brand-band.dsr-brand-band_lightning-blue:before {
48
- background-image: url(/assets/images/themes/oneSalesforce/banner-brand-default.png), linear-gradient(to top, rgba(175, 197, 222, 0) 0, #1B5F9E);
49
- }
50
- .slds-brand-band.dsr-brand-band_lightning-blue:after {
51
- background-image: linear-gradient(to bottom, rgba(175, 197, 222, 0) 60%, #AFC5DE);
52
- }`}</style>
53
- );
54
- }
55
-
56
34
  constructor(props) {
57
35
  super(props);
36
+
37
+ checkProps(BRAND_BAND, this.props);
58
38
  this.generatedId = shortid.generate();
59
39
  }
60
40
 
@@ -67,35 +47,23 @@ class BrandBand extends React.Component {
67
47
 
68
48
  return (
69
49
  <div
70
- style={{
71
- background: 'rgb(176, 196, 223)',
72
- height: '100%',
73
- position: 'relative',
74
- width: '100%',
75
- zIndex: 1,
76
- ...props.styleContainer,
77
- }}
50
+ className={classNames(
51
+ 'slds-brand-band',
52
+ {
53
+ 'slds-brand-band_small': props.size === 'small',
54
+ 'slds-brand-band_medium': props.size === 'medium',
55
+ 'slds-brand-band_large': props.size === 'large',
56
+ 'slds-brand-band_cover': props.backgroundSize === 'cover',
57
+ 'slds-brand-band_none': props.image === 'none',
58
+ 'slds-brand-band_group': props.image === 'group',
59
+ 'slds-brand-band_user': props.image === 'user',
60
+ },
61
+ props.className
62
+ )}
63
+ id={this.getId()}
64
+ style={props.style}
78
65
  >
79
- {BrandBand.injectLightningBlueStyles()}
80
- <div
81
- className={classNames(
82
- 'slds-brand-band',
83
- {
84
- 'slds-brand-band_small': props.size === 'small',
85
- 'slds-brand-band_medium': props.size === 'medium',
86
- 'slds-brand-band_large': props.size === 'large',
87
- 'slds-brand-band_cover': props.backgroundSize === 'cover',
88
- 'slds-brand-band_none': props.image === 'none',
89
-
90
- 'dsr-brand-band_lightning-blue': true,
91
- },
92
- props.className
93
- )}
94
- id={this.getId()}
95
- style={props.style}
96
- >
97
- {props.children}
98
- </div>
66
+ {props.children}
99
67
  </div>
100
68
  );
101
69
  }
@@ -126,12 +94,13 @@ BrandBand.propTypes = {
126
94
  /**
127
95
  * Image of the brand band
128
96
  */
129
- image: PropTypes.oneOf(['default', 'none']),
97
+ image: PropTypes.oneOf(['default', 'none', 'group', 'user']),
130
98
 
131
99
  /**
132
100
  * Background size of the brand band. Default is 'contain'
133
101
  */
134
102
  backgroundSize: PropTypes.oneOf(['contain', 'cover']),
103
+
135
104
  /**
136
105
  * Size of the brand band. Default is 'medium'
137
106
  */
@@ -141,24 +110,12 @@ BrandBand.propTypes = {
141
110
  * Custom styles to be passed to the component
142
111
  */
143
112
  style: PropTypes.object,
144
-
145
- /**
146
- * Custom styles to be passed to the component container
147
- */
148
- styleContainer: PropTypes.object,
149
-
150
- /**
151
- * Different brand band styling.
152
- * NOTE: using 'lightning-blue' may result in incorrect styling depending on server CSP settings. See opening component documentation above for details.
153
- */
154
- theme: PropTypes.oneOf(['default', 'lightning-blue']),
155
113
  };
156
114
 
157
115
  BrandBand.defaultProps = {
158
116
  backgroundSize: 'contain',
159
117
  image: 'default',
160
118
  size: 'medium',
161
- theme: 'default',
162
119
  };
163
120
 
164
121
  export default BrandBand;
@@ -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', () => {
@@ -804,8 +804,11 @@ class Combobox extends React.Component {
804
804
  };
805
805
  }
806
806
 
807
+ // Propagate events when menu is closed
808
+ const stopPropagation = this.getIsOpen();
809
+
807
810
  // Helper function that takes an object literal of callbacks that are triggered with a key event
808
- mapKeyEventCallbacks(event, { callbacks });
811
+ mapKeyEventCallbacks(event, { callbacks, stopPropagation });
809
812
  };
810
813
 
811
814
  handleKeyDownDown = (event) => {