mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
chore(ui-shell): remove ambiguous type prop in favor of $$restProps
This commit is contained in:
parent
c3f924c25a
commit
566a281d81
2 changed files with 32 additions and 6 deletions
|
@ -1,7 +1,21 @@
|
||||||
<script>
|
<script>
|
||||||
export let type = undefined;
|
/**
|
||||||
|
* Set to `true` to open the panel
|
||||||
|
* @type {boolean} [isOpen=false]
|
||||||
|
*/
|
||||||
|
export let isOpen = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the icon props
|
||||||
|
* @type {{ render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean; }} [icon]
|
||||||
|
*/
|
||||||
export let icon = undefined;
|
export let icon = undefined;
|
||||||
export let isOpen = undefined;
|
|
||||||
|
/**
|
||||||
|
* Specify the text
|
||||||
|
* Alternatively, use the named slot "text" (e.g. <div slot="text">...</div>)
|
||||||
|
* @type {string} [text]
|
||||||
|
*/
|
||||||
export let text = undefined;
|
export let text = undefined;
|
||||||
|
|
||||||
import { Icon } from "../../Icon";
|
import { Icon } from "../../Icon";
|
||||||
|
@ -38,7 +52,6 @@
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
aria-label={type}
|
|
||||||
class:bx--header__action={true}
|
class:bx--header__action={true}
|
||||||
class:bx--header__action--active={isOpen}
|
class:bx--header__action--active={isOpen}
|
||||||
class:action-text={text}
|
class:action-text={text}
|
||||||
|
|
|
@ -1,8 +1,21 @@
|
||||||
<script>
|
<script>
|
||||||
|
/**
|
||||||
|
* Set to `true` to use the active state
|
||||||
|
* @type {boolean} [linkIsActive=false]
|
||||||
|
*/
|
||||||
|
export let linkIsActive = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specify the `href` attribute
|
||||||
|
* @type {string} [href]
|
||||||
|
*/
|
||||||
export let href = undefined;
|
export let href = undefined;
|
||||||
export let type = undefined;
|
|
||||||
|
/**
|
||||||
|
* Specify the icon props
|
||||||
|
* @type {{ render: typeof import("carbon-icons-svelte/lib/Add16").default; skeleton: boolean; }} [icon]
|
||||||
|
*/
|
||||||
export let icon = undefined;
|
export let icon = undefined;
|
||||||
export let linkIsActive = undefined;
|
|
||||||
|
|
||||||
import { Icon } from "../../Icon";
|
import { Icon } from "../../Icon";
|
||||||
</script>
|
</script>
|
||||||
|
@ -18,10 +31,10 @@
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
aria-label={type}
|
|
||||||
class:bx--header__action={true}
|
class:bx--header__action={true}
|
||||||
class:bx--header__action--active={linkIsActive}
|
class:bx--header__action--active={linkIsActive}
|
||||||
class:action-link={true}
|
class:action-link={true}
|
||||||
|
{...$$restProps}
|
||||||
{href}>
|
{href}>
|
||||||
<Icon {...icon} />
|
<Icon {...icon} />
|
||||||
</a>
|
</a>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue