From 73ff321411e1ea00c1221cc673a6c6f59677c089 Mon Sep 17 00:00:00 2001 From: "Endurance, the Martian" Date: Tue, 15 Aug 2023 20:47:52 +0100 Subject: [PATCH] added/ support for flag imports individually Co-authored-by: Adewale Abdulrazaq --- README.md | 41 ++++++++ package.json | 2 +- src/flags.ts | 270 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/index.ts | 2 +- 4 files changed, 313 insertions(+), 2 deletions(-) create mode 100644 src/flags.ts diff --git a/README.md b/README.md index e7ba95e..08b6e26 100644 --- a/README.md +++ b/README.md @@ -527,6 +527,47 @@ In order to use the flag class, you need to add the flag class to the element, f ``` +## Flags Import 🚩 +You can import the flags in your project, you can do that by importing the `flags` folder from the library, for example, if you want to import the flags in your app, you can do the following: +- Vue.js +```javascript + + + +``` +- React.js +```jsx +import { AD, AE } from '@amplifiedhq/countries-atlas/dist/flags'; + +const App = () => { + return ( +
+ + +
+ ); +} + +export default App; +``` + ## Contributing 🤝 Contributions, issues and feature requests are welcome. After cloning & setting up project locally, you can just submit a PR to this repo and it will be deployed once it's accepted. diff --git a/package.json b/package.json index 4ecc232..e7ba652 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@amplifiedhq/countries-atlas", - "version": "1.0.5", + "version": "1.1.0", "description": "Uncover the world with a single lightweight library - countries, codes, currencies, flags, languages, cities, and more 🌎", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/flags.ts b/src/flags.ts new file mode 100644 index 0000000..712db84 --- /dev/null +++ b/src/flags.ts @@ -0,0 +1,270 @@ +/** + * @packageDocumentation + * @module amplifiedhq/countries-atlas + * @author AmplifiedHQ + * + * @description This is the flag entry point for the Countries Atlas package. + * + * @license MIT + * + * @example + * import { AD } from '@amplifiedhq/countries-atlas/flags'; + * + * + * @see {@link https://github.com/amplifiedhq/countries-atlas GitHub} + * + * + */ + +export { default as HN } from '../dist/flags/svg/hn.svg'; +export { default as DM } from '../dist/flags/svg/dm.svg'; +export { default as FR } from '../dist/flags/svg/fr.svg'; +export { default as DZ } from '../dist/flags/svg/dz.svg'; +export { default as GA } from '../dist/flags/svg/ga.svg'; +export { default as PH } from '../dist/flags/svg/ph.svg'; +export { default as SS } from '../dist/flags/svg/ss.svg'; +export { default as RW } from '../dist/flags/svg/rw.svg'; +export { default as SD } from '../dist/flags/svg/sd.svg'; +export { default as SE } from '../dist/flags/svg/se.svg'; +export { default as SR } from '../dist/flags/svg/sr.svg'; +export { default as EH } from '../dist/flags/svg/eh.svg'; +export { default as GW } from '../dist/flags/svg/gw.svg'; +export { default as JP } from '../dist/flags/svg/jp.svg'; +export { default as HM } from '../dist/flags/svg/hm.svg'; +export { default as JE } from '../dist/flags/svg/je.svg'; +export { default as GU } from '../dist/flags/svg/gu.svg'; +export { default as GB } from '../dist/flags/svg/gb.svg'; +export { default as PK } from '../dist/flags/svg/pk.svg'; +export { default as SG } from '../dist/flags/svg/sg.svg'; +export { default as RU } from '../dist/flags/svg/ru.svg'; +export { default as DO } from '../dist/flags/svg/do.svg'; +export { default as GT } from '../dist/flags/svg/gt.svg'; +export { default as KW } from '../dist/flags/svg/kw.svg'; +export { default as IL } from '../dist/flags/svg/il.svg'; +export { default as GG } from '../dist/flags/svg/gg.svg'; +export { default as GP } from '../dist/flags/svg/gp.svg'; +export { default as DK } from '../dist/flags/svg/dk.svg'; +export { default as SB } from '../dist/flags/svg/sb.svg'; +export { default as PY } from '../dist/flags/svg/py.svg'; +export { default as PN } from '../dist/flags/svg/pn.svg'; +export { default as ST } from '../dist/flags/svg/st.svg'; +export { default as SC } from '../dist/flags/svg/sc.svg'; +export { default as DJ } from '../dist/flags/svg/dj.svg'; +export { default as GQ } from '../dist/flags/svg/gq.svg'; +export { default as GF } from '../dist/flags/svg/gf.svg'; +export { default as KR } from '../dist/flags/svg/kr.svg'; +export { default as IM } from '../dist/flags/svg/im.svg'; +export { default as KE } from '../dist/flags/svg/ke.svg'; +export { default as KG } from '../dist/flags/svg/kg.svg'; +export { default as HK } from '../dist/flags/svg/hk.svg'; +export { default as KP } from '../dist/flags/svg/kp.svg'; +export { default as IO } from '../dist/flags/svg/io.svg'; +export { default as GD } from '../dist/flags/svg/gd.svg'; +export { default as GS } from '../dist/flags/svg/gs.svg'; +export { default as SA } from '../dist/flags/svg/sa.svg'; +export { default as RE } from '../dist/flags/svg/re.svg'; +export { default as PM } from '../dist/flags/svg/pm.svg'; +export { default as SV } from '../dist/flags/svg/sv.svg'; +export { default as RS } from '../dist/flags/svg/rs.svg'; +export { default as PL } from '../dist/flags/svg/pl.svg'; +export { default as GR } from '../dist/flags/svg/gr.svg'; +export { default as GE } from '../dist/flags/svg/ge.svg'; +export { default as IN } from '../dist/flags/svg/in.svg'; +export { default as MV } from '../dist/flags/svg/mv.svg'; +export { default as LR } from '../dist/flags/svg/lr.svg'; +export { default as MA } from '../dist/flags/svg/ma.svg'; +export { default as NZ } from '../dist/flags/svg/nz.svg'; +export { default as AU } from '../dist/flags/svg/au.svg'; +export { default as BN } from '../dist/flags/svg/bn.svg'; +export { default as BY } from '../dist/flags/svg/by.svg'; +export { default as TT } from '../dist/flags/svg/tt.svg'; +export { default as UG } from '../dist/flags/svg/ug.svg'; +export { default as TC } from '../dist/flags/svg/tc.svg'; +export { default as YE } from '../dist/flags/svg/ye.svg'; +export { default as CK } from '../dist/flags/svg/ck.svg'; +export { default as BO } from '../dist/flags/svg/bo.svg'; +export { default as AT } from '../dist/flags/svg/at.svg'; +export { default as LS } from '../dist/flags/svg/ls.svg'; +export { default as MW } from '../dist/flags/svg/mw.svg'; +export { default as NL } from '../dist/flags/svg/nl.svg'; +export { default as MU } from '../dist/flags/svg/mu.svg'; +export { default as CI } from '../dist/flags/svg/ci.svg'; +export { default as BM } from '../dist/flags/svg/bm.svg'; +export { default as BZ } from '../dist/flags/svg/bz.svg'; +export { default as TW } from '../dist/flags/svg/tw.svg'; +export { default as US } from '../dist/flags/svg/us.svg'; +export { default as VI } from '../dist/flags/svg/vi.svg'; +export { default as TV } from '../dist/flags/svg/tv.svg'; +export { default as BL } from '../dist/flags/svg/bl.svg'; +export { default as AW } from '../dist/flags/svg/aw.svg'; +export { default as CH } from '../dist/flags/svg/ch.svg'; +export { default as MC } from '../dist/flags/svg/mc.svg'; +export { default as MT } from '../dist/flags/svg/mt.svg'; +export { default as NO } from '../dist/flags/svg/no.svg'; +export { default as LC } from '../dist/flags/svg/lc.svg'; +export { default as MG } from '../dist/flags/svg/mg.svg'; +export { default as LT } from '../dist/flags/svg/lt.svg'; +export { default as MP } from '../dist/flags/svg/mp.svg'; +export { default as AD } from '../dist/flags/svg/ad.svg'; +export { default as CL } from '../dist/flags/svg/cl.svg'; +export { default as AS } from '../dist/flags/svg/as.svg'; +export { default as BH } from '../dist/flags/svg/bh.svg'; +export { default as UA } from '../dist/flags/svg/ua.svg'; +export { default as TR } from '../dist/flags/svg/tr.svg'; +export { default as YT } from '../dist/flags/svg/yt.svg'; +export { default as TD } from '../dist/flags/svg/td.svg'; +export { default as BI } from '../dist/flags/svg/bi.svg'; +export { default as AR } from '../dist/flags/svg/ar.svg'; +export { default as CM } from '../dist/flags/svg/cm.svg'; +export { default as AE } from '../dist/flags/svg/ae.svg'; +export { default as CZ } from '../dist/flags/svg/cz.svg'; +export { default as MQ } from '../dist/flags/svg/mq.svg'; +export { default as LU } from '../dist/flags/svg/lu.svg'; +export { default as MF } from '../dist/flags/svg/mf.svg'; +export { default as LB } from '../dist/flags/svg/lb.svg'; +export { default as MD } from '../dist/flags/svg/md.svg'; +export { default as MS } from '../dist/flags/svg/ms.svg'; +export { default as AG } from '../dist/flags/svg/ag.svg'; +export { default as CX } from '../dist/flags/svg/cx.svg'; +export { default as CO } from '../dist/flags/svg/co.svg'; +export { default as TF } from '../dist/flags/svg/tf.svg'; +export { default as VN } from '../dist/flags/svg/vn.svg'; +export { default as ZM } from '../dist/flags/svg/zm.svg'; +export { default as TG } from '../dist/flags/svg/tg.svg'; +export { default as CN } from '../dist/flags/svg/cn.svg'; +export { default as BJ } from '../dist/flags/svg/bj.svg'; +export { default as AQ } from '../dist/flags/svg/aq.svg'; +export { default as CY } from '../dist/flags/svg/cy.svg'; +export { default as AF } from '../dist/flags/svg/af.svg'; +export { default as LV } from '../dist/flags/svg/lv.svg'; +export { default as OM } from '../dist/flags/svg/om.svg'; +export { default as MR } from '../dist/flags/svg/mr.svg'; +export { default as NI } from '../dist/flags/svg/ni.svg'; +export { default as LA } from '../dist/flags/svg/la.svg'; +export { default as ME } from '../dist/flags/svg/me.svg'; +export { default as MH } from '../dist/flags/svg/mh.svg'; +export { default as CC } from '../dist/flags/svg/cc.svg'; +export { default as BG } from '../dist/flags/svg/bg.svg'; +export { default as TJ } from '../dist/flags/svg/tj.svg'; +export { default as VU } from '../dist/flags/svg/vu.svg'; +export { default as WF } from '../dist/flags/svg/wf.svg'; +export { default as UY } from '../dist/flags/svg/uy.svg'; +export { default as ZA } from '../dist/flags/svg/za.svg'; +export { default as ZW } from '../dist/flags/svg/zw.svg'; +export { default as VC } from '../dist/flags/svg/vc.svg'; +export { default as TK } from '../dist/flags/svg/tk.svg'; +export { default as BF } from '../dist/flags/svg/bf.svg'; +export { default as BQ } from '../dist/flags/svg/bq.svg'; +export { default as CU } from '../dist/flags/svg/cu.svg'; +export { default as NE } from '../dist/flags/svg/ne.svg'; +export { default as NR } from '../dist/flags/svg/nr.svg'; +export { default as MK } from '../dist/flags/svg/mk.svg'; +export { default as NP } from '../dist/flags/svg/np.svg'; +export { default as NG } from '../dist/flags/svg/ng.svg'; +export { default as BS } from '../dist/flags/svg/bs.svg'; +export { default as CW } from '../dist/flags/svg/cw.svg'; +export { default as BD } from '../dist/flags/svg/bd.svg'; +export { default as UM } from '../dist/flags/svg/um.svg'; +export { default as VA } from '../dist/flags/svg/va.svg'; +export { default as UZ } from '../dist/flags/svg/uz.svg'; +export { default as XK } from '../dist/flags/svg/xk.svg'; +export { default as WS } from '../dist/flags/svg/ws.svg'; +export { default as TH } from '../dist/flags/svg/th.svg'; +export { default as CA } from '../dist/flags/svg/ca.svg'; +export { default as BE } from '../dist/flags/svg/be.svg'; +export { default as CV } from '../dist/flags/svg/cv.svg'; +export { default as AI } from '../dist/flags/svg/ai.svg'; +export { default as BR } from '../dist/flags/svg/br.svg'; +export { default as LY } from '../dist/flags/svg/ly.svg'; +export { default as NF } from '../dist/flags/svg/nf.svg'; +export { default as MY } from '../dist/flags/svg/my.svg'; +export { default as MN } from '../dist/flags/svg/mn.svg'; +export { default as NU } from '../dist/flags/svg/nu.svg'; +export { default as AZ } from '../dist/flags/svg/az.svg'; +export { default as BA } from '../dist/flags/svg/ba.svg'; +export { default as BV } from '../dist/flags/svg/bv.svg'; +export { default as AM } from '../dist/flags/svg/am.svg'; +export { default as CR } from '../dist/flags/svg/cr.svg'; +export { default as TL } from '../dist/flags/svg/tl.svg'; +export { default as TM } from '../dist/flags/svg/tm.svg'; +export { default as TZ } from '../dist/flags/svg/tz.svg'; +export { default as VE } from '../dist/flags/svg/ve.svg'; +export { default as AL } from '../dist/flags/svg/al.svg'; +export { default as BW } from '../dist/flags/svg/bw.svg'; +export { default as CD } from '../dist/flags/svg/cd.svg'; +export { default as LK } from '../dist/flags/svg/lk.svg'; +export { default as MO } from '../dist/flags/svg/mo.svg'; +export { default as MX } from '../dist/flags/svg/mx.svg'; +export { default as NC } from '../dist/flags/svg/nc.svg'; +export { default as NA } from '../dist/flags/svg/na.svg'; +export { default as MZ } from '../dist/flags/svg/mz.svg'; +export { default as LI } from '../dist/flags/svg/li.svg'; +export { default as MM } from '../dist/flags/svg/mm.svg'; +export { default as CF } from '../dist/flags/svg/cf.svg'; +export { default as BB } from '../dist/flags/svg/bb.svg'; +export { default as VG } from '../dist/flags/svg/vg.svg'; +export { default as TO } from '../dist/flags/svg/to.svg'; +export { default as TN } from '../dist/flags/svg/tn.svg'; +export { default as AO } from '../dist/flags/svg/ao.svg'; +export { default as BT } from '../dist/flags/svg/bt.svg'; +export { default as AX } from '../dist/flags/svg/ax.svg'; +export { default as CG } from '../dist/flags/svg/cg.svg'; +export { default as ML } from '../dist/flags/svg/ml.svg'; +export { default as JO } from '../dist/flags/svg/jo.svg'; +export { default as IT } from '../dist/flags/svg/it.svg'; +export { default as GH } from '../dist/flags/svg/gh.svg'; +export { default as SM } from '../dist/flags/svg/sm.svg'; +export { default as PA } from '../dist/flags/svg/pa.svg'; +export { default as SZ } from '../dist/flags/svg/sz.svg'; +export { default as PW } from '../dist/flags/svg/pw.svg'; +export { default as SL } from '../dist/flags/svg/sl.svg'; +export { default as DE } from '../dist/flags/svg/de.svg'; +export { default as GI } from '../dist/flags/svg/gi.svg'; +export { default as FM } from '../dist/flags/svg/fm.svg'; +export { default as KH } from '../dist/flags/svg/kh.svg'; +export { default as ET } from '../dist/flags/svg/et.svg'; +export { default as FO } from '../dist/flags/svg/fo.svg'; +export { default as EC } from '../dist/flags/svg/ec.svg'; +export { default as SN } from '../dist/flags/svg/sn.svg'; +export { default as SY } from '../dist/flags/svg/sy.svg'; +export { default as SX } from '../dist/flags/svg/sx.svg'; +export { default as PT } from '../dist/flags/svg/pt.svg'; +export { default as SO } from '../dist/flags/svg/so.svg'; +export { default as JM } from '../dist/flags/svg/jm.svg'; +export { default as HR } from '../dist/flags/svg/hr.svg'; +export { default as KI } from '../dist/flags/svg/ki.svg'; +export { default as KZ } from '../dist/flags/svg/kz.svg'; +export { default as IE } from '../dist/flags/svg/ie.svg'; +export { default as KM } from '../dist/flags/svg/km.svg'; +export { default as IR } from '../dist/flags/svg/ir.svg'; +export { default as GY } from '../dist/flags/svg/gy.svg'; +export { default as GN } from '../dist/flags/svg/gn.svg'; +export { default as FJ } from '../dist/flags/svg/fj.svg'; +export { default as PG } from '../dist/flags/svg/pg.svg'; +export { default as SK } from '../dist/flags/svg/sk.svg'; +export { default as RO } from '../dist/flags/svg/ro.svg'; +export { default as SJ } from '../dist/flags/svg/sj.svg'; +export { default as PF } from '../dist/flags/svg/pf.svg'; +export { default as FK } from '../dist/flags/svg/fk.svg'; +export { default as EG } from '../dist/flags/svg/eg.svg'; +export { default as IS } from '../dist/flags/svg/is.svg'; +export { default as ID } from '../dist/flags/svg/id.svg'; +export { default as KY } from '../dist/flags/svg/ky.svg'; +export { default as IQ } from '../dist/flags/svg/iq.svg'; +export { default as KN } from '../dist/flags/svg/kn.svg'; +export { default as HU } from '../dist/flags/svg/hu.svg'; +export { default as EE } from '../dist/flags/svg/ee.svg'; +export { default as ER } from '../dist/flags/svg/er.svg'; +export { default as FI } from '../dist/flags/svg/fi.svg'; +export { default as GM } from '../dist/flags/svg/gm.svg'; +export { default as SH } from '../dist/flags/svg/sh.svg'; +export { default as PS } from '../dist/flags/svg/ps.svg'; +export { default as PR } from '../dist/flags/svg/pr.svg'; +export { default as SI } from '../dist/flags/svg/si.svg'; +export { default as PE } from '../dist/flags/svg/pe.svg'; +export { default as QA } from '../dist/flags/svg/qa.svg'; +export { default as GL } from '../dist/flags/svg/gl.svg'; +export { default as ES } from '../dist/flags/svg/es.svg'; +export { default as HT } from '../dist/flags/svg/ht.svg'; + + diff --git a/src/index.ts b/src/index.ts index a95810e..d64b3ae 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,7 +9,7 @@ * * @example * import { CountriesAtlas } from '@amplifiedhq/countries-atlas'; - * + * import { ValidatorAtlas } from '@amplifiedhq/countries-atlas'; * const countries = CountriesAtlas.getCountries(); * const country = CountriesAtlas.find('US'); *