@keenmate/web-multiselect 1.0.0-rc11 → 1.0.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.
@@ -57,7 +57,7 @@
57
57
  // Individual option
58
58
  .ml__option {
59
59
  display: flex;
60
- align-items: flex-start;
60
+ align-items: var(--ml-checkbox-align, flex-start); // Support checkbox alignment
61
61
  gap: var(--ml-option-gap, $ml-option-gap);
62
62
  padding: var(--ml-option-padding, $ml-option-padding);
63
63
  cursor: pointer;
@@ -94,6 +94,15 @@
94
94
  background: var(--ml-option-bg, $ml-option-bg);
95
95
  }
96
96
  }
97
+
98
+ // Checkbox alignment variants
99
+ &[data-checkbox-align="center"] {
100
+ --ml-checkbox-align: center;
101
+ }
102
+
103
+ &[data-checkbox-align="bottom"] {
104
+ --ml-checkbox-align: flex-end;
105
+ }
97
106
  }
98
107
 
99
108
  // ==============================================================================
@@ -104,6 +113,10 @@
104
113
  .ml__checkbox {
105
114
  flex-shrink: 0;
106
115
  margin-top: var(--ml-checkbox-margin-top, $ml-checkbox-margin-top); // Align with first line of text
116
+ width: var(--ml-checkbox-size, $ml-checkbox-size);
117
+ height: var(--ml-checkbox-size, $ml-checkbox-size);
118
+ transform: scale(var(--ml-checkbox-scale, $ml-checkbox-scale));
119
+ transform-origin: top left;
107
120
  cursor: pointer;
108
121
 
109
122
  .ml__option--disabled & {
@@ -28,8 +28,8 @@
28
28
  }
29
29
 
30
30
  // Move count badge to left side
31
- .ml__count-badge {
32
- left: var(--ml-count-badge-offset, $ml-count-badge-offset) !important;
31
+ .ml__counter {
32
+ left: var(--ml-counter-offset, $ml-counter-offset) !important;
33
33
  right: auto !important;
34
34
  }
35
35
 
@@ -62,28 +62,28 @@
62
62
  }
63
63
 
64
64
  // ==============================================================================
65
- // PILLS LAYOUT
65
+ // BADGES LAYOUT
66
66
  // ==============================================================================
67
67
 
68
- .ml__pills {
68
+ .ml__badges {
69
69
  direction: rtl;
70
70
  }
71
71
 
72
- // Pills flow right-to-left
73
- .ml__pill {
72
+ // Badges flow right-to-left
73
+ .ml__badge {
74
74
  flex-direction: row-reverse;
75
75
  }
76
76
 
77
- // Remove button on left side of pill
78
- .ml__pill-remove {
79
- border-radius: var(--ml-pill-remove-border-radius-rtl, $ml-pill-border-radius) 0 0 var(--ml-pill-remove-border-radius-rtl, $ml-pill-border-radius);
80
- border-left: var(--ml-pill-remove-border, $ml-pill-remove-border);
77
+ // Remove button on left side of badge
78
+ .ml__badge-remove {
79
+ border-radius: var(--ml-badge-remove-border-radius-rtl, $ml-badge-border-radius) 0 0 var(--ml-badge-remove-border-radius-rtl, $ml-badge-border-radius);
80
+ border-left: var(--ml-badge-remove-border, $ml-badge-remove-border);
81
81
  border-right: none;
82
82
  }
83
83
 
84
- // Pill text rounded on right
85
- .ml__pill-text {
86
- border-radius: 0 var(--ml-pill-text-border-radius-rtl, $ml-pill-border-radius) var(--ml-pill-text-border-radius-rtl, $ml-pill-border-radius) 0;
84
+ // Badge text rounded on right
85
+ .ml__badge-text {
86
+ border-radius: 0 var(--ml-badge-text-border-radius-rtl, $ml-badge-border-radius) var(--ml-badge-text-border-radius-rtl, $ml-badge-border-radius) 0;
87
87
  }
88
88
 
89
89
  // ==============================================================================
@@ -94,7 +94,7 @@
94
94
  direction: rtl;
95
95
  }
96
96
 
97
- .ml__count-badge-wrapper {
97
+ .ml__counter-wrapper {
98
98
  flex-direction: row-reverse;
99
99
  }
100
100
 
@@ -1,15 +1,15 @@
1
1
  // ==============================================================================
2
2
  // TOOLTIPS & POPOVER
3
3
  // ==============================================================================
4
- // Pill tooltips and selected items popover
4
+ // Badge tooltips and selected items popover
5
5
 
6
6
  @use 'variables' as *;
7
7
 
8
8
  // ==============================================================================
9
- // PILL TOOLTIPS
9
+ // BADGE TOOLTIPS
10
10
  // ==============================================================================
11
11
 
12
- .ml__pill-tooltip {
12
+ .ml__badge-tooltip {
13
13
  position: fixed;
14
14
  z-index: var(--ml-tooltip-z-index, $ml-tooltip-z-index);
15
15
  opacity: 0;
@@ -106,17 +106,22 @@
106
106
  overflow-y: auto;
107
107
  max-height: var(--ml-selected-popover-body-max-height, $ml-selected-popover-body-max-height);
108
108
 
109
- // Pills inside popover
110
- .ml__pill {
109
+ // Badges inside popover (non-virtual mode)
110
+ .ml__badge {
111
111
  width: 100%;
112
+ min-height: fit-content; // Allow badges to expand based on content
113
+ line-height: var(--ml-line-height-relaxed, $ml-line-height-relaxed); // Override line-height: 1 to allow multi-line content
112
114
  }
113
115
 
114
- .ml__pill-text {
116
+ .ml__badge-text {
115
117
  flex: 1;
116
- overflow: hidden;
117
- text-overflow: ellipsis;
118
- white-space: nowrap;
119
- min-width: 0; // Allow text truncation
118
+ min-width: 0; // Allow proper flex sizing
119
+ white-space: normal; // Explicitly allow wrapping
120
+ word-wrap: break-word; // Break long words
121
+ // Remove overflow constraints to allow multi-line content
122
+ // overflow: hidden;
123
+ // text-overflow: ellipsis;
124
+ // white-space: nowrap;
120
125
  }
121
126
 
122
127
  // Virtual scroll mode
@@ -126,14 +131,21 @@
126
131
  max-height: none; // Remove max-height constraint
127
132
  padding: 0; // Remove padding as virtual scroll has its own spacing
128
133
 
129
- .ml__pill {
130
- // Fixed height for virtual scroll (default: 36px, configurable via pill-height attribute)
131
- height: var(--ml-pill-height-virtual, 36px);
132
- min-height: var(--ml-pill-height-virtual, 36px);
133
- max-height: var(--ml-pill-height-virtual, 36px);
134
- margin-bottom: var(--ml-selected-popover-body-gap, $ml-selected-popover-body-gap); // Add gap between pills
134
+ .ml__badge {
135
+ // Fixed height for virtual scroll (default: 36px, configurable via badge-height attribute)
136
+ height: var(--ml-badge-height-virtual, 36px);
137
+ min-height: var(--ml-badge-height-virtual, 36px);
138
+ max-height: var(--ml-badge-height-virtual, 36px);
139
+ margin-bottom: var(--ml-selected-popover-body-gap, $ml-selected-popover-body-gap); // Add gap between badges
135
140
  overflow: hidden;
136
141
  box-sizing: border-box;
137
142
  }
143
+
144
+ .ml__badge-text {
145
+ // Enforce single-line truncation for virtual scroll fixed heights
146
+ white-space: nowrap;
147
+ overflow: hidden;
148
+ text-overflow: ellipsis;
149
+ }
138
150
  }
139
151
  }
@@ -111,14 +111,14 @@ $ml-z-index-popover: 10000 !default;
111
111
  // 8. LAYOUT & DIMENSIONS
112
112
  // ==============================================================================
113
113
  $ml-input-icon-spacing: 2.5rem !default;
114
- $ml-count-badge-offset: 2rem !default;
114
+ $ml-counter-offset: 2rem !default;
115
115
  $ml-option-icon-size: 1.25rem !default;
116
116
  $ml-count-clear-size: 1rem !default;
117
- $ml-pill-height: 1.5rem !default;
118
- $ml-pill-remove-width: 1.5rem !default;
117
+ $ml-badge-height: 1.5rem !default;
118
+ $ml-badge-remove-width: 1.5rem !default;
119
119
  $ml-popover-close-size: 1.5rem !default;
120
120
 
121
- $ml-dropdown-max-height: 20rem !default;
121
+ $ml-options-max-height: 20rem !default;
122
122
  $ml-selected-popover-width: 20rem !default;
123
123
  $ml-selected-popover-max-height: 20rem !default;
124
124
  $ml-selected-popover-body-max-height: 18rem !default;
@@ -203,13 +203,13 @@ $ml-toggle-right: $ml-input-padding-h !default;
203
203
 
204
204
  // Count Badge (in input)
205
205
  // ==============================================================================
206
- $ml-count-badge-padding: 0.125rem 0.25rem !default;
207
- $ml-count-badge-bg: $ml-accent-color !default;
208
- $ml-count-badge-color: $ml-text-white !default;
209
- $ml-count-badge-font-size: $ml-font-size-xs !default;
210
- $ml-count-badge-font-weight: $ml-font-weight-semibold !default;
211
- $ml-count-badge-border-radius: $ml-border-radius-sm !default;
212
- $ml-count-badge-bg-hover: $ml-accent-color-hover !default;
206
+ $ml-counter-padding: 0.125rem 0.25rem !default;
207
+ $ml-counter-bg: $ml-accent-color !default;
208
+ $ml-counter-color: $ml-text-white !default;
209
+ $ml-counter-font-size: $ml-font-size-xs !default;
210
+ $ml-counter-font-weight: $ml-font-weight-semibold !default;
211
+ $ml-counter-border-radius: $ml-border-radius-sm !default;
212
+ $ml-counter-bg-hover: $ml-accent-color-hover !default;
213
213
 
214
214
  // Floating Hint
215
215
  // ==============================================================================
@@ -232,7 +232,7 @@ $ml-dropdown-text: $ml-color-neutral-darkest !default;
232
232
  $ml-dropdown-border: $ml-border-width-base solid $ml-dropdown-border-color !default;
233
233
  $ml-dropdown-border-radius: $ml-border-radius !default;
234
234
  $ml-dropdown-box-shadow: $ml-dropdown-shadow !default;
235
- $ml-dropdown-color: $ml-dropdown-text !default;
235
+ $ml-option-color: $ml-dropdown-text !default;
236
236
 
237
237
  // Dropdown Actions
238
238
  // ==============================================================================
@@ -326,14 +326,14 @@ $ml-loader-gap: $ml-spacing-sm !default;
326
326
  $ml-loading-text-font-size: $ml-font-size-sm !default;
327
327
  $ml-loading-text-color: $ml-text-secondary !default;
328
328
 
329
- // Pills Container
329
+ // Badges Container
330
330
  // ==============================================================================
331
- $ml-pill-gap: $ml-spacing-sm !default;
332
- $ml-pills-gap: $ml-pill-gap !default;
333
- $ml-pills-margin-bottom: $ml-spacing-sm !default;
334
- $ml-pills-margin-top: $ml-spacing-sm !default;
335
- $ml-pills-margin-left: $ml-spacing-xs !default;
336
- $ml-pills-margin-right: $ml-spacing-xs !default;
331
+ $ml-badge-gap: $ml-spacing-sm !default;
332
+ $ml-badges-gap: $ml-badge-gap !default;
333
+ $ml-badges-margin-bottom: $ml-spacing-sm !default;
334
+ $ml-badges-margin-top: $ml-spacing-sm !default;
335
+ $ml-badges-margin-left: $ml-spacing-xs !default;
336
+ $ml-badges-margin-right: $ml-spacing-xs !default;
337
337
 
338
338
  // Count Display
339
339
  // ==============================================================================
@@ -344,13 +344,13 @@ $ml-count-display-margin-right: $ml-spacing-sm !default;
344
344
 
345
345
  // Count Badge Wrapper
346
346
  // ==============================================================================
347
- $ml-count-badge-wrapper-bg: transparent !default;
348
- $ml-count-badge-wrapper-border: $ml-border-width-base solid $ml-border-color !default;
349
- $ml-count-badge-wrapper-border-radius: $ml-border-radius-sm !default;
350
- $ml-count-badge-wrapper-padding: $ml-spacing-xs $ml-spacing-sm !default;
351
- $ml-count-badge-wrapper-gap: $ml-spacing-xs !default;
352
- $ml-count-badge-wrapper-bg-hover: $ml-option-hover-bg !default;
353
- $ml-count-badge-wrapper-border-color-hover: $ml-accent-color !default;
347
+ $ml-counter-wrapper-bg: transparent !default;
348
+ $ml-counter-wrapper-border: $ml-border-width-base solid $ml-border-color !default;
349
+ $ml-counter-wrapper-border-radius: $ml-border-radius-sm !default;
350
+ $ml-counter-wrapper-padding: $ml-spacing-xs $ml-spacing-sm !default;
351
+ $ml-counter-wrapper-gap: $ml-spacing-xs !default;
352
+ $ml-counter-wrapper-bg-hover: $ml-option-hover-bg !default;
353
+ $ml-counter-wrapper-border-color-hover: $ml-accent-color !default;
354
354
 
355
355
  // Count Text
356
356
  // ==============================================================================
@@ -368,48 +368,48 @@ $ml-count-clear-border-radius: $ml-border-radius-full !default;
368
368
  $ml-count-clear-bg-hover: rgba($ml-accent-color, $ml-opacity-highlight-bg) !default;
369
369
  $ml-count-clear-color-hover: $ml-accent-color !default;
370
370
 
371
- // Pill
371
+ // Badge
372
372
  // ==============================================================================
373
- $ml-pill-bg: $ml-color-accent-lightest !default;
374
- $ml-pill-bg-hover: $ml-color-white !default;
375
- $ml-pill-bg-active: $ml-color-accent-lighter !default;
373
+ $ml-badge-bg: $ml-color-accent-lightest !default;
374
+ $ml-badge-bg-hover: $ml-color-white !default;
375
+ $ml-badge-bg-active: $ml-color-accent-lighter !default;
376
376
 
377
- $ml-pill-font-size: $ml-font-size-xs !default;
378
- $ml-pill-font-weight: $ml-font-weight-semibold !default;
379
- $ml-pill-border-radius: $ml-border-radius !default;
377
+ $ml-badge-font-size: $ml-font-size-xs !default;
378
+ $ml-badge-font-weight: $ml-font-weight-semibold !default;
379
+ $ml-badge-border-radius: $ml-border-radius !default;
380
380
 
381
- // Pill Text
381
+ // Badge Text
382
382
  // ==============================================================================
383
- $ml-pill-text-padding: 0 $ml-spacing-sm !default;
384
- $ml-pill-text-bg: $ml-pill-bg !default;
385
- $ml-pill-text-color: $ml-accent-color !default;
383
+ $ml-badge-text-padding: 0 $ml-spacing-sm !default;
384
+ $ml-badge-text-bg: $ml-badge-bg !default;
385
+ $ml-badge-text-color: $ml-accent-color !default;
386
386
 
387
- // Pill Remove Button
387
+ // Badge Remove Button
388
388
  // ==============================================================================
389
- $ml-pill-remove-bg: $ml-accent-color !default;
390
- $ml-pill-remove-color: $ml-text-white !default;
391
- $ml-pill-remove-border: none !default;
392
- $ml-pill-remove-font-size: $ml-font-size-xs !default;
393
- $ml-pill-remove-bg-hover: $ml-accent-color-hover !default;
394
- $ml-pill-remove-box-shadow-focus: 0 0 0 $ml-focus-outline-width
389
+ $ml-badge-remove-bg: $ml-accent-color !default;
390
+ $ml-badge-remove-color: $ml-text-white !default;
391
+ $ml-badge-remove-border: none !default;
392
+ $ml-badge-remove-font-size: $ml-font-size-xs !default;
393
+ $ml-badge-remove-bg-hover: $ml-accent-color-hover !default;
394
+ $ml-badge-remove-box-shadow-focus: 0 0 0 $ml-focus-outline-width
395
395
  rgba($ml-accent-color, $ml-opacity-focus-shadow) !default;
396
396
 
397
- // Pill Indicator (for "+ X more", "3 selected", compact mode display)
397
+ // Badge Indicator (for "+ X more", "3 selected", compact mode display)
398
398
  // ==============================================================================
399
- $ml-pill-indicator-bg: transparent !default;
400
- $ml-pill-indicator-border: $ml-border-width-base solid $ml-border-color !default;
401
- $ml-pill-indicator-border-radius: $ml-border-radius-sm !default;
402
- $ml-pill-indicator-text-color: $ml-text-secondary !default;
403
- $ml-pill-indicator-text-bg: $ml-color-neutral-base !default;
404
- $ml-pill-indicator-remove-bg: $ml-color-neutral-dark !default;
405
- $ml-pill-indicator-remove-color: $ml-color-white !default;
406
- $ml-pill-indicator-remove-bg-hover: $ml-color-neutral-darkest !default;
399
+ $ml-badge-counter-bg: transparent !default;
400
+ $ml-badge-counter-border: $ml-border-width-base solid $ml-border-color !default;
401
+ $ml-badge-counter-border-radius: $ml-border-radius-sm !default;
402
+ $ml-badge-counter-text-color: $ml-text-secondary !default;
403
+ $ml-badge-counter-text-bg: $ml-color-neutral-base !default;
404
+ $ml-badge-counter-remove-bg: $ml-color-neutral-dark !default;
405
+ $ml-badge-counter-remove-color: $ml-color-white !default;
406
+ $ml-badge-counter-remove-bg-hover: $ml-color-neutral-darkest !default;
407
407
 
408
408
  // "+X more" badge (partial mode)
409
409
  // ==============================================================================
410
- $ml-more-badge-bg: $ml-pill-text-bg !default;
411
- $ml-more-badge-hover-bg: $ml-pill-bg-hover !default;
412
- $ml-more-badge-active-bg: $ml-pill-bg-active !default;
410
+ $ml-more-badge-bg: $ml-badge-text-bg !default;
411
+ $ml-more-badge-hover-bg: $ml-badge-bg-hover !default;
412
+ $ml-more-badge-active-bg: $ml-badge-bg-active !default;
413
413
 
414
414
  // Tooltip
415
415
  // ==============================================================================
@@ -455,6 +455,8 @@ $ml-selected-popover-body-padding: $ml-spacing-sm !default;
455
455
  // ==============================================================================
456
456
  $ml-checkbox-offset: 0.125rem !default;
457
457
  $ml-checkbox-margin-top: $ml-checkbox-offset !default;
458
+ $ml-checkbox-size: 16px !default; // Width and height of checkbox
459
+ $ml-checkbox-scale: 1 !default; // Scale multiplier for checkbox size
458
460
 
459
461
  // Placeholder
460
462
  // ==============================================================================
@@ -7,10 +7,10 @@
7
7
  // - _variables.scss : All variables (base primitives + semantic)
8
8
  // - _css-variables.scss : CSS custom properties at :host level (for theming)
9
9
  // - _base.scss : FOUC prevention + layout containers
10
- // - _input-dropdown.scss : Input, toggle, badge, hint, dropdown, actions
10
+ // - _input-dropdown.scss : Input, toggle, counter, hint, dropdown, actions
11
11
  // - _options.scss : Options list, groups, checkbox, content, states
12
- // - _pills-display.scss : Pills, count display, individual pills
13
- // - _tooltips-popover.scss: Pill tooltips + selected items popover
12
+ // - _badges-display.scss : Badges, count display, individual badges
13
+ // - _tooltips-popover.scss: Badge tooltips + selected items popover
14
14
  // - _rtl.scss : RTL (Right-to-Left) language support
15
15
  // - _modifiers.scss : Size variants + state modifiers
16
16
  // - _debug.scss : Debug information panel
@@ -21,7 +21,7 @@
21
21
  @use 'base';
22
22
  @use 'input-dropdown';
23
23
  @use 'options';
24
- @use 'pills-display';
24
+ @use 'badges-display';
25
25
  @use 'tooltips-popover';
26
26
  @use 'rtl';
27
27
  @use 'modifiers';