@1024pix/pix-ui 54.14.0 → 54.15.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 +10 -10
- package/addon/components/pix-table-column.hbs +9 -3
- package/addon/components/pix-tabs.hbs +3 -0
- package/addon/components/pix-tabs.js +30 -0
- package/addon/styles/_pix-table-column.scss +1 -1
- package/addon/styles/_pix-table.scss +7 -1
- package/addon/styles/_pix-tabs.scss +58 -0
- package/addon/styles/addon.scss +1 -0
- package/app/components/pix-tabs.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
- [Présentation de Pix
|
|
2
|
-
- [Installation de l'addon Pix
|
|
3
|
-
- [Développment de Pix
|
|
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
|
|
7
|
+
Pix UI <a id="Pix-UI"></a>
|
|
8
8
|
==============================================================================
|
|
9
9
|
|
|
10
|
-
Pix
|
|
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
|
-

|
|
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
|
|
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
|
|
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
|
|
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
|
|
46
|
+
##### Création d'un composant Pix UI
|
|
47
47
|
|
|
48
48
|
* `ember g pix-component <nom_du_composant>`
|
|
49
49
|
|
|
@@ -13,7 +13,13 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
</th>
|
|
15
15
|
{{else}}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
{{#if @isMainRow}}
|
|
17
|
+
<th scope="row" class={{this.typeClass}} ...attributes>
|
|
18
|
+
{{yield to="cell"}}
|
|
19
|
+
</th>
|
|
20
|
+
{{else}}
|
|
21
|
+
<td class={{this.typeClass}} ...attributes>
|
|
22
|
+
{{yield to="cell"}}
|
|
23
|
+
</td>
|
|
24
|
+
{{/if}}
|
|
19
25
|
{{/if}}
|
|
@@ -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
|
+
}
|
|
@@ -59,11 +59,17 @@
|
|
|
59
59
|
align-items: center;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
th {
|
|
62
|
+
th[scope='col'] {
|
|
63
|
+
font-weight: var(--pix-font-bold);
|
|
63
64
|
text-align: start;
|
|
64
65
|
vertical-align: middle;
|
|
65
66
|
}
|
|
66
67
|
|
|
68
|
+
th[scope='row'] {
|
|
69
|
+
font-weight: var(--pix-font-normal);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
|
|
67
73
|
td, th {
|
|
68
74
|
padding: var(--pix-spacing-6x) var(--pix-spacing-4x);
|
|
69
75
|
|
|
@@ -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
|
+
|
package/addon/styles/addon.scss
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@1024pix/pix-ui/components/pix-tabs';
|