@neptune.fintech/icons 2.0.0 → 2.2.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.
@@ -0,0 +1,35 @@
1
+ # NOTICE — Brand marks (third-party trademarks)
2
+
3
+ The payment-network and fintech **brand marks** shipped in this package
4
+ (`src/brand-marks.ts` → `BRAND_MARKS`, `brandMarkSvg`, `<npt-brand-mark>`) —
5
+ including but not limited to **Visa, Mastercard, American Express, Discover,
6
+ UnionPay, Western Union, MoneyGram, Apple Pay, Google Pay, PayPal, SWIFT,
7
+ mada, NUMO, Moamalat, LyPay, OnePay, Sadad, and Tadawul** — are
8
+ **third-party trademarks of their respective owners**.
9
+
10
+ They are provided here ONLY as **simplified, schematic identification marks /
11
+ placeholders** so that a user interface can label a payment method. They are:
12
+
13
+ - **original, clean geometric placeholders** authored for Neptune Odyssey —
14
+ **NOT traced or copied** from any official logo artwork;
15
+ - **NOT** pixel-exact reproductions of any official logo;
16
+ - **NOT** licensed under the Neptune Odyssey Community License v1.0 (which covers
17
+ only the original monochrome icon set in `src/icons.ts`);
18
+ - kept **separate** from the `ICONS` / `IconName` set on purpose.
19
+
20
+ Each mark renders in three variants — `color`, `mono`, and `outline` — but all
21
+ three remain placeholders.
22
+
23
+ The Libyan / local marks (**NUMO, Moamalat, LyPay, OnePay, Sadad, Tadawul**) and
24
+ the generic **mada**-style mark are **neutral placeholders** (a simple badge plus
25
+ initials) — this package does not ship those brands' real assets.
26
+
27
+ ## In production
28
+
29
+ Replace each brand mark with that brand's **official asset** — the supported path
30
+ is `registerBrandMark(name, svg)` (or a per-variant `{ color, mono, outline }`),
31
+ after which `brandMarkSvg()` and `<npt-brand-mark>` return your approved artwork.
32
+ Use it strictly in accordance with the relevant brand / trademark owner's brand
33
+ and usage guidelines. Use of a brand mark does not imply any endorsement,
34
+ sponsorship, or affiliation. Neptune.Fintech claims no rights in these
35
+ third-party trademarks.
package/README.md CHANGED
@@ -55,6 +55,98 @@ registerIcons(); // browser-only, idempotent
55
55
  Reactive attributes: `name`, `size` (px, default 24), `stroke` (default 1.8).
56
56
  Override colour with the `--npt-icon-color` custom property or plain `color`.
57
57
 
