@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 CHANGED
@@ -1,22 +1,26 @@
1
1
  <div align="center">
2
- <img src="./website/public/favicon.svg" alt="@sankyu/react-circle-flags" width="120" height="120" />
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
- # @sankyu/react-circle-flags
9
+ # `@sankyu/react-circle-flags`
8
10
 
9
- [![npm version](https://img.shields.io/npm/v/%40sankyu%2Freact-circle-flags?style=flat-square&label=%40sankyu%2Freact-circle-flags)](https://www.npmjs.com/package/@sankyu/react-circle-flags) [![npm downloads](https://img.shields.io/npm/dm/@sankyu/react-circle-flags.svg?style=flat-square&label=NPM%20Downloads)](https://www.npmjs.com/package/@sankyu/react-circle-flags) [![Bundle Size](https://img.shields.io/bundlephobia/minzip/@sankyu/react-circle-flags?style=flat-square&label=Bundle%20Size)](https://bundlephobia.com/package/@sankyu/react-circle-flags)
11
+ [![npm version](https://img.shields.io/npm/v/%40sankyu%2Freact-circle-flags?style=flat-square&label=%40sankyu%2Freact-circle-flags)](https://www.npmjs.com/package/@sankyu/react-circle-flags) [![Bundle Size](https://img.shields.io/bundlephobia/minzip/@sankyu/react-circle-flags?style=flat-square&label=Bundle%20Size)](https://bundlephobia.com/package/@sankyu/react-circle-flags) [![npm downloads](https://img.shields.io/npm/dm/@sankyu/react-circle-flags.svg?style=flat-square&label=NPM%20Downloads)](https://www.npmjs.com/package/@sankyu/react-circle-flags) [![Last Commit](https://img.shields.io/github/last-commit/SanKyu-Lab/react-circle-flags?style=flat-square&label=Last%20Commit)](https://github.com/SanKyu-Lab/react-circle-flags/commits/main)
12
+
13
+ <!-- CI/CD & Quality -->
10
14
 
11
15
  [![CI](https://github.com/SanKyu-Lab/react-circle-flags/actions/workflows/ci.yml/badge.svg)](https://github.com/SanKyu-Lab/react-circle-flags/actions/workflows/ci.yml) [![Release](https://github.com/SanKyu-Lab/react-circle-flags/actions/workflows/release.yml/badge.svg)](https://github.com/SanKyu-Lab/react-circle-flags/actions/workflows/release.yml) [![codecov](https://codecov.io/gh/SanKyu-Lab/react-circle-flags/branch/main/graph/badge.svg?token=YHZ46T51AG)](https://codecov.io/gh/SanKyu-Lab/react-circle-flags)
12
16
 
13
- [![TypeScript Supported](https://img.shields.io/badge/TypeScript-Supported-blue?style=flat-square&logo=typescript)](https://www.typescriptlang.org/) [![React Ready](https://img.shields.io/badge/React-%3E%3D16.0.0-61dafb?style=flat-square&logo=react)](https://reactjs.org/) [![MIT License](https://img.shields.io/badge/License-MIT-green?style=flat-square&logo=opensourceinitiative)](./LICENSE)
17
+ [![TypeScript supported](https://img.shields.io/badge/TypeScript-supported-blue?style=flat-square&logo=typescript)](https://www.typescriptlang.org/) [![React Ready](https://badgen.net/bundlephobia/tree-shaking/@sankyu/react-circle-flags)](https://reactjs.org/) [![MIT License](https://img.shields.io/badge/License-MIT-green?style=flat-square&logo=opensourceinitiative)](./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://sankyu-lab.github.io/react-circle-flags/browse)** | :book: **Read the [Documentation](https://sankyu-lab.github.io/react-circle-flags/docs/guides/getting-started/)**
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://sankyu-lab.github.io/react-circle-flags/docs/guides/getting-started/#-key-features).
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 ~1-3KB
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://sankyu-lab.github.io/react-circle-flags/docs/guides/getting-started/installation/).
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
- > [!TIP]
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
- ```tsx
85
- import { FlagUs } from '@sankyu/react-circle-flags'
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
- export default function StyledFlag() {
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
- ### Dynamic flag selection
90
+ ### Build Meta Information
100
91
 
101
- > [!WARNING]
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 { DynamicFlag } from '@sankyu/react-circle-flags'
106
-
107
- interface CountryFlagProps {
108
- countryCode: string
109
- size?: number
110
- }
95
+ import { buildMeta } from '@sankyu/react-circle-flags'
111
96
 
112
- export const CountryFlag = ({ countryCode, size = 48 }: CountryFlagProps) => {
113
- return <DynamicFlag code={countryCode} width={size} height={size} />
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
- > [!TIP]
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
- Each flag component accepts all standard SVG props:
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://sankyu-lab.github.io/react-circle-flags/browse) in the react-circle-flags gallery.
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://sankyu-lab.github.io/react-circle-flags/docs/guides/getting-started/styling/).
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://sankyu-lab.github.io/react-circle-flags/docs/guides/getting-started/typescript/).
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://sankyu-lab.github.io/react-circle-flags/docs/guides/getting-started/usage/).
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. Importing individual flags ensures that only the used flags are included in your bundle.
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://sankyu-lab.github.io/react-circle-flags/docs/guides/getting-started/bundle-size/).
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.1"};
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
- "1767526390448"
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.1"};
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
- "1767526390448"
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.1",
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": "^22.19.3",
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": "^5.2.0",
103
- "globals": "^16.5.0",
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",