Skip to content

Commit b1af973

Browse files
authored
Merge branch 'v1/contrib' into v1/feature/uui-label-required-color
2 parents 5b309e4 + fb6d48e commit b1af973

File tree

23 files changed

+4534
-3547
lines changed

23 files changed

+4534
-3547
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"babel-loader": "9.1.3",
8989
"chromatic": "11.12.5",
9090
"element-internals-polyfill": "1.3.10",
91-
"esbuild": "0.21.5",
91+
"esbuild": "0.25.0",
9292
"eslint": "9.7.0",
9393
"eslint-config-prettier": "9.1.0",
9494
"eslint-plugin-lit": "1.14.0",

packages/uui-base/lib/utils/drag.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@ export const drag = (
2222
const offsetY = dims.top + defaultView.scrollY;
2323

2424
let pointerEvent: PointerEvent | Touch;
25-
if (event instanceof TouchEvent) {
25+
// TouchEvent is not available in Firefox
26+
if ('TouchEvent' in window && event instanceof TouchEvent) {
2627
pointerEvent = event.touches[0];
27-
} else {
28+
} else if (event instanceof PointerEvent) {
2829
pointerEvent = event;
30+
} else {
31+
return;
2932
}
3033

3134
const x = pointerEvent.pageX - offsetX;

packages/uui-button/lib/uui-button.story.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ export const Loading: Story = {
117117
args: {
118118
state: 'waiting',
119119
},
120+
parameters: {
121+
chromatic: { disableSnapshot: true },
122+
},
120123
};
121124

122125
export const ContentAlign: Story = {

packages/uui-card-media/lib/uui-card-media.story.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,7 @@ export const Image: Story = {
8282
args: {
8383
slot: html`<img src="https://placedog.net/1447/?random" alt="" />`,
8484
},
85+
parameters: {
86+
chromatic: { disableSnapshot: true },
87+
},
8588
};

packages/uui-card-user/lib/uui-card-user.story.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ export const Avatar: Story = {
5555
${cardContent}
5656
</uui-card-user>
5757
`,
58+
parameters: {
59+
chromatic: { disableSnapshot: true },
60+
},
5861
};
5962

6063
export const Tag: Story = {

packages/uui-combobox/lib/uui-combobox.element.ts

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ export class UUIComboboxElement extends UUIFormControlMixin(LitElement, '') {
3434
return super.value;
3535
}
3636
set value(newValue) {
37+
super.value = newValue;
38+
3739
if (typeof newValue === 'string') {
38-
this.#updateValue(newValue);
40+
this.#updateValue();
3941
}
40-
41-
super.value = newValue;
4242
}
4343

4444
/**
@@ -166,7 +166,17 @@ export class UUIComboboxElement extends UUIFormControlMixin(LitElement, '') {
166166
this.#phoneMediaQuery.removeEventListener('change', this.#onPhoneChange);
167167
}
168168

169-
protected async firstUpdated() {
169+
#onSlotChange() {
170+
if (this.#comboboxList) {
171+
this.#comboboxList.removeEventListener(
172+
UUIComboboxListEvent.CHANGE,
173+
this.#onChange,
174+
);
175+
this.#comboboxList.removeEventListener(
176+
UUIComboboxListEvent.INNER_SLOT_CHANGE,
177+
this.#onInnerSlotChange,
178+
);
179+
}
170180
const list = this._comboboxListElements?.[0];
171181

172182
if (list) {
@@ -178,21 +188,22 @@ export class UUIComboboxElement extends UUIFormControlMixin(LitElement, '') {
178188
);
179189
this.#comboboxList.addEventListener(
180190
UUIComboboxListEvent.INNER_SLOT_CHANGE,
181-
this.#onSlotChange,
191+
this.#onInnerSlotChange,
182192
);
183-
184-
await this.updateComplete;
185-
this.#updateValue(this.value);
186193
}
194+
195+
this.updateComplete.then(() => {
196+
this.#updateValue();
197+
});
187198
}
188199

189200
#onPhoneChange = () => {
190201
this._isPhone = this.#phoneMediaQuery.matches;
191202
};
192203

193-
#updateValue(value: FormDataEntryValue | FormData) {
204+
#updateValue() {
194205
if (this.#comboboxList) {
195-
this.#comboboxList.value = value;
206+
this.#comboboxList.value = this.value;
196207
requestAnimationFrame(
197208
() => (this._displayValue = this.#comboboxList.displayValue || ''),
198209
);
@@ -233,9 +244,9 @@ export class UUIComboboxElement extends UUIFormControlMixin(LitElement, '') {
233244
this.#onOpen();
234245
};
235246

236-
#onSlotChange = () => {
247+
#onInnerSlotChange = () => {
237248
if (this.value && this.value !== this.#comboboxList?.value) {
238-
this.#updateValue(this.value);
249+
this.#updateValue();
239250
}
240251
};
241252

@@ -344,7 +355,7 @@ export class UUIComboboxElement extends UUIFormControlMixin(LitElement, '') {
344355
#renderDropdown = () => {
345356
return html`<div id="dropdown">
346357
<uui-scroll-container tabindex="-1" id="scroll-container">
347-
<slot></slot>
358+
<slot @slotchange=${this.#onSlotChange}></slot>
348359
</uui-scroll-container>
349360
</div>`;
350361
};

packages/uui-icon/lib/uui-icon.element.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ export class UUIIconElement extends LitElement {
149149
:host svg,
150150
::slotted(svg) {
151151
color: var(--uui-icon-color, currentColor);
152+
width: 100%;
152153
}
153154
154155
:host-context(div[slot='prepend']) {

packages/uui-icon/lib/uui-icon.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,5 +224,13 @@ describe('UUIIconElement', () => {
224224
it('Child uui-icon passes the a11y audit', async () => {
225225
await expect(testElement.iconElement).shadowDom.to.be.accessible();
226226
});
227+
228+
it('svg has a size of 18px for both width and height', () => {
229+
const svgElement =
230+
testElement.iconElement.shadowRoot!.querySelector('svg')!;
231+
const computedStyle = getComputedStyle(svgElement);
232+
expect(computedStyle.width).to.equal('18px');
233+
expect(computedStyle.height).to.equal('18px');
234+
});
227235
});
228236
});

packages/uui-input/lib/uui-input.element.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ export class UUIInputElement extends UUIFormControlMixin(
348348
);
349349
border: var(--uui-input-border-width, 1px) solid
350350
var(--uui-input-border-color, var(--uui-color-border));
351+
border-radius: var(--uui-border-radius);
351352
352353
--uui-button-height: 100%;
353354
--auto-width-text-margin-right: 0;
@@ -439,7 +440,7 @@ export class UUIInputElement extends UUIFormControlMixin(
439440
padding: var(--uui-size-1) var(--uui-size-space-3);
440441
font-size: inherit;
441442
color: inherit;
442-
border-radius: 0;
443+
border-radius: var(--uui-border-radius);
443444
box-sizing: border-box;
444445
border: none;
445446
background: none;

0 commit comments

Comments
 (0)