@sankyu/react-circle-flags 1.4.1 â 1.4.3
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 +32 -63
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +4 -4
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,28 @@ 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.builtAt) // e.g., 1760000000000 (timestamp)
|
|
99
|
+
console.log(buildMeta.commit) // e.g., <example-sha256-hash>
|
|
118
100
|
```
|
|
119
101
|
|
|
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
|
|
102
|
+
### Other Props
|
|
126
103
|
|
|
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
|
-
```
|
|
104
|
+
...For more information, you may refer to the [API Reference](https://react-circle-flags.js.org/reference/api/interfaceflagcomponentprops/).
|
|
138
105
|
|
|
139
106
|
### Available Flags
|
|
140
107
|
|
|
@@ -146,33 +113,35 @@ Each flag is exported with the pattern `Flag{PascalCase ISO_CODE}` (for example,
|
|
|
146
113
|
- `FlagJp` - Japan
|
|
147
114
|
- ... and many more
|
|
148
115
|
|
|
149
|
-
See the [Full list of flags](https://
|
|
116
|
+
See the [Full list of flags](https://react-circle-flags.js.org/browse) in the react-circle-flags gallery.
|
|
150
117
|
|
|
151
118
|
## ðĻ Styling
|
|
152
119
|
|
|
153
120
|
Flag components accept all standard SVG props, making them easy to style with any CSS approach.
|
|
154
121
|
|
|
155
122
|
> [!TIP]
|
|
156
|
-
> For more information, you may refer to the [Styling Guide](https://
|
|
123
|
+
> For more information, you may refer to the [Styling Guide](https://react-circle-flags.js.org/docs/guides/getting-started/styling/).
|
|
157
124
|
|
|
158
125
|
## ð§ TypeScript
|
|
159
126
|
|
|
160
127
|
All flag components are fully typed with TypeScript, providing autocomplete and type safety out of the box.
|
|
161
128
|
|
|
162
129
|
> [!TIP]
|
|
163
|
-
> For more information, you may refer to the [TypeScript Guide](https://
|
|
130
|
+
> For more information, you may refer to the [TypeScript Guide](https://react-circle-flags.js.org/docs/guides/getting-started/typescript/).
|
|
164
131
|
|
|
165
132
|
## ð Examples
|
|
166
133
|
|
|
167
134
|
> [!TIP]
|
|
168
|
-
> For more information, you may refer to the [Guide - Basic Usage](https://
|
|
135
|
+
> For more information, you may refer to the [Guide - Basic Usage](https://react-circle-flags.js.org/docs/guides/getting-started/usage/).
|
|
169
136
|
|
|
170
137
|
## ðĶ Bundle Size & Tree-shaking
|
|
171
138
|
|
|
172
|
-
`@sankyu/react-circle-flags` is designed to be tree-shakable.
|
|
139
|
+
`@sankyu/react-circle-flags` is designed to be tree-shakable.
|
|
140
|
+
|
|
141
|
+
Importing individual flags ensures that only the used flags are included in your bundle.
|
|
173
142
|
|
|
174
143
|
> [!TIP]
|
|
175
|
-
> For more information, you may refer to the [Bundle Size & Tree-shaking Guide](https://
|
|
144
|
+
> 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
145
|
|
|
177
146
|
## ðĪ Contributing
|
|
178
147
|
|
package/dist/index.cjs
CHANGED
|
@@ -13045,7 +13045,7 @@ var FLAG_REGISTRY = {
|
|
|
13045
13045
|
|
|
13046
13046
|
// package.json
|
|
13047
13047
|
var package_default = {
|
|
13048
|
-
version: "1.4.
|
|
13048
|
+
version: "1.4.3"};
|
|
13049
13049
|
|
|
13050
13050
|
// src/meta.ts
|
|
13051
13051
|
var parseBuiltAt = (source) => {
|
|
@@ -13054,7 +13054,7 @@ var parseBuiltAt = (source) => {
|
|
|
13054
13054
|
};
|
|
13055
13055
|
var commit = "dev" ;
|
|
13056
13056
|
var builtAt = parseBuiltAt(
|
|
13057
|
-
"
|
|
13057
|
+
"1767793041933"
|
|
13058
13058
|
);
|
|
13059
13059
|
var buildMeta = {
|
|
13060
13060
|
version: package_default.version,
|
package/dist/index.mjs
CHANGED
|
@@ -13043,7 +13043,7 @@ var FLAG_REGISTRY = {
|
|
|
13043
13043
|
|
|
13044
13044
|
// package.json
|
|
13045
13045
|
var package_default = {
|
|
13046
|
-
version: "1.4.
|
|
13046
|
+
version: "1.4.3"};
|
|
13047
13047
|
|
|
13048
13048
|
// src/meta.ts
|
|
13049
13049
|
var parseBuiltAt = (source) => {
|
|
@@ -13052,7 +13052,7 @@ var parseBuiltAt = (source) => {
|
|
|
13052
13052
|
};
|
|
13053
13053
|
var commit = "dev" ;
|
|
13054
13054
|
var builtAt = parseBuiltAt(
|
|
13055
|
-
"
|
|
13055
|
+
"1767793041933"
|
|
13056
13056
|
);
|
|
13057
13057
|
var buildMeta = {
|
|
13058
13058
|
version: package_default.version,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sankyu/react-circle-flags",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"description": "ðĶ 400+ circular SVG React flags â tree-shakeable, TypeScript-ready, SSR-compatible, zero deps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@testing-library/jest-dom": "^6.9.1",
|
|
92
92
|
"@testing-library/react": "^14.3.1",
|
|
93
93
|
"@types/jest": "^30.0.0",
|
|
94
|
-
"@types/node": "^
|
|
94
|
+
"@types/node": "^25.0.3",
|
|
95
95
|
"@types/react": "^18.3.27",
|
|
96
96
|
"@typescript-eslint/eslint-plugin": "^8.51.0",
|
|
97
97
|
"@typescript-eslint/parser": "^8.51.0",
|
|
@@ -99,8 +99,8 @@
|
|
|
99
99
|
"eslint-config-prettier": "^10.1.8",
|
|
100
100
|
"eslint-plugin-prettier": "^5.5.4",
|
|
101
101
|
"eslint-plugin-react": "^7.37.5",
|
|
102
|
-
"eslint-plugin-react-hooks": "^
|
|
103
|
-
"globals": "^
|
|
102
|
+
"eslint-plugin-react-hooks": "^7.0.1",
|
|
103
|
+
"globals": "^17.0.0",
|
|
104
104
|
"husky": "^9.1.7",
|
|
105
105
|
"jest": "^30.2.0",
|
|
106
106
|
"jest-environment-jsdom": "^30.2.0",
|