support-kurdistan 1.1.2 → 1.1.6

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,183 +1,145 @@
1
- # Support Kurdistan Banner
1
+ # Support Kurdistan Banner 🇹🇯
2
2
 
3
- A custom HTML element that displays a banner showing support for Kurdistan.
3
+ Luxury, minimal banner component to show solidarity with Kurdistan.
4
+ Works with **React, Next.js, and Vue**.
4
5
 
5
- ## Features
6
+ ---
6
7
 
7
- - Multi-language support (English, Kurdish, Arabic)
8
- - Multiple themes (light, dark, subtle)
9
- - Responsive design
10
- - Customizable text
11
- - Social media integration with hashtags
8
+ ## Features
12
9
 
13
- ## Usage
10
+ - Luxury minimal design
11
+ - RTL & LTR support
12
+ - Multi-language (EN, KU, CKB, AR)
13
+ - Themes: light, dark, subtle
14
+ - Sticky top or footer mode
15
+ - Responsive
16
+ - Zero dependencies
14
17
 
15
- Include the JavaScript file in your HTML:
18
+ ---
16
19
 
17
- ```html
18
- <script src="src/support-kurdistan.js"></script>
19
- ```
20
-
21
- Then use the element:
22
-
23
- ```html
24
- <support-kurdistan></support-kurdistan>
25
- ```
26
-
27
- ## Attributes
28
-
29
- - `locale`: Language code (en, ku, ckb, ar). Default: en
30
- - `theme`: Theme (light, dark, subtle). Default: light
31
- - `text`: Custom message. If provided, replaces the default message.
32
- - `mode`: Position (top, footer). Default: top
20
+ ## 📦 Installation
33
21
 
34
- ## Examples
22
+ ```bash
23
+ npm install support-kurdistan
35
24
 
36
- ### Default banner
37
25
 
38
- ```html
39
- <support-kurdistan></support-kurdistan>
40
- ```
41
-
42
- ### Dark theme in Kurdish
43
-
44
- ```html
45
- <support-kurdistan locale="ku" theme="dark"></support-kurdistan>
46
- ```
26
+ ## ⚛ React / Next.js Usage
47
27
 
48
- ### Custom text in footer
28
+ import SupportKurdistan from "support-kurdistan/react";
49
29
 
50
- ```html
51
- <support-kurdistan
52
- text="Custom support message"
53
- mode="footer"
54
- ></support-kurdistan>
55
- ```
56
-
57
- ### Arabic with subtle theme
30
+ export default function App() {
31
+ return (
32
+ <SupportKurdistan
33
+ locale="ckb"
34
+ theme="dark"
35
+ text=""
36
+ mode="top"
37
+ />
38
+ );
39
+ }
58
40
 
59
- ```html
60
- <support-kurdistan locale="ar" theme="subtle"></support-kurdistan>
61
- ```
41
+ ##Next.js (App Router)
62
42
 
63
- ## Framework Integration
43
+ "use client";
64
44
 
65
- **Note:** This custom element is framework-agnostic and works with any JavaScript framework. Make sure to include the `support-kurdistan.js` script before using the component. For frameworks with server-side rendering (like Next.js), the component will only render on the client side.
45
+ import SupportKurdistan from "support-kurdistan/react";
66
46
 
67
- This custom element can be used in various JavaScript frameworks. Below are examples for React, Vue, and Next.js.
47
+ export default function App() {
48
+ return (
49
+ <SupportKurdistan
50
+ locale="ckb"
51
+ theme="dark"
52
+ text=""
53
+ mode="top"
54
+ />
55
+ );
56
+ }
68
57
 
69
- ### React
70
58
 
71
- First, include the script in your HTML (e.g., in `public/index.html`):
59
+ 🟢 Vue 3 Usage
72
60
 
73
- ```html
74
- <script src="%PUBLIC_URL%/src/support-kurdistan.js"></script>
75
- ```
61
+ <script setup>
62
+ import SupportKurdistan from "support-kurdistan/vue";
63
+ </script>
76
64
 
77
- Then use it in your React component:
65
+ <template>
66
+ <SupportKurdistan
67
+ locale="ckb"
68
+ theme="dark"
69
+ mode="top"
70
+ />
71
+ </template>
78
72
 
79
- ```jsx
80
- import React from "react";
73
+ Props
81
74
 
