Skip to content

Commit

Permalink
update kolibri deps and lock
Browse files Browse the repository at this point in the history
Refs: #6350
  • Loading branch information
deleonio committed Jan 29, 2025
2 parents 3013c98 + de57a18 commit fb1e1b7
Show file tree
Hide file tree
Showing 213 changed files with 8,415 additions and 6,589 deletions.
5 changes: 3 additions & 2 deletions packages/components/src/components/a11y.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@import '@shared/mixins';

/*
* This file contains all rules for accessibility.
*/
Expand Down Expand Up @@ -47,8 +49,7 @@
/* select, */
/* textarea, */
[role='button'],
button:not([role='link']),
.kol-input .input {
button:not([role='link']) {
min-height: var(--a11y-min-size);
min-width: var(--a11y-min-size);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/abbr/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../@shared/mixins';
@import '../style';
@import '../../styles/global';
@import '../tooltip/style.scss';

@layer kol-component {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/accordion/shadow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class KolAccordion implements AccordionAPI, FocusableElement {
@Prop() public _on?: AccordionCallbacksPropType<boolean>;

/**
* If set (to true) opens/expands the element, closes if not set (or set to false).
* Opens/expands the element when truthy, closes/collapses when falsy.
* @TODO: Change type back to `OpenPropType` after Stencil#4663 has been resolved.
*/
@Prop({ mutable: true, reflect: true }) public _open?: boolean = false;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/accordion/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../@shared/mixins';
@import '../style';
@import '../../styles/global';
@import '../host-display-block';
@import '../../functional-components/Collapsible/collapsible';

Expand Down
8 changes: 4 additions & 4 deletions packages/components/src/components/alert/style.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@import '../../styles/global';
@import '../../styles/kol-alert-mixin';
@import '../@shared/mixins';
@import '../style';
@import '../@shared/kol-alert-mixin';

@include kol-alert;

@layer kol-component {
.kol-alert {
font-size: rem(16);
}
}

@include kol-alert-styles;
2 changes: 1 addition & 1 deletion packages/components/src/components/avatar/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../@shared/mixins';
@import '../style';
@import '../../styles/global';
@import '../host-display-block';

@layer kol-component {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/badge/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../@shared/mixins';
@import '../style';
@import '../../styles/global';
@import '../tooltip/style.scss';

@layer kol-component {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/breadcrumb/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../@shared/mixins';
@import '../style';
@import '../../styles/global';

@layer kol-component {
.kol-breadcrumb {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/button-link/shadow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class KolButtonLink implements ButtonLinkProps, FocusableElement {
}

/**
* Defines the elements access key.
* Defines which key combination can be used to trigger or focus the interactive element of the component.
*/
@Prop() public _accessKey?: AccessKeyPropType;

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/button-link/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../@shared/mixins';
@import '../style';
@import '../../styles/global';
@import '../@shared/kol-link-mixin';

@include kol-link-styles('kol-button');
2 changes: 1 addition & 1 deletion packages/components/src/components/button/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export class KolButtonWc implements ButtonAPI, FocusableElement {
private readonly controller: AssociatedInputController;

/**
* Defines the elements access key.
* Defines which key combination can be used to trigger or focus the interactive element of the component.
*/
@Prop() public _accessKey?: AccessKeyPropType;

Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/components/button/shadow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class KolButton implements ButtonProps, FocusableElement {
}

/**
* Defines the elements access key.
* Defines which key combination can be used to trigger or focus the interactive element of the component.
*/
@Prop() public _accessKey?: AccessKeyPropType;

Expand Down Expand Up @@ -151,7 +151,7 @@ export class KolButton implements ButtonProps, FocusableElement {
@Prop() public _role?: AlternativeButtonLinkRolePropType;

/**
* Defines the elements short key.
* Adds a visual short key hint to the component.
*/
@Prop() public _shortKey?: ShortKeyPropType;

Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/button/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../@shared/mixins';
@import '../style';
@import '../../styles/global';
@import '../@shared/kol-button-mixin';

@include kol-button-styles('kol-button');
2 changes: 1 addition & 1 deletion packages/components/src/components/card/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../@shared/mixins';
@import '../style';
@import '../../styles/global';
@import '../tooltip/style.scss';

@layer kol-component {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/combobox/shadow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ export class KolCombobox implements ComboboxAPI {
@Prop() public _on?: InputTypeOnDefault;

/**
* Suggestions the user can choose from.
* Suggestions to provide for the input.
*/
@Prop() public _suggestions!: SuggestionsPropType;

Expand Down
13 changes: 11 additions & 2 deletions packages/components/src/components/combobox/style.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import '../../styles/global';
@import '../@shared/mixins';
@import '../style';
@import '../input-line';
@import '../host-display-block';
@import '../tooltip/style';

@layer kol-component {
:host {
Expand Down Expand Up @@ -28,6 +29,10 @@

&__input {
flex-grow: 1;

&:focus {
outline: none;
}
}

&__icon {
Expand Down Expand Up @@ -59,4 +64,8 @@
}
}
}

.kol-input {
display: grid;
}
}
2 changes: 1 addition & 1 deletion packages/components/src/components/details/shadow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class KolDetails implements DetailsAPI, FocusableElement {
@Prop() public _on?: DetailsCallbacksPropType<boolean>;

/**
* If set (to true) opens/expands the element, closes if not set (or set to false).
* Opens/expands the element when truthy, closes/collapses when falsy.
* @TODO: Change type back to `OpenPropType` after Stencil#4663 has been resolved.
*/
@Prop({ mutable: true, reflect: true }) public _open?: boolean = false;
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/details/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../@shared/mixins';
@import '../style';
@import '../../styles/global';
@import '../host-display-block';
@import '../../functional-components/Collapsible/collapsible';

Expand Down
28 changes: 26 additions & 2 deletions packages/components/src/components/drawer/drawer.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import { KolEvent } from '../../utils/events';
test.describe('kol-drawer', () => {
test.describe('Callbacks', () => {
test(`should call 'onClose' callback when drawer is closed`, async ({ page }) => {
await page.setContent('<kol-drawer _label="Details" >Drawer content</kol-drawer>');
await page.setContent('<kol-drawer _label="Details" _open>Drawer content</kol-drawer>');
const kolDrawer = page.locator('kol-drawer');

const callbackPromise = kolDrawer.evaluate((element: HTMLKolDrawerElement) => {
element._open = true; // see #7165
return new Promise<void>((resolve) => {
element._on = {
onClose: () => {
Expand All @@ -25,6 +24,31 @@ test.describe('kol-drawer', () => {
});
});

test.describe('_open property', () => {
test(`should open initially when _open property is true`, async ({ page }) => {
await page.setContent('<kol-drawer _label="Details" _open><div data-testid="drawer-content">Drawer content</div></kol-drawer>');
await expect(page.getByTestId('drawer-content')).toBeVisible();
});

test(`should open when _open property becomes true`, async ({ page }) => {
await page.setContent('<kol-drawer _label="Details"><div data-testid="drawer-content">Drawer content</div></kol-drawer>');
const kolDrawer = page.locator('kol-drawer');
await kolDrawer.evaluate((element: HTMLKolDrawerElement) => {
element._open = true;
});
await expect(page.getByTestId('drawer-content')).toBeVisible();
});

test(`should close when _open property becomes false`, async ({ page }) => {
await page.setContent('<kol-drawer _label="Details" _open><div data-testid="drawer-content">Drawer content</div></kol-drawer>');
const kolDrawer = page.locator('kol-drawer');
await kolDrawer.evaluate((element: HTMLKolDrawerElement) => {
element._open = false;
});
await expect(page.getByTestId('drawer-content')).not.toBeVisible();
});
});

test.describe('DOM events', () => {
test(`should emit 'close' when drawer is closed`, async ({ page }) => {
await page.setContent('<kol-drawer _label="Details" >Drawer content</kol-drawer>');
Expand Down
31 changes: 24 additions & 7 deletions packages/components/src/components/drawer/shadow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ export class KolDrawer implements DrawerAPI {
);
}

private getRef = (el: HTMLDialogElement | undefined) => (this.dialogElement = el as HTMLDialogElement);
private getRef = (el: HTMLDialogElement | undefined) => {
this.dialogElement = el as HTMLDialogElement;
setTimeout(() => {
void this.openOrCloseBasedOnState(); // handle initial state as soon as element is ready
});
};
public render(): JSX.Element {
return (
<Host class="kol-drawer">
Expand All @@ -77,12 +82,12 @@ export class KolDrawer implements DrawerAPI {
}

/**
* Specifies the default open state of the drawer.
* Opens/expands the element when truthy, closes/collapses when falsy.
*/
@Prop() public _open?: OpenPropType;

/**
* Specifies the orientation of the drawer.
* Defines the visual orientation of the component.
*/
@Prop() public _align?: AlignPropType;

Expand Down Expand Up @@ -115,10 +120,22 @@ export class KolDrawer implements DrawerAPI {
}

@Watch('_open')
public async validateOpen(value?: OpenPropType): Promise<void> {
public validateOpen(value?: OpenPropType) {
if (typeof value === 'boolean') {
validateOpen(this, value);
value ? await this.open() : await this.close();

if (this.dialogElement) {
// handle property changes but not the initial validateOpen call
void this.openOrCloseBasedOnState();
}
}
}

private async openOrCloseBasedOnState() {
if (this.state._open) {
await this.open();
} else {
await this.close();
}
}

Expand Down Expand Up @@ -165,9 +182,9 @@ export class KolDrawer implements DrawerAPI {
this.dialogElement?.removeEventListener('close', this.handleClose.bind(this));
}

public async componentWillLoad(): Promise<void> {
public componentWillLoad() {
this.validateLabel(this._label);
await this.validateOpen(this._open);
this.validateOpen(this._open);
this.validateAlign(this._align);
this.validateOn(this._on);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/drawer/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../@shared/mixins';
@import '../style';
@import '../../styles/global';

@layer kol-component {
.kol-drawer {
Expand Down
8 changes: 5 additions & 3 deletions packages/components/src/components/form/style.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
@import '../@shared/mixins';
@import '../style';
@import '../input-line';
@import '../../styles/global';
@import '../host-display-block';
@import '../@shared/kol-link-mixin';
@import '../../styles/kol-alert-mixin';

@layer kol-component {
@include kol-link-styles('kol-link');
@include kol-alert-styles;
@include kol-alert;

.kol-form {
font-size: rem(16);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/heading/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../@shared/mixins';
@import '../style';
@import '../../styles/global';

@layer kol-component {
.kol-headline {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/components/image/style.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '../@shared/mixins';
@import '../style';
@import '../../styles/global';

@layer kol-component {
.kol-image {
Expand Down
43 changes: 0 additions & 43 deletions packages/components/src/components/input-checkbox/button.scss

This file was deleted.

Loading

0 comments on commit fb1e1b7

Please sign in to comment.