@1024pix/pix-ui 58.4.2 → 58.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/addon/components/pix-accordions.gjs +81 -0
  2. package/addon/components/pix-app-layout.gjs +1 -1
  3. package/addon/components/pix-background-header.gjs +15 -0
  4. package/addon/components/{pix-banner-alert.js → pix-banner-alert.gjs} +49 -0
  5. package/addon/components/{pix-block.js → pix-block.gjs} +18 -0
  6. package/addon/components/pix-breadcrumb.gjs +40 -0
  7. package/addon/components/pix-button/pix-button-content.gjs +21 -0
  8. package/addon/components/pix-button-link.gjs +49 -0
  9. package/addon/components/{pix-button-upload.js → pix-button-upload.gjs} +15 -0
  10. package/addon/components/{pix-button.js → pix-button.gjs} +30 -0
  11. package/addon/components/{pix-checkbox.js → pix-checkbox.gjs} +42 -1
  12. package/addon/components/pix-code.gjs +59 -0
  13. package/addon/components/{pix-filterable-and-searchable-select.js → pix-filterable-and-searchable-select.gjs} +55 -0
  14. package/addon/components/pix-gauge.gjs +199 -0
  15. package/addon/components/{pix-icon-button.js → pix-icon-button.gjs} +21 -0
  16. package/addon/components/{pix-icon.js → pix-icon.gjs} +19 -0
  17. package/addon/components/pix-indicator-card.gjs +68 -0
  18. package/addon/components/{pix-input-code.js → pix-input-code.gjs} +29 -0
  19. package/addon/components/pix-input-password.gjs +102 -0
  20. package/addon/components/pix-input.gjs +57 -0
  21. package/addon/components/pix-label-wrapped.gjs +64 -0
  22. package/addon/components/pix-modal.gjs +55 -0
  23. package/addon/components/pix-navigation-separator.gjs +1 -0
  24. package/addon/components/{pix-navigation.js → pix-navigation.gjs} +49 -0
  25. package/addon/components/{pix-notification-alert.js → pix-notification-alert.gjs} +19 -0
  26. package/addon/components/pix-overlay.gjs +31 -0
  27. package/addon/components/{pix-pagination.js → pix-pagination.gjs} +58 -0
  28. package/addon/components/{pix-progress-bar.js → pix-progress-bar.gjs} +22 -0
  29. package/addon/components/{pix-radio-button.js → pix-radio-button.gjs} +42 -0
  30. package/addon/components/{pix-search-input.js → pix-search-input.gjs} +31 -0
  31. package/addon/components/pix-select-list.gjs +166 -0
  32. package/addon/components/pix-selectable-tag.gjs +23 -0
  33. package/addon/components/pix-sidebar.gjs +49 -0
  34. package/addon/components/pix-stars.gjs +34 -0
  35. package/addon/components/pix-structure-switcher.gjs +107 -0
  36. package/addon/components/{pix-table-column.js → pix-table-column.gjs} +33 -0
  37. package/addon/components/{pix-tabs.js → pix-tabs.gjs} +6 -0
  38. package/addon/components/pix-textarea.gjs +68 -0
  39. package/addon/components/pix-toast-container.gjs +16 -0
  40. package/addon/components/{pix-toast.js → pix-toast.gjs} +25 -0
  41. package/addon/components/pix-tooltip.gjs +82 -0
  42. package/addon/components/{toast-example.js → toast-example.gjs} +13 -0
  43. package/package.json +1 -1
  44. package/addon/components/pix-accordions.hbs +0 -48
  45. package/addon/components/pix-accordions.js +0 -26
  46. package/addon/components/pix-background-header.hbs +0 -7
  47. package/addon/components/pix-background-header.js +0 -5
  48. package/addon/components/pix-banner-alert.hbs +0 -38
  49. package/addon/components/pix-block.hbs +0 -8
  50. package/addon/components/pix-breadcrumb.hbs +0 -21
  51. package/addon/components/pix-breadcrumb.js +0 -12
  52. package/addon/components/pix-button/pix-button-content.hbs +0 -17
  53. package/addon/components/pix-button-link.hbs +0 -32
  54. package/addon/components/pix-button-link.js +0 -10
  55. package/addon/components/pix-button-upload.hbs +0 -11
  56. package/addon/components/pix-button.hbs +0 -25
  57. package/addon/components/pix-checkbox.hbs +0 -37
  58. package/addon/components/pix-code.hbs +0 -31
  59. package/addon/components/pix-code.js +0 -24
  60. package/addon/components/pix-filterable-and-searchable-select.hbs +0 -48
  61. package/addon/components/pix-gauge.hbs +0 -98
  62. package/addon/components/pix-gauge.js +0 -96
  63. package/addon/components/pix-icon-button.hbs +0 -15
  64. package/addon/components/pix-icon.hbs +0 -15
  65. package/addon/components/pix-indicator-card.hbs +0 -47
  66. package/addon/components/pix-indicator-card.js +0 -14
  67. package/addon/components/pix-input-code.hbs +0 -24
  68. package/addon/components/pix-input-password.hbs +0 -68
  69. package/addon/components/pix-input-password.js +0 -28
  70. package/addon/components/pix-input.hbs +0 -38
  71. package/addon/components/pix-input.js +0 -14
  72. package/addon/components/pix-label-wrapped.hbs +0 -32
  73. package/addon/components/pix-label-wrapped.js +0 -27
  74. package/addon/components/pix-modal.hbs +0 -33
  75. package/addon/components/pix-modal.js +0 -16
  76. package/addon/components/pix-navigation-separator.hbs +0 -1
  77. package/addon/components/pix-navigation.hbs +0 -43
  78. package/addon/components/pix-notification-alert.hbs +0 -13
  79. package/addon/components/pix-overlay.hbs +0 -11
  80. package/addon/components/pix-overlay.js +0 -13
  81. package/addon/components/pix-pagination.hbs +0 -52
  82. package/addon/components/pix-progress-bar.hbs +0 -19
  83. package/addon/components/pix-radio-button.hbs +0 -37
  84. package/addon/components/pix-search-input.hbs +0 -25
  85. package/addon/components/pix-select-list.hbs +0 -115
  86. package/addon/components/pix-select-list.js +0 -41
  87. package/addon/components/pix-selectable-tag.hbs +0 -10
  88. package/addon/components/pix-selectable-tag.js +0 -9
  89. package/addon/components/pix-sidebar.hbs +0 -28
  90. package/addon/components/pix-sidebar.js +0 -16
  91. package/addon/components/pix-stars.hbs +0 -17
  92. package/addon/components/pix-stars.js +0 -13
  93. package/addon/components/pix-structure-switcher.hbs +0 -41
  94. package/addon/components/pix-structure-switcher.js +0 -54
  95. package/addon/components/pix-table-column.hbs +0 -28
  96. package/addon/components/pix-tabs.hbs +0 -3
  97. package/addon/components/pix-textarea.hbs +0 -36
  98. package/addon/components/pix-textarea.js +0 -23
  99. package/addon/components/pix-toast-container.hbs +0 -5
  100. package/addon/components/pix-toast-container.js +0 -6
  101. package/addon/components/pix-toast.hbs +0 -17
  102. package/addon/components/pix-tooltip.hbs +0 -30
  103. package/addon/components/pix-tooltip.js +0 -46
  104. package/addon/components/toast-example.hbs +0 -7
  105. /package/addon/components/{pix-button-base.js → pix-button-base.gjs} +0 -0
  106. /package/addon/components/{pix-input-base.js → pix-input-base.gjs} +0 -0
