@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,27 +0,0 @@
1
- import Component from '@glimmer/component';
2
-
3
- export default class PixLabelWrapped extends Component {
4
- get className() {
5
- const classes = ['pix-label', 'pix-label-wrapped'];
6
-
7
- if (this.args.inlineLabel) classes.push('pix-label--inline-label');
8
- if (this.args.isDisabled) classes.push('pix-label-wrapped--disabled');
9
- if (this.args.variant === 'tile') classes.push('pix-label-wrapped--variant-tile');
10
- if (this.args.state === 'success') classes.push('pix-label-wrapped--state-success');
11
- if (this.args.state === 'error') classes.push('pix-label-wrapped--state-error');
12
-
13
- const size = ['small', 'large'].includes(this.args.size) ? this.args.size : 'default';
14
-
15
- classes.push(`pix-label--${size}`);
16
-
17
- return classes.join(' ');
18
- }
19
-
20
- get hasError() {
21
- return this.args.state === 'error';
22
- }
23
-
24
- get hasSuccess() {
25
- return this.args.state === 'success';
26
- }
27
- }
@@ -1,33 +0,0 @@
1
- <PixOverlay
2
- @isVisible={{@showModal}}
3
- @onClose={{@onCloseButtonClick}}
4
- @focusOnClose={{@focusOnClose}}
5
- @hasCenteredContent={{true}}
6
- >
7
- <div
8
- class="pix-modal"
9
- role="dialog"
10
- aria-labelledby="modal-title--{{this.id}}"
11
- aria-describedby="modal-content--{{this.id}}"
12
- aria-modal="true"
13
- ...attributes
14
- >
15
- <div class="pix-modal__header">
16
- <h1 id="modal-title--{{this.id}}" class="pix-modal__title">{{@title}}</h1>
17
- <PixIconButton
18
- @iconName="close"
19
- @triggerAction={{@onCloseButtonClick}}
20
- @ariaLabel="Fermer"
21
- @size="small"
22
- @withBackground={{true}}
23
- class="pix-modal__close-button"
24
- />
25
- </div>
26
- <div id="modal-content--{{this.id}}" class="pix-modal__content">
27
- {{yield to="content"}}
28
- </div>
29
- <div class="pix-modal__footer">
30
- {{yield to="footer"}}
31
- </div>
32
- </div>
33
- </PixOverlay>
@@ -1,16 +0,0 @@
1
- import { guidFor } from '@ember/object/internals';
2
- import Component from '@glimmer/component';
3
-
4
- export default class PixModal extends Component {
5
- constructor(...args) {
6
- super(...args);
7
-
8
- if (!this.args.title) {
9
- throw new Error('ERROR in PixModal component: @title argument is required.');
10
- }
11
- }
12
-
13
- get id() {
14
- return guidFor(this);
15
- }
16
- }
@@ -1 +0,0 @@
1
- <hr class="pix-navigation-separator" />
@@ -1,43 +0,0 @@
1
- <aside
2
- ...attributes
3
- class="pix-navigation
4
- {{if this.navigationMenuOpened 'pix-navigation--opened'}}
5
- {{if this.shrinkNavigationService.isShrunk 'pix-navigation--shrunk'}}"
6
- >
7
- <header class="pix-navigation__brand">{{yield to="brand"}}
8
- {{#if this.shrinkNavigationService.canNavigationBeShrunk}}
9
- <div class="pix-navigation__shrunk-container">
10
- <PixIconButton
11
- class="pix-navigation-shrunk-button"
12
- @iconName={{this.shrunkNavigationIcon}}
13
- @triggerAction={{this.shrinkNavigation}}
14
- @ariaLabel="{{this.shrunkNavigationAriaLabel}}"
15
- />
16
- </div>
17
- {{/if}}
18
- <div class="pix-navigation__burger-menu"><PixButton
19
- aria-controls="{{this.navigationId}} {{this.footerId}}"
20
- aria-expanded={{this.navigationMenuOpened}}
21
- @iconBefore={{if this.navigationMenuOpened "close" "menu"}}
22
- @triggerAction={{this.toggleNavigationMenu}}
23
- >
24
- <span class="screen-reader-only">
25
- {{#if this.navigationMenuOpened}}
26
- {{@closeLabel}}
27
- {{else}}
28
- {{@openLabel}}
29
- {{/if}}
30
- </span>
31
- </PixButton>
32
- </div>
33
- </header>
34
- <nav
35
- class="pix-navigation__nav"
36
- {{on "click" this.closeNavigation}}
37
- aria-label={{@navigationAriaLabel}}
38
- id={{this.navigationId}}
39
- >
40
- {{yield to="navElements"}}
41
- </nav>
42
- <footer class="pix-navigation__footer" id={{this.footerId}}>{{yield to="footer"}}</footer>
43
- </aside>
@@ -1,13 +0,0 @@
1
- <p class="pix-notification-alert {{concat 'pix-notification-alert--' this.type}}" ...attributes>
2
- {{#if @withIcon}}
3
- <PixIcon
4
- @name={{this.iconName}}
5
- @ariaHidden={{true}}
6
- @plainIcon={{true}}
7
- class="pix-notification-alert__icon"
8
- />
9
- {{/if}}
10
- <span class="pix-notification-alert__content">
11
- {{yield}}
12
- </span>
13
- </p>
@@ -1,11 +0,0 @@
1
- <div
2
- class="pix-overlay
3
- {{unless @isVisible ' pix-overlay--hidden'}}
4
- {{if @hasCenteredContent ' pix-overlay--with-centered-content'}}"
5
- {{on "click" this.onClick}}
6
- {{trap-focus @isVisible @focusOnClose}}
7
- {{on-escape-action @onClose}}
8
- ...attributes
9
- >
10
- {{yield}}
11
- </div>
@@ -1,13 +0,0 @@
1
- import { action } from '@ember/object';
2
- import Component from '@glimmer/component';
3
-
4
- export default class PixOverlay extends Component {
5
- @action
6
- onClick(event) {
7
- const isClickOnOverlay = event.target.classList.contains('pix-overlay');
8
-
9
- if (this.args.onClose && isClickOnOverlay) {
10
- this.args.onClose(event);
11
- }
12
- }
13
- }
@@ -1,52 +0,0 @@
1
- <footer class={{this.isCondensed}}>
2
- <section class="pix-pagination__size">
3
- <span class="pagination-size__label">{{this.beforeResultsPerPage}}</span>
4
- <PixSelect
5
- @placeholder={{this.pageSize}}
6
- @screenReaderOnly={{true}}
7
- class="pagination-size__choice"
8
- @value={{this.pageSize}}
9
- @hideDefaultOption={{true}}
10
- @onChange={{this.changePageSize}}
11
- @options={{this.pageOptions}}
12
- >
13
- <:label>{{this.selectPageSizeLabel}}</:label>
14
- </PixSelect>
15
- </section>
16
- <section class="pix-pagination__navigation">
17
- <span>
18
- {{#if (eq this.pageCount 1)}}
19
- {{this.pageResults}}
20
- {{else}}
21
- {{this.pageInfo}}
22
- {{/if}}
23
- </span>
24
- <div class="pix-pagination-navigation__action">
25
- <PixIconButton
26
- class="pix-pagination-navigation__action-button"
27
- @iconName="arrowLeft"
28
- @ariaLabel={{this.previousPageLabel}}
29
- @triggerAction={{this.goToPreviousPage}}
30
- @withBackground={{false}}
31
- @size="big"
32
- @color="dark-grey"
33
- disabled={{this.isPreviousPageDisabled}}
34
- aria-disabled="{{this.isPreviousPageDisabled}}"
35
- />
36
- <span>
37
- {{this.pageNumber}}
38
- </span>
39
- <PixIconButton
40
- class="pix-pagination-navigation__action-button"
41
- @iconName="arrowRight"
42
- @ariaLabel={{this.nextPageLabel}}
43
- @triggerAction={{this.goToNextPage}}
44
- @withBackground={{false}}
45
- @size="big"
46
- @color="dark-grey"
47
- disabled={{this.isNextPageDisabled}}
48
- aria-disabled="{{this.isNextPageDisabled}}"
49
- />
50
- </div>
51
- </section>
52
- </footer>
@@ -1,19 +0,0 @@
1
- <div
2
- class="progress-bar {{this.themeMode}} {{this.colorClass}}"
3
- aria-hidden={{if @isDecorative "true"}}
4
- ...attributes
5
- >
6
- {{#unless @hidePercentage}}
7
- <div class="progress-bar__text" role="presentation">{{this.percentageValue}}</div>
8
- {{/unless}}
9
- <label for={{this.id}} class="screen-reader-only">{{@label}}</label>
10
- <progress
11
- class="progress-bar__bar"
12
- id={{this.id}}
13
- max="100"
14
- value={{this.value}}
15
- >{{this.value}}%</progress>
16
- {{#if @subtitle}}
17
- <p class="progress-bar__sub-title">{{@subtitle}}</p>
18
- {{/if}}
19
- </div>
@@ -1,37 +0,0 @@
1
- <div class="pix-radio-button {{@class}}">
2
- <PixLabelWrapped
3
- @for={{this.id}}
4
- @requiredLabel={{@requiredLabel}}
5
- @subLabel={{@subLabel}}
6
- @size={{@size}}
7
- @screenReaderOnly={{@screenReaderOnly}}
8
- @isDisabled={{this.isDisabled}}
9
- @inlineLabel={{true}}
10
- @variant={{@variant}}
11
- @state={{@state}}
12
- >
13
- <:inputElement>
14
- <input
15
- type="radio"
16
- id={{this.id}}
17
- class={{this.inputClasses}}
18
- value={{@value}}
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,25 +0,0 @@
1
- <div class="pix-search-input {{if @inlineLabel ' pix-search-input--inline'}}">
2
- <PixLabel
3
- @for={{this.id}}
4
- @requiredLabel={{@requiredLabel}}
5
- @subLabel={{@subLabel}}
6
- @size={{@size}}
7
- @screenReaderOnly={{@screenReaderOnly}}
8
- @inlineLabel={{@inlineLabel}}
9
- >
10
- {{yield to="label"}}
11
- </PixLabel>
12
-
13
- <div class="pix-search-input__input-container">
14
- <PixIcon @name="search" @ariaHidden={{true}} />
15
- <input
16
- id={{this.id}}
17
- class="pix-search-input__input"
18
- name={{@inputName}}
19
- placeholder={{@placeholder}}
20
- value={{this.initialValue}}
21
- {{on "input" this.onSearch}}
22
- ...attributes
23
- />
24
- </div>
25
- </div>
@@ -1,115 +0,0 @@
1
- <ul role="listbox" id={{@listId}} class="pix-select_list" ...attributes>
2
- {{#if @displayDefaultOption}}
3
- <li
4
- class="pix-select-list-category__option{{unless
5
- @value
6
- ' pix-select-list-category__option--selected'
7
- }}"
8
- role="option"
9
- tabindex={{if this.isDefaultOptionHidden "-1" "0"}}
10
- aria-selected={{if @value "false" "true"}}
11
- {{on "click" (fn @onChange @defaultOption)}}
12
- {{on-enter-action (fn @onChange @defaultOption)}}
13
- {{on-space-action (fn @onChange @defaultOption)}}
14
- >
15
- {{@defaultOptionValue}}
16
- </li>
17
- {{/if}}
18
- {{#if this.results}}
19
- {{#if this.displayCategory}}
20
- {{#each this.results as |element index|}}
21
- <ul
22
- class="pix-select-list-category"
23
- role="group"
24
- aria-labelledby={{if this.displayCategory (concat "cat-" @selectId "-" index)}}
25
- >
26
- {{#if this.displayCategory}}
27
- <li
28
- class="pix-select-list-category__name"
29
- role="presentation"
30
- id={{concat "cat-" @selectId "-" index}}
31
- title={{element.label}}
32
- >
33
- {{element.category}}
34
- </li>
35
- {{/if}}
36
-
37
- {{#each element.options as |option|}}
38
- {{! template-lint-disable require-context-role }}
39
- {{!https://www.w3.org/WAI/ARIA/apg/example-index/listbox/listbox-grouped.html}}
40
- <li
41
- class="pix-select-list-category__option{{if
42
- (eq option.value @value)
43
- ' pix-select-list-category__option--selected'
44
- }}"
45
- role="option"
46
- tabindex={{if @isExpanded "0" "-1"}}
47
- title={{option.label}}
48
- aria-selected={{if (eq option.value @value) "true" "false"}}
49
- {{on "click" (fn @onChange option)}}
50
- {{on-enter-action (fn @onChange option)}}
51
- {{on-space-action (fn @onChange option)}}
52
- >
53
-
54
- {{#if option.icon}}
55
- <PixIcon
56
- role="presentation"
57
- @name={{option.icon}}
58
- @title={{option.iconTitle}}
59
- class="pix-icon--no-shrink"
60
- />
61
- {{/if}}
62
-
63
- {{option.label}}
64
-
65
- {{#if (eq option.value @value)}}
66
- <PixIcon
67
- @name="check"
68
- role="presentation"
69
- class="pix-select-list-category__option-checked"
70
- />
71
- {{/if}}
72
- </li>
73
- {{/each}}
74
- </ul>
75
- {{/each}}
76
- {{else}}
77
- {{#each this.results as |option|}}
78
- <li
79
- class="pix-select-list-category__option{{if
80
- (eq option.value @value)
81
- ' pix-select-list-category__option--selected'
82
- }}"
83
- role="option"
84
- tabindex={{if @isExpanded "0" "-1"}}
85
- aria-selected={{if (eq option.value @value) "true" "false"}}
86
- title={{option.label}}
87
- {{on "click" (fn @onChange option)}}
88
- {{on-enter-action (fn @onChange option)}}
89
- {{on-space-action (fn @onChange option)}}
90
- >
91
- {{#if option.icon}}
92
- <PixIcon
93
- role="presentation"
94
- @name={{option.icon}}
95
- @title={{option.iconTitle}}
96
- class="pix-icon--no-shrink"
97
- />
98
- {{/if}}
99
-
100
- {{option.label}}
101
-
102
- {{#if (eq option.value @value)}}
103
- <PixIcon
104
- @name="check"
105
- role="presentation"
106
- class="pix-select-list-category__option-checked"
107
- />
108
- {{/if}}
109
- </li>
110
- {{/each}}
111
- {{/if}}
112
- {{else}}
113
- <li class="pix-select-list__empty-search-message">{{@emptySearchMessage}}</li>
114
- {{/if}}
115
- </ul>
@@ -1,41 +0,0 @@
1
- import Component from '@glimmer/component';
2
-
3
- export default class PixSelectList extends Component {
4
- get categories() {
5
- const uniqueCategories = new Set(
6
- ...this.args.options.map((option) => option.category).filter(Boolean),
7
- );
8
- return Array.from(uniqueCategories.values());
9
- }
10
-
11
- get displayCategory() {
12
- return this.categories.length > 0;
13
- }
14
-
15
- get isDefaultOptionHidden() {
16
- return !this.args.isExpanded || this.args.hideDefaultOption;
17
- }
18
-
19
- get results() {
20
- const results = [];
21
- let options = this.args.options;
22
-
23
- if (this.args.searchValue) {
24
- options = this.args.options.filter((option) =>
25
- option.label.toLowerCase().includes(this.args.searchValue.toLowerCase()),
26
- );
27
- }
28
-
29
- if (!this.displayCategory) return options;
30
-
31
- options.forEach(({ category, value, label, icon, iconTitle }) => {
32
- const categoryIndex = results.findIndex((result) => result.category === category);
33
- if (categoryIndex !== -1) {
34
- results[categoryIndex].options.push({ value, label, icon, iconTitle });
35
- } else {
36
- results.push({ category, options: [{ label, value, icon, iconTitle }] });
37
- }
38
- });
39
- return results;
40
- }
41
- }
@@ -1,10 +0,0 @@
1
- <div class="pix-selectable-tag {{if @checked ' pix-selectable-tag--checked'}}">
2
- <input
3
- type="checkbox"
4
- id={{@id}}
5
- {{on "change" this.toggleIsChecked}}
6
- checked={{@checked}}
7
- ...attributes
8
- />
9
- <label for={{@id}}>{{@label}}</label>
10
- </div>
@@ -1,9 +0,0 @@
1
- import { action } from '@ember/object';
2
- import Component from '@glimmer/component';
3
-
4
- export default class PixSelectableTag extends Component {
5
- @action
6
- toggleIsChecked() {
7
- return this.args.onChange(!this.args.checked);
8
- }
9
- }
@@ -1,28 +0,0 @@
1
- <PixOverlay @isVisible={{@showSidebar}} @onClose={{@onClose}} @focusOnClose={{@focusOnClose}}>
2
- <div
3
- class="pix-sidebar {{unless @showSidebar ' pix-sidebar--hidden'}}"
4
- role="dialog"
5
- aria-labelledby="sidebar-title--{{this.id}}"
6
- aria-describedby="sidebar-content--{{this.id}}"
7
- aria-modal="true"
8
- ...attributes
9
- >
10
- <div class="pix-sidebar__header">
11
- <h1 id="sidebar-title--{{this.id}}" class="pix-sidebar__title">{{@title}}</h1>
12
- <PixIconButton
13
- @iconName="close"
14
- @triggerAction={{@onClose}}
15
- @ariaLabel="Fermer"
16
- @size="small"
17
- @withBackground={{true}}
18
- class="pix-sidebar__close-button"
19
- />
20
- </div>
21
- <div id="sidebar-content--{{this.id}}" class="pix-sidebar__content">
22
- {{yield to="content"}}
23
- </div>
24
- <div class="pix-sidebar__footer">
25
- {{yield to="footer"}}
26
- </div>
27
- </div>
28
- </PixOverlay>
@@ -1,16 +0,0 @@
1
- import { guidFor } from '@ember/object/internals';
2
- import Component from '@glimmer/component';
3
-
4
- export default class PixSidebar extends Component {
5
- constructor(...args) {
6
- super(...args);
7
-
8
- if (!this.args.title) {
9
- throw new Error('ERROR in PixSidebar component: @title argument is required.');
10
- }
11
- }
12
-
13
- get id() {
14
- return guidFor(this);
15
- }
16
- }
@@ -1,17 +0,0 @@
1
- <div class="pix-stars" ...attributes>
2
- <span class="screen-reader-only">{{@alt}}</span>
3
- {{#each this.starsCount as |item index|}}
4
- <svg
5
- role="img"
6
- class={{this.itemClasses}}
7
- data-acquired={{lt index @count}}
8
- aria-hidden="true"
9
- viewBox="0 0 36 36"
10
- >
11
- <path
12
- d="M19.2828 2.10285L19.2859 2.1094L19.2891 2.11591L23.2657 10.1293C23.7043 11.0131 24.5494 11.6248 25.5259 11.7652L34.3061 13.0281C34.3075 13.0283 34.3089 13.0285 34.3102 13.0287C35.2023 13.1692 35.6257 14.3013 34.8986 15.0326C34.8976 15.0336 34.8966 15.0346 34.8956 15.0356L28.5817 21.2292C27.8785 21.919 27.5588 22.9099 27.7261 23.8806L29.2294 32.5994C29.3684 33.5432 28.3298 34.2646 27.5175 33.8437C27.5166 33.8432 27.5157 33.8428 27.5148 33.8423L19.7026 29.6958C18.8261 29.2305 17.7761 29.2289 16.8981 29.6914L9.01736 33.8423C9.01683 33.8426 9.01631 33.8428 9.01578 33.8431C8.20337 34.2653 7.16367 33.5437 7.30279 32.5994L8.80604 23.8806C8.97339 22.9099 8.65362 21.919 7.95048 21.2292L1.63355 15.0326C0.90651 14.3014 1.32978 13.1695 2.22156 13.0288L11.0636 11.7656C12.0477 11.6251 12.8982 11.0062 13.3347 10.1131L17.2434 2.11512C17.6777 1.2532 18.8988 1.30004 19.2828 2.10285Z"
13
- stroke-width="2"
14
- ></path>
15
- </svg>
16
- {{/each}}
17
- </div>
@@ -1,13 +0,0 @@
1
- import Component from '@glimmer/component';
2
-
3
- export default class PixStars extends Component {
4
- get starsCount() {
5
- if (!this.args.total && !this.args.count) return [];
6
- return this.args.total ? Array(this.args.total) : Array(this.args.count);
7
- }
8
-
9
- get itemClasses() {
10
- if (!this.args.color) return 'pix-stars__item';
11
- return `pix-stars__item pix-stars__item--color-${this.args.color}`;
12
- }
13
- }
@@ -1,41 +0,0 @@
1
- <div
2
- id="container-{{this.switcherId}}"
3
- class="pix-structure-switcher"
4
- {{on-click-outside this.closeMenu}}
5
- {{on-arrow-down-up-action this.listId this.openMenu this.isMenuOpen}}
6
- {{on-escape-action this.closeMenu this.switcherId}}
7
- {{on "keydown" this.lockTab}}
8
- ...attributes
9
- >
10
- <PopperJS @placement="right-end" as |reference popover|>
11
- <PixButton
12
- {{reference}}
13
- @size="small"
14
- @variant="secondary"
15
- aria-controls={{this.listId}}
16
- id={{this.switcherId}}
17
- @triggerAction={{this.toggleMenu}}
18
- aria-expanded={{this.isMenuOpen}}
19
- >{{@label}}</PixButton>
20
- {{#if this.isMenuOpen}}
21
- <div
22
- {{popover}}
23
- class="pix-select__dropdown {{unless this.isMenuOpen 'pix-select__dropdown--closed'}}"
24
- >
25
- <PixSelectList
26
- aria-labelledby={{this.switcherId}}
27
- {{on "transitionend" this.focus}}
28
- @hideDefaultOption={{true}}
29
- @listId={{this.listId}}
30
- @selectId={{this.switcherId}}
31
- @value={{@value}}
32
- @onChange={{this.onSelectListChange}}
33
- @defaultOption={{@defaultOption}}
34
- @isExpanded={{this.isMenuOpen}}
35
- @options={{@structures}}
36
- @defaultOptionValue={{@label}}
37
- />
38
- </div>
39
- {{/if}}
40
- </PopperJS>
41
- </div>
@@ -1,54 +0,0 @@
1
- import { action } from '@ember/object';
2
- import { guidFor } from '@ember/object/internals';
3
- import Component from '@glimmer/component';
4
- import { tracked } from '@glimmer/tracking';
5
- export default class PixStructureSwitcher extends Component {
6
- constructor(...args) {
7
- super(...args);
8
- this.switcherId = 'structure-switcher-' + guidFor(this);
9
- this.listId = `listbox-${this.switcherId}`;
10
- }
11
-
12
- @tracked
13
- isMenuOpen = false;
14
-
15
- @action
16
- toggleMenu() {
17
- this.isMenuOpen = !this.isMenuOpen;
18
- }
19
-
20
- @action
21
- onSelectListChange(structure, event) {
22
- this.args.onChange(structure);
23
- this.closeMenu(event);
24
- document.getElementById(this.switcherId).focus();
25
- }
26
-
27
- @action
28
- openMenu(event) {
29
- if (this.isMenuOpen) return;
30
-
31
- event.preventDefault();
32
- this.isMenuOpen = true;
33
- }
34
-
35
- @action
36
- closeMenu(event) {
37
- if (!this.isMenuOpen) return;
38
-
39
- event.preventDefault();
40
- this.isMenuOpen = false;
41
- }
42
-
43
- @action
44
- lockTab(event) {
45
- if (event.code === 'Tab' && this.isMenuOpen) {
46
- event.preventDefault();
47
- }
48
- }
49
-
50
- @action
51
- focus() {
52
- document.getElementById(this.listId).querySelector("[aria-selected='true']").focus();
53
- }
54
- }