diff --git a/addon/components/pix-input.hbs b/addon/components/pix-input.hbs index d2de0ec27..741d36179 100644 --- a/addon/components/pix-input.hbs +++ b/addon/components/pix-input.hbs @@ -1,14 +1,16 @@
- - {{yield to="label"}} - + {{#if (has-block "label")}} + + {{yield to="label"}} + + {{/if}}
+## Without label + + + ## Usage ```html diff --git a/app/stories/pix-input.stories.js b/app/stories/pix-input.stories.js index d326a79b5..99c7fff06 100644 --- a/app/stories/pix-input.stories.js +++ b/app/stories/pix-input.stories.js @@ -102,6 +102,24 @@ const Template = (args) => { }; }; +const TemplateWithoutLabel = (args) => { + return { + template: hbs``, + context: args, + }; +}; + export const Default = Template.bind({}); Default.args = { id: 'first-name', @@ -150,3 +168,8 @@ withRequiredLabel.args = { label: 'Prénom', requiredLabel: 'Champ obligatoire', }; + +export const withoutLabel = TemplateWithoutLabel.bind({}); +withoutLabel.args = { + id: 'first-name', +};