Commit graph

20 commits

Author SHA1 Message Date
Eric Liu
6bf72d4602
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.
2025-02-02 19:49:53 -08:00
metonym
6fbd8ae6a9 fix(types): use type alias instead of interface for $$restProps 2024-11-09 14:41:28 -08:00
metonym
8bffc17d65 fix(link)!: do not render p for disabled link
Closes #1924

Svelte 5 will not compile if `div` is nested inside `p` element. Refactor Link to render an `a` instead of `p` when disabled.
2024-03-06 22:49:27 -05:00
Eric Liu
2f026f792a
feat(typescript)!: support svelte 4 (#1773)
Closes #1753 

The minimum Svelte version required for TypeScript users is now 3.55.
2023-07-19 09:44:56 -07:00
Eric Liu
7fdc2ef7f0
fix(types): allow data-* attributes for props forwarded to HTML elements (#1741)
* chore(deps-dev): upgrade `sveld` to v0.18.1

* Run "yarn build:docs"

* test: assert that `data-*` attributes are valid
2023-07-08 16:41:44 -07:00
metonym
724d90bd7b
chore(types)!: remove sveltekit: attributes from types (#1581)
* chore(deps-dev): upgrade sveld 0.17.2 -> 0.18.0

* Run "yarn build:docs"
2022-12-11 15:58:19 -05:00
metonym
2d26ce115d
chore(deps-dev): upgrade sveld to v0.15.0 (#1247)
* chore(deps-dev): upgrade sveld to v0.15.0

* Run "yarn build:docs"
2022-04-15 08:28:00 -07:00
metonym
35f4a5cb84
refactor(link): make a precede p element for restProps (#1237) 2022-04-09 14:17:36 -07:00
metonym
ea38cd2568
feat(types): support sveltekit:prefetch, sveltekit:noscroll attributes in type definitions (#1234)
* chore(deps-dev): upgrade sveld to 0.14.0

* Run "yarn build:docs"
2022-04-09 14:13:56 -07:00
metonym
45c272642f
fix(link): $$restProps should extend p, a HTML attributes (#1233)
* fix(link): restProps should extend `p` or `a` tag attributes

* Run "yarn build:docs"

* test(link): assert anchor link rest attributes
2022-04-09 11:24:25 -07:00
metonym
e23b121143
feat: make icons slottable (#1186) 2022-03-19 11:37:20 -07:00
Eric Liu
0d78c30b9d
fix(types): include @default annotations for props that are undefined by default (#1020)
* chore(deps-dev): upgrade sveld to v0.12.1

* Run "yarn build:lib"

* Re-run "yarn build:lib"
2022-01-20 19:29:06 -08:00
Eric Liu
7b65a15345
Omit explicit "from carbon-icons-svelte" from icon prop definitions (#866)
* fix(types): update description for icon props #865

* docs(component-api): remove hardcoded Carbon Svelte icon description
2021-10-20 13:48:52 -07:00
Eric Liu
3203e7a61f
Upgrade sveld to v0.10 (#856)
* chore(deps-dev): upgrade sveld to v0.10.2

* feat(types): regenerate types using sveld@0.10.2

* fix(types): update @extends to use .svelte extension
2021-10-16 12:34:29 -07:00
Eric Liu
b21600c9d6
feat(types): loosen icon prop type to allow any Svelte component #806 (#853)
* feat(types): loosen type for Carbon icons #806

* Add closeIcon option and remove stopPropagation on:click in HeaderAction (#840)

* Remove stopPropagation on:click

Remove stopPropagation on:click helps when you have more then one acction to switch between actions tabs

* fix bug for default icon

* add closeIcon attribute to HeaderAction

* feat(types): loosen type for Carbon icons #806

* chore: update TreeView, HeaderAction icon types

Co-authored-by: Daniel Miedzik <daniel.miedzik@gmail.com>
2021-10-15 16:40:23 -07:00
Eric Liu
f3cddbad9f
Align v10.33 (#619)
* chore(deps-dev): upgrade carbon-components to v10.33.0

* fix(clickable-tile): support disabled state for ClickableTile

* fix(aspect-ratio): add missing 3x2 ratio

* docs: update number of supported chart types

* feat(link): support link with icon

* refactor(outbound-link): use icon prop

* fix(search): wrap search icon with div
2021-04-30 17:08:09 -07:00
Eric Liu
bcd28de86e
feat(types): use the SvelteComponentTyped interface in the TypeScript definitions (#515) 2021-02-07 11:25:20 -08:00
Eric Liu
251f986304
add OutboundLink (#504)
* feat(link): add OutboundLink

* fix(outbound-link): forward Link events
2021-02-03 05:27:24 -08:00
Eric Liu
75d4b4cf03 refactor(types): shorten ref, id JSDocs, use CarbonIcon type, export component props 2020-11-06 11:30:46 -08:00
Eric Liu
3c04f122b0 refactor(types): rewrite type definitions to account for intrinsic attributes 2020-11-03 05:44:11 -08:00