mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-17 11:11:25 +00:00
* feat(icons): inline carbon icons used by components * feat(icons): update svelte components to use inlined carbon icons * breaking(deps): remove carbon-icons-svelte * chore(deps-dev): install carbon-icons-svelte as a devDependency
51 lines
1.4 KiB
Svelte
51 lines
1.4 KiB
Svelte
<script>
|
|
let className = undefined;
|
|
export { className as class };
|
|
export let id = undefined;
|
|
export let tabindex = undefined;
|
|
export let focusable = false;
|
|
export let title = undefined;
|
|
export let style = undefined;
|
|
|
|
$: ariaLabel = $$props["aria-label"];
|
|
$: ariaLabelledBy = $$props["aria-labelledby"];
|
|
$: labelled = ariaLabel || ariaLabelledBy || title;
|
|
$: attributes = {
|
|
"aria-label": ariaLabel,
|
|
"aria-labelledby": ariaLabelledBy,
|
|
"aria-hidden": labelled ? undefined : true,
|
|
role: labelled ? "img" : undefined,
|
|
focusable: tabindex === "0" ? true : focusable,
|
|
tabindex,
|
|
};
|
|
</script>
|
|
|
|
<!-- svelte-ignore a11y-mouse-events-have-key-events -->
|
|
<svg
|
|
data-carbon-icon="EditOff16"
|
|
on:click
|
|
on:mouseover
|
|
on:mouseenter
|
|
on:mouseleave
|
|
on:keyup
|
|
on:keydown
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
viewBox="0 0 32 32"
|
|
fill="currentColor"
|
|
width="16"
|
|
height="16"
|
|
class="{className}"
|
|
preserveAspectRatio="xMidYMid meet"
|
|
style="{style}"
|
|
id="{id}"
|
|
{...attributes}
|
|
>
|
|
<path
|
|
d="M30 28.6L3.4 2 2 3.4l10.1 10.1L4 21.6V28h6.4l8.1-8.1L28.6 30 30 28.6zM9.6 26H6v-3.6l7.5-7.5 3.6 3.6L9.6 26zM29.4 6.2L29.4 6.2l-3.6-3.6c-.8-.8-2-.8-2.8 0l0 0 0 0-8 8 1.4 1.4L20 8.4l3.6 3.6L20 15.6l1.4 1.4 8-8C30.2 8.2 30.2 7 29.4 6.2L29.4 6.2zM25 10.6L21.4 7l3-3L28 7.6 25 10.6z"
|
|
></path>
|
|
<slot>
|
|
{#if title}
|
|
<title>{title}</title>
|
|
{/if}
|
|
</slot>
|
|
</svg>
|