Skip to content

Commit 2a0c09b

Browse files
authored
Merge branch 'master' into sivanova/chip-discrepancies
2 parents 3b19c72 + 9e830cd commit 2a0c09b

File tree

8 files changed

+301
-212
lines changed

8 files changed

+301
-212
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ v18.19.1
2727
git clone https://github.com/IgniteUI/igniteui-webcomponents.git
2828
cd igniteui-webcomponents
2929
npm ci
30-
npm run build
30+
npm start
3131
```
3232

3333
## Making Changes

package-lock.json

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

package.json

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,14 @@
1818
},
1919
"scripts": {
2020
"start": "npm run storybook",
21-
"build": "npm run clean && npm run build:styles && npm run build:typescript && npm run cem && npm run build:meta",
2221
"build:publish": "npm run cem && node scripts/build.mjs",
23-
"build:typescript": "tsc",
2422
"cem": "cem analyze --config cem.config.mjs",
2523
"cem:watch": "cem analyze --config cem.config.mjs --watch",
2624
"build:styles": "node scripts/build-styles.mjs",
27-
"build:watch": "npm run build:styles && concurrently -k -r \"npm:watch-scss\" \"npm:watch-ts\"",
2825
"build:meta": "node scripts/build-stories.mjs",
2926
"watch-meta": "node scripts/stories-watcher.js ",
3027
"watch-scss": "node scripts/styles-watcher.mjs",
31-
"watch-ts": "tsc --watch --preserveWatchOutput",
32-
"check": "madge --circular --warning --no-spinner dist/src/index.js",
28+
"check": "madge --circular --warning --no-spinner --ts-config ./tsconfig.json --extensions ts src/index.ts",
3329
"clean": "npm run clean:dist && npm run clean:styles && npm run clean:docs",
3430
"clean:dist": "rimraf ./dist",
3531
"clean:styles": "rimraf --glob \"src/**/*.css.ts\"",
@@ -41,10 +37,10 @@
4137
"lint:styles": "stylelint \"src/**/*.scss\"",
4238
"format": "biome check --fix && prettier \"**/*.ts\" --write --ignore-path .gitignore",
4339
"release": "node scripts/gen-changelog.mjs",
44-
"test": "npm run build && wtr --coverage",
45-
"test:watch": "npm run build && concurrently -k -r \"npm:watch-scss\" \"npm:watch-ts\" \"wtr --watch\"",
46-
"storybook": "npm run build && concurrently -k -r \"npm run cem:watch\" \"npm:watch-scss\" \"npm:watch-meta\" \"storybook dev -p 8000 --debug\"",
47-
"storybook:build": "npm run build && storybook build -o ./storybook-static",
40+
"test": "npm run build:styles && wtr --coverage",
41+
"test:watch": "npm run build:styles && concurrently -k -r \"npm:watch-scss\" \"wtr --watch\"",
42+
"storybook": "npm run build:styles && concurrently -k -r \"npm run cem:watch\" \"npm:watch-scss\" \"npm:watch-meta\" \"storybook dev -p 8000\"",
43+
"storybook:build": "npm run build:styles && storybook build -o ./storybook-static",
4844
"build:typedoc:export": "node scripts/build-typedoc.js export",
4945
"build:typedoc:import": "node scripts/build-typedoc.js import",
5046
"build:typedoc:watch": "node scripts/build-typedoc.js watch",
@@ -64,13 +60,14 @@
6460
"@custom-elements-manifest/analyzer": "^0.10.3",
6561
"@igniteui/material-icons-extended": "^3.1.0",
6662
"@open-wc/testing": "^4.0.0",
67-
"@storybook/addon-a11y": "^8.4.6",
68-
"@storybook/addon-actions": "^8.4.6",
69-
"@storybook/addon-essentials": "^8.4.6",
70-
"@storybook/addon-links": "^8.4.6",
71-
"@storybook/web-components": "^8.4.6",
72-
"@storybook/web-components-vite": "^8.4.6",
63+
"@storybook/addon-a11y": "^8.4.7",
64+
"@storybook/addon-actions": "^8.4.7",
65+
"@storybook/addon-essentials": "^8.4.7",
66+
"@storybook/addon-links": "^8.4.7",
67+
"@storybook/web-components": "^8.4.7",
68+
"@storybook/web-components-vite": "^8.4.7",
7369
"@types/mocha": "^10.0.10",
70+
"@web/dev-server-esbuild": "^1.0.3",
7471
"@web/test-runner": "^0.19.0",
7572
"@web/test-runner-playwright": "^0.11.0",
7673
"autoprefixer": "^10.4.20",
@@ -90,12 +87,12 @@
9087
"node-watch": "^0.7.4",
9188
"playwright": "^1.49.0",
9289
"postcss": "^8.4.49",
93-
"prettier": "^3.4.1",
90+
"prettier": "^3.4.2",
9491
"rimraf": "^5.0.10",
9592
"sass": "^1.78.0",
9693
"sass-embedded": "^1.78.0",
9794
"sinon": "^19.0.2",
98-
"storybook": "^8.4.6",
95+
"storybook": "^8.4.7",
9996
"stylelint": "^16.11.0",
10097
"stylelint-config-standard-scss": "^14.0.0",
10198
"stylelint-prettier": "^5.0.2",
@@ -105,17 +102,23 @@
105102
"typedoc": "^0.26.11",
106103
"typedoc-plugin-localization": "^3.0.5",
107104
"typescript": "^5.6.3",
108-
"vite": "^6.0.1"
105+
"vite": "^6.0.3"
109106
},
110107
"browserslist": [
111108
"defaults"
112109
],
113110
"lint-staged": {
114111
"*.{js,ts,cjs,mjs,jsx,tsx}": [
115112
"biome check --fix --no-errors-on-unmatched",
116-
"prettier --write",
117-
"git add"
113+
"prettier --write"
118114
]
119115
},
116+
"madge": {
117+
"detectiveOptions": {
118+
"ts": {
119+
"skipTypeImports": true
120+
}
121+
}
122+
},
120123
"customElements": "custom-elements.json"
121124
}

src/components/avatar/themes/shared/avatar.common.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ $theme: $material;
55

66
:host {
77
--component-size: var(--ig-size, #{var-get($theme, 'default-size')});
8+
9+
::slotted(igc-icon) {
10+
--ig-size: 3;
11+
12+
color: var-get($theme, 'icon-color');
13+
}
814
}
915

1016
[part='base'] {

src/components/avatar/themes/shared/avatar.indigo.scss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@ $theme: $indigo;
88

99
::slotted(igc-icon) {
1010
--ig-size: 1;
11-
12-
color: var-get($theme, 'icon-color');
1311
}
1412
}

stories/avatar.stories.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
import type { Meta, StoryObj } from '@storybook/web-components';
22

3-
import { IgcAvatarComponent, defineComponents } from 'igniteui-webcomponents';
3+
import {
4+
IgcAvatarComponent,
5+
IgcIconComponent,
6+
defineComponents,
7+
registerIcon,
8+
} from 'igniteui-webcomponents';
9+
import { html } from 'lit';
410

5-
defineComponents(IgcAvatarComponent);
11+
defineComponents(IgcAvatarComponent, IgcIconComponent);
612

713
// region default
814
const metadata: Meta<IgcAvatarComponent> = {
@@ -57,6 +63,11 @@ interface IgcAvatarArgs {
5763
}
5864
type Story = StoryObj<IgcAvatarArgs>;
5965

66+
registerIcon(
67+
'home',
68+
'https://unpkg.com/[email protected]/action/svg/production/ic_home_24px.svg'
69+
);
70+
6071
// endregion
6172

6273
export const Image: Story = {
@@ -66,6 +77,14 @@ export const Image: Story = {
6677
},
6778
};
6879

80+
export const WithIcon: Story = {
81+
render: () => html`
82+
<igc-avatar>
83+
<igc-icon name="home"></igc-icon>
84+
</igc-avatar>
85+
`,
86+
};
87+
6988
export const WithInitials: Story = {
7089
args: {
7190
initials: 'RK',

stories/stepper.stories.ts

Lines changed: 43 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { html } from 'lit';
44
import {
55
IgcButtonComponent,
66
IgcInputComponent,
7+
type IgcStepComponent,
78
IgcStepperComponent,
89
defineComponents,
910
} from 'igniteui-webcomponents';
@@ -122,19 +123,35 @@ const BasicTemplate = ({
122123
verticalAnimation,
123124
horizontalAnimation,
124125
}: IgcStepperArgs) => {
125-
const next = () => {
126+
document.addEventListener('DOMContentLoaded', () => {
126127
const stepper = document.getElementById('stepper') as IgcStepperComponent;
127-
stepper.next();
128-
};
129128

130-
const prev = () => {
129+
stepper.addEventListener('igcInput', () => {
130+
checkValidity();
131+
});
132+
stepper.addEventListener('igcChange', () => {
133+
checkValidity();
134+
});
135+
});
136+
137+
function checkValidity() {
131138
const stepper = document.getElementById('stepper') as IgcStepperComponent;
132-
stepper.prev();
133-
};
139+
const activeStep = stepper.steps.find(
140+
(step) => step.active
141+
) as IgcStepComponent;
142+
const form = activeStep!.querySelector('form') as HTMLFormElement;
143+
const isFormInvalid = !form.checkValidity();
134144

135-
return html`
136-
<span>test content top</span>
145+
if (activeStep!.optional) {
146+
return;
147+
}
148+
149+
if (stepper.linear) {
150+
activeStep!.invalid = isFormInvalid;
151+
}
152+
}
137153