@@ -1,25 +0,0 @@
1
- <button
2
- type={{this.type}}
3
- class={{this.className}}
4
- {{on "click" this.triggerAction}}
5
- aria-disabled="{{this.isDisabled}}"
6
- ...attributes
7
- >
8
- {{#if this.isLoading}}
9
- <div class="loader loader--{{this.loadingColor}}">
10
- <div class="bounce1"></div>
11
- <div class="bounce2"></div>
12
- <div class="bounce3"></div>
13
- </div>
14
- <span class="loader__not-visible-text">{{yield}}</span>
15
- {{else}}
16
- <PixButtonContent
17
- @iconBefore={{@iconBefore}}
18
- @iconAfter={{@iconAfter}}
19
- @plainIconAfter={{@plainIconAfter}}
20
- @plainIconBefore={{@plainIconBefore}}
21
- >
22
- {{yield}}
23
- </PixButtonContent>
24
- {{/if}}
25
- </button>
@@ -1,37 +0,0 @@
1
- <div class="pix-checkbox {{@class}}">
2
- <PixLabelWrapped
3
- @for={{this.id}}
4
- @requiredLabel={{@requiredLabel}}
5
- @subLabel={{@subLabel}}
6
- @size={{@size}}
7
- @inlineLabel={{true}}
8
- @screenReaderOnly={{@screenReaderOnly}}
9
- @isDisabled={{this.isDisabled}}
10
- @variant={{@variant}}
11
- @state={{@state}}
12
- >
13
- <:inputElement>
14
- <input
15
- type="checkbox"
16
- id={{this.id}}
17
- class={{this.inputClasses}}
18
- checked={{@checked}}
19
- aria-disabled={{this.isDisabled}}
20
- aria-describedby={{this.stateId}}
21
- {{on "click" this.avoidCheckedStateChangeIfIsDisabled}}
22
- ...attributes
23
- />
24
- </:inputElement>
25
- <:default>
26
- {{yield to="label"}}
27
- </:default>
28
- </PixLabelWrapped>
29
-
30
- <span class="screen-reader-only" id={{this.stateId}}>
31
- {{#if this.hasSuccessState}}
32
- {{this.stateSuccessMessage}}
33
- {{else if this.hasErrorState}}
34
- {{this.stateErrorMessage}}
35
- {{/if}}
36
- </span>
37
- </div>
@@ -1,31 +0,0 @@
1
- <div>
2
- {{#if (has-block "label")}}
3
- <PixLabel
4
- @for={{this.id}}
5
- @requiredLabel={{@requiredLabel}}
6
- @subLabel={{@subLabel}}
7
- @size={{@size}}
8
- @screenReaderOnly={{@screenReaderOnly}}
9
- >
10
- {{yield to="label"}}
11
- </PixLabel>
12
- {{/if}}
13
- <div>
14
- <input
15
- id={{this.id}}
16
- class="pix-code"
17
- style={{this.style}}
18
- value={{@value}}
19
- aria-required="{{if @requiredLabel true false}}"
20
- required={{if @requiredLabel true false}}
21
- maxlength={{this.length}}
22
- minlength={{this.length}}
23
- aria-describedby={{this.ariaDescribedBy}}
24
- ...attributes
25
- />
26
-
27
- {{#if this.hasErrorMessage}}
28
- <p id={{this.ariaDescribedBy}} class="pix-code__error-message">{{@errorMessage}}</p>
29
- {{/if}}
30
- </div>
31
- </div>
@@ -1,24 +0,0 @@
1
- import { warn } from '@ember/debug';
2
- import { htmlSafe } from '@ember/template';
3
-
4
- import PixInputBase from './pix-input-base';
5
-
6
- export default class PixCode extends PixInputBase {
7
- constructor() {
8
- super(...arguments);
9
-
10
- this.prefix = 'pix-code';
11
- }
12
-
13
- get length() {
14
- warn('PixCode: @length is required.', !['', null, undefined].includes(this.args.length), {
15
- id: 'pix-ui.code.length.required',
16
- });
17
-
18
- return this.args.length || 1;
19
- }
20
-
21
- get style() {
22
- return htmlSafe('--nb-characters:' + this.length);
23
- }
24
- }
@@ -1,48 +0,0 @@
1
- <div id={{this.mainId}} ...attributes>
2
- <PixLabel
3
- @for={{this.pixSelectId}}
4
- @requiredLabel={{@requiredLabel}}
5
- @size={{@size}}
6
- @subLabel={{@subLabel}}
7
- @screenReaderOnly={{@screenReaderOnly}}
8
- @inlineLabel={{@inlineLabel}}
9
- >
10
- {{yield to="label"}}
11
- </PixLabel>
12
- <div
13
- class="pix-filterable-and-searchable-select{{if
14
- @errorMessage
15
- ' pix-filterable-and-searchable-select--error'
16
- }}"
17
- >
18
- <PixMultiSelect
19
- id={{this.pixMultiSelectId}}
20
- @values={{this.selectedCategories}}
21
- @options={{this.categories}}
22
- @onChange={{this.selectCategories}}
23
- @isComputeWidthDisabled={{true}}
24
- @screenReaderOnly={{true}}
25
- @className="pix-filterable-and-searchable-select__pix-multi-select"
26
- >
27
- <:label>{{yield to="categoriesLabel"}}</:label>
28
- <:placeholder>{{this.categoriesPlaceholder}}</:placeholder>
29
- <:default as |option|>{{option.label}}</:default>
30
- </PixMultiSelect>
31
- <PixSelect
32
- @id={{this.pixSelectId}}
33
- @placeholder={{@placeholder}}
34
- @value={{@value}}
35
- @options={{this.selectableOptions}}
36
- @onChange={{@onChange}}
37
- @isSearchable={{@isSearchable}}
38
- @searchLabel={{@searchLabel}}
39
- @screenReaderOnly={{true}}
40
- @hideDefaultOption={{@hideDefaultOption}}
41
- @className="pix-filterable-and-searchable-select__pix-select"
42
- @isComputeWidthDisabled={{true}}
43
- />
44
- </div>
45
- {{#if @errorMessage}}
46
- <p class="pix-filterable-and-searchable-select__error-message">{{@errorMessage}}</p>
47
- {{/if}}
48
- </div>
@@ -1,98 +0,0 @@
1
- <svg
2
- xmlns:svg="http://www.w3.org/2000/svg"
3
- xmlns="http://www.w3.org/2000/svg"
4
- viewBox={{this.viewBox}}
5
- version="1.1"
6
- preserveAspectRatio="none"
7
- class="result-level-gauge {{if @isSmall 'result-level-gauge__small'}}"
8
- role="progressbar"
9
- aria-valuenow={{this.formatNumber this.reachedLevel}}
10
- aria-valuemin={{0}}
11
- aria-valuemax={{this.formatNumber this.maxLevel}}
12
- aria-valuetext={{this.label}}
13
- aria-label={{this.label}}
14
- >
15
- <title {{this.label}}></title>
16
-
17
- {{! gauge grey background}}
18
- <rect
19
- y={{22}}
20
- width="100%"
21
- height={{this.backgroundHeight}}
22
- rx={{this.greyGaugeRx}}
23
- class="result-level-gauge__background"
24
- />
25
-
26
- <g transform="translate(4, 0)">
27
- {{! template-lint-disable no-inline-styles style-concatenation }}
28
- {{! gauge white max level}}
29
- <rect
30
- y={{26}}
31
- width="calc(calc(100% - 8px) * {{this.maxLevelPourcentage}})"
32
- height={{this.whiteAndPurpleGaugesHeight}}
33
- rx={{this.whiteAndPurpleGaugeRx}}
34
- class="result-level-gauge__max-bar"
35
- />
36
- {{#unless this.hideValues}}
37
- <g style="transform: translate(calc(calc(100% - 8px) * {{this.maxLevelPourcentage}}))">
38
- <text
39
- y={{this.statsFontHeight}}
40
- x="0"
41
- dx={{-10}}
42
- dy={{26}}
43
- class="result-level-gauge__max-value"
44
- aria-hidden={{this.hideValues}}
45
- >{{this.formatNumber @maxLevel}}</text>
46
- </g>
47
- {{/unless}}
48
- {{! mean purple level }}
49
- <rect
50
- y={{26}}
51
- width="max(calc(calc(100% - 8px) * {{this.reachedLevelPercentage}}), 44px)"
52
- height={{this.whiteAndPurpleGaugesHeight}}
53
- rx={{this.whiteAndPurpleGaugeRx}}
54
- class="result-level-gauge__mean-bar"
55
- />
56
- {{#unless this.hideValues}}
57
- <g
58
- style="transform: translate(max(calc(calc(100% - 8px) * {{this.reachedLevelPercentage}}), 44px))"
59
- >
60
- <text
61
- y={{this.statsFontHeight}}
62
- x="0"
63
- dx={{-10}}
64
- dy={{26}}
65
- class="result-level-gauge__mean-value"
66
- aria-hidden={{this.hideValues}}
67
- >{{this.formatNumber @reachedLevel}}</text>
68
- </g>
69
- {{/unless}}
70
- {{! level labels }}
71
- {{#unless @isSmall}}
72
- {{#each @stepLabels as |stepLabel index|}}
73
- <g style="transform: translate(calc(calc(100% - 8px) * {{this.stepLabelX index}}))">
74
- <text
75
- y={{15}}
76
- class="result-level-gauge__rank
77
- {{if (this.isLevelActive index) 'result-level-gauge__rank--active'}}"
78
- >{{stepLabel}}</text>
79
- </g>
80
- {{#unless (eq index 0)}}
81
- <g style="transform: translate(calc(100% * {{this.stepLineX index}}))">
82
- <line
83
- x1="0"
84
- y1={{7}}
85
- x2="0"
86
- y2="74.6641"
87
- stroke-width={{2}}
88
- stroke-linecap="round"
89
- stroke-dasharray="2 8"
90
- class="result-level-gauge__separator"
91
- role="separator"
92
- />
93
- </g>
94
- {{/unless}}
95
- {{/each}}
96
- {{/unless}}
97
- </g>
98
- </svg>
@@ -1,96 +0,0 @@
1
- import { warn } from '@ember/debug';
2
- import Component from '@glimmer/component';
3
- export default class PixGauge extends Component {
4
- get label() {
5
- warn('PixGauge: @label must be defined', !this.args.label, {
6
- id: 'pix-ui.gauge.label.not-defined',
7
- });
8
- return this.args.label;
9
- }
10
-
11
- get reachedLevel() {
12
- warn(
13
- 'PixGauge: @reachedLevel must be between 0 and 8',
14
- this.args.reachedLevel <= 8 || this.args.reachedLevel >= 0,
15
- {
16
- id: 'pix-ui.gauge.reachedLevel.not-defined',
17
- },
18
- );
19
- return this.args.reachedLevel;
20
- }
21
-
22
- get maxLevel() {
23
- warn(
24
- 'PixGauge: @maxLevel must be between 1 and 8',
25
- this.args.maxLevel <= 8 || this.args.maxLevel >= 1,
26
- {
27
- id: 'pix-ui.gauge.maxLevel.not-defined',
28
- },
29
- );
30
- return this.args.maxLevel;
31
- }
32
-
33
- get hideValues() {
34
- return this.args.hideValues ?? false;
35
- }
36
-
37
- get maxLevelPourcentage() {
38
- return this.maxLevel / 8;
39
- }
40
- get viewBox() {
41
- if (this.args.isSmall) {
42
- return '0 22 200 32';
43
- }
44
- return '0 0 100% 70';
45
- }
46
-
47
- get reachedLevelPercentage() {
48
- return this.reachedLevel / 8;
49
- }
50
-
51
- get whiteAndPurpleGaugeRx() {
52
- return this.args.isSmall ? 12 : 20;
53
- }
54
-
55
- get whiteAndPurpleGaugesHeight() {
56
- return this.args.isSmall ? 24 : 40;
57
- }
58
-
59
- // background
60
- get greyGaugeRx() {
61
- return this.args.isSmall ? 16 : 24;
62
- }
63
-
64
- get backgroundHeight() {
65
- return this.args.isSmall ? 32 : 48;
66
- }
67
-
68
- get statsFontHeight() {
69
- return this.args.isSmall ? 18 : 26;
70
- }
71
-
72
- isLevelActive = (index) => {
73
- if (this.reachedLevel === 0 && index === 0) return true;
74
- const step = 8 / this.args.stepLabels.length;
75
- return index * step < this.reachedLevel && this.reachedLevel <= (index + 1) * step;
76
- };
77
-
78
- stepLabelX = (index) => {
79
- const stepStart = 1 / this.args.stepLabels.length;
80
- return `${stepStart * index + (1 / 2) * stepStart}`;
81
- };
82
-
83
- stepLineX = (index) => {
84
- const stepStart = 1 / this.args.stepLabels.length;
85
- return `${stepStart * index}`;
86
- };
87
-
88
- formatNumber = (str) => {
89
- const num = Number(str);
90
- const oneDigitNum = num.toFixed(1);
91
- if (oneDigitNum.toString().endsWith('0')) {
92
- return Math.ceil(oneDigitNum);
93
- }
94
- return oneDigitNum;
95
- };
96
- }
@@ -1,15 +0,0 @@
1
- <button
2
- type="button"
3
- class="pix-icon-button pix-icon-button--{{this.size}}"
4
- {{on "click" this.triggerAction}}
5
- aria-disabled="{{this.isDisabled}}"
6
- ...attributes
7
- >
8
- <span class="screen-reader-only">{{this.ariaLabel}}</span>
9
- <PixIcon
10
- class="pix-icon-button__icon pix-icon-button__icon--{{this.size}}"
11
- @ariaHidden={{true}}
12
- @name={{@iconName}}
13
- @plainIcon={{@plainIcon}}
14
- />
15
- </button>
@@ -1,15 +0,0 @@
1
- {{#let (unique-id) as |titleId|}}
2
- <svg
3
- xmlns="http://www.w3.org/2000/svg"
4
- aria-hidden={{this.ariaHidden}}
5
- role="img"
6
- class="pix-icon"
7
- aria-describedby={{if this.title titleId}}
8
- ...attributes
9
- >
10
- {{#if this.title}}
11
- <title id={{titleId}}>{{this.title}}</title>
12
- {{/if}}
13
- <use href="/@1024pix/pix-ui/svg/pix-sprite.svg#{{this.iconName}}" />
14
- </svg>
15
- {{/let}}
@@ -1,47 +0,0 @@
1
- <PixBlock @variant="orga" class="indicator-card" role="region" ...attributes>
2
- {{#if @isLoading}}
3
- <p class="screen-reader-only">{{@loadingMessage}}</p>
4
- <div class="indicator-card__icon" aria-hidden="true"></div>
5
- <div class="indicator-card__content" aria-hidden="true"></div>
6
- {{else}}
7
- <div id={{this.iconId}} class="indicator-card__icon-wrapper {{this.color}}">
8
- <PixIcon
9
- @name={{@iconName}}
10
- @plainIcon={{@plainIcon}}
11
- @ariaHidden={{true}}
12
- class="indicator-card__icon"
13
- />
14
- </div>
15
- <dl class="indicator-card__content">
16
- <div class="indicator-card__title">
17
- <dt>{{@title}}</dt>
18
- {{#if @info}}
19
- <PixTooltip
20
- @id={{this.tooltipId}}
21
- @position="top"
22
- @isWide={{true}}
23
- class="indicator-card__tooltip hide-on-mobile"
24
- >
25
- <:triggerElement>
26
- <PixIcon
27
- @name="info"
28
- @plainIcon={{true}}
29
- class="indicator-card__tooltip-icon"
30
- tabindex="0"
31
- aria-label={{@infoLabel}}
32
- aria-describedby={{this.tooltipId}}
33
- />
34
- </:triggerElement>
35
- <:tooltip>
36
- {{@info}}
37
- </:tooltip>
38
- </PixTooltip>
39
- {{/if}}
40
- </div>
41
- <dd class="indicator-card__value">{{yield}}</dd>
42
- <p class="indicator-card__sub">
43
- {{yield to="sub"}}
44
- </p>
45
- </dl>
46
- {{/if}}
47
- </PixBlock>
@@ -1,14 +0,0 @@
1
- import { guidFor } from '@ember/object/internals';
2
- import Component from '@glimmer/component';
3
-
4
- export default class PixIndicatorCard extends Component {
5
- id = guidFor(this);
6
- iconId = 'icon-' + this.id;
7
- tooltipId = 'tooltip-' + this.id;
8
-
9
- get color() {
10
- const { color } = this.args;
11
- if (!color) return `indicator-card__icon-wrapper--grey`;
12
- return `indicator-card__icon-wrapper--${color}`;
13
- }
14
- }
@@ -1,24 +0,0 @@
1
- <div class="pix-input-code">
2
- <fieldset aria-describedby="pix-input-code__details-of-use">
3
- <p id="pix-input-code__details-of-use">{{this.explanationOfUse}}</p>
4
- <legend>{{this.legend}}</legend>
5
- {{#each this.numberOfIterations as |i|}}
6
- <input
7
- id="code-input-{{i}}"
8
- type="{{this.inputType}}"
9
- aria-label="{{this.ariaLabel}} {{i}}"
10
- class="pix-input-code__input"
11
- min="1"
12
- max="9"
13
- autocomplete="off"
14
- placeholder="{{this.placeholder}}"
15
- {{on "keydown" this.handleArrowUpOrDown}}
16
- {{on "keyup" (fn this.handleKeyUp i)}}
17
- {{on "input" (fn this.handleCodeInput i)}}
18
- {{on "paste" (fn this.handlePaste i)}}
19
- {{on "focus" (fn this.handleFocus i)}}
20
- ...attributes
21
- />
22
- {{/each}}
23
- </fieldset>
24
- </div>
@@ -1,68 +0,0 @@
1
- <div class="pix-input-password {{if @inlineLabel ' pix-input-password--inline'}}">
2
- <PixLabel
3
- @for={{this.id}}
4
- @requiredLabel={{@requiredLabel}}
5
- @size={{@size}}
6
- @subLabel={{@subLabel}}
7
- @screenReaderOnly={{@screenReaderOnly}}
8
- @inlineLabel={{@inlineLabel}}
9
- >
10
- {{yield to="label"}}
11
- </PixLabel>
12
- <div>
13
- <div
14
- class="pix-input-password__container
15
- {{this.validationStatusClassName}}
16
- {{if @prefix 'pix-input-password__with-prefix'}}"
17
- >
18
-
19
- {{#if @prefix}}
20
- <span class="pix-input-password__prefix">{{@prefix}}</span>
21
- {{/if}}
22
-
23
- <input
24
- id={{this.id}}
25
- type={{if this.isPasswordVisible "text" "password"}}
26
- value={{@value}}
27
- aria-required="{{if @requiredLabel true false}}"
28
- required={{if @requiredLabel true false}}
29
- aria-describedby={{this.ariaDescribedBy}}
30
- ...attributes
31
- />
32
-
33
- <PixIconButton
34
- class="pix-input-password__button"
35
- @iconName={{if this.isPasswordVisible "eye" "eyeOff"}}
36
- @plainIcon={{true}}
37
- @ariaLabel={{if
38
- this.isPasswordVisible
39
- "Masquer le mot de passe"
40
- "Afficher le mot de passe"
41
- }}
42
- @triggerAction={{this.togglePasswordVisibility}}
43
- @size="small"
44
- />
45
-
46
- {{#if this.hasError}}
47
- <PixIcon
48
- @name="close"
49
- @ariaHidden={{true}}
50
- class="pix-input-password__icon pix-input-password__error-icon"
51
- />
52
- {{/if}}
53
- {{#if this.hasSuccess}}
54
- <PixIcon
55
- @name="check"
56
- @ariaHidden={{true}}
57
- class="pix-input-password__icon pix-input-password__success-icon"
58
- />
59
- {{/if}}
60
- </div>
61
-
62
- {{#if this.hasErrorMessage}}
63
- <p id={{this.ariaDescribedBy}} class="pix-input-password__error-message">
64
- {{@errorMessage}}
65
- </p>
66
- {{/if}}
67
- </div>
68
- </div>
@@ -1,28 +0,0 @@
1
- import { action } from '@ember/object';
2
- import { tracked } from '@glimmer/tracking';
3
-
4
- import PixInputBase from './pix-input-base';
5
-
6
- export default class PixInputPassword extends PixInputBase {
7
- constructor() {
8
- super(...arguments);
9
-
10
- this.prefix = 'pix-input-password';
11
- this.inputValidationError = {
12
- default: '',
13
- error: 'pix-input-password__container--error',
14
- success: 'pix-input-password__container--success',
15
- };
16
- }
17
-
18
- @tracked isPasswordVisible = false;
19
-
20
- @action
21
- togglePasswordVisibility() {
22
- this.isPasswordVisible = !this.isPasswordVisible;
23
- const InputElement = document.getElementById(this.args.id);
24
- if (InputElement) {
25
- InputElement.focus();
26
- }
27
- }
28
- }
@@ -1,38 +0,0 @@
1
- <div class={{this.rootClassNames}}>
2
- {{#if (has-block "label")}}
3
- <PixLabel
4
- @for={{this.id}}
5
- @requiredLabel={{@requiredLabel}}
6
- @subLabel={{@subLabel}}
7
- @size={{@size}}
8
- @screenReaderOnly={{@screenReaderOnly}}
9
- @inlineLabel={{@inlineLabel}}
10
- >
11
- {{yield to="label"}}
12
- </PixLabel>
13
- {{/if}}
14
- <div class="pix-input__field-container">
15
- <div class="pix-input__container">
16
- <input
17
- id={{this.id}}
18
- class="pix-input__input {{this.validationStatusClassName}}"
19
- value={{@value}}
20
- aria-required="{{if @requiredLabel true false}}"
21
- required={{if @requiredLabel true false}}
22
- aria-describedby={{this.ariaDescribedBy}}
23
- ...attributes
24
- />
25
-
26
- {{#if this.hasError}}
27
- <PixIcon @name="close" class="pix-input__error-icon" @ariaHidden={{true}} />
28
- {{/if}}
29
- {{#if this.hasSuccess}}
30
- <PixIcon @name="check" class="pix-input__success-icon" @ariaHidden={{true}} />
31
- {{/if}}
32
- </div>
33
-
34
- {{#if this.hasErrorMessage}}
35
- <p id={{this.ariaDescribedBy}} class="pix-input__error-message">{{@errorMessage}}</p>
36
- {{/if}}
37
- </div>
38
- </div>
@@ -1,14 +0,0 @@
1
- import PixInputBase from './pix-input-base';
2
-
3
- export default class PixInput extends PixInputBase {
4
- constructor() {
5
- super(...arguments);
6
-
7
- this.prefix = 'pix-input';
8
- this.inputValidationError = {
9
- default: '',
10
- error: 'pix-input__input--error',
11
- success: 'pix-input__input--success',
12
- };
13
- }
14
- }
@@ -1,32 +0,0 @@
1
- <label for={{@for}} class={{this.className}} ...attributes>
2
- {{#if this.hasError}}
3
- <PixIcon
4
- @name="cancel"
5
- @plainIcon={{true}}
6
- @ariaHidden={{true}}
7
- class="pix-label-wrapped__state-icon"
8
- />
9
- {{/if}}
10
- {{#if this.hasSuccess}}
11
- <PixIcon
12
- @name="checkCircle"
13
- @plainIcon={{true}}
14
- @ariaHidden={{true}}
15
- class="pix-label-wrapped__state-icon"
16
- />
17
- {{/if}}
18
-
19
- {{yield to="inputElement"}}
20
-
21
- <span class="{{if @screenReaderOnly 'screen-reader-only'}}">
22
- {{yield}}
23
-
24
- {{#if @requiredLabel}}
25
- <abbr title={{@requiredLabel}} class="mandatory-mark">*</abbr>
26
- {{/if}}
27
-
28
- {{#if @subLabel}}
29
- <span class="pix-label__sub-label">{{@subLabel}}</span>
30
- {{/if}}
31
- </span>
32
- </label>