@smilodon/core 1.3.3 → 1.3.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/README.md +192 -10
- package/dist/index.cjs +117 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +117 -72
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.umd.js +117 -72
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +1 -1
- package/dist/index.umd.min.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -216,21 +216,203 @@ const filtered = select.getFilteredItems();
|
|
|
216
216
|
|
|
217
217
|
### Custom Styling
|
|
218
218
|
|
|
219
|
-
Smilodon uses CSS custom properties for theming
|
|
219
|
+
Smilodon uses CSS custom properties (CSS variables) for easy theming and customization. The default theme is **light mode** with a clean white background.
|
|
220
220
|
|
|
221
|
+
#### Basic Customization
|
|
222
|
+
|
|
223
|
+
```css
|
|
224
|
+
enhanced-select {
|
|
225
|
+
/* Options styling */
|
|
226
|
+
--select-option-bg: #ffffff;
|
|
227
|
+
--select-option-color: #1f2937;
|
|
228
|
+
--select-option-padding: 8px 12px;
|
|
229
|
+
|
|
230
|
+
/* Hover state */
|
|
231
|
+
--select-option-hover-bg: #f3f4f6;
|
|
232
|
+
--select-option-hover-color: #1f2937;
|
|
233
|
+
|
|
234
|
+
/* Selected state */
|
|
235
|
+
--select-option-selected-bg: #e0e7ff;
|
|
236
|
+
--select-option-selected-color: #4338ca;
|
|
237
|
+
|
|
238
|
+
/* Active/focused state */
|
|
239
|
+
--select-option-active-bg: #f3f4f6;
|
|
240
|
+
--select-option-active-color: #1f2937;
|
|
241
|
+
|
|
242
|
+
/* Dropdown */
|
|
243
|
+
--select-dropdown-bg: white;
|
|
244
|
+
--select-dropdown-border: #ccc;
|
|
245
|
+
--select-dropdown-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
#### Dark Mode (Opt-in)
|
|
250
|
+
|
|
251
|
+
Dark mode is **opt-in only** and can be enabled by adding a class or data attribute:
|
|
252
|
+
|
|
253
|
+
```html
|
|
254
|
+
<!-- Using class -->
|
|
255
|
+
<enhanced-select class="dark-mode"></enhanced-select>
|
|
256
|
+
|
|
257
|
+
<!-- Using data attribute -->
|
|
258
|
+
<enhanced-select data-theme="dark"></enhanced-select>
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
```css
|
|
262
|
+
/* Custom dark mode colors */
|
|
263
|
+
enhanced-select.dark-mode {
|
|
264
|
+
--select-dark-bg: #1f2937;
|
|
265
|
+
--select-dark-text: #f9fafb;
|
|
266
|
+
--select-dark-border: #4b5563;
|
|
267
|
+
--select-dark-dropdown-bg: #1f2937;
|
|
268
|
+
--select-dark-option-color: #f9fafb;
|
|
269
|
+
--select-dark-option-bg: #1f2937;
|
|
270
|
+
--select-dark-option-hover-bg: #374151;
|
|
271
|
+
--select-dark-option-selected-bg: #3730a3;
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
#### Available CSS Variables
|
|
276
|
+
|
|
277
|
+
**Light Mode (Default)**
|
|
278
|
+
```css
|
|
279
|
+
--select-options-bg /* Options container background (white) */
|
|
280
|
+
--select-option-color /* Option text color (#1f2937) */
|
|
281
|
+
--select-option-bg /* Option background (white) */
|
|
282
|
+
--select-option-padding /* Option padding (8px 12px) */
|
|
283
|
+
--select-option-hover-bg /* Hover background (#f3f4f6) */
|
|
284
|
+
--select-option-hover-color /* Hover text color (#1f2937) */
|
|
285
|
+
--select-option-selected-bg /* Selected background (#e0e7ff) */
|
|
286
|
+
--select-option-selected-color /* Selected text color (#4338ca) */
|
|
287
|
+
--select-option-active-bg /* Active background (#f3f4f6) */
|
|
288
|
+
--select-option-active-color /* Active text color (#1f2937) */
|
|
289
|
+
--select-dropdown-bg /* Dropdown background (white) */
|
|
290
|
+
--select-dropdown-border /* Dropdown border color (#ccc) */
|
|
291
|
+
--select-dropdown-shadow /* Dropdown shadow */
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
**Dark Mode (Opt-in)**
|
|
295
|
+
```css
|
|
296
|
+
--select-dark-bg /* Dark input background (#1f2937) */
|
|
297
|
+
--select-dark-text /* Dark text color (#f9fafb) */
|
|
298
|
+
--select-dark-border /* Dark border color (#4b5563) */
|
|
299
|
+
--select-dark-dropdown-bg /* Dark dropdown background (#1f2937) */
|
|
300
|
+
--select-dark-options-bg /* Dark options container bg (#1f2937) */
|
|
301
|
+
--select-dark-option-color /* Dark option text (#f9fafb) */
|
|
302
|
+
--select-dark-option-bg /* Dark option background (#1f2937) */
|
|
303
|
+
--select-dark-option-hover-bg /* Dark hover background (#374151) */
|
|
304
|
+
--select-dark-option-selected-bg /* Dark selected bg (#3730a3) */
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
**Complete CSS Variables List (60+ variables)**
|
|
308
|
+
|
|
309
|
+
See the [full CSS variables reference](https://github.com/navidrezadoost/smilodon/blob/main/CHANGELOG.md#135---2026-02-09) for all 60+ customizable properties including:
|
|
310
|
+
- Input container (gap, padding, height, borders, focus states)
|
|
311
|
+
- Input field (width, padding, font, colors)
|
|
312
|
+
- Arrow/icon (size, color, hover states, position)
|
|
313
|
+
- Separator line (width, height, gradient)
|
|
314
|
+
- Selection badges (padding, colors, remove button)
|
|
315
|
+
- Dropdown (margins, max-height, borders, shadows)
|
|
316
|
+
- Options (font size, line height, borders, transitions)
|
|
317
|
+
- Load more button (padding, borders, colors, hover states)
|
|
318
|
+
- Loading/empty states (padding, colors, backgrounds, spinner)
|
|
319
|
+
|
|
320
|
+
#### Real-World Customization Examples
|
|
321
|
+
|
|
322
|
+
**Example 1: Bootstrap-style Select**
|
|
323
|
+
```css
|
|
324
|
+
enhanced-select {
|
|
325
|
+
--select-input-border: 1px solid #ced4da;
|
|
326
|
+
--select-input-border-radius: 0.375rem;
|
|
327
|
+
--select-input-focus-border: #86b7fe;
|
|
328
|
+
--select-input-focus-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
|
|
329
|
+
--select-option-hover-bg: #e9ecef;
|
|
330
|
+
--select-option-selected-bg: #0d6efd;
|
|
331
|
+
--select-option-selected-color: white;
|
|
332
|
+
--select-badge-bg: #0d6efd;
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
**Example 2: Material Design**
|
|
337
|
+
```css
|
|
338
|
+
enhanced-select {
|
|
339
|
+
--select-input-border-radius: 4px;
|
|
340
|
+
--select-input-focus-border: #1976d2;
|
|
341
|
+
--select-input-focus-shadow: none;
|
|
342
|
+
--select-option-padding: 16px;
|
|
343
|
+
--select-option-hover-bg: rgba(0, 0, 0, 0.04);
|
|
344
|
+
--select-option-selected-bg: #e3f2fd;
|
|
345
|
+
--select-option-selected-color: #1976d2;
|
|
346
|
+
--select-badge-bg: #1976d2;
|
|
347
|
+
--select-badge-border-radius: 16px;
|
|
348
|
+
}
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
**Example 3: Tailwind-style**
|
|
221
352
|
```css
|
|
222
|
-
|
|
223
|
-
--
|
|
224
|
-
--
|
|
225
|
-
--
|
|
226
|
-
--
|
|
227
|
-
--
|
|
228
|
-
--
|
|
229
|
-
--
|
|
230
|
-
--
|
|
353
|
+
enhanced-select {
|
|
354
|
+
--select-input-border: 1px solid #e5e7eb;
|
|
355
|
+
--select-input-border-radius: 0.5rem;
|
|
356
|
+
--select-input-focus-border: #3b82f6;
|
|
357
|
+
--select-input-focus-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
|
|
358
|
+
--select-option-padding: 0.5rem 0.75rem;
|
|
359
|
+
--select-option-hover-bg: #f3f4f6;
|
|
360
|
+
--select-option-selected-bg: #dbeafe;
|
|
361
|
+
--select-option-selected-color: #1e40af;
|
|
231
362
|
}
|
|
232
363
|
```
|
|
233
364
|
|
|
365
|
+
**Example 4: Custom Brand Colors**
|
|
366
|
+
```css
|
|
367
|
+
enhanced-select {
|
|
368
|
+
/* Your brand colors */
|
|
369
|
+
--select-input-focus-border: #ff6b6b;
|
|
370
|
+
--select-arrow-color: #ff6b6b;
|
|
371
|
+
--select-badge-bg: #ff6b6b;
|
|
372
|
+
--select-option-selected-bg: #ffe0e0;
|
|
373
|
+
--select-option-selected-color: #c92a2a;
|
|
374
|
+
--select-button-border: 1px solid #ff6b6b;
|
|
375
|
+
--select-button-color: #ff6b6b;
|
|
376
|
+
--select-button-hover-bg: #ff6b6b;
|
|
377
|
+
}
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
#### Framework-Specific Examples
|
|
381
|
+
|
|
382
|
+
**React**
|
|
383
|
+
```jsx
|
|
384
|
+
import { Select } from '@smilodon/react';
|
|
385
|
+
|
|
386
|
+
function App() {
|
|
387
|
+
return (
|
|
388
|
+
<Select
|
|
389
|
+
items={items}
|
|
390
|
+
className="dark-mode"
|
|
391
|
+
style={{
|
|
392
|
+
'--select-option-hover-bg': '#2563eb',
|
|
393
|
+
'--select-option-padding': '12px 16px',
|
|
394
|
+
'--select-badge-bg': '#3b82f6'
|
|
395
|
+
}}
|
|
396
|
+
/>
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
**Vue**
|
|
402
|
+
```vue
|
|
403
|
+
<template>
|
|
404
|
+
<Select
|
|
405
|
+
:items="items"
|
|
406
|
+
class="dark-mode"
|
|
407
|
+
:style="{
|
|
408
|
+
'--select-option-hover-bg': '#2563eb',
|
|
409
|
+
'--select-option-padding': '12px 16px',
|
|
410
|
+
'--select-badge-bg': '#3b82f6'
|
|
411
|
+
}"
|
|
412
|
+
/>
|
|
413
|
+
</template>
|
|
414
|
+
```
|
|
415
|
+
|
|
234
416
|
### Server-Side Rendering (SSR)
|
|
235
417
|
|
|
236
418
|
Smilodon gracefully handles SSR environments:
|
package/dist/index.cjs
CHANGED
|
@@ -1668,19 +1668,19 @@ class EnhancedSelect extends HTMLElement {
|
|
|
1668
1668
|
display: flex;
|
|
1669
1669
|
align-items: center;
|
|
1670
1670
|
flex-wrap: wrap;
|
|
1671
|
-
gap: 6px;
|
|
1672
|
-
padding: 6px 52px 6px 8px;
|
|
1673
|
-
min-height: 44px;
|
|
1674
|
-
background: white;
|
|
1675
|
-
border: 1px solid #d1d5db;
|
|
1676
|
-
border-radius: 6px;
|
|
1671
|
+
gap: var(--select-input-gap, 6px);
|
|
1672
|
+
padding: var(--select-input-padding, 6px 52px 6px 8px);
|
|
1673
|
+
min-height: var(--select-input-min-height, 44px);
|
|
1674
|
+
background: var(--select-input-bg, white);
|
|
1675
|
+
border: var(--select-input-border, 1px solid #d1d5db);
|
|
1676
|
+
border-radius: var(--select-input-border-radius, 6px);
|
|
1677
1677
|
box-sizing: border-box;
|
|
1678
1678
|
transition: all 0.2s ease;
|
|
1679
1679
|
}
|
|
1680
1680
|
|
|
1681
1681
|
.input-container:focus-within {
|
|
1682
|
-
border-color: #667eea;
|
|
1683
|
-
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
|
|
1682
|
+
border-color: var(--select-input-focus-border, #667eea);
|
|
1683
|
+
box-shadow: var(--select-input-focus-shadow, 0 0 0 3px rgba(102, 126, 234, 0.1));
|
|
1684
1684
|
}
|
|
1685
1685
|
|
|
1686
1686
|
/* Gradient separator before arrow */
|
|
@@ -1688,17 +1688,17 @@ class EnhancedSelect extends HTMLElement {
|
|
|
1688
1688
|
content: '';
|
|
1689
1689
|
position: absolute;
|
|
1690
1690
|
top: 50%;
|
|
1691
|
-
right: 40px;
|
|
1691
|
+
right: var(--select-separator-position, 40px);
|
|
1692
1692
|
transform: translateY(-50%);
|
|
1693
|
-
width: 1px;
|
|
1694
|
-
height: 60
|
|
1695
|
-
background: linear-gradient(
|
|
1693
|
+
width: var(--select-separator-width, 1px);
|
|
1694
|
+
height: var(--select-separator-height, 60%);
|
|
1695
|
+
background: var(--select-separator-gradient, linear-gradient(
|
|
1696
1696
|
to bottom,
|
|
1697
1697
|
transparent 0%,
|
|
1698
1698
|
rgba(0, 0, 0, 0.1) 20%,
|
|
1699
1699
|
rgba(0, 0, 0, 0.1) 80%,
|
|
1700
1700
|
transparent 100%
|
|
1701
|
-
);
|
|
1701
|
+
));
|
|
1702
1702
|
pointer-events: none;
|
|
1703
1703
|
z-index: 1;
|
|
1704
1704
|
}
|
|
@@ -1708,30 +1708,30 @@ class EnhancedSelect extends HTMLElement {
|
|
|
1708
1708
|
top: 0;
|
|
1709
1709
|
right: 0;
|
|
1710
1710
|
bottom: 0;
|
|
1711
|
-
width: 40px;
|
|
1711
|
+
width: var(--select-arrow-width, 40px);
|
|
1712
1712
|
display: flex;
|
|
1713
1713
|
align-items: center;
|
|
1714
1714
|
justify-content: center;
|
|
1715
1715
|
cursor: pointer;
|
|
1716
1716
|
transition: background-color 0.2s ease;
|
|
1717
|
-
border-radius: 0 4px 4px 0;
|
|
1717
|
+
border-radius: var(--select-arrow-border-radius, 0 4px 4px 0);
|
|
1718
1718
|
z-index: 2;
|
|
1719
1719
|
}
|
|
1720
1720
|
|
|
1721
1721
|
.dropdown-arrow-container:hover {
|
|
1722
|
-
background-color: rgba(102, 126, 234, 0.08);
|
|
1722
|
+
background-color: var(--select-arrow-hover-bg, rgba(102, 126, 234, 0.08));
|
|
1723
1723
|
}
|
|
1724
1724
|
|
|
1725
1725
|
.dropdown-arrow {
|
|
1726
|
-
width: 16px;
|
|
1727
|
-
height: 16px;
|
|
1728
|
-
color: #667eea;
|
|
1726
|
+
width: var(--select-arrow-size, 16px);
|
|
1727
|
+
height: var(--select-arrow-size, 16px);
|
|
1728
|
+
color: var(--select-arrow-color, #667eea);
|
|
1729
1729
|
transition: transform 0.2s ease, color 0.2s ease;
|
|
1730
1730
|
transform: translateY(0);
|
|
1731
1731
|
}
|
|
1732
1732
|
|
|
1733
1733
|
.dropdown-arrow-container:hover .dropdown-arrow {
|
|
1734
|
-
color: #667eea;
|
|
1734
|
+
color: var(--select-arrow-hover-color, #667eea);
|
|
1735
1735
|
}
|
|
1736
1736
|
|
|
1737
1737
|
.dropdown-arrow.open {
|
|
@@ -1740,31 +1740,32 @@ class EnhancedSelect extends HTMLElement {
|
|
|
1740
1740
|
|
|
1741
1741
|
.select-input {
|
|
1742
1742
|
flex: 1;
|
|
1743
|
-
min-width: 120px;
|
|
1744
|
-
padding: 4px;
|
|
1743
|
+
min-width: var(--select-input-min-width, 120px);
|
|
1744
|
+
padding: var(--select-input-field-padding, 4px);
|
|
1745
1745
|
border: none;
|
|
1746
|
-
font-size: 14px;
|
|
1747
|
-
line-height: 1.5;
|
|
1748
|
-
color: #1f2937;
|
|
1746
|
+
font-size: var(--select-input-font-size, 14px);
|
|
1747
|
+
line-height: var(--select-input-line-height, 1.5);
|
|
1748
|
+
color: var(--select-input-color, #1f2937);
|
|
1749
1749
|
background: transparent;
|
|
1750
1750
|
box-sizing: border-box;
|
|
1751
1751
|
outline: none;
|
|
1752
|
+
font-family: var(--select-font-family, inherit);
|
|
1752
1753
|
}
|
|
1753
1754
|
|
|
1754
1755
|
.select-input::placeholder {
|
|
1755
|
-
color: #9ca3af;
|
|
1756
|
+
color: var(--select-input-placeholder-color, #9ca3af);
|
|
1756
1757
|
}
|
|
1757
1758
|
|
|
1758
1759
|
.selection-badge {
|
|
1759
1760
|
display: inline-flex;
|
|
1760
1761
|
align-items: center;
|
|
1761
|
-
gap: 4px;
|
|
1762
|
-
padding: 4px 8px;
|
|
1763
|
-
margin: 2px;
|
|
1764
|
-
background: #667eea;
|
|
1765
|
-
color: white;
|
|
1766
|
-
border-radius: 4px;
|
|
1767
|
-
font-size: 13px;
|
|
1762
|
+
gap: var(--select-badge-gap, 4px);
|
|
1763
|
+
padding: var(--select-badge-padding, 4px 8px);
|
|
1764
|
+
margin: var(--select-badge-margin, 2px);
|
|
1765
|
+
background: var(--select-badge-bg, #667eea);
|
|
1766
|
+
color: var(--select-badge-color, white);
|
|
1767
|
+
border-radius: var(--select-badge-border-radius, 4px);
|
|
1768
|
+
font-size: var(--select-badge-font-size, 13px);
|
|
1768
1769
|
line-height: 1;
|
|
1769
1770
|
}
|
|
1770
1771
|
|
|
@@ -1772,22 +1773,22 @@ class EnhancedSelect extends HTMLElement {
|
|
|
1772
1773
|
display: inline-flex;
|
|
1773
1774
|
align-items: center;
|
|
1774
1775
|
justify-content: center;
|
|
1775
|
-
width: 16px;
|
|
1776
|
-
height: 16px;
|
|
1776
|
+
width: var(--select-badge-remove-size, 16px);
|
|
1777
|
+
height: var(--select-badge-remove-size, 16px);
|
|
1777
1778
|
padding: 0;
|
|
1778
1779
|
margin-left: 4px;
|
|
1779
|
-
background: rgba(255, 255, 255, 0.3);
|
|
1780
|
+
background: var(--select-badge-remove-bg, rgba(255, 255, 255, 0.3));
|
|
1780
1781
|
border: none;
|
|
1781
1782
|
border-radius: 50%;
|
|
1782
|
-
color: white;
|
|
1783
|
-
font-size: 16px;
|
|
1783
|
+
color: var(--select-badge-remove-color, white);
|
|
1784
|
+
font-size: var(--select-badge-remove-font-size, 16px);
|
|
1784
1785
|
line-height: 1;
|
|
1785
1786
|
cursor: pointer;
|
|
1786
1787
|
transition: background 0.2s;
|
|
1787
1788
|
}
|
|
1788
1789
|
|
|
1789
1790
|
.badge-remove:hover {
|
|
1790
|
-
background: rgba(255, 255, 255, 0.5);
|
|
1791
|
+
background: var(--select-badge-remove-hover-bg, rgba(255, 255, 255, 0.5));
|
|
1791
1792
|
}
|
|
1792
1793
|
|
|
1793
1794
|
.select-input:disabled {
|
|
@@ -1801,59 +1802,68 @@ class EnhancedSelect extends HTMLElement {
|
|
|
1801
1802
|
top: 100%;
|
|
1802
1803
|
left: 0;
|
|
1803
1804
|
right: 0;
|
|
1804
|
-
margin-top: 4px;
|
|
1805
|
-
max-height: 300px;
|
|
1805
|
+
margin-top: var(--select-dropdown-margin-top, 4px);
|
|
1806
|
+
max-height: var(--select-dropdown-max-height, 300px);
|
|
1806
1807
|
overflow: hidden;
|
|
1807
1808
|
background: var(--select-dropdown-bg, white);
|
|
1808
|
-
border:
|
|
1809
|
-
border-radius: var(--select-border-radius, 4px);
|
|
1809
|
+
border: var(--select-dropdown-border, 1px solid #ccc);
|
|
1810
|
+
border-radius: var(--select-dropdown-border-radius, 4px);
|
|
1810
1811
|
box-shadow: var(--select-dropdown-shadow, 0 4px 6px rgba(0,0,0,0.1));
|
|
1811
1812
|
z-index: var(--select-dropdown-z-index, 1000);
|
|
1812
1813
|
}
|
|
1813
1814
|
|
|
1814
1815
|
.options-container {
|
|
1815
1816
|
position: relative;
|
|
1816
|
-
max-height: 300px;
|
|
1817
|
+
max-height: var(--select-options-max-height, 300px);
|
|
1817
1818
|
overflow: auto;
|
|
1818
1819
|
transition: opacity 0.2s ease-in-out;
|
|
1820
|
+
background: var(--select-options-bg, white);
|
|
1819
1821
|
}
|
|
1820
1822
|
|
|
1821
1823
|
.option {
|
|
1822
|
-
padding: 8px 12px;
|
|
1824
|
+
padding: var(--select-option-padding, 8px 12px);
|
|
1823
1825
|
cursor: pointer;
|
|
1824
|
-
color:
|
|
1825
|
-
|
|
1826
|
+
color: var(--select-option-color, #1f2937);
|
|
1827
|
+
background: var(--select-option-bg, white);
|
|
1828
|
+
transition: var(--select-option-transition, background-color 0.15s ease);
|
|
1826
1829
|
user-select: none;
|
|
1830
|
+
font-size: var(--select-option-font-size, 14px);
|
|
1831
|
+
line-height: var(--select-option-line-height, 1.5);
|
|
1832
|
+
border-bottom: var(--select-option-border-bottom, none);
|
|
1827
1833
|
}
|
|
1828
1834
|
|
|
1829
1835
|
.option:hover {
|
|
1830
|
-
background-color: #f3f4f6;
|
|
1836
|
+
background-color: var(--select-option-hover-bg, #f3f4f6);
|
|
1837
|
+
color: var(--select-option-hover-color, #1f2937);
|
|
1831
1838
|
}
|
|
1832
1839
|
|
|
1833
1840
|
.option.selected {
|
|
1834
|
-
background-color: #e0e7ff;
|
|
1835
|
-
color: #4338ca;
|
|
1836
|
-
font-weight: 500;
|
|
1841
|
+
background-color: var(--select-option-selected-bg, #e0e7ff);
|
|
1842
|
+
color: var(--select-option-selected-color, #4338ca);
|
|
1843
|
+
font-weight: var(--select-option-selected-weight, 500);
|
|
1837
1844
|
}
|
|
1838
1845
|
|
|
1839
1846
|
.option.active {
|
|
1840
|
-
background-color: #f3f4f6;
|
|
1847
|
+
background-color: var(--select-option-active-bg, #f3f4f6);
|
|
1848
|
+
color: var(--select-option-active-color, #1f2937);
|
|
1841
1849
|
}
|
|
1842
1850
|
|
|
1843
1851
|
.load-more-container {
|
|
1844
|
-
padding: 12px;
|
|
1852
|
+
padding: var(--select-load-more-padding, 12px);
|
|
1845
1853
|
text-align: center;
|
|
1846
|
-
border-top:
|
|
1854
|
+
border-top: var(--select-divider-border, 1px solid #e0e0e0);
|
|
1855
|
+
background: var(--select-load-more-bg, white);
|
|
1847
1856
|
}
|
|
1848
1857
|
|
|
1849
1858
|
.load-more-button {
|
|
1850
|
-
padding: 8px 16px;
|
|
1851
|
-
border:
|
|
1859
|
+
padding: var(--select-button-padding, 8px 16px);
|
|
1860
|
+
border: var(--select-button-border, 1px solid #1976d2);
|
|
1852
1861
|
background: var(--select-button-bg, white);
|
|
1853
1862
|
color: var(--select-button-color, #1976d2);
|
|
1854
|
-
border-radius: 4px;
|
|
1863
|
+
border-radius: var(--select-button-border-radius, 4px);
|
|
1855
1864
|
cursor: pointer;
|
|
1856
|
-
font-size: 14px;
|
|
1865
|
+
font-size: var(--select-button-font-size, 14px);
|
|
1866
|
+
font-family: var(--select-font-family, inherit);
|
|
1857
1867
|
transition: all 0.2s ease;
|
|
1858
1868
|
}
|
|
1859
1869
|
|
|
@@ -1863,21 +1873,23 @@ class EnhancedSelect extends HTMLElement {
|
|
|
1863
1873
|
}
|
|
1864
1874
|
|
|
1865
1875
|
.load-more-button:disabled {
|
|
1866
|
-
opacity: 0.5;
|
|
1876
|
+
opacity: var(--select-button-disabled-opacity, 0.5);
|
|
1867
1877
|
cursor: not-allowed;
|
|
1868
1878
|
}
|
|
1869
1879
|
|
|
1870
1880
|
.busy-bucket {
|
|
1871
|
-
padding: 16px;
|
|
1881
|
+
padding: var(--select-busy-padding, 16px);
|
|
1872
1882
|
text-align: center;
|
|
1873
1883
|
color: var(--select-busy-color, #666);
|
|
1884
|
+
background: var(--select-busy-bg, white);
|
|
1885
|
+
font-size: var(--select-busy-font-size, 14px);
|
|
1874
1886
|
}
|
|
1875
1887
|
|
|
1876
1888
|
.spinner {
|
|
1877
1889
|
display: inline-block;
|
|
1878
|
-
width: 20px;
|
|
1879
|
-
height: 20px;
|
|
1880
|
-
border:
|
|
1890
|
+
width: var(--select-spinner-size, 20px);
|
|
1891
|
+
height: var(--select-spinner-size, 20px);
|
|
1892
|
+
border: var(--select-spinner-border, 2px solid #ccc);
|
|
1881
1893
|
border-top-color: var(--select-spinner-active-color, #1976d2);
|
|
1882
1894
|
border-radius: 50%;
|
|
1883
1895
|
animation: spin 0.6s linear infinite;
|
|
@@ -1888,16 +1900,20 @@ class EnhancedSelect extends HTMLElement {
|
|
|
1888
1900
|
}
|
|
1889
1901
|
|
|
1890
1902
|
.empty-state {
|
|
1891
|
-
padding: 24px;
|
|
1903
|
+
padding: var(--select-empty-padding, 24px);
|
|
1892
1904
|
text-align: center;
|
|
1893
1905
|
color: var(--select-empty-color, #999);
|
|
1906
|
+
font-size: var(--select-empty-font-size, 14px);
|
|
1907
|
+
background: var(--select-empty-bg, white);
|
|
1894
1908
|
}
|
|
1895
1909
|
|
|
1896
1910
|
.searching-state {
|
|
1897
|
-
padding: 24px;
|
|
1911
|
+
padding: var(--select-searching-padding, 24px);
|
|
1898
1912
|
text-align: center;
|
|
1899
|
-
color: #667eea;
|
|
1913
|
+
color: var(--select-searching-color, #667eea);
|
|
1914
|
+
font-size: var(--select-searching-font-size, 14px);
|
|
1900
1915
|
font-style: italic;
|
|
1916
|
+
background: var(--select-searching-bg, white);
|
|
1901
1917
|
animation: pulse 1.5s ease-in-out infinite;
|
|
1902
1918
|
}
|
|
1903
1919
|
|
|
@@ -1926,22 +1942,39 @@ class EnhancedSelect extends HTMLElement {
|
|
|
1926
1942
|
}
|
|
1927
1943
|
}
|
|
1928
1944
|
|
|
1929
|
-
/*
|
|
1930
|
-
|
|
1931
|
-
|
|
1945
|
+
/* Dark mode - Opt-in via class or data attribute */
|
|
1946
|
+
:host(.dark-mode),
|
|
1947
|
+
:host([data-theme="dark"]) {
|
|
1948
|
+
.input-container {
|
|
1932
1949
|
background: var(--select-dark-bg, #1f2937);
|
|
1933
|
-
color: var(--select-dark-text, #f9fafb);
|
|
1934
1950
|
border-color: var(--select-dark-border, #4b5563);
|
|
1935
1951
|
}
|
|
1936
1952
|
|
|
1953
|
+
.select-input {
|
|
1954
|
+
color: var(--select-dark-text, #f9fafb);
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
.select-input::placeholder {
|
|
1958
|
+
color: var(--select-dark-placeholder, #6b7280);
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1937
1961
|
.select-dropdown {
|
|
1938
1962
|
background: var(--select-dark-dropdown-bg, #1f2937);
|
|
1939
1963
|
border-color: var(--select-dark-dropdown-border, #4b5563);
|
|
1940
|
-
|
|
1964
|
+
}
|
|
1965
|
+
|
|
1966
|
+
.options-container {
|
|
1967
|
+
background: var(--select-dark-options-bg, #1f2937);
|
|
1968
|
+
}
|
|
1969
|
+
|
|
1970
|
+
.option {
|
|
1971
|
+
color: var(--select-dark-option-color, #f9fafb);
|
|
1972
|
+
background: var(--select-dark-option-bg, #1f2937);
|
|
1941
1973
|
}
|
|
1942
1974
|
|
|
1943
1975
|
.option:hover {
|
|
1944
1976
|
background-color: var(--select-dark-option-hover-bg, #374151);
|
|
1977
|
+
color: var(--select-dark-option-hover-color, #f9fafb);
|
|
1945
1978
|
}
|
|
1946
1979
|
|
|
1947
1980
|
.option.selected {
|
|
@@ -1951,11 +1984,23 @@ class EnhancedSelect extends HTMLElement {
|
|
|
1951
1984
|
|
|
1952
1985
|
.option.active {
|
|
1953
1986
|
background-color: var(--select-dark-option-active-bg, #374151);
|
|
1987
|
+
color: var(--select-dark-option-active-color, #f9fafb);
|
|
1954
1988
|
}
|
|
1955
1989
|
|
|
1956
|
-
.busy-bucket
|
|
1990
|
+
.busy-bucket,
|
|
1991
|
+
.empty-state {
|
|
1957
1992
|
color: var(--select-dark-busy-color, #9ca3af);
|
|
1958
1993
|
}
|
|
1994
|
+
|
|
1995
|
+
.input-container::after {
|
|
1996
|
+
background: linear-gradient(
|
|
1997
|
+
to bottom,
|
|
1998
|
+
transparent 0%,
|
|
1999
|
+
rgba(255, 255, 255, 0.1) 20%,
|
|
2000
|
+
rgba(255, 255, 255, 0.1) 80%,
|
|
2001
|
+
transparent 100%
|
|
2002
|
+
);
|
|
2003
|
+
}
|
|
1959
2004
|
}
|
|
1960
2005
|
|
|
1961
2006
|
/* Accessibility: High contrast mode */
|