@travel-match/ui 0.5.1 → 0.6.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 +26 -0
- package/dist/countries/ad.webp +0 -0
- package/dist/countries/ae.webp +0 -0
- package/dist/countries/af.webp +0 -0
- package/dist/countries/al.webp +0 -0
- package/dist/countries/am.webp +0 -0
- package/dist/countries/at.webp +0 -0
- package/dist/countries/az.webp +0 -0
- package/dist/countries/ba.webp +0 -0
- package/dist/countries/bd.webp +0 -0
- package/dist/countries/be.webp +0 -0
- package/dist/countries/bg.webp +0 -0
- package/dist/countries/bn.webp +0 -0
- package/dist/countries/bt.webp +0 -0
- package/dist/countries/by.webp +0 -0
- package/dist/countries/ch.webp +0 -0
- package/dist/countries/cn.webp +0 -0
- package/dist/countries/cy.webp +0 -0
- package/dist/countries/cz.webp +0 -0
- package/dist/countries/de.webp +0 -0
- package/dist/countries/dk.webp +0 -0
- package/dist/countries/ee.webp +0 -0
- package/dist/countries/es.webp +0 -0
- package/dist/countries/fi.webp +0 -0
- package/dist/countries/fr.webp +0 -0
- package/dist/countries/gb.webp +0 -0
- package/dist/countries/ge.webp +0 -0
- package/dist/countries/gr.webp +0 -0
- package/dist/countries/hr.webp +0 -0
- package/dist/countries/hu.webp +0 -0
- package/dist/countries/id.webp +0 -0
- package/dist/countries/ie.webp +0 -0
- package/dist/countries/il.webp +0 -0
- package/dist/countries/in.webp +0 -0
- package/dist/countries/iq.webp +0 -0
- package/dist/countries/ir.webp +0 -0
- package/dist/countries/is.webp +0 -0
- package/dist/countries/it.webp +0 -0
- package/dist/countries/jo.webp +0 -0
- package/dist/countries/jp.webp +0 -0
- package/dist/countries/kg.webp +0 -0
- package/dist/countries/kh.webp +0 -0
- package/dist/countries/kp.webp +0 -0
- package/dist/countries/kr.webp +0 -0
- package/dist/countries/kz.webp +0 -0
- package/dist/countries/la.webp +0 -0
- package/dist/countries/lb.webp +0 -0
- package/dist/countries/li.webp +0 -0
- package/dist/countries/lk.webp +0 -0
- package/dist/countries/lt.webp +0 -0
- package/dist/countries/lu.webp +0 -0
- package/dist/countries/lv.webp +0 -0
- package/dist/countries/mc.webp +0 -0
- package/dist/countries/md.webp +0 -0
- package/dist/countries/me.webp +0 -0
- package/dist/countries/mk.webp +0 -0
- package/dist/countries/mm.webp +0 -0
- package/dist/countries/mn.webp +0 -0
- package/dist/countries/mt.webp +0 -0
- package/dist/countries/mv.webp +0 -0
- package/dist/countries/my.webp +0 -0
- package/dist/countries/nl.webp +0 -0
- package/dist/countries/no.webp +0 -0
- package/dist/countries/np.webp +0 -0
- package/dist/countries/om.webp +0 -0
- package/dist/countries/ph.webp +0 -0
- package/dist/countries/pk.webp +0 -0
- package/dist/countries/pl.webp +0 -0
- package/dist/countries/ps.webp +0 -0
- package/dist/countries/pt.webp +0 -0
- package/dist/countries/ro.webp +0 -0
- package/dist/countries/rs.webp +0 -0
- package/dist/countries/ru.webp +0 -0
- package/dist/countries/sa.webp +0 -0
- package/dist/countries/se.webp +0 -0
- package/dist/countries/sg.webp +0 -0
- package/dist/countries/si.webp +0 -0
- package/dist/countries/sk.webp +0 -0
- package/dist/countries/sm.webp +0 -0
- package/dist/countries/th.webp +0 -0
- package/dist/countries/tj.webp +0 -0
- package/dist/countries/tl.webp +0 -0
- package/dist/countries/tm.webp +0 -0
- package/dist/countries/tr.webp +0 -0
- package/dist/countries/tw.webp +0 -0
- package/dist/countries/ua.webp +0 -0
- package/dist/countries/us.webp +0 -0
- package/dist/countries/uz.webp +0 -0
- package/dist/countries/va.webp +0 -0
- package/dist/countries/vn.webp +0 -0
- package/dist/countries.cjs +2 -0
- package/dist/countries.cjs.map +1 -0
- package/dist/countries.d.cts +101 -0
- package/dist/countries.d.ts +101 -0
- package/dist/countries.js +9 -0
- package/dist/countries.js.map +1 -0
- package/package.json +12 -1
package/README.md
CHANGED
|
@@ -80,6 +80,32 @@ Components are client components (`'use client'` is baked into the bundle) and c
|
|
|
80
80
|
|
|
81
81
|
Naming rule: take the Figma variable name, lower-case it, replace `/` and spaces with `-`, prefix `--tm-`. `Line Height/H1` → `--tm-line-height-h1`. This is also how Figma MCP output (`var(--primary\/default)`) maps to code.
|
|
82
82
|
|
|
83
|
+
### Country photos
|
|
84
|
+
|
|
85
|
+
89 country card photos (1536×1024 WebP, about 330 KB each) ship in the package as `@travel-match/ui/countries/<code>.webp` (lowercase ISO 3166-1 alpha-2 code, e.g. `am.webp`). The prompts they were generated from are in `assets/countries/generation.json` (repo only, not published).
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
import { getCountryImage, countryImageCodes } from '@travel-match/ui/countries';
|
|
89
|
+
|
|
90
|
+
getCountryImage('AM'); // '/images/countries/am.webp'
|
|
91
|
+
getCountryImage('am', { baseUrl: 'https://cdn.example/countries' }); // 'https://cdn.example/countries/am.webp'
|
|
92
|
+
getCountryImage('ZZ'); // undefined — no photo, show a fallback
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
The helper only builds URLs; the app serves the files. In a Next.js app, copy them into `public/` before `dev` and `build` and keep the copy out of git:
|
|
96
|
+
|
|
97
|
+
```jsonc
|
|
98
|
+
// package.json
|
|
99
|
+
"predev": "cp -r node_modules/@travel-match/ui/dist/countries public/images/",
|
|
100
|
+
"prebuild": "cp -r node_modules/@travel-match/ui/dist/countries public/images/"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
```gitignore
|
|
104
|
+
/public/images/countries
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
To serve them from object storage or a CDN instead, upload `dist/countries` and pass its URL as `baseUrl`. New photos go into `assets/countries/` (same size and style); the test fails until the file and `countryImageCodes` in `src/countries/index.ts` match.
|
|
108
|
+
|
|
83
109
|
## Develop
|
|
84
110
|
|
|
85
111
|
```bash
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=`AD.AE.AF.AL.AM.AT.AZ.BA.BD.BE.BG.BN.BT.BY.CH.CN.CY.CZ.DE.DK.EE.ES.FI.FR.GB.GE.GR.HR.HU.ID.IE.IL.IN.IQ.IR.IS.IT.JO.JP.KG.KH.KP.KR.KZ.LA.LB.LI.LK.LT.LU.LV.MC.MD.ME.MK.MM.MN.MT.MV.MY.NL.NO.NP.OM.PH.PK.PL.PS.PT.RO.RS.RU.SA.SE.SG.SI.SK.SM.TH.TJ.TL.TM.TR.TW.UA.US.UZ.VA.VN`.split(`.`),t=new Set(e);function n(e,{baseUrl:n=`/images/countries`}={}){let r=e.trim().toUpperCase();if(t.has(r))return`${n.replace(/\/+$/,``)}/${r.toLowerCase()}.webp`}exports.countryImageCodes=e,exports.getCountryImage=n;
|
|
2
|
+
//# sourceMappingURL=countries.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"countries.cjs","names":["countryImageCodes","available","getCountryImage","code","countryCode","baseUrl"],"sources":["../src/countries/index.ts"],"sourcesContent":["/** ISO 3166-1 alpha-2 codes (uppercase) that have a country card photo in `@travel-match/ui/countries/<code>.webp`. */\nexport const countryImageCodes = [\n 'AD',\n 'AE',\n 'AF',\n 'AL',\n 'AM',\n 'AT',\n 'AZ',\n 'BA',\n 'BD',\n 'BE',\n 'BG',\n 'BN',\n 'BT',\n 'BY',\n 'CH',\n 'CN',\n 'CY',\n 'CZ',\n 'DE',\n 'DK',\n 'EE',\n 'ES',\n 'FI',\n 'FR',\n 'GB',\n 'GE',\n 'GR',\n 'HR',\n 'HU',\n 'ID',\n 'IE',\n 'IL',\n 'IN',\n 'IQ',\n 'IR',\n 'IS',\n 'IT',\n 'JO',\n 'JP',\n 'KG',\n 'KH',\n 'KP',\n 'KR',\n 'KZ',\n 'LA',\n 'LB',\n 'LI',\n 'LK',\n 'LT',\n 'LU',\n 'LV',\n 'MC',\n 'MD',\n 'ME',\n 'MK',\n 'MM',\n 'MN',\n 'MT',\n 'MV',\n 'MY',\n 'NL',\n 'NO',\n 'NP',\n 'OM',\n 'PH',\n 'PK',\n 'PL',\n 'PS',\n 'PT',\n 'RO',\n 'RS',\n 'RU',\n 'SA',\n 'SE',\n 'SG',\n 'SI',\n 'SK',\n 'SM',\n 'TH',\n 'TJ',\n 'TL',\n 'TM',\n 'TR',\n 'TW',\n 'UA',\n 'US',\n 'UZ',\n 'VA',\n 'VN',\n] as const;\n\nexport type CountryImageCode = (typeof countryImageCodes)[number];\n\nexport interface CountryImageOptions {\n /** URL prefix the app serves the package's `dist/countries` folder under. Default: `/images/countries`. */\n baseUrl?: string;\n}\n\nconst available: ReadonlySet<string> = new Set(countryImageCodes);\n\n/** Photo URL for a country code (any casing, surrounding whitespace ignored); `undefined` when there is no photo. */\nexport function getCountryImage(countryCode: string, { baseUrl = '/images/countries' }: CountryImageOptions = {}): string | undefined {\n const code = countryCode.trim().toUpperCase();\n if (!available.has(code)) return undefined;\n return `${baseUrl.replace(/\\/+$/, '')}/${code.toLowerCase()}.webp`;\n}\n"],"mappings":"A,mEACA,IAAaA,EAAoB,sRA0FjC,EASMC,EAAiC,IAAI,IAAID,CAAiB,EAGhE,SAAgBE,EAAgB,EAAqB,CAAE,UAAU,qBAA6C,CAAC,EAAuB,CACpI,IAAMC,EAAOC,EAAY,KAAK,CAAC,CAAC,YAAY,EAC5C,GAAKH,EAAU,IAAIE,CAAI,EACvB,MAAO,GAAGE,EAAQ,QAAQ,OAAQ,EAAE,EAAE,GAAGF,EAAK,YAAY,EAAE,MAC9D,C"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/** ISO 3166-1 alpha-2 codes (uppercase) that have a country card photo in `@travel-match/ui/countries/<code>.webp`. */
|
|
2
|
+
export declare const countryImageCodes: readonly [
|
|
3
|
+
"AD",
|
|
4
|
+
"AE",
|
|
5
|
+
"AF",
|
|
6
|
+
"AL",
|
|
7
|
+
"AM",
|
|
8
|
+
"AT",
|
|
9
|
+
"AZ",
|
|
10
|
+
"BA",
|
|
11
|
+
"BD",
|
|
12
|
+
"BE",
|
|
13
|
+
"BG",
|
|
14
|
+
"BN",
|
|
15
|
+
"BT",
|
|
16
|
+
"BY",
|
|
17
|
+
"CH",
|
|
18
|
+
"CN",
|
|
19
|
+
"CY",
|
|
20
|
+
"CZ",
|
|
21
|
+
"DE",
|
|
22
|
+
"DK",
|
|
23
|
+
"EE",
|
|
24
|
+
"ES",
|
|
25
|
+
"FI",
|
|
26
|
+
"FR",
|
|
27
|
+
"GB",
|
|
28
|
+
"GE",
|
|
29
|
+
"GR",
|
|
30
|
+
"HR",
|
|
31
|
+
"HU",
|
|
32
|
+
"ID",
|
|
33
|
+
"IE",
|
|
34
|
+
"IL",
|
|
35
|
+
"IN",
|
|
36
|
+
"IQ",
|
|
37
|
+
"IR",
|
|
38
|
+
"IS",
|
|
39
|
+
"IT",
|
|
40
|
+
"JO",
|
|
41
|
+
"JP",
|
|
42
|
+
"KG",
|
|
43
|
+
"KH",
|
|
44
|
+
"KP",
|
|
45
|
+
"KR",
|
|
46
|
+
"KZ",
|
|
47
|
+
"LA",
|
|
48
|
+
"LB",
|
|
49
|
+
"LI",
|
|
50
|
+
"LK",
|
|
51
|
+
"LT",
|
|
52
|
+
"LU",
|
|
53
|
+
"LV",
|
|
54
|
+
"MC",
|
|
55
|
+
"MD",
|
|
56
|
+
"ME",
|
|
57
|
+
"MK",
|
|
58
|
+
"MM",
|
|
59
|
+
"MN",
|
|
60
|
+
"MT",
|
|
61
|
+
"MV",
|
|
62
|
+
"MY",
|
|
63
|
+
"NL",
|
|
64
|
+
"NO",
|
|
65
|
+
"NP",
|
|
66
|
+
"OM",
|
|
67
|
+
"PH",
|
|
68
|
+
"PK",
|
|
69
|
+
"PL",
|
|
70
|
+
"PS",
|
|
71
|
+
"PT",
|
|
72
|
+
"RO",
|
|
73
|
+
"RS",
|
|
74
|
+
"RU",
|
|
75
|
+
"SA",
|
|
76
|
+
"SE",
|
|
77
|
+
"SG",
|
|
78
|
+
"SI",
|
|
79
|
+
"SK",
|
|
80
|
+
"SM",
|
|
81
|
+
"TH",
|
|
82
|
+
"TJ",
|
|
83
|
+
"TL",
|
|
84
|
+
"TM",
|
|
85
|
+
"TR",
|
|
86
|
+
"TW",
|
|
87
|
+
"UA",
|
|
88
|
+
"US",
|
|
89
|
+
"UZ",
|
|
90
|
+
"VA",
|
|
91
|
+
"VN"
|
|
92
|
+
];
|
|
93
|
+
export type CountryImageCode = (typeof countryImageCodes)[number];
|
|
94
|
+
export interface CountryImageOptions {
|
|
95
|
+
/** URL prefix the app serves the package's `dist/countries` folder under. Default: `/images/countries`. */
|
|
96
|
+
baseUrl?: string;
|
|
97
|
+
}
|
|
98
|
+
/** Photo URL for a country code (any casing, surrounding whitespace ignored); `undefined` when there is no photo. */
|
|
99
|
+
export declare function getCountryImage(countryCode: string, { baseUrl }?: CountryImageOptions): string | undefined;
|
|
100
|
+
|
|
101
|
+
export {};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/** ISO 3166-1 alpha-2 codes (uppercase) that have a country card photo in `@travel-match/ui/countries/<code>.webp`. */
|
|
2
|
+
export declare const countryImageCodes: readonly [
|
|
3
|
+
"AD",
|
|
4
|
+
"AE",
|
|
5
|
+
"AF",
|
|
6
|
+
"AL",
|
|
7
|
+
"AM",
|
|
8
|
+
"AT",
|
|
9
|
+
"AZ",
|
|
10
|
+
"BA",
|
|
11
|
+
"BD",
|
|
12
|
+
"BE",
|
|
13
|
+
"BG",
|
|
14
|
+
"BN",
|
|
15
|
+
"BT",
|
|
16
|
+
"BY",
|
|
17
|
+
"CH",
|
|
18
|
+
"CN",
|
|
19
|
+
"CY",
|
|
20
|
+
"CZ",
|
|
21
|
+
"DE",
|
|
22
|
+
"DK",
|
|
23
|
+
"EE",
|
|
24
|
+
"ES",
|
|
25
|
+
"FI",
|
|
26
|
+
"FR",
|
|
27
|
+
"GB",
|
|
28
|
+
"GE",
|
|
29
|
+
"GR",
|
|
30
|
+
"HR",
|
|
31
|
+
"HU",
|
|
32
|
+
"ID",
|
|
33
|
+
"IE",
|
|
34
|
+
"IL",
|
|
35
|
+
"IN",
|
|
36
|
+
"IQ",
|
|
37
|
+
"IR",
|
|
38
|
+
"IS",
|
|
39
|
+
"IT",
|
|
40
|
+
"JO",
|
|
41
|
+
"JP",
|
|
42
|
+
"KG",
|
|
43
|
+
"KH",
|
|
44
|
+
"KP",
|
|
45
|
+
"KR",
|
|
46
|
+
"KZ",
|
|
47
|
+
"LA",
|
|
48
|
+
"LB",
|
|
49
|
+
"LI",
|
|
50
|
+
"LK",
|
|
51
|
+
"LT",
|
|
52
|
+
"LU",
|
|
53
|
+
"LV",
|
|
54
|
+
"MC",
|
|
55
|
+
"MD",
|
|
56
|
+
"ME",
|
|
57
|
+
"MK",
|
|
58
|
+
"MM",
|
|
59
|
+
"MN",
|
|
60
|
+
"MT",
|
|
61
|
+
"MV",
|
|
62
|
+
"MY",
|
|
63
|
+
"NL",
|
|
64
|
+
"NO",
|
|
65
|
+
"NP",
|
|
66
|
+
"OM",
|
|
67
|
+
"PH",
|
|
68
|
+
"PK",
|
|
69
|
+
"PL",
|
|
70
|
+
"PS",
|
|
71
|
+
"PT",
|
|
72
|
+
"RO",
|
|
73
|
+
"RS",
|
|
74
|
+
"RU",
|
|
75
|
+
"SA",
|
|
76
|
+
"SE",
|
|
77
|
+
"SG",
|
|
78
|
+
"SI",
|
|
79
|
+
"SK",
|
|
80
|
+
"SM",
|
|
81
|
+
"TH",
|
|
82
|
+
"TJ",
|
|
83
|
+
"TL",
|
|
84
|
+
"TM",
|
|
85
|
+
"TR",
|
|
86
|
+
"TW",
|
|
87
|
+
"UA",
|
|
88
|
+
"US",
|
|
89
|
+
"UZ",
|
|
90
|
+
"VA",
|
|
91
|
+
"VN"
|
|
92
|
+
];
|
|
93
|
+
export type CountryImageCode = (typeof countryImageCodes)[number];
|
|
94
|
+
export interface CountryImageOptions {
|
|
95
|
+
/** URL prefix the app serves the package's `dist/countries` folder under. Default: `/images/countries`. */
|
|
96
|
+
baseUrl?: string;
|
|
97
|
+
}
|
|
98
|
+
/** Photo URL for a country code (any casing, surrounding whitespace ignored); `undefined` when there is no photo. */
|
|
99
|
+
export declare function getCountryImage(countryCode: string, { baseUrl }?: CountryImageOptions): string | undefined;
|
|
100
|
+
|
|
101
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// src/countries/index.ts
|
|
2
|
+
var e = /* @__PURE__ */ "AD.AE.AF.AL.AM.AT.AZ.BA.BD.BE.BG.BN.BT.BY.CH.CN.CY.CZ.DE.DK.EE.ES.FI.FR.GB.GE.GR.HR.HU.ID.IE.IL.IN.IQ.IR.IS.IT.JO.JP.KG.KH.KP.KR.KZ.LA.LB.LI.LK.LT.LU.LV.MC.MD.ME.MK.MM.MN.MT.MV.MY.NL.NO.NP.OM.PH.PK.PL.PS.PT.RO.RS.RU.SA.SE.SG.SI.SK.SM.TH.TJ.TL.TM.TR.TW.UA.US.UZ.VA.VN".split("."), t = new Set(e);
|
|
3
|
+
function n(e, { baseUrl: n = "/images/countries" } = {}) {
|
|
4
|
+
let r = e.trim().toUpperCase();
|
|
5
|
+
if (t.has(r)) return `${n.replace(/\/+$/, "")}/${r.toLowerCase()}.webp`;
|
|
6
|
+
}
|
|
7
|
+
export { e as countryImageCodes, n as getCountryImage };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=countries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"countries.js","names":["countryImageCodes","available","getCountryImage","code","countryCode","baseUrl"],"sources":["../src/countries/index.ts"],"sourcesContent":["/** ISO 3166-1 alpha-2 codes (uppercase) that have a country card photo in `@travel-match/ui/countries/<code>.webp`. */\nexport const countryImageCodes = [\n 'AD',\n 'AE',\n 'AF',\n 'AL',\n 'AM',\n 'AT',\n 'AZ',\n 'BA',\n 'BD',\n 'BE',\n 'BG',\n 'BN',\n 'BT',\n 'BY',\n 'CH',\n 'CN',\n 'CY',\n 'CZ',\n 'DE',\n 'DK',\n 'EE',\n 'ES',\n 'FI',\n 'FR',\n 'GB',\n 'GE',\n 'GR',\n 'HR',\n 'HU',\n 'ID',\n 'IE',\n 'IL',\n 'IN',\n 'IQ',\n 'IR',\n 'IS',\n 'IT',\n 'JO',\n 'JP',\n 'KG',\n 'KH',\n 'KP',\n 'KR',\n 'KZ',\n 'LA',\n 'LB',\n 'LI',\n 'LK',\n 'LT',\n 'LU',\n 'LV',\n 'MC',\n 'MD',\n 'ME',\n 'MK',\n 'MM',\n 'MN',\n 'MT',\n 'MV',\n 'MY',\n 'NL',\n 'NO',\n 'NP',\n 'OM',\n 'PH',\n 'PK',\n 'PL',\n 'PS',\n 'PT',\n 'RO',\n 'RS',\n 'RU',\n 'SA',\n 'SE',\n 'SG',\n 'SI',\n 'SK',\n 'SM',\n 'TH',\n 'TJ',\n 'TL',\n 'TM',\n 'TR',\n 'TW',\n 'UA',\n 'US',\n 'UZ',\n 'VA',\n 'VN',\n] as const;\n\nexport type CountryImageCode = (typeof countryImageCodes)[number];\n\nexport interface CountryImageOptions {\n /** URL prefix the app serves the package's `dist/countries` folder under. Default: `/images/countries`. */\n baseUrl?: string;\n}\n\nconst available: ReadonlySet<string> = new Set(countryImageCodes);\n\n/** Photo URL for a country code (any casing, surrounding whitespace ignored); `undefined` when there is no photo. */\nexport function getCountryImage(countryCode: string, { baseUrl = '/images/countries' }: CountryImageOptions = {}): string | undefined {\n const code = countryCode.trim().toUpperCase();\n if (!available.has(code)) return undefined;\n return `${baseUrl.replace(/\\/+$/, '')}/${code.toLowerCase()}.webp`;\n}\n"],"mappings":";AACA,IAAaA,IAAoB,sSA0FjC,GASMC,IAAiC,IAAI,IAAID,CAAiB;AAGhE,SAAgBE,EAAgB,GAAqB,EAAE,aAAU,wBAA6C,CAAC,GAAuB;CACpI,IAAMC,IAAOC,EAAY,KAAK,CAAC,CAAC,YAAY;CAC5C,IAAKH,EAAU,IAAIE,CAAI,GACvB,OAAO,GAAGE,EAAQ,QAAQ,QAAQ,EAAE,EAAE,GAAGF,EAAK,YAAY,EAAE;AAC9D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travel-match/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "TravelMatch design system: design tokens, icons and React components built from the Figma Design System file.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"keywords": [
|
|
@@ -60,6 +60,17 @@
|
|
|
60
60
|
"default": "./dist/tokens.cjs"
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
|
+
"./countries": {
|
|
64
|
+
"import": {
|
|
65
|
+
"types": "./dist/countries.d.ts",
|
|
66
|
+
"default": "./dist/countries.js"
|
|
67
|
+
},
|
|
68
|
+
"require": {
|
|
69
|
+
"types": "./dist/countries.d.cts",
|
|
70
|
+
"default": "./dist/countries.cjs"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"./countries/*": "./dist/countries/*",
|
|
63
74
|
"./styles.css": "./dist/styles.css",
|
|
64
75
|
"./tokens.css": "./dist/tokens.css",
|
|
65
76
|
"./tailwind.css": "./dist/tailwind.css",
|