@synergy-design-system/mcp 2.2.0 → 2.3.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.
@@ -6,12 +6,15 @@
6
6
  // ---------------------------------------------------------------------
7
7
 
8
8
  /**
9
- * @summary Comboboxes allow you to choose items from a menu of predefined options.
9
+ * @summary A combobox component that combines the functionality of a text input with a dropdown listbox,
10
+ * allowing users to either select from predefined options or enter custom values (when not restricted).
11
+ *
10
12
  * @documentation https://synergy-design-system.github.io/?path=/docs/components-syn-combobox--docs
11
13
  * @status stable
12
14
  *
13
15
  * @dependency syn-icon
14
16
  * @dependency syn-popup
17
+ * @dependency syn-tag
15
18
  *
16
19
  * @slot - The listbox options. Must be `<syn-option>` elements.
17
20
  * You can use `<syn-optgroup>`'s to group items visually.
@@ -41,7 +44,7 @@
41
44
  * @csspart form-control-label - The label's wrapper.
42
45
  * @csspart form-control-input - The combobox's wrapper.
43
46
  * @csspart form-control-help-text - The help text's wrapper.
44
- * @csspart combobox - The container the wraps the prefix, combobox, clear icon, and expand button.
47
+ * @csspart combobox - The container that wraps the prefix, combobox, clear icon, and expand button.
45
48
  * @csspart prefix - The container that wraps the prefix slot.
46
49
  * @csspart suffix - The container that wraps the suffix slot.
47
50
  * @csspart display-input - The element that displays the selected option's label,
@@ -54,6 +57,12 @@
54
57
  * @csspart popup - The popup's exported `popup` part.
55
58
  * Use this to target the tooltip's popup container.
56
59
  * @csspart no-results - The container that wraps the "no results" message.
60
+ * @csspart tags - The container that houses option tags when `multiple` is used.
61
+ * @csspart tag - The individual tags that represent each selected option in `multiple`.
62
+ * @csspart tag__base - The tag's base part.
63
+ * @csspart tag__content - The tag's content part.
64
+ * @csspart tag__remove-button - The tag's remove button.
65
+ * @csspart tag__remove-button__base - The tag's remove button base part.
57
66
  *
58
67
  * @animation combobox.show - The animation to use when showing the combobox.
59
68
  * @animation combobox.hide - The animation to use when hiding the combobox.
@@ -88,11 +97,6 @@ const props = defineProps<{
88
97
  */
89
98
  name?: SynCombobox['name'];
90
99
 
91
- /**
92
- * The current value of the combobox, submitted as a name/value pair with form data.
93
- */
94
- value?: SynCombobox['value'];
95
-
96
100
  /**
97
101
  * The combobox's size.
98
102
  */
@@ -154,9 +158,16 @@ The form must be in the same document or shadow root for this to work.
154
158
  /**
155
159
  * When set to `true`, restricts the combobox to only allow selection from the available options.
156
160
  Users will not be able to enter custom values that are not present in the list.
161
+ This will always be true, if `multiple` is active.
157
162
  */
158
163
  restricted?: SynCombobox['restricted'];
159
164
 
165
+ /**
166
+ * Allows more than one option to be selected.
167
+ If `multiple` is set, the combobox will always be `restricted` to the available options
168
+ */
169
+ multiple?: SynCombobox['multiple'];
170
+
160
171
  /**
161
172
  * A function that customizes the rendered option.
162
173
  * The first argument is the option, the second
@@ -173,6 +184,38 @@ The default filter method is a case- and diacritic-insensitive string comparison
173
184
  */
174
185
  filter?: SynCombobox['filter'];
175
186
 
