mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
Alignment with Carbon version 10.29 (#529)
* chore: patch prettier-plugin-svelte * docs(tag): add filterable small tag example * feat(ui-shell): add SideNavDivider * feat(combo-box): support warning state * docs(combo-box): add invalid state example * fix(progress-step): add title to warning icon * docs(progress-indicator): add invalid step example * docs(progress-indicator): add disabled steps example * feat(truncate): add text truncation component and action * docs(radio-tile): fix light variant example * fix(side-effects): add pre-compiled CSS to library side effects * refactor(css): use shorthand scss imports, add comments * refactor(truncate): rename "direction" prop to "clamp" * chore(deps-dev): bump carbon-components to v10.29.0 * feat(combo-box): add direction prop * feat(dropdown): add direction prop * feat(multi-select): add direction prop
This commit is contained in:
parent
827a9822e7
commit
14e714fa61
48 changed files with 729 additions and 277 deletions
|
@ -103,54 +103,9 @@
|
|||
on:mouseenter
|
||||
on:mouseleave
|
||||
/>
|
||||
{:else}
|
||||
{#if type === "inline"}
|
||||
{#if hideCopyButton}
|
||||
<span
|
||||
class:bx--snippet="{true}"
|
||||
class:bx--snippet--expand="{expanded}"
|
||||
class:bx--snippet--light="{light}"
|
||||
class:bx--snippet--no-copy="{hideCopyButton}"
|
||||
class:bx--snippet--wraptext="{wrapText}"
|
||||
class:bx--snippet--single="{type === 'single'}"
|
||||
class:bx--snippet--inline="{type === 'inline'}"
|
||||
class:bx--snippet--multi="{type === 'multi'}"
|
||||
{...$$restProps}
|
||||
>
|
||||
<code id="{id}">
|
||||
<slot>{code}</slot>
|
||||
</code>
|
||||
</span>
|
||||
{:else}
|
||||
<Copy
|
||||
aria-label="{copyLabel}"
|
||||
aria-describedby="{id}"
|
||||
feedback="{feedback}"
|
||||
feedbackTimeout="{feedbackTimeout}"
|
||||
class="bx--snippet {type && `bx--snippet--${type}`}
|
||||
{type ===
|
||||
'inline' && 'bx--btn--copy'}
|
||||
{expanded &&
|
||||
'bx--snippet--expand'}
|
||||
{light &&
|
||||
'bx--snippet--light'}
|
||||
{hideCopyButton &&
|
||||
'bx--snippet--no-copy'}
|
||||
{wrapText &&
|
||||
'bx--snippet--wraptext'}"
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
>
|
||||
<code id="{id}">
|
||||
<slot>{code}</slot>
|
||||
</code>
|
||||
</Copy>
|
||||
{/if}
|
||||
{:else}
|
||||
<div
|
||||
{:else if type === "inline"}
|
||||
{#if hideCopyButton}
|
||||
<span
|
||||
class:bx--snippet="{true}"
|
||||
class:bx--snippet--expand="{expanded}"
|
||||
class:bx--snippet--light="{light}"
|
||||
|
@ -159,51 +114,93 @@
|
|||
class:bx--snippet--single="{type === 'single'}"
|
||||
class:bx--snippet--inline="{type === 'inline'}"
|
||||
class:bx--snippet--multi="{type === 'multi'}"
|
||||
class:bx--snippet--disabled="{type !== 'inline' && disabled}"
|
||||
{...$$restProps}
|
||||
>
|
||||
<code id="{id}">
|
||||
<slot>{code}</slot>
|
||||
</code>
|
||||
</span>
|
||||
{:else}
|
||||
<Copy
|
||||
aria-label="{copyLabel}"
|
||||
aria-describedby="{id}"
|
||||
feedback="{feedback}"
|
||||
feedbackTimeout="{feedbackTimeout}"
|
||||
class="bx--snippet {type && `bx--snippet--${type}`}
|
||||
{type ===
|
||||
'inline' && 'bx--btn--copy'}
|
||||
{expanded &&
|
||||
'bx--snippet--expand'}
|
||||
{light &&
|
||||
'bx--snippet--light'}
|
||||
{hideCopyButton &&
|
||||
'bx--snippet--no-copy'}
|
||||
{wrapText && 'bx--snippet--wraptext'}"
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
>
|
||||
<div
|
||||
role="{type === 'single' ? 'textbox' : undefined}"
|
||||
tabindex="{type === 'single' && !disabled ? '0' : undefined}"
|
||||
aria-label="{$$restProps['aria-label'] || copyLabel || 'code-snippet'}"
|
||||
class:bx--snippet-container="{true}"
|
||||
>
|
||||
<code>
|
||||
<pre bind:this="{ref}">
|
||||
<code id="{id}">
|
||||
<slot>{code}</slot>
|
||||
</code>
|
||||
</Copy>
|
||||
{/if}
|
||||
{:else}
|
||||
<div
|
||||
class:bx--snippet="{true}"
|
||||
class:bx--snippet--expand="{expanded}"
|
||||
class:bx--snippet--light="{light}"
|
||||
class:bx--snippet--no-copy="{hideCopyButton}"
|
||||
class:bx--snippet--wraptext="{wrapText}"
|
||||
class:bx--snippet--single="{type === 'single'}"
|
||||
class:bx--snippet--inline="{type === 'inline'}"
|
||||
class:bx--snippet--multi="{type === 'multi'}"
|
||||
class:bx--snippet--disabled="{type !== 'inline' && disabled}"
|
||||
{...$$restProps}
|
||||
on:mouseover
|
||||
on:mouseenter
|
||||
on:mouseleave
|
||||
>
|
||||
<div
|
||||
role="{type === 'single' ? 'textbox' : undefined}"
|
||||
tabindex="{type === 'single' && !disabled ? '0' : undefined}"
|
||||
aria-label="{$$restProps['aria-label'] || copyLabel || 'code-snippet'}"
|
||||
class:bx--snippet-container="{true}"
|
||||
>
|
||||
<code>
|
||||
<pre bind:this="{ref}">
|
||||
<slot>{code}</slot>
|
||||
</pre>
|
||||
</code>
|
||||
</div>
|
||||
{#if !hideCopyButton}
|
||||
<CopyButton
|
||||
disabled="{disabled}"
|
||||
feedback="{feedback}"
|
||||
feedbackTimeout="{feedbackTimeout}"
|
||||
iconDescription="{copyButtonDescription}"
|
||||
on:click
|
||||
on:animationend
|
||||
/>
|
||||
{/if}
|
||||
{#if showMoreLess}
|
||||
<Button
|
||||
kind="ghost"
|
||||
size="field"
|
||||
class="bx--snippet-btn--expand"
|
||||
disabled="{disabled}"
|
||||
on:click="{() => {
|
||||
expanded = !expanded;
|
||||
}}"
|
||||
>
|
||||
<span class:bx--snippet-btn--text="{true}">{expandText}</span>
|
||||
<ChevronDown16
|
||||
class="bx--icon-chevron--down bx--snippet__icon"
|
||||
aria-label="{expandText}"
|
||||
/>
|
||||
</Button>
|
||||
{/if}
|
||||
</code>
|
||||
</div>
|
||||
{/if}
|
||||
{#if !hideCopyButton}
|
||||
<CopyButton
|
||||
disabled="{disabled}"
|
||||
feedback="{feedback}"
|
||||
feedbackTimeout="{feedbackTimeout}"
|
||||
iconDescription="{copyButtonDescription}"
|
||||
on:click
|
||||
on:animationend
|
||||
/>
|
||||
{/if}
|
||||
{#if showMoreLess}
|
||||
<Button
|
||||
kind="ghost"
|
||||
size="field"
|
||||
class="bx--snippet-btn--expand"
|
||||
disabled="{disabled}"
|
||||
on:click="{() => {
|
||||
expanded = !expanded;
|
||||
}}"
|
||||
>
|
||||
<span class:bx--snippet-btn--text="{true}">{expandText}</span>
|
||||
<ChevronDown16
|
||||
class="bx--icon-chevron--down bx--snippet__icon"
|
||||
aria-label="{expandText}"
|
||||
/>
|
||||
</Button>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue