mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +00:00
feat(TextInput): add isFluid
from Form context
This commit is contained in:
parent
7689c33a75
commit
04443c5833
2 changed files with 24 additions and 5 deletions
|
@ -107,17 +107,21 @@
|
|||
*/
|
||||
export let ref = null;
|
||||
|
||||
import { getContext } from "svelte";
|
||||
import WarningFilled16 from "carbon-icons-svelte/lib/WarningFilled16";
|
||||
import View16 from "carbon-icons-svelte/lib/View16";
|
||||
import ViewOff16 from "carbon-icons-svelte/lib/ViewOff16";
|
||||
|
||||
const ctx = getContext("Form");
|
||||
|
||||
$: isFluid = !!ctx && ctx.isFluid;
|
||||
$: errorId = `error-${id}`;
|
||||
</script>
|
||||
|
||||
<div
|
||||
class:bx--form-item="{true}"
|
||||
class:bx--text-input-wrapper="{true}"
|
||||
class:bx--password-input-wrapper="{true}"
|
||||
class:bx--password-input-wrapper="{!isFluid}"
|
||||
{...$$restProps}
|
||||
on:click
|
||||
on:mouseover
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue