Skip to content

Commit fd5c5e8

Browse files
authored
Merge branch 'master' into chore()-update-roadmap-oct-2025-release
2 parents 76ede56 + d7570b6 commit fd5c5e8

35 files changed

+746
-518
lines changed

.storybook/preview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export default {
164164
},
165165
parameters: {
166166
backgrounds: {
167-
disable: true,
167+
disabled: true,
168168
},
169169
},
170170
decorators: [themeProvider, withActions, localeProvider],

package-lock.json

Lines changed: 275 additions & 324 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@
6060
"lit": "^3.3.1"
6161
},
6262
"devDependencies": {
63-
"@biomejs/biome": "~2.2.6",
63+
"@biomejs/biome": "~2.3.2",
6464
"@custom-elements-manifest/analyzer": "^0.10.10",
6565
"@igniteui/material-icons-extended": "^3.1.0",
6666
"@open-wc/testing": "^4.0.0",
67-
"@storybook/addon-a11y": "^9.1.13",
68-
"@storybook/addon-docs": "^9.1.13",
69-
"@storybook/addon-links": "^9.1.13",
70-
"@storybook/web-components-vite": "^9.1.13",
67+
"@storybook/addon-a11y": "^10.0.1",
68+
"@storybook/addon-docs": "^10.0.1",
69+
"@storybook/addon-links": "^10.0.1",
70+
"@storybook/web-components-vite": "^10.0.1",
7171
"@types/mocha": "^10.0.10",
7272
"@web/dev-server-esbuild": "^1.0.4",
7373
"@web/test-runner": "^0.20.2",
@@ -80,11 +80,11 @@
8080
"custom-element-vs-code-integration": "^1.5.0",
8181
"globby": "^15.0.0",
8282
"husky": "^9.1.7",
83-
"ig-typedoc-theme": "^6.2.3",
83+
"ig-typedoc-theme": "^7.0.0",
8484
"igniteui-i18n-resources": "0.6.0-alpha.4",
85-
"igniteui-theming": "^21.0.2",
85+
"igniteui-theming": "^22.1.0",
8686
"keep-a-changelog": "^2.7.1",
87-
"lint-staged": "^16.2.5",
87+
"lint-staged": "^16.2.6",
8888
"lit-analyzer": "^2.0.3",
8989
"madge": "^8.0.0",
9090
"node-watch": "^0.7.4",
@@ -94,23 +94,23 @@
9494
"rimraf": "^6.0.1",
9595
"sass-embedded": "~1.93.2",
9696
"sinon": "^21.0.0",
97-
"storybook": "^9.1.13",
97+
"storybook": "^10.0.1",
9898
"stylelint": "^16.25.0",
9999
"stylelint-config-standard-scss": "^16.0.0",
100100
"stylelint-prettier": "^5.0.3",
101101
"stylelint-scss": "^6.12.1",
102102
"ts-lit-plugin": "^2.0.2",
103103
"tslib": "^2.8.1",
104-
"typedoc": "~0.27.9",
105-
"typedoc-plugin-localization": "^3.0.6",
106-
"typescript": "^5.8.3",
107-
"vite": "^7.1.11"
104+
"typedoc": "~0.28.14",
105+
"typedoc-plugin-localization": "^3.1.0",
106+
"typescript": "^5.9.3",
107+
"vite": "^7.1.12"
108108
},
109109
"peerDependencies": {
110110
"dompurify": "^3.3.0",
111111
"marked": "^16.4.1",
112112
"marked-shiki": "^1.2.1",
113-
"shiki": "^3.13.0"
113+
"shiki": "^3.14.0"
114114
},
115115
"browserslist": [
116116
"defaults"

scripts/build-typedoc.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
import path from 'node:path';
2+
import { fileURLToPath } from 'node:url';
23
import { create } from 'browser-sync';
34
import watch from 'node-watch';
45
import { Application } from 'typedoc';
56
import report from './report.mjs';
67

8+
const __filename = fileURLToPath(import.meta.url);
9+
const __dirname = path.dirname(__filename);
10+
11+
const toPosix = (p) => p.replace(/\\/g, '/');
712
const browserSync = create();
8-
const ROOT = path.join.bind(null, path.resolve('./'));
13+
const ROOT = (...segments) =>
14+
toPosix(path.resolve(__dirname, '..', ...segments));
915

1016
const TYPEDOC = {
1117
PLUGINS: {
@@ -99,6 +105,7 @@ async function main() {
99105
entryPointStrategy,
100106
plugin: [TYPEDOC.PLUGINS.THEME, TYPEDOC.PLUGINS.LOCALIZATION],
101107
theme: 'igtheme',
108+
router: 'structure',
102109
excludePrivate: true,
103110
excludeProtected: true,
104111
excludeNotDocumented: true,

scripts/report.mjs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import { stdout } from 'node:process';
2-
import { format } from 'node:util';
2+
import { format, styleText } from 'node:util';
33

44
export default {
5-
error: (s) => console.error('\x1b[31m%s\x1b[0m', s),
6-
success: (s) => console.info('\x1b[32m%s\x1b[0m', s),
7-
warn: (s) => console.warn('\x1b[33m%s\x1b[0m', s),
8-
info: (s) => console.info('\x1b[36m%s\x1b[0m', s),
5+
error: (s) => console.error(styleText('red', s)),
6+
success: (s) => console.info(styleText('green', s)),
7+
warn: (s) => console.warn(styleText('yellow', s)),
8+
info: (s) => console.info(styleText('cyan', s)),
99

1010
stdout: {
1111
clearLine: () => {
1212
stdout.clearLine(0);
1313
stdout.cursorTo(0);
1414
},
15-
success: (s) => stdout.write(format('\x1b[32m%s\x1b[0m', s)),
16-
warn: (s) => stdout.write(format('\x1b[33m%s\x1b[0m', s)),
17-
info: (s) => stdout.write(format('\x1b[36m%s\x1b[0m', s)),
15+
success: (s) => stdout.write(format(styleText('green', s))),
16+
warn: (s) => stdout.write(format(styleText('yellow', s))),
17+
info: (s) => stdout.write(format(styleText('cyan', s))),
1818
},
1919
};

src/components/badge/badge.spec.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,27 @@ describe('Badge', () => {
7272
`<igc-badge shape="rounded" variant="primary"></igc-badge>`
7373
);
7474
});
75+
76+
it('can be a dot badge', async () => {
77+
const el = await fixture<IgcBadgeComponent>(
78+
html`<igc-badge dot></igc-badge>`
79+
);
80+
81+
expect(el.dot).to.be.true;
82+
83+
el.dot = false;
84+
await elementUpdated(el);
85+
expect(el).dom.to.equal(
86+
`<igc-badge shape="rounded" variant="primary"></igc-badge>`
87+
);
88+
});
89+
90+
it('dot badge works with all variants', async () => {
91+
const el = await fixture<IgcBadgeComponent>(
92+
html`<igc-badge dot variant="success"></igc-badge>`
93+
);
94+
95+
expect(el.dot).to.be.true;
96+
expect(el.variant).to.equal('success');
97+
});
7598
});

src/components/badge/badge.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import { html, LitElement, type PropertyValues } from 'lit';
22
import { property } from 'lit/decorators.js';
33
import { addThemingController } from '../../theming/theming-controller.js';
44
import { addInternalsController } from '../common/controllers/internals.js';
5+
import { addSlotController } from '../common/controllers/slot.js';
56
import { registerComponent } from '../common/definitions/register.js';
7+
import { partMap } from '../common/part-map.js';
68
import type { BadgeShape, StyleVariant } from '../types.js';
79
import { styles } from './themes/badge.base.css.js';
810
import { styles as shared } from './themes/shared/badge.common.css.js';
@@ -27,6 +29,21 @@ export default class IgcBadgeComponent extends LitElement {
2729
registerComponent(IgcBadgeComponent);
2830
}
2931

32+
private _iconPart = false;
33+
34+
private readonly _slots = addSlotController(this, {
35+
onChange: this._handleSlotChange,
36+
});
37+
38+
protected _handleSlotChange(): void {
39+
const assignedNodes = this._slots.getAssignedNodes('[default]', true);
40+
this._iconPart = assignedNodes.some(
41+
(node) =>
42+
node.nodeType === Node.ELEMENT_NODE &&
43+
(node as Element).tagName.toLowerCase() === 'igc-icon'
44+
);
45+
}
46+
3047
private readonly _internals = addInternalsController(this, {
3148
initialARIA: { role: 'status' },
3249
});
@@ -52,6 +69,13 @@ export default class IgcBadgeComponent extends LitElement {
5269
@property({ reflect: true })
5370
public shape: BadgeShape = 'rounded';
5471

72+
/**
73+
* Sets whether to render a dot type badge.
74+
* @attr
75+
*/
76+
@property({ type: Boolean, reflect: true })
77+
public dot = false;
78+
5579
constructor() {
5680
super();
5781
addThemingController(this, all);
@@ -65,7 +89,7 @@ export default class IgcBadgeComponent extends LitElement {
6589

6690
protected override render() {
6791
return html`
68-
<span part="base">
92+
<span part=${partMap({ base: true, icon: this._iconPart })}>
6993
<slot></slot>
7094
</span>
7195
`;

src/components/badge/themes/badge.base.scss

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,56 @@
22
@use 'styles/utilities' as *;
33

44
:host {
5-
--size: #{rem(22px)};
6-
--_badge-size: var(--size);
7-
85
width: fit-content;
96
height: fit-content;
107
display: inline-flex;
11-
font-weight: 500;
128
vertical-align: top;
139
}
1410

15-
[part='base'] {
16-
@include type-style('caption');
17-
11+
[part~='base'] {
1812
display: inline-flex;
19-
min-width: var(--size);
20-
min-height: var(--size);
13+
min-width: var(--_badge-size);
14+
min-height: var(--_badge-size);
2115
justify-content: center;
2216
align-items: center;
2317
overflow: hidden;
2418
white-space: nowrap;
19+
font-size: sizable(var(--ig-caption-font-size), var(--ig-body-2-font-size), var(--ig-body-2-font-size));
20+
font-weight: sizable(var(--ig-caption-font-weight), var(--ig-body-2-font-weight), var(--ig-body-2-font-weight));
21+
line-height: sizable(var(--ig-caption-line-height), var(--ig-body-2-line-height), var(--ig-body-2-line-height));
22+
letter-spacing: sizable(var(--ig-caption-letter-spacing), var(--ig-body-2-letter-spacing), var(--ig-body-2-letter-spacing));
23+
text-transform: sizable(var(--ig-caption-text-transform), var(--ig-body-2-text-transform), var(--ig-body-2-text-transform));
2524
}
2625

27-
::slotted(*) {
28-
--size: calc(var(--_badge-size) / 2) !important;
26+
:host(:not(:empty, [dot])) [part='base'] {
27+
padding-inline: pad-inline(rem(4px), rem(6px), rem(8px));
2928
}
3029

31-
:host(:not(:empty)) [part='base'] {
32-
padding-inline: rem(4px);
33-
}
34-
35-
:host([variant='info']) [part='base'] {
30+
:host([variant='info']) [part~='base'] {
3631
background: color(info, 500);
3732
}
3833

39-
:host([variant='success']) [part='base'] {
34+
:host([variant='success']) [part~='base'] {
4035
background: color(success, 500);
4136
}
4237

43-
:host([variant='warning']) [part='base'] {
38+
:host([variant='warning']) [part~='base'] {
4439
background: color(warn, 500);
40+
color: contrast-color(warn, 500);
41+
42+
igc-icon,
43+
::slotted(igc-icon) {
44+
color: contrast-color(warn, 500);
45+
}
4546
}
4647

47-
:host([variant='danger']) [part='base'] {
48+
:host([variant='danger']) [part~='base'] {
4849
background: color(error, 500);
50+
color: contrast-color(error, 900);
4951
}
5052

5153
:host([shape='rounded']),
52-
:host([shape='rounded']) [part='base'] {
53-
border-radius: calc(var(--size) * 2);
54+
:host([shape='rounded']) [part~='base'],
55+
:host([dot]) [part~='base'] {
56+
border-radius: calc(var(--_badge-size) * 2);
5457
}

src/components/badge/themes/dark/badge.indigo.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,12 @@ $theme: $indigo;
77
:host {
88
@include css-vars-from-theme(diff(light.$base, $theme), 'ig-badge');
99
}
10+
11+
:host([variant='warning']) [part~='base'] {
12+
color: color(gray, 50);
13+
14+
igc-icon,
15+
::slotted(igc-icon) {
16+
color: color(gray, 50);
17+
}
18+
}
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
@use 'styles/utilities' as *;
2-
@use '../light/themes' as *;
32

4-
$theme: $bootstrap;
5-
6-
:host([outlined]) [part='base'] {
7-
box-shadow: inset 0 0 0 rem(1px) var-get($theme, 'border-color');
3+
:host([variant='danger']) [part~='base'] {
4+
color: contrast-color(error, 100);
85
}

0 commit comments

Comments
 (0)