187
+ /**
188
+ * The delimiter to use when setting the value when `multiple` is enabled.
189
+ The default is a space ' ', but you can set it to a comma or other character(s).
190
+ */
191
+ delimiter?: SynCombobox['delimiter'];
192
+
193
+ /**
194
+ * The maximum number of selected options to show when `multiple` is true.
195
+ * After the maximum, "+n" will be shown to
196
+ indicate the number of additional items that are selected.
197
+ * Set to 0 to remove the limit.
198
+ */
199
+ maxOptionsVisible?: SynCombobox['maxOptionsVisible'];
200
+
201
+ /**
202
+ * A function that customizes the tags to be rendered when `multiple` is true.
203
+ * The first argument is the option, the second
204
+ is the current tag's index.
205
+ * The function should return either a Lit TemplateResult or a string containing trusted HTML of the symbol to render at
206
+ the specified value.
207
+ */
208
+ getTag?: SynCombobox['getTag'];
209
+
210
+ /**
211
+ * The current value of the combobox, submitted as a name/value pair with form data.
212
+ * When `multiple` is enabled, the
213
+ value attribute will be a list of values separated by the delimiter, based on the options selected, and the value property will
214
+ be an array.
215
+ * **For this reason, values must not contain the delimiter character.**
216
+ */
217
+ value?: SynCombobox['value'];
218
+
176
219
  /**
177
220
  * Support for two way data binding
178
221
  */
@@ -11,6 +11,7 @@ import styles from './option.styles.js';
11
11
  import customStyles from './option.custom.styles.js';
12
12
  import { delimiterToWhiteSpace } from './utility.js';
13
13
  import type { CSSResultGroup } from 'lit';
14
+ import { enableDefaultSettings } from '../../utilities/defaultSettings/decorator.js';
14
15
 
15
16
  /**
16
17
  * @summary Options define the selectable items within various form controls such as [select](/components/select).
@@ -30,6 +31,7 @@ import type { CSSResultGroup } from 'lit';
30
31
  * @csspart prefix - The container that wraps the prefix.
31
32
  * @csspart suffix - The container that wraps the suffix.
32
33
  */
