Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
xav-car committed Dec 12, 2023
1 parent e589fe6 commit 217e6d6
Show file tree
Hide file tree
Showing 35 changed files with 574 additions and 615 deletions.
1 change: 1 addition & 0 deletions .template-lintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ module.exports = {
allowDynamicStyles: true,
},
},
ignore: ['blueprints/**'],
};
1 change: 0 additions & 1 deletion addon/components/pix-input-code.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{! template-lint-disable no-down-event-binding }}
<div class="pix-input-code">
<fieldset aria-describedby="pix-input-code__details-of-use">
<p id="pix-input-code__details-of-use">{{this.explanationOfUse}}</p>
Expand Down
2 changes: 0 additions & 2 deletions addon/components/pix-search-input.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@

<div class="pix-search-input__input-container">
<FaIcon @icon="magnifying-glass" />
{{! template-lint-disable require-input-label }}
<input
id={{this.searchInputId}}
class="pix-search-input__input"
role="searchbox"
name={{@inputName}}
placeholder={{@placeholder}}
aria-label={{this.ariaLabel}}
Expand Down
9 changes: 4 additions & 5 deletions addon/components/pix-select.hbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{! template-lint-disable no-down-event-binding require-context-role require-presentational-children }}
<div
class="pix-select"
id="container-{{this.selectId}}"
Expand Down Expand Up @@ -89,8 +88,6 @@
aria-labelledby={{if this.displayCategory (concat "cat-" this.selectId "-" index)}}
>
{{#if this.displayCategory}}
{{! template-lint-disable no-invalid-role }}
{{!https://www.w3.org/WAI/ARIA/apg/example-index/listbox/listbox-grouped.html}}
<li
class="pix-select-options-category__name"
role="presentation"
Expand All @@ -101,6 +98,8 @@
{{/if}}

{{#each element.options as |option|}}
{{! template-lint-disable require-context-role }}
{{!https://www.w3.org/WAI/ARIA/apg/example-index/listbox/listbox-grouped.html}}
<li
class="pix-select-options-category__option{{if
(eq option.value @value)
Expand All @@ -116,7 +115,7 @@
{{option.label}}

{{#if (eq option.value @value)}}
<FaIcon @icon="check" />
<FaIcon @icon="check" role="presentation" />
{{/if}}
</li>
{{/each}}
Expand All @@ -139,7 +138,7 @@
{{option.label}}

{{#if (eq option.value @value)}}
<FaIcon @icon="check" />
<FaIcon @icon="check" role="presentation" />
{{/if}}
</li>
{{/each}}
Expand Down
12 changes: 7 additions & 5 deletions app/stories/form.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ export const form = (args) => {
@validationStatus={{this.validationStatus}}
/>
<br />
<PixInputPassword @id='password' @label='Mot de passe' @errorMessage={{this.genericErrorMessage}} />
<PixInputPassword
@id='password'
@label='Mot de passe'
@errorMessage={{this.genericErrorMessage}}
/>
<br />
<PixMultiSelect
Expand Down Expand Up @@ -45,6 +49,7 @@ export const form = (args) => {
{{condiment.label}}
</PixMultiSelect>
<br /><br />
{{! template-lint-disable no-inline-styles }}
<PixSelect
@id='form__searchable-pix-select'
Expand Down Expand Up @@ -72,10 +77,7 @@ export const form = (args) => {
<PixRadioButton @label='Carotte' @value='carotte' name='légume' />
<br />
<PixCheckbox
@id='spam-pub'
@labelSize='small'
>
<PixCheckbox @id='spam-pub' @labelSize='small'>
Acceptez-vous de vous faire spammer de PUB ?
</PixCheckbox>
Expand Down
2 changes: 2 additions & 0 deletions app/stories/pix-background-header.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ export default {
export const backgroundHeader = (args) => {
return {
template: hbs`<PixBackgroundHeader>
{{! template-lint-disable no-inline-styles }}
<PixBlock style='margin: 0 0 32px; padding: 14px 24px;'>Un panel avec du text</PixBlock>
{{! template-lint-disable no-inline-styles }}
<PixBlock style='padding: 14px 24px;'>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis a interdum mauris. Morbi ac diam
Expand Down
4 changes: 2 additions & 2 deletions app/stories/pix-button.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export default {
const Template = (args) => ({
template: hbs`<section style={{this.style}}>
<PixButton
@triggerAction={{action this.triggerAction}}
@triggerAction={{this.triggerAction}}
@loadingColor={{this.loadingColor}}
@shape={{this.shape}}
@backgroundColor={{this.backgroundColor}}
Expand All @@ -182,7 +182,7 @@ const Template = (args) => ({
{{#each this.extraButtons as |button|}}
<section style={{button.style}}>
<PixButton
@triggerAction={{action this.triggerAction}}
@triggerAction={{this.triggerAction}}
@loadingColor={{button.loadingColor}}
@shape={{button.shape}}
@backgroundColor={{button.backgroundColor}}
Expand Down
16 changes: 6 additions & 10 deletions app/stories/pix-checkbox.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ export default {

export const Template = (args) => {
return {
template: hbs`
<PixCheckbox
template: hbs`<PixCheckbox
@id={{this.id}}
@class={{this.class}}
@screenReaderOnly={{this.screenReaderOnly}}
Expand All @@ -82,8 +81,7 @@ export const Template = (args) => {
disabled={{this.disabled}}
>
{{this.label}}
</PixCheckbox>
`,
</PixCheckbox>`,
context: args,
};
};
Expand Down Expand Up @@ -142,9 +140,8 @@ checkboxInterminateDisabled.args = {

export const MultipleTemplate = (args) => {
return {
template: hbs`
<PixCheckbox
@id="one"
template: hbs`<PixCheckbox
@id='one'
@class={{this.class}}
@screenReaderOnly={{this.screenReaderOnly}}
@isIndeterminate={{this.isIndeterminate}}
Expand All @@ -155,7 +152,7 @@ export const MultipleTemplate = (args) => {
{{this.label}}
</PixCheckbox>
<PixCheckbox
@id="two"
@id='two'
@class={{this.class}}
@screenReaderOnly={{this.screenReaderOnly}}
@isIndeterminate={{this.isIndeterminate}}
Expand All @@ -164,8 +161,7 @@ export const MultipleTemplate = (args) => {
disabled={{this.disabled}}
>
{{this.label}}
</PixCheckbox>
`,
</PixCheckbox>`,
context: args,
};
};
Expand Down
24 changes: 21 additions & 3 deletions app/stories/pix-filter-banner.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,27 @@ export const filterBanner = (args) => {
@onClearFilters={{this.onClearFilters}}
@isClearFilterButtonDisabled={{this.isClearFilterButtonDisabled}}
>
<PixSelect @options={{this.options}} @onChange={{this.onChange}} @label="mon label" @screenReaderOnly={{true}} @placeholder="placeholer"/>
<PixSelect @options={{this.options}} @onChange={{this.onChange}} @label="mon label" @screenReaderOnly={{true}} @placeholder="placeholer"/>
<PixSelect @options={{this.options}} @onChange={{this.onChange}} @label="mon label" @screenReaderOnly={{true}} @placeholder="placeholer"/>
<PixSelect
@options={{this.options}}
@onChange={{this.onChange}}
@label='mon label'
@screenReaderOnly={{true}}
@placeholder='placeholer'
/>
<PixSelect
@options={{this.options}}
@onChange={{this.onChange}}
@label='mon label'
@screenReaderOnly={{true}}
@placeholder='placeholer'
/>
<PixSelect
@options={{this.options}}
@onChange={{this.onChange}}
@label='mon label'
@screenReaderOnly={{true}}
@placeholder='placeholer'
/>
</PixFilterBanner>`,
context: args,
};
Expand Down
32 changes: 15 additions & 17 deletions app/stories/pix-filterable-and-searchable-select.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,23 +139,21 @@ export default {

const Template = (args) => {
return {
template: hbs`
<PixFilterableAndSearchableSelect
@label={{this.label}}
@subLabel={{this.subLabel}}
@screenReaderOnly={{this.screenReaderOnly}}
@placeholder={{this.placeholder}}
@hideDefaultOption={{this.hideDefaultOption}}
@options={{this.options}}
@onChange={{this.onChange}}
@categoriesLabel={{this.categoriesLabel}}
@categoriesPlaceholder={{this.categoriesPlaceholder}}
@isSearchable={{this.isSearchable}}
@value={{this.value}}
@requiredText={{this.requiredText}}
@errorMessage={{this.errorMessage}}
/>
`,
template: hbs`<PixFilterableAndSearchableSelect
@label={{this.label}}
@subLabel={{this.subLabel}}
@screenReaderOnly={{this.screenReaderOnly}}
@placeholder={{this.placeholder}}
@hideDefaultOption={{this.hideDefaultOption}}
@options={{this.options}}
@onChange={{this.onChange}}
@categoriesLabel={{this.categoriesLabel}}
@categoriesPlaceholder={{this.categoriesPlaceholder}}
@isSearchable={{this.isSearchable}}
@value={{this.value}}
@requiredText={{this.requiredText}}
@errorMessage={{this.errorMessage}}
/>`,
context: args,
};
};
Expand Down
34 changes: 17 additions & 17 deletions app/stories/pix-indicator-card.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,23 @@ export default {

const Template = (args) => {
return {
template: hbs`
<div style="min-width:300px">
<PixIndicatorCard
@title={{this.title}}
@color={{this.color}}
@icon={{this.icon}}
@iconPrefix={{this.iconPrefix}}
@info={{this.info}}
@isLoading={{this.isLoading}}
@loadingMessage={{this.loadingMessage}}
>
<:default>{{this.value}}</:default>
<:sub>
<span>En cours : 1</span><span>En attente : 2</span><span>Envoyés : 3</span>
</:sub>
</PixIndicatorCard>
</div>`,
template: hbs`{{! template-lint-disable no-inline-styles }}
<div style='min-width:300px'>
<PixIndicatorCard
@title={{this.title}}
@color={{this.color}}
@icon={{this.icon}}
@iconPrefix={{this.iconPrefix}}
@info={{this.info}}
@isLoading={{this.isLoading}}
@loadingMessage={{this.loadingMessage}}
>
<:default>{{this.value}}</:default>
<:sub>
<span>En cours : 1</span><span>En attente : 2</span><span>Envoyés : 3</span>
</:sub>
</PixIndicatorCard>
</div>`,
context: args,
};
};
Expand Down
14 changes: 12 additions & 2 deletions app/stories/pix-modal.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,22 @@ export default {
</p>
</:content>
<:footer>
<div style="display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 16px">
<PixButton @backgroundColor='transparent-light' @isBorderVisible='true' @triggerAction={{fn (mut this.showModal) (not this.showModal)}}>Annuler</PixButton>
{{! template-lint-disable no-inline-styles }}
<div
style='display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 16px'
>
<PixButton
@backgroundColor='transparent-light'
@isBorderVisible='true'
@triggerAction={{fn (mut this.showModal) (not this.showModal)}}
>Annuler</PixButton>
<PixButton @triggerAction={{fn (mut this.showModal) (not this.showModal)}}>Valider</PixButton>
</div>
</:footer>
</PixModal>
{{! template-lint-disable no-inline-styles }}
<div style='display:flex; justify-content:center; align-items:center; height:105vh;'>
<PixButton @triggerAction={{fn (mut this.showModal) (not this.showModal)}}>Ouvrir la modale</PixButton>
</div>`,
Expand Down
Loading

0 comments on commit 217e6d6

Please sign in to comment.