@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 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,29 @@ 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.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
- > [!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
103
+ ### Other Props
126
104
 
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
- ```
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://sankyu-lab.github.io/react-circle-flags/browse) in the react-circle-flags gallery.
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://sankyu-lab.github.io/react-circle-flags/docs/guides/getting-started/styling/).
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://sankyu-lab.github.io/react-circle-flags/docs/guides/getting-started/typescript/).
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://sankyu-lab.github.io/react-circle-flags/docs/guides/getting-started/usage/).
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. Importing individual flags ensures that only the used flags are included in your bundle.
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://sankyu-lab.github.io/react-circle-flags/docs/guides/getting-started/bundle-size/).
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.4.2"};
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 = "dev" ;
13055
+ var commit = "221e4aa374259781591a48d199a8a5bdfb636c85" ;
13056
+ var circleFlagsCommit = "f803b46170cc7d068b247c6a0993c7882429bb3d" ;
13056
13057
  var builtAt = parseBuiltAt(
13057
- "1767709251902"
13058
+ "1767797134425"
13058
13059
  );
13059
13060
  var buildMeta = {
13060
13061
  version: package_default.version,
13061
- commit,
13062
- builtAt
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
- commit: string;
1300
- builtAt: number;
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.4.2"};
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 = "dev" ;
13053
+ var commit = "221e4aa374259781591a48d199a8a5bdfb636c85" ;
13054
+ var circleFlagsCommit = "f803b46170cc7d068b247c6a0993c7882429bb3d" ;
13054
13055
  var builtAt = parseBuiltAt(
13055
- "1767709251902"
13056
+ "1767797134425"
13056
13057
  );
13057
13058
  var buildMeta = {
13058
13059
  version: package_default.version,
13059
- commit,
13060
- builtAt
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sankyu/react-circle-flags",
3
- "version": "1.4.2",
3
+ "version": "1.5.0",
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",