From 0ffb2d5bc6c2e82cd587c9659a4462f49b5a1c6c Mon Sep 17 00:00:00 2001 From: reverend Date: Sat, 1 Aug 2020 00:09:34 +0200 Subject: [PATCH] Moved cases to variants --- components/01_Atoms/input/input.config.json | 27 +++++++++++++++-- components/01_Atoms/input/input.hbs | 33 +++++---------------- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/components/01_Atoms/input/input.config.json b/components/01_Atoms/input/input.config.json index 3c65575..71bf134 100644 --- a/components/01_Atoms/input/input.config.json +++ b/components/01_Atoms/input/input.config.json @@ -1,7 +1,28 @@ { "context": { "label": "Enter your value here", - "placeholder": "A sample value", - "message": "Please fill in anything valuable" - } + "placeholder": "A sample value" + }, + "variants": [ + { + "name": "With message", + "context":{ + "message": "Please fill in anything valuable" + } + }, + { + "name": "disabled", + "context": { + "modifier": "--disabled", + "disabled": true + } + }, + { + "name": "error", + "context": { + "modifier": "--error", + "message": "This field is required" + } + } + ] } \ No newline at end of file diff --git a/components/01_Atoms/input/input.hbs b/components/01_Atoms/input/input.hbs index bdc6523..6ca9f97 100644 --- a/components/01_Atoms/input/input.hbs +++ b/components/01_Atoms/input/input.hbs @@ -1,28 +1,11 @@ -

Regular with message

-
+
- - {{message}} -
-

Regular without message

-
- - -
-

Regular without placeholder

-
- - - {{message}} -
-

Disabled

-
- - -
-

Error

-
- - + + {{#if message}} {{message}} + {{/if}}
\ No newline at end of file