@neptune.fintech/icons 2.1.0 → 2.3.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.
@@ -10,19 +10,26 @@ mada, NUMO, Moamalat, LyPay, OnePay, Sadad, and Tadawul** — are
10
10
  They are provided here ONLY as **simplified, schematic identification marks /
11
11
  placeholders** so that a user interface can label a payment method. They are:
12
12
 
13
- - **NOT** original Neptune Odyssey artwork;
13
+ - **original, clean geometric placeholders** authored for Neptune Odyssey
14
+ **NOT traced or copied** from any official logo artwork;
14
15
  - **NOT** pixel-exact reproductions of any official logo;
15
16
  - **NOT** licensed under the Neptune Odyssey Community License v1.0 (which covers
16
17
  only the original monochrome icon set in `src/icons.ts`);
17
18
  - kept **separate** from the `ICONS` / `IconName` set on purpose.
18
19
 
20
+ Each mark renders in three variants — `color`, `mono`, and `outline` — but all
21
+ three remain placeholders.
22
+
19
23
  The Libyan / local marks (**NUMO, Moamalat, LyPay, OnePay, Sadad, Tadawul**) and
20
24
  the generic **mada**-style mark are **neutral placeholders** (a simple badge plus
21
25
  initials) — this package does not ship those brands' real assets.
22
26
 
23
27
  ## In production
24
28
 
25
- Replace each brand mark with that brand's **official asset** and use it strictly
26
- in accordance with the relevant brand / trademark owner's brand and usage
27
- guidelines. Use of a brand mark does not imply any endorsement, sponsorship, or
28
- affiliation. Neptune.Fintech claims no rights in these third-party trademarks.
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
@@ -62,15 +62,27 @@ Override colour with the `--npt-icon-color` custom property or plain `color`.
62
62
  > Apple Pay, Google Pay, PayPal, SWIFT, mada, NUMO, Moamalat, LyPay, OnePay,
63
63
  > Sadad, Tadawul, …) are **third-party trademarks of their respective owners**,
64
64
  > provided here as **simplified identification marks / placeholders only**. They
65
- > are **NOT** original Neptune Odyssey artwork and are **NOT** licensed under the
66
- > Neptune Odyssey Community License. In production use each brand's **official
67
- > assets per that brand's brand guidelines**. The Libyan/local marks are neutral
68
- > placeholders to be replaced with official assets. See
69
- > [`NOTICE-brand-marks.md`](./NOTICE-brand-marks.md).
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).
70
71
 
71
- Brand marks are **multicolour** and live in a separate module — they return a
72
- **complete** `<svg>` (with their own `viewBox`), not inner markup, and are NOT in
73
- `ICONS` / `IconName`.
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. |
74
86
 
75
87
  ```ts
76
88
  import { brandMarkSvg, BRAND_MARK_NAMES, register } from "@neptune.fintech/icons";
@@ -78,22 +90,60 @@ import { brandMarkSvg, BRAND_MARK_NAMES, register } from "@neptune.fintech/icons
78
90
  // full <svg> string, sized to a height (width preserves aspect ratio)
79
91
  document.querySelector("#pm")!.innerHTML = brandMarkSvg("visa", { height: 24 });
80
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
+
81
97
  // custom element — register() wires up BOTH <npt-icon> and <npt-brand-mark>
82
98
  register();
83
99
  ```
84
100
 
85
101
  ```html
86
102
  <npt-brand-mark name="mastercard" height="24"></npt-brand-mark>
87
- <npt-brand-mark name="apple-pay" height="20"></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>
88
105
  ```
89
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
+
90
136
  | Export | Description |
91
137
  | ------------------ | ---------------------------------------------------------------- |
92
- | `brandMarkSvg` | `(name, { height? }) => string` — full `<svg>`. Throws on bad name. |
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. |
93
142
  | `isBrandMarkName` | `(name) => boolean` type guard for `BrandMarkName`. |
94
- | `BRAND_MARKS` | `Record<BrandMarkName, string>` — complete `<svg>` per mark. |
143
+ | `BRAND_MARKS` | `Record<BrandMarkName, string>` — complete `color`-variant `<svg>` per mark. |
95
144
  | `BRAND_MARK_NAMES` | `BrandMarkName[]` — the roster, in catalogue order. |
96
145
  | `BrandMarkName` | Union type of every brand-mark name. |
146
+ | `BrandMarkVariant` | `"color" \| "mono" \| "outline"`. |
97
147
  | `NptBrandMark` | The `<npt-brand-mark>` custom-element class. |
98
148
  | `registerBrandMarks` / `register` | Register `<npt-brand-mark>` (and `register()` both elements). |
99
149
 
@@ -115,7 +165,7 @@ for free.
115
165
  | `IconName` | Union type of every icon name. |
116
166
  | `NptIcon` | The `<npt-icon>` custom-element class. |
117
167
  | `registerIcons` | Registers `<npt-icon>` (browser-only, idempotent). |
118
- | `ICONS_VERSION` | `"2.1.0"`. |
168
+ | `ICONS_VERSION` | `"2.2.0"`. |
119
169
 
120
170
  ## Icon list
121
171
 
@@ -1,25 +1,59 @@
1
1
  /** Every payment / fintech brand mark shipped (identification placeholders). */
2
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
- /**
4
- * name complete multicolour <svg> string.
5
- *
6
- * Card-ratio canvas (viewBox 0 0 48 32) for wide marks; 32×32 for square
7
- * badges. A neutral card body (#F4F5F7 fill, #E1E3E8 hairline) frames most
8
- * marks so they sit well on any surface.
9
- */
10
- export declare const BRAND_MARKS: Record<BrandMarkName, string>;
3
+ /** The three render variants every brand mark supports. */
4
+ export type BrandMarkVariant = "color" | "mono" | "outline";
11
5
  /** All brand-mark names, in catalogue order. */
12
6
  export declare const BRAND_MARK_NAMES: BrandMarkName[];
13
7
  /** True when `name` is a known brand mark. Acts as a type guard. */
14
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;
15
34
  export interface BrandMarkOptions {
35
+ /** Render variant. Default "color". */
36
+ variant?: BrandMarkVariant;
16
37
  /** Rendered height in px; width scales to preserve the mark's aspect ratio. */
17
38
  height?: number;
39
+ /** Optional class attribute placed on the root <svg>. */
40
+ class?: string;
18
41
  }
19
42
  /**
20
- * Return the complete multicolour <svg> for `name`, sized to a given height.
21
- * Aspect ratio is preserved from the mark's intrinsic viewBox.
22
- * @throws RangeError when `name` is not a known BrandMarkName.
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.
23
50
  */
24
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 {};
25
59
  //# sourceMappingURL=brand-marks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"brand-marks.d.ts","sourceRoot":"","sources":["../src/brand-marks.ts"],"names":[],"mappings":"AAwBA,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;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAkJrD,CAAC;AAEF,gDAAgD;AAChD,eAAO,MAAM,gBAAgB,EAAE,aAAa,EAuB3C,CAAC;AAEF,oEAAoE;AACpE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,IAAI,aAAa,CAEnE;AAED,MAAM,WAAW,gBAAgB;IAC/B,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,EA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