@carbon/ibm-products-web-components 0.12.0 → 0.13.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/custom-elements.json +126 -0
  2. package/es/components/full-page-error/assets/error403SVG.js +831 -0
  3. package/es/components/full-page-error/assets/error403SVG.js.map +1 -0
  4. package/es/components/full-page-error/assets/error404SVG.js +735 -0
  5. package/es/components/full-page-error/assets/error404SVG.js.map +1 -0
  6. package/es/components/full-page-error/assets/errorGenericSVG.js +830 -0
  7. package/es/components/full-page-error/assets/errorGenericSVG.js.map +1 -0
  8. package/es/components/full-page-error/full-page-error.d.ts +43 -0
  9. package/es/components/full-page-error/full-page-error.js +102 -0
  10. package/es/components/full-page-error/full-page-error.js.map +1 -0
  11. package/es/components/full-page-error/full-page-error.scss.js +13 -0
  12. package/es/components/full-page-error/full-page-error.scss.js.map +1 -0
  13. package/es/components/full-page-error/full-page-error.test.d.ts +7 -0
  14. package/es/components/full-page-error/full-page-error.test.js +103 -0
  15. package/es/components/full-page-error/full-page-error.test.js.map +1 -0
  16. package/es/components/full-page-error/index.d.ts +9 -0
  17. package/es/components/full-page-error/index.js +9 -0
  18. package/es/components/full-page-error/index.js.map +1 -0
  19. package/es/components/full-page-error/types.d.ts +13 -0
  20. package/es/components/full-page-error/types.js +24 -0
  21. package/es/components/full-page-error/types.js.map +1 -0
  22. package/es/components/tearsheet/story-styles.scss.js +13 -0
  23. package/es/components/tearsheet/story-styles.scss.js.map +1 -0
  24. package/es/components/tearsheet/tearsheet.test.d.ts +8 -1
  25. package/es/components/tearsheet/tearsheet.test.js +230 -71
  26. package/es/components/tearsheet/tearsheet.test.js.map +1 -1
  27. package/es/components/tearsheet/utils.d.ts +29 -0
  28. package/es/components/tearsheet/utils.js +294 -0
  29. package/es/components/tearsheet/utils.js.map +1 -0
  30. package/es/components/user-avatar/user-avatar.test.d.ts +1 -0
  31. package/es/components/user-avatar/user-avatar.test.js +128 -0
  32. package/es/components/user-avatar/user-avatar.test.js.map +1 -0
  33. package/es/index.d.ts +1 -0
  34. package/es/index.js +1 -0
  35. package/es/index.js.map +1 -1
  36. package/es/package.json.js +1 -1
  37. package/es-custom/components/full-page-error/assets/error403SVG.js +831 -0
  38. package/es-custom/components/full-page-error/assets/error403SVG.js.map +1 -0
  39. package/es-custom/components/full-page-error/assets/error404SVG.js +735 -0
  40. package/es-custom/components/full-page-error/assets/error404SVG.js.map +1 -0
  41. package/es-custom/components/full-page-error/assets/errorGenericSVG.js +830 -0
  42. package/es-custom/components/full-page-error/assets/errorGenericSVG.js.map +1 -0
  43. package/es-custom/components/full-page-error/full-page-error.d.ts +43 -0
  44. package/es-custom/components/full-page-error/full-page-error.js +102 -0
  45. package/es-custom/components/full-page-error/full-page-error.js.map +1 -0
  46. package/es-custom/components/full-page-error/full-page-error.scss.js +13 -0
  47. package/es-custom/components/full-page-error/full-page-error.scss.js.map +1 -0
  48. package/es-custom/components/full-page-error/full-page-error.test.d.ts +7 -0
  49. package/es-custom/components/full-page-error/full-page-error.test.js +103 -0
  50. package/es-custom/components/full-page-error/full-page-error.test.js.map +1 -0
  51. package/es-custom/components/full-page-error/index.d.ts +9 -0
  52. package/es-custom/components/full-page-error/index.js +9 -0
  53. package/es-custom/components/full-page-error/index.js.map +1 -0
  54. package/es-custom/components/full-page-error/types.d.ts +13 -0
  55. package/es-custom/components/full-page-error/types.js +24 -0
  56. package/es-custom/components/full-page-error/types.js.map +1 -0
  57. package/es-custom/components/tearsheet/story-styles.scss.js +13 -0
  58. package/es-custom/components/tearsheet/story-styles.scss.js.map +1 -0
  59. package/es-custom/components/tearsheet/tearsheet.test.d.ts +8 -1
  60. package/es-custom/components/tearsheet/tearsheet.test.js +230 -71
  61. package/es-custom/components/tearsheet/tearsheet.test.js.map +1 -1
  62. package/es-custom/components/tearsheet/utils.d.ts +29 -0
  63. package/es-custom/components/tearsheet/utils.js +294 -0
  64. package/es-custom/components/tearsheet/utils.js.map +1 -0
  65. package/es-custom/components/user-avatar/user-avatar.test.d.ts +1 -0
  66. package/es-custom/components/user-avatar/user-avatar.test.js +128 -0
  67. package/es-custom/components/user-avatar/user-avatar.test.js.map +1 -0
  68. package/es-custom/index.d.ts +1 -0
  69. package/es-custom/index.js +1 -0
  70. package/es-custom/index.js.map +1 -1
  71. package/es-custom/package.json.js +1 -1
  72. package/lib/components/full-page-error/full-page-error.d.ts +43 -0
  73. package/lib/components/full-page-error/full-page-error.test.d.ts +7 -0
  74. package/lib/components/full-page-error/index.d.ts +9 -0
  75. package/lib/components/full-page-error/types.d.ts +13 -0
  76. package/lib/components/tearsheet/tearsheet.test.d.ts +8 -1
  77. package/lib/components/tearsheet/utils.d.ts +29 -0
  78. package/lib/components/user-avatar/user-avatar.test.d.ts +1 -0
  79. package/lib/index.d.ts +1 -0
  80. package/package.json +5 -4
  81. package/scss/components/full-page-error/full-page-error.scss +29 -0
  82. package/scss/components/full-page-error/story-styles.scss +24 -0
  83. package/scss/components/user-avatar/user-avatar.scss +1 -1
