basefn 1.7.0 → 1.9.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/package.json +1 -1
- package/src/Basefn.res +12 -0
- package/src/Basefn.res.mjs +8 -0
- package/src/Basefn__Responsive.res +291 -0
- package/src/Basefn__Responsive.res.mjs +407 -0
- package/src/components/Basefn__Responsive.css +118 -0
- package/src/components/Basefn__Spotlight.css +207 -0
- package/src/components/Basefn__Spotlight.res +205 -0
- package/src/components/Basefn__Spotlight.res.mjs +233 -0
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Xote from "xote/src/Xote.res.mjs";
|
|
4
|
+
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
5
|
+
|
|
6
|
+
import './components/Basefn__Responsive.css'
|
|
7
|
+
;
|
|
8
|
+
|
|
9
|
+
function breakpointToPixels(bp) {
|
|
10
|
+
switch (bp) {
|
|
11
|
+
case "Xs" :
|
|
12
|
+
return 480;
|
|
13
|
+
case "Sm" :
|
|
14
|
+
return 640;
|
|
15
|
+
case "Md" :
|
|
16
|
+
return 768;
|
|
17
|
+
case "Lg" :
|
|
18
|
+
return 1024;
|
|
19
|
+
case "Xl" :
|
|
20
|
+
return 1280;
|
|
21
|
+
case "Xxl" :
|
|
22
|
+
return 1536;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function breakpointToString(bp) {
|
|
27
|
+
switch (bp) {
|
|
28
|
+
case "Xs" :
|
|
29
|
+
return "xs";
|
|
30
|
+
case "Sm" :
|
|
31
|
+
return "sm";
|
|
32
|
+
case "Md" :
|
|
33
|
+
return "md";
|
|
34
|
+
case "Lg" :
|
|
35
|
+
return "lg";
|
|
36
|
+
case "Xl" :
|
|
37
|
+
return "xl";
|
|
38
|
+
case "Xxl" :
|
|
39
|
+
return "xxl";
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function minWidth(bp) {
|
|
44
|
+
let px = breakpointToPixels(bp);
|
|
45
|
+
return `(min-width: ` + px.toString() + `px)`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function maxWidth(bp) {
|
|
49
|
+
let px = breakpointToPixels(bp) - 1 | 0;
|
|
50
|
+
return `(max-width: ` + px.toString() + `px)`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function between(lower, upper) {
|
|
54
|
+
let minPx = breakpointToPixels(lower);
|
|
55
|
+
let maxPx = breakpointToPixels(upper) - 1 | 0;
|
|
56
|
+
return `(min-width: ` + minPx.toString() + `px) and (max-width: ` + maxPx.toString() + `px)`;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let xsUp = minWidth("Xs");
|
|
60
|
+
|
|
61
|
+
let smUp = minWidth("Sm");
|
|
62
|
+
|
|
63
|
+
let mdUp = minWidth("Md");
|
|
64
|
+
|
|
65
|
+
let lgUp = minWidth("Lg");
|
|
66
|
+
|
|
67
|
+
let xlUp = minWidth("Xl");
|
|
68
|
+
|
|
69
|
+
let xxlUp = minWidth("Xxl");
|
|
70
|
+
|
|
71
|
+
let xsDown = maxWidth("Xs");
|
|
72
|
+
|
|
73
|
+
let smDown = maxWidth("Sm");
|
|
74
|
+
|
|
75
|
+
let mdDown = maxWidth("Md");
|
|
76
|
+
|
|
77
|
+
let lgDown = maxWidth("Lg");
|
|
78
|
+
|
|
79
|
+
let xlDown = maxWidth("Xl");
|
|
80
|
+
|
|
81
|
+
let xxlDown = maxWidth("Xxl");
|
|
82
|
+
|
|
83
|
+
let xsOnly = maxWidth("Sm");
|
|
84
|
+
|
|
85
|
+
let smOnly = between("Sm", "Md");
|
|
86
|
+
|
|
87
|
+
let mdOnly = between("Md", "Lg");
|
|
88
|
+
|
|
89
|
+
let lgOnly = between("Lg", "Xl");
|
|
90
|
+
|
|
91
|
+
let xlOnly = between("Xl", "Xxl");
|
|
92
|
+
|
|
93
|
+
let xxlOnly = minWidth("Xxl");
|
|
94
|
+
|
|
95
|
+
let portrait = "(orientation: portrait)";
|
|
96
|
+
|
|
97
|
+
let landscape = "(orientation: landscape)";
|
|
98
|
+
|
|
99
|
+
let prefersReducedMotion = "(prefers-reduced-motion: reduce)";
|
|
100
|
+
|
|
101
|
+
let prefersDark = "(prefers-color-scheme: dark)";
|
|
102
|
+
|
|
103
|
+
let touchDevice = "(hover: none) and (pointer: coarse)";
|
|
104
|
+
|
|
105
|
+
let retina = "(-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)";
|
|
106
|
+
|
|
107
|
+
let Query = {
|
|
108
|
+
xsUp: xsUp,
|
|
109
|
+
smUp: smUp,
|
|
110
|
+
mdUp: mdUp,
|
|
111
|
+
lgUp: lgUp,
|
|
112
|
+
xlUp: xlUp,
|
|
113
|
+
xxlUp: xxlUp,
|
|
114
|
+
xsDown: xsDown,
|
|
115
|
+
smDown: smDown,
|
|
116
|
+
mdDown: mdDown,
|
|
117
|
+
lgDown: lgDown,
|
|
118
|
+
xlDown: xlDown,
|
|
119
|
+
xxlDown: xxlDown,
|
|
120
|
+
xsOnly: xsOnly,
|
|
121
|
+
smOnly: smOnly,
|
|
122
|
+
mdOnly: mdOnly,
|
|
123
|
+
lgOnly: lgOnly,
|
|
124
|
+
xlOnly: xlOnly,
|
|
125
|
+
xxlOnly: xxlOnly,
|
|
126
|
+
portrait: portrait,
|
|
127
|
+
landscape: landscape,
|
|
128
|
+
prefersReducedMotion: prefersReducedMotion,
|
|
129
|
+
prefersDark: prefersDark,
|
|
130
|
+
prefersLight: "(prefers-color-scheme: light)",
|
|
131
|
+
highContrast: "(prefers-contrast: more)",
|
|
132
|
+
touchDevice: touchDevice,
|
|
133
|
+
finePointer: "(hover: hover) and (pointer: fine)",
|
|
134
|
+
retina: retina
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
let addChangeListener = (function(mql, cb) { mql.addEventListener("change", cb) });
|
|
138
|
+
|
|
139
|
+
let removeChangeListener = (function(mql, cb) { mql.removeEventListener("change", cb) });
|
|
140
|
+
|
|
141
|
+
function matchesQuery(query) {
|
|
142
|
+
return window.matchMedia(query).matches;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function matchesBreakpointUp(bp) {
|
|
146
|
+
let query = minWidth(bp);
|
|
147
|
+
return window.matchMedia(query).matches;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function matchesBreakpointDown(bp) {
|
|
151
|
+
let query = maxWidth(bp);
|
|
152
|
+
return window.matchMedia(query).matches;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function makeMediaSignal(query) {
|
|
156
|
+
let mql = window.matchMedia(query);
|
|
157
|
+
let signal = Xote.Signal.make(mql.matches, undefined, undefined);
|
|
158
|
+
let handler = evt => Xote.Signal.set(signal, evt.matches);
|
|
159
|
+
addChangeListener(mql, handler);
|
|
160
|
+
return signal;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function makeBreakpointSignal(bp) {
|
|
164
|
+
return makeMediaSignal(minWidth(bp));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function _memo(make) {
|
|
168
|
+
let cached = {
|
|
169
|
+
contents: undefined
|
|
170
|
+
};
|
|
171
|
+
return () => {
|
|
172
|
+
let s = cached.contents;
|
|
173
|
+
if (s !== undefined) {
|
|
174
|
+
return s;
|
|
175
|
+
}
|
|
176
|
+
let s$1 = make();
|
|
177
|
+
cached.contents = s$1;
|
|
178
|
+
return s$1;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
let isXsScreen = _memo(() => makeMediaSignal(xsDown));
|
|
183
|
+
|
|
184
|
+
let isSmScreen = _memo(() => makeMediaSignal(smOnly));
|
|
185
|
+
|
|
186
|
+
let isMdScreen = _memo(() => makeMediaSignal(mdOnly));
|
|
187
|
+
|
|
188
|
+
let isLgScreen = _memo(() => makeMediaSignal(lgOnly));
|
|
189
|
+
|
|
190
|
+
let isXlScreen = _memo(() => makeMediaSignal(xlOnly));
|
|
191
|
+
|
|
192
|
+
let isXxlScreen = _memo(() => makeMediaSignal(xxlOnly));
|
|
193
|
+
|
|
194
|
+
let isSmallAndUp = _memo(() => makeMediaSignal(smUp));
|
|
195
|
+
|
|
196
|
+
let isMediumAndUp = _memo(() => makeMediaSignal(mdUp));
|
|
197
|
+
|
|
198
|
+
let isLargeAndUp = _memo(() => makeMediaSignal(lgUp));
|
|
199
|
+
|
|
200
|
+
let isExtraLargeAndUp = _memo(() => makeMediaSignal(xlUp));
|
|
201
|
+
|
|
202
|
+
let isMobile = _memo(() => makeMediaSignal(smDown));
|
|
203
|
+
|
|
204
|
+
let isTablet = _memo(() => makeMediaSignal(mdOnly));
|
|
205
|
+
|
|
206
|
+
let isDesktop = _memo(() => makeMediaSignal(lgUp));
|
|
207
|
+
|
|
208
|
+
let isPortrait = _memo(() => makeMediaSignal(portrait));
|
|
209
|
+
|
|
210
|
+
let isLandscape = _memo(() => makeMediaSignal(landscape));
|
|
211
|
+
|
|
212
|
+
let prefersReducedMotion$1 = _memo(() => makeMediaSignal(prefersReducedMotion));
|
|
213
|
+
|
|
214
|
+
let prefersDarkMode = _memo(() => makeMediaSignal(prefersDark));
|
|
215
|
+
|
|
216
|
+
let isTouchDevice = _memo(() => makeMediaSignal(touchDevice));
|
|
217
|
+
|
|
218
|
+
let isRetina = _memo(() => makeMediaSignal(retina));
|
|
219
|
+
|
|
220
|
+
function currentBreakpointToString(bp) {
|
|
221
|
+
switch (bp) {
|
|
222
|
+
case "ExtraSmall" :
|
|
223
|
+
return "xs";
|
|
224
|
+
case "Small" :
|
|
225
|
+
return "sm";
|
|
226
|
+
case "Medium" :
|
|
227
|
+
return "md";
|
|
228
|
+
case "Large" :
|
|
229
|
+
return "lg";
|
|
230
|
+
case "ExtraLarge" :
|
|
231
|
+
return "xl";
|
|
232
|
+
case "ExtraExtraLarge" :
|
|
233
|
+
return "xxl";
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function getCurrentBreakpoint() {
|
|
238
|
+
if (window.matchMedia(xxlUp).matches) {
|
|
239
|
+
return "ExtraExtraLarge";
|
|
240
|
+
} else if (window.matchMedia(xlUp).matches) {
|
|
241
|
+
return "ExtraLarge";
|
|
242
|
+
} else if (window.matchMedia(lgUp).matches) {
|
|
243
|
+
return "Large";
|
|
244
|
+
} else if (window.matchMedia(mdUp).matches) {
|
|
245
|
+
return "Medium";
|
|
246
|
+
} else if (window.matchMedia(smUp).matches) {
|
|
247
|
+
return "Small";
|
|
248
|
+
} else {
|
|
249
|
+
return "ExtraSmall";
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function makeCurrentBreakpointSignal() {
|
|
254
|
+
let signal = Xote.Signal.make(getCurrentBreakpoint(), undefined, undefined);
|
|
255
|
+
let breakpoints = [
|
|
256
|
+
"Sm",
|
|
257
|
+
"Md",
|
|
258
|
+
"Lg",
|
|
259
|
+
"Xl",
|
|
260
|
+
"Xxl"
|
|
261
|
+
];
|
|
262
|
+
breakpoints.forEach(bp => {
|
|
263
|
+
let mql = window.matchMedia(minWidth(bp));
|
|
264
|
+
let _handler = _evt => Xote.Signal.set(signal, getCurrentBreakpoint());
|
|
265
|
+
addChangeListener(mql, _handler);
|
|
266
|
+
});
|
|
267
|
+
return signal;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
let currentBreakpoint = {
|
|
271
|
+
contents: undefined
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
function getCurrentBreakpointSignal() {
|
|
275
|
+
let s = currentBreakpoint.contents;
|
|
276
|
+
if (s !== undefined) {
|
|
277
|
+
return s;
|
|
278
|
+
}
|
|
279
|
+
let s$1 = makeCurrentBreakpointSignal();
|
|
280
|
+
currentBreakpoint.contents = s$1;
|
|
281
|
+
return s$1;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
function resolveResponsiveValue(value, fallback) {
|
|
285
|
+
let bp = getCurrentBreakpoint();
|
|
286
|
+
let ordered;
|
|
287
|
+
switch (bp) {
|
|
288
|
+
case "ExtraSmall" :
|
|
289
|
+
ordered = [value.xs];
|
|
290
|
+
break;
|
|
291
|
+
case "Small" :
|
|
292
|
+
ordered = [
|
|
293
|
+
value.sm,
|
|
294
|
+
value.xs
|
|
295
|
+
];
|
|
296
|
+
break;
|
|
297
|
+
case "Medium" :
|
|
298
|
+
ordered = [
|
|
299
|
+
value.md,
|
|
300
|
+
value.sm,
|
|
301
|
+
value.xs
|
|
302
|
+
];
|
|
303
|
+
break;
|
|
304
|
+
case "Large" :
|
|
305
|
+
ordered = [
|
|
306
|
+
value.lg,
|
|
307
|
+
value.md,
|
|
308
|
+
value.sm,
|
|
309
|
+
value.xs
|
|
310
|
+
];
|
|
311
|
+
break;
|
|
312
|
+
case "ExtraLarge" :
|
|
313
|
+
ordered = [
|
|
314
|
+
value.xl,
|
|
315
|
+
value.lg,
|
|
316
|
+
value.md,
|
|
317
|
+
value.sm,
|
|
318
|
+
value.xs
|
|
319
|
+
];
|
|
320
|
+
break;
|
|
321
|
+
case "ExtraExtraLarge" :
|
|
322
|
+
ordered = [
|
|
323
|
+
value.xxl,
|
|
324
|
+
value.xl,
|
|
325
|
+
value.lg,
|
|
326
|
+
value.md,
|
|
327
|
+
value.sm,
|
|
328
|
+
value.xs
|
|
329
|
+
];
|
|
330
|
+
break;
|
|
331
|
+
}
|
|
332
|
+
let _idx = 0;
|
|
333
|
+
while (true) {
|
|
334
|
+
let idx = _idx;
|
|
335
|
+
if (idx >= ordered.length) {
|
|
336
|
+
return fallback;
|
|
337
|
+
}
|
|
338
|
+
let v = ordered[idx];
|
|
339
|
+
if (v !== undefined) {
|
|
340
|
+
return Primitive_option.valFromOption(v);
|
|
341
|
+
}
|
|
342
|
+
_idx = idx + 1 | 0;
|
|
343
|
+
continue;
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
function hiddenBelow(bp) {
|
|
348
|
+
return `basefn-hidden-below-` + breakpointToString(bp);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
function hiddenAbove(bp) {
|
|
352
|
+
return `basefn-hidden-above-` + breakpointToString(bp);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
function visibleOnly(bp) {
|
|
356
|
+
return `basefn-visible-` + breakpointToString(bp) + `-only`;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
let Visibility = {
|
|
360
|
+
hiddenBelow: hiddenBelow,
|
|
361
|
+
hiddenAbove: hiddenAbove,
|
|
362
|
+
visibleOnly: visibleOnly
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
export {
|
|
366
|
+
breakpointToPixels,
|
|
367
|
+
breakpointToString,
|
|
368
|
+
minWidth,
|
|
369
|
+
maxWidth,
|
|
370
|
+
between,
|
|
371
|
+
Query,
|
|
372
|
+
addChangeListener,
|
|
373
|
+
removeChangeListener,
|
|
374
|
+
matchesQuery,
|
|
375
|
+
matchesBreakpointUp,
|
|
376
|
+
matchesBreakpointDown,
|
|
377
|
+
makeMediaSignal,
|
|
378
|
+
makeBreakpointSignal,
|
|
379
|
+
_memo,
|
|
380
|
+
isXsScreen,
|
|
381
|
+
isSmScreen,
|
|
382
|
+
isMdScreen,
|
|
383
|
+
isLgScreen,
|
|
384
|
+
isXlScreen,
|
|
385
|
+
isXxlScreen,
|
|
386
|
+
isSmallAndUp,
|
|
387
|
+
isMediumAndUp,
|
|
388
|
+
isLargeAndUp,
|
|
389
|
+
isExtraLargeAndUp,
|
|
390
|
+
isMobile,
|
|
391
|
+
isTablet,
|
|
392
|
+
isDesktop,
|
|
393
|
+
isPortrait,
|
|
394
|
+
isLandscape,
|
|
395
|
+
prefersReducedMotion$1 as prefersReducedMotion,
|
|
396
|
+
prefersDarkMode,
|
|
397
|
+
isTouchDevice,
|
|
398
|
+
isRetina,
|
|
399
|
+
currentBreakpointToString,
|
|
400
|
+
getCurrentBreakpoint,
|
|
401
|
+
makeCurrentBreakpointSignal,
|
|
402
|
+
currentBreakpoint,
|
|
403
|
+
getCurrentBreakpointSignal,
|
|
404
|
+
resolveResponsiveValue,
|
|
405
|
+
Visibility,
|
|
406
|
+
}
|
|
407
|
+
/* Not a pure module */
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
Responsive Visibility Utilities
|
|
3
|
+
============================================================================ */
|
|
4
|
+
|
|
5
|
+
/* Hidden below breakpoint (hidden on screens smaller than) */
|
|
6
|
+
@media (max-width: 479px) {
|
|
7
|
+
.basefn-hidden-below-xs { display: none !important; }
|
|
8
|
+
}
|
|
9
|
+
@media (max-width: 639px) {
|
|
10
|
+
.basefn-hidden-below-sm { display: none !important; }
|
|
11
|
+
}
|
|
12
|
+
@media (max-width: 767px) {
|
|
13
|
+
.basefn-hidden-below-md { display: none !important; }
|
|
14
|
+
}
|
|
15
|
+
@media (max-width: 1023px) {
|
|
16
|
+
.basefn-hidden-below-lg { display: none !important; }
|
|
17
|
+
}
|
|
18
|
+
@media (max-width: 1279px) {
|
|
19
|
+
.basefn-hidden-below-xl { display: none !important; }
|
|
20
|
+
}
|
|
21
|
+
@media (max-width: 1535px) {
|
|
22
|
+
.basefn-hidden-below-xxl { display: none !important; }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/* Hidden above breakpoint (hidden on screens larger than) */
|
|
26
|
+
@media (min-width: 480px) {
|
|
27
|
+
.basefn-hidden-above-xs { display: none !important; }
|
|
28
|
+
}
|
|
29
|
+
@media (min-width: 640px) {
|
|
30
|
+
.basefn-hidden-above-sm { display: none !important; }
|
|
31
|
+
}
|
|
32
|
+
@media (min-width: 768px) {
|
|
33
|
+
.basefn-hidden-above-md { display: none !important; }
|
|
34
|
+
}
|
|
35
|
+
@media (min-width: 1024px) {
|
|
36
|
+
.basefn-hidden-above-lg { display: none !important; }
|
|
37
|
+
}
|
|
38
|
+
@media (min-width: 1280px) {
|
|
39
|
+
.basefn-hidden-above-xl { display: none !important; }
|
|
40
|
+
}
|
|
41
|
+
@media (min-width: 1536px) {
|
|
42
|
+
.basefn-hidden-above-xxl { display: none !important; }
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* Visible only at specific breakpoint */
|
|
46
|
+
.basefn-visible-xs-only {
|
|
47
|
+
display: none !important;
|
|
48
|
+
}
|
|
49
|
+
@media (max-width: 479px) {
|
|
50
|
+
.basefn-visible-xs-only { display: revert !important; }
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.basefn-visible-sm-only {
|
|
54
|
+
display: none !important;
|
|
55
|
+
}
|
|
56
|
+
@media (min-width: 640px) and (max-width: 767px) {
|
|
57
|
+
.basefn-visible-sm-only { display: revert !important; }
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.basefn-visible-md-only {
|
|
61
|
+
display: none !important;
|
|
62
|
+
}
|
|
63
|
+
@media (min-width: 768px) and (max-width: 1023px) {
|
|
64
|
+
.basefn-visible-md-only { display: revert !important; }
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.basefn-visible-lg-only {
|
|
68
|
+
display: none !important;
|
|
69
|
+
}
|
|
70
|
+
@media (min-width: 1024px) and (max-width: 1279px) {
|
|
71
|
+
.basefn-visible-lg-only { display: revert !important; }
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.basefn-visible-xl-only {
|
|
75
|
+
display: none !important;
|
|
76
|
+
}
|
|
77
|
+
@media (min-width: 1280px) and (max-width: 1535px) {
|
|
78
|
+
.basefn-visible-xl-only { display: revert !important; }
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.basefn-visible-xxl-only {
|
|
82
|
+
display: none !important;
|
|
83
|
+
}
|
|
84
|
+
@media (min-width: 1536px) {
|
|
85
|
+
.basefn-visible-xxl-only { display: revert !important; }
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* Orientation-based visibility */
|
|
89
|
+
.basefn-hidden-portrait {
|
|
90
|
+
display: revert !important;
|
|
91
|
+
}
|
|
92
|
+
@media (orientation: portrait) {
|
|
93
|
+
.basefn-hidden-portrait { display: none !important; }
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.basefn-hidden-landscape {
|
|
97
|
+
display: revert !important;
|
|
98
|
+
}
|
|
99
|
+
@media (orientation: landscape) {
|
|
100
|
+
.basefn-hidden-landscape { display: none !important; }
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* Device-based visibility */
|
|
104
|
+
@media (hover: none) and (pointer: coarse) {
|
|
105
|
+
.basefn-hidden-touch { display: none !important; }
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@media (hover: hover) and (pointer: fine) {
|
|
109
|
+
.basefn-hidden-desktop { display: none !important; }
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Print visibility */
|
|
113
|
+
@media print {
|
|
114
|
+
.basefn-hidden-print { display: none !important; }
|
|
115
|
+
}
|
|
116
|
+
@media not print {
|
|
117
|
+
.basefn-visible-print-only { display: none !important; }
|
|
118
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
@import '../styles/variables.css';
|
|
2
|
+
|
|
3
|
+
.basefn-spotlight-backdrop {
|
|
4
|
+
position: fixed;
|
|
5
|
+
inset: 0;
|
|
6
|
+
background-color: var(--basefn-surface-overlay);
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: flex-start;
|
|
9
|
+
justify-content: center;
|
|
10
|
+
padding-top: 20vh;
|
|
11
|
+
z-index: 1100;
|
|
12
|
+
animation: basefn-spotlight-fade-in 0.15s ease-out;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.basefn-spotlight {
|
|
16
|
+
background: var(--basefn-bg-primary);
|
|
17
|
+
border-radius: var(--basefn-radius-xl);
|
|
18
|
+
box-shadow: var(--basefn-shadow-lg);
|
|
19
|
+
width: 560px;
|
|
20
|
+
max-width: 90vw;
|
|
21
|
+
max-height: 60vh;
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
animation: basefn-spotlight-slide-in 0.2s ease-out;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Search input area */
|
|
29
|
+
.basefn-spotlight__input-wrapper {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: var(--basefn-spacing-md);
|
|
33
|
+
padding: var(--basefn-spacing-md) var(--basefn-spacing-lg);
|
|
34
|
+
border-bottom: 1px solid var(--basefn-border-primary);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.basefn-spotlight__icon {
|
|
38
|
+
flex-shrink: 0;
|
|
39
|
+
color: var(--basefn-text-tertiary);
|
|
40
|
+
width: 20px;
|
|
41
|
+
height: 20px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.basefn-spotlight__input {
|
|
45
|
+
flex: 1;
|
|
46
|
+
border: none;
|
|
47
|
+
outline: none;
|
|
48
|
+
background: transparent;
|
|
49
|
+
font-family: var(--basefn-font-family);
|
|
50
|
+
font-size: var(--basefn-font-size-base);
|
|
51
|
+
color: var(--basefn-text-primary);
|
|
52
|
+
line-height: var(--basefn-line-height-normal);
|
|
53
|
+
padding: var(--basefn-spacing-sm) 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.basefn-spotlight__input::placeholder {
|
|
57
|
+
color: var(--basefn-text-muted);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Results list */
|
|
61
|
+
.basefn-spotlight__results {
|
|
62
|
+
overflow-y: auto;
|
|
63
|
+
padding: var(--basefn-spacing-sm) 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.basefn-spotlight__empty {
|
|
67
|
+
padding: var(--basefn-spacing-xl) var(--basefn-spacing-lg);
|
|
68
|
+
text-align: center;
|
|
69
|
+
color: var(--basefn-text-muted);
|
|
70
|
+
font-size: var(--basefn-font-size-sm);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.basefn-spotlight__group-label {
|
|
74
|
+
padding: var(--basefn-spacing-sm) var(--basefn-spacing-lg);
|
|
75
|
+
font-size: var(--basefn-font-size-xs);
|
|
76
|
+
font-weight: var(--basefn-font-weight-semibold);
|
|
77
|
+
color: var(--basefn-text-muted);
|
|
78
|
+
text-transform: uppercase;
|
|
79
|
+
letter-spacing: 0.05em;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.basefn-spotlight__item {
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
gap: var(--basefn-spacing-md);
|
|
86
|
+
width: 100%;
|
|
87
|
+
padding: var(--basefn-spacing-sm) var(--basefn-spacing-lg);
|
|
88
|
+
margin: 0;
|
|
89
|
+
font-family: var(--basefn-font-family);
|
|
90
|
+
font-size: var(--basefn-font-size-sm);
|
|
91
|
+
color: var(--basefn-text-primary);
|
|
92
|
+
background: none;
|
|
93
|
+
border: none;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
text-align: left;
|
|
96
|
+
transition: background-color var(--basefn-transition-fast);
|
|
97
|
+
border-radius: 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.basefn-spotlight__item:hover,
|
|
101
|
+
.basefn-spotlight__item--active {
|
|
102
|
+
background-color: var(--basefn-color-primary);
|
|
103
|
+
color: #ffffff;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.basefn-spotlight__item-icon {
|
|
107
|
+
flex-shrink: 0;
|
|
108
|
+
width: 16px;
|
|
109
|
+
height: 16px;
|
|
110
|
+
color: var(--basefn-text-tertiary);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.basefn-spotlight__item:hover .basefn-spotlight__item-icon,
|
|
114
|
+
.basefn-spotlight__item--active .basefn-spotlight__item-icon {
|
|
115
|
+
color: #ffffff;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.basefn-spotlight__item-content {
|
|
119
|
+
flex: 1;
|
|
120
|
+
min-width: 0;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.basefn-spotlight__item-label {
|
|
124
|
+
font-weight: var(--basefn-font-weight-medium);
|
|
125
|
+
white-space: nowrap;
|
|
126
|
+
overflow: hidden;
|
|
127
|
+
text-overflow: ellipsis;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.basefn-spotlight__item-description {
|
|
131
|
+
font-size: var(--basefn-font-size-xs);
|
|
132
|
+
color: var(--basefn-text-muted);
|
|
133
|
+
white-space: nowrap;
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
text-overflow: ellipsis;
|
|
136
|
+
margin-top: 1px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.basefn-spotlight__item:hover .basefn-spotlight__item-description,
|
|
140
|
+
.basefn-spotlight__item--active .basefn-spotlight__item-description {
|
|
141
|
+
color: rgba(255, 255, 255, 0.7);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Footer with keyboard hints */
|
|
145
|
+
.basefn-spotlight__footer {
|
|
146
|
+
display: flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
gap: var(--basefn-spacing-lg);
|
|
149
|
+
padding: var(--basefn-spacing-sm) var(--basefn-spacing-lg);
|
|
150
|
+
border-top: 1px solid var(--basefn-border-primary);
|
|
151
|
+
font-size: var(--basefn-font-size-xs);
|
|
152
|
+
color: var(--basefn-text-muted);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.basefn-spotlight__footer-hint {
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
gap: var(--basefn-spacing-xs);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.basefn-spotlight__footer-key {
|
|
162
|
+
display: inline-flex;
|
|
163
|
+
align-items: center;
|
|
164
|
+
justify-content: center;
|
|
165
|
+
min-width: 1.25rem;
|
|
166
|
+
height: 1.25rem;
|
|
167
|
+
padding: 0 0.25rem;
|
|
168
|
+
border-radius: var(--basefn-radius-sm);
|
|
169
|
+
border: 1px solid var(--basefn-border-secondary);
|
|
170
|
+
background: var(--basefn-bg-secondary);
|
|
171
|
+
font-size: 0.6875rem;
|
|
172
|
+
font-family: var(--basefn-font-family);
|
|
173
|
+
line-height: 1;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* Animations */
|
|
177
|
+
@keyframes basefn-spotlight-fade-in {
|
|
178
|
+
from { opacity: 0; }
|
|
179
|
+
to { opacity: 1; }
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
@keyframes basefn-spotlight-slide-in {
|
|
183
|
+
from {
|
|
184
|
+
opacity: 0;
|
|
185
|
+
transform: scale(0.98) translateY(-8px);
|
|
186
|
+
}
|
|
187
|
+
to {
|
|
188
|
+
opacity: 1;
|
|
189
|
+
transform: scale(1) translateY(0);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/* Mobile */
|
|
194
|
+
@media (max-width: 640px) {
|
|
195
|
+
.basefn-spotlight-backdrop {
|
|
196
|
+
padding-top: 10vh;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.basefn-spotlight {
|
|
200
|
+
max-width: 95vw;
|
|
201
|
+
max-height: 70vh;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.basefn-spotlight__footer {
|
|
205
|
+
display: none;
|
|
206
|
+
}
|
|
207
|
+
}
|