mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-20 12:23:02 +00:00
feat(icons): inline carbon icons used by components
This commit is contained in:
parent
ea6757d020
commit
03800f73f9
39 changed files with 2019 additions and 0 deletions
49
src/icons/ChevronDownGlyph.svelte
Normal file
49
src/icons/ChevronDownGlyph.svelte
Normal file
|
@ -0,0 +1,49 @@
|
|||
<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="ChevronDownGlyph"
|
||||
on:click
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
on:keyup
|
||||
on:keydown
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 10 6"
|
||||
fill="currentColor"
|
||||
width="10"
|
||||
height="6"
|
||||
class="{className}"
|
||||
preserveAspectRatio="xMidYMid meet"
|
||||
style="{style}"
|
||||
id="{id}"
|
||||
{...attributes}
|
||||
>
|
||||
<path d="M5 6L0 1 0.7 0.3 5 4.6 9.3 0.3 10 1z"></path>
|
||||
<slot>
|
||||
{#if title}
|
||||
<title>{title}</title>
|
||||
{/if}
|
||||
</slot>
|
||||
</svg>
|
Loading…
Add table
Add a link
Reference in a new issue