@sankyu/react-circle-flags 1.4.2 â 1.5.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 +33 -63
- package/dist/index.cjs +7 -5
- package/dist/index.d.ts +3 -2
- package/dist/index.mjs +7 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<
|
|
2
|
+
<a href="https://react-circle-flags.js.org/">
|
|
3
|
+
<img src="https://raw.githubusercontent.com/SanKyu-Lab/react-circle-flags/main/website/public/favicon.svg" alt="@sankyu/react-circle-flags" width="120" height="120" />
|
|
4
|
+
</a>
|
|
3
5
|
</div>
|
|
4
6
|
|
|
5
7
|
<div align="center">
|
|
6
8
|
|
|
7
|
-
#
|
|
9
|
+
# `@sankyu/react-circle-flags`
|
|
8
10
|
|
|
9
|
-
[](https://www.npmjs.com/package/@sankyu/react-circle-flags) [](https://www.npmjs.com/package/@sankyu/react-circle-flags) [](https://www.npmjs.com/package/@sankyu/react-circle-flags) [](https://bundlephobia.com/package/@sankyu/react-circle-flags) [](https://www.npmjs.com/package/@sankyu/react-circle-flags) [](https://github.com/SanKyu-Lab/react-circle-flags/commits/main)
|
|
12
|
+
|
|
13
|
+
<!-- CI/CD & Quality -->
|
|
10
14
|
|
|
11
15
|
[](https://github.com/SanKyu-Lab/react-circle-flags/actions/workflows/ci.yml) [](https://github.com/SanKyu-Lab/react-circle-flags/actions/workflows/release.yml) [](https://codecov.io/gh/SanKyu-Lab/react-circle-flags)
|
|
12
16
|
|
|
13
|
-
[](https://www.typescriptlang.org/) [](https://reactjs.org/) [](./LICENSE)
|
|
14
18
|
|
|
15
19
|
---
|
|
16
20
|
|
|
17
21
|
:star: **Star us on [GitHub](https://github.com/Sankyu-Lab/react-circle-flags)** | :bug: **Report Issues [here](https://github.com/Sankyu-Lab/react-circle-flags/issues)**
|
|
18
22
|
|
|
19
|
-
:rocket: **Explore the [Demo Gallery](https://
|
|
23
|
+
:rocket: **Explore the [Demo Gallery](https://react-circle-flags.js.org/browse)** | :book: **Read the [Documentation](https://react-circle-flags.js.org/docs/guides/getting-started/)**
|
|
20
24
|
|
|
21
25
|
</div>
|
|
22
26
|
|
|
@@ -33,7 +37,7 @@ Perfect for applications that need fast, crisp country flags without external im
|
|
|
33
37
|
## âĻ Key Features
|
|
34
38
|
|
|
35
39
|
> [!TIP]
|
|
36
|
-
> For more information, you may refer to the [Documentation](https://
|
|
40
|
+
> For more information, you may refer to the [Documentation](https://react-circle-flags.js.org/docs/guides/getting-started/#-key-features).
|
|
37
41
|
|
|
38
42
|
- ðŊ **Tree-shakable** - Only bundle the flags you use
|
|
39
43
|
- ðĶ **TypeScript** - Full type definitions included
|
|
@@ -41,7 +45,7 @@ Perfect for applications that need fast, crisp country flags without external im
|
|
|
41
45
|
- ðĻ **Inline SVG** - No external requests, works offline
|
|
42
46
|
- ð§ **Fully customizable** - All standard SVG props supported
|
|
43
47
|
- ðą **SSR compatible** - Works with `Next.js`, `Remix`, etc.
|
|
44
|
-
- ðŠķ **Lightweight** - Each flag is ~
|
|
48
|
+
- ðŠķ **Lightweight** - Each flag is ~1KB
|
|
45
49
|
|
|
46
50
|
## ðĶ Installation
|
|
47
51
|
|
|
@@ -56,7 +60,7 @@ bun add @sankyu/react-circle-flags
|
|
|
56
60
|
```
|
|
57
61
|
|
|
58
62
|
> [!TIP]
|
|
59
|
-
> For more information, you may refer to the [Installation Guide](https://
|
|
63
|
+
> For more information, you may refer to the [Installation Guide](https://react-circle-flags.js.org/docs/guides/getting-started/installation/).
|
|
60
64
|
|
|
61
65
|
## ð Usage
|
|
62
66
|
|
|
@@ -76,65 +80,29 @@ export default function App() {
|
|
|
76
80
|
}
|
|
77
81
|
```
|
|
78
82
|
|
|
79
|
-
|
|
80
|
-
> For more information, you may refer to the [Usage Guide](https://sankyu-lab.github.io/react-circle-flags/docs/guides/getting-started/usage/).
|
|
81
|
-
|
|
82
|
-
### With custom styling
|
|
83
|
+
### Other usage examples
|
|
83
84
|
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
> [!TIP]
|
|
86
|
+
> For more information, you may refer to the [Usage Guide](https://react-circle-flags.js.org/docs/guides/getting-started/usage/).
|
|
86
87
|
|
|
87
|
-
|
|
88
|
-
return (
|
|
89
|
-
<FlagUs
|
|
90
|
-
width={64}
|
|
91
|
-
height={64}
|
|
92
|
-
className="shadow-lg rounded-full"
|
|
93
|
-
style={{ border: '2px solid #000' }}
|
|
94
|
-
/>
|
|
95
|
-
)
|
|
96
|
-
}
|
|
97
|
-
```
|
|
88
|
+
## ð API
|
|
98
89
|
|
|
99
|
-
###
|
|
90
|
+
### Build Meta Information
|
|
100
91
|
|
|
101
|
-
|
|
102
|
-
> â ïļ Using `DynamicFlag` or `import * as Flags` will pull all flag components into the bundle, which can reduce tree-shaking efficiency and increase bundle size.
|
|
92
|
+
You can access the library's build meta information from the `buildMeta` export:
|
|
103
93
|
|
|
104
94
|
```tsx
|
|
105
|
-
import {
|
|
106
|
-
|
|
107
|
-
interface CountryFlagProps {
|
|
108
|
-
countryCode: string
|
|
109
|
-
size?: number
|
|
110
|
-
}
|
|
95
|
+
import { buildMeta } from '@sankyu/react-circle-flags'
|
|
111
96
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
// Usage
|
|
117
|
-
;<CountryFlag countryCode="us" size={64} />
|
|
97
|
+
console.log(buildMeta.version) // e.g., "1.2.3"
|
|
98
|
+
console.log(buildMeta.builtTimestamp) // e.g., 1760000000000
|
|
99
|
+
console.log(buildMeta.commitHash) // e.g., <example-sha256-hash>
|
|
100
|
+
console.log(buildMeta.circleFlagsCommitHash) // e.g., <example-sha256-hash>
|
|
118
101
|
```
|
|
119
102
|
|
|
120
|
-
|
|
121
|
-
> For more information, you may refer to the [Dynamic Flag Selection](https://sankyu-lab.github.io/react-circle-flags/docs/guides/getting-started/dynamic-flags/) section in the documentation.
|
|
122
|
-
|
|
123
|
-
## ð API
|
|
124
|
-
|
|
125
|
-
### Flag Components
|
|
103
|
+
### Other Props
|
|
126
104
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
```tsx
|
|
130
|
-
interface FlagProps extends SVGProps<SVGSVGElement> {
|
|
131
|
-
width?: number | string
|
|
132
|
-
height?: number | string
|
|
133
|
-
className?: string
|
|
134
|
-
style?: CSSProperties
|
|
135
|
-
// ... all other SVG props
|
|
136
|
-
}
|
|
137
|
-
```
|
|
105
|
+
...For more information, you may refer to the [API Reference](https://react-circle-flags.js.org/reference/api/interfaceflagcomponentprops/).
|
|
138
106
|
|
|
139
107
|
### Available Flags
|
|
140
108
|
|
|
@@ -146,33 +114,35 @@ Each flag is exported with the pattern `Flag{PascalCase ISO_CODE}` (for example,
|
|
|
146
114
|
- `FlagJp` - Japan
|
|
147
115
|
- ... and many more
|
|
148
116
|
|
|
149
|
-
See the [Full list of flags](https://
|
|
117
|
+
See the [Full list of flags](https://react-circle-flags.js.org/browse) in the react-circle-flags gallery.
|
|
150
118
|
|
|
151
119
|
## ðĻ Styling
|
|
152
120
|
|
|
153
121
|
Flag components accept all standard SVG props, making them easy to style with any CSS approach.
|
|
154
122
|
|
|
155
123
|
> [!TIP]
|
|
156
|
-
> For more information, you may refer to the [Styling Guide](https://
|
|
124
|
+
> For more information, you may refer to the [Styling Guide](https://react-circle-flags.js.org/docs/guides/getting-started/styling/).
|
|
157
125
|
|
|
158
126
|
## ð§ TypeScript
|
|
159
127
|
|
|
160
128
|
All flag components are fully typed with TypeScript, providing autocomplete and type safety out of the box.
|
|
161
129
|
|
|
162
130
|
> [!TIP]
|
|
163
|
-
> For more information, you may refer to the [TypeScript Guide](https://
|
|
131
|
+
> For more information, you may refer to the [TypeScript Guide](https://react-circle-flags.js.org/docs/guides/getting-started/typescript/).
|
|
164
132
|
|
|
165
133
|
## ð Examples
|
|
166
134
|
|
|
167
135
|
> [!TIP]
|
|
168
|
-
> For more information, you may refer to the [Guide - Basic Usage](https://
|
|
136
|
+
> For more information, you may refer to the [Guide - Basic Usage](https://react-circle-flags.js.org/docs/guides/getting-started/usage/).
|
|
169
137
|
|
|
170
138
|
## ðĶ Bundle Size & Tree-shaking
|
|
171
139
|
|
|
172
|
-
`@sankyu/react-circle-flags` is designed to be tree-shakable.
|
|
140
|
+
`@sankyu/react-circle-flags` is designed to be tree-shakable.
|
|
141
|
+
|
|
142
|
+
Importing individual flags ensures that only the used flags are included in your bundle.
|
|
173
143
|
|
|
174
144
|
> [!TIP]
|
|
175
|
-
> For more information, you may refer to the [Bundle Size & Tree-shaking Guide](https://
|
|
145
|
+
> For more information, you may refer to the [Bundle Size & Tree-shaking Guide](https://react-circle-flags.js.org/docs/guides/getting-started/bundle-size/).
|
|
176
146
|
|
|
177
147
|
## ðĪ Contributing
|
|
178
148
|
|
package/dist/index.cjs
CHANGED
|
@@ -13045,21 +13045,23 @@ var FLAG_REGISTRY = {
|
|
|
13045
13045
|
|
|
13046
13046
|
// package.json
|
|
13047
13047
|
var package_default = {
|
|
13048
|
-
version: "1.
|
|
13048
|
+
version: "1.5.0"};
|
|
13049
13049
|
|
|
13050
13050
|
// src/meta.ts
|
|
13051
13051
|
var parseBuiltAt = (source) => {
|
|
13052
13052
|
const parsed = Number.parseInt(source, 10);
|
|
13053
13053
|
return Number.isFinite(parsed) ? parsed : Date.now();
|
|
13054
13054
|
};
|
|
13055
|
-
var commit = "
|
|
13055
|
+
var commit = "221e4aa374259781591a48d199a8a5bdfb636c85" ;
|
|
13056
|
+
var circleFlagsCommit = "f803b46170cc7d068b247c6a0993c7882429bb3d" ;
|
|
13056
13057
|
var builtAt = parseBuiltAt(
|
|
13057
|
-
"
|
|
13058
|
+
"1767797134425"
|
|
13058
13059
|
);
|
|
13059
13060
|
var buildMeta = {
|
|
13060
13061
|
version: package_default.version,
|
|
13061
|
-
commit,
|
|
13062
|
-
|
|
13062
|
+
commitHash: commit,
|
|
13063
|
+
circleFlagsCommitHash: circleFlagsCommit,
|
|
13064
|
+
builtTimestamp: builtAt
|
|
13063
13065
|
};
|
|
13064
13066
|
function codeToEmoji(code) {
|
|
13065
13067
|
const upperCode = code.toUpperCase().slice(0, 2);
|
package/dist/index.d.ts
CHANGED
|
@@ -1296,8 +1296,9 @@ type FlagCode = keyof typeof FLAG_REGISTRY;
|
|
|
1296
1296
|
|
|
1297
1297
|
interface BuildMeta {
|
|
1298
1298
|
version: string;
|
|
1299
|
-
|
|
1300
|
-
|
|
1299
|
+
commitHash: string;
|
|
1300
|
+
circleFlagsCommitHash: string;
|
|
1301
|
+
builtTimestamp: number;
|
|
1301
1302
|
}
|
|
1302
1303
|
declare const buildMeta: BuildMeta;
|
|
1303
1304
|
|
package/dist/index.mjs
CHANGED
|
@@ -13043,21 +13043,23 @@ var FLAG_REGISTRY = {
|
|
|
13043
13043
|
|
|
13044
13044
|
// package.json
|
|
13045
13045
|
var package_default = {
|
|
13046
|
-
version: "1.
|
|
13046
|
+
version: "1.5.0"};
|
|
13047
13047
|
|
|
13048
13048
|
// src/meta.ts
|
|
13049
13049
|
var parseBuiltAt = (source) => {
|
|
13050
13050
|
const parsed = Number.parseInt(source, 10);
|
|
13051
13051
|
return Number.isFinite(parsed) ? parsed : Date.now();
|
|
13052
13052
|
};
|
|
13053
|
-
var commit = "
|
|
13053
|
+
var commit = "221e4aa374259781591a48d199a8a5bdfb636c85" ;
|
|
13054
|
+
var circleFlagsCommit = "f803b46170cc7d068b247c6a0993c7882429bb3d" ;
|
|
13054
13055
|
var builtAt = parseBuiltAt(
|
|
13055
|
-
"
|
|
13056
|
+
"1767797134425"
|
|
13056
13057
|
);
|
|
13057
13058
|
var buildMeta = {
|
|
13058
13059
|
version: package_default.version,
|
|
13059
|
-
commit,
|
|
13060
|
-
|
|
13060
|
+
commitHash: commit,
|
|
13061
|
+
circleFlagsCommitHash: circleFlagsCommit,
|
|
13062
|
+
builtTimestamp: builtAt
|
|
13061
13063
|
};
|
|
13062
13064
|
function codeToEmoji(code) {
|
|
13063
13065
|
const upperCode = code.toUpperCase().slice(0, 2);
|
package/package.json
CHANGED