154+
return html`
138155
<igc-stepper
139156
id="stepper"
140157
.orientation=${orientation}
@@ -146,31 +163,28 @@ const BasicTemplate = ({
146163
.verticalAnimation=${verticalAnimation}
147164
.horizontalAnimation=${horizontalAnimation}
148165
>
149-
<igc-step complete>
166+
<igc-step invalid>
150167
<span slot="title">Step1</span>
151-
<span slot="subtitle">(completed)</span>
152-
<igc-input
153-
label="First Name"
154-
id="first-name"
155-
name="first-name"
156-
required
157-
></igc-input>
158-
<br /><br />
159-
<igc-button @click=${next}>Next</igc-button>
168+
<form id="form">
169+
<igc-input
170+
label="First Name"
171+
id="first-name"
172+
name="first-name"
173+
required
174+
></igc-input>
175+
</form>
160176
</igc-step>
161177
162-
<igc-step active>
178+
<igc-step invalid>
163179
<span slot="title">Step 2</span>
164-
<span slot="subtitle">(default)</span>
165-
<igc-input
166-
label="Last Name"
167-
id="last-name"
168-
name="last-name"
169-
required
170-
></igc-input>
171-
<br /><br />
172-
<igc-button @click=${prev}>Prev</igc-button>
173-
<igc-button @click=${next}>Next</igc-button>
180+
<form id="form">
181+
<igc-input
182+
label="Last Name"
183+
id="last-name"
184+
name="last-name"
185+
required
186+
></igc-input>
187+
</form>
174188
</igc-step>
175189
176190
<igc-step optional>
@@ -180,9 +194,6 @@ const BasicTemplate = ({
180194
soluta nulla asperiores, officia ullam recusandae voluptatem omnis
181195
perferendis vitae non magni magnam praesentium placeat nemo quas
182196
repudiandae. Nisi, quo ex!
183-
<br /><br />
184-
<igc-button @click=${prev}>Prev</igc-button>
185-
<igc-button @click=${next}>Next</igc-button>
186197
</igc-step>
187198
188199
<igc-step disabled>
@@ -197,11 +208,8 @@ const BasicTemplate = ({
197208
repudiandae. Nisi, quo ex!
198209
</div>
199210
<br />
200-
<igc-button @click=${prev}>Prev</igc-button>
201211
</igc-step>
202212
</igc-stepper>
203-
204-
<span>test content bottom</span>
205213
`;
206214
};
207215

web-test-runner.config.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import { fileURLToPath } from 'node:url';
12
import { playwrightLauncher } from '@web/test-runner-playwright';
3+
import { esbuildPlugin } from '@web/dev-server-esbuild';
24

35
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
4-
files: ['dist/**/*.spec.js'],
6+
files: ['src/**/*.spec.ts'],
57
browsers: [playwrightLauncher({ product: 'chromium', headless: true })],
68

79
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
@@ -16,6 +18,13 @@ export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
1618
exclude: ['node_modules/**/*', '**/themes/**'],
1719
},
1820

21+
plugins: [
22+
esbuildPlugin({
23+
ts: true,
24+
tsconfig: fileURLToPath(new URL('./tsconfig.json', import.meta.url)),
25+
}),
26+
],
27+
1928
// See documentation for all available options
2029
// https://modern-web.dev/docs/test-runner/cli-and-configuration/#configuration-file
2130
});

0 commit comments

Comments
 (0)