@f-ewald/components 1.16.0 → 1.18.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/llms.txt CHANGED
@@ -1082,6 +1082,44 @@ Example:
1082
1082
  <map-pin color="#22c55e" size="26" highlighted>🏠</map-pin>
1083
1083
  ```
1084
1084
 
1085
+ ## <mapbox-map>
1086
+
1087
+ A thin, generic wrapper around a `mapboxgl.Map` — construction, access
1088
+ token, style loading/switching, and container resizing only. It carries no
1089
+ domain logic: no layer registry, no click-handler system, no markers or
1090
+ popups. A consumer registers its own sources/layers/handlers against the
1091
+ `mapboxgl.Map` instance handed back on `map-ready`, the same instance
1092
+ `mapbox-map` continues to own (this component never calls `map.remove()`
1093
+ except on disconnect, so a consumer's own registrations survive style
1094
+ reloads exactly as they would using `mapboxgl.Map` directly).
1095
+
1096
+ Deliberately does not construct the map until `styleUrl` is a non-empty
1097
+ string — if a consumer knows the desired style only after an async
1098
+ lookup (e.g. a saved user preference), delay setting `styleUrl` rather
1099
+ than setting a default and swapping it later, which would visibly flash
1100
+ the wrong basemap before the real one loads.
1101
+
1102
+ Import: `import "@f-ewald/components/mapbox-map.js";`
1103
+
1104
+ Properties: `accessToken` (attribute `access-token`) : string, default ""; `styleUrl` (attribute `style-url`) : string, default ""; `center` (JS property only) : [number, number], default [0, 0]; `zoom` (attribute `zoom`) : number, default 0
1105
+ Events: `map-style-reloaded`, `map-ready`
1106
+ CSS custom properties: none
1107
+
1108
+ Example:
1109
+ ```html
1110
+ <mapbox-map
1111
+ access-token="pk.your-token"
1112
+ style-url="mapbox://styles/mapbox/light-v11"
1113
+ ></mapbox-map>
1114
+ <script type="module">
1115
+ document.querySelector("mapbox-map").addEventListener("map-ready", (e) => {
1116
+ const map = e.detail.map; // the underlying mapboxgl.Map
1117
+ map.addSource("mine", { type: "geojson", data: "/mine.geojson" });
1118
+ map.addLayer({ id: "mine", type: "circle", source: "mine", paint: { "circle-color": "#4f46e5" } });
1119
+ });
1120
+ </script>
1121
+ ```
1122
+
1085
1123
  ## <markdown-view>
1086
1124
 
1087
1125
  Renders a markdown string as sanitized, styled HTML — headings, lists,
@@ -1418,6 +1456,33 @@ Example:
1418
1456
  </script>
1419
1457
  ```
1420
1458
 
1459
+ ## <range-slider>
1460
+
1461
+ A form-associated numeric range slider, usable standalone or inside a
1462
+ native `<form>`. Wraps a native `<input type="range">` (kept for its free
1463
+ keyboard, drag, and screen-reader support) restyled to match this
1464
+ package's track/fill visual language (`stat-meter`, `percent-bar-chart`)
1465
+ instead of the browser-default appearance. Purely a value control — no
1466
+ built-in label; wrap in `form-field` for a labeled field, or render a
1467
+ value readout next to it (see the playground example), matching
1468
+ `autocomplete-input`/`form-select`.
1469
+
1470
+ Import: `import "@f-ewald/components/range-slider.js";`
1471
+
1472
+ Properties: `min` (attribute `min`) : number, default 0; `max` (attribute `max`) : number, default 100; `step` (attribute `step`) : number, default 1; `value` (attribute `value`) : number, default 0; `disabled` (attribute `disabled`) : boolean, default false; `name` (attribute `name`) : string, default ""
1473
+ Events: `input`, `change`
1474
+ CSS custom properties: `--ui-focus-ring`, `--ui-primary`, `--ui-surface`, `--ui-surface-muted`, `--ui-text-muted`
1475
+
1476
+ Example:
1477
+ ```html
1478
+ <range-slider min="100" max="5000" step="50" value="1000"></range-slider>
1479
+ <script type="module">
1480
+ document.querySelector("range-slider").addEventListener("input", (e) => {
1481
+ console.log(e.detail.value);
1482
+ });
1483
+ </script>
1484
+ ```
1485
+
1421
1486
  ## <relative-time>
1422
1487
 
1423
1488
  Inline relative-time display (e.g. "3 hours ago"). Accepts either a
@@ -1552,6 +1617,33 @@ Example:
1552
1617
  </slide-panel>
