mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
fix(types): loosen icon
prop type to any
(#2095)
Fixes https://github.com/carbon-design-system/carbon-icons-svelte/issues/207 `carbon-icons-svelte@13` and `carbon-pictograms-svelte@13` now only support TypeScript for Svelte 4/5. The new `Component` type is incompatible with the `icon` prop in `carbon-components-svelte`, causing a type error with Svelte 5, as `typeof SvelteComponent` doesn't match the new `Component` type. Since `Component` isn't available in Svelte 3/4, this PR changes the `icon` prop type to `any` for compatibility across Svelte 3, 4, and 5.
This commit is contained in:
parent
ece9e0362f
commit
6bf72d4602
44 changed files with 273 additions and 251 deletions
2
types/Button/Button.svelte.d.ts
vendored
2
types/Button/Button.svelte.d.ts
vendored
|
@ -44,7 +44,7 @@ type $Props = {
|
|||
* Alternatively, use the named slot "icon" (e.g., `<Icon slot="icon" size="{20}" />`)
|
||||
* @default undefined
|
||||
*/
|
||||
icon?: typeof import("svelte").SvelteComponent<any>;
|
||||
icon?: any;
|
||||
|
||||
/**
|
||||
* Specify the ARIA label for the button icon
|
||||
|
|
2
types/ComposedModal/ModalFooter.svelte.d.ts
vendored
2
types/ComposedModal/ModalFooter.svelte.d.ts
vendored
|
@ -14,7 +14,7 @@ type $Props = {
|
|||
* Specify the primary button icon
|
||||
* @default undefined
|
||||
*/
|
||||
primaryButtonIcon?: typeof import("svelte").SvelteComponent<any>;
|
||||
primaryButtonIcon?: any;
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the primary button
|
||||
|
|
|
@ -27,7 +27,7 @@ type $Props = {
|
|||
* Icon is rendered to the left of the label text
|
||||
* @default undefined
|
||||
*/
|
||||
icon?: typeof import("svelte").SvelteComponent<any>;
|
||||
icon?: any;
|
||||
|
||||
/**
|
||||
* Specify the label text.
|
||||
|
|
2
types/Link/Link.svelte.d.ts
vendored
2
types/Link/Link.svelte.d.ts
vendored
|
@ -27,7 +27,7 @@ type $Props = {
|
|||
* `inline` must be `false`
|
||||
* @default undefined
|
||||
*/
|
||||
icon?: typeof import("svelte").SvelteComponent<any>;
|
||||
icon?: any;
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the checkbox
|
||||
|
|
2
types/Modal/Modal.svelte.d.ts
vendored
2
types/Modal/Modal.svelte.d.ts
vendored
|
@ -86,7 +86,7 @@ type $Props = {
|
|||
* Specify the primary button icon
|
||||
* @default undefined
|
||||
*/
|
||||
primaryButtonIcon?: typeof import("svelte").SvelteComponent<any>;
|
||||
primaryButtonIcon?: any;
|
||||
|
||||
/**
|
||||
* Set to `true` for the "submit" and "click:button--primary" events
|
||||
|
|
|
@ -14,7 +14,7 @@ type $Props = {
|
|||
* Specify the icon to render
|
||||
* @default undefined
|
||||
*/
|
||||
icon?: typeof import("svelte").SvelteComponent<any>;
|
||||
icon?: any;
|
||||
|
||||
/**
|
||||
* Specify the title of the icon
|
||||
|
|
2
types/OverflowMenu/OverflowMenu.svelte.d.ts
vendored
2
types/OverflowMenu/OverflowMenu.svelte.d.ts
vendored
|
@ -45,7 +45,7 @@ type $Props = {
|
|||
* Defaults to `<OverflowMenuVertical />`
|
||||
* @default undefined
|
||||
*/
|
||||
icon?: typeof import("svelte").SvelteComponent<any>;
|
||||
icon?: any;
|
||||
|
||||
/**
|
||||
* Specify the icon class
|
||||
|
|
2
types/Search/Search.svelte.d.ts
vendored
2
types/Search/Search.svelte.d.ts
vendored
|
@ -87,7 +87,7 @@ type $Props = {
|
|||
* Defaults to `<Search />`
|
||||
* @default undefined
|
||||
*/
|
||||
icon?: typeof import("svelte").SvelteComponent<any>;
|
||||
icon?: any;
|
||||
|
||||
/**
|
||||
* Set an id for the input element
|
||||
|
|
2
types/Tag/Tag.svelte.d.ts
vendored
2
types/Tag/Tag.svelte.d.ts
vendored
|
@ -61,7 +61,7 @@ type $Props = {
|
|||
* Specify the icon to render
|
||||
* @default undefined
|
||||
*/
|
||||
icon?: typeof import("svelte").SvelteComponent<any>;
|
||||
icon?: any;
|
||||
|
||||
/**
|
||||
* Set an id for the filterable tag
|
||||
|
|
2
types/Tooltip/Tooltip.svelte.d.ts
vendored
2
types/Tooltip/Tooltip.svelte.d.ts
vendored
|
@ -33,7 +33,7 @@ type $Props = {
|
|||
* Default to `<Information />`
|
||||
* @default undefined
|
||||
*/
|
||||
icon?: typeof import("svelte").SvelteComponent<any>;
|
||||
icon?: any;
|
||||
|
||||
/**
|
||||
* Specify the ARIA label for the tooltip button
|
||||
|
|
2
types/TooltipIcon/TooltipIcon.svelte.d.ts
vendored
2
types/TooltipIcon/TooltipIcon.svelte.d.ts
vendored
|
@ -15,7 +15,7 @@ type $Props = {
|
|||
* Specify the icon to render
|
||||
* @default undefined
|
||||
*/
|
||||
icon?: typeof import("svelte").SvelteComponent<any>;
|
||||
icon?: any;
|
||||
|
||||
/**
|
||||
* Set to `true` to disable the tooltip icon
|
||||
|
|
2
types/TreeView/TreeView.svelte.d.ts
vendored
2
types/TreeView/TreeView.svelte.d.ts
vendored
|
@ -6,7 +6,7 @@ export type TreeNodeId = string | number;
|
|||
export interface TreeNode {
|
||||
id: TreeNodeId;
|
||||
text: any;
|
||||
icon?: typeof import("svelte").SvelteComponent<any>;
|
||||
icon?: any;
|
||||
disabled?: boolean;
|
||||
nodes?: TreeNode[];
|
||||
}
|
||||
|
|
4
types/UIShell/Header.svelte.d.ts
vendored
4
types/UIShell/Header.svelte.d.ts
vendored
|
@ -72,14 +72,14 @@ type $Props = {
|
|||
* Defaults to `<Menu size={20} />`
|
||||
* @default undefined
|
||||
*/
|
||||
iconMenu?: typeof import("svelte").SvelteComponent<any>;
|
||||
iconMenu?: any;
|
||||
|
||||
/**
|
||||
* Specify the icon to render for the opened state.
|
||||
* Defaults to `<Close size={20} />`
|
||||
* @default undefined
|
||||
*/
|
||||
iconClose?: typeof import("svelte").SvelteComponent<any>;
|
||||
iconClose?: any;
|
||||
|
||||
[key: `data-${string}`]: any;
|
||||
};
|
||||
|
|
4
types/UIShell/HeaderAction.svelte.d.ts
vendored
4
types/UIShell/HeaderAction.svelte.d.ts
vendored
|
@ -15,14 +15,14 @@ type $Props = {
|
|||
* Defaults to `<Switcher size={20} />`
|
||||
* @default undefined
|
||||
*/
|
||||
icon?: typeof import("svelte").SvelteComponent<any>;
|
||||
icon?: any;
|
||||
|
||||
/**
|
||||
* Specify the icon to render when the action panel is open.
|
||||
* Defaults to `<Close size={20} />`
|
||||
* @default undefined
|
||||
*/
|
||||
closeIcon?: typeof import("svelte").SvelteComponent<any>;
|
||||
closeIcon?: any;
|
||||
|
||||
/**
|
||||
* Specify the text.
|
||||
|
|
2
types/UIShell/HeaderActionLink.svelte.d.ts
vendored
2
types/UIShell/HeaderActionLink.svelte.d.ts
vendored
|
@ -20,7 +20,7 @@ type $Props = {
|
|||
* Specify the icon to render
|
||||
* @default undefined
|
||||
*/
|
||||
icon?: typeof import("svelte").SvelteComponent<any>;
|
||||
icon?: any;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML anchor element
|
||||
|
|
2
types/UIShell/HeaderGlobalAction.svelte.d.ts
vendored
2
types/UIShell/HeaderGlobalAction.svelte.d.ts
vendored
|
@ -12,7 +12,7 @@ export type HeaderGlobalActionProps = ButtonProps & {
|
|||
* Specify the icon to render
|
||||
* @default undefined
|
||||
*/
|
||||
icon?: typeof import("svelte").SvelteComponent<any>;
|
||||
icon?: any;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML button element
|
||||
|
|
2
types/UIShell/SideNavLink.svelte.d.ts
vendored
2
types/UIShell/SideNavLink.svelte.d.ts
vendored
|
@ -26,7 +26,7 @@ type $Props = {
|
|||
* Specify the icon to render
|
||||
* @default undefined
|
||||
*/
|
||||
icon?: typeof import("svelte").SvelteComponent<any>;
|
||||
icon?: any;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML anchor element
|
||||
|
|
2
types/UIShell/SideNavMenu.svelte.d.ts
vendored
2
types/UIShell/SideNavMenu.svelte.d.ts
vendored
|
@ -20,7 +20,7 @@ type $Props = {
|
|||
* Specify the icon to render
|
||||
* @default undefined
|
||||
*/
|
||||
icon?: typeof import("svelte").SvelteComponent<any>;
|
||||
icon?: any;
|
||||
|
||||
/**
|
||||
* Obtain a reference to the HTML button element
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue