@f-ewald/components 1.13.0 → 1.14.1

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.
@@ -8581,7 +8581,7 @@
8581
8581
  "declarations": [
8582
8582
  {
8583
8583
  "kind": "class",
8584
- "description": "A plain circular map marker: a light-to-dark gradient fill with a white\nouter ring, no point/tail (unlike `<map-pin>`) for markers that don't\nneed to visually \"point\" at their exact coordinate. Purely a visual\nprimitive — it has no `mapbox-gl` (or any mapping library) dependency;\nthe consumer positions it, e.g. via `new mapboxgl.Marker({ element: el })`.\nIt can also replace the former `<map-point>` dense-layer primitive: use\n`size=\"14\" ring-width=\"3\"`, leave the slot empty, and rasterize one marker\nper color for use as a map `icon-image`.",
8584
+ "description": "A plain circular map marker: a radial-gradient fill with a soft highlight\nand a solid white outer ring, no point/tail (unlike `<map-pin>`) —\nfor markers that don't need to visually \"point\" at their exact\ncoordinate. Purely a visual primitive — it has no `mapbox-gl` (or any\nmapping library) dependency; the consumer positions it, e.g. via\n`new mapboxgl.Marker({ element: el })`. It can also replace the former\n`<map-point>` dense-layer primitive: use `size=\"14\" ring-width=\"3\"`, leave\nthe slot empty, and rasterize one marker per color for use as a map\n`icon-image`.",
8585
8585
  "name": "MapCircle",
8586
8586
  "slots": [
8587
8587
  {
@@ -8597,7 +8597,7 @@
8597
8597
  "text": "string"
8598
8598
  },
8599
8599
  "default": "\"#4f46e5\"",
8600
- "description": "Fill color; the gradient's light (top) and dark (bottom) stops are derived from this.",
8600
+ "description": "Fill color; the gradient's light (highlight) and dark (edge) stops are derived from this.",
8601
8601
  "attribute": "color"
8602
8602
  },
8603
8603
  {
@@ -8616,10 +8616,20 @@
8616
8616
  "type": {
8617
8617
  "text": "number"
8618
8618
  },
8619
- "default": "4",
8619
+ "default": "2",
8620
8620
  "description": "White outer ring thickness, in the same viewBox units as `size` (scales with it).",
8621
8621
  "attribute": "ring-width"
8622
8622
  },
8623
+ {
8624
+ "kind": "field",
8625
+ "name": "ringOpacity",
8626
+ "type": {
8627
+ "text": "number"
8628
+ },
8629
+ "default": "1",
8630
+ "description": "Outer ring opacity, 0-1 (default 1 = a solid Apple Maps-style white ring; lower for a translucent ring).",
8631
+ "attribute": "ring-opacity"
8632
+ },
8623
8633
  {
8624
8634
  "kind": "field",
8625
8635
  "name": "highlighted",
@@ -8646,7 +8656,7 @@
8646
8656
  "text": "string"
8647
8657
  },
8648
8658
  "default": "\"#4f46e5\"",
8649
- "description": "Fill color; the gradient's light (top) and dark (bottom) stops are derived from this.",
8659
+ "description": "Fill color; the gradient's light (highlight) and dark (edge) stops are derived from this.",
8650
8660
  "fieldName": "color"
8651
8661
  },
8652
8662
  {
@@ -8663,10 +8673,19 @@
8663
8673
  "type": {
8664
8674
  "text": "number"
8665
8675
  },
8666
- "default": "4",
8676
+ "default": "2",
8667
8677
  "description": "White outer ring thickness, in the same viewBox units as `size` (scales with it).",
8668
8678
  "fieldName": "ringWidth"
8669
8679
  },
8680
+ {
8681
+ "name": "ring-opacity",
8682
+ "type": {
8683
+ "text": "number"
8684
+ },
8685
+ "default": "1",
8686
+ "description": "Outer ring opacity, 0-1 (default 1 = a solid Apple Maps-style white ring; lower for a translucent ring).",
8687
+ "fieldName": "ringOpacity"
8688
+ },
8670
8689
  {
8671
8690
  "name": "highlighted",
8672
8691
  "type": {
@@ -8710,7 +8729,7 @@
8710
8729
  "declarations": [
8711
8730
  {
8712
8731
  "kind": "class",
8713
- "description": "A circular \"Apple Maps\"-style map pin: a light-to-dark gradient fill with\na slight point at the bottom. Purely a visual primitive it has no\n`mapbox-gl` (or any mapping library) dependency; the consumer positions\nit, e.g. via `new mapboxgl.Marker({ element: pinEl })`.",
8732
+ "description": "A circular \"Apple Maps\"-style map pin: a radial-gradient fill with a soft\nhighlight and a slight point at the bottom. Purely a visual primitive —\nit has no `mapbox-gl` (or any mapping library) dependency; the consumer\npositions it, e.g. via `new mapboxgl.Marker({ element: pinEl })`.",
8714
8733
  "name": "MapPin",
8715
8734
  "slots": [
8716
8735
  {
@@ -8726,7 +8745,7 @@
8726
8745
  "text": "string"
8727
8746
  },
8728
8747
  "default": "\"#4f46e5\"",
8729
- "description": "Fill color; the gradient's light (top) and dark (bottom) stops are derived from this.",
8748
+ "description": "Fill color; the gradient's light (highlight) and dark (edge) stops are derived from this.",
8730
8749
  "attribute": "color"
8731
8750
  },
8732
8751
  {
@@ -8739,6 +8758,16 @@
8739
8758
  "description": "Diameter of the circular head, in CSS pixels.",
8740
8759
  "attribute": "size"
8741
8760
  },
8761
+ {
8762
+ "kind": "field",
8763
+ "name": "ringOpacity",
8764
+ "type": {
8765
+ "text": "number"
8766
+ },
8767
+ "default": "1",
8768
+ "description": "Outer ring opacity, 0-1 (default 1 = a solid Apple Maps-style white ring; lower for a translucent ring).",
8769
+ "attribute": "ring-opacity"
8770
+ },
8742
8771
  {
8743
8772
  "kind": "field",
8744
8773
  "name": "highlighted",
@@ -8765,7 +8794,7 @@
8765
8794
  "text": "string"
8766
8795
  },
8767
8796
  "default": "\"#4f46e5\"",
8768
- "description": "Fill color; the gradient's light (top) and dark (bottom) stops are derived from this.",
8797
+ "description": "Fill color; the gradient's light (highlight) and dark (edge) stops are derived from this.",
8769
8798
  "fieldName": "color"
8770
8799
  },
8771
8800
  {
@@ -8777,6 +8806,15 @@
8777
8806
  "description": "Diameter of the circular head, in CSS pixels.",
8778
8807
  "fieldName": "size"
8779
8808
  },
8809
+ {
8810
+ "name": "ring-opacity",
8811
+ "type": {
8812
+ "text": "number"
8813
+ },
8814
+ "default": "1",
8815
+ "description": "Outer ring opacity, 0-1 (default 1 = a solid Apple Maps-style white ring; lower for a translucent ring).",
8816
+ "fieldName": "ringOpacity"
8817
+ },
8780
8818
  {
8781
8819
  "name": "highlighted",
8782
8820
  "type": {
@@ -1,13 +1,14 @@
1
1
  import { LitElement } from "lit";
2
2
  /**
3
- * A plain circular map marker: a light-to-dark gradient fill with a white
4
- * outer ring, no point/tail (unlike `<map-pin>`) — for markers that don't
5
- * need to visually "point" at their exact coordinate. Purely a visual
6
- * primitive — it has no `mapbox-gl` (or any mapping library) dependency;
7
- * the consumer positions it, e.g. via `new mapboxgl.Marker({ element: el })`.
8
- * It can also replace the former `<map-point>` dense-layer primitive: use
9
- * `size="14" ring-width="3"`, leave the slot empty, and rasterize one marker
10
- * per color for use as a map `icon-image`.
3
+ * A plain circular map marker: a radial-gradient fill with a soft highlight
4
+ * and a solid white outer ring, no point/tail (unlike `<map-pin>`) —
5
+ * for markers that don't need to visually "point" at their exact
6
+ * coordinate. Purely a visual primitive — it has no `mapbox-gl` (or any
7
+ * mapping library) dependency; the consumer positions it, e.g. via
8
+ * `new mapboxgl.Marker({ element: el })`. It can also replace the former
9
+ * `<map-point>` dense-layer primitive: use `size="14" ring-width="3"`, leave
10
+ * the slot empty, and rasterize one marker per color for use as a map
11
+ * `icon-image`.
11
12
  *
12
13
  * @element map-circle
13
14
  * @slot - Optional badge content shown centered on the circle — a rank
@@ -15,12 +16,14 @@ import { LitElement } from "lit";
15
16
  */
16
17
  export declare class MapCircle extends LitElement {
17
18
  static styles: import("lit").CSSResult[];
18
- /** Fill color; the gradient's light (top) and dark (bottom) stops are derived from this. */
19
+ /** Fill color; the gradient's light (highlight) and dark (edge) stops are derived from this. */
19
20
  color: string;
20
21
  /** Diameter, in CSS pixels. */
21
22
  size: number;
22
23
  /** White outer ring thickness, in the same viewBox units as `size` (scales with it). */
23
24
  ringWidth: number;
25
+ /** Outer ring opacity, 0-1 (default 1 = a solid Apple Maps-style white ring; lower for a translucent ring). */
26
+ ringOpacity: number;
24
27
  /** Scales and glows the circle — a generic emphasis state (e.g. hover, selection). */
25
28
  highlighted: boolean;
26
29
  private readonly _gradId;
@@ -1 +1 @@
1
- {"version":3,"file":"map-circle.d.ts","sourceRoot":"","sources":["../src/map-circle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAO5C;;;;;;;;;;;;;GAaG;AACH,qBACa,SAAU,SAAQ,UAAU;IACvC,OAAgB,MAAM,4BA4CpB;IAEF,4FAA4F;IAChF,KAAK,SAAa;IAC9B,+BAA+B;IACH,IAAI,SAAM;IACtC,wFAAwF;IACnC,SAAS,SAAK;IACnE,sFAAsF;IAC1C,WAAW,UAAS;IAEhE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA4C;IAE3D,MAAM,yCAwBd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
1
+ {"version":3,"file":"map-circle.d.ts","sourceRoot":"","sources":["../src/map-circle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAO5C;;;;;;;;;;;;;;GAcG;AACH,qBACa,SAAU,SAAQ,UAAU;IACvC,OAAgB,MAAM,4BA6CpB;IAEF,gGAAgG;IACpF,KAAK,SAAa;IAC9B,+BAA+B;IACH,IAAI,SAAM;IACtC,wFAAwF;IACnC,SAAS,SAAK;IACnE,+GAA+G;IACxD,WAAW,SAAK;IACvE,sFAAsF;IAC1C,WAAW,UAAS;IAEhE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA4C;IAE3D,MAAM,yCA8Cd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
@@ -10,14 +10,15 @@ import { tokens } from "./tokens.js";
10
10
  import { mixHex } from "./utils/color.js";
11
11
  let gradientIdCounter = 0;
12
12
  /**
13
- * A plain circular map marker: a light-to-dark gradient fill with a white
14
- * outer ring, no point/tail (unlike `<map-pin>`) — for markers that don't
15
- * need to visually "point" at their exact coordinate. Purely a visual
16
- * primitive — it has no `mapbox-gl` (or any mapping library) dependency;
17
- * the consumer positions it, e.g. via `new mapboxgl.Marker({ element: el })`.
18
- * It can also replace the former `<map-point>` dense-layer primitive: use
19
- * `size="14" ring-width="3"`, leave the slot empty, and rasterize one marker
20
- * per color for use as a map `icon-image`.
13
+ * A plain circular map marker: a radial-gradient fill with a soft highlight
14
+ * and a solid white outer ring, no point/tail (unlike `<map-pin>`) —
15
+ * for markers that don't need to visually "point" at their exact
16
+ * coordinate. Purely a visual primitive — it has no `mapbox-gl` (or any
17
+ * mapping library) dependency; the consumer positions it, e.g. via
18
+ * `new mapboxgl.Marker({ element: el })`. It can also replace the former
19
+ * `<map-point>` dense-layer primitive: use `size="14" ring-width="3"`, leave
20
+ * the slot empty, and rasterize one marker per color for use as a map
21
+ * `icon-image`.
21
22
  *
22
23
  * @element map-circle
23
24
  * @slot - Optional badge content shown centered on the circle — a rank
@@ -26,12 +27,14 @@ let gradientIdCounter = 0;
26
27
  let MapCircle = class MapCircle extends LitElement {
27
28
  constructor() {
28
29
  super(...arguments);
29
- /** Fill color; the gradient's light (top) and dark (bottom) stops are derived from this. */
30
+ /** Fill color; the gradient's light (highlight) and dark (edge) stops are derived from this. */
30
31
  this.color = "#4f46e5";
31
32
  /** Diameter, in CSS pixels. */
32
33
  this.size = 18;
33
34
  /** White outer ring thickness, in the same viewBox units as `size` (scales with it). */
34
- this.ringWidth = 4;
35
+ this.ringWidth = 2;
36
+ /** Outer ring opacity, 0-1 (default 1 = a solid Apple Maps-style white ring; lower for a translucent ring). */
37
+ this.ringOpacity = 1;
35
38
  /** Scales and glows the circle — a generic emphasis state (e.g. hover, selection). */
36
39
  this.highlighted = false;
37
40
  this._gradId = `map-circle-grad-${gradientIdCounter++}`;
@@ -46,6 +49,7 @@ let MapCircle = class MapCircle extends LitElement {
46
49
  }
47
50
  svg {
48
51
  display: block;
52
+ filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.25));
49
53
  transition: transform 120ms ease, filter 120ms ease;
50
54
  }
51
55
  :host([highlighted]) svg {
@@ -84,6 +88,13 @@ let MapCircle = class MapCircle extends LitElement {
84
88
  render() {
85
89
  const light = mixHex(this.color, "#ffffff", 30);
86
90
  const dark = mixHex(this.color, "#000000", 30);
91
+ // A fixed outer radius keeps the marker footprint constant as `ring-width`
92
+ // varies; the ring sits entirely outside the fill (the fill meets the
93
+ // ring's inner edge) so the stroke never straddles the fill edge — which
94
+ // is what used to read as two rings.
95
+ const outerR = 15;
96
+ const fillR = outerR - this.ringWidth;
97
+ const ringR = outerR - this.ringWidth / 2;
87
98
  return html `
88
99
  <svg
89
100
  aria-hidden="true"
@@ -94,12 +105,27 @@ let MapCircle = class MapCircle extends LitElement {
94
105
  xmlns="http://www.w3.org/2000/svg"
95
106
  >
96
107
  <defs>
97
- <linearGradient id=${this._gradId} x1="0" y1="0" x2="0" y2="1">
108
+ <radialGradient id=${this._gradId} cx="35%" cy="30%" r="75%">
98
109
  <stop offset="0%" stop-color=${light} />
99
110
  <stop offset="100%" stop-color=${dark} />
100
- </linearGradient>
111
+ </radialGradient>
101
112
  </defs>
102
- <circle cx="16" cy="16" r="13" fill="url(#${this._gradId})" stroke="#ffffff" stroke-width=${this.ringWidth} />
113
+ <circle
114
+ class="fill"
115
+ cx="16"
116
+ cy="16"
117
+ r=${fillR}
118
+ fill="url(#${this._gradId})"
119
+ />
120
+ <circle
121
+ class="ring"
122
+ cx="16"
123
+ cy="16"
124
+ r=${ringR}
125
+ fill="none"
126
+ stroke="rgb(255 255 255 / ${this.ringOpacity})"
127
+ stroke-width=${this.ringWidth}
128
+ />
103
129
  </svg>
104
130
  <div class="content" style="font-size:${Math.round(this.size * 0.4)}px">
105
131
  <slot></slot>
@@ -116,6 +142,9 @@ __decorate([
116
142
  __decorate([
117
143
  property({ type: Number, attribute: "ring-width" })
118
144
  ], MapCircle.prototype, "ringWidth", void 0);
145
+ __decorate([
146
+ property({ type: Number, attribute: "ring-opacity" })
147
+ ], MapCircle.prototype, "ringOpacity", void 0);
119
148
  __decorate([
120
149
  property({ type: Boolean, reflect: true })
121
150
  ], MapCircle.prototype, "highlighted", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"map-circle.js","sourceRoot":"","sources":["../src/map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ACJ,CAAC;CACF,CAAA;AAnCa;IAAX,QAAQ,EAAE;wCAAmB;AAEF;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAW;AAEe;IAApD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;4CAAe;AAEvB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAAqB;AAtDrD,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CAmFrB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\nimport { mixHex } from \"./utils/color.js\";\n\nlet gradientIdCounter = 0;\n\n/**\n * A plain circular map marker: a light-to-dark gradient fill with a white\n * outer ring, no point/tail (unlike `<map-pin>`) for markers that don't\n * need to visually \"point\" at their exact coordinate. Purely a visual\n * primitive — it has no `mapbox-gl` (or any mapping library) dependency;\n * the consumer positions it, e.g. via `new mapboxgl.Marker({ element: el })`.\n * It can also replace the former `<map-point>` dense-layer primitive: use\n * `size=\"14\" ring-width=\"3\"`, leave the slot empty, and rasterize one marker\n * per color for use as a map `icon-image`.\n *\n * @element map-circle\n * @slot - Optional badge content shown centered on the circle — a rank\n * number, an emoji, a small icon.\n */\n@customElement(\"map-circle\")\nexport class MapCircle extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-block;\n position: relative;\n line-height: 0;\n }\n svg {\n display: block;\n transition: transform 120ms ease, filter 120ms ease;\n }\n :host([highlighted]) svg {\n transform: scale(1.12);\n filter: brightness(1.08) drop-shadow(0 0 5px rgb(0 0 0 / 0.35));\n }\n .content {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n color: #fff;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-weight: var(--ui-font-weight-bold, 700);\n line-height: var(--ui-line-height-glyph, 1);\n text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);\n pointer-events: none;\n white-space: nowrap;\n }\n @media (prefers-reduced-motion: reduce) {\n svg {\n transition: none;\n }\n }\n `,\n ];\n\n /** Fill color; the gradient's light (top) and dark (bottom) stops are derived from this. */\n @property() color = \"#4f46e5\";\n /** Diameter, in CSS pixels. */\n @property({ type: Number }) size = 18;\n /** White outer ring thickness, in the same viewBox units as `size` (scales with it). */\n @property({ type: Number, attribute: \"ring-width\" }) ringWidth = 4;\n /** Scales and glows the circle — a generic emphasis state (e.g. hover, selection). */\n @property({ type: Boolean, reflect: true }) highlighted = false;\n\n private readonly _gradId = `map-circle-grad-${gradientIdCounter++}`;\n\n override render() {\n const light = mixHex(this.color, \"#ffffff\", 30);\n const dark = mixHex(this.color, \"#000000\", 30);\n return html`\n <svg\n aria-hidden=\"true\"\n width=${this.size}\n height=${this.size}\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient id=${this._gradId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stop-color=${light} />\n <stop offset=\"100%\" stop-color=${dark} />\n </linearGradient>\n </defs>\n <circle cx=\"16\" cy=\"16\" r=\"13\" fill=\"url(#${this._gradId})\" stroke=\"#ffffff\" stroke-width=${this.ringWidth} />\n </svg>\n <div class=\"content\" style=\"font-size:${Math.round(this.size * 0.4)}px\">\n <slot></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"map-circle\": MapCircle;\n }\n}\n"]}
1
+ {"version":3,"file":"map-circle.js","sourceRoot":"","sources":["../src/map-circle.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,E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I;;;;;;+BAMK,IAAI,CAAC,OAAO;2CACA,KAAK;6CACH,IAAI;;;;;;;cAOnC,KAAK;uBACI,IAAI,CAAC,OAAO;;;;;;cAMrB,KAAK;;sCAEmB,IAAI,CAAC,WAAW;yBAC7B,IAAI,CAAC,SAAS;;;8CAGO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;;;KAGpE,CAAC;IACJ,CAAC;CACF,CAAA;AA3Da;IAAX,QAAQ,EAAE;wCAAmB;AAEF;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAW;AAEe;IAApD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;4CAAe;AAEZ;IAAtD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;8CAAiB;AAE3B;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;8CAAqB;AAzDrD,SAAS;IADrB,aAAa,CAAC,YAAY,CAAC;GACf,SAAS,CA4GrB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\nimport { mixHex } from \"./utils/color.js\";\n\nlet gradientIdCounter = 0;\n\n/**\n * A plain circular map marker: a radial-gradient fill with a soft highlight\n * and a solid white outer ring, no point/tail (unlike `<map-pin>`) —\n * for markers that don't need to visually \"point\" at their exact\n * coordinate. Purely a visual primitive — it has no `mapbox-gl` (or any\n * mapping library) dependency; the consumer positions it, e.g. via\n * `new mapboxgl.Marker({ element: el })`. It can also replace the former\n * `<map-point>` dense-layer primitive: use `size=\"14\" ring-width=\"3\"`, leave\n * the slot empty, and rasterize one marker per color for use as a map\n * `icon-image`.\n *\n * @element map-circle\n * @slot - Optional badge content shown centered on the circle — a rank\n * number, an emoji, a small icon.\n */\n@customElement(\"map-circle\")\nexport class MapCircle extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-block;\n position: relative;\n line-height: 0;\n }\n svg {\n display: block;\n filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.25));\n transition: transform 120ms ease, filter 120ms ease;\n }\n :host([highlighted]) svg {\n transform: scale(1.12);\n filter: brightness(1.08) drop-shadow(0 0 5px rgb(0 0 0 / 0.35));\n }\n .content {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n color: #fff;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-weight: var(--ui-font-weight-bold, 700);\n line-height: var(--ui-line-height-glyph, 1);\n text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);\n pointer-events: none;\n white-space: nowrap;\n }\n @media (prefers-reduced-motion: reduce) {\n svg {\n transition: none;\n }\n }\n `,\n ];\n\n /** Fill color; the gradient's light (highlight) and dark (edge) stops are derived from this. */\n @property() color = \"#4f46e5\";\n /** Diameter, in CSS pixels. */\n @property({ type: Number }) size = 18;\n /** White outer ring thickness, in the same viewBox units as `size` (scales with it). */\n @property({ type: Number, attribute: \"ring-width\" }) ringWidth = 2;\n /** Outer ring opacity, 0-1 (default 1 = a solid Apple Maps-style white ring; lower for a translucent ring). */\n @property({ type: Number, attribute: \"ring-opacity\" }) ringOpacity = 1;\n /** Scales and glows the circle — a generic emphasis state (e.g. hover, selection). */\n @property({ type: Boolean, reflect: true }) highlighted = false;\n\n private readonly _gradId = `map-circle-grad-${gradientIdCounter++}`;\n\n override render() {\n const light = mixHex(this.color, \"#ffffff\", 30);\n const dark = mixHex(this.color, \"#000000\", 30);\n // A fixed outer radius keeps the marker footprint constant as `ring-width`\n // varies; the ring sits entirely outside the fill (the fill meets the\n // ring's inner edge) so the stroke never straddles the fill edge — which\n // is what used to read as two rings.\n const outerR = 15;\n const fillR = outerR - this.ringWidth;\n const ringR = outerR - this.ringWidth / 2;\n return html`\n <svg\n aria-hidden=\"true\"\n width=${this.size}\n height=${this.size}\n viewBox=\"0 0 32 32\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <radialGradient id=${this._gradId} cx=\"35%\" cy=\"30%\" r=\"75%\">\n <stop offset=\"0%\" stop-color=${light} />\n <stop offset=\"100%\" stop-color=${dark} />\n </radialGradient>\n </defs>\n <circle\n class=\"fill\"\n cx=\"16\"\n cy=\"16\"\n r=${fillR}\n fill=\"url(#${this._gradId})\"\n />\n <circle\n class=\"ring\"\n cx=\"16\"\n cy=\"16\"\n r=${ringR}\n fill=\"none\"\n stroke=\"rgb(255 255 255 / ${this.ringOpacity})\"\n stroke-width=${this.ringWidth}\n />\n </svg>\n <div class=\"content\" style=\"font-size:${Math.round(this.size * 0.4)}px\">\n <slot></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"map-circle\": MapCircle;\n }\n}\n"]}
package/dist/map-pin.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { LitElement } from "lit";
2
2
  /**
3
- * A circular "Apple Maps"-style map pin: a light-to-dark gradient fill with
4
- * a slight point at the bottom. Purely a visual primitive — it has no
5
- * `mapbox-gl` (or any mapping library) dependency; the consumer positions
6
- * it, e.g. via `new mapboxgl.Marker({ element: pinEl })`.
3
+ * A circular "Apple Maps"-style map pin: a radial-gradient fill with a soft
4
+ * highlight and a slight point at the bottom. Purely a visual primitive —
5
+ * it has no `mapbox-gl` (or any mapping library) dependency; the consumer
6
+ * positions it, e.g. via `new mapboxgl.Marker({ element: pinEl })`.
7
7
  *
8
8
  * @element map-pin
9
9
  * @slot - Badge content shown centered on the pin's circular head — a rank
@@ -11,10 +11,12 @@ import { LitElement } from "lit";
11
11
  */
12
12
  export declare class MapPin extends LitElement {
13
13
  static styles: import("lit").CSSResult[];
14
- /** Fill color; the gradient's light (top) and dark (bottom) stops are derived from this. */
14
+ /** Fill color; the gradient's light (highlight) and dark (edge) stops are derived from this. */
15
15
  color: string;
16
16
  /** Diameter of the circular head, in CSS pixels. */
17
17
  size: number;
18
+ /** Outer ring opacity, 0-1 (default 1 = a solid Apple Maps-style white ring; lower for a translucent ring). */
19
+ ringOpacity: number;
18
20
  /** Scales and glows the pin — a generic emphasis state (e.g. hover, selection). */
19
21
  highlighted: boolean;
20
22
  private readonly _gradId;
@@ -1 +1 @@
1
- {"version":3,"file":"map-pin.d.ts","sourceRoot":"","sources":["../src/map-pin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAO5C;;;;;;;;;GASG;AACH,qBACa,MAAO,SAAQ,UAAU;IACpC,OAAgB,MAAM,4BA+CpB;IAEF,4FAA4F;IAChF,KAAK,SAAa;IAC9B,oDAAoD;IACxB,IAAI,SAAM;IACtC,mFAAmF;IACvC,WAAW,UAAS;IAEhE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyC;IAExD,MAAM,yCA8Bd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
1
+ {"version":3,"file":"map-pin.d.ts","sourceRoot":"","sources":["../src/map-pin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAO5C;;;;;;;;;GASG;AACH,qBACa,MAAO,SAAQ,UAAU;IACpC,OAAgB,MAAM,4BAgDpB;IAEF,gGAAgG;IACpF,KAAK,SAAa;IAC9B,oDAAoD;IACxB,IAAI,SAAM;IACtC,+GAA+G;IACxD,WAAW,SAAK;IACvE,mFAAmF;IACvC,WAAW,UAAS;IAEhE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAyC;IAExD,MAAM,yCA4Cd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
package/dist/map-pin.js CHANGED
@@ -10,10 +10,10 @@ import { tokens } from "./tokens.js";
10
10
  import { mixHex } from "./utils/color.js";
11
11
  let gradientIdCounter = 0;
12
12
  /**
13
- * A circular "Apple Maps"-style map pin: a light-to-dark gradient fill with
14
- * a slight point at the bottom. Purely a visual primitive — it has no
15
- * `mapbox-gl` (or any mapping library) dependency; the consumer positions
16
- * it, e.g. via `new mapboxgl.Marker({ element: pinEl })`.
13
+ * A circular "Apple Maps"-style map pin: a radial-gradient fill with a soft
14
+ * highlight and a slight point at the bottom. Purely a visual primitive —
15
+ * it has no `mapbox-gl` (or any mapping library) dependency; the consumer
16
+ * positions it, e.g. via `new mapboxgl.Marker({ element: pinEl })`.
17
17
  *
18
18
  * @element map-pin
19
19
  * @slot - Badge content shown centered on the pin's circular head — a rank
@@ -22,10 +22,12 @@ let gradientIdCounter = 0;
22
22
  let MapPin = class MapPin extends LitElement {
23
23
  constructor() {
24
24
  super(...arguments);
25
- /** Fill color; the gradient's light (top) and dark (bottom) stops are derived from this. */
25
+ /** Fill color; the gradient's light (highlight) and dark (edge) stops are derived from this. */
26
26
  this.color = "#4f46e5";
27
27
  /** Diameter of the circular head, in CSS pixels. */
28
28
  this.size = 32;
29
+ /** Outer ring opacity, 0-1 (default 1 = a solid Apple Maps-style white ring; lower for a translucent ring). */
30
+ this.ringOpacity = 1;
29
31
  /** Scales and glows the pin — a generic emphasis state (e.g. hover, selection). */
30
32
  this.highlighted = false;
31
33
  this._gradId = `map-pin-grad-${gradientIdCounter++}`;
@@ -40,6 +42,7 @@ let MapPin = class MapPin extends LitElement {
40
42
  }
41
43
  svg {
42
44
  display: block;
45
+ filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.25));
43
46
  transition: transform 120ms ease, filter 120ms ease;
44
47
  }
45
48
  :host([highlighted]) svg {
@@ -82,6 +85,13 @@ let MapPin = class MapPin extends LitElement {
82
85
  const light = mixHex(this.color, "#ffffff", 30);
83
86
  const dark = mixHex(this.color, "#000000", 30);
84
87
  const height = Math.round(this.size * (34 / 32));
88
+ const shape = "M16 30 C10 24 4 19.5 4 13 A12 12 0 1 1 28 13 C28 19.5 22 24 16 30 Z";
89
+ const ringWidth = 2;
90
+ // Inset the fill so its head edge meets the ring's inner edge instead of the
91
+ // ring straddling the fill (which reads as two rings): the head arc has
92
+ // radius 12, so scale the fill to (12 - ringWidth / 2) / 12 about the head
93
+ // center (16, 13). The ring is the same outline drawn behind, stroke only.
94
+ const fillScale = (12 - ringWidth / 2) / 12;
85
95
  return html `
86
96
  <svg
87
97
  aria-hidden="true"
@@ -92,16 +102,23 @@ let MapPin = class MapPin extends LitElement {
92
102
  xmlns="http://www.w3.org/2000/svg"
93
103
  >
94
104
  <defs>
95
- <linearGradient id=${this._gradId} x1="0" y1="0" x2="0" y2="1">
105
+ <radialGradient id=${this._gradId} gradientUnits="userSpaceOnUse" cx="12" cy="9" r="18">
96
106
  <stop offset="0%" stop-color=${light} />
97
107
  <stop offset="100%" stop-color=${dark} />
98
- </linearGradient>
108
+ </radialGradient>
99
109
  </defs>
100
110
  <path
101
- d="M16 30 C10 24 4 19.5 4 13 A12 12 0 1 1 28 13 C28 19.5 22 24 16 30 Z"
111
+ class="ring"
112
+ d=${shape}
113
+ fill="none"
114
+ stroke="rgb(255 255 255 / ${this.ringOpacity})"
115
+ stroke-width=${ringWidth}
116
+ />
117
+ <path
118
+ class="fill"
119
+ d=${shape}
102
120
  fill="url(#${this._gradId})"
103
- stroke="#ffffff"
104
- stroke-width="1.5"
121
+ transform="translate(16 13) scale(${fillScale}) translate(-16 -13)"
105
122
  />
106
123
  </svg>
107
124
  <div class="content" style="font-size:${Math.round(this.size * 0.4)}px">
@@ -116,6 +133,9 @@ __decorate([
116
133
  __decorate([
117
134
  property({ type: Number })
118
135
  ], MapPin.prototype, "size", void 0);
136
+ __decorate([
137
+ property({ type: Number, attribute: "ring-opacity" })
138
+ ], MapPin.prototype, "ringOpacity", void 0);
119
139
  __decorate([
120
140
  property({ type: Boolean, reflect: true })
121
141
  ], MapPin.prototype, "highlighted", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"map-pin.js","sourceRoot":"","sources":["../src/map-pin.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,IAAI,iBAAiB,GAAG,CAAC,CAAC;AAE1B;;;;;;;;;GASG;AAEI,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,UAAU;IAA/B;;QAkDL,4FAA4F;QAChF,UAAK,GAAG,SAAS,CAAC;QAC9B,oDAAoD;QACxB,SAAI,GAAG,EAAE,CAAC;QACtC,mFAAmF;QACvC,gBAAW,GAAG,KAAK,CAAC;QAE/C,YAAO,GAAG,gBAAgB,iBAAiB,EAAE,EAAE,CAAC;IAiCnE,CAAC;aAzFiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4CF;KACF,AA/CqB,CA+CpB;IAWO,MAAM;QACb,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;QAChD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;QAC/C,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;QACjD,OAAO,IAAI,CAAA;;;gBAGC,IAAI,CAAC,IAAI;iBACR,MAAM;;;;;;+BAMQ,IAAI,CAAC,OAAO;2CACA,KAAK;6CACH,IAAI;;;;;uBAK1B,IAAI,CAAC,OAAO;;;;;8CAKW,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;;;KAGpE,CAAC;IACJ,CAAC;CACF,CAAA;AAvCa;IAAX,QAAQ,EAAE;qCAAmB;AAEF;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oCAAW;AAEM;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAAqB;AAvDrD,MAAM;IADlB,aAAa,CAAC,SAAS,CAAC;GACZ,MAAM,CA0FlB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\nimport { mixHex } from \"./utils/color.js\";\n\nlet gradientIdCounter = 0;\n\n/**\n * A circular \"Apple Maps\"-style map pin: a light-to-dark gradient fill with\n * a slight point at the bottom. Purely a visual primitive it has no\n * `mapbox-gl` (or any mapping library) dependency; the consumer positions\n * it, e.g. via `new mapboxgl.Marker({ element: pinEl })`.\n *\n * @element map-pin\n * @slot - Badge content shown centered on the pin's circular head — a rank\n * number, an emoji, a small icon.\n */\n@customElement(\"map-pin\")\nexport class MapPin extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-block;\n position: relative;\n line-height: 0;\n }\n svg {\n display: block;\n transition: transform 120ms ease, filter 120ms ease;\n }\n :host([highlighted]) svg {\n transform: scale(1.12);\n filter: brightness(1.08) drop-shadow(0 0 5px rgb(0 0 0 / 0.35));\n }\n .content {\n position: absolute;\n /* The path's circular head is centered at viewBox y=13 of 34 total\n (13/34 ≈ 38%) — not the pin's full bounding box, which is pulled\n down by the point below the circle. */\n top: 38%;\n left: 50%;\n transform: translate(-50%, -50%);\n color: #fff;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-weight: var(--ui-font-weight-bold, 700);\n line-height: var(--ui-line-height-glyph, 1);\n text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);\n pointer-events: none;\n white-space: nowrap;\n }\n @media (prefers-reduced-motion: reduce) {\n svg {\n transition: none;\n }\n }\n `,\n ];\n\n /** Fill color; the gradient's light (top) and dark (bottom) stops are derived from this. */\n @property() color = \"#4f46e5\";\n /** Diameter of the circular head, in CSS pixels. */\n @property({ type: Number }) size = 32;\n /** Scales and glows the pin — a generic emphasis state (e.g. hover, selection). */\n @property({ type: Boolean, reflect: true }) highlighted = false;\n\n private readonly _gradId = `map-pin-grad-${gradientIdCounter++}`;\n\n override render() {\n const light = mixHex(this.color, \"#ffffff\", 30);\n const dark = mixHex(this.color, \"#000000\", 30);\n const height = Math.round(this.size * (34 / 32));\n return html`\n <svg\n aria-hidden=\"true\"\n width=${this.size}\n height=${height}\n viewBox=\"0 0 32 34\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <linearGradient id=${this._gradId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stop-color=${light} />\n <stop offset=\"100%\" stop-color=${dark} />\n </linearGradient>\n </defs>\n <path\n d=\"M16 30 C10 24 4 19.5 4 13 A12 12 0 1 1 28 13 C28 19.5 22 24 16 30 Z\"\n fill=\"url(#${this._gradId})\"\n stroke=\"#ffffff\"\n stroke-width=\"1.5\"\n />\n </svg>\n <div class=\"content\" style=\"font-size:${Math.round(this.size * 0.4)}px\">\n <slot></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"map-pin\": MapPin;\n }\n}\n"]}
1
+ {"version":3,"file":"map-pin.js","sourceRoot":"","sources":["../src/map-pin.ts"],"names":[],"mappings":";;;;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,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QAC5C,OAAO,IAAI,CAAA;;;gBAGC,IAAI,CAAC,IAAI;iBACR,MAAM;;;;;;+BAMQ,IAAI,CAAC,OAAO;2CACA,KAAK;6CACH,IAAI;;;;;cAKnC,KAAK;;sCAEmB,IAAI,CAAC,WAAW;yBAC7B,SAAS;;;;cAIpB,KAAK;uBACI,IAAI,CAAC,OAAO;8CACW,SAAS;;;8CAGT,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;;;KAGpE,CAAC;IACJ,CAAC;CACF,CAAA;AAvDa;IAAX,QAAQ,EAAE;qCAAmB;AAEF;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oCAAW;AAEiB;IAAtD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;2CAAiB;AAE3B;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAAqB;AA1DrD,MAAM;IADlB,aAAa,CAAC,SAAS,CAAC;GACZ,MAAM,CA2GlB","sourcesContent":["import { LitElement, css, html } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { tokens } from \"./tokens.js\";\nimport { mixHex } from \"./utils/color.js\";\n\nlet gradientIdCounter = 0;\n\n/**\n * A circular \"Apple Maps\"-style map pin: a radial-gradient fill with a soft\n * highlight and a slight point at the bottom. Purely a visual primitive —\n * it has no `mapbox-gl` (or any mapping library) dependency; the consumer\n * positions it, e.g. via `new mapboxgl.Marker({ element: pinEl })`.\n *\n * @element map-pin\n * @slot - Badge content shown centered on the pin's circular head — a rank\n * number, an emoji, a small icon.\n */\n@customElement(\"map-pin\")\nexport class MapPin extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-block;\n position: relative;\n line-height: 0;\n }\n svg {\n display: block;\n filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.25));\n transition: transform 120ms ease, filter 120ms ease;\n }\n :host([highlighted]) svg {\n transform: scale(1.12);\n filter: brightness(1.08) drop-shadow(0 0 5px rgb(0 0 0 / 0.35));\n }\n .content {\n position: absolute;\n /* The path's circular head is centered at viewBox y=13 of 34 total\n (13/34 ≈ 38%) — not the pin's full bounding box, which is pulled\n down by the point below the circle. */\n top: 38%;\n left: 50%;\n transform: translate(-50%, -50%);\n color: #fff;\n font-family: var(\n --ui-font,\n ui-sans-serif,\n system-ui,\n sans-serif,\n \"Apple Color Emoji\",\n \"Segoe UI Emoji\",\n \"Segoe UI Symbol\",\n \"Noto Color Emoji\"\n );\n font-weight: var(--ui-font-weight-bold, 700);\n line-height: var(--ui-line-height-glyph, 1);\n text-shadow: 0 1px 2px rgb(0 0 0 / 0.35);\n pointer-events: none;\n white-space: nowrap;\n }\n @media (prefers-reduced-motion: reduce) {\n svg {\n transition: none;\n }\n }\n `,\n ];\n\n /** Fill color; the gradient's light (highlight) and dark (edge) stops are derived from this. */\n @property() color = \"#4f46e5\";\n /** Diameter of the circular head, in CSS pixels. */\n @property({ type: Number }) size = 32;\n /** Outer ring opacity, 0-1 (default 1 = a solid Apple Maps-style white ring; lower for a translucent ring). */\n @property({ type: Number, attribute: \"ring-opacity\" }) ringOpacity = 1;\n /** Scales and glows the pin — a generic emphasis state (e.g. hover, selection). */\n @property({ type: Boolean, reflect: true }) highlighted = false;\n\n private readonly _gradId = `map-pin-grad-${gradientIdCounter++}`;\n\n override render() {\n const light = mixHex(this.color, \"#ffffff\", 30);\n const dark = mixHex(this.color, \"#000000\", 30);\n const height = Math.round(this.size * (34 / 32));\n const shape = \"M16 30 C10 24 4 19.5 4 13 A12 12 0 1 1 28 13 C28 19.5 22 24 16 30 Z\";\n const ringWidth = 2;\n // Inset the fill so its head edge meets the ring's inner edge instead of the\n // ring straddling the fill (which reads as two rings): the head arc has\n // radius 12, so scale the fill to (12 - ringWidth / 2) / 12 about the head\n // center (16, 13). The ring is the same outline drawn behind, stroke only.\n const fillScale = (12 - ringWidth / 2) / 12;\n return html`\n <svg\n aria-hidden=\"true\"\n width=${this.size}\n height=${height}\n viewBox=\"0 0 32 34\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <defs>\n <radialGradient id=${this._gradId} gradientUnits=\"userSpaceOnUse\" cx=\"12\" cy=\"9\" r=\"18\">\n <stop offset=\"0%\" stop-color=${light} />\n <stop offset=\"100%\" stop-color=${dark} />\n </radialGradient>\n </defs>\n <path\n class=\"ring\"\n d=${shape}\n fill=\"none\"\n stroke=\"rgb(255 255 255 / ${this.ringOpacity})\"\n stroke-width=${ringWidth}\n />\n <path\n class=\"fill\"\n d=${shape}\n fill=\"url(#${this._gradId})\"\n transform=\"translate(16 13) scale(${fillScale}) translate(-16 -13)\"\n />\n </svg>\n <div class=\"content\" style=\"font-size:${Math.round(this.size * 0.4)}px\">\n <slot></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"map-pin\": MapPin;\n }\n}\n"]}
@@ -1,13 +1,14 @@
1
1
  # `<map-circle>`
2
2
 
3
- A plain circular map marker: a light-to-dark gradient fill with a white
4
- outer ring, no point/tail (unlike `<map-pin>`) — for markers that don't
5
- need to visually "point" at their exact coordinate. Purely a visual
6
- primitive — it has no `mapbox-gl` (or any mapping library) dependency;
7
- the consumer positions it, e.g. via `new mapboxgl.Marker({ element: el })`.
8
- It can also replace the former `<map-point>` dense-layer primitive: use
9
- `size="14" ring-width="3"`, leave the slot empty, and rasterize one marker
10
- per color for use as a map `icon-image`.
3
+ A plain circular map marker: a radial-gradient fill with a soft highlight
4
+ and a solid white outer ring, no point/tail (unlike `<map-pin>`) —
5
+ for markers that don't need to visually "point" at their exact
6
+ coordinate. Purely a visual primitive — it has no `mapbox-gl` (or any
7
+ mapping library) dependency; the consumer positions it, e.g. via
8
+ `new mapboxgl.Marker({ element: el })`. It can also replace the former
9
+ `<map-point>` dense-layer primitive: use `size="14" ring-width="3"`, leave
10
+ the slot empty, and rasterize one marker per color for use as a map
11
+ `icon-image`.
11
12
 
12
13
  ## Install
13
14
 
@@ -27,9 +28,10 @@ import "@f-ewald/components/map-circle.js";
27
28
 
28
29
  | Property | Attribute | Type | Default | Description |
29
30
  | --- | --- | --- | --- | --- |
30
- | `color` | `color` | `string` | `"#4f46e5"` | Fill color; the gradient's light (top) and dark (bottom) stops are derived from this. |
31
+ | `color` | `color` | `string` | `"#4f46e5"` | Fill color; the gradient's light (highlight) and dark (edge) stops are derived from this. |
31
32
  | `size` | `size` | `number` | `18` | Diameter, in CSS pixels. |
32
- | `ringWidth` | `ring-width` | `number` | `4` | White outer ring thickness, in the same viewBox units as `size` (scales with it). |
33
+ | `ringWidth` | `ring-width` | `number` | `2` | White outer ring thickness, in the same viewBox units as `size` (scales with it). |
34
+ | `ringOpacity` | `ring-opacity` | `number` | `1` | Outer ring opacity, 0-1 (default 1 = a solid Apple Maps-style white ring; lower for a translucent ring). |
33
35
  | `highlighted` | `highlighted` | `boolean` | `false` | Scales and glows the circle — a generic emphasis state (e.g. hover, selection). |
34
36
 
35
37
  ## Events
package/docs/map-pin.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # `<map-pin>`
2
2
 
3
- A circular "Apple Maps"-style map pin: a light-to-dark gradient fill with
4
- a slight point at the bottom. Purely a visual primitive — it has no
5
- `mapbox-gl` (or any mapping library) dependency; the consumer positions
6
- it, e.g. via `new mapboxgl.Marker({ element: pinEl })`.
3
+ A circular "Apple Maps"-style map pin: a radial-gradient fill with a soft
4
+ highlight and a slight point at the bottom. Purely a visual primitive —
5
+ it has no `mapbox-gl` (or any mapping library) dependency; the consumer
6
+ positions it, e.g. via `new mapboxgl.Marker({ element: pinEl })`.
7
7
 
8
8
  ## Install
9
9
 
@@ -22,8 +22,9 @@ import "@f-ewald/components/map-pin.js";
22
22
 
23
23
  | Property | Attribute | Type | Default | Description |
24
24
  | --- | --- | --- | --- | --- |
25
- | `color` | `color` | `string` | `"#4f46e5"` | Fill color; the gradient's light (top) and dark (bottom) stops are derived from this. |
25
+ | `color` | `color` | `string` | `"#4f46e5"` | Fill color; the gradient's light (highlight) and dark (edge) stops are derived from this. |
26
26
  | `size` | `size` | `number` | `32` | Diameter of the circular head, in CSS pixels. |
27
+ | `ringOpacity` | `ring-opacity` | `number` | `1` | Outer ring opacity, 0-1 (default 1 = a solid Apple Maps-style white ring; lower for a translucent ring). |
27
28
  | `highlighted` | `highlighted` | `boolean` | `false` | Scales and glows the pin — a generic emphasis state (e.g. hover, selection). |
28
29
 
29
30
  ## Events
package/llms.txt CHANGED
@@ -994,18 +994,19 @@ Example:
994
994
 
995
995
  ## <map-circle>
996
996
 
997
- A plain circular map marker: a light-to-dark gradient fill with a white
998
- outer ring, no point/tail (unlike `<map-pin>`) — for markers that don't
999
- need to visually "point" at their exact coordinate. Purely a visual
1000
- primitive — it has no `mapbox-gl` (or any mapping library) dependency;
1001
- the consumer positions it, e.g. via `new mapboxgl.Marker({ element: el })`.
1002
- It can also replace the former `<map-point>` dense-layer primitive: use
1003
- `size="14" ring-width="3"`, leave the slot empty, and rasterize one marker
1004
- per color for use as a map `icon-image`.
997
+ A plain circular map marker: a radial-gradient fill with a soft highlight
998
+ and a solid white outer ring, no point/tail (unlike `<map-pin>`) —
999
+ for markers that don't need to visually "point" at their exact
1000
+ coordinate. Purely a visual primitive — it has no `mapbox-gl` (or any
1001
+ mapping library) dependency; the consumer positions it, e.g. via
1002
+ `new mapboxgl.Marker({ element: el })`. It can also replace the former
1003
+ `<map-point>` dense-layer primitive: use `size="14" ring-width="3"`, leave
1004
+ the slot empty, and rasterize one marker per color for use as a map
1005
+ `icon-image`.
1005
1006
 
1006
1007
  Import: `import "@f-ewald/components/map-circle.js";`
1007
1008
 
1008
- Properties: `color` (attribute `color`) : string, default "#4f46e5"; `size` (attribute `size`) : number, default 18; `ringWidth` (attribute `ring-width`) : number, default 4; `highlighted` (attribute `highlighted`) : boolean, default false
1009
+ Properties: `color` (attribute `color`) : string, default "#4f46e5"; `size` (attribute `size`) : number, default 18; `ringWidth` (attribute `ring-width`) : number, default 2; `ringOpacity` (attribute `ring-opacity`) : number, default 1; `highlighted` (attribute `highlighted`) : boolean, default false
1009
1010
  Events: none
1010
1011
  CSS custom properties: `--ui-font`, `--ui-font-weight-bold`, `--ui-line-height-glyph`
1011
1012
 
@@ -1018,14 +1019,14 @@ Example:
1018
1019
 
1019
1020
  ## <map-pin>
1020
1021
 
1021
- A circular "Apple Maps"-style map pin: a light-to-dark gradient fill with
1022
- a slight point at the bottom. Purely a visual primitive — it has no
1023
- `mapbox-gl` (or any mapping library) dependency; the consumer positions
1024
- it, e.g. via `new mapboxgl.Marker({ element: pinEl })`.
1022
+ A circular "Apple Maps"-style map pin: a radial-gradient fill with a soft
1023
+ highlight and a slight point at the bottom. Purely a visual primitive —
1024
+ it has no `mapbox-gl` (or any mapping library) dependency; the consumer
1025
+ positions it, e.g. via `new mapboxgl.Marker({ element: pinEl })`.
1025
1026
 
1026
1027
  Import: `import "@f-ewald/components/map-pin.js";`
1027
1028
 
1028
- Properties: `color` (attribute `color`) : string, default "#4f46e5"; `size` (attribute `size`) : number, default 32; `highlighted` (attribute `highlighted`) : boolean, default false
1029
+ Properties: `color` (attribute `color`) : string, default "#4f46e5"; `size` (attribute `size`) : number, default 32; `ringOpacity` (attribute `ring-opacity`) : number, default 1; `highlighted` (attribute `highlighted`) : boolean, default false
1029
1030
  Events: none
1030
1031
  CSS custom properties: `--ui-font`, `--ui-font-weight-bold`, `--ui-line-height-glyph`
1031
1032
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@f-ewald/components",
3
3
  "private": false,
4
- "version": "1.13.0",
4
+ "version": "1.14.1",
5
5
  "description": "A collection of universally usable web components for various tasks.",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",