1553
1618
  ```
1554
1619
 
1620
+ ## <split-hero>
1621
+
1622
+ Full-viewport split layout: a user-supplied photo fills one half, the
1623
+ default slot (typically a sign-in/sign-up form) fills the other. Below the
1624
+ shared 48rem breakpoint the photo becomes a blurred, full-bleed backdrop
1625
+ behind a solid content card instead of disappearing outright.
1626
+
1627
+ Give the host a height the same way as `app-shell` (e.g. `height: 100vh`).
1628
+
1629
+ Import: `import "@f-ewald/components/split-hero.js";`
1630
+
1631
+ Properties: `src` (attribute `src`) : string, default ""; `alt` (attribute `alt`) : string, default ""
1632
+ Events: none
1633
+ CSS custom properties: `--ui-font`, `--ui-radius`, `--ui-shadow-lg`, `--ui-surface`, `--ui-surface-muted`, `--ui-text`
1634
+
1635
+ Example:
1636
+ ```html
1637
+ <split-hero src="/photos/coast.jpg" alt="Coastal road" style="height: 100vh">
1638
+ <form>
1639
+ <h1>Sign in</h1>
1640
+ <form-field label="Email"><input type="email" name="email" /></form-field>
1641
+ <form-field label="Password"><input type="password" name="password" /></form-field>
1642
+ <ui-button type="submit" variant="primary">Sign in</ui-button>
1643
+ </form>
1644
+ </split-hero>
1645
+ ```
1646
+
1555
1647
  ## <stat-meter>
1556
1648
 
1557
1649
  A compact labeled meter for a single percentage reading — e.g. CPU or
@@ -1828,11 +1920,15 @@ A form-associated boolean checkbox, usable standalone or inside a native
1828
1920
  Renders a native `<input type="checkbox">` wrapped in a `<label>`, styled
1829
1921
  via `:has()` on the wrapping label (matching `radio-pills`/`radio-cards`)
1830
1922
  rather than styling the native input directly; the checkbox itself renders
1831
- at `1rem`, matching the existing radio-input convention.
1923
+ at `1rem`, matching the existing radio-input convention. An optional
1924
+ pre-rendered `icon` (matching `form-select`'s per-option icon convention)
1925
+ renders between the box and the label, inside the same clickable `<label>`
1926
+ — for a row that pairs a checkbox with an icon/swatch and needs the whole
1927
+ row, icon included, to stay one click target.
1832
1928
 
1833
1929
  Import: `import "@f-ewald/components/ui-checkbox.js";`
1834
1930
 
1835
- Properties: `checked` (attribute `checked`) : boolean, default false; `indeterminate` (attribute `indeterminate`) : boolean, default false; `disabled` (attribute `disabled`) : boolean, default false; `required` (attribute `required`) : boolean, default false; `name` (attribute `name`) : string, default ""; `label` (attribute `label`) : string, default ""
1931
+ Properties: `checked` (attribute `checked`) : boolean, default false; `indeterminate` (attribute `indeterminate`) : boolean, default false; `disabled` (attribute `disabled`) : boolean, default false; `required` (attribute `required`) : boolean, default false; `name` (attribute `name`) : string, default ""; `label` (attribute `label`) : string, default ""; `icon` (JS property only) : TemplateResult | null, default null; `iconSize` (attribute `iconSize`) : number, default 14
1836
1932
  Events: `change`
1837
1933
  CSS custom properties: `--ui-danger`, `--ui-focus-ring`, `--ui-font`, `--ui-font-size-sm`, `--ui-line-height-tight`, `--ui-primary`, `--ui-radius-sm`, `--ui-text`
1838
1934
 
@@ -1840,6 +1936,8 @@ Example:
1840
1936
  ```html
1841
1937
  <ui-checkbox label="Subscribe to updates"></ui-checkbox>
1842
1938
  <ui-checkbox name="terms" label="I agree to the terms" required></ui-checkbox>
1939
+ <!-- .icon is set programmatically (a pre-rendered TemplateResult), not an attribute -->
1940
+ <ui-checkbox label="Show list view"></ui-checkbox>
1843
1941
  ```
1844
1942
 
1845
1943
  ## <user-avatar>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@f-ewald/components",
3
3
  "private": false,
4
- "version": "1.16.0",
4
+ "version": "1.18.0",
5
5
  "description": "A collection of universally usable web components for various tasks.",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",
@@ -65,6 +65,7 @@
65
65
  "d3-shape": "^3.2.0",
66
66
  "dompurify": "^3.4.12",
67
67
  "lit": "^3.3.3",
68
+ "mapbox-gl": "^3.9.0",
68
69
  "marked": "^18.0.7",
69
70
  "zod": "^4.4.3"
70
71
  },
@@ -79,6 +80,7 @@
79
80
  "@types/d3-array": "^3.2.2",
80
81
  "@types/d3-scale": "^4.0.9",
81
82
  "@types/d3-shape": "^3.1.8",
83
+ "@types/mapbox-gl": "^3.4.1",
82
84
  "@types/node": "^26.1.1",
83
85
  "heroicons": "^2.2.0",
84
86
  "tailwindcss": "^4.3.3",