From cf1e5aa429b2ed863288c85e705dccaccf1a1fda Mon Sep 17 00:00:00 2001 From: dharini Date: Tue, 4 Jan 2022 15:12:19 -0800 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20helper=20text=20su?= =?UTF-8?q?pport=20to=20inp=20&=20textarea?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../addon/components/rose/form/helper-text/index.hbs | 2 +- .../rose/form/helper-text/index.stories.mdx | 6 +++--- .../rose/addon/components/rose/form/input/index.hbs | 2 +- .../components/rose/form/input/index.stories.mdx | 12 ++++++++++++ .../addon/components/rose/form/textarea/index.hbs | 2 +- .../components/rose/form/textarea/index.stories.mdx | 6 ++++++ addons/rose/jsconfig.json | 1 + 7 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 addons/rose/jsconfig.json diff --git a/addons/rose/addon/components/rose/form/helper-text/index.hbs b/addons/rose/addon/components/rose/form/helper-text/index.hbs index 92e716a2b..4dadb4d55 100644 --- a/addons/rose/addon/components/rose/form/helper-text/index.hbs +++ b/addons/rose/addon/components/rose/form/helper-text/index.hbs @@ -4,5 +4,5 @@ ...attributes > {{yield}} -{{@linkTxt}} +{{@linkText}} diff --git a/addons/rose/addon/components/rose/form/helper-text/index.stories.mdx b/addons/rose/addon/components/rose/form/helper-text/index.stories.mdx index 48a2070bb..19d8e4fac 100644 --- a/addons/rose/addon/components/rose/form/helper-text/index.stories.mdx +++ b/addons/rose/addon/components/rose/form/helper-text/index.stories.mdx @@ -11,7 +11,7 @@ Displays helpful messages related to a form field. This component is used by form fields and should not be used directly. ```html - + Helper text ``` @@ -19,14 +19,14 @@ by form fields and should not be used directly. {{ template: hbs` - + Helper text `, context: { error: boolean('error', false), link: text('link', 'http://www.example.net/'), - linkTxt: text('linkTxt', 'link text') + linkText: text('linkText', 'link text') }, }} diff --git a/addons/rose/addon/components/rose/form/input/index.hbs b/addons/rose/addon/components/rose/form/input/index.hbs index 889ca0639..524523bbb 100644 --- a/addons/rose/addon/components/rose/form/input/index.hbs +++ b/addons/rose/addon/components/rose/form/input/index.hbs @@ -29,7 +29,7 @@ {{#if @helperText}} - + {{@helperText}} {{/if}} diff --git a/addons/rose/addon/components/rose/form/input/index.stories.mdx b/addons/rose/addon/components/rose/form/input/index.stories.mdx index a0b6080f2..2eaeb2f99 100644 --- a/addons/rose/addon/components/rose/form/input/index.stories.mdx +++ b/addons/rose/addon/components/rose/form/input/index.stories.mdx @@ -16,6 +16,8 @@ Renders a simple form input. @value="info@example.com" @label="Email" @helperText="Enter your email" + @link='www.example.net' + @linkText='sample link text' @error={{false}} @disabled={{false}} @icon='flight-icons/svg/search-16' @@ -33,6 +35,8 @@ Or a fully contextual component without a wrapper, for maximum flexibility. @value="info@example.com" @label="Email" @helperText="Enter your email" + @link='www.example.net' + @linkText='sample link text' @error={{false}} @disabled={{false}} readonly={{false}} @@ -50,6 +54,8 @@ Or a fully contextual component without a wrapper, for maximum flexibility. @value={{value}} @label={{label}} @helperText={{helperText}} + @link={{link}} + @linkText={{linkText}} @error={{false}} @disabled={{disabled}} readonly={{read-only}} @@ -70,6 +76,8 @@ Or a fully contextual component without a wrapper, for maximum flexibility. value: text('value', 'Value'), label: text('label', 'Label'), helperText: text('helperText', 'Helper text'), + link: text('link', 'link goes here'), + linkText: text('linkText', 'link text'), disabled: boolean('disabled', false), 'read-only': boolean('readonly', false), icon: select( @@ -93,6 +101,8 @@ Or a fully contextual component without a wrapper, for maximum flexibility. @value={{value}} @label={{label}} @helperText={{helperText}} + @link={{link}} + @linkText={{linkText}} @error={{true}} @disabled={{disabled}} readonly={{read-only}} @@ -117,6 +127,8 @@ Or a fully contextual component without a wrapper, for maximum flexibility. value: text('value', 'Value'), label: text('label', 'Label'), helperText: text('helperText', 'Helper text'), + link: text('link', 'link goes here'), + linkText: text('linkText', 'link text'), disabled: boolean('disabled', false), 'read-only': boolean('readonly', false), } diff --git a/addons/rose/addon/components/rose/form/textarea/index.hbs b/addons/rose/addon/components/rose/form/textarea/index.hbs index 8bc67af1a..1ab92ac9d 100644 --- a/addons/rose/addon/components/rose/form/textarea/index.hbs +++ b/addons/rose/addon/components/rose/form/textarea/index.hbs @@ -28,7 +28,7 @@ {{#if @helperText}} - + {{@helperText}} {{/if}} diff --git a/addons/rose/addon/components/rose/form/textarea/index.stories.mdx b/addons/rose/addon/components/rose/form/textarea/index.stories.mdx index 5851d4b12..efb4dbacb 100644 --- a/addons/rose/addon/components/rose/form/textarea/index.stories.mdx +++ b/addons/rose/addon/components/rose/form/textarea/index.stories.mdx @@ -18,6 +18,8 @@ Renders a simple form textarea. @error={{false}} @disabled={{false}} readonly={{false}} + @link='www.example.net' + @linkText='link text goes here' /> ``` @@ -32,12 +34,16 @@ Renders a simple form textarea. @error={{false}} @disabled={{disabled}} readonly={{read-only}} + @link='www.example.net' + @linkText='link text goes here' /> `, context: { value: text('value', 'Value'), label: text('label', 'Label'), helperText: text('helperText', 'Helper text'), + link: text('link', 'link'), + linkText: text('linkText', 'link text goes here'), disabled: boolean('disabled', false), 'read-only': boolean('readonly', false), } diff --git a/addons/rose/jsconfig.json b/addons/rose/jsconfig.json new file mode 100644 index 000000000..f408cac8c --- /dev/null +++ b/addons/rose/jsconfig.json @@ -0,0 +1 @@ +{"compilerOptions":{"target":"es6","experimentalDecorators":true},"exclude":["node_modules","bower_components","tmp","vendor",".git","dist"]} \ No newline at end of file