82
- function App() {
83
- return (
84
- <div className="App">
85
- <support-kurdistan locale="en" theme="light"></support-kurdistan>
86
- </div>
87
- );
88
- }
75
+ locale
76
+ Type: string
77
+ Default: en
78
+ Description: Language code (en, ku, ckb, ar)
89
79
 
90
- export default App;
91
- ```
80
+ theme
81
+ Type: string
82
+ Default: light
83
+ Description: light, dark, subtle
92
84
 
93
- If you encounter TypeScript issues, declare the element:
85
+ text
86
+ Type: string
87
+ Default: auto
88
+ Description: Custom text override
94
89
 
95
- ```typescript
96
- declare global {
97
- namespace JSX {
98
- interface IntrinsicElements {
99
- "support-kurdistan": any;
100
- }
101
- }
102
- }
103
- ```
90
+ mode
91
+ Type: string
92
+ Default: top
93
+ Description: top or footer
104
94
 
105
- ### Vue
95
+
106
96
 
107
- Include the script in your `index.html`:
97
+ Supported Locales
108
98
 
109
- ```html
110
- <script src="./src/support-kurdistan.js"></script>
111
- ```
99
+ en - English
100
+ ku - Kurdish (Kurmanji)
101
+ ckb - Kurdish (Sorani)
102
+ ar - Arabic
112
103
 
113
- Then use it in your Vue component:
104
+ Themes
114
105
 
115
- ```vue
116
- <template>
117
- <div id="app">
118
- <support-kurdistan locale="ku" theme="dark" />
119
- </div>
120
- </template>
106
+ light
107
+ dark
108
+ subtle
121
109
 
122
- <script>
123
- export default {
124
- name: "App",
125
- };
126
- </script>
127
- ```
128
110
 
129
- In Vue 3, you may need to configure it in `main.js`:
111
+ Examples
130
112
 
131
- ```javascript
132
- import { createApp } from "vue";
133
- import App from "./App.vue";
113
+ Custom text:
114
+ <SupportKurdistan
115
+ text="Kurdistan Forever"
116
+ theme="dark"
117
+ />
134
118
 
135
- const app = createApp(App);
136
- app.config.compilerOptions.isCustomElement = (tag) =>
137
- tag === "support-kurdistan";
138
- app.mount("#app");
139
- ```
119
+ Arabic footer:
140
120
 
141
- ### Next.js
121
+ <SupportKurdistan
122
+ locale="ar"
123
+ theme="subtle"
124
+ mode="footer"
125
+ />
142
126
 
143
- Include the script in your `_document.js` or use `next/script`:
127
+ Notes
128
+ • RTL direction is detected automatically
129
+ • Works with SSR in Next.js
130
+ • No CSS import required
131
+ • Internal styles are scoped
132
+ • Vue and React versions are framework native
144
133
 
145
- ```jsx
146
- import { Html, Head, Main, NextScript } from "next/document";
147
134
 
