@znetrox/tribe-ui 0.0.0-stage → 0.0.2
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 +63 -2
- package/fesm2022/znetrox-tribe-ui.mjs +176 -0
- package/fesm2022/znetrox-tribe-ui.mjs.map +1 -0
- package/package.json +22 -4
- package/types/znetrox-tribe-ui.d.ts +35 -0
package/README.md
CHANGED
|
@@ -1,3 +1,64 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Ui
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 22.3.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build ui
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
### Publishing the Library
|
|
30
|
+
|
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
|
32
|
+
|
|
33
|
+
1. Navigate to the `dist` directory:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cd dist/ui
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
40
|
+
```bash
|
|
41
|
+
npm publish
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Running unit tests
|
|
45
|
+
|
|
46
|
+
To execute unit tests with the [Vitest](https://vitest.dev/) test runner, use the following command:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
ng test
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Running end-to-end tests
|
|
53
|
+
|
|
54
|
+
For end-to-end (e2e) testing, run:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
ng e2e
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
61
|
+
|
|
62
|
+
## Additional Resources
|
|
63
|
+
|
|
64
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { ChangeDetectionStrategy, Component, input } from "@angular/core";
|
|
4
|
+
var Button = class Button {
|
|
5
|
+
variant = input("primary", ...ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []);
|
|
6
|
+
type = input("button", ...ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []);
|
|
7
|
+
shape = input("default", ...ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []);
|
|
8
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
9
|
+
minVersion: "12.0.0",
|
|
10
|
+
version: "22.3.0",
|
|
11
|
+
ngImport: i0,
|
|
12
|
+
type: Button,
|
|
13
|
+
deps: [],
|
|
14
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
15
|
+
});
|
|
16
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
17
|
+
minVersion: "17.1.0",
|
|
18
|
+
version: "22.3.0",
|
|
19
|
+
type: Button,
|
|
20
|
+
isStandalone: true,
|
|
21
|
+
selector: "app-button",
|
|
22
|
+
inputs: {
|
|
23
|
+
variant: {
|
|
24
|
+
classPropertyName: "variant",
|
|
25
|
+
publicName: "variant",
|
|
26
|
+
isSignal: true,
|
|
27
|
+
isRequired: false,
|
|
28
|
+
transformFunction: null
|
|
29
|
+
},
|
|
30
|
+
type: {
|
|
31
|
+
classPropertyName: "type",
|
|
32
|
+
publicName: "type",
|
|
33
|
+
isSignal: true,
|
|
34
|
+
isRequired: false,
|
|
35
|
+
transformFunction: null
|
|
36
|
+
},
|
|
37
|
+
shape: {
|
|
38
|
+
classPropertyName: "shape",
|
|
39
|
+
publicName: "shape",
|
|
40
|
+
isSignal: true,
|
|
41
|
+
isRequired: false,
|
|
42
|
+
transformFunction: null
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
ngImport: i0,
|
|
46
|
+
template: "<ng-template #content>\n <ng-content />\n</ng-template>\n\n<button\n [type]=\"type()\"\n [class]=\"'shape-' + shape() + ' btn-' + variant()\"\n>\n <!-- Contenu du bouton classique -->\n <ng-container [ngTemplateOutlet]=\"content\" />\n</button>",
|
|
47
|
+
styles: [":host{display:inline-block;font-size:var(--font-size-base)}button{--btn-py: .8em;--btn-size: calc(var(--btn-py) * 2 + 1em);font-family:var(--font-body);font-size:inherit;line-height:1}.shape-default{display:inline-flex;align-items:center;justify-content:center;gap:.5em;padding:var(--btn-py) 1.5em;border-radius:50em;border:1px solid transparent;white-space:nowrap;transition:.25s var(--ease-smooth)}.btn-primary.shape-default{background-color:var(--orange);color:var(--white)}.btn-primary.shape-default:hover{background-color:var(--dark-orange)}.btn-secondary.shape-default{background-color:var(--brown);color:var(--white)}.btn-secondary.shape-default:hover{background-color:var(--orange);color:var(--white)}.btn-outline.shape-default{background-color:transparent;border-color:var(--brown);color:var(--brown)}.btn-outline.shape-default:hover{background-color:var(--brown);color:var(--white)}.btn-white.shape-default{background-color:var(--white);color:var(--brown)}.btn-white.shape-default:hover{background-color:var(--cream)}\n"],
|
|
48
|
+
dependencies: [{
|
|
49
|
+
kind: "directive",
|
|
50
|
+
type: NgTemplateOutlet,
|
|
51
|
+
selector: "[ngTemplateOutlet]",
|
|
52
|
+
inputs: [
|
|
53
|
+
"ngTemplateOutletContext",
|
|
54
|
+
"ngTemplateOutlet",
|
|
55
|
+
"ngTemplateOutletInjector"
|
|
56
|
+
]
|
|
57
|
+
}],
|
|
58
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
62
|
+
minVersion: "12.0.0",
|
|
63
|
+
version: "22.3.0",
|
|
64
|
+
ngImport: i0,
|
|
65
|
+
type: Button,
|
|
66
|
+
decorators: [{
|
|
67
|
+
type: Component,
|
|
68
|
+
args: [{
|
|
69
|
+
imports: [NgTemplateOutlet],
|
|
70
|
+
selector: "app-button",
|
|
71
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
72
|
+
template: "<ng-template #content>\n <ng-content />\n</ng-template>\n\n<button\n [type]=\"type()\"\n [class]=\"'shape-' + shape() + ' btn-' + variant()\"\n>\n <!-- Contenu du bouton classique -->\n <ng-container [ngTemplateOutlet]=\"content\" />\n</button>",
|
|
73
|
+
styles: [":host{display:inline-block;font-size:var(--font-size-base)}button{--btn-py: .8em;--btn-size: calc(var(--btn-py) * 2 + 1em);font-family:var(--font-body);font-size:inherit;line-height:1}.shape-default{display:inline-flex;align-items:center;justify-content:center;gap:.5em;padding:var(--btn-py) 1.5em;border-radius:50em;border:1px solid transparent;white-space:nowrap;transition:.25s var(--ease-smooth)}.btn-primary.shape-default{background-color:var(--orange);color:var(--white)}.btn-primary.shape-default:hover{background-color:var(--dark-orange)}.btn-secondary.shape-default{background-color:var(--brown);color:var(--white)}.btn-secondary.shape-default:hover{background-color:var(--orange);color:var(--white)}.btn-outline.shape-default{background-color:transparent;border-color:var(--brown);color:var(--brown)}.btn-outline.shape-default:hover{background-color:var(--brown);color:var(--white)}.btn-white.shape-default{background-color:var(--white);color:var(--brown)}.btn-white.shape-default:hover{background-color:var(--cream)}\n"]
|
|
74
|
+
}]
|
|
75
|
+
}],
|
|
76
|
+
propDecorators: {
|
|
77
|
+
variant: [{
|
|
78
|
+
type: i0.Input,
|
|
79
|
+
args: [{
|
|
80
|
+
isSignal: true,
|
|
81
|
+
alias: "variant",
|
|
82
|
+
required: false
|
|
83
|
+
}]
|
|
84
|
+
}],
|
|
85
|
+
type: [{
|
|
86
|
+
type: i0.Input,
|
|
87
|
+
args: [{
|
|
88
|
+
isSignal: true,
|
|
89
|
+
alias: "type",
|
|
90
|
+
required: false
|
|
91
|
+
}]
|
|
92
|
+
}],
|
|
93
|
+
shape: [{
|
|
94
|
+
type: i0.Input,
|
|
95
|
+
args: [{
|
|
96
|
+
isSignal: true,
|
|
97
|
+
alias: "shape",
|
|
98
|
+
required: false
|
|
99
|
+
}]
|
|
100
|
+
}]
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
var ArrowIcon = class ArrowIcon {
|
|
104
|
+
size = input(18, ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
105
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
106
|
+
minVersion: "12.0.0",
|
|
107
|
+
version: "22.3.0",
|
|
108
|
+
ngImport: i0,
|
|
109
|
+
type: ArrowIcon,
|
|
110
|
+
deps: [],
|
|
111
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
112
|
+
});
|
|
113
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
114
|
+
minVersion: "17.1.0",
|
|
115
|
+
version: "22.3.0",
|
|
116
|
+
type: ArrowIcon,
|
|
117
|
+
isStandalone: true,
|
|
118
|
+
selector: "app-arrow-icon",
|
|
119
|
+
inputs: { size: {
|
|
120
|
+
classPropertyName: "size",
|
|
121
|
+
publicName: "size",
|
|
122
|
+
isSignal: true,
|
|
123
|
+
isRequired: false,
|
|
124
|
+
transformFunction: null
|
|
125
|
+
} },
|
|
126
|
+
ngImport: i0,
|
|
127
|
+
template: `
|
|
128
|
+
<svg
|
|
129
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
130
|
+
viewBox="0 0 24 24"
|
|
131
|
+
[attr.width]="size()"
|
|
132
|
+
[attr.height]="size()"
|
|
133
|
+
fill="currentColor"
|
|
134
|
+
aria-hidden="true"
|
|
135
|
+
>
|
|
136
|
+
<path d="M6.4,18L5,16.6L14.6,7H6V5H18V17H16V8.4L6.4,18Z" />
|
|
137
|
+
</svg>
|
|
138
|
+
`,
|
|
139
|
+
isInline: true
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
143
|
+
minVersion: "12.0.0",
|
|
144
|
+
version: "22.3.0",
|
|
145
|
+
ngImport: i0,
|
|
146
|
+
type: ArrowIcon,
|
|
147
|
+
decorators: [{
|
|
148
|
+
type: Component,
|
|
149
|
+
args: [{
|
|
150
|
+
selector: "app-arrow-icon",
|
|
151
|
+
template: `
|
|
152
|
+
<svg
|
|
153
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
154
|
+
viewBox="0 0 24 24"
|
|
155
|
+
[attr.width]="size()"
|
|
156
|
+
[attr.height]="size()"
|
|
157
|
+
fill="currentColor"
|
|
158
|
+
aria-hidden="true"
|
|
159
|
+
>
|
|
160
|
+
<path d="M6.4,18L5,16.6L14.6,7H6V5H18V17H16V8.4L6.4,18Z" />
|
|
161
|
+
</svg>
|
|
162
|
+
`
|
|
163
|
+
}]
|
|
164
|
+
}],
|
|
165
|
+
propDecorators: { size: [{
|
|
166
|
+
type: i0.Input,
|
|
167
|
+
args: [{
|
|
168
|
+
isSignal: true,
|
|
169
|
+
alias: "size",
|
|
170
|
+
required: false
|
|
171
|
+
}]
|
|
172
|
+
}] }
|
|
173
|
+
});
|
|
174
|
+
export { ArrowIcon, Button };
|
|
175
|
+
|
|
176
|
+
//# sourceMappingURL=znetrox-tribe-ui.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"znetrox-tribe-ui.mjs","names":[],"sources":["../../../../projects/tribe/ui/src/lib/button/button.ts","../../../../projects/tribe/ui/src/lib/button/button.html","../../../../projects/tribe/ui/src/lib/icons/arrow-icon.ts"],"sourcesContent":["import { NgTemplateOutlet } from '@angular/common';\nimport {ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n@Component({\n imports: [NgTemplateOutlet],\n selector: 'app-button',\n styleUrl: './button.css',\n templateUrl: './button.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Button {\n // paramètres du bouton\n readonly variant = input<'primary' | 'secondary' | 'outline' | 'white'>('primary');\n readonly type = input<'button' | 'submit'>('button');\n readonly shape = input<'default'>('default'); // on peut ajouter de nouveau style de boutons si besoin\n}\n","<ng-template #content>\n <ng-content />\n</ng-template>\n\n<button\n [type]=\"type()\"\n [class]=\"'shape-' + shape() + ' btn-' + variant()\"\n>\n <!-- Contenu du bouton classique -->\n <ng-container [ngTemplateOutlet]=\"content\" />\n</button>","import { Component, input } from '@angular/core';\n\n@Component({\n selector: 'app-arrow-icon',\n template: `\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n [attr.width]=\"size()\"\n [attr.height]=\"size()\"\n fill=\"currentColor\"\n aria-hidden=\"true\"\n >\n <path d=\"M6.4,18L5,16.6L14.6,7H6V5H18V17H16V8.4L6.4,18Z\" />\n </svg>\n `\n})\nexport class ArrowIcon {\n size = input<number>(18);\n}"],"mappings":";;;AAUA,IAAa,SAAb,MAAa,OAAM;CAER,UAAU,MAAqD,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CACzE,OAAO,MAA2B,UAAS,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,+BAAA,CAAA,CAAA;CAC3C,QAAQ,MAAiB,WAAU,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAJjC,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,U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AAA,MAAA;GAAA,mBAAA;GAAA,YAAA;GAAA,UAAA;GAAA,YAAA;GAAA,mBAAA;EAAA,EAAA;EAAA,UAAA;EAAA,UAbR;;;;;;;;;;;;EAWT,UAAA;CAAA,CAAA;;AAEQ,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAS,YAAA,CAAA;EAfrB,MAAA;EAAU,MAAA,CAAA;GACP,UAAU;GACV,UAAU;;;;;;;;;;;;EAYb,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
{
|
|
2
|
+
"repository": "https://github.com/zNetrox/tribe-ui",
|
|
3
|
+
"peerDependencies": {
|
|
4
|
+
"@angular/common": "^22.3.0",
|
|
5
|
+
"@angular/core": "^22.3.0"
|
|
6
|
+
},
|
|
7
|
+
"sideEffects": false,
|
|
2
8
|
"name": "@znetrox/tribe-ui",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "./fesm2022/znetrox-tribe-ui.mjs",
|
|
11
|
+
"module": "./fesm2022/znetrox-tribe-ui.mjs",
|
|
12
|
+
"typings": "./types/znetrox-tribe-ui.d.ts",
|
|
13
|
+
"types": "./types/znetrox-tribe-ui.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./types/znetrox-tribe-ui.d.ts",
|
|
17
|
+
"default": "./fesm2022/znetrox-tribe-ui.mjs"
|
|
18
|
+
},
|
|
19
|
+
"./package.json": {
|
|
20
|
+
"default": "./package.json"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"version": "0.0.2"
|
|
24
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class Button {
|
|
3
|
+
readonly variant: import("@angular/core").InputSignal<"primary" | "secondary" | "outline" | "white">;
|
|
4
|
+
readonly type: import("@angular/core").InputSignal<"button" | "submit">;
|
|
5
|
+
readonly shape: import("@angular/core").InputSignal<"default">;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Button, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Button, "app-button", never, {
|
|
8
|
+
"variant": {
|
|
9
|
+
"alias": "variant";
|
|
10
|
+
"required": false;
|
|
11
|
+
"isSignal": true;
|
|
12
|
+
};
|
|
13
|
+
"type": {
|
|
14
|
+
"alias": "type";
|
|
15
|
+
"required": false;
|
|
16
|
+
"isSignal": true;
|
|
17
|
+
};
|
|
18
|
+
"shape": {
|
|
19
|
+
"alias": "shape";
|
|
20
|
+
"required": false;
|
|
21
|
+
"isSignal": true;
|
|
22
|
+
};
|
|
23
|
+
}, {}, never, ["*"], true, never>;
|
|
24
|
+
}
|
|
25
|
+
export declare class ArrowIcon {
|
|
26
|
+
size: import("@angular/core").InputSignal<number>;
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ArrowIcon, never>;
|
|
28
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ArrowIcon, "app-arrow-icon", never, {
|
|
29
|
+
"size": {
|
|
30
|
+
"alias": "size";
|
|
31
|
+
"required": false;
|
|
32
|
+
"isSignal": true;
|
|
33
|
+
};
|
|
34
|
+
}, {}, never, never, true, never>;
|
|
35
|
+
}
|