@identitate-md/logos 1.3.6 → 1.3.8

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.
Files changed (3) hide show
  1. package/README.md +148 -137
  2. package/identity-loader.js +49 -39
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,14 +1,14 @@
1
- # @identitate-ro/logos
1
+ # @identitate-md/logos
2
2
 
3
- > Logo-uri oficiale ale instituțiilor publice din România — Official logos of Romanian public institutions
3
+ > Logo-uri oficiale ale instituțiilor publice din Moldova — Official logos of Romanian public institutions
4
4
 
5
- [![npm version](https://img.shields.io/npm/v/@identitate-ro/logos.svg)](https://www.npmjs.com/package/@identitate-ro/logos)
5
+ [![npm version](https://img.shields.io/npm/v/@identitate-md/logos.svg)](https://www.npmjs.com/package/@identitate-md/logos)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
7
 
8
8
  ## 📦 Instalare
9
9
 
10
10
  ```bash
11
- npm install @identitate-ro/logos
11
+ npm install @identitate-md/logos
12
12
  ```
13
13
 
14
14
  ## 🚀 Utilizare
@@ -21,42 +21,57 @@ Logo-urile sunt disponibile automat prin CDN-uri gratuite:
21
21
 
22
22
  ```html
23
23
  <!-- Logo complet -->
24
- <img src="https://identitate.eu/logos/anaf/anaf.svg" alt="ANAF">
24
+ <img src="https://identitate.eu/logos/anaf/anaf.svg" alt="ANAF" />
25
25
 
26
26
  <!-- Simbol -->
27
- <img src="https://identitate.eu/logos/anaf/simbol-anaf.svg" alt="ANAF Simbol">
27
+ <img src="https://identitate.eu/logos/anaf/simbol-anaf.svg" alt="ANAF Simbol" />
28
28
 
29
29
  <!-- Alte instituții -->
30
- <img src="https://identitate.eu/logos/guvernul-romaniei/guvernul-romaniei.svg" alt="Guvernul României">
31
- <img src="https://identitate.eu/logos/pnrr/pnrr.svg" alt="PNRR">
30
+ <img
31
+ src="https://identitate.eu/logos/guvernul-republicii-moldova/guvernul-republicii-moldova.svg"
32
+ alt="Guvernul Republicii Moldova"
33
+ />
34
+ <img src="https://identitate.eu/logos/pnrr/pnrr.svg" alt="PNRR" />
32
35
  ```
33
36
 
34
37
  #### jsDelivr (CDN Primară)
35
38
 
36
39
  ```html
37
40
  <!-- Logo complet -->
38
- <img src="https://cdn.jsdelivr.net/npm/@identitate-ro/logos@1.3.1/logos/anaf/anaf.svg" alt="ANAF">
41
+ <img
42
+ src="https://cdn.jsdelivr.net/npm/@identitate-md/logos@1.3.1/logos/anaf/anaf.svg"
43
+ alt="ANAF"
44
+ />
39
45
 
40
46
  <!-- Simbol -->
41
- <img src="https://cdn.jsdelivr.net/npm/@identitate-ro/logos@1.3.1/logos/anaf/simbol-anaf.svg" alt="ANAF Simbol">
47
+ <img
48
+ src="https://cdn.jsdelivr.net/npm/@identitate-md/logos@1.3.1/logos/anaf/simbol-anaf.svg"
49
+ alt="ANAF Simbol"
50
+ />
42
51
 
43
52
  <!-- Versiunea latest (se actualizează automat) -->
44
- <img src="https://cdn.jsdelivr.net/npm/@identitate-ro/logos@1.3.1/logos/guvernul-romaniei/guvernul-romaniei.svg" alt="Guvernul României">
53
+ <img
54
+ src="https://cdn.jsdelivr.net/npm/@identitate-md/logos@1.3.1/logos/guvernul-republicii-moldova/guvernul-republicii-moldova.svg"
55
+ alt="Guvernul Republicii Moldova"
56
+ />
45
57
  ```
46
58
 
47
59
  #### unpkg (CDN Fallback)
48
60
 
49
61
  ```html
50
- <img src="https://unpkg.com/@identitate-ro/logos@1.3.1/logos/pnrr/pnrr.svg" alt="PNRR">
62
+ <img
63
+ src="https://unpkg.com/@identitate-md/logos@1.3.1/logos/pnrr/pnrr.svg"
64
+ alt="PNRR"
65
+ />
51
66
  ```
52
67
 
53
68
  ### Via npm Package
54
69
 
55
- După instalare, logo-urile sunt disponibile în `node_modules/@identitate-ro/logos/logos/`:
70
+ După instalare, logo-urile sunt disponibile în `node_modules/@identitate-md/logos/logos/`:
56
71
 
57
72
  ```javascript
58
73
  // În React, Vue, etc.
59
- import logoPath from '@identitate-ro/logos/logos/anaf/anaf.svg';
74
+ import logoPath from "@identitate-md/logos/logos/anaf/anaf.svg";
60
75
 
61
76
  function MyComponent() {
62
77
  return <img src={logoPath} alt="ANAF" />;
@@ -65,14 +80,14 @@ function MyComponent() {
65
80
 
66
81
  ```javascript
67
82
  // În Node.js
68
- import { readFileSync } from 'fs';
69
- import { join } from 'path';
83
+ import { readFileSync } from "fs";
84
+ import { join } from "path";
70
85
 
71
86
  const logoPath = join(
72
- process.cwd(),
73
- 'node_modules/@identitate-ro/logos/logos/anaf/anaf.svg'
87
+ process.cwd(),
88
+ "node_modules/@identitate-md/logos/logos/anaf/anaf.svg",
74
89
  );
75
- const logoContent = readFileSync(logoPath, 'utf8');
90
+ const logoContent = readFileSync(logoPath, "utf8");
76
91
  ```
77
92
 
78
93
  ### 🎯 Web Component (Recomandat pentru Aplicații Moderne)
@@ -82,6 +97,7 @@ const logoContent = readFileSync(logoPath, 'utf8');
82
97
  #### Cum funcționează?
83
98
 
84
99
  Web Component-ul `<identity-icon>` este un element HTML custom care:
100
+
85
101
  - ✅ Descarcă automat SVG-ul din CDN
86
102
  - ✅ Include caching inteligent (descarcă o singură dată)
87
103
  - ✅ Permite stilizare CSS (`color`, `width`, `height`, etc.)
@@ -93,28 +109,26 @@ Web Component-ul `<identity-icon>` este un element HTML custom care:
93
109
  **Pas 1: Instalează pachetul**
94
110
 
95
111
  ```bash
96
- npm install @identitate-ro/logos
112
+ npm install @identitate-md/logos
97
113
  ```
98
114
 
99
115
  **Pas 2: Importă loader-ul** (o singură dată în aplicație)
100
116
 
101
117
  ```javascript
102
118
  // În index.js, main.js, App.js, etc.
103
- import '@identitate-ro/logos/loader';
119
+ import "@identitate-md/logos/loader";
104
120
  ```
105
121
 
106
122
  Sau în HTML:
107
123
 
108
124
  ```html
109
- <script src="https://cdn.jsdelivr.net/npm/@identitate-ro/logos/identity-loader.js"></script>
125
+ <script src="https://cdn.jsdelivr.net/npm/@identitate-md/logos/identity-loader.js"></script>
110
126
  ```
111
127
 
112
128
  **Pas 3: Folosește tag-ul `<identity-icon>`**
113
129
 
114
130
  ```html
115
- <identity-icon
116
- src="https://identitate.eu/logos/anaf/anaf.svg">
117
- </identity-icon>
131
+ <identity-icon src="https://identitate.eu/logos/anaf/anaf.svg"> </identity-icon>
118
132
  ```
119
133
 
120
134
  #### Exemple Complete
@@ -124,29 +138,30 @@ Sau în HTML:
124
138
  ```html
125
139
  <!DOCTYPE html>
126
140
  <html>
127
- <head>
128
- <title>Logo Instituții</title>
129
- <script src="https://cdn.jsdelivr.net/npm/@identitate-ro/logos/identity-loader.js"></script>
130
- <style>
131
- .logo-guvern {
132
- width: 64px;
133
- height: 64px;
134
- color: #003399; /* Albastru */
135
- transition: color 0.3s;
136
- }
137
-
138
- .logo-guvern:hover {
139
- color: #ffcc00; /* Galben la hover */
140
- filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));
141
- }
142
- </style>
143
- </head>
144
- <body>
145
- <identity-icon
146
- src="https://identitate.eu/logos/guvernul-romaniei/guvernul-romaniei.svg"
147
- class="logo-guvern">
148
- </identity-icon>
149
- </body>
141
+ <head>
142
+ <title>Logo Instituții</title>
143
+ <script src="https://cdn.jsdelivr.net/npm/@identitate-md/logos/identity-loader.js"></script>
144
+ <style>
145
+ .logo-guvern {
146
+ width: 64px;
147
+ height: 64px;
148
+ color: #003399; /* Albastru */
149
+ transition: color 0.3s;
150
+ }
151
+
152
+ .logo-guvern:hover {
153
+ color: #ffcc00; /* Galben la hover */
154
+ filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
155
+ }
156
+ </style>
157
+ </head>
158
+ <body>
159
+ <identity-icon
160
+ src="https://identitate.eu/logos/guvernul-republicii-moldova/guvernul-republicii-moldova.svg"
161
+ class="logo-guvern"
162
+ >
163
+ </identity-icon>
164
+ </body>
150
165
  </html>
151
166
  ```
152
167
 
@@ -154,11 +169,11 @@ Sau în HTML:
154
169
 
155
170
  ```jsx
156
171
  // App.js sau index.js
157
- import '@identitate-ro/logos/loader';
172
+ import "@identitate-md/logos/loader";
158
173
 
159
174
  function InstitutionLogo({ slug }) {
160
175
  return (
161
- <identity-icon
176
+ <identity-icon
162
177
  src={`https://identitate.eu/logos/${slug}/${slug}.svg`}
163
178
  className="w-16 h-16 text-blue-600"
164
179
  />
@@ -166,7 +181,7 @@ function InstitutionLogo({ slug }) {
166
181
  }
167
182
 
168
183
  // Folosire
169
- <InstitutionLogo slug="anaf" />
184
+ <InstitutionLogo slug="anaf" />;
170
185
  ```
171
186
 
172
187
  ##### Vue
@@ -174,13 +189,13 @@ function InstitutionLogo({ slug }) {
174
189
  ```vue
175
190
  <script setup>
176
191
  // În main.js sau App.vue
177
- import '@identitate-ro/logos/loader';
192
+ import "@identitate-md/logos/loader";
178
193
 
179
- const props = defineProps(['institution']);
194
+ const props = defineProps(["institution"]);
180
195
  </script>
181
196
 
182
197
  <template>
183
- <identity-icon
198
+ <identity-icon
184
199
  :src="`https://identitate.eu/logos/${institution}/${institution}.svg`"
185
200
  class="logo-icon"
186
201
  />
@@ -199,29 +214,29 @@ const props = defineProps(['institution']);
199
214
 
200
215
  ```typescript
201
216
  // app.component.ts
202
- import '@identitate-ro/logos/loader';
217
+ import "@identitate-md/logos/loader";
203
218
 
204
219
  @Component({
205
- selector: 'app-institution-logo',
220
+ selector: "app-institution-logo",
206
221
  template: `
207
- <identity-icon
208
- [attr.src]="logoUrl"
209
- class="institution-logo">
222
+ <identity-icon [attr.src]="logoUrl" class="institution-logo">
210
223
  </identity-icon>
211
224
  `,
212
- styles: [`
213
- .institution-logo {
214
- width: 64px;
215
- height: 64px;
216
- color: #003399;
217
- }
218
- `]
225
+ styles: [
226
+ `
227
+ .institution-logo {
228
+ width: 64px;
229
+ height: 64px;
230
+ color: #003399;
231
+ }
232
+ `,
233
+ ],
219
234
  })
220
235
  export class InstitutionLogoComponent {
221
236
  @Input() slug!: string;
222
-
237
+
223
238
  get logoUrl() {
224
- return `https://cdn.jsdelivr.net/npm/@identitate-ro/logos/logos/${this.slug}/${this.slug}.svg`;
239
+ return `https://cdn.jsdelivr.net/npm/@identitate-md/logos/logos/${this.slug}/${this.slug}.svg`;
225
240
  }
226
241
  }
227
242
  ```
@@ -234,7 +249,7 @@ export class InstitutionLogoComponent {
234
249
  function enqueue_identity_loader() {
235
250
  wp_enqueue_script(
236
251
  'identity-loader',
237
- 'https://cdn.jsdelivr.net/npm/@identitate-ro/logos/identity-loader.js',
252
+ 'https://cdn.jsdelivr.net/npm/@identitate-md/logos/identity-loader.js',
238
253
  array(),
239
254
  '1.0.0',
240
255
  true
@@ -244,8 +259,8 @@ add_action('wp_enqueue_scripts', 'enqueue_identity_loader');
244
259
  ?>
245
260
 
246
261
  <!-- În template (page.php, single.php, etc.) -->
247
- <identity-icon
248
- src="https://cdn.jsdelivr.net/npm/@identitate-ro/logos@1.3.1/logos/primaria-cluj-napoca/primaria-cluj-napoca.svg"
262
+ <identity-icon
263
+ src="https://cdn.jsdelivr.net/npm/@identitate-md/logos@1.3.1/logos/primaria-cluj-napoca/primaria-cluj-napoca.svg"
249
264
  style="width: 100px; height: 100px; color: #2c5aa0;">
250
265
  </identity-icon>
251
266
  ```
@@ -272,7 +287,7 @@ identity-icon:hover {
272
287
 
273
288
  /* Efecte */
274
289
  identity-icon {
275
- filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
290
+ filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
276
291
  transition: all 0.3s ease;
277
292
  }
278
293
 
@@ -288,13 +303,14 @@ identity-icon {
288
303
  #### Atribute Suportate
289
304
 
290
305
  - `src` **(obligatoriu)** — URL-ul către logo-ul SVG
291
- - `size` *(opțional)* — Shortcut pentru width/height (ex: `size="64px"`)
306
+ - `size` _(opțional)_ — Shortcut pentru width/height (ex: `size="64px"`)
292
307
 
293
308
  ```html
294
309
  <!-- Cu size attribute -->
295
- <identity-icon
296
- src="https://cdn.jsdelivr.net/npm/@identitate-ro/logos/logos/anaf/anaf.svg"
297
- size="128px">
310
+ <identity-icon
311
+ src="https://cdn.jsdelivr.net/npm/@identitate-md/logos/logos/anaf/anaf.svg"
312
+ size="128px"
313
+ >
298
314
  </identity-icon>
299
315
  ```
300
316
 
@@ -312,7 +328,7 @@ identity-icon {
312
328
  Pachetul include `index.json` cu metadata despre toate logo-urile:
313
329
 
314
330
  ```javascript
315
- import metadata from '@identitate-ro/logos/index.json';
331
+ import metadata from "@identitate-md/logos/index.json";
316
332
 
317
333
  console.log(metadata.institutions);
318
334
  // [
@@ -336,15 +352,15 @@ console.log(metadata.institutions);
336
352
  ## 📁 Structură
337
353
 
338
354
  ```
339
- @identitate-ro/logos/
355
+ @identitate-md/logos/
340
356
  ├── logos/
341
357
  │ ├── anaf/
342
358
  │ │ ├── anaf.svg
343
359
  │ │ └── simbol-anaf.svg
344
- │ ├── guvernul-romaniei/
345
- │ │ ├── guvernul-romaniei.svg
346
- │ │ ├── guvernul-romaniei-alb.svg
347
- │ │ └── guvernul-romaniei-mono.svg
360
+ │ ├── guvernul-republicii-moldova/
361
+ │ │ ├── guvernul-republicii-moldova.svg
362
+ │ │ ├── guvernul-republicii-moldova-alb.svg
363
+ │ │ └── guvernul-republicii-moldova-mono.svg
348
364
  │ ├── ministerul-educatiei/
349
365
  │ ├── pnrr/
350
366
  │ ├── primaria-cluj-napoca/
@@ -372,20 +388,20 @@ Pentru fiecare instituție, logo-urile sunt disponibile în mai multe variante:
372
388
  ## 🔗 CDN URLs Pattern
373
389
 
374
390
  ```
375
- https://cdn.jsdelivr.net/npm/@identitate-ro/logos@{version}/logos/{slug}/{filename}.svg
391
+ https://cdn.jsdelivr.net/npm/@identitate-md/logos@{version}/logos/{slug}/{filename}.svg
376
392
  ```
377
393
 
378
394
  **Exemple:**
379
395
 
380
396
  ```
381
397
  # Versiune specifică (recomandată pentru producție)
382
- https://cdn.jsdelivr.net/npm/@identitate-ro/logos@1.0.0/logos/anaf/anaf.svg
398
+ https://cdn.jsdelivr.net/npm/@identitate-md/logos@1.0.0/logos/anaf/anaf.svg
383
399
 
384
400
  # Latest version (se actualizează automat)
385
- https://cdn.jsdelivr.net/npm/@identitate-ro/logos/logos/anaf/anaf.svg
401
+ https://cdn.jsdelivr.net/npm/@identitate-md/logos/logos/anaf/anaf.svg
386
402
 
387
403
  # Specific major version
388
- https://cdn.jsdelivr.net/npm/@identitate-ro/logos@1/logos/anaf/anaf.svg
404
+ https://cdn.jsdelivr.net/npm/@identitate-md/logos@1/logos/anaf/anaf.svg
389
405
  ```
390
406
 
391
407
  ## 📋 Lista Instituțiilor
@@ -393,7 +409,7 @@ https://cdn.jsdelivr.net/npm/@identitate-ro/logos@1/logos/anaf/anaf.svg
393
409
  Instituțiile disponibile în v1.0.0:
394
410
 
395
411
  - `anaf` — Agenția Națională de Administrare Fiscală
396
- - `guvernul-romaniei` — Guvernul României
412
+ - `guvernul-republicii-moldova` — Guvernul Republicii Moldova
397
413
  - `ministerul-educatiei` — Ministerul Educației
398
414
  - `pnrr` — Plan Național de Redresare și Reziliență
399
415
  - `primaria-cluj-napoca` — Primăria Cluj-Napoca
@@ -407,32 +423,26 @@ Pentru lista completă și actualizată, consultă [identitatero.vercel.app](htt
407
423
  ```html
408
424
  <!DOCTYPE html>
409
425
  <html>
410
- <head>
411
- <title>Logo-uri Instituții</title>
412
- </head>
413
- <body>
414
- <img
415
- src="https://cdn.jsdelivr.net/npm/@identitate-ro/logos/logos/anaf/anaf.svg"
416
- alt="ANAF"
417
- width="200"
418
- >
419
- </body>
426
+ <head>
427
+ <title>Logo-uri Instituții</title>
428
+ </head>
429
+ <body>
430
+ <img
431
+ src="https://cdn.jsdelivr.net/npm/@identitate-md/logos/logos/anaf/anaf.svg"
432
+ alt="ANAF"
433
+ width="200"
434
+ />
435
+ </body>
420
436
  </html>
421
437
  ```
422
438
 
423
439
  ### React/Next.js
424
440
 
425
441
  ```jsx
426
- export default function InstitutionLogo({ slug, variant = 'color' }) {
427
- const cdnUrl = `https://cdn.jsdelivr.net/npm/@identitate-ro/logos/logos/${slug}/${slug}.svg`;
428
-
429
- return (
430
- <img
431
- src={cdnUrl}
432
- alt={slug}
433
- loading="lazy"
434
- />
435
- );
442
+ export default function InstitutionLogo({ slug, variant = "color" }) {
443
+ const cdnUrl = `https://cdn.jsdelivr.net/npm/@identitate-md/logos/logos/${slug}/${slug}.svg`;
444
+
445
+ return <img src={cdnUrl} alt={slug} loading="lazy" />;
436
446
  }
437
447
  ```
438
448
 
@@ -440,20 +450,17 @@ export default function InstitutionLogo({ slug, variant = 'color' }) {
440
450
 
441
451
  ```vue
442
452
  <template>
443
- <img
444
- :src="logoUrl"
445
- :alt="institution"
446
- loading="lazy"
447
- />
453
+ <img :src="logoUrl" :alt="institution" loading="lazy" />
448
454
  </template>
449
455
 
450
456
  <script setup>
451
- import { computed } from 'vue';
457
+ import { computed } from "vue";
452
458
 
453
- const props = defineProps(['institution', 'variant']);
459
+ const props = defineProps(["institution", "variant"]);
454
460
 
455
- const logoUrl = computed(() =>
456
- `https://cdn.jsdelivr.net/npm/@identitate-ro/logos/logos/${props.institution}/${props.institution}.svg`
461
+ const logoUrl = computed(
462
+ () =>
463
+ `https://cdn.jsdelivr.net/npm/@identitate-md/logos/logos/${props.institution}/${props.institution}.svg`,
457
464
  );
458
465
  </script>
459
466
  ```
@@ -462,7 +469,7 @@ const logoUrl = computed(() =>
462
469
 
463
470
  ```css
464
471
  .anaf-logo {
465
- background-image: url('https://cdn.jsdelivr.net/npm/@identitate-ro/logos@1.3.1/logos/anaf/anaf.svg');
472
+ background-image: url("https://cdn.jsdelivr.net/npm/@identitate-md/logos@1.3.1/logos/anaf/anaf.svg");
466
473
  background-size: contain;
467
474
  background-repeat: no-repeat;
468
475
  width: 200px;
@@ -476,49 +483,53 @@ const logoUrl = computed(() =>
476
483
 
477
484
  ```html
478
485
  <!-- ✅ Bine - versiune fixată -->
479
- <img src="https://cdn.jsdelivr.net/npm/@identitate-ro/logos@1.0.0/logos/anaf/anaf.svg">
486
+ <img
487
+ src="https://cdn.jsdelivr.net/npm/@identitate-md/logos@1.0.0/logos/anaf/anaf.svg"
488
+ />
480
489
 
481
490
  <!-- ⚠️ Evită în producție - poate schimba -->
482
- <img src="https://cdn.jsdelivr.net/npm/@identitate-ro/logos@1.3.1/logos/anaf/anaf.svg">
491
+ <img
492
+ src="https://cdn.jsdelivr.net/npm/@identitate-md/logos@1.3.1/logos/anaf/anaf.svg"
493
+ />
483
494
  ```
484
495
 
485
496
  ### 2. Optimizare Performanță
486
497
 
487
498
  ```html
488
499
  <!-- Lazy loading -->
489
- <img
490
- src="https://cdn.jsdelivr.net/npm/@identitate-ro/logos/logos/anaf/anaf.svg"
500
+ <img
501
+ src="https://cdn.jsdelivr.net/npm/@identitate-md/logos/logos/anaf/anaf.svg"
491
502
  loading="lazy"
492
503
  alt="ANAF"
493
- >
504
+ />
494
505
 
495
506
  <!-- Preload pentru logo-uri critice -->
496
- <link
497
- rel="preload"
498
- href="https://cdn.jsdelivr.net/npm/@identitate-ro/logos/logos/guvernul-romaniei/guvernul-romaniei.svg"
507
+ <link
508
+ rel="preload"
509
+ href="https://cdn.jsdelivr.net/npm/@identitate-md/logos/logos/guvernul-republicii-moldova/guvernul-republicii-moldova.svg"
499
510
  as="image"
500
- >
511
+ />
501
512
  ```
502
513
 
503
514
  ### 3. Fallback Strategy
504
515
 
505
516
  ```html
506
- <img
507
- src="https://cdn.jsdelivr.net/npm/@identitate-ro/logos/logos/anaf/anaf.svg"
508
- onerror="this.src='https://unpkg.com/@identitate-ro/logos/logos/anaf/anaf.svg'"
517
+ <img
518
+ src="https://cdn.jsdelivr.net/npm/@identitate-md/logos/logos/anaf/anaf.svg"
519
+ onerror="this.src='https://unpkg.com/@identitate-md/logos/logos/anaf/anaf.svg'"
509
520
  alt="ANAF"
510
- >
521
+ />
511
522
  ```
512
523
 
513
524
  ### 4. Accesibilitate
514
525
 
515
526
  ```html
516
527
  <!-- ✅ Include întotdeauna alt text descriptiv -->
517
- <img
518
- src="https://cdn.jsdelivr.net/npm/@identitate-ro/logos/logos/anaf/anaf.svg"
528
+ <img
529
+ src="https://cdn.jsdelivr.net/npm/@identitate-md/logos/logos/anaf/anaf.svg"
519
530
  alt="Logo Agenția Națională de Administrare Fiscală"
520
531
  role="img"
521
- >
532
+ />
522
533
  ```
523
534
 
524
535
  ## 📄 Licență
@@ -542,13 +553,13 @@ Pentru a adăuga logo-uri noi sau pentru a raporta probleme:
542
553
  - **Website**: [identitatero.vercel.app](https://identitatero.vercel.app)
543
554
  - **Documentație**: [identitatero.vercel.app/utilizare](https://identitatero.vercel.app/utilizare)
544
555
  - **GitHub**: [github.com/laurentiucotet/IdentitateRO](https://github.com/laurentiucotet/IdentitateRO)
545
- - **npm Package**: [@identitate-ro/logos](https://www.npmjs.com/package/@identitate-ro/logos)
546
- - **jsDelivr CDN**: [cdn.jsdelivr.net/npm/@identitate-ro/logos](https://cdn.jsdelivr.net/npm/@identitate-ro/logos/)
547
- - **unpkg CDN**: [unpkg.com/@identitate-ro/logos](https://unpkg.com/@identitate-ro/logos/)
556
+ - **npm Package**: [@identitate-md/logos](https://www.npmjs.com/package/@identitate-md/logos)
557
+ - **jsDelivr CDN**: [cdn.jsdelivr.net/npm/@identitate-md/logos](https://cdn.jsdelivr.net/npm/@identitate-md/logos/)
558
+ - **unpkg CDN**: [unpkg.com/@identitate-md/logos](https://unpkg.com/@identitate-md/logos/)
548
559
 
549
560
  ## 📊 Stats
550
561
 
551
- ![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/@identitate-ro/logos/badge)
562
+ ![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/@identitate-md/logos/badge)
552
563
 
553
564
  ---
554
565
 
@@ -1,19 +1,19 @@
1
1
  /**
2
2
  * IdentitateRO Web Component Loader
3
- *
3
+ *
4
4
  * A custom HTML element for loading Romanian institution logos
5
5
  * Framework-agnostic, works with React, Vue, Angular, vanilla HTML, etc.
6
- *
6
+ *
7
7
  * Usage:
8
- * <identity-icon src="https://cdn.jsdelivr.net/npm/@identitate-ro/logos@latest/logos/anaf/anaf.svg"></identity-icon>
9
- *
8
+ * <identity-icon src="https://cdn.jsdelivr.net/npm/@identitate-md/logos@latest/logos/anaf/anaf.svg"></identity-icon>
9
+ *
10
10
  * Features:
11
11
  * - Automatic SVG fetching and injection
12
12
  * - Built-in caching (loads each SVG only once)
13
13
  * - CSS styling support (fill: currentColor)
14
14
  * - Error handling with fallback display
15
15
  * - Observable attributes (dynamic updates)
16
- *
16
+ *
17
17
  * @version 1.0.0
18
18
  * @license MIT
19
19
  */
@@ -38,7 +38,7 @@ class IdentityIcon extends HTMLElement {
38
38
  * Define which attributes to observe for changes
39
39
  */
40
40
  static get observedAttributes() {
41
- return ['src', 'size'];
41
+ return ["src", "size"];
42
42
  }
43
43
 
44
44
  /**
@@ -54,19 +54,23 @@ class IdentityIcon extends HTMLElement {
54
54
  * Main rendering logic
55
55
  */
56
56
  async render() {
57
- let url = this.getAttribute('src');
58
-
57
+ let url = this.getAttribute("src");
58
+
59
59
  if (!url) {
60
- this.showError('Missing src attribute');
60
+ this.showError("Missing src attribute");
61
61
  return;
62
62
  }
63
63
 
64
64
  // Resolve relative paths to absolute URLs (for local dev / same-origin usage)
65
- if (!url.startsWith('http://') && !url.startsWith('https://') && !url.startsWith('data:')) {
65
+ if (
66
+ !url.startsWith("http://") &&
67
+ !url.startsWith("https://") &&
68
+ !url.startsWith("data:")
69
+ ) {
66
70
  try {
67
71
  url = new URL(url, document.baseURI).href;
68
72
  } catch (e) {
69
- this.showError('Invalid URL: ' + url);
73
+ this.showError("Invalid URL: " + url);
70
74
  return;
71
75
  }
72
76
  }
@@ -84,15 +88,18 @@ class IdentityIcon extends HTMLElement {
84
88
  try {
85
89
  // Fetch SVG content
86
90
  const response = await fetch(url);
87
-
91
+
88
92
  if (!response.ok) {
89
93
  throw new Error(`HTTP ${response.status}: ${response.statusText}`);
90
94
  }
91
95
 
92
- const contentType = response.headers.get('content-type') || '';
93
- const isSvg = contentType.includes('svg') || contentType.includes('xml') || url.endsWith('.svg');
96
+ const contentType = response.headers.get("content-type") || "";
97
+ const isSvg =
98
+ contentType.includes("svg") ||
99
+ contentType.includes("xml") ||
100
+ url.endsWith(".svg");
94
101
  if (!isSvg) {
95
- throw new Error('Response is not an SVG file');
102
+ throw new Error("Response is not an SVG file");
96
103
  }
97
104
 
98
105
  const svgContent = await response.text();
@@ -105,9 +112,8 @@ class IdentityIcon extends HTMLElement {
105
112
 
106
113
  // Inject into DOM
107
114
  this.injectSvg(cleanedSvg);
108
-
109
115
  } catch (error) {
110
- console.error('[IdentitateRO] Failed to load logo:', url, error);
116
+ console.error("[IdentitateRO] Failed to load logo:", url, error);
111
117
  this.showError(error.message);
112
118
  } finally {
113
119
  this._isLoading = false;
@@ -120,9 +126,9 @@ class IdentityIcon extends HTMLElement {
120
126
  sanitizeSvg(svgContent) {
121
127
  // Remove script tags and event handlers
122
128
  return svgContent
123
- .replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '')
124
- .replace(/on\w+="[^"]*"/gi, '')
125
- .replace(/on\w+='[^']*'/gi, '');
129
+ .replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "")
130
+ .replace(/on\w+="[^"]*"/gi, "")
131
+ .replace(/on\w+='[^']*'/gi, "");
126
132
  }
127
133
 
128
134
  /**
@@ -132,32 +138,36 @@ class IdentityIcon extends HTMLElement {
132
138
  this.innerHTML = svgContent;
133
139
 
134
140
  // Configure SVG element for CSS styling
135
- const svg = this.querySelector('svg');
141
+ const svg = this.querySelector("svg");
136
142
  if (svg) {
137
143
  // Make SVG responsive
138
- svg.setAttribute('width', '100%');
139
- svg.setAttribute('height', '100%');
140
-
144
+ svg.setAttribute("width", "100%");
145
+ svg.setAttribute("height", "100%");
146
+
141
147
  // Enable CSS color control
142
- svg.style.fill = 'currentColor';
143
-
148
+ svg.style.fill = "currentColor";
149
+
144
150
  // Preserve aspect ratio
145
- if (!svg.hasAttribute('viewBox') && svg.hasAttribute('width') && svg.hasAttribute('height')) {
146
- const width = svg.getAttribute('width');
147
- const height = svg.getAttribute('height');
148
- svg.setAttribute('viewBox', `0 0 ${width} ${height}`);
151
+ if (
152
+ !svg.hasAttribute("viewBox") &&
153
+ svg.hasAttribute("width") &&
154
+ svg.hasAttribute("height")
155
+ ) {
156
+ const width = svg.getAttribute("width");
157
+ const height = svg.getAttribute("height");
158
+ svg.setAttribute("viewBox", `0 0 ${width} ${height}`);
149
159
  }
150
160
 
151
161
  // Apply size attribute if present
152
- const size = this.getAttribute('size');
162
+ const size = this.getAttribute("size");
153
163
  if (size) {
154
164
  this.style.width = size;
155
165
  this.style.height = size;
156
166
  }
157
167
 
158
168
  // Ensure display is set
159
- if (!this.style.display || this.style.display === '') {
160
- this.style.display = 'inline-block';
169
+ if (!this.style.display || this.style.display === "") {
170
+ this.style.display = "inline-block";
161
171
  }
162
172
  }
163
173
  }
@@ -167,7 +177,7 @@ class IdentityIcon extends HTMLElement {
167
177
  */
168
178
  showLoading() {
169
179
  this.innerHTML = `<span style="opacity: 0.5; font-size: 0.75em;">⏳</span>`;
170
- this.setAttribute('aria-busy', 'true');
180
+ this.setAttribute("aria-busy", "true");
171
181
  }
172
182
 
173
183
  /**
@@ -175,17 +185,17 @@ class IdentityIcon extends HTMLElement {
175
185
  */
176
186
  showError(message) {
177
187
  this.innerHTML = `<span style="opacity: 0.5; font-size: 0.75em;" title="${message}">⚠️</span>`;
178
- this.setAttribute('aria-invalid', 'true');
179
- this.removeAttribute('aria-busy');
188
+ this.setAttribute("aria-invalid", "true");
189
+ this.removeAttribute("aria-busy");
180
190
  }
181
191
  }
182
192
 
183
193
  // Register the custom element
184
- if (!customElements.get('identity-icon')) {
185
- customElements.define('identity-icon', IdentityIcon);
194
+ if (!customElements.get("identity-icon")) {
195
+ customElements.define("identity-icon", IdentityIcon);
186
196
  }
187
197
 
188
198
  // Export for module environments
189
- if (typeof module !== 'undefined' && module.exports) {
199
+ if (typeof module !== "undefined" && module.exports) {
190
200
  module.exports = IdentityIcon;
191
201
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@identitate-md/logos",
3
- "version": "1.3.6",
3
+ "version": "1.3.8",
4
4
  "description": "Logo-uri oficiale ale instituțiilor publice din Republica Moldova — Official logos of public institutions from the Republic of Moldova",
5
5
  "license": "MIT",
6
6
  "author": "IdentitateMD Contributors",