mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 02:11:05 +00:00
- Inline class assignments to avoid script-level clutter - Ignore a11y-missing-attribute instead of redundant href
24 lines
491 B
Svelte
24 lines
491 B
Svelte
<script>
|
|
let className = undefined;
|
|
export { className as class };
|
|
export let value = '';
|
|
export let text = '';
|
|
export let disabled = false;
|
|
export let hidden = false;
|
|
export let style = undefined;
|
|
|
|
import { getContext } from 'svelte';
|
|
import { cx } from '../../lib';
|
|
|
|
const { selected } = getContext('Select');
|
|
</script>
|
|
|
|
<option
|
|
selected={$selected === value}
|
|
class={cx('--select-option', className)}
|
|
{value}
|
|
{disabled}
|
|
{hidden}
|
|
{style}>
|
|
{text}
|
|
</option>
|