mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
chore(numberinput): move helper text below input
This commit is contained in:
parent
b61be53f09
commit
544d48d2e8
2 changed files with 8 additions and 14 deletions
|
@ -30,6 +30,7 @@ export const Default = () => ({
|
||||||
disabled: boolean("Disabled (disabled)", false),
|
disabled: boolean("Disabled (disabled)", false),
|
||||||
readonly: boolean("Read only (readonly)", false),
|
readonly: boolean("Read only (readonly)", false),
|
||||||
invalid: boolean("Show form validation UI (invalid)", false),
|
invalid: boolean("Show form validation UI (invalid)", false),
|
||||||
|
helperText: text("Helper text (helperText)", "Optional helper text here"),
|
||||||
mobile: boolean("Mobile variant (mobile)", false),
|
mobile: boolean("Mobile variant (mobile)", false),
|
||||||
invalidText: text(
|
invalidText: text(
|
||||||
"Form validation UI content (invalidText)",
|
"Form validation UI content (invalidText)",
|
||||||
|
|
|
@ -198,13 +198,6 @@
|
||||||
<slot name="label">{label}</slot>
|
<slot name="label">{label}</slot>
|
||||||
</label>
|
</label>
|
||||||
{/if}
|
{/if}
|
||||||
{#if helperText}
|
|
||||||
<div
|
|
||||||
class:bx--form__helper-text="{true}"
|
|
||||||
class:bx--form__helper-text--disabled="{disabled}">
|
|
||||||
{helperText}
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
<div class:bx--number__input-wrapper="{true}">
|
<div class:bx--number__input-wrapper="{true}">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
|
@ -262,13 +255,6 @@
|
||||||
<slot name="label">{label}</slot>
|
<slot name="label">{label}</slot>
|
||||||
</label>
|
</label>
|
||||||
{/if}
|
{/if}
|
||||||
{#if helperText}
|
|
||||||
<div
|
|
||||||
class:bx--form__helper-text="{true}"
|
|
||||||
class:bx--form__helper-text--disabled="{disabled}">
|
|
||||||
{helperText}
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
<div class:bx--number__input-wrapper="{true}">
|
<div class:bx--number__input-wrapper="{true}">
|
||||||
<input
|
<input
|
||||||
bind:this="{ref}"
|
bind:this="{ref}"
|
||||||
|
@ -324,6 +310,13 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if !error && helperText}
|
||||||
|
<div
|
||||||
|
class:bx--form__helper-text="{true}"
|
||||||
|
class:bx--form__helper-text--disabled="{disabled}">
|
||||||
|
{helperText}
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
{#if error}
|
{#if error}
|
||||||
<div id="{errorId}" class:bx--form-requirement="{true}">
|
<div id="{errorId}" class:bx--form-requirement="{true}">
|
||||||
{invalidText}
|
{invalidText}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue