@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.
- package/addon/components/pix-accordions.gjs +81 -0
- package/addon/components/pix-app-layout.gjs +1 -1
- package/addon/components/pix-background-header.gjs +15 -0
- package/addon/components/{pix-banner-alert.js → pix-banner-alert.gjs} +49 -0
- package/addon/components/{pix-block.js → pix-block.gjs} +18 -0
- package/addon/components/pix-breadcrumb.gjs +40 -0
- package/addon/components/pix-button/pix-button-content.gjs +21 -0
- package/addon/components/pix-button-link.gjs +49 -0
- package/addon/components/{pix-button-upload.js → pix-button-upload.gjs} +15 -0
- package/addon/components/{pix-button.js → pix-button.gjs} +30 -0
- package/addon/components/{pix-checkbox.js → pix-checkbox.gjs} +42 -1
- package/addon/components/pix-code.gjs +59 -0
- package/addon/components/{pix-filterable-and-searchable-select.js → pix-filterable-and-searchable-select.gjs} +55 -0
- package/addon/components/pix-gauge.gjs +199 -0
- package/addon/components/{pix-icon-button.js → pix-icon-button.gjs} +21 -0
- package/addon/components/{pix-icon.js → pix-icon.gjs} +19 -0
- package/addon/components/pix-indicator-card.gjs +68 -0
- package/addon/components/{pix-input-code.js → pix-input-code.gjs} +29 -0
- package/addon/components/pix-input-password.gjs +102 -0
- package/addon/components/pix-input.gjs +57 -0
- package/addon/components/pix-label-wrapped.gjs +64 -0
- package/addon/components/pix-modal.gjs +55 -0
- package/addon/components/pix-navigation-separator.gjs +1 -0
- package/addon/components/{pix-navigation.js → pix-navigation.gjs} +49 -0
- package/addon/components/{pix-notification-alert.js → pix-notification-alert.gjs} +19 -0
- package/addon/components/pix-overlay.gjs +31 -0
- package/addon/components/{pix-pagination.js → pix-pagination.gjs} +58 -0
- package/addon/components/{pix-progress-bar.js → pix-progress-bar.gjs} +22 -0
- package/addon/components/{pix-radio-button.js → pix-radio-button.gjs} +42 -0
- package/addon/components/{pix-search-input.js → pix-search-input.gjs} +31 -0
- package/addon/components/pix-select-list.gjs +166 -0
- package/addon/components/pix-selectable-tag.gjs +23 -0
- package/addon/components/pix-sidebar.gjs +49 -0
- package/addon/components/pix-stars.gjs +34 -0
- package/addon/components/pix-structure-switcher.gjs +107 -0
- package/addon/components/{pix-table-column.js → pix-table-column.gjs} +33 -0
- package/addon/components/{pix-tabs.js → pix-tabs.gjs} +6 -0
- package/addon/components/pix-textarea.gjs +68 -0
- package/addon/components/pix-toast-container.gjs +16 -0
- package/addon/components/{pix-toast.js → pix-toast.gjs} +25 -0
- package/addon/components/pix-tooltip.gjs +82 -0
- package/addon/components/{toast-example.js → toast-example.gjs} +13 -0
- package/package.json +1 -1
- package/addon/components/pix-accordions.hbs +0 -48
- package/addon/components/pix-accordions.js +0 -26
- package/addon/components/pix-background-header.hbs +0 -7
- package/addon/components/pix-background-header.js +0 -5
- package/addon/components/pix-banner-alert.hbs +0 -38
- package/addon/components/pix-block.hbs +0 -8
- package/addon/components/pix-breadcrumb.hbs +0 -21
- package/addon/components/pix-breadcrumb.js +0 -12
- package/addon/components/pix-button/pix-button-content.hbs +0 -17
- package/addon/components/pix-button-link.hbs +0 -32
- package/addon/components/pix-button-link.js +0 -10
- package/addon/components/pix-button-upload.hbs +0 -11
- package/addon/components/pix-button.hbs +0 -25
- package/addon/components/pix-checkbox.hbs +0 -37
- package/addon/components/pix-code.hbs +0 -31
- package/addon/components/pix-code.js +0 -24
- package/addon/components/pix-filterable-and-searchable-select.hbs +0 -48
- package/addon/components/pix-gauge.hbs +0 -98
- package/addon/components/pix-gauge.js +0 -96
- package/addon/components/pix-icon-button.hbs +0 -15
- package/addon/components/pix-icon.hbs +0 -15
- package/addon/components/pix-indicator-card.hbs +0 -47
- package/addon/components/pix-indicator-card.js +0 -14
- package/addon/components/pix-input-code.hbs +0 -24
- package/addon/components/pix-input-password.hbs +0 -68
- package/addon/components/pix-input-password.js +0 -28
- package/addon/components/pix-input.hbs +0 -38
- package/addon/components/pix-input.js +0 -14
- package/addon/components/pix-label-wrapped.hbs +0 -32
- package/addon/components/pix-label-wrapped.js +0 -27
- package/addon/components/pix-modal.hbs +0 -33
- package/addon/components/pix-modal.js +0 -16
- package/addon/components/pix-navigation-separator.hbs +0 -1
- package/addon/components/pix-navigation.hbs +0 -43
- package/addon/components/pix-notification-alert.hbs +0 -13
- package/addon/components/pix-overlay.hbs +0 -11
- package/addon/components/pix-overlay.js +0 -13
- package/addon/components/pix-pagination.hbs +0 -52
- package/addon/components/pix-progress-bar.hbs +0 -19
- package/addon/components/pix-radio-button.hbs +0 -37
- package/addon/components/pix-search-input.hbs +0 -25
- package/addon/components/pix-select-list.hbs +0 -115
- package/addon/components/pix-select-list.js +0 -41
- package/addon/components/pix-selectable-tag.hbs +0 -10
- package/addon/components/pix-selectable-tag.js +0 -9
- package/addon/components/pix-sidebar.hbs +0 -28
- package/addon/components/pix-sidebar.js +0 -16
- package/addon/components/pix-stars.hbs +0 -17
- package/addon/components/pix-stars.js +0 -13
- package/addon/components/pix-structure-switcher.hbs +0 -41
- package/addon/components/pix-structure-switcher.js +0 -54
- package/addon/components/pix-table-column.hbs +0 -28
- package/addon/components/pix-tabs.hbs +0 -3
- package/addon/components/pix-textarea.hbs +0 -36
- package/addon/components/pix-textarea.js +0 -23
- package/addon/components/pix-toast-container.hbs +0 -5
- package/addon/components/pix-toast-container.js +0 -6
- package/addon/components/pix-toast.hbs +0 -17
- package/addon/components/pix-tooltip.hbs +0 -30
- package/addon/components/pix-tooltip.js +0 -46
- package/addon/components/toast-example.hbs +0 -7
- /package/addon/components/{pix-button-base.js → pix-button-base.gjs} +0 -0
- /package/addon/components/{pix-input-base.js → pix-input-base.gjs} +0 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { on } from '@ember/modifier';
|
|
2
|
+
import { action } from '@ember/object';
|
|
3
|
+
import { guidFor } from '@ember/object/internals';
|
|
4
|
+
import Component from '@glimmer/component';
|
|
5
|
+
import { tracked } from '@glimmer/tracking';
|
|
6
|
+
import onClickOutside from 'ember-click-outside/modifiers/on-click-outside';
|
|
7
|
+
import { PopperJS } from 'ember-popperjs';
|
|
8
|
+
|
|
9
|
+
import onArrowDownUpAction from '../modifiers/on-arrow-down-up-action';
|
|
10
|
+
import onEscapeAction from '../modifiers/on-escape-action';
|
|
11
|
+
import PixButton from './pix-button';
|
|
12
|
+
import PixSelectList from './pix-select-list';
|
|
13
|
+
|
|
14
|
+
export default class PixStructureSwitcher extends Component {
|
|
15
|
+
constructor(...args) {
|
|
16
|
+
super(...args);
|
|
17
|
+
this.switcherId = 'structure-switcher-' + guidFor(this);
|
|
18
|
+
this.listId = `listbox-${this.switcherId}`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@tracked
|
|
22
|
+
isMenuOpen = false;
|
|
23
|
+
|
|
24
|
+
@action
|
|
25
|
+
toggleMenu() {
|
|
26
|
+
this.isMenuOpen = !this.isMenuOpen;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@action
|
|
30
|
+
onSelectListChange(structure, event) {
|
|
31
|
+
this.args.onChange(structure);
|
|
32
|
+
this.closeMenu(event);
|
|
33
|
+
document.getElementById(this.switcherId).focus();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@action
|
|
37
|
+
openMenu(event) {
|
|
38
|
+
if (this.isMenuOpen) return;
|
|
39
|
+
|
|
40
|
+
event.preventDefault();
|
|
41
|
+
this.isMenuOpen = true;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@action
|
|
45
|
+
closeMenu(event) {
|
|
46
|
+
if (!this.isMenuOpen) return;
|
|
47
|
+
|
|
48
|
+
event.preventDefault();
|
|
49
|
+
this.isMenuOpen = false;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@action
|
|
53
|
+
lockTab(event) {
|
|
54
|
+
if (event.code === 'Tab' && this.isMenuOpen) {
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
@action
|
|
60
|
+
focus() {
|
|
61
|
+
document.getElementById(this.listId).querySelector("[aria-selected='true']").focus();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
<template>
|
|
65
|
+
<div
|
|
66
|
+
id="container-{{this.switcherId}}"
|
|
67
|
+
class="pix-structure-switcher"
|
|
68
|
+
{{onClickOutside this.closeMenu}}
|
|
69
|
+
{{onArrowDownUpAction this.listId this.openMenu this.isMenuOpen}}
|
|
70
|
+
{{onEscapeAction this.closeMenu this.switcherId}}
|
|
71
|
+
{{on "keydown" this.lockTab}}
|
|
72
|
+
...attributes
|
|
73
|
+
>
|
|
74
|
+
<PopperJS @placement="right-end" as |reference popover|>
|
|
75
|
+
<PixButton
|
|
76
|
+
{{reference}}
|
|
77
|
+
@size="small"
|
|
78
|
+
@variant="secondary"
|
|
79
|
+
aria-controls={{this.listId}}
|
|
80
|
+
id={{this.switcherId}}
|
|
81
|
+
@triggerAction={{this.toggleMenu}}
|
|
82
|
+
aria-expanded={{this.isMenuOpen}}
|
|
83
|
+
>{{@label}}</PixButton>
|
|
84
|
+
{{#if this.isMenuOpen}}
|
|
85
|
+
<div
|
|
86
|
+
{{popover}}
|
|
87
|
+
class="pix-select__dropdown {{unless this.isMenuOpen 'pix-select__dropdown--closed'}}"
|
|
88
|
+
>
|
|
89
|
+
<PixSelectList
|
|
90
|
+
aria-labelledby={{this.switcherId}}
|
|
91
|
+
{{on "transitionend" this.focus}}
|
|
92
|
+
@hideDefaultOption={{true}}
|
|
93
|
+
@listId={{this.listId}}
|
|
94
|
+
@selectId={{this.switcherId}}
|
|
95
|
+
@value={{@value}}
|
|
96
|
+
@onChange={{this.onSelectListChange}}
|
|
97
|
+
@defaultOption={{@defaultOption}}
|
|
98
|
+
@isExpanded={{this.isMenuOpen}}
|
|
99
|
+
@options={{@structures}}
|
|
100
|
+
@defaultOptionValue={{@label}}
|
|
101
|
+
/>
|
|
102
|
+
</div>
|
|
103
|
+
{{/if}}
|
|
104
|
+
</PopperJS>
|
|
105
|
+
</div>
|
|
106
|
+
</template>
|
|
107
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { warn } from '@ember/debug';
|
|
2
2
|
import Component from '@glimmer/component';
|
|
3
3
|
|
|
4
|
+
import PixIconButton from './pix-icon-button';
|
|
5
|
+
|
|
4
6
|
export default class PixTableColumn extends Component {
|
|
5
7
|
get displayHeader() {
|
|
6
8
|
return this.args.context === 'header';
|
|
@@ -96,4 +98,35 @@ export default class PixTableColumn extends Component {
|
|
|
96
98
|
}
|
|
97
99
|
return '';
|
|
98
100
|
}
|
|
101
|
+
|
|
102
|
+
<template>
|
|
103
|
+
{{#if this.displayHeader}}
|
|
104
|
+
<th scope="col" ...attributes aria-sort={{this.ariaSort}}>
|
|
105
|
+
<div class="pix-table-header-container">
|
|
106
|
+
{{yield to="header"}}
|
|
107
|
+
{{#if this.sortable}}
|
|
108
|
+
<PixIconButton
|
|
109
|
+
@ariaLabel={{this.iconLabel}}
|
|
110
|
+
@iconName={{this.iconName}}
|
|
111
|
+
@triggerAction={{@onSort}}
|
|
112
|
+
@size="small"
|
|
113
|
+
/>
|
|
114
|
+
{{/if}}
|
|
115
|
+
</div>
|
|
116
|
+
</th>
|
|
117
|
+
{{else}}
|
|
118
|
+
{{#if @isMainRow}}
|
|
119
|
+
<th scope="row" class={{this.typeClass}} ...attributes>
|
|
120
|
+
{{yield to="cell"}}
|
|
121
|
+
</th>
|
|
122
|
+
{{else}}
|
|
123
|
+
<td class={{this.typeClass}} ...attributes>
|
|
124
|
+
{{yield to="cell"}}
|
|
125
|
+
{{#if (has-block "subCell")}}
|
|
126
|
+
<p>{{yield to="subCell"}}</p>
|
|
127
|
+
{{/if}}
|
|
128
|
+
</td>
|
|
129
|
+
{{/if}}
|
|
130
|
+
{{/if}}
|
|
131
|
+
</template>
|
|
99
132
|
}
|
|
@@ -27,4 +27,10 @@ export default class PixTabs extends Component {
|
|
|
27
27
|
get classNames() {
|
|
28
28
|
return ['pix-tabs', `pix-tabs--${this.variant}`].join(' ');
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<nav class={{this.classNames}} aria-label={{this.ariaLabel}} ...attributes>
|
|
33
|
+
{{yield}}
|
|
34
|
+
</nav>
|
|
35
|
+
</template>
|
|
30
36
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { on } from '@ember/modifier';
|
|
2
|
+
import { action } from '@ember/object';
|
|
3
|
+
import { guidFor } from '@ember/object/internals';
|
|
4
|
+
import Component from '@glimmer/component';
|
|
5
|
+
import { tracked } from '@glimmer/tracking';
|
|
6
|
+
|
|
7
|
+
import PixLabel from './pix-label';
|
|
8
|
+
|
|
9
|
+
export default class PixTextarea extends Component {
|
|
10
|
+
// eslint-disable-next-line ember/no-tracked-properties-from-args
|
|
11
|
+
@tracked value = this.args.value;
|
|
12
|
+
|
|
13
|
+
get id() {
|
|
14
|
+
if (this.args.id) return this.args.id;
|
|
15
|
+
return 'textarea-' + guidFor(this);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
get textLengthIndicator() {
|
|
19
|
+
return this.value ? this.value.length : 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@action
|
|
23
|
+
updateValue(event) {
|
|
24
|
+
this.value = event.target.value;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<div class="pix-textarea {{if @inlineLabel ' pix-textarea--inline'}}">
|
|
29
|
+
{{#if (has-block "label")}}
|
|
30
|
+
<PixLabel
|
|
31
|
+
@for={{this.id}}
|
|
32
|
+
@requiredLabel={{@requiredLabel}}
|
|
33
|
+
@subLabel={{@subLabel}}
|
|
34
|
+
@size={{@size}}
|
|
35
|
+
@screenReaderOnly={{@screenReaderOnly}}
|
|
36
|
+
@inlineLabel={{@inlineLabel}}
|
|
37
|
+
>
|
|
38
|
+
{{yield to="label"}}
|
|
39
|
+
</PixLabel>
|
|
40
|
+
{{/if}}
|
|
41
|
+
|
|
42
|
+
<div class="pix-textarea__container">
|
|
43
|
+
<textarea
|
|
44
|
+
id={{this.id}}
|
|
45
|
+
maxlength={{if @maxlength @maxlength}}
|
|
46
|
+
aria-required="{{if @requiredLabel true false}}"
|
|
47
|
+
required={{if @requiredLabel true false}}
|
|
48
|
+
class="pix-textarea-container__input {{if @errorMessage 'pix-textarea--error'}}"
|
|
49
|
+
{{on "keyup" this.updateValue}}
|
|
50
|
+
...attributes
|
|
51
|
+
>{{@value}}</textarea>
|
|
52
|
+
|
|
53
|
+
{{#if @maxlength}}
|
|
54
|
+
{{! prettier-ignore }}
|
|
55
|
+
<p class="pix-textarea-container__text-length-indicator">{{this.textLengthIndicator}} / {{@maxlength}}</p>
|
|
56
|
+
{{/if}}
|
|
57
|
+
|
|
58
|
+
{{#if @errorMessage}}
|
|
59
|
+
<label
|
|
60
|
+
for={{this.id}}
|
|
61
|
+
class="pix-textarea-container__error-message"
|
|
62
|
+
>{{@errorMessage}}</label>
|
|
63
|
+
{{/if}}
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
</div>
|
|
67
|
+
</template>
|
|
68
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { service } from '@ember/service';
|
|
2
|
+
import Component from '@glimmer/component';
|
|
3
|
+
|
|
4
|
+
import PixToast from './pix-toast';
|
|
5
|
+
|
|
6
|
+
export default class PixToastContainer extends Component {
|
|
7
|
+
@service pixToast;
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div class="pix-toast-container">
|
|
11
|
+
{{#each this.pixToast.content as |toast|}}
|
|
12
|
+
<PixToast @toast={{toast}} @closeButtonAriaLabel={{@closeButtonAriaLabel}} />
|
|
13
|
+
{{/each}}
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
}
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { warn } from '@ember/debug';
|
|
2
|
+
import { concat } from '@ember/helper';
|
|
2
3
|
import { action } from '@ember/object';
|
|
3
4
|
import { service } from '@ember/service';
|
|
4
5
|
import Component from '@glimmer/component';
|
|
6
|
+
|
|
5
7
|
const TYPE_SUCCESS = 'success';
|
|
6
8
|
const TYPE_ERROR = 'error';
|
|
7
9
|
const TYPE_INFORMATION = 'information';
|
|
8
10
|
const TYPE_WARNING = 'warning';
|
|
9
11
|
|
|
12
|
+
import PixIcon from './pix-icon';
|
|
13
|
+
import PixIconButton from './pix-icon-button';
|
|
14
|
+
|
|
10
15
|
export default class PixToast extends Component {
|
|
11
16
|
@service pixToast;
|
|
12
17
|
|
|
@@ -34,4 +39,24 @@ export default class PixToast extends Component {
|
|
|
34
39
|
event.stopPropagation();
|
|
35
40
|
this.pixToast.removeNotification(this.args.toast);
|
|
36
41
|
}
|
|
42
|
+
|
|
43
|
+
<template>
|
|
44
|
+
<div class="pix-toast {{concat 'pix-toast--' this.type}}" role="alert" ...attributes>
|
|
45
|
+
<div class="pix-toast__icon {{concat 'pix-toast__icon--' this.type}}">
|
|
46
|
+
<PixIcon @name={{this.iconClass}} @ariaHidden={{true}} @plainIcon={{true}} />
|
|
47
|
+
</div>
|
|
48
|
+
<p class="pix-toast__content">
|
|
49
|
+
{{@toast.message}}
|
|
50
|
+
</p>
|
|
51
|
+
<div class="pix-toast__close-button-container">
|
|
52
|
+
<PixIconButton
|
|
53
|
+
@ariaLabel={{@closeButtonAriaLabel}}
|
|
54
|
+
@iconName="close"
|
|
55
|
+
@size="small"
|
|
56
|
+
@triggerAction={{this.removeNotification}}
|
|
57
|
+
class="{{concat 'pix-toast__close-button--' this.type}}"
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
37
62
|
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { on } from '@ember/modifier';
|
|
2
|
+
import { action } from '@ember/object';
|
|
3
|
+
import Component from '@glimmer/component';
|
|
4
|
+
import { tracked } from '@glimmer/tracking';
|
|
5
|
+
|
|
6
|
+
import onEscapeAction from '../modifiers/on-escape-action';
|
|
7
|
+
|
|
8
|
+
export default class PixTooltip extends Component {
|
|
9
|
+
@tracked isTooltipVisible = false;
|
|
10
|
+
|
|
11
|
+
get position() {
|
|
12
|
+
const correctsPosition = [
|
|
13
|
+
'top',
|
|
14
|
+
'right',
|
|
15
|
+
'bottom',
|
|
16
|
+
'bottom-left',
|
|
17
|
+
'bottom-right',
|
|
18
|
+
'left',
|
|
19
|
+
'top-left',
|
|
20
|
+
'top-right',
|
|
21
|
+
];
|
|
22
|
+
return correctsPosition.includes(this.args.position) ? this.args.position : 'top';
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
get display() {
|
|
26
|
+
return typeof this.args.hide === 'undefined' || !this.args.hide;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@action
|
|
30
|
+
showTooltip() {
|
|
31
|
+
this.isTooltipVisible = true;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@action
|
|
35
|
+
hideTooltip() {
|
|
36
|
+
setTimeout(() => (this.isTooltipVisible = false));
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
@action
|
|
40
|
+
hideTooltipOnMouseOut(event) {
|
|
41
|
+
const isFocused = event.target.contains(document.activeElement);
|
|
42
|
+
|
|
43
|
+
if (isFocused) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
this.hideTooltip(event);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
<template>
|
|
51
|
+
<div
|
|
52
|
+
class="pix-tooltip {{if this.isTooltipVisible 'pix-tooltip--visible' ''}}"
|
|
53
|
+
{{onEscapeAction this.hideTooltip}}
|
|
54
|
+
{{on "mouseover" this.showTooltip}}
|
|
55
|
+
{{on "mouseleave" this.hideTooltipOnMouseOut}}
|
|
56
|
+
{{on "focusin" this.showTooltip}}
|
|
57
|
+
{{on "focusout" this.hideTooltip}}
|
|
58
|
+
...attributes
|
|
59
|
+
>
|
|
60
|
+
{{#if (has-block "triggerElement")}}
|
|
61
|
+
<span class="pix-tooltip__trigger-element" tabindex="0">
|
|
62
|
+
{{yield to="triggerElement"}}
|
|
63
|
+
</span>
|
|
64
|
+
{{/if}}
|
|
65
|
+
|
|
66
|
+
{{#if (has-block "tooltip")}}
|
|
67
|
+
{{#if this.display}}
|
|
68
|
+
<span
|
|
69
|
+
id={{@id}}
|
|
70
|
+
role="tooltip"
|
|
71
|
+
class="pix-tooltip__content pix-tooltip__content--{{this.position}}
|
|
72
|
+
{{if @isInline 'pix-tooltip__content--inline'}}
|
|
73
|
+
{{if @isLight 'pix-tooltip__content--light'}}
|
|
74
|
+
{{if @isWide 'pix-tooltip__content--wide'}}"
|
|
75
|
+
>
|
|
76
|
+
{{yield to="tooltip"}}
|
|
77
|
+
</span>
|
|
78
|
+
{{/if}}
|
|
79
|
+
{{/if}}
|
|
80
|
+
</div>
|
|
81
|
+
</template>
|
|
82
|
+
}
|
|
@@ -2,6 +2,9 @@ import { action } from '@ember/object';
|
|
|
2
2
|
import { service } from '@ember/service';
|
|
3
3
|
import Component from '@glimmer/component';
|
|
4
4
|
|
|
5
|
+
import PixButton from './pix-button';
|
|
6
|
+
import PixToastContainer from './pix-toast-container';
|
|
7
|
+
|
|
5
8
|
export default class ToastExample extends Component {
|
|
6
9
|
@service pixToast;
|
|
7
10
|
|
|
@@ -21,4 +24,14 @@ export default class ToastExample extends Component {
|
|
|
21
24
|
type: types[randomNumber],
|
|
22
25
|
});
|
|
23
26
|
}
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<div class="toast-example">
|
|
30
|
+
<PixButton @size="small" @triggerAction={{this.displayNotification}}>
|
|
31
|
+
Afficher une notification
|
|
32
|
+
</PixButton>
|
|
33
|
+
|
|
34
|
+
<PixToastContainer @closeButtonAriaLabel="Fermer la notification" />
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
24
37
|
}
|
package/package.json
CHANGED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
<div class="pix-accordions">
|
|
2
|
-
|
|
3
|
-
<button
|
|
4
|
-
class="pix-accordions__title"
|
|
5
|
-
type="button"
|
|
6
|
-
{{on "click" this.toggleAccordions}}
|
|
7
|
-
aria-controls={{this.contentId}}
|
|
8
|
-
aria-expanded={{if this.isUnCollapsed "true" "false"}}
|
|
9
|
-
...attributes
|
|
10
|
-
>
|
|
11
|
-
|
|
12
|
-
<span class="pix-accordions-title__container">
|
|
13
|
-
{{#if @iconName}}
|
|
14
|
-
<PixIcon
|
|
15
|
-
class="pix-accordions-title__icon"
|
|
16
|
-
@name={{@iconName}}
|
|
17
|
-
@plainIcon={{@plainIcon}}
|
|
18
|
-
@ariaHidden={{true}}
|
|
19
|
-
/>
|
|
20
|
-
{{/if}}
|
|
21
|
-
|
|
22
|
-
{{yield to="title"}}
|
|
23
|
-
</span>
|
|
24
|
-
|
|
25
|
-
<span class="pix-accordions-title__container">
|
|
26
|
-
{{#if @tagContent}}
|
|
27
|
-
<PixTag @color={{@tagColor}}>
|
|
28
|
-
{{@tagContent}}
|
|
29
|
-
</PixTag>
|
|
30
|
-
{{/if}}
|
|
31
|
-
<PixIcon
|
|
32
|
-
class="pix-accordions-title-container__toggle-icon"
|
|
33
|
-
@ariaHidden={{true}}
|
|
34
|
-
@name="{{if this.isCollapsed 'chevronBottom' 'chevronTop'}}"
|
|
35
|
-
/>
|
|
36
|
-
</span>
|
|
37
|
-
</button>
|
|
38
|
-
|
|
39
|
-
<div
|
|
40
|
-
id={{this.contentId}}
|
|
41
|
-
class="pix-accordions__content"
|
|
42
|
-
aria-hidden={{if this.isCollapsed "true" "false"}}
|
|
43
|
-
>
|
|
44
|
-
{{#if this.isContentRendered}}
|
|
45
|
-
{{yield to="content"}}
|
|
46
|
-
{{/if}}
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
@@ -1,26 +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
|
-
|
|
6
|
-
export default class PixAccordions extends Component {
|
|
7
|
-
text = 'pix-accordions';
|
|
8
|
-
contentId = 'pix-accordions-' + guidFor(this);
|
|
9
|
-
|
|
10
|
-
@tracked isCollapsed = true;
|
|
11
|
-
@tracked hasUnCollapsedOnce = false;
|
|
12
|
-
|
|
13
|
-
get isUnCollapsed() {
|
|
14
|
-
return !this.isCollapsed;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
get isContentRendered() {
|
|
18
|
-
return this.hasUnCollapsedOnce;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
@action
|
|
22
|
-
toggleAccordions() {
|
|
23
|
-
this.isCollapsed = !this.isCollapsed;
|
|
24
|
-
this.hasUnCollapsedOnce = true;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
{{#if this.displayBanner}}
|
|
2
|
-
<div class="pix-banner-alert pix-banner-alert--{{this.type}}" role="alert" ...attributes>
|
|
3
|
-
<PixIcon
|
|
4
|
-
@name={{this.icon}}
|
|
5
|
-
@plainIcon={{true}}
|
|
6
|
-
@ariaHidden={{true}}
|
|
7
|
-
class="pix-banner-alert__icon"
|
|
8
|
-
/>
|
|
9
|
-
<div>
|
|
10
|
-
{{yield}}
|
|
11
|
-
{{#if this.displayAction}}
|
|
12
|
-
{{#if this.isExternalLink}}
|
|
13
|
-
<a
|
|
14
|
-
class="pix-banner-alert__action"
|
|
15
|
-
href={{@actionUrl}}
|
|
16
|
-
target="_blank"
|
|
17
|
-
rel="noopener noreferrer"
|
|
18
|
-
>
|
|
19
|
-
{{@actionLabel}}
|
|
20
|
-
<PixIcon @name="openNew" class="external-link" @ariaHidden={{true}} />
|
|
21
|
-
</a>
|
|
22
|
-
{{else}}
|
|
23
|
-
<LinkTo class="pix-banner-alert__action" @route={{@actionUrl}}>{{@actionLabel}}</LinkTo>
|
|
24
|
-
{{/if}}
|
|
25
|
-
{{/if}}
|
|
26
|
-
</div>
|
|
27
|
-
{{#if this.canCloseBanner}}
|
|
28
|
-
<div class="pix-banner-alert__close">
|
|
29
|
-
<PixIconButton
|
|
30
|
-
@ariaLabel="Fermer"
|
|
31
|
-
@iconName="close"
|
|
32
|
-
@size="small"
|
|
33
|
-
@triggerAction={{this.closeBanner}}
|
|
34
|
-
/>
|
|
35
|
-
</div>
|
|
36
|
-
{{/if}}
|
|
37
|
-
</div>
|
|
38
|
-
{{/if}}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<nav class="pix-breadcrumb" ...attributes>
|
|
2
|
-
<ol>
|
|
3
|
-
{{#each this.links as |link|}}
|
|
4
|
-
{{#if link.route}}
|
|
5
|
-
<li>
|
|
6
|
-
<LinkTo
|
|
7
|
-
@route={{link.route}}
|
|
8
|
-
@models={{if link.model (array link.model) this.defaultModel}}
|
|
9
|
-
>
|
|
10
|
-
{{link.label}}
|
|
11
|
-
</LinkTo>
|
|
12
|
-
<PixIcon @name="chevronRight" @ariaHidden={{true}} />
|
|
13
|
-
</li>
|
|
14
|
-
{{else}}
|
|
15
|
-
<li aria-current="page">
|
|
16
|
-
<p>{{link.label}}</p>
|
|
17
|
-
</li>
|
|
18
|
-
{{/if}}
|
|
19
|
-
{{/each}}
|
|
20
|
-
</ol>
|
|
21
|
-
</nav>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{{#if @iconBefore}}
|
|
2
|
-
<PixIcon
|
|
3
|
-
class="pix-button__icon pix-button__icon--before"
|
|
4
|
-
@ariaHidden={{true}}
|
|
5
|
-
@name={{@iconBefore}}
|
|
6
|
-
@plainIcon={{@plainIconBefore}}
|
|
7
|
-
/>
|
|
8
|
-
{{/if}}
|
|
9
|
-
{{yield}}
|
|
10
|
-
{{#if @iconAfter}}
|
|
11
|
-
<PixIcon
|
|
12
|
-
class="pix-button__icon pix-button__icon--after"
|
|
13
|
-
@name={{@iconAfter}}
|
|
14
|
-
@ariaHidden={{true}}
|
|
15
|
-
@plainIcon={{@plainIconAfter}}
|
|
16
|
-
/>
|
|
17
|
-
{{/if}}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{{#if @route}}
|
|
2
|
-
<LinkTo
|
|
3
|
-
@route={{@route}}
|
|
4
|
-
@models={{if @model (array @model) this.defaultModel}}
|
|
5
|
-
@disabled={{@isDisabled}}
|
|
6
|
-
@query={{if @query @query this.defaultParams}}
|
|
7
|
-
class={{this.className}}
|
|
8
|
-
aria-disabled="{{@isDisabled}}"
|
|
9
|
-
...attributes
|
|
10
|
-
>
|
|
11
|
-
<PixButtonContent
|
|
12
|
-
@iconBefore={{@iconBefore}}
|
|
13
|
-
@iconAfter={{@iconAfter}}
|
|
14
|
-
@plainIconAfter={{@plainIconAfter}}
|
|
15
|
-
@plainIconBefore={{@plainIconBefore}}
|
|
16
|
-
>
|
|
17
|
-
{{yield}}
|
|
18
|
-
</PixButtonContent>
|
|
19
|
-
</LinkTo>
|
|
20
|
-
{{else}}
|
|
21
|
-
{{! template-lint-disable no-unsupported-role-attributes }}
|
|
22
|
-
<a href={{@href}} class={{this.className}} aria-disabled="{{@isDisabled}}" ...attributes>
|
|
23
|
-
<PixButtonContent
|
|
24
|
-
@iconBefore={{@iconBefore}}
|
|
25
|
-
@iconAfter={{@iconAfter}}
|
|
26
|
-
@plainIconAfter={{@plainIconAfter}}
|
|
27
|
-
@plainIconBefore={{@plainIconBefore}}
|
|
28
|
-
>
|
|
29
|
-
{{yield}}
|
|
30
|
-
</PixButtonContent>
|
|
31
|
-
</a>
|
|
32
|
-
{{/if}}
|