@f-ewald/components 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +111 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/map-point.d.ts +31 -0
- package/dist/map-point.d.ts.map +1 -0
- package/dist/map-point.js +83 -0
- package/dist/map-point.js.map +1 -0
- package/docs/map-point.md +43 -0
- package/llms.txt +23 -0
- package/package.json +1 -1
package/custom-elements.json
CHANGED
|
@@ -2504,6 +2504,14 @@
|
|
|
2504
2504
|
"module": "./map-circle.js"
|
|
2505
2505
|
}
|
|
2506
2506
|
},
|
|
2507
|
+
{
|
|
2508
|
+
"kind": "js",
|
|
2509
|
+
"name": "MapPoint",
|
|
2510
|
+
"declaration": {
|
|
2511
|
+
"name": "MapPoint",
|
|
2512
|
+
"module": "./map-point.js"
|
|
2513
|
+
}
|
|
2514
|
+
},
|
|
2507
2515
|
{
|
|
2508
2516
|
"kind": "js",
|
|
2509
2517
|
"name": "RadioCards",
|
|
@@ -2817,6 +2825,109 @@
|
|
|
2817
2825
|
}
|
|
2818
2826
|
]
|
|
2819
2827
|
},
|
|
2828
|
+
{
|
|
2829
|
+
"kind": "javascript-module",
|
|
2830
|
+
"path": "src/map-point.ts",
|
|
2831
|
+
"declarations": [
|
|
2832
|
+
{
|
|
2833
|
+
"kind": "class",
|
|
2834
|
+
"description": "A small plain-colored map marker for dense point layers (transit stops,\namenities, hazard points, etc.): a light-to-dark gradient fill with a thin\nwhite ring, no badge/content slot — every instance on a given layer shares\nthe same look, so there's nothing to render per-feature (unlike\n`<map-pin>`/`<map-circle>`, which carry per-marker slotted content).\nPurely a visual primitive — it has no `mapbox-gl` (or any mapping library)\ndependency; typically rasterized once per color and used as a Mapbox\n`icon-image` on a `symbol` layer rather than mounted as individual DOM\nmarkers, so a whole layer's worth of points shares one icon image.",
|
|
2835
|
+
"name": "MapPoint",
|
|
2836
|
+
"members": [
|
|
2837
|
+
{
|
|
2838
|
+
"kind": "field",
|
|
2839
|
+
"name": "color",
|
|
2840
|
+
"type": {
|
|
2841
|
+
"text": "string"
|
|
2842
|
+
},
|
|
2843
|
+
"default": "\"#4f46e5\"",
|
|
2844
|
+
"description": "Fill color; the gradient's light (top) and dark (bottom) stops are derived from this.",
|
|
2845
|
+
"attribute": "color"
|
|
2846
|
+
},
|
|
2847
|
+
{
|
|
2848
|
+
"kind": "field",
|
|
2849
|
+
"name": "size",
|
|
2850
|
+
"type": {
|
|
2851
|
+
"text": "number"
|
|
2852
|
+
},
|
|
2853
|
+
"default": "14",
|
|
2854
|
+
"description": "Diameter, in CSS pixels.",
|
|
2855
|
+
"attribute": "size"
|
|
2856
|
+
},
|
|
2857
|
+
{
|
|
2858
|
+
"kind": "field",
|
|
2859
|
+
"name": "ringWidth",
|
|
2860
|
+
"type": {
|
|
2861
|
+
"text": "number"
|
|
2862
|
+
},
|
|
2863
|
+
"default": "3",
|
|
2864
|
+
"description": "White outer ring thickness, in the same viewBox units as `size` (scales with it).",
|
|
2865
|
+
"attribute": "ring-width"
|
|
2866
|
+
},
|
|
2867
|
+
{
|
|
2868
|
+
"kind": "field",
|
|
2869
|
+
"name": "_gradId",
|
|
2870
|
+
"privacy": "private",
|
|
2871
|
+
"readonly": true,
|
|
2872
|
+
"default": "`map-point-grad-${gradientIdCounter++}`"
|
|
2873
|
+
}
|
|
2874
|
+
],
|
|
2875
|
+
"attributes": [
|
|
2876
|
+
{
|
|
2877
|
+
"name": "color",
|
|
2878
|
+
"type": {
|
|
2879
|
+
"text": "string"
|
|
2880
|
+
},
|
|
2881
|
+
"default": "\"#4f46e5\"",
|
|
2882
|
+
"description": "Fill color; the gradient's light (top) and dark (bottom) stops are derived from this.",
|
|
2883
|
+
"fieldName": "color"
|
|
2884
|
+
},
|
|
2885
|
+
{
|
|
2886
|
+
"name": "size",
|
|
2887
|
+
"type": {
|
|
2888
|
+
"text": "number"
|
|
2889
|
+
},
|
|
2890
|
+
"default": "14",
|
|
2891
|
+
"description": "Diameter, in CSS pixels.",
|
|
2892
|
+
"fieldName": "size"
|
|
2893
|
+
},
|
|
2894
|
+
{
|
|
2895
|
+
"name": "ring-width",
|
|
2896
|
+
"type": {
|
|
2897
|
+
"text": "number"
|
|
2898
|
+
},
|
|
2899
|
+
"default": "3",
|
|
2900
|
+
"description": "White outer ring thickness, in the same viewBox units as `size` (scales with it).",
|
|
2901
|
+
"fieldName": "ringWidth"
|
|
2902
|
+
}
|
|
2903
|
+
],
|
|
2904
|
+
"superclass": {
|
|
2905
|
+
"name": "LitElement",
|
|
2906
|
+
"package": "lit"
|
|
2907
|
+
},
|
|
2908
|
+
"tagName": "map-point",
|
|
2909
|
+
"customElement": true
|
|
2910
|
+
}
|
|
2911
|
+
],
|
|
2912
|
+
"exports": [
|
|
2913
|
+
{
|
|
2914
|
+
"kind": "js",
|
|
2915
|
+
"name": "MapPoint",
|
|
2916
|
+
"declaration": {
|
|
2917
|
+
"name": "MapPoint",
|
|
2918
|
+
"module": "src/map-point.ts"
|
|
2919
|
+
}
|
|
2920
|
+
},
|
|
2921
|
+
{
|
|
2922
|
+
"kind": "custom-element-definition",
|
|
2923
|
+
"name": "map-point",
|
|
2924
|
+
"declaration": {
|
|
2925
|
+
"name": "MapPoint",
|
|
2926
|
+
"module": "src/map-point.ts"
|
|
2927
|
+
}
|
|
2928
|
+
}
|
|
2929
|
+
]
|
|
2930
|
+
},
|
|
2820
2931
|
{
|
|
2821
2932
|
"kind": "javascript-module",
|
|
2822
2933
|
"path": "src/percent-bar-chart.ts",
|
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export { AutocompleteInput, type AutocompleteOption, } from "./autocomplete-inpu
|
|
|
16
16
|
export { UserAvatar } from "./user-avatar.js";
|
|
17
17
|
export { MapPin } from "./map-pin.js";
|
|
18
18
|
export { MapCircle } from "./map-circle.js";
|
|
19
|
+
export { MapPoint } from "./map-point.js";
|
|
19
20
|
export { RadioCards, type RadioCardOption } from "./radio-cards.js";
|
|
20
21
|
export { RadioPills, type RadioPillOption } from "./radio-pills.js";
|
|
21
22
|
export { UiButton, type ButtonVariant } from "./ui-button.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,UAAU,EACV,KAAK,YAAY,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EACL,mBAAmB,EACnB,KAAK,iBAAiB,GACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,KAAK,kBAAkB,GACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAClD,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,UAAU,EACV,KAAK,YAAY,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EACL,mBAAmB,EACnB,KAAK,iBAAiB,GACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iBAAiB,EACjB,KAAK,kBAAkB,GACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAClD,cAAc,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export { AutocompleteInput, } from "./autocomplete-input.js";
|
|
|
16
16
|
export { UserAvatar } from "./user-avatar.js";
|
|
17
17
|
export { MapPin } from "./map-pin.js";
|
|
18
18
|
export { MapCircle } from "./map-circle.js";
|
|
19
|
+
export { MapPoint } from "./map-point.js";
|
|
19
20
|
export { RadioCards } from "./radio-cards.js";
|
|
20
21
|
export { RadioPills } from "./radio-pills.js";
|
|
21
22
|
export { UiButton } from "./ui-button.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,UAAU,GAEX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAmB,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAA0B,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAwB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAsB,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EACL,mBAAmB,GAEpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iBAAiB,GAElB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAsB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAClD,cAAc,YAAY,CAAC","sourcesContent":["export { AnimateConfetti } from \"./animate-confetti.js\";\nexport { RevealButton } from \"./reveal-button.js\";\nexport { RomanNumeral } from \"./roman-numeral.js\";\nexport { ConfirmDialog } from \"./confirm-dialog.js\";\nexport {\n ToastNotification,\n notifySuccess,\n notifyError,\n notifyInfo,\n type ToastVariant,\n} from \"./toast-notification.js\";\nexport { SlidePanel } from \"./slide-panel.js\";\nexport { CopyLinkButton } from \"./copy-link-button.js\";\nexport { RelativeTime } from \"./relative-time.js\";\nexport { DistanceValue } from \"./distance-value.js\";\nexport { PriceHistoryChart, type PricePoint } from \"./price-history-chart.js\";\nexport { DistributionChart, type DistributionValue } from \"./distribution-chart.js\";\nexport { PercentBarChart, type PercentBarGroup } from \"./percent-bar-chart.js\";\nexport { WeightBarChart, type WeightBarItem } from \"./weight-bar-chart.js\";\nexport {\n AddressAutocomplete,\n type AddressSuggestion,\n} from \"./address-autocomplete.js\";\nexport {\n AutocompleteInput,\n type AutocompleteOption,\n} from \"./autocomplete-input.js\";\nexport { UserAvatar } from \"./user-avatar.js\";\nexport { MapPin } from \"./map-pin.js\";\nexport { MapCircle } from \"./map-circle.js\";\nexport { RadioCards, type RadioCardOption } from \"./radio-cards.js\";\nexport { RadioPills, type RadioPillOption } from \"./radio-pills.js\";\nexport { UiButton, type ButtonVariant } from \"./ui-button.js\";\nexport { tokens, tokenValues } from \"./tokens.js\";\nexport * from \"./icons.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,UAAU,GAEX,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAmB,MAAM,0BAA0B,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAA0B,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAwB,MAAM,wBAAwB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAsB,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EACL,mBAAmB,GAEpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,iBAAiB,GAElB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAwB,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAsB,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAClD,cAAc,YAAY,CAAC","sourcesContent":["export { AnimateConfetti } from \"./animate-confetti.js\";\nexport { RevealButton } from \"./reveal-button.js\";\nexport { RomanNumeral } from \"./roman-numeral.js\";\nexport { ConfirmDialog } from \"./confirm-dialog.js\";\nexport {\n ToastNotification,\n notifySuccess,\n notifyError,\n notifyInfo,\n type ToastVariant,\n} from \"./toast-notification.js\";\nexport { SlidePanel } from \"./slide-panel.js\";\nexport { CopyLinkButton } from \"./copy-link-button.js\";\nexport { RelativeTime } from \"./relative-time.js\";\nexport { DistanceValue } from \"./distance-value.js\";\nexport { PriceHistoryChart, type PricePoint } from \"./price-history-chart.js\";\nexport { DistributionChart, type DistributionValue } from \"./distribution-chart.js\";\nexport { PercentBarChart, type PercentBarGroup } from \"./percent-bar-chart.js\";\nexport { WeightBarChart, type WeightBarItem } from \"./weight-bar-chart.js\";\nexport {\n AddressAutocomplete,\n type AddressSuggestion,\n} from \"./address-autocomplete.js\";\nexport {\n AutocompleteInput,\n type AutocompleteOption,\n} from \"./autocomplete-input.js\";\nexport { UserAvatar } from \"./user-avatar.js\";\nexport { MapPin } from \"./map-pin.js\";\nexport { MapCircle } from \"./map-circle.js\";\nexport { MapPoint } from \"./map-point.js\";\nexport { RadioCards, type RadioCardOption } from \"./radio-cards.js\";\nexport { RadioPills, type RadioPillOption } from \"./radio-pills.js\";\nexport { UiButton, type ButtonVariant } from \"./ui-button.js\";\nexport { tokens, tokenValues } from \"./tokens.js\";\nexport * from \"./icons.js\";\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { LitElement } from "lit";
|
|
2
|
+
/**
|
|
3
|
+
* A small plain-colored map marker for dense point layers (transit stops,
|
|
4
|
+
* amenities, hazard points, etc.): a light-to-dark gradient fill with a thin
|
|
5
|
+
* white ring, no badge/content slot — every instance on a given layer shares
|
|
6
|
+
* the same look, so there's nothing to render per-feature (unlike
|
|
7
|
+
* `<map-pin>`/`<map-circle>`, which carry per-marker slotted content).
|
|
8
|
+
* Purely a visual primitive — it has no `mapbox-gl` (or any mapping library)
|
|
9
|
+
* dependency; typically rasterized once per color and used as a Mapbox
|
|
10
|
+
* `icon-image` on a `symbol` layer rather than mounted as individual DOM
|
|
11
|
+
* markers, so a whole layer's worth of points shares one icon image.
|
|
12
|
+
*
|
|
13
|
+
* @element map-point
|
|
14
|
+
*/
|
|
15
|
+
export declare class MapPoint extends LitElement {
|
|
16
|
+
static styles: import("lit").CSSResult[];
|
|
17
|
+
/** Fill color; the gradient's light (top) and dark (bottom) stops are derived from this. */
|
|
18
|
+
color: string;
|
|
19
|
+
/** Diameter, in CSS pixels. */
|
|
20
|
+
size: number;
|
|
21
|
+
/** White outer ring thickness, in the same viewBox units as `size` (scales with it). */
|
|
22
|
+
ringWidth: number;
|
|
23
|
+
private readonly _gradId;
|
|
24
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
25
|
+
}
|
|
26
|
+
declare global {
|
|
27
|
+
interface HTMLElementTagNameMap {
|
|
28
|
+
"map-point": MapPoint;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=map-point.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-point.d.ts","sourceRoot":"","sources":["../src/map-point.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAO5C;;;;;;;;;;;;GAYG;AACH,qBACa,QAAS,SAAQ,UAAU;IACtC,OAAgB,MAAM,4BAWpB;IAEF,4FAA4F;IAChF,KAAK,SAAa;IAC9B,+BAA+B;IACH,IAAI,SAAM;IACtC,wFAAwF;IACnC,SAAS,SAAK;IAEnE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA2C;IAE1D,MAAM,yCAoBd;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, css, html } from "lit";
|
|
8
|
+
import { customElement, property } from "lit/decorators.js";
|
|
9
|
+
import { tokens } from "./tokens.js";
|
|
10
|
+
import { mixHex } from "./utils/color.js";
|
|
11
|
+
let gradientIdCounter = 0;
|
|
12
|
+
/**
|
|
13
|
+
* A small plain-colored map marker for dense point layers (transit stops,
|
|
14
|
+
* amenities, hazard points, etc.): a light-to-dark gradient fill with a thin
|
|
15
|
+
* white ring, no badge/content slot — every instance on a given layer shares
|
|
16
|
+
* the same look, so there's nothing to render per-feature (unlike
|
|
17
|
+
* `<map-pin>`/`<map-circle>`, which carry per-marker slotted content).
|
|
18
|
+
* Purely a visual primitive — it has no `mapbox-gl` (or any mapping library)
|
|
19
|
+
* dependency; typically rasterized once per color and used as a Mapbox
|
|
20
|
+
* `icon-image` on a `symbol` layer rather than mounted as individual DOM
|
|
21
|
+
* markers, so a whole layer's worth of points shares one icon image.
|
|
22
|
+
*
|
|
23
|
+
* @element map-point
|
|
24
|
+
*/
|
|
25
|
+
let MapPoint = class MapPoint extends LitElement {
|
|
26
|
+
constructor() {
|
|
27
|
+
super(...arguments);
|
|
28
|
+
/** Fill color; the gradient's light (top) and dark (bottom) stops are derived from this. */
|
|
29
|
+
this.color = "#4f46e5";
|
|
30
|
+
/** Diameter, in CSS pixels. */
|
|
31
|
+
this.size = 14;
|
|
32
|
+
/** White outer ring thickness, in the same viewBox units as `size` (scales with it). */
|
|
33
|
+
this.ringWidth = 3;
|
|
34
|
+
this._gradId = `map-point-grad-${gradientIdCounter++}`;
|
|
35
|
+
}
|
|
36
|
+
static { this.styles = [
|
|
37
|
+
tokens,
|
|
38
|
+
css `
|
|
39
|
+
:host {
|
|
40
|
+
display: inline-block;
|
|
41
|
+
line-height: 0;
|
|
42
|
+
}
|
|
43
|
+
svg {
|
|
44
|
+
display: block;
|
|
45
|
+
}
|
|
46
|
+
`,
|
|
47
|
+
]; }
|
|
48
|
+
render() {
|
|
49
|
+
const light = mixHex(this.color, "#ffffff", 30);
|
|
50
|
+
const dark = mixHex(this.color, "#000000", 30);
|
|
51
|
+
return html `
|
|
52
|
+
<svg
|
|
53
|
+
width=${this.size}
|
|
54
|
+
height=${this.size}
|
|
55
|
+
viewBox="0 0 32 32"
|
|
56
|
+
fill="none"
|
|
57
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
58
|
+
>
|
|
59
|
+
<defs>
|
|
60
|
+
<linearGradient id=${this._gradId} x1="0" y1="0" x2="0" y2="1">
|
|
61
|
+
<stop offset="0%" stop-color=${light} />
|
|
62
|
+
<stop offset="100%" stop-color=${dark} />
|
|
63
|
+
</linearGradient>
|
|
64
|
+
</defs>
|
|
65
|
+
<circle cx="16" cy="16" r="13" fill="url(#${this._gradId})" stroke="#ffffff" stroke-width=${this.ringWidth} />
|
|
66
|
+
</svg>
|
|
67
|
+
`;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
__decorate([
|
|
71
|
+
property()
|
|
72
|
+
], MapPoint.prototype, "color", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
property({ type: Number })
|
|
75
|
+
], MapPoint.prototype, "size", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
property({ type: Number, attribute: "ring-width" })
|
|
78
|
+
], MapPoint.prototype, "ringWidth", void 0);
|
|
79
|
+
MapPoint = __decorate([
|
|
80
|
+
customElement("map-point")
|
|
81
|
+
], MapPoint);
|
|
82
|
+
export { MapPoint };
|
|
83
|
+
//# sourceMappingURL=map-point.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-point.js","sourceRoot":"","sources":["../src/map-point.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;;;;;;;;;;;;GAYG;AAEI,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAAjC;;QAcL,4FAA4F;QAChF,UAAK,GAAG,SAAS,CAAC;QAC9B,+BAA+B;QACH,SAAI,GAAG,EAAE,CAAC;QACtC,wFAAwF;QACnC,cAAS,GAAG,CAAC,CAAC;QAElD,YAAO,GAAG,kBAAkB,iBAAiB,EAAE,EAAE,CAAC;IAuBrE,CAAC;aA3CiB,WAAM,GAAG;QACvB,MAAM;QACN,GAAG,CAAA;;;;;;;;KAQF;KACF,AAXqB,CAWpB;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,OAAO,IAAI,CAAA;;gBAEC,IAAI,CAAC,IAAI;iBACR,IAAI,CAAC,IAAI;;;;;;+BAMK,IAAI,CAAC,OAAO;2CACA,KAAK;6CACH,IAAI;;;oDAGG,IAAI,CAAC,OAAO,oCAAoC,IAAI,CAAC,SAAS;;KAE7G,CAAC;IACJ,CAAC;CACF,CAAA;AA7Ba;IAAX,QAAQ,EAAE;uCAAmB;AAEF;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sCAAW;AAEe;IAApD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;2CAAe;AAnBxD,QAAQ;IADpB,aAAa,CAAC,WAAW,CAAC;GACd,QAAQ,CA4CpB","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 small plain-colored map marker for dense point layers (transit stops,\n * amenities, hazard points, etc.): a light-to-dark gradient fill with a thin\n * white ring, no badge/content slot — every instance on a given layer shares\n * the same look, so there's nothing to render per-feature (unlike\n * `<map-pin>`/`<map-circle>`, which carry per-marker slotted content).\n * Purely a visual primitive — it has no `mapbox-gl` (or any mapping library)\n * dependency; typically rasterized once per color and used as a Mapbox\n * `icon-image` on a `symbol` layer rather than mounted as individual DOM\n * markers, so a whole layer's worth of points shares one icon image.\n *\n * @element map-point\n */\n@customElement(\"map-point\")\nexport class MapPoint extends LitElement {\n static override styles = [\n tokens,\n css`\n :host {\n display: inline-block;\n line-height: 0;\n }\n svg {\n display: block;\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 = 14;\n /** White outer ring thickness, in the same viewBox units as `size` (scales with it). */\n @property({ type: Number, attribute: \"ring-width\" }) ringWidth = 3;\n\n private readonly _gradId = `map-point-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 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 `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"map-point\": MapPoint;\n }\n}\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# `<map-point>`
|
|
2
|
+
|
|
3
|
+
A small plain-colored map marker for dense point layers (transit stops,
|
|
4
|
+
amenities, hazard points, etc.): a light-to-dark gradient fill with a thin
|
|
5
|
+
white ring, no badge/content slot — every instance on a given layer shares
|
|
6
|
+
the same look, so there's nothing to render per-feature (unlike
|
|
7
|
+
`<map-pin>`/`<map-circle>`, which carry per-marker slotted content).
|
|
8
|
+
Purely a visual primitive — it has no `mapbox-gl` (or any mapping library)
|
|
9
|
+
dependency; typically rasterized once per color and used as a Mapbox
|
|
10
|
+
`icon-image` on a `symbol` layer rather than mounted as individual DOM
|
|
11
|
+
markers, so a whole layer's worth of points shares one icon image.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import "@f-ewald/components/map-point.js";
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```html
|
|
22
|
+
<map-point></map-point>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Attributes / properties
|
|
26
|
+
|
|
27
|
+
| Property | Attribute | Type | Default | Description |
|
|
28
|
+
| --- | --- | --- | --- | --- |
|
|
29
|
+
| `color` | `color` | `string` | `"#4f46e5"` | Fill color; the gradient's light (top) and dark (bottom) stops are derived from this. |
|
|
30
|
+
| `size` | `size` | `number` | `14` | Diameter, in CSS pixels. |
|
|
31
|
+
| `ringWidth` | `ring-width` | `number` | `3` | White outer ring thickness, in the same viewBox units as `size` (scales with it). |
|
|
32
|
+
|
|
33
|
+
## Events
|
|
34
|
+
|
|
35
|
+
_None._
|
|
36
|
+
|
|
37
|
+
## Slots
|
|
38
|
+
|
|
39
|
+
_None._
|
|
40
|
+
|
|
41
|
+
## CSS custom properties
|
|
42
|
+
|
|
43
|
+
_None._
|
package/llms.txt
CHANGED
|
@@ -227,6 +227,29 @@ Example:
|
|
|
227
227
|
<map-pin color="#22c55e" size="26" highlighted>🏠</map-pin>
|
|
228
228
|
```
|
|
229
229
|
|
|
230
|
+
## <map-point>
|
|
231
|
+
|
|
232
|
+
A small plain-colored map marker for dense point layers (transit stops,
|
|
233
|
+
amenities, hazard points, etc.): a light-to-dark gradient fill with a thin
|
|
234
|
+
white ring, no badge/content slot — every instance on a given layer shares
|
|
235
|
+
the same look, so there's nothing to render per-feature (unlike
|
|
236
|
+
`<map-pin>`/`<map-circle>`, which carry per-marker slotted content).
|
|
237
|
+
Purely a visual primitive — it has no `mapbox-gl` (or any mapping library)
|
|
238
|
+
dependency; typically rasterized once per color and used as a Mapbox
|
|
239
|
+
`icon-image` on a `symbol` layer rather than mounted as individual DOM
|
|
240
|
+
markers, so a whole layer's worth of points shares one icon image.
|
|
241
|
+
|
|
242
|
+
Import: `import "@f-ewald/components/map-point.js";`
|
|
243
|
+
|
|
244
|
+
Properties: `color` (attribute `color`) : string, default "#4f46e5"; `size` (attribute `size`) : number, default 14; `ringWidth` (attribute `ring-width`) : number, default 3
|
|
245
|
+
Events: none
|
|
246
|
+
CSS custom properties: none
|
|
247
|
+
|
|
248
|
+
Example:
|
|
249
|
+
```html
|
|
250
|
+
<map-point></map-point>
|
|
251
|
+
```
|
|
252
|
+
|
|
230
253
|
## <percent-bar-chart>
|
|
231
254
|
|
|
232
255
|
Horizontal bar chart for labeled percentage rows, using D3's linear scale.
|