58
+ ## Brand marks (third-party trademarks)
59
+
60
+ > **Trademark notice.** The payment-network & fintech brand marks
61
+ > (Visa, Mastercard, Amex, Discover, UnionPay, Western Union, MoneyGram,
62
+ > Apple Pay, Google Pay, PayPal, SWIFT, mada, NUMO, Moamalat, LyPay, OnePay,
63
+ > Sadad, Tadawul, …) are **third-party trademarks of their respective owners**,
64
+ > provided here as **simplified identification marks / placeholders only**. They
65
+ > are original, clean geometric placeholders (**never traced** from official
66
+ > artwork) and are **NOT** licensed under the Neptune Odyssey Community License.
67
+ > In production, register each brand's **official asset** with
68
+ > [`registerBrandMark()`](#use-your-own-official-logos) per that brand's brand
69
+ > guidelines. The Libyan/local marks are neutral placeholders to be replaced with
70
+ > official assets. See [`NOTICE-brand-marks.md`](./NOTICE-brand-marks.md).
71
+
72
+ Brand marks live in a separate module — they return a **complete** `<svg>` (with
73
+ their own `viewBox`), not inner markup, and are NOT in `ICONS` / `IconName`. The
74
+ bundled marks are **original, simplified geometric placeholders** (never traced
75
+ from official artwork).
76
+
77
+ ### Three variants
78
+
79
+ Every mark renders in three variants via `brandMarkSvg(name, { variant })`:
80
+
81
+ | Variant | What it is |
82
+ | --------- | ---------------------------------------------------------------------- |
83
+ | `color` | Multicolour brand colours. **The default.** Not themeable. |
84
+ | `mono` | A single flat silhouette in `currentColor` — themeable like an icon. |
85
+ | `outline` | Line style: `stroke="currentColor"`, `fill="none"`, round joins — themeable. |
86
+
87
+ ```ts
88
+ import { brandMarkSvg, BRAND_MARK_NAMES, register } from "@neptune.fintech/icons";
89
+
90
+ // full <svg> string, sized to a height (width preserves aspect ratio)
91
+ document.querySelector("#pm")!.innerHTML = brandMarkSvg("visa", { height: 24 });
92
+
93
+ // mono / outline track `currentColor`, so they theme like the icon set
94
+ brandMarkSvg("mastercard", { variant: "mono", height: 24 });
95
+ brandMarkSvg("onepay", { variant: "outline", height: 24, class: "pm" });
96
+
97
+ // custom element — register() wires up BOTH <npt-icon> and <npt-brand-mark>
98
+ register();
99
+ ```
100
+
101
+ ```html
102
+ <npt-brand-mark name="mastercard" height="24"></npt-brand-mark>
103
+ <npt-brand-mark name="apple-pay" height="20" variant="mono"></npt-brand-mark>
104
+ <npt-brand-mark name="lypay" height="24" variant="outline"></npt-brand-mark>
105
+ ```
106
+
107
+ ### Use your own official logos
108
+
109
+ The bundled marks are **identification placeholders**. If you are licensed to use
110
+ a brand's official logo, drop it in with `registerBrandMark()` — after that,
111
+ `brandMarkSvg(name, { variant })` (and `<npt-brand-mark>`) return **your**
112
+ approved artwork:
113
+
114
+ ```ts
115
+ import { registerBrandMark, brandMarkSvg } from "@neptune.fintech/icons";
116
+
117
+ // one SVG covers all three variants
118
+ registerBrandMark("visa", officialVisaSvg);
119
+
120
+ // …or supply a per-variant set (missing variants fall back across the others)
121
+ registerBrandMark("mastercard", {
122
+ color: officialMastercardColorSvg,
123
+ mono: officialMastercardMonoSvg,
124
+ outline: officialMastercardOutlineSvg,
125
+ });
126
+
127
+ brandMarkSvg("visa", { height: 24 }); // → your official Visa SVG
128
+ brandMarkSvg("mastercard", { variant: "mono" }); // → your mono Mastercard SVG
129
+ ```
130
+
131
+ `registerBrandMark(name, svg)` also accepts an arbitrary `name` string, so you can
132
+ register brands that aren't bundled (then render them with `brandMarkSvg(name)`).
133
+ **Licensed users SHOULD register official assets** and follow each brand's usage
134
+ guidelines; the bundled marks are placeholders only.
135
+
136
+ | Export | Description |
137
+ | ------------------ | ---------------------------------------------------------------- |
138
+ | `brandMarkSvg` | `(name, { variant?, height?, class? }) => string` — full `<svg>`. Throws on unknown name with no override. |
139
+ | `registerBrandMark`| `(name, svg \| { color?, mono?, outline? }) => void` — install an official/own override. |
140
+ | `unregisterBrandMark` | `(name) => void` — remove a registered override. |
141
+ | `hasBrandMarkOverride` | `(name) => boolean` — true when an override is registered. |
142
+ | `isBrandMarkName` | `(name) => boolean` type guard for `BrandMarkName`. |
143
+ | `BRAND_MARKS` | `Record<BrandMarkName, string>` — complete `color`-variant `<svg>` per mark. |
144
+ | `BRAND_MARK_NAMES` | `BrandMarkName[]` — the roster, in catalogue order. |
145
+ | `BrandMarkName` | Union type of every brand-mark name. |
146
+ | `BrandMarkVariant` | `"color" \| "mono" \| "outline"`. |
147
+ | `NptBrandMark` | The `<npt-brand-mark>` custom-element class. |
148
+ | `registerBrandMarks` / `register` | Register `<npt-brand-mark>` (and `register()` both elements). |
149
+
58
150
  ## Theming
59
151
 
60
152
  There is nothing to configure. Because each glyph uses `currentColor`, it
@@ -73,7 +165,7 @@ for free.
73
165
  | `IconName` | Union type of every icon name. |
74
166
  | `NptIcon` | The `<npt-icon>` custom-element class. |
75
167
  | `registerIcons` | Registers `<npt-icon>` (browser-only, idempotent). |
76
- | `ICONS_VERSION` | `"2.0.0"`. |
168
+ | `ICONS_VERSION` | `"2.2.0"`. |
77
169
 
78
170
  ## Icon list
79
171
 
@@ -86,7 +178,9 @@ for free.
86
178
  `trending-up`, `trending-down`, `savings`, `calendar`, `clock`, `location`,
87
179
  `phone`, `mail`, `support`, `chevron-right`, `chevron-down`, `arrow-right`,
88
180
  `arrow-left`, `menu`, `more-horizontal`, `more-vertical`, `copy`, `share`,
89
- `logout`, `language`, `moon`, `sun`.
181
+ `logout`, `language`, `moon`, `sun`, `atm`, `pos-terminal`, `coins`,
182
+ `cash-stack`, `invoice`, `pie-budget`, `exchange-rate`, `crypto`, `loan`,
183
+ `insurance`, `split-bill`, `tap-to-pay`.
90
184
 
91
185
  ## License
92
186
 
@@ -0,0 +1,59 @@
1
+ /** Every payment / fintech brand mark shipped (identification placeholders). */
2
+ export type BrandMarkName = "visa" | "mastercard" | "amex" | "discover" | "unionpay" | "western-union" | "moneygram" | "numo" | "moamalat" | "lypay" | "onepay" | "sadad" | "tadawul" | "apple-pay" | "google-pay" | "paypal" | "swift" | "mada" | "generic-card" | "contactless-pay" | "cash" | "bank-building";
3
+ /** The three render variants every brand mark supports. */
4
+ export type BrandMarkVariant = "color" | "mono" | "outline";
5
+ /** All brand-mark names, in catalogue order. */
6
+ export declare const BRAND_MARK_NAMES: BrandMarkName[];
7
+ /** True when `name` is a known brand mark. Acts as a type guard. */
8
+ export declare function isBrandMarkName(name: string): name is BrandMarkName;
9
+ /** Per-variant override entry. A bare string fills all three variants. */
10
+ interface OverrideEntry {
11
+ color?: string;
12
+ mono?: string;
13
+ outline?: string;
14
+ }
15
+ /**
16
+ * Register a brand's OFFICIAL, licensed SVG, overriding the bundled placeholder.
17
+ *
18
+ * Licensed users SHOULD call this to render approved official artwork:
19
+ * registerBrandMark("visa", officialVisaSvg); // all variants
20
+ * registerBrandMark("visa", { color, mono, outline }); // per-variant
21
+ *
22
+ * After registration, brandMarkSvg(name, { variant }) returns the override,
23
+ * falling back across variants when only some are provided
24
+ * (color → mono → outline, whichever exists). <npt-brand-mark> uses it too.
25
+ *
26
+ * `name` is typed as BrandMarkName | string so you may also register your own
27
+ * additional brands (then render them via brandMarkSvg(yourName)).
28
+ */
29
+ export declare function registerBrandMark(name: BrandMarkName | string, svg: string | OverrideEntry): void;
30
+ /** Remove a previously registered override (mainly for tests/tooling). */
31
+ export declare function unregisterBrandMark(name: BrandMarkName | string): void;
32
+ /** True when an official-asset override has been registered for `name`. */
33
+ export declare function hasBrandMarkOverride(name: string): boolean;
34
+ export interface BrandMarkOptions {
35
+ /** Render variant. Default "color". */
36
+ variant?: BrandMarkVariant;
37
+ /** Rendered height in px; width scales to preserve the mark's aspect ratio. */
38
+ height?: number;
39
+ /** Optional class attribute placed on the root <svg>. */
40
+ class?: string;
41
+ }
42
+ /**
43
+ * Return the complete <svg> for `name`, in the requested variant, sized to a
44
+ * height. Aspect ratio is preserved from the mark's intrinsic viewBox.
45
+ *
46
+ * If an official asset was registered via registerBrandMark(), that override is
47
+ * returned (with width/height sized to `height`), falling back across variants.
48
+ *
49
+ * @throws RangeError when `name` is not a known BrandMarkName and has no override.
50
+ */
51
+ export declare function brandMarkSvg(name: BrandMarkName, opts?: BrandMarkOptions): string;
52
+ /**
53
+ * BRAND_MARKS — name → complete multicolour ("color" variant) <svg> string.
54
+ * Kept as a convenience map (back-compat). For mono/outline or overrides, use
55
+ * brandMarkSvg(name, { variant }).
56
+ */
57
+ export declare const BRAND_MARKS: Record<BrandMarkName, string>;
58
+ export {};
59
+ //# sourceMappingURL=brand-marks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"brand-marks.d.ts","sourceRoot":"","sources":["../src/brand-marks.ts"],"names":[],"mappings":"AA+BA,gFAAgF;AAChF,MAAM,MAAM,aAAa,GAErB,MAAM,GACN,YAAY,GACZ,MAAM,GACN,UAAU,GACV,UAAU,GAEV,eAAe,GACf,WAAW,GAEX,MAAM,GACN,UAAU,GACV,OAAO,GACP,QAAQ,GACR,OAAO,GACP,SAAS,GAET,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,OAAO,GACP,MAAM,GACN,cAAc,GACd,iBAAiB,GACjB,MAAM,GACN,eAAe,CAAC;AAEpB,2DAA2D;AAC3D,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAqrB5D,gDAAgD;AAChD,eAAO,MAAM,gBAAgB,EAAE,aAAa,EAuB3C,CAAC;AAEF,oEAAoE;AACpE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,aAAa,CAEnE;AAkLD,0EAA0E;AAC1E,UAAU,aAAa;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,aAAa,GAAG,MAAM,EAC5B,GAAG,EAAE,MAAM,GAAG,aAAa,GAC1B,IAAI,CAGN;AAED,0EAA0E;AAC1E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAEtE;AAED,2EAA2E;AAC3E,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1D;AAiBD,MAAM,WAAW,gBAAgB;IAC/B,uCAAuC;IACvC,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAuCD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,GAAE,gBAAqB,GAAG,MAAM,CAgBrF;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAMrD,CAAC"}