@keenmate/web-multiselect 1.3.0 → 1.5.0-rc01
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 +97 -4
- package/dist/multiselect.js +838 -860
- package/dist/multiselect.umd.js +10 -10
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/scss/_badges-display.scss +81 -64
- package/src/scss/_base.scss +3 -2
- package/src/scss/_css-variables.scss +273 -261
- package/src/scss/_debug.scss +23 -23
- package/src/scss/_input-dropdown.scss +76 -69
- package/src/scss/_modifiers.scss +6 -65
- package/src/scss/_options.scss +126 -70
- package/src/scss/_rtl.scss +13 -11
- package/src/scss/_tooltips-popover.scss +45 -45
- package/src/scss/_variables.scss +302 -304
package/README.md
CHANGED
|
@@ -1504,6 +1504,99 @@ interface MultiSelectOption {
|
|
|
1504
1504
|
|
|
1505
1505
|
The component uses Shadow DOM for style encapsulation, but exposes CSS custom properties (CSS variables) that you can override to customize the appearance.
|
|
1506
1506
|
|
|
1507
|
+
### Sizing
|
|
1508
|
+
|
|
1509
|
+
The component uses `--ms-rem` as a base unit for proportional scaling. Default is `10px`, meaning `calc(1.4 * var(--ms-rem))` equals `14px`.
|
|
1510
|
+
|
|
1511
|
+
**Global Scaling:**
|
|
1512
|
+
```html
|
|
1513
|
+
<!-- Compact (80%) -->
|
|
1514
|
+
<web-multiselect style="--ms-rem: 8px;"></web-multiselect>
|
|
1515
|
+
|
|
1516
|
+
<!-- Default (100%) -->
|
|
1517
|
+
<web-multiselect></web-multiselect>
|
|
1518
|
+
|
|
1519
|
+
<!-- Large (120%) -->
|
|
1520
|
+
<web-multiselect style="--ms-rem: 12px;"></web-multiselect>
|
|
1521
|
+
|
|
1522
|
+
<!-- Pure Admin integration (inherits from html { font-size: 10px }) -->
|
|
1523
|
+
<web-multiselect style="--ms-rem: 1rem;"></web-multiselect>
|
|
1524
|
+
```
|
|
1525
|
+
|
|
1526
|
+
**Via CSS class:**
|
|
1527
|
+
```css
|
|
1528
|
+
web-multiselect.compact { --ms-rem: 8px; }
|
|
1529
|
+
web-multiselect.large { --ms-rem: 12px; }
|
|
1530
|
+
```
|
|
1531
|
+
|
|
1532
|
+
**Shadow DOM Note:** CSS variables must be set on the `<web-multiselect>` element itself, not on wrapper divs.
|
|
1533
|
+
|
|
1534
|
+
**Fine-grained Control:**
|
|
1535
|
+
Override individual sizing variables for specific adjustments:
|
|
1536
|
+
- `--ms-input-height` - Input field height
|
|
1537
|
+
- `--ms-input-font-size` - Input font size
|
|
1538
|
+
- `--ms-input-padding` - Input padding
|
|
1539
|
+
- `--ms-badge-height` - Badge height
|
|
1540
|
+
- `--ms-option-height` - Option height in dropdown
|
|
1541
|
+
|
|
1542
|
+
### Theme Designer
|
|
1543
|
+
|
|
1544
|
+
The easiest way to customize the appearance of this component is using the **KeenMate Theme Designer** at:
|
|
1545
|
+
|
|
1546
|
+
**[theme-designer.keenmate.dev](https://theme-designer.keenmate.dev)**
|
|
1547
|
+
|
|
1548
|
+
#### How It Works
|
|
1549
|
+
|
|
1550
|
+
1. **Choose 3 base colors** - background, text, and accent
|
|
1551
|
+
2. **Preview changes live** - see your theme applied instantly
|
|
1552
|
+
3. **Fine-tune individual variables** - lock specific values while adjusting others
|
|
1553
|
+
4. **Export your theme** - copy CSS, JSON, or SCSS to your project
|
|
1554
|
+
|
|
1555
|
+
#### CSS Variable Layers
|
|
1556
|
+
|
|
1557
|
+
KeenMate components support a **two-layer theming architecture**:
|
|
1558
|
+
|
|
1559
|
+
**Standalone Mode (Simple)** - Just override the component-specific variables you need:
|
|
1560
|
+
|
|
1561
|
+
```css
|
|
1562
|
+
:root {
|
|
1563
|
+
--ms-accent-color: #your-brand-color;
|
|
1564
|
+
--ms-primary-bg: #your-background;
|
|
1565
|
+
--ms-text-primary: #your-text-color;
|
|
1566
|
+
}
|
|
1567
|
+
```
|
|
1568
|
+
|
|
1569
|
+
**Cascading Mode (Multi-Component)** - When using multiple KeenMate components, you can define a shared base layer:
|
|
1570
|
+
|
|
1571
|
+
```css
|
|
1572
|
+
:root {
|
|
1573
|
+
/* Base layer - single source of truth */
|
|
1574
|
+
--base-accent-color: #3b82f6;
|
|
1575
|
+
--base-primary-bg: #ffffff;
|
|
1576
|
+
--base-text-primary: #111827;
|
|
1577
|
+
|
|
1578
|
+
/* Components reference base layer */
|
|
1579
|
+
--ms-accent-color: var(--base-accent-color);
|
|
1580
|
+
--drp-accent-color: var(--base-accent-color);
|
|
1581
|
+
}
|
|
1582
|
+
```
|
|
1583
|
+
|
|
1584
|
+
Change `--base-accent-color` once → all components update automatically.
|
|
1585
|
+
|
|
1586
|
+
#### Unified Variable Naming
|
|
1587
|
+
|
|
1588
|
+
All KeenMate components follow a consistent naming convention for **Tier 1 variables** (core theming):
|
|
1589
|
+
|
|
1590
|
+
| Purpose | web-multiselect | web-daterangepicker |
|
|
1591
|
+
|---------|-----------------|---------------------|
|
|
1592
|
+
| Brand color | `--ms-accent-color` | `--drp-accent-color` |
|
|
1593
|
+
| Background | `--ms-primary-bg` | `--drp-primary-bg` |
|
|
1594
|
+
| Text color | `--ms-text-primary` | `--drp-text-primary` |
|
|
1595
|
+
| Text on accent | `--ms-text-on-accent` | `--drp-text-on-accent` |
|
|
1596
|
+
| Border color | `--ms-border-color` | `--drp-border-color` |
|
|
1597
|
+
|
|
1598
|
+
Learn the pattern once, apply it across all components.
|
|
1599
|
+
|
|
1507
1600
|
### CSS Variables (No Build System Required)
|
|
1508
1601
|
|
|
1509
1602
|
You can customize the component using CSS variables even with just a `<script>` tag:
|
|
@@ -1704,9 +1797,9 @@ For users with a build system, you can import and customize the SCSS:
|
|
|
1704
1797
|
```scss
|
|
1705
1798
|
// Import and override SCSS variables
|
|
1706
1799
|
@use '@keenmate/web-multiselect/scss' with (
|
|
1707
|
-
$
|
|
1708
|
-
$
|
|
1709
|
-
$
|
|
1800
|
+
$ms-accent-color: #10b981,
|
|
1801
|
+
$ms-border-radius: 0.5rem,
|
|
1802
|
+
$ms-font-size-base: 1rem
|
|
1710
1803
|
);
|
|
1711
1804
|
```
|
|
1712
1805
|
|
|
@@ -1746,7 +1839,7 @@ npm run package
|
|
|
1746
1839
|
|
|
1747
1840
|
## License
|
|
1748
1841
|
|
|
1749
|
-
Copyright (c)
|
|
1842
|
+
Copyright (c) 2025 Keenmate
|
|
1750
1843
|
|
|
1751
1844
|
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
1752
1845
|
|