@classic-homes/maps-core 0.7.4 → 0.7.5
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/package.json +1 -1
- package/src/styles/popup.css +142 -122
package/package.json
CHANGED
package/src/styles/popup.css
CHANGED
|
@@ -91,181 +91,201 @@
|
|
|
91
91
|
position: absolute;
|
|
92
92
|
inset: -8px;
|
|
93
93
|
}
|
|
94
|
+
/* PopupContent placed first (no PopupHeader) keeps clear of the close button */
|
|
95
|
+
.maplibregl-popup-content:has(> .maplibregl-popup-close-button)
|
|
96
|
+
[data-popup-card]
|
|
97
|
+
> [data-popup-content]:first-child {
|
|
98
|
+
padding-right: 2.75rem;
|
|
99
|
+
}
|
|
94
100
|
|
|
95
101
|
/* ==========================================================================
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
MapLibre creates a tip element with CSS borders to form a triangle.
|
|
99
|
-
We color the border to match our popup border, then use ::after to
|
|
100
|
-
create an inner triangle that fills with the background color.
|
|
101
|
-
|
|
102
|
-
Note: The tip is outside the content container, so overflow:hidden
|
|
103
|
-
on the content doesn't affect it.
|
|
102
|
+
Corner anchors: the tip meets the popup at a square corner
|
|
104
103
|
========================================================================== */
|
|
105
104
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
z-index: 1 !important;
|
|
109
|
-
position: relative !important;
|
|
105
|
+
.maplibregl-popup-anchor-top-left .maplibregl-popup-content {
|
|
106
|
+
border-top-left-radius: 0 !important;
|
|
110
107
|
}
|
|
111
108
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
|
|
115
|
-
border-top-color: hsl(var(--border)) !important;
|
|
109
|
+
.maplibregl-popup-anchor-top-right .maplibregl-popup-content {
|
|
110
|
+
border-top-right-radius: 0 !important;
|
|
116
111
|
}
|
|
117
112
|
|
|
118
|
-
.
|
|
119
|
-
border-
|
|
113
|
+
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content {
|
|
114
|
+
border-bottom-left-radius: 0 !important;
|
|
120
115
|
}
|
|
121
116
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
content: '' !important;
|
|
125
|
-
position: absolute !important;
|
|
126
|
-
left: -10px !important;
|
|
127
|
-
top: -11px !important;
|
|
128
|
-
border-left: 10px solid transparent !important;
|
|
129
|
-
border-right: 10px solid transparent !important;
|
|
130
|
-
border-top: 10px solid hsl(var(--popover)) !important;
|
|
117
|
+
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content {
|
|
118
|
+
border-bottom-right-radius: 0 !important;
|
|
131
119
|
}
|
|
132
120
|
|
|
133
|
-
|
|
121
|
+
[dir='rtl'] .maplibregl-popup-anchor-top-left .maplibregl-popup-content {
|
|
122
|
+
border-top-left-radius: 0.5rem !important;
|
|
123
|
+
border-top-right-radius: 0 !important;
|
|
124
|
+
}
|
|
134
125
|
|
|
135
|
-
.maplibregl-popup-anchor-top .maplibregl-popup-
|
|
136
|
-
border-
|
|
126
|
+
[dir='rtl'] .maplibregl-popup-anchor-top-right .maplibregl-popup-content {
|
|
127
|
+
border-top-right-radius: 0.5rem !important;
|
|
128
|
+
border-top-left-radius: 0 !important;
|
|
137
129
|
}
|
|
138
130
|
|
|
139
|
-
|
|
140
|
-
border-bottom-
|
|
131
|
+
[dir='rtl'] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-content {
|
|
132
|
+
border-bottom-left-radius: 0.5rem !important;
|
|
133
|
+
border-bottom-right-radius: 0 !important;
|
|
141
134
|
}
|
|
142
135
|
|
|
143
|
-
.maplibregl-popup-anchor-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
left: -10px !important;
|
|
147
|
-
bottom: -11px !important;
|
|
148
|
-
border-left: 10px solid transparent !important;
|
|
149
|
-
border-right: 10px solid transparent !important;
|
|
150
|
-
border-bottom: 10px solid hsl(var(--popover)) !important;
|
|
136
|
+
[dir='rtl'] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-content {
|
|
137
|
+
border-bottom-right-radius: 0.5rem !important;
|
|
138
|
+
border-bottom-left-radius: 0 !important;
|
|
151
139
|
}
|
|
152
140
|
|
|
153
|
-
/*
|
|
141
|
+
/* ==========================================================================
|
|
142
|
+
Popup Tip/Arrow
|
|
143
|
+
|
|
144
|
+
MapLibre draws the tip as a CSS border triangle. We drop that and paint
|
|
145
|
+
two clip-path triangles instead: ::before in the border colour, ::after
|
|
146
|
+
in the fill colour, inset 1px (1.414px along the 45° edges). The tip
|
|
147
|
+
overlaps the popup by 1px, so the fill covers the popup's own border
|
|
148
|
+
across the tip's mouth: the outline runs round the tip, not through it.
|
|
149
|
+
|
|
150
|
+
The fill matches the part of the popup the tip touches: PopupHeader
|
|
151
|
+
(when it comes first) for tips above, PopupFooter (when it comes last)
|
|
152
|
+
for tips below, the popover colour otherwise. A header or footer with a
|
|
153
|
+
custom background sets --popup-tip-fill on the popup to match.
|
|
154
|
+
========================================================================== */
|
|
154
155
|
|
|
155
|
-
.maplibregl-popup
|
|
156
|
-
|
|
156
|
+
.maplibregl-popup {
|
|
157
|
+
--ct-popup-tip-border: hsl(var(--border));
|
|
158
|
+
--ct-popup-tip-fill: var(--popup-tip-fill, hsl(var(--popover)));
|
|
157
159
|
}
|
|
158
160
|
|
|
159
|
-
.dark .maplibregl-popup
|
|
160
|
-
|
|
161
|
+
.dark .maplibregl-popup {
|
|
162
|
+
--ct-popup-tip-border: rgb(156 163 175); /* gray-400, as the popup border */
|
|
161
163
|
}
|
|
162
164
|
|
|
163
|
-
.maplibregl-popup
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
165
|
+
.maplibregl-popup:is(
|
|
166
|
+
.maplibregl-popup-anchor-top,
|
|
167
|
+
.maplibregl-popup-anchor-top-left,
|
|
168
|
+
.maplibregl-popup-anchor-top-right
|
|
169
|
+
):has([data-popup-card] > [data-popup-header]:first-child),
|
|
170
|
+
.maplibregl-popup:is(
|
|
171
|
+
.maplibregl-popup-anchor-bottom,
|
|
172
|
+
.maplibregl-popup-anchor-bottom-left,
|
|
173
|
+
.maplibregl-popup-anchor-bottom-right
|
|
174
|
+
):has([data-popup-card] > [data-popup-footer]:last-child) {
|
|
175
|
+
--ct-popup-tip-fill: var(--popup-tip-fill, hsl(var(--muted)));
|
|
171
176
|
}
|
|
172
177
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
178
|
+
.maplibregl-popup-tip {
|
|
179
|
+
position: relative !important;
|
|
180
|
+
z-index: 1 !important; /* above the popup's border */
|
|
181
|
+
width: 22px !important;
|
|
182
|
+
height: 11px !important;
|
|
183
|
+
border: none !important;
|
|
177
184
|
}
|
|
178
185
|
|
|
179
|
-
.
|
|
180
|
-
|
|
186
|
+
.maplibregl-popup-tip::before,
|
|
187
|
+
.maplibregl-popup-tip::after {
|
|
188
|
+
content: '';
|
|
189
|
+
position: absolute;
|
|
190
|
+
inset: 0;
|
|
191
|
+
clip-path: var(--ct-tip-outer);
|
|
192
|
+
background: var(--ct-popup-tip-border);
|
|
181
193
|
}
|
|
182
194
|
|
|
183
|
-
.maplibregl-popup-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
top: -10px !important;
|
|
187
|
-
right: -10px !important;
|
|
188
|
-
border-top: 10px solid transparent !important;
|
|
189
|
-
border-bottom: 10px solid transparent !important;
|
|
190
|
-
border-left: 10px solid hsl(var(--popover)) !important;
|
|
195
|
+
.maplibregl-popup-tip::after {
|
|
196
|
+
clip-path: var(--ct-tip-inner);
|
|
197
|
+
background: var(--ct-popup-tip-fill);
|
|
191
198
|
}
|
|
192
199
|
|
|
193
|
-
/*
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
200
|
+
/* Popup above the point: tip hangs below, mouth on top */
|
|
201
|
+
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip {
|
|
202
|
+
margin-top: -1px !important;
|
|
203
|
+
--ct-tip-outer: polygon(0 0, 100% 0, 50% 100%);
|
|
204
|
+
--ct-tip-inner: polygon(1.414px 0, calc(100% - 1.414px) 0, 50% calc(100% - 1.414px));
|
|
197
205
|
}
|
|
198
206
|
|
|
199
|
-
|
|
200
|
-
|
|
207
|
+
/* Popup below the point: tip sits on top, mouth at the bottom */
|
|
208
|
+
.maplibregl-popup-anchor-top .maplibregl-popup-tip {
|
|
209
|
+
margin-bottom: -1px !important;
|
|
210
|
+
--ct-tip-outer: polygon(50% 0, 100% 100%, 0 100%);
|
|
211
|
+
--ct-tip-inner: polygon(50% 1.414px, calc(100% - 1.414px) 100%, 1.414px 100%);
|
|
201
212
|
}
|
|
202
213
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
border-bottom: 10px solid hsl(var(--popover)) !important;
|
|
214
|
+
/* Popup right of the point: tip on its left, mouth on the right */
|
|
215
|
+
.maplibregl-popup-anchor-left .maplibregl-popup-tip {
|
|
216
|
+
width: 11px !important;
|
|
217
|
+
height: 22px !important;
|
|
218
|
+
margin-right: -1px !important;
|
|
219
|
+
--ct-tip-outer: polygon(100% 0, 100% 100%, 0 50%);
|
|
220
|
+
--ct-tip-inner: polygon(100% 1.414px, 100% calc(100% - 1.414px), 1.414px 50%);
|
|
211
221
|
}
|
|
212
222
|
|
|
213
|
-
/*
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
223
|
+
/* Popup left of the point: tip on its right, mouth on the left */
|
|
224
|
+
.maplibregl-popup-anchor-right .maplibregl-popup-tip {
|
|
225
|
+
width: 11px !important;
|
|
226
|
+
height: 22px !important;
|
|
227
|
+
margin-left: -1px !important;
|
|
228
|
+
--ct-tip-outer: polygon(0 0, 100% 50%, 0 100%);
|
|
229
|
+
--ct-tip-inner: polygon(0 1.414px, calc(100% - 1.414px) 50%, 0 calc(100% - 1.414px));
|
|
217
230
|
}
|
|
218
231
|
|
|
219
|
-
|
|
220
|
-
|
|
232
|
+
[dir='rtl'] .maplibregl-popup-anchor-left .maplibregl-popup-tip {
|
|
233
|
+
margin-right: 0 !important;
|
|
234
|
+
margin-left: -1px !important;
|
|
235
|
+
--ct-tip-outer: polygon(0 0, 100% 50%, 0 100%);
|
|
236
|
+
--ct-tip-inner: polygon(0 1.414px, calc(100% - 1.414px) 50%, 0 calc(100% - 1.414px));
|
|
221
237
|
}
|
|
222
238
|
|
|
223
|
-
.maplibregl-popup-anchor-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
border-left: 10px solid transparent !important;
|
|
229
|
-
border-right: 10px solid transparent !important;
|
|
230
|
-
border-bottom: 10px solid hsl(var(--popover)) !important;
|
|
239
|
+
[dir='rtl'] .maplibregl-popup-anchor-right .maplibregl-popup-tip {
|
|
240
|
+
margin-left: 0 !important;
|
|
241
|
+
margin-right: -1px !important;
|
|
242
|
+
--ct-tip-outer: polygon(100% 0, 100% 100%, 0 50%);
|
|
243
|
+
--ct-tip-inner: polygon(100% 1.414px, 100% calc(100% - 1.414px), 1.414px 50%);
|
|
231
244
|
}
|
|
232
245
|
|
|
233
|
-
/*
|
|
234
|
-
|
|
235
|
-
.maplibregl-popup-anchor-
|
|
236
|
-
|
|
246
|
+
/* Corner anchors: a right-angled tip whose straight side continues the
|
|
247
|
+
popup's side border down (or up) to the point */
|
|
248
|
+
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
|
|
249
|
+
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip,
|
|
250
|
+
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
|
|
251
|
+
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
|
|
252
|
+
width: 11px !important;
|
|
237
253
|
}
|
|
238
254
|
|
|
239
|
-
.
|
|
240
|
-
|
|
255
|
+
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
|
|
256
|
+
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
|
|
257
|
+
margin-bottom: -1px !important;
|
|
241
258
|
}
|
|
242
259
|
|
|
243
|
-
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
left: -10px !important;
|
|
247
|
-
top: -11px !important;
|
|
248
|
-
border-left: 10px solid transparent !important;
|
|
249
|
-
border-right: 10px solid transparent !important;
|
|
250
|
-
border-top: 10px solid hsl(var(--popover)) !important;
|
|
260
|
+
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
|
|
261
|
+
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
|
|
262
|
+
margin-top: -1px !important;
|
|
251
263
|
}
|
|
252
264
|
|
|
253
|
-
/*
|
|
265
|
+
/* Point at the top-left corner */
|
|
266
|
+
.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
|
|
267
|
+
[dir='rtl'] .maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
|
|
268
|
+
--ct-tip-outer: polygon(0 0, 100% 100%, 0 100%);
|
|
269
|
+
--ct-tip-inner: polygon(1px 2.414px, calc(100% - 1.414px) 100%, 1px 100%);
|
|
270
|
+
}
|
|
254
271
|
|
|
255
|
-
|
|
256
|
-
|
|
272
|
+
/* Point at the top-right corner */
|
|
273
|
+
.maplibregl-popup-anchor-top-right .maplibregl-popup-tip,
|
|
274
|
+
[dir='rtl'] .maplibregl-popup-anchor-top-left .maplibregl-popup-tip {
|
|
275
|
+
--ct-tip-outer: polygon(100% 0, 100% 100%, 0 100%);
|
|
276
|
+
--ct-tip-inner: polygon(calc(100% - 1px) 2.414px, calc(100% - 1px) 100%, 1.414px 100%);
|
|
257
277
|
}
|
|
258
278
|
|
|
259
|
-
|
|
260
|
-
|
|
279
|
+
/* Point at the bottom-left corner */
|
|
280
|
+
.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
|
|
281
|
+
[dir='rtl'] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
|
|
282
|
+
--ct-tip-outer: polygon(0 0, 100% 0, 0 100%);
|
|
283
|
+
--ct-tip-inner: polygon(1px 0, calc(100% - 1.414px) 0, 1px calc(100% - 2.414px));
|
|
261
284
|
}
|
|
262
285
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
border-left: 10px solid transparent !important;
|
|
269
|
-
border-right: 10px solid transparent !important;
|
|
270
|
-
border-top: 10px solid hsl(var(--popover)) !important;
|
|
286
|
+
/* Point at the bottom-right corner */
|
|
287
|
+
.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip,
|
|
288
|
+
[dir='rtl'] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip {
|
|
289
|
+
--ct-tip-outer: polygon(0 0, 100% 0, 100% 100%);
|
|
290
|
+
--ct-tip-inner: polygon(1.414px 0, calc(100% - 1px) 0, calc(100% - 1px) calc(100% - 2.414px));
|
|
271
291
|
}
|