@@ -0,0 +1,294 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { BUTTON_KIND } from '@carbon/web-components/es/components/button/defs.js';
9
+ import '@carbon/web-components/es-custom/components/tabs/index.js';
10
+ import '@carbon/web-components/es-custom/components/text-input/index.js';
11
+ import '@carbon/web-components/es-custom/components/textarea/index.js';
12
+ import '@carbon/web-components/es-custom/components/slug/index.js';
13
+ import '@carbon/web-components/es-custom/components/dropdown/index.js';
14
+ import '@carbon/web-components/es-custom/components/progress-indicator/index.js';
15
+ import '@carbon/web-components/es-custom/components/progress-bar/index.js';
16
+ import './tearsheet.js';
17
+ import { html } from 'lit';
18
+ import { prefix } from '../../globals/settings.js';
19
+ import styles from './story-styles.scss.js';
20
+
21
+ /**
22
+ * @license
23
+ *
24
+ * Copyright IBM Corp. 2024, 2024
25
+ *
26
+ * This source code is licensed under the Apache-2.0 license found in the
27
+ * LICENSE file in the root directory of this source tree.
28
+ */
29
+ const storyPrefix = 'tearsheet-stories';
30
+ const cancelButton = () => {
31
+ var _a;
32
+ (_a = document.querySelector(`${prefix}-tearsheet`)) === null || _a === void 0 ? void 0 : _a.removeAttribute('open');
33
+ };
34
+ const influencers = {
35
+ 'No influencer': 0,
36
+ 'Simple influencer': 1,
37
+ 'Progress influencer': 2,
38
+ };
39
+ const getInfluencer = (index) => {
40
+ switch (index) {
41
+ case 1:
42
+ return html `<div
43
+ slot="influencer"
44
+ class=${`${storyPrefix}__dummy-content-block`}
45
+ >
46
+ Influencer
47
+ </div>`;
48
+ case 2:
49
+ return html ` <cds-custom-progress-indicator
50
+ vertical
51
+ slot="influencer"
52
+ class=${`${storyPrefix}__dummy-content-block`}
53
+ >
54
+ <cds-custom-progress-step
55
+ state="complete"
56
+ label="First step"
57
+ secondary-label="Optional label"
58
+ description="Step 1: Getting started with Carbon Design System"
59
+ ></cds-custom-progress-step>
60
+ <cds-custom-progress-step
61
+ label="Second step with tooltip"
62
+ state="current"
63
+ ></cds-custom-progress-step>
64
+ <cds-custom-progress-step
65
+ label="Third step with tooltip"
66
+ state="incomplete"
67
+ ></cds-custom-progress-step>
68
+ <cds-custom-progress-step
69
+ label="Fourth step"
70
+ secondary-label="Example invalid step"
71
+ state="invalid"
72
+ ></cds-custom-progress-step>
73
+ <cds-custom-progress-step
74
+ disabled
75
+ label="Fifth step"
76
+ state="incomplete"
77
+ ></cds-custom-progress-step>
78
+ </cds-custom-progress-indicator>`;
79
+ default:
80
+ return null;
81
+ }
82
+ };
83
+ const getContent = (index) => {
84
+ switch (index) {
85
+ case 1:
86
+ return html `
87
+ <style>
88
+ ${styles}
89
+ </style>
90
+ <div class=${`${storyPrefix}__dummy-content-block`}>
91
+ <h5>Section</h5>
92
+ <cds-custom-text-input
93
+ label="Input A"
94
+ id="tearsheet-story-text-input-a"
95
+ class="${storyPrefix}text-input"
96
+ ></cds-custom-text-input>
97
+ <cds-custom-text-input
98
+ label="Input B"
99
+ id="tearsheet-story-text-input-b"
100
+ class="${storyPrefix}text-input"
101
+ ></cds-custom-text-input>
102
+ </div>
103
+ `;
104
+ case 2:
105
+ return html ` <style>
106
+ ${styles}
107
+ </style>
108
+ <div class=${`${storyPrefix}__dummy-content-block`}>
109
+ <h5>Section</h5>
110
+ <div class="${storyPrefix}text-inputs">
111
+ <cds-custom-text-input
112
+ label="Input A"
113
+ id="tearsheet-story-text-input-a"
114
+ ></cds-custom-text-input>
115
+ <cds-custom-text-input
116
+ label="Input B"
117
+ id="tearsheet-story-text-input-b"
118
+ ></cds-custom-text-input>
119
+ </div>
120
+ <div class="${storyPrefix}text-inputs">
121
+ <cds-custom-text-input
122
+ label="Input C"
123
+ id="tearsheet-story-text-input-c"
124
+ ></cds-custom-text-input>
125
+ <cds-custom-text-input
126
+ label="Input D"
127
+ id="tearsheet-story-text-input-d"
128
+ ></cds-custom-text-input>
129
+ </div>
130
+ <div class="${storyPrefix}textarea-container">
131
+ <cds-custom-textarea
132
+ label="Notes"
133
+ value="This is a text area"
134
+ ></cds-custom-textarea>
135
+ <cds-custom-textarea
136
+ label="Notes"
137
+ value="This is a text area"
138
+ ></cds-custom-textarea>
139
+ <cds-custom-textarea
140
+ label="Notes"
141
+ value="This is a text area"
142
+ ></cds-custom-textarea>
143
+ </div>
144
+ </div>`;
145
+ default:
146
+ return null;
147
+ }
148
+ };
149
+ const getLabel = (index) => {
150
+ switch (index) {
151
+ case 1:
152
+ return html `<span slot="label">Optional label for context</span>`;
153
+ case 2:
154
+ return html `<span slot="label"
155
+ >A longer label giving a bit more context
156
+ </span>`;
157
+ default:
158
+ return null;
159
+ }
160
+ };
161
+ const getActionToolbarItems = (index) => {
162
+ switch (index) {
163
+ case 1:
164
+ return html `<cds-custom-dropdown slot="header-actions" value="option 1">
165
+ ${['option 1', 'option 2', 'option 3', 'option 4'].map((option) => html ` <cds-custom-dropdown-item value="${option}"
166
+ >${option}</cds-custom-dropdown-item
167
+ >`)}
168
+ </cds-custom-dropdown>`;
169
+ case 2:
170
+ return html `
171
+ <cds-custom-button
172
+ slot="header-actions"
173
+ kind=${BUTTON_KIND.SECONDARY}
174
+ size="sm"
175
+ style="width: initial"
176
+ >
177
+ Secondary
178
+ </cds-custom-button>
179
+ <cds-custom-button
180
+ slot="header-actions"
181
+ kind=${BUTTON_KIND.PRIMARY}
182
+ size="sm"
183
+ style="width: initial"
184
+ >
185
+ Primary
186
+ </cds-custom-button>
187
+ `;
188
+ default:
189
+ return null;
190
+ }
191
+ };
192
+ const toActions = (kinds) => {
193
+ return kinds === null || kinds === void 0 ? void 0 : kinds.map((kind) => {
194
+ return html `<cds-custom-button
195
+ key=${kind}
196
+ slot="actions"
197
+ kind=${kind}
198
+ @click=${kind === 'ghost' && cancelButton}
199
+ >
200
+ ${kind.charAt(0).toUpperCase() + kind.slice(1)}
201
+ </cds-custom-button>`;
202
+ });
203
+ };
204
+ // TODO: There are problems switching this
205
+ const getActionItems = (index) => {
206
+ switch (index) {
207
+ case 1:
208
+ return toActions([BUTTON_KIND.PRIMARY]);
209
+ case 2:
210
+ return toActions([BUTTON_KIND.GHOST, BUTTON_KIND.PRIMARY]);
211
+ case 3:
212
+ return toActions([BUTTON_KIND.DANGER, BUTTON_KIND.PRIMARY]);
213
+ case 4:
214
+ return toActions([
215
+ BUTTON_KIND.GHOST,
216
+ BUTTON_KIND.SECONDARY,
217
+ BUTTON_KIND.PRIMARY,
218
+ ]);
219
+ case 5:
220
+ return toActions([
221
+ BUTTON_KIND.DANGER,
222
+ BUTTON_KIND.SECONDARY,
223
+ BUTTON_KIND.PRIMARY,
224
+ ]);
225
+ case 6:
226
+ return toActions([
227
+ BUTTON_KIND.GHOST,
228
+ BUTTON_KIND.TERTIARY,
229
+ BUTTON_KIND.SECONDARY,
230
+ BUTTON_KIND.PRIMARY,
231
+ ]);
232
+ case 7:
233
+ return toActions([
234
+ BUTTON_KIND.DANGER,
235
+ BUTTON_KIND.TERTIARY,
236
+ BUTTON_KIND.SECONDARY,
237
+ BUTTON_KIND.PRIMARY,
238
+ ]);
239
+ case 8:
240
+ return toActions([
241
+ BUTTON_KIND.GHOST,
242
+ BUTTON_KIND.DANGER,
243
+ BUTTON_KIND.TERTIARY,
244
+ BUTTON_KIND.SECONDARY,
245
+ BUTTON_KIND.PRIMARY,
246
+ ]);
247
+ default:
248
+ return null;
249
+ }
250
+ };
251
+ const getNavigation = (index) => {
252
+ switch (index) {
253
+ case 1:
254
+ return html ` <div
255
+ className="tearsheet-stories__tabs"
256
+ slot="header-navigation"
257
+ >
258
+ <cds-custom-tabs value="1">
259
+ <cds-custom-tab value="1">Tab 1</cds-custom-tab>
260
+ <cds-custom-tab value="2">Tab 2</cds-custom-tab>
261
+ <cds-custom-tab value="3">Tab 3</cds-custom-tab>
262
+ <cds-custom-tab value="4">Tab 4</cds-custom-tab>
263
+ </cds-custom-tabs>
264
+ </div>`;
265
+ default:
266
+ return null;
267
+ }
268
+ };
269
+ const getSlug = (index) => {
270
+ switch (index) {
271
+ case 1:
272
+ return html `<cds-custom-slug size="xs" alignment="bottom-right">
273
+ <div slot="body-text">
274
+ <p class="secondary">AI Explained</p>
275
+ <h1>84%</h1>
276
+ <p class="secondary bold">Confidence score</p>
277
+ <!-- //cspell: disable -->
278
+ <p class="secondary">
279
+ Lorem ipsum dolor sit amet, di os consectetur adipiscing elit, sed
280
+ do eiusmod tempor incididunt ut fsil labore et dolore magna aliqua.
281
+ </p>
282
+ <!-- //cspell: enable -->
283
+ <hr />
284
+ <p class="secondary">Model type</p>
285
+ <p class="bold">Foundation model</p>
286
+ </div>
287
+ </cds-custom-slug>`;
288
+ default:
289
+ return null;
290
+ }
291
+ };
292
+
293
+ export { getActionItems, getActionToolbarItems, getContent, getInfluencer, getLabel, getNavigation, getSlug, influencers };
294
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sources":["../../../src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AA,WAAW,CAAC,KAAK;AACjB,gBAAA,WAAW,CAAC,MAAM;AAClB,gBAAA,WAAW,CAAC,QAAQ;AACpB,gBAAA,WAAW,CAAC,SAAS;AACrB,gBAAA,WAAW,CAAC,OAAO;AACpB,aAAA,CAAC;AACJ,QAAA;AACE,YAAA,OAAO,IAAI;;AAEjB;AAEa,MAAA,aAAa,GAAG,CAAC,KAAK,KAAI;IACrC,QAAQ,KAAK;AACX,QAAA,KAAK,CAAC;AACJ,YAAA,OAAO,IAAI,CAAA,CAAA;;;;;;;;;;aAUJ;AACT,QAAA;AACE,YAAA,OAAO,IAAI;;AAEjB;AAEa,MAAA,OAAO,GAAG,CAAC,KAAK,KAAI;IAC/B,QAAQ,KAAK;AACX,QAAA,KAAK,CAAC;AACJ,YAAA,OAAO,IAAI,CAAA,CAAA;;;;;;;;;;;;;;;kBAeC;AACd,QAAA;AACE,YAAA,OAAO,IAAI;;AAEjB;;;;"}
@@ -0,0 +1 @@
1
+ import './index';
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Copyright IBM Corp. 2024
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ import { vi, describe, it, expect } from 'vitest';
9
+ import { fixture, html } from '@open-wc/testing';
10
+ import './user-avatar.js';
11
+ import { prefix } from '../../globals/settings.js';
12
+
13
+ /**
14
+ * Copyright IBM Corp. 2024, 2024
15
+ *
16
+ * This source code is licensed under the Apache-2.0 license found in the
17
+ * LICENSE file in the root directory of this source tree.
18
+ */
19
+ vi.mock('./_story-assets/headshot.jpg', () => 'mock-image-path');
20
+ const blockClass = `${prefix}--user-avatar`;
21
+ const defaultProps = {
22
+ tooltipText: 'TW, Thomas J. Watson user profile',
23
+ name: 'Thomas J. Watson',
24
+ backgroundColor: 'order-1-cyan',
25
+ };
26
+ const template = (props = defaultProps) => html `
27
+ <c4p-user-avatar
28
+ tooltip-text=${props.tooltipText}
29
+ name=${props.name}
30
+ background-color=${props.backgroundColor}
31
+ size=${props.size}
32
+ image=${props.image}
33
+ imageDescription=${props.imageDescription}
34
+ >
35
+ </c4p-user-avatar>
36
+ `;
37
+ const iconTemplate = (props = defaultProps) => html `
38
+ <c4p-user-avatar
39
+ tooltip-text=${props.tooltipText}
40
+ name=${props.name}
41
+ background-color=${props.backgroundColor}
42
+ size=${props.size}
43
+ image=${props.image}
44
+ imageDescription=${props.imageDescription}
45
+ >
46
+ <svg slot="rendericon" data-test-id="mock-icon" viewBox="0 0 32 32">
47
+ <circle cx="16" cy="10" r="6"></circle>
48
+ <path d="M16 18C10 18 4 22 4 26V28H28V26C28 22 22 18 16 18Z"></path>
49
+ </svg>
50
+ </c4p-user-avatar>
51
+ `;
52
+ describe('c4p-user-avatar', () => {
53
+ it('should render a user avatar', async () => {
54
+ const userAvatar = await fixture(template(Object.assign({}, defaultProps)));
55
+ expect(userAvatar).toBeDefined();
56
+ });
57
+ it('should return a circle with background color', async () => {
58
+ var _a, _b;
59
+ const userAvatar = await fixture(template(Object.assign({}, defaultProps)));
60
+ expect(userAvatar).toBeDefined();
61
+ expect(userAvatar.getAttribute('background-color')).toBe('order-1-cyan');
62
+ const bgClass = (_b = (_a = userAvatar === null || userAvatar === void 0 ? void 0 : userAvatar.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(`.${blockClass}--order-1-cyan`)) === null || _b === void 0 ? void 0 : _b[0];
63
+ expect(bgClass).toBeDefined();
64
+ });
65
+ it('should return a circle with updated background color', async () => {
66
+ var _a, _b;
67
+ const userAvatar = await fixture(template(Object.assign(Object.assign({}, defaultProps), { backgroundColor: 'order-3-green' })));
68
+ expect(userAvatar).toBeDefined();
69
+ expect(userAvatar.getAttribute('background-color')).toBe('order-3-green');
70
+ const bgClass = (_b = (_a = userAvatar === null || userAvatar === void 0 ? void 0 : userAvatar.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(`.${blockClass}--order-3-green`)) === null || _b === void 0 ? void 0 : _b[0];
71
+ expect(bgClass).toBeDefined();
72
+ });
73
+ it('applies className to the containing node', async () => {
74
+ const customClass = 'test';
75
+ const userAvatar = await fixture(template(Object.assign({}, defaultProps)));
76
+ userAvatar.classList.add(customClass);
77
+ expect(userAvatar.getAttribute('class')).to.include(customClass);
78
+ });
79
+ it('should return appropriately size circle based on size prop', async () => {
80
+ var _a, _b;
81
+ const userAvatar = await fixture(template(Object.assign(Object.assign({}, defaultProps), { size: 'md' })));
82
+ const hasSizeClass = (_b = (_a = userAvatar === null || userAvatar === void 0 ? void 0 : userAvatar.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(`.${blockClass}--md`)) === null || _b === void 0 ? void 0 : _b[0];
83
+ // expect the element is present
84
+ expect(hasSizeClass).toBeDefined();
85
+ });
86
+ it('should render the initials when passed the name prop', async () => {
87
+ var _a, _b;
88
+ const userAvatar = await fixture(template(Object.assign({}, defaultProps)));
89
+ const initials = (_b = (_a = userAvatar === null || userAvatar === void 0 ? void 0 : userAvatar.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(`.${blockClass}`)) === null || _b === void 0 ? void 0 : _b[0];
90
+ expect(initials).to.exist;
91
+ expect(initials === null || initials === void 0 ? void 0 : initials.textContent).to.equal('TW');
92
+ });
93
+ it('should render the initials when simply passing two names to the name prop', async () => {
94
+ var _a, _b;
95
+ const userAvatar = await fixture(template(Object.assign(Object.assign({}, defaultProps), { name: 'DN' })));
96
+ const initials = (_b = (_a = userAvatar === null || userAvatar === void 0 ? void 0 : userAvatar.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(`.${blockClass}`)) === null || _b === void 0 ? void 0 : _b[0];
97
+ expect(initials).to.exist;
98
+ expect(initials === null || initials === void 0 ? void 0 : initials.textContent).to.equal('DN');
99
+ });
100
+ it('should render a tooltip if the tooltipText is supplied', async () => {
101
+ var _a, _b;
102
+ const userAvatar = await fixture(template(Object.assign({}, defaultProps)));
103
+ const tooltipElement = (_b = (_a = userAvatar === null || userAvatar === void 0 ? void 0 : userAvatar.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(`.${blockClass}__tooltip`)) === null || _b === void 0 ? void 0 : _b[0];
104
+ expect(tooltipElement).to.exist;
105
+ });
106
+ it('should render a tooltip if the tooltipText is supplied', async () => {
107
+ var _a, _b;
108
+ const userAvatar = await fixture(template(Object.assign(Object.assign({}, defaultProps), { tooltipText: '' })));
109
+ const tooltipElement = (_b = (_a = userAvatar === null || userAvatar === void 0 ? void 0 : userAvatar.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll(`${blockClass}__tooltip`)) === null || _b === void 0 ? void 0 : _b[0];
110
+ expect(tooltipElement).to.not.exist;
111
+ });
112
+ it('should return an icon for the avatar image', async () => {
113
+ var _a;
114
+ const userAvatar = await fixture(iconTemplate(Object.assign(Object.assign({}, defaultProps), { size: 'md' })));
115
+ const renderedSVG = (_a = userAvatar === null || userAvatar === void 0 ? void 0 : userAvatar.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('slot[name="rendericon"]');
116
+ expect(renderedSVG).to.exist;
117
+ const assignedNodes = renderedSVG.assignedNodes({ flatten: true });
118
+ const svg = assignedNodes.find((node) => node.nodeName.toLowerCase() === 'svg');
119
+ expect(svg).to.exist;
120
+ });
121
+ it('should render image for the avatar image', async () => {
122
+ var _a, _b;
123
+ const userAvatar = await fixture(template(Object.assign(Object.assign({}, defaultProps), { image: 'mock-image-path', imageDescription: 'test alt text' })));
124
+ const imagePath = (_b = (_a = userAvatar === null || userAvatar === void 0 ? void 0 : userAvatar.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('img')) === null || _b === void 0 ? void 0 : _b.getAttribute('src');
125
+ expect(typeof imagePath).toBe('string');
126
+ });
127
+ });
128
+ //# sourceMappingURL=user-avatar.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-avatar.test.js","sources":["../../../src/components/user-avatar/user-avatar.test.ts"],"sourcesContent":[null],"names":[],"mapp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pC,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAA,aAAa,CAAC,KAAK,CAAC,0CACpB,YAAY,CAAC,KAAK,CAAC;QACvB,MAAM,CAAC,OAAO,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;AACzC,KAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -8,5 +8,6 @@
8
8
  */
9
9
  export { default as CDSSidePanel } from './components/side-panel/side-panel';
10
10
  export { default as CDSTearsheet } from './components/tearsheet/tearsheet';
11
+ export { default as CDSFullPageError } from './components/full-page-error/full-page-error';
11
12
  export { default as CDSAboutModal } from './components/about-modal/about-modal';
12
13
  export { default as CDSUseravatar } from './components/user-avatar/user-avatar';
@@ -7,6 +7,7 @@
7
7
 
8
8
  export { default as CDSSidePanel } from './components/side-panel/side-panel.js';
9
9
  export { default as CDSTearsheet } from './components/tearsheet/tearsheet.js';
10
+ export { default as CDSFullPageError } from './components/full-page-error/full-page-error.js';
10
11
  export { default as CDSAboutModal } from './components/about-modal/about-modal.js';
11
12
  export { default as CDSUseravatar } from './components/user-avatar/user-avatar.js';
12
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- var version = "0.12.0-rc.0";
8
+ var version = "0.12.0";
9
9
  var packageJson = {
10
10
  version: version};
11
11
 
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025, 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import { LitElement } from 'lit';
10
+ import { Kind } from './types';
11
+ export declare const blockClass = "c4p--full-page-error";
12
+ declare const elementName = "c4p-full-page-error";
13
+ /**
14
+ * FullPageError.
15
+ *
16
+ * @element c4p-full-page-error
17
+ */
18
+ declare class CDSFullPageError extends LitElement {
19
+ static styles: any;
20
+ /**
21
+ * Sets the label text
22
+ */
23
+ label: string;
24
+ /**
25
+ * Sets the description text
26
+ */
27
+ description?: string;
28
+ /**
29
+ * Sets what kind of error it is. '404' | '403' | 'custom'
30
+ */
31
+ kind: Kind;
32
+ /**
33
+ * Sets the title text
34
+ */
35
+ title: string;
36
+ render(): import("lit-html").TemplateResult<1>;
37
+ }
38
+ declare global {
39
+ interface HTMLElementTagNameMap {
40
+ [elementName]: CDSFullPageError;
41
+ }
42
+ }
43
+ export default CDSFullPageError;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025, 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025, 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import './full-page-error';
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2025, 2025
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ export declare enum Kind {
10
+ Custom = "custom",
11
+ Error403 = "403",
12
+ Error404 = "404"
13
+ }
@@ -4,4 +4,11 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- export {};
7
+ import './index';
8
+ import '@carbon/web-components/es/components/tabs/index.js';
9
+ import '@carbon/web-components/es/components/slug/index.js';
10
+ import '@carbon/web-components/es/components/dropdown/index.js';
11
+ import '@carbon/web-components/es/components/progress-bar/index.js';
12
+ import '@carbon/web-components/es/components/button/index.js';
13
+ import '@carbon/web-components/es/components/text-input/index.js';
14
+ import '@carbon/web-components/es/components/textarea/index.js';
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @license
3
+ *
4
+ * Copyright IBM Corp. 2024, 2024
5
+ *
6
+ * This source code is licensed under the Apache-2.0 license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import '@carbon/web-components/es/components/tabs/index.js';
10
+ import '@carbon/web-components/es/components/text-input/index.js';
11
+ import '@carbon/web-components/es/components/textarea/index.js';
12
+ import '@carbon/web-components/es/components/tabs/index.js';
13
+ import '@carbon/web-components/es/components/slug/index.js';
14
+ import '@carbon/web-components/es/components/dropdown/index.js';
15
+ import '@carbon/web-components/es/components/progress-indicator/index.js';
16
+ import '@carbon/web-components/es/components/progress-bar/index.js';
17
+ import './index';
18
+ export declare const influencers: {
19
+ 'No influencer': number;
20
+ 'Simple influencer': number;
21
+ 'Progress influencer': number;
22
+ };
23
+ export declare const getInfluencer: (index: any) => import("lit-html").TemplateResult<1> | null;
24
+ export declare const getContent: (index: any) => import("lit-html").TemplateResult<1> | null;
25
+ export declare const getLabel: (index: any) => import("lit-html").TemplateResult<1> | null;
26
+ export declare const getActionToolbarItems: (index: any) => import("lit-html").TemplateResult<1> | null;
27
+ export declare const getActionItems: (index: any) => import("lit-html").TemplateResult<1>[] | null;
28
+ export declare const getNavigation: (index: any) => import("lit-html").TemplateResult<1> | null;
29
+ export declare const getSlug: (index: any) => import("lit-html").TemplateResult<1> | null;
@@ -0,0 +1 @@
1
+ import './index';
package/lib/index.d.ts CHANGED
@@ -8,5 +8,6 @@
8
8
  */
9
9
  export { default as CDSSidePanel } from './components/side-panel/side-panel';
10
10
  export { default as CDSTearsheet } from './components/tearsheet/tearsheet';
11
+ export { default as CDSFullPageError } from './components/full-page-error/full-page-error';
11
12
  export { default as CDSAboutModal } from './components/about-modal/about-modal';
12
13
  export { default as CDSUseravatar } from './components/user-avatar/user-avatar';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@carbon/ibm-products-web-components",
3
3
  "description": "Carbon for IBM Products Web Components",
4
- "version": "0.12.0",
4
+ "version": "0.13.0-rc.0",
5
5
  "license": "Apache-2.0",
6
6
  "main": "es/index.js",
7
7
  "module": "es/index.js",
@@ -51,7 +51,7 @@
51
51
  "coverage": "vitest run --coverage"
52
52
  },
53
53
  "dependencies": {
54
- "@carbon/ibm-products-styles": "^2.59.0",
54
+ "@carbon/ibm-products-styles": "^2.60.0-rc.0",
55
55
  "@carbon/styles": "1.75.0",
56
56
  "@carbon/web-components": "2.25.0",
57
57
  "lit": "^3.1.0"
@@ -61,7 +61,7 @@
61
61
  "@carbon/icon-helpers": "^10.54.0",
62
62
  "@carbon/icons": "^11.55.0",
63
63
  "@carbon/motion": "^11.24.0",
64
- "@mordech/vite-lit-loader": "^0.35.0",
64
+ "@mordech/vite-lit-loader": "^0.37.0",
65
65
  "@open-wc/testing": "^4.0.0",
66
66
  "@rollup/plugin-alias": "^5.1.1",
67
67
  "@rollup/plugin-commonjs": "^28.0.1",
@@ -86,6 +86,7 @@
86
86
  "eslint-config-carbon": "^3.19.0",
87
87
  "globby": "^14.0.2",
88
88
  "happy-dom": "^15.11.6",
89
+ "playwright": "^1.51.1",
89
90
  "postcss": "^8.4.47",
90
91
  "remark-gfm": "^4.0.0",
91
92
  "rimraf": "^5.0.5",
@@ -100,5 +101,5 @@
100
101
  "vitest": "^3.0.1",
101
102
  "web-component-analyzer": "2.0.0"
102
103
  },
103
- "gitHead": "5e391143783f07e648878658b2895f160395fe93"
104
+ "gitHead": "c4a8482c99e4e30e6bec3e1f2cb850a654f034f6"
104
105
  }