34
+ @enableDefaultSettings('SynOption')
33
35
  export default class SynOption extends SynergyElement {
34
36
  static styles: CSSResultGroup = [componentStyles, styles, customStyles];
35
37
  static dependencies = { 'syn-icon': SynIcon };
@@ -1,5 +1,26 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1164](https://github.com/synergy-design-system/synergy-design-system/pull/1164) [`c9fb440`](https://github.com/synergy-design-system/synergy-design-system/commit/c9fb4405c0a1eb3499e4753447ac643ae632ff56) Thanks [@kirchsuSICKAG](https://github.com/kirchsuSICKAG)! - Released on: 2026-02-05
8
+
9
+ feat: ✨ syn-combobox multiple (#627)
10
+
11
+ Adds multiple selection functionality to the `syn-combobox` component, enabling users to select multiple options simultaneously.
12
+
13
+ **Properties Added:**
14
+ - `multiple`: Enables multiple selection mode
15
+ - `delimiter`: Customizable value separator (default: ` ` (space))
16
+ - `max-options-visible`: Controls visible tag limit with overflow handling
17
+ - `getTag`: Custom tag rendering function
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies []:
22
+ - @synergy-design-system/tokens@3.2.0
23
+
3
24
  ## 3.1.0
4
25
 
5
26
  ### Minor Changes
@@ -4,6 +4,64 @@ This file lists known issues and limitations of Synergy Web Components and usefu
4
4
 
5
5
  ---
6
6
 
7
+ <h2 id="syn-option-spaces">Console errors when using spaces in `<syn-option>` values</h2>
8
+
9
+ <h3 id="syn-option-spaces-meta">Meta Information</h3>
10
+
11
+ - Framework version: ALL
12
+ - Synergy version: ALL
13
+ - Issues: [#1087](https://github.com/synergy-design-system/synergy-design-system/issues/1087)
14
+
15
+ <h3 id="syn-option-spaces-description">Description</h3>
16
+
17
+ When using `<syn-option>` components with values that contain spaces inside `<syn-select>` or `<syn-combobox>` components, you may see console errors like:
18
+
19
+ > Option values cannot include " ". All occurrences of " " have been replaced with "\_".
20
+
21
+ <h3 id="syn-option-spaces-cause">Cause</h3>
22
+
23
+ When using the `multiple` attribute, Synergy components create a space-separated list of selected values (e.g., `"Option_One Option_Two"`). If option values themselves contain spaces, the component cannot properly distinguish between individual values in this list. To prevent data corruption, spaces in option values are automatically replaced with underscores (`_`).
24
+
25
+ <h3 id="syn-option-spaces-solution">Proposed Solution</h3>
26
+
27
+ <h4 id="syn-option-spaces-problem">Problem</h4>
28
+
29
+ ```html
30
+ <syn-select multiple>
31
+ <syn-option value="Option One">Option One</syn-option>
32
+ <syn-option value="Option Two">Option Two</syn-option>
33
+ </syn-select>
34
+ ```
35
+
36
+ <h4 id="syn-option-spaces-solution-1">Solution 1: Use space-free values (Recommended)</h4>
37
+
38
+ Design your option values without spaces and use the display text separately:
39
+
40
+ ```html
41
+ <syn-select multiple>
42
+ <syn-option value="option-one">Option One</syn-option>
43
+ <syn-option value="option-two">Option Two</syn-option>
44
+ </syn-select>
45
+ ```
46
+
47
+ <h4 id="syn-option-spaces-solution-2">Solution 2: Change the global delimiter</h4>
48
+
49
+ If you need to keep spaces in values and don't mind changing how all select and combobox components work globally, you can configure a different delimiter:
50
+
51
+ ```js
52
+ import { setGlobalDefaultSettings } from "@synergy-design-system/components";
53
+
54
+ setGlobalDefaultSettings({
55
+ delimiter: {
56
+ SynOption: ",",
57
+ SynSelect: ",",
58
+ SynCombobox: ",",
59
+ },
60
+ });
61
+ ```
62
+
63
+ **Note:** This affects **all** select and combobox components in your application, which do not explicitly set the `delimiter` attribute.
64
+
7
65
  <h2 id="syn-input-number-width">`<syn-input type="number">` is too large when no `width` is set</h2>
8
66
 
9
67
  <h3 id="syn-input-number-width-meta">Meta Information</h3>
@@ -1,5 +1,7 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.2.0
4
+
3
5
  ## 3.1.0
4
6
 
5
7
  ### Minor Changes
@@ -3,7 +3,7 @@
3
3
  The combobox suggests items based on the user input.
4
4
 
5
5
  ```html
6
- <syn-combobox size="medium" placement="bottom" form="">
6
+ <syn-combobox max-options-visible="3" size="medium" placement="bottom" form="">
7
7
  <syn-option
8
8
  role="option"
9
9
  aria-selected="false"
@@ -441,6 +441,140 @@ Use the disabled attribute to disable a combobox.
441
441
 
442
442
  ---
443
443
 
444
+ ## Multiple
445
+
446
+ To allow multiple options to be selected, use the multiple attribute. It’s a good practice to use clearable when this option is enabled. To set multiple values at once, set value to a space-delimited list of values. Use the max-options-visible attribute to define the maximum number of selected options that will be visible. After the maximum, "+n" will be shown to indicate the number of additional items that are selected.
447
+
448
+ ```html
449
+ <syn-combobox
450
+ value="option-1 option-2 option-3"
451
+ multiple=""
452
+ clearable=""
453
+ max-options-visible="2"
454
+ size="medium"
455
+ placement="bottom"
456
+ form=""
457
+ >
458
+ <syn-option
459
+ value="option-1"
460
+ role="option"
461
+ aria-selected="false"
462
+ aria-disabled="false"
463
+ id="syn-combobox-option-0"
464
+ >Option 1</syn-option
465
+ >
466
+ <syn-option
467
+ value="option-2"
468
+ role="option"
469
+ aria-selected="false"
470
+ aria-disabled="false"
471
+ id="syn-combobox-option-1"
472
+ >Option 2</syn-option
473
+ >
474
+ <syn-option
475
+ value="option-3"
476
+ role="option"
477
+ aria-selected="false"
478
+ aria-disabled="false"
479
+ id="syn-combobox-option-2"
480
+ >Option 3</syn-option
481
+ >
482
+ <syn-option
483
+ value="option-4"
484
+ role="option"
485
+ aria-selected="false"
486
+ aria-disabled="false"
487
+ id="syn-combobox-option-3"
488
+ >Option 4</syn-option
489
+ >
490
+ <syn-option
491
+ value="option-5"
492
+ role="option"
493
+ aria-selected="false"
494
+ aria-disabled="false"
495
+ id="syn-combobox-option-4"
496
+ >Option 5</syn-option
497
+ >
498
+ <syn-option
499
+ value="option-6"
500
+ role="option"
501
+ aria-selected="false"
502
+ aria-disabled="false"
503
+ id="syn-combobox-option-5"
504
+ >Option 6</syn-option
505
+ >
506
+ </syn-combobox>
507
+ ```
508
+
509
+ ---
510
+
511
+ ## Setting Initial Value
512
+
513
+ Use the value attribute to set the initial selection.When using multiple, the value attribute uses space-delimited values to select more than one option. Because of this, <syn-option> values cannot contain spaces. If you’re accessing the value property through Javascript, it will be an array.
514
+
515
+ ```html
516
+ <syn-combobox
517
+ value="option-1 option-2 option-3"
518
+ multiple=""
519
+ clearable=""
520
+ max-options-visible="2"
521
+ size="medium"
522
+ placement="bottom"
523
+ form=""
524
+ >
525
+ <syn-option
526
+ value="option-1"
527
+ role="option"
528
+ aria-selected="false"
529
+ aria-disabled="false"
530
+ id="syn-combobox-option-0"
531
+ >Option 1</syn-option
532
+ >
533
+ <syn-option
534
+ value="option-2"
535
+ role="option"
536
+ aria-selected="false"
537
+ aria-disabled="false"
538
+ id="syn-combobox-option-1"
539
+ >Option 2</syn-option
540
+ >
541
+ <syn-option
542
+ value="option-3"
543
+ role="option"
544
+ aria-selected="false"
545
+ aria-disabled="false"
546
+ id="syn-combobox-option-2"
547
+ >Option 3</syn-option
548
+ >
549
+ <syn-option
550
+ value="option-4"
551
+ role="option"
552
+ aria-selected="false"
553
+ aria-disabled="false"
554
+ id="syn-combobox-option-3"
555
+ >Option 4</syn-option
556
+ >
557
+ <syn-option
558
+ value="option-5"
559
+ role="option"
560
+ aria-selected="false"
561
+ aria-disabled="false"
562
+ id="syn-combobox-option-4"
563
+ >Option 5</syn-option
564
+ >
565
+ <syn-option
566
+ value="option-6"
567
+ role="option"
568
+ aria-selected="false"
569
+ aria-disabled="false"
570
+ id="syn-combobox-option-5"
571
+ >Option 6</syn-option
572
+ >
573
+ </syn-combobox>
574
+ ```
575
+
576
+ ---
577
+
444
578
  ## Restricted
445
579
 
446
580
  This restricts the combobox to only allow selections from the available options. Users cannot enter custom values that are not in the list.
package/package.json CHANGED
@@ -28,12 +28,12 @@
28
28
  "serve-handler": "^6.1.6",
29
29
  "ts-jest": "^29.4.6",
30
30
  "typescript": "^5.9.3",
31
- "@synergy-design-system/components": "3.1.0",
32
- "@synergy-design-system/docs": "0.1.0",
31
+ "@synergy-design-system/components": "3.2.0",
33
32
  "@synergy-design-system/fonts": "1.0.2",
34
33
  "@synergy-design-system/eslint-config-syn": "^0.1.0",
35
34
  "@synergy-design-system/styles": "2.0.0",
36
- "@synergy-design-system/tokens": "^3.1.0"
35
+ "@synergy-design-system/docs": "0.1.0",
36
+ "@synergy-design-system/tokens": "^3.2.0"
37
37
  },
38
38
  "exports": {
39
39
  ".": {
@@ -67,7 +67,7 @@
67
67
  "directory": "packages/mcp"
68
68
  },
69
69
  "type": "module",
70
- "version": "2.2.0",
70
+ "version": "2.3.0",
71
71
  "scripts": {
72
72
  "build": "pnpm run build:ts && pnpm run build:metadata && pnpm build:hash",
73
73
  "build:all": "pnpm run build && pnpm run build:storybook",