148
- export default function Document() {
149
- return (
150
- <Html>
151
- <Head>
152
- <script src="/src/support-kurdistan.js" />
153
- </Head>
154
- <body>
155
- <Main />
156
- <NextScript />
157
- </body>
158
- </Html>
159
- );
160
- }
161
- ```
135
+ This project was created to raise awareness and express solidarity with the people of Kurdistan through clean and respectful UI.
162
136
 
163
- Then use it in your pages:
137
+ License
164
138
 
165
- ```jsx
166
- export default function Home() {
167
- return (
168
- <div>
169
- <support-kurdistan locale="ar" theme="subtle" />
170
- </div>
171
- );
172
- }
173
- ```
139
+ MIT License
174
140
 
175
- For TypeScript support, add to `types.d.ts`:
141
+ Author
176
142
 
177
- ```typescript
178
- declare namespace JSX {
179
- interface IntrinsicElements {
180
- "support-kurdistan": any;
181
- }
182
- }
143
+ Abdulsamad Zuhair
144
+ Software Engineer
183
145
  ```
@@ -0,0 +1,19 @@
1
+ export declare class SupportKurdistanComponent {
2
+ locale: string;
3
+ theme: string;
4
+ text: string;
5
+ mode: string;
6
+ hashtags: string[];
7
+ translations: any;
8
+ themes: any;
9
+ get isRTL(): boolean;
10
+ get displayText(): any;
11
+ get style(): {
12
+ "--bg": any;
13
+ "--border": any;
14
+ "--accent": any;
15
+ position: string;
16
+ top: string;
17
+ zIndex: string;
18
+ };
19
+ }
@@ -0,0 +1,186 @@
1
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
2
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
3
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
4
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
5
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
6
+ var _, done = false;
7
+ for (var i = decorators.length - 1; i >= 0; i--) {
8
+ var context = {};
9
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
10
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
11
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
12
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
13
+ if (kind === "accessor") {
14
+ if (result === void 0) continue;
15
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
16
+ if (_ = accept(result.get)) descriptor.get = _;
17
+ if (_ = accept(result.set)) descriptor.set = _;
18
+ if (_ = accept(result.init)) initializers.unshift(_);
19
+ }
20
+ else if (_ = accept(result)) {
21
+ if (kind === "field") initializers.unshift(_);
22
+ else descriptor[key] = _;
23
+ }
24
+ }
25
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
26
+ done = true;
27
+ };
28
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
29
+ var useValue = arguments.length > 2;
30
+ for (var i = 0; i < initializers.length; i++) {
31
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
32
+ }
33
+ return useValue ? value : void 0;
34
+ };
35
+ var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
36
+ if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
37
+ return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
38
+ };
39
+ import { Component, Input } from "@angular/core";
40
+ let SupportKurdistanComponent = (() => {
41
+ let _classDecorators = [Component({
42
+ selector: "support-kurdistan",
43
+ standalone: true,
44
+ template: `
45
+ <div class="banner" [ngStyle]="style">
46
+ <div class="wrap">
47
+ <div class="left">
48
+ <img
49
+ src="https://cdn-icons-png.flaticon.com/512/10600/10600720.png"
50
+ width="36"
51
+ />
52
+ <p [dir]="isRTL ? 'rtl' : 'ltr'">
53
+ {{ displayText }}
54
+ <span *ngIf="!text" class="heart">❤️</span>
55
+ </p>
56
+ </div>
57
+
58
+ <div class="right">
59
+ <a
60
+ *ngFor="let tag of hashtags"
61
+ [href]="'https://twitter.com/search?q=' + tag"
62
+ target="_blank"
63
+ >
64
+ {{ tag }}
65
+ </a>
66
+ </div>
67
+ </div>
68
+ </div>
69
+ `,
70
+ styles: [
71
+ `
72
+ .banner {
73
+ width: 100%;
74
+ border-bottom: 1px solid var(--border);
75
+ background: var(--bg);
76
+ }
77
+ .wrap {
78
+ max-width: 1200px;
79
+ margin: auto;
80
+ padding: 12px 20px;
81
+ display: flex;
82
+ justify-content: space-between;
83
+ flex-wrap: wrap;
84
+ gap: 12px;
85
+ }
86
+ .left {
87
+ display: flex;
88
+ gap: 16px;
89
+ align-items: center;
90
+ }
91
+ p {
92
+ margin: 0;
93
+ font-family: Inter, sans-serif;
94
+ font-weight: 500;
95
+ }
96
+ .right {
97
+ display: flex;
98
+ gap: 14px;
99
+ flex-wrap: wrap;
100
+ }
101
+ a {
102
+ text-decoration: none;
103
+ font-weight: 500;
104
+ color: var(--accent);
105
+ }
106
+ a:hover {
107
+ opacity: 0.8;
108
+ }
109
+ .heart {
110
+ margin-left: 6px;
111
+ color: #e74c3c;
112
+ }
113
+ `,
114
+ ],
115
+ })];
116
+ let _classDescriptor;
117
+ let _classExtraInitializers = [];
118
+ let _classThis;
119
+ let _locale_decorators;
120
+ let _locale_initializers = [];
121
+ let _locale_extraInitializers = [];
122
+ let _theme_decorators;
123
+ let _theme_initializers = [];
124
+ let _theme_extraInitializers = [];
125
+ let _text_decorators;
126
+ let _text_initializers = [];
127
+ let _text_extraInitializers = [];
128
+ let _mode_decorators;
129
+ let _mode_initializers = [];
130
+ let _mode_extraInitializers = [];
131
+ var SupportKurdistanComponent = _classThis = class {
132
+ constructor() {
133
+ this.locale = __runInitializers(this, _locale_initializers, "en");
134
+ this.theme = (__runInitializers(this, _locale_extraInitializers), __runInitializers(this, _theme_initializers, "light"));
135
+ this.text = (__runInitializers(this, _theme_extraInitializers), __runInitializers(this, _text_initializers, ""));
136
+ this.mode = (__runInitializers(this, _text_extraInitializers), __runInitializers(this, _mode_initializers, "top"));
137
+ this.hashtags = (__runInitializers(this, _mode_extraInitializers), ["#SaveRojavaPeople", "#FreeRojava", "#SaveKurdistan"]);
138
+ this.translations = {
139
+ en: "We stand with Kurdistan",
140
+ ku: "ئێمە لەگەڵ کوردستانین",
141
+ ckb: "ئێمە لەگەڵ کوردستانین",
142
+ ar: "نحن نقف مع كوردستان",
143
+ };
144
+ this.themes = {
145
+ light: { bg: "#fff", border: "#e8e8e8", accent: "#c0392b" },
146
+ dark: { bg: "#1a1a1a", border: "#333", accent: "#e74c3c" },
147
+ subtle: { bg: "#f9f9f9", border: "#e0e0e0", accent: "#2980b9" },
148
+ };
149
+ }
150
+ get isRTL() {
151
+ return ["ar", "ku", "ckb"].includes(this.locale);
152
+ }
153
+ get displayText() {
154
+ return this.text || this.translations[this.locale] || this.translations.en;
155
+ }
156
+ get style() {
157
+ const t = this.themes[this.theme] || this.themes.light;
158
+ return {
159
+ "--bg": t.bg,
160
+ "--border": t.border,
161
+ "--accent": t.accent,
162
+ position: this.mode === "footer" ? "relative" : "sticky",
163
+ top: this.mode === "footer" ? null : "0",
164
+ zIndex: "100",
165
+ };
166
+ }
167
+ };
168
+ __setFunctionName(_classThis, "SupportKurdistanComponent");
169
+ (() => {
170
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
171
+ _locale_decorators = [Input()];
172
+ _theme_decorators = [Input()];
173
+ _text_decorators = [Input()];
174
+ _mode_decorators = [Input()];
175
+ __esDecorate(null, null, _locale_decorators, { kind: "field", name: "locale", static: false, private: false, access: { has: obj => "locale" in obj, get: obj => obj.locale, set: (obj, value) => { obj.locale = value; } }, metadata: _metadata }, _locale_initializers, _locale_extraInitializers);
176
+ __esDecorate(null, null, _theme_decorators, { kind: "field", name: "theme", static: false, private: false, access: { has: obj => "theme" in obj, get: obj => obj.theme, set: (obj, value) => { obj.theme = value; } }, metadata: _metadata }, _theme_initializers, _theme_extraInitializers);
177
+ __esDecorate(null, null, _text_decorators, { kind: "field", name: "text", static: false, private: false, access: { has: obj => "text" in obj, get: obj => obj.text, set: (obj, value) => { obj.text = value; } }, metadata: _metadata }, _text_initializers, _text_extraInitializers);
178
+ __esDecorate(null, null, _mode_decorators, { kind: "field", name: "mode", static: false, private: false, access: { has: obj => "mode" in obj, get: obj => obj.mode, set: (obj, value) => { obj.mode = value; } }, metadata: _metadata }, _mode_initializers, _mode_extraInitializers);
179
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
180
+ SupportKurdistanComponent = _classThis = _classDescriptor.value;
181
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
182
+ __runInitializers(_classThis, _classExtraInitializers);
183
+ })();
184
+ return SupportKurdistanComponent = _classThis;
185
+ })();
186
+ export { SupportKurdistanComponent };
@@ -0,0 +1,114 @@
1
+ 'use client';
2
+
3
+ import { useEffect } from "react";
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ export default function SupportKurdistan(_ref) {
6
+ var _ref$locale = _ref.locale,
7
+ locale = _ref$locale === void 0 ? "en" : _ref$locale,
8
+ _ref$theme = _ref.theme,
9
+ theme = _ref$theme === void 0 ? "light" : _ref$theme,
10
+ _ref$text = _ref.text,
11
+ text = _ref$text === void 0 ? "" : _ref$text,
12
+ _ref$mode = _ref.mode,
13
+ mode = _ref$mode === void 0 ? "top" : _ref$mode;
14
+ var translations = {
15
+ en: "We stand with Kurdistan",
16
+ ku: "ئێمە لەگەڵ کوردستانین",
17
+ ckb: "ئێمە لەگەڵ کوردستانین",
18
+ ar: "نحن نقف مع كوردستان"
19
+ };
20
+ var hashtags = ["#SaveRojavaPeople", "#FreeRojava", "#SaveKurdistan"];
21
+ var themes = {
22
+ light: {
23
+ bg: "#fff",
24
+ color: "#333",
25
+ border: "#e8e8e8",
26
+ accent: "#c0392b"
27
+ },
28
+ dark: {
29
+ bg: "#1a1a1a",
30
+ color: "#f5f5f5",
31
+ border: "#333",
32
+ accent: "#e74c3c"
33
+ },
34
+ subtle: {
35
+ bg: "#f9f9f9",
36
+ color: "#444",
37
+ border: "#e0e0e0",
38
+ accent: "#2980b9"
39
+ }
40
+ };
41
+ var t = themes[theme] || themes.light;
42
+ var isRTL = ["ar", "ku", "ckb"].includes(locale);
43
+ return /*#__PURE__*/_jsx("div", {
44
+ style: {
45
+ position: mode === "footer" ? "relative" : "sticky",
46
+ top: mode === "footer" ? undefined : 0,
47
+ zIndex: 100,
48
+ background: t.bg,
49
+ borderBottom: "1px solid ".concat(t.border),
50
+ width: "100%"
51
+ },
52
+ children: /*#__PURE__*/_jsxs("div", {
53
+ style: {
54
+ maxWidth: 1200,
55
+ margin: "0 auto",
56
+ padding: "12px 20px",
57
+ display: "flex",
58
+ justifyContent: "space-between",
59
+ alignItems: "center",
60
+ gap: 20,
61
+ flexWrap: "wrap"
62
+ },
63
+ children: [/*#__PURE__*/_jsxs("div", {
64
+ style: {
65
+ display: "flex",
66
+ alignItems: "center",
67
+ gap: 16
68
+ },
69
+ children: [/*#__PURE__*/_jsx("img", {
70
+ src: "https://cdn-icons-png.flaticon.com/512/10600/10600720.png",
71
+ width: 36,
72
+ height: 36
73
+ }), /*#__PURE__*/_jsxs("p", {
74
+ style: {
75
+ margin: 0,
76
+ fontFamily: "Inter, sans-serif",
77
+ fontSize: 16,
78
+ fontWeight: 500,
79
+ color: t.color,
80
+ direction: isRTL ? "rtl" : "ltr",
81
+ textAlign: isRTL ? "right" : "left"
82
+ },
83
+ children: [text || translations[locale] || translations.en, !text && /*#__PURE__*/_jsx("span", {
84
+ style: {
85
+ marginLeft: 6,
86
+ color: "#e74c3c"
87
+ },
88
+ children: "\u2764\uFE0F"
89
+ })]
90
+ })]
91
+ }), /*#__PURE__*/_jsx("div", {
92
+ style: {
93
+ display: "flex",
94
+ gap: 14,
95
+ flexWrap: "wrap"
96
+ },
97
+ children: hashtags.map(function (tag, i) {
98
+ return /*#__PURE__*/_jsx("a", {
99
+ href: "https://twitter.com/search?q=".concat(encodeURIComponent(tag)),
100
+ target: "_blank",
101
+ style: {
102
+ color: t.accent,
103
+ fontFamily: "Inter, sans-serif",
104
+ fontSize: 14,
105
+ fontWeight: 500,
106
+ textDecoration: "none"
107
+ },
108
+ children: tag
109
+ }, i);
110
+ })
111
+ })]
112
+ })
113
+ });
114
+ }
@@ -0,0 +1,99 @@
1
+ <script setup>
2
+ const props = defineProps({
3
+ locale: { default: "en" },
4
+ theme: { default: "light" },
5
+ text: { default: "" },
6
+ mode: { default: "top" },
7
+ });
8
+
9
+ const translations = {
10
+ en: "We stand with Kurdistan",
11
+ ku: "ئێمە لەگەڵ کوردستانین",
12
+ ckb: "ئێمە لەگەڵ کوردستانین",
13
+ ar: "نحن نقف مع كوردستان",
14
+ };
15
+
16
+ const hashtags = ["#SaveRojavaPeople", "#FreeRojava", "#SaveKurdistan"];
17
+
18
+ const themes = {
19
+ light: { bg: "#fff", color: "#333", border: "#e8e8e8", accent: "#c0392b" },
20
+ dark: { bg: "#1a1a1a", color: "#f5f5f5", border: "#333", accent: "#e74c3c" },
21
+ subtle: {
22
+ bg: "#f9f9f9",
23
+ color: "#444",
24
+ border: "#e0e0e0",
25
+ accent: "#2980b9",
26
+ },
27
+ };
28
+
29
+ const t = themes[props.theme] || themes.light;
30
+ const isRTL = ["ar", "ku", "ckb"].includes(props.locale);
31
+ </script>
32
+
33
+ <template>
34
+ <div :style="{ background: t.bg, borderBottom: `1px solid ${t.border}` }">
35
+ <div class="wrap">
36
+ <div class="left">
37
+ <img
38
+ src="https://cdn-icons-png.flaticon.com/512/10600/10600720.png"
39
+ width="36"
40
+ />
41
+ <p :style="{ color: t.color, direction: isRTL ? 'rtl' : 'ltr' }">
42
+ {{ props.text || translations[props.locale] || translations.en }}
43
+ </p>
44
+ </div>
45
+ <div class="right">
46
+ <a
47
+ v-for="tag in hashtags"
48
+ :key="tag"
49
+ :href="`https://twitter.com/search?q=${encodeURIComponent(tag)}`"
50
+ target="_blank"
51
+ class="hashtag"
52
+ >
53
+ {{ tag }}
54
+ </a>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ </template>
59
+
60
+ <style scoped>
61
+ .wrap {
62
+ max-width: 1200px;
63
+ margin: auto;
64
+ padding: 12px 20px;
65
+ display: flex;
66
+ justify-content: space-between;
67
+ flex-wrap: wrap;
68
+ }
69
+ .left {
70
+ display: flex;
71
+ gap: 16px;
72
+ align-items: center;
73
+ }
74
+ .right {
75
+ display: flex;
76
+ gap: 14px;
77
+ flex-wrap: wrap;
78
+ }
79
+ a {
80
+ font-weight: 500;
81
+ text-decoration: none;
82
+ }
83
+ </style>
84
+
85
+ <style scoped>
86
+ .hashtag {
87
+ color: var(--accent, #c0392b);
88
+ font-family: Inter, sans-serif;
89
+ font-size: 14px;
90
+ font-weight: 500;
91
+ text-decoration: none;
92
+ transition: opacity 0.2s ease;
93
+ white-space: nowrap;
94
+ }
95
+
96
+ .hashtag:hover {
97
+ opacity: 0.8;
98
+ }
99
+ </style>
package/package.json CHANGED
@@ -1,13 +1,21 @@
1
1
  {
2
2
  "name": "support-kurdistan",
3
- "version": "1.1.2",
3
+ "version": "1.1.6",
4
4
  "description": "Luxury banner component to support Kurdistan for React, Next.js and Vue",
5
+ "types": "./types/react.d.ts",
5
6
  "type": "module",
6
- "main": "./index.js",
7
+ "files": [
8
+ "dist",
9
+ "types"
10
+ ],
7
11
  "exports": {
8
- ".": "./index.js",
9
- "./react": "./react/SupportKurdistan.jsx",
10
- "./vue": "./vue/SupportKurdistan.vue"
12
+ ".": "./dist/index.js",
13
+ "./react": "./dist/react/SupportKurdistan.js",
14
+ "./vue": "./dist/vue/SupportKurdistan.vue",
15
+ "./angular": {
16
+ "types": "./dist/angular/support-kurdistan.component.d.ts",
17
+ "default": "./dist/angular/support-kurdistan.component.js"
18
+ }
11
19
  },
12
20
  "keywords": [
13
21
  "kurdistan",
@@ -17,6 +25,28 @@
17
25
  "banner",
18
26
  "solidarity"
19
27
  ],
28
+ "scripts": {
29
+ "build:react": "babel src --out-dir dist --extensions \".jsx,.js\"",
30
+ "build:vue": "copyfiles -u 2 src/vue/*.vue dist/vue",
31
+ "build:angular": "npx tsc -p tsconfig.angular.json",
32
+ "build": "npm run build:react && npm run build:vue && npm run build:angular"
33
+ },
20
34
  "author": "Abdulsamad Zuhair",
21
- "license": "MIT"
22
- }
35
+ "license": "MIT",
36
+ "devDependencies": {
37
+ "@babel/cli": "^7.28.6",
38
+ "@babel/core": "^7.28.6",
39
+ "@babel/preset-env": "^7.28.6",
40
+ "@babel/preset-react": "^7.28.5",
41
+ "copyfiles": "^2.4.1",
42
+ "typescript": "^5.9.3"
43
+ },
44
+ "dependencies": {
45
+ "@angular/common": "^21.1.1",
46
+ "@angular/core": "^21.1.1"
47
+ },
48
+ "peerDependencies": {
49
+ "@angular/core": ">=16.0.0",
50
+ "@angular/common": ">=16.0.0"
51
+ }
52
+ }
@@ -0,0 +1,11 @@
1
+ import { ComponentType } from "react";
2
+
3
+ export interface SupportKurdistanProps {
4
+ locale?: string;
5
+ theme?: string;
6
+ text?: string;
7
+ mode?: string;
8
+ }
9
+
10
+ declare const SupportKurdistan: ComponentType<SupportKurdistanProps>;
11
+ export default SupportKurdistan;
@@ -1,94 +0,0 @@
1
- 'use client';
2
- import { useEffect } from "react";
3
-
4
- export default function SupportKurdistan({
5
- locale = "en",
6
- theme = "light",
7
- text = "",
8
- mode = "top"
9
- }) {
10
-
11
- const translations = {
12
- en: "We stand with Kurdistan",
13
- ku: "ئێمە لەگەڵ کوردستانین",
14
- ckb: "ئێمە لەگەڵ کوردستانین",
15
- ar: "نحن نقف مع كوردستان"
16
- };
17
-
18
- const hashtags = ["#SaveRojavaPeople", "#FreeRojava", "#SaveKurdistan"];
19
-
20
- const themes = {
21
- light: { bg:"#fff", color:"#333", border:"#e8e8e8", accent:"#c0392b" },
22
- dark: { bg:"#1a1a1a", color:"#f5f5f5", border:"#333", accent:"#e74c3c" },
23
- subtle: { bg:"#f9f9f9", color:"#444", border:"#e0e0e0", accent:"#2980b9" }
24
- };
25
-
26
- const t = themes[theme] || themes.light;
27
- const isRTL = ["ar","ku","ckb"].includes(locale);
28
-
29
- return (
30
- <div
31
- style={{
32
- position: mode === "footer" ? "relative" : "sticky",
33
- top: mode === "footer" ? undefined : 0,
34
- zIndex: 100,
35
- background: t.bg,
36
- borderBottom: `1px solid ${t.border}`,
37
- width: "100%"
38
- }}
39
- >
40
- <div style={{
41
- maxWidth:1200,
42
- margin:"0 auto",
43
- padding:"12px 20px",
44
- display:"flex",
45
- justifyContent:"space-between",
46
- alignItems:"center",
47
- gap:20,
48
- flexWrap:"wrap"
49
- }}>
50
-
51
- <div style={{display:"flex",alignItems:"center",gap:16}}>
52
- <img
53
- src="https://cdn-icons-png.flaticon.com/512/10600/10600720.png"
54
- width={36}
55
- height={36}
56
- />
57
-
58
- <p style={{
59
- margin:0,
60
- fontFamily:"Inter, sans-serif",
61
- fontSize:16,
62
- fontWeight:500,
63
- color:t.color,
64
- direction:isRTL?"rtl":"ltr",
65
- textAlign:isRTL?"right":"left"
66
- }}>
67
- {text || translations[locale] || translations.en}
68
- {!text && <span style={{marginLeft:6,color:"#e74c3c"}}>❤️</span>}
69
- </p>
70
- </div>
71
-
72
- <div style={{display:"flex",gap:14,flexWrap:"wrap"}}>
73
- {hashtags.map((tag,i)=>(
74
- <a
75
- key={i}
76
- href={`https://twitter.com/search?q=${encodeURIComponent(tag)}`}
77
- target="_blank"
78
- style={{
79
- color:t.accent,
80
- fontFamily:"Inter, sans-serif",
81
- fontSize:14,
82
- fontWeight:500,
83
- textDecoration:"none"
84
- }}
85
- >
86
- {tag}
87
- </a>
88
- ))}
89
- </div>
90
-
91
- </div>
92
- </div>
93
- );
94
- }
File without changes
File without changes