@1024pix/pix-ui 44.2.9 → 44.3.0

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.
@@ -8,7 +8,7 @@
8
8
  aria-expanded={{if this.isUnCollapsed "true" "false"}}
9
9
  ...attributes
10
10
  >
11
- <span class="pix-collapsible-title__label">
11
+ <span>
12
12
  {{#if @titleIcon}}
13
13
  <FaIcon class="pix-collapsible-title__icon" @icon={{@titleIcon}} />
14
14
  {{/if}}
@@ -20,10 +20,17 @@
20
20
  {{/if}}
21
21
  </span>
22
22
 
23
- <FaIcon
24
- class="pix-collapsible-title__toggle-icon"
25
- @icon="{{if this.isCollapsed 'chevron-down' 'chevron-up'}}"
26
- />
23
+ <span class="pix-collapsible-title__container">
24
+ {{#if @tagContent}}
25
+ <PixTag @compact={{false}} @color={{@tagColor}}>
26
+ {{@tagContent}}
27
+ </PixTag>
28
+ {{/if}}
29
+ <FaIcon
30
+ class="pix-collapsible-title-container__toggle-icon"
31
+ @icon="{{if this.isCollapsed 'chevron-down' 'chevron-up'}}"
32
+ />
33
+ </span>
27
34
  </button>
28
35
 
29
36
  <div
@@ -53,7 +53,6 @@
53
53
  .pix-collapsible-title {
54
54
  &__container {
55
55
  display: flex;
56
- flex-grow: 1;
57
56
  align-items: center;
58
57
  }
59
58
 
@@ -61,6 +60,9 @@
61
60
  margin-right: var(--pix-spacing-2x);
62
61
  color: var(--pix-neutral-500);
63
62
  }
63
+ }
64
+
65
+ .pix-collapsible-title-container {
64
66
 
65
67
  &__toggle-icon {
66
68
  width: 1rem;
@@ -17,6 +17,12 @@ Par défaut le contenu est masqué et cliquer sur le libellé permet de montrer
17
17
 
18
18
  <Story of={ComponentStories.multipleCollapsible} height={260} />
19
19
 
20
+ ### Collapsible avec tag
21
+ Les paramètres `tagContent` et `tagColor` permettent d'afficher un `Pix Tag` près du chevron.
22
+
23
+
24
+ <Story of={ComponentStories.collapsibleWithTag} height={260} />
25
+
20
26
 
21
27
  ## Usage
22
28
 
@@ -13,6 +13,18 @@ export default {
13
13
  description: "Ajoute l'icône donnée en paramètre avant le titre du PixCollapsible",
14
14
  type: { name: 'string', required: false },
15
15
  },
16
+ tagContent: {
17
+ name: 'tagContent',
18
+ description: "Contenu du tag qui s'affiche près du chevron",
19
+ type: { name: 'string', required: false },
20
+ },
21
+ tagColor: {
22
+ name: 'tagColor',
23
+ description:
24
+ "Couleur du tag qui s'affiche près du chevron. Doit s'ajouter avec le paramètre tagContent. Voir le composant Pix Tag pour les couleurs disponibles",
25
+ type: { name: 'string', required: false },
26
+ table: { defaultValue: { summary: 'primary' } },
27
+ },
16
28
  },
17
29
  };
18
30
 
@@ -63,3 +75,30 @@ export const multipleCollapsible = (args) => {
63
75
  context: args,
64
76
  };
65
77
  };
78
+
79
+ export const collapsibleWithTag = (args) => {
80
+ return {
81
+ template: hbs`{{! template-lint-disable no-inline-styles }}
82
+ <div style='width:800px'>
83
+ {{! template-lint-disable no-inline-styles }}
84
+ <PixCollapsible
85
+ @title='Titre A'
86
+ @titleIcon={{this.titleIcon}}
87
+ @tagColor='success'
88
+ @tagContent='tag 1'
89
+ >
90
+ <div>Contenu A</div>
91
+ </PixCollapsible>
92
+
93
+ <PixCollapsible
94
+ @title='Titre B'
95
+ @titleIcon={{this.titleIcon}}
96
+ @tagColor='error'
97
+ @tagContent='tag 2'
98
+ >
99
+ <div>Contenu B</div>
100
+ </PixCollapsible>
101
+ </div>`,
102
+ context: args,
103
+ };
104
+ };
@@ -25,7 +25,7 @@ Customiser la couleur du tag:
25
25
  <PixTag @color="purple"> This is a purple tag </PixTag>
26
26
 
27
27
  Tag Compact
28
- <PixTag @compact="{{true}}" @color="blue"> This is a compactg tag </PixTag>
28
+ <PixTag @compact="{{true}}" @color="blue"> This is a compact tag </PixTag>
29
29
  ```
30
30
 
31
31
  ## Arguments
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "44.2.9",
3
+ "version": "44.3.0",
4
4
  "description": "Pix-UI is the implementation of Pix design principles and guidelines for its products.",
5
5
  "keywords": [
6
6
  "ember-addon"