@1024pix/pix-ui 54.14.1 → 55.0.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.
package/README.md CHANGED
@@ -1,17 +1,17 @@
1
- - [Présentation de Pix-UI](#Pix-UI)
2
- - [Installation de l'addon Pix-UI](#Addon)
3
- - [Développment de Pix-UI](#Developpement)
1
+ - [Présentation de Pix UI](#Pix-UI)
2
+ - [Installation de l'addon Pix UI](#Addon)
3
+ - [Développment de Pix UI](#Developpement)
4
4
  - [Lancement de storybook en local](#Storybook)
5
5
 
6
6
 
7
- Pix-UI <a id="Pix-UI"></a>
7
+ Pix UI <a id="Pix-UI"></a>
8
8
  ==============================================================================
9
9
 
10
- Pix-UI c'est l'implémentation des principes du design system de Pix. Cela se matérialise par :
10
+ Pix UI c'est l'implémentation des principes du design system de Pix. Cela se matérialise par :
11
11
  - **un addon ember**, permettant l'utilisation composants UI Pix sur des applications ember externes
12
12
  - **un site statique**, présentant les composants UI Pix : https://1024pix.github.io/pix-ui/
13
13
 
14
- ![Capture d'écran du storybook en ligne](./docs/assets/screen-pix-storybook.png)
14
+ ![Capture d'écran du storybook en ligne](./docs/assets/screen-pix-ui.png)
15
15
 
16
16
  ##### Version du projet :
17
17
 
@@ -21,14 +21,14 @@ Pix-UI c'est l'implémentation des principes du design system de Pix. Cela se ma
21
21
 
22
22
  ## Installation de l'addon Pix-UI <a id="Addon"></a>
23
23
 
24
- Pour utiliser les composants sur une application Ember externe, il faut installer l'addon ember Pix-UI avec la commande :
24
+ Pour utiliser les composants sur une application Ember externe, il faut installer l'addon ember Pix UI avec la commande :
25
25
  - `npm install @1024pix/pix-ui@<tag_souhaité>`
26
26
 
27
27
  ##### Quel tag choisir ?
28
28
 
29
29
  `<tag_souhaité>` doit correspondre au numéro de version à installer. Ce numéro de version correspond à une release.
30
30
  *Par exemple, on peut remplacer `<tag_souhaité>` par `v0.1.1`.*
31
- Pour voir la liste des tags de Pix-UI, [c'est par ici.](https://github.com/1024pix/pix-ui/tags)
31
+ Pour voir la liste des tags de Pix UI, [c'est par ici.](https://github.com/1024pix/pix-ui/tags)
32
32
 
33
33
  ##### Installation par défaut
34
34
 
@@ -37,13 +37,13 @@ Il est possible d'installer Pix UI sans `#<tag_souhaité>`, auquel cas ce sera l
37
37
  Plus d'informations sur les [tags git ici](https://git-scm.com/book/fr/v2/Les-bases-de-Git-%C3%89tiquetage).
38
38
 
39
39
 
40
- ## Développement de Pix-UI <a id="Developpement"></a>
40
+ ## Développement de Pix UI <a id="Developpement"></a>
41
41
 
42
42
  * `git clone https://github.com/1024pix/pix-ui.git`
43
43
  * `cd pix-ui`
44
44
  * `npm install`
45
45
 
46
- ##### Création d'un composant Pix-UI
46
+ ##### Création d'un composant Pix UI
47
47
 
48
48
  * `ember g pix-component <nom_du_composant>`
49
49
 
@@ -8,7 +8,13 @@
8
8
  aria-expanded={{this.navigationMenuOpened}}
9
9
  @iconBefore={{if this.navigationMenuOpened "close" "menu"}}
10
10
  @triggerAction={{this.toggleNavigationMenu}}
11
- >{{@menuLabel}}</PixButton>
11
+ >
12
+ {{#if this.navigationMenuOpened}}
13
+ {{@closeLabel}}
14
+ {{else}}
15
+ {{@openLabel}}
16
+ {{/if}}
17
+ </PixButton>
12
18
  </div>
13
19
  </header>
14
20
  <nav
@@ -0,0 +1,3 @@
1
+ <nav class={{this.classNames}} aria-label={{this.ariaLabel}} ...attributes>
2
+ {{yield}}
3
+ </nav>
@@ -0,0 +1,30 @@
1
+ import { warn } from '@ember/debug';
2
+ import Component from '@glimmer/component';
3
+
4
+ export default class PixTabs extends Component {
5
+ get variant() {
6
+ const value = this.args.variant ?? 'primary';
7
+ warn(
8
+ `PixTabs: @variant "${value}" should be certif, orga or primary`,
9
+ ['primary', 'orga', 'certif'].includes(value),
10
+ {
11
+ id: 'pix-ui.pix-tabs.variant.not-valid',
12
+ },
13
+ );
14
+
15
+ return value;
16
+ }
17
+
18
+ get ariaLabel() {
19
+ const value = this.args.ariaLabel;
20
+ warn('PixTabs: @ariaLabel is required.', !['', null, undefined].includes(value), {
21
+ id: 'pix-ui.pix-tabs.ariaLabel.required',
22
+ });
23
+
24
+ return value;
25
+ }
26
+
27
+ get classNames() {
28
+ return ['pix-tabs', `pix-tabs--${this.variant}`].join(' ');
29
+ }
30
+ }
@@ -0,0 +1,58 @@
1
+ @use "pix-design-tokens/typography";
2
+
3
+ .pix-tabs {
4
+ display: flex;
5
+ flex-direction: row;
6
+ flex-grow: 1;
7
+ gap: var(--pix-spacing-2x);
8
+ height: min-content;
9
+ border-bottom: 2px solid var(--pix-tab-color);
10
+
11
+ & a {
12
+ padding: var(--pix-spacing-3x) var(--pix-spacing-4x);
13
+ color: var(--pix-neutral-900);
14
+ border-radius: 8px 8px 0 0;
15
+ cursor: pointer;
16
+
17
+ @extend %pix-body-s;
18
+
19
+ &.active {
20
+ color: var(--pix-neutral-0);
21
+ font-weight: var(--pix-font-bold);
22
+ background-color: var(--pix-tab-color);
23
+ }
24
+
25
+ &:focus,
26
+ &:focus-visible {
27
+ color: var(--pix-neutral-0);
28
+ background-color: rgb(var(--pix-tab-color-inline), 80%);
29
+ outline: 1px solid var(--pix-neutral-0);
30
+ outline-offset: -5px;
31
+ }
32
+
33
+ &:active {
34
+ background-color: rgb(var(--pix-tab-color-inline), 50%);
35
+ outline: none;
36
+ }
37
+
38
+ &:hover:not(.active) {
39
+ background-color: rgb(var(--pix-tab-color-inline), 30%);
40
+ }
41
+ }
42
+
43
+ &--primary {
44
+ --pix-tab-color: var(--pix-primary-500);
45
+ --pix-tab-color-inline: var(--pix-primary-500-inline);
46
+ }
47
+
48
+ &--orga {
49
+ --pix-tab-color: var(--pix-orga-500);
50
+ --pix-tab-color-inline: var(--pix-orga-500-inline);
51
+ }
52
+
53
+ &--certif {
54
+ --pix-tab-color: var(--pix-certif-500);
55
+ --pix-tab-color-inline: var(--pix-certif-500-inline);
56
+ }
57
+ }
58
+
@@ -46,6 +46,7 @@
46
46
  @use 'pix-app-layout';
47
47
  @use 'pix-structure-switcher';
48
48
  @use 'pix-code';
49
+ @use 'pix-tabs';
49
50
 
50
51
 
51
52
  // at the end so it can override it's children scss
@@ -0,0 +1 @@
1
+ export { default } from '@1024pix/pix-ui/components/pix-tabs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1024pix/pix-ui",
3
- "version": "54.14.1",
3
+ "version": "55.0.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"