Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { h } from '@stencil/core';
import type { FunctionalComponent as FC } from '@stencil/core';
import { h } from '@stencil/core';
import type { JSXBase } from '@stencil/core/internal';
import clsx from 'clsx';
import { KolButtonWcTag } from '../../core/component-names';
import type { HeadingLevel, IconsPropType } from '../../schema';
import type { EventValueOrEventCallback, HeadingLevel, IconsPropType, StencilUnknown } from '../../schema';
import KolHeadingFc from '../Heading';

type ClassType =
Expand All @@ -12,12 +12,13 @@ type ClassType =
[className: string]: boolean;
};

export type CollapsibleProps = Omit<JSXBase.HTMLAttributes<HTMLElement>, 'id'> & {
export type CollapsibleProps = Omit<JSXBase.HTMLAttributes<HTMLElement>, 'id' | 'onClick'> & {
id: string;
open?: boolean;
disabled?: boolean;
level?: HeadingLevel;
label: string;
onClick?: EventValueOrEventCallback<MouseEvent, StencilUnknown>;

HeadingProps?: {
ref?: ((elm?: HTMLElement | undefined) => void) | undefined;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
export type DefaultInputProps<T> = Omit<T, 'title' | 'autoCapitalize' | 'autoCorrect' | 'spellcheck'> & {
export type DefaultInputProps<T> = Omit<
{
[K in keyof T as K extends `aria${string}` ? never : K]: T[K]; // `aria${string}` is defined in the Stencil HTML types and colliding with our props, hence we remove it.
},
'title' | 'autoCapitalize' | 'autoCorrect' | 'spellcheck'
> & {
id: string;
ariaDescribedBy?: string[];
hideLabel?: boolean;
Expand Down
46 changes: 24 additions & 22 deletions packages/components/src/global/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,29 @@ import { getThemeDetails, setThemeStyle } from 'adopted-style-sheets';
import { Log } from '../schema';
import { setMode } from '@stencil/core';

setMode((elm) => {
try {
if (elm.shadowRoot instanceof ShadowRoot) {
setThemeStyle(elm, getThemeDetails(elm));
export default () => {
setMode((elm) => {
try {
if (elm.shadowRoot instanceof ShadowRoot) {
setThemeStyle(elm, getThemeDetails(elm));
}
} catch (error) {
/**
* Try is needed for SSR.
* - no HTMLElement is available
* - no ShadowRoot is available
*/
}
} catch (error) {
/**
* Try is needed for SSR.
* - no HTMLElement is available
* - no ShadowRoot is available
*/
}
return 'default';
});

import('./devtools')
.then((devTools) => {
if (typeof devTools === 'object' && devTools !== null && typeof devTools.initialize === 'function') {
devTools.initialize();
}
})
.catch((error) => {
Log.error(error);
return 'default';
});

import('./devtools')
.then((devTools) => {
if (typeof devTools === 'object' && devTools !== null && typeof devTools.initialize === 'function') {
devTools.initialize();
}
})
.catch((error) => {
Log.error(error);
});
};
1 change: 1 addition & 0 deletions packages/components/src/styles/_global.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@use '../components/a11y' as *;
@use '../components/preset' as *;
@use '../components/@shared/mixins' as *;

@layer kol-global {
:host {
Expand Down
Loading