carbon-components-svelte 0.98.1 → 0.98.3

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.
Files changed (120) hide show
  1. package/package.json +1 -1
  2. package/src/Checkbox/Checkbox.svelte +1 -1
  3. package/src/Checkbox/InlineCheckbox.svelte +1 -1
  4. package/src/CodeSnippet/CodeSnippet.svelte +2 -2
  5. package/src/ComboBox/ComboBox.svelte +3 -4
  6. package/src/ContainedList/ContainedList.svelte +1 -1
  7. package/src/ContentSwitcher/Switch.svelte +1 -1
  8. package/src/ContextMenu/ContextMenuOption.svelte +1 -1
  9. package/src/DataTable/DataTable.svelte +3 -3
  10. package/src/DataTable/TableHeader.svelte +1 -1
  11. package/src/DatePicker/DatePicker.svelte +1 -1
  12. package/src/DatePicker/DatePickerInput.svelte +1 -1
  13. package/src/DatePicker/DatePickerSkeleton.svelte +1 -1
  14. package/src/Dropdown/Dropdown.svelte +1 -1
  15. package/src/FileUploader/FileUploaderButton.svelte +1 -1
  16. package/src/FileUploader/FileUploaderDropContainer.svelte +1 -1
  17. package/src/FileUploader/FileUploaderItem.svelte +1 -1
  18. package/src/FormLabel/FormLabel.svelte +1 -1
  19. package/src/ImageLoader/ImageLoader.svelte +2 -2
  20. package/src/ListBox/ListBoxField.svelte +1 -1
  21. package/src/ListBox/ListBoxMenu.svelte +1 -1
  22. package/src/Modal/Modal.svelte +1 -1
  23. package/src/MultiSelect/MultiSelect.svelte +2 -1
  24. package/src/Notification/InlineNotification.svelte +1 -1
  25. package/src/Notification/NotificationQueue.svelte +4 -4
  26. package/src/Notification/ToastNotification.svelte +1 -1
  27. package/src/NumberInput/NumberInput.svelte +1 -1
  28. package/src/OverflowMenu/OverflowMenu.svelte +6 -6
  29. package/src/OverflowMenu/OverflowMenuItem.svelte +1 -1
  30. package/src/Pagination/Pagination.svelte +1 -1
  31. package/src/ProgressBar/ProgressBar.svelte +2 -2
  32. package/src/ProgressIndicator/ProgressStep.svelte +1 -1
  33. package/src/RadioButton/RadioButton.svelte +1 -1
  34. package/src/Search/Search.svelte +1 -1
  35. package/src/Select/Select.svelte +1 -1
  36. package/src/Select/SelectItem.svelte +1 -1
  37. package/src/Slider/Slider.svelte +1 -1
  38. package/src/StructuredList/StructuredListInput.svelte +1 -1
  39. package/src/Tabs/Tab.svelte +1 -1
  40. package/src/Tabs/TabContent.svelte +1 -1
  41. package/src/Tag/Tag.svelte +1 -1
  42. package/src/TextArea/TextArea.svelte +1 -1
  43. package/src/TextInput/PasswordInput.svelte +1 -1
  44. package/src/TextInput/TextInput.svelte +1 -1
  45. package/src/Tile/ExpandableTile.svelte +1 -1
  46. package/src/Tile/RadioTile.svelte +1 -1
  47. package/src/Tile/SelectableTile.svelte +1 -1
  48. package/src/TimePicker/TimePicker.svelte +1 -1
  49. package/src/TimePicker/TimePickerSelect.svelte +1 -1
  50. package/src/Toggle/Toggle.svelte +1 -1
  51. package/src/Toggle/ToggleSkeleton.svelte +1 -1
  52. package/src/Tooltip/Tooltip.svelte +4 -4
  53. package/src/TooltipDefinition/TooltipDefinition.svelte +1 -1
  54. package/src/TooltipIcon/TooltipIcon.svelte +1 -1
  55. package/src/TreeView/TreeView.svelte +4 -9
  56. package/src/TreeView/TreeViewNode.svelte +3 -3
  57. package/src/UIShell/Header.svelte +2 -2
  58. package/src/UIShell/HeaderNavItem.svelte +1 -1
  59. package/types/Checkbox/Checkbox.svelte.d.ts +3 -1
  60. package/types/Checkbox/InlineCheckbox.svelte.d.ts +1 -1
  61. package/types/CodeSnippet/CodeSnippet.svelte.d.ts +1 -1
  62. package/types/ComboBox/ComboBox.svelte.d.ts +5 -2
  63. package/types/ContainedList/ContainedList.svelte.d.ts +5 -1
  64. package/types/ContainedList/ContainedListItem.svelte.d.ts +2 -0
  65. package/types/ContentSwitcher/Switch.svelte.d.ts +1 -1
  66. package/types/ContextMenu/ContextMenuOption.svelte.d.ts +3 -1
  67. package/types/DataTable/DataTable.svelte.d.ts +35 -1
  68. package/types/DataTable/TableHeader.svelte.d.ts +1 -1
  69. package/types/DataTable/ToolbarBatchActions.svelte.d.ts +2 -0
  70. package/types/DatePicker/DatePicker.svelte.d.ts +1 -1
  71. package/types/DatePicker/DatePickerInput.svelte.d.ts +3 -1
  72. package/types/DatePicker/DatePickerSkeleton.svelte.d.ts +1 -1
  73. package/types/Dropdown/Dropdown.svelte.d.ts +1 -1
  74. package/types/FileUploader/FileUploaderButton.svelte.d.ts +3 -1
  75. package/types/FileUploader/FileUploaderDropContainer.svelte.d.ts +3 -1
  76. package/types/FileUploader/FileUploaderItem.svelte.d.ts +1 -1
  77. package/types/FormLabel/FormLabel.svelte.d.ts +1 -1
  78. package/types/ImageLoader/ImageLoader.svelte.d.ts +2 -1
  79. package/types/ListBox/ListBoxField.svelte.d.ts +1 -1
  80. package/types/ListBox/ListBoxMenu.svelte.d.ts +1 -1
  81. package/types/Modal/Modal.svelte.d.ts +5 -1
  82. package/types/MultiSelect/MultiSelect.svelte.d.ts +3 -1
  83. package/types/Notification/InlineNotification.svelte.d.ts +7 -1
  84. package/types/Notification/NotificationQueue.svelte.d.ts +2 -0
  85. package/types/Notification/ToastNotification.svelte.d.ts +7 -1
  86. package/types/NumberInput/NumberInput.svelte.d.ts +3 -1
  87. package/types/OverflowMenu/OverflowMenu.svelte.d.ts +3 -1
  88. package/types/OverflowMenu/OverflowMenuItem.svelte.d.ts +1 -1
  89. package/types/Pagination/Pagination.svelte.d.ts +1 -1
  90. package/types/ProgressBar/ProgressBar.svelte.d.ts +3 -1
  91. package/types/ProgressIndicator/ProgressStep.svelte.d.ts +1 -1
  92. package/types/RadioButton/RadioButton.svelte.d.ts +3 -1
  93. package/types/RadioButtonGroup/RadioButtonGroup.svelte.d.ts +2 -0
  94. package/types/Search/Search.svelte.d.ts +3 -1
  95. package/types/Select/Select.svelte.d.ts +3 -1
  96. package/types/Slider/Slider.svelte.d.ts +3 -1
  97. package/types/StructuredList/StructuredListInput.svelte.d.ts +1 -1
  98. package/types/Tabs/Tab.svelte.d.ts +1 -1
  99. package/types/Tabs/TabContent.svelte.d.ts +1 -1
  100. package/types/Tabs/Tabs.svelte.d.ts +2 -0
  101. package/types/Tag/Tag.svelte.d.ts +1 -1
  102. package/types/TextArea/TextArea.svelte.d.ts +3 -1
  103. package/types/TextInput/PasswordInput.svelte.d.ts +3 -1
  104. package/types/TextInput/TextInput.svelte.d.ts +3 -1
  105. package/types/Tile/ExpandableTile.svelte.d.ts +5 -1
  106. package/types/Tile/RadioTile.svelte.d.ts +1 -1
  107. package/types/Tile/SelectableTile.svelte.d.ts +1 -1
  108. package/types/Tile/SelectableTileGroup.svelte.d.ts +2 -0
  109. package/types/Tile/TileGroup.svelte.d.ts +2 -0
  110. package/types/TimePicker/TimePicker.svelte.d.ts +3 -1
  111. package/types/TimePicker/TimePickerSelect.svelte.d.ts +3 -1
  112. package/types/Toggle/Toggle.svelte.d.ts +3 -1
  113. package/types/Toggle/ToggleSkeleton.svelte.d.ts +3 -1
  114. package/types/Tooltip/Tooltip.svelte.d.ts +2 -2
  115. package/types/TooltipDefinition/TooltipDefinition.svelte.d.ts +3 -1
  116. package/types/TooltipIcon/TooltipIcon.svelte.d.ts +1 -1
  117. package/types/TreeView/TreeView.svelte.d.ts +6 -2
  118. package/types/TreeView/TreeViewNode.svelte.d.ts +2 -1
  119. package/types/UIShell/Header.svelte.d.ts +6 -0
  120. package/types/UIShell/HeaderAction.svelte.d.ts +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-components-svelte",
3
- "version": "0.98.1",
3
+ "version": "0.98.3",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Svelte implementation of the Carbon Design System",
6
6
  "type": "module",
@@ -53,7 +53,7 @@
53
53
  export let title = undefined;
54
54
 
55
55
  /** Set an id for the input label */
56
- export let id = "ccs-" + Math.random().toString(36);
56
+ export let id = `ccs-${Math.random().toString(36)}`;
57
57
 
58
58
  /** Obtain a reference to the input HTML element */
59
59
  export let ref = null;
@@ -12,7 +12,7 @@
12
12
  export let title = undefined;
13
13
 
14
14
  /** Set an id for the input label */
15
- export let id = "ccs-" + Math.random().toString(36);
15
+ export let id = `ccs-${Math.random().toString(36)}`;
16
16
 
17
17
  /** Obtain a reference to the input HTML element */
18
18
  export let ref = null;
@@ -103,7 +103,7 @@
103
103
  export let showMoreLess = true;
104
104
 
105
105
  /** Set an id for the code element */
106
- export let id = "ccs-" + Math.random().toString(36);
106
+ export let id = `ccs-${Math.random().toString(36)}`;
107
107
 
108
108
  /** Obtain a reference to the pre HTML element */
109
109
  export let ref = null;
@@ -127,7 +127,7 @@
127
127
 
128
128
  $: expandText = expanded ? showLessText : showMoreText;
129
129
  $: minHeight = expanded ? 16 * 15 : 48;
130
- $: maxHeight = expanded ? "none" : 16 * 15 + "px";
130
+ $: maxHeight = expanded ? "none" : `${16 * 15}px`;
131
131
 
132
132
  // Show more/less only applies to multi-line code snippets
133
133
  $: if (type !== "multi") showMoreLess = false;
@@ -120,7 +120,7 @@
120
120
  export let translateWithIdSelection = undefined;
121
121
 
122
122
  /** Set an id for the list box component */
123
- export let id = "ccs-" + Math.random().toString(36);
123
+ export let id = `ccs-${Math.random().toString(36)}`;
124
124
 
125
125
  /**
126
126
  * Specify a name attribute for the input.
@@ -200,10 +200,9 @@
200
200
  }
201
201
 
202
202
  /**
203
- * Clear the combo box programmatically
203
+ * Clear the combo box programmatically.
204
+ * By default, focuses the combo box after clearing. Set `options.focus` to `false` to prevent focusing.
204
205
  * @type {(options?: { focus?: boolean; }) => Promise<void>}
205
- * @param {object} [options] - Configuration options for clearing
206
- * @param {boolean} [options.focus=true] - Whether to focus the combo box after clearing
207
206
  * @example
208
207
  * ```svelte
209
208
  * <ComboBox bind:this={comboBox} items={items} />
@@ -21,7 +21,7 @@
21
21
  export let inset = false;
22
22
 
23
23
  /** Set an id for the list element */
24
- export let id = "ccs-" + Math.random().toString(36);
24
+ export let id = `ccs-${Math.random().toString(36)}`;
25
25
 
26
26
  $: labelId = `label-${id}`;
27
27
  </script>
@@ -18,7 +18,7 @@
18
18
  export let disabled = false;
19
19
 
20
20
  /** Set an id for the button element */
21
- export let id = "ccs-" + Math.random().toString(36);
21
+ export let id = `ccs-${Math.random().toString(36)}`;
22
22
 
23
23
  /** Obtain a reference to the button HTML element */
24
24
  export let ref = null;
@@ -55,7 +55,7 @@
55
55
  * Specify the id.
56
56
  * It's recommended to provide an id as a value to bind to within a selectable/radio menu group.
57
57
  */
58
- export let id = "ccs-" + Math.random().toString(36);
58
+ export let id = `ccs-${Math.random().toString(36)}`;
59
59
 
60
60
  /** Obtain a reference to the list item HTML element */
61
61
  export let ref = null;
@@ -102,7 +102,7 @@
102
102
  * When the table is inside a form, this name will
103
103
  * be included in the form data on submit.
104
104
  */
105
- export let inputName = "ccs-" + Math.random().toString(36);
105
+ export let inputName = `ccs-${Math.random().toString(36)}`;
106
106
 
107
107
  /** Set to `true` to use zebra styles */
108
108
  export let zebra = false;
@@ -223,7 +223,7 @@
223
223
 
224
224
  // Internal ID prefix for radio buttons, checkboxes, etc.
225
225
  // since there may be multiple `DataTable` instances that have overlapping row ids.
226
- const id = "ccs-" + Math.random().toString(36);
226
+ const id = `ccs-${Math.random().toString(36)}`;
227
227
 
228
228
  // Store a copy of the original rows for filter restoration.
229
229
  $: originalRows = [...rows];
@@ -272,7 +272,7 @@
272
272
  return searchableKeys.some((key) => {
273
273
  const _value = resolvePath(row, key);
274
274
  if (typeof _value === "string" || typeof _value === "number") {
275
- return (_value + "")?.toLowerCase().includes(value);
275
+ return `${_value}`?.toLowerCase().includes(value);
276
276
  }
277
277
  return false;
278
278
  });
@@ -31,7 +31,7 @@
31
31
  export let translateWithId = (id) => defaultTranslations[id];
32
32
 
33
33
  /** Set an id for the top-level element */
34
- export let id = "ccs-" + Math.random().toString(36);
34
+ export let id = `ccs-${Math.random().toString(36)}`;
35
35
 
36
36
  import ArrowsVertical from "../icons/ArrowsVertical.svelte";
37
37
  import ArrowUp from "../icons/ArrowUp.svelte";
@@ -57,7 +57,7 @@
57
57
  export let light = false;
58
58
 
59
59
  /** Set an id for the date picker element */
60
- export let id = "ccs-" + Math.random().toString(36);
60
+ export let id = `ccs-${Math.random().toString(36)}`;
61
61
 
62
62
  /**
63
63
  * Override the options passed to the Flatpickr instance.
@@ -24,7 +24,7 @@
24
24
  export let iconDescription = "";
25
25
 
26
26
  /** Set an id for the input element */
27
- export let id = "ccs-" + Math.random().toString(36);
27
+ export let id = `ccs-${Math.random().toString(36)}`;
28
28
 
29
29
  /** Specify the label text */
30
30
  export let labelText = "";
@@ -3,7 +3,7 @@
3
3
  export let range = false;
4
4
 
5
5
  /** Set an id to be used by the label element */
6
- export let id = "ccs-" + Math.random().toString(36);
6
+ export let id = `ccs-${Math.random().toString(36)}`;
7
7
  </script>
8
8
 
9
9
  <!-- svelte-ignore a11y-mouse-events-have-key-events -->
@@ -95,7 +95,7 @@
95
95
  export let translateWithId = undefined;
96
96
 
97
97
  /** Set an id for the list box component */
98
- export let id = "ccs-" + Math.random().toString(36);
98
+ export let id = `ccs-${Math.random().toString(36)}`;
99
99
 
100
100
  /**
101
101
  * Specify a name attribute for the list box.
@@ -40,7 +40,7 @@
40
40
  export let labelText = "Add file";
41
41
 
42
42
  /** Set an id for the input element */
43
- export let id = "ccs-" + Math.random().toString(36);
43
+ export let id = `ccs-${Math.random().toString(36)}`;
44
44
 
45
45
  /** Specify a name attribute for the input */
46
46
  export let name = "";
@@ -39,7 +39,7 @@
39
39
  export let tabindex = "0";
40
40
 
41
41
  /** Set an id for the input element */
42
- export let id = "ccs-" + Math.random().toString(36);
42
+ export let id = `ccs-${Math.random().toString(36)}`;
43
43
 
44
44
  /** Specify a name attribute for the input */
45
45
  export let name = "";
@@ -28,7 +28,7 @@
28
28
  export let errorBody = "";
29
29
 
30
30
  /** Set an id for the top-level element */
31
- export let id = "ccs-" + Math.random().toString(36);
31
+ export let id = `ccs-${Math.random().toString(36)}`;
32
32
 
33
33
  /** Specify the file uploader name */
34
34
  export let name = "";
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  /** Set an id to be used by the label element */
3
- export let id = "ccs-" + Math.random().toString(36);
3
+ export let id = `ccs-${Math.random().toString(36)}`;
4
4
  </script>
5
5
 
6
6
  <!-- svelte-ignore a11y-mouse-events-have-key-events -->
@@ -42,9 +42,9 @@
42
42
  export let fadeIn = false;
43
43
 
44
44
  /**
45
- * Method invoked to load the image provided a `src` value
45
+ * Method invoked to load the image provided a `src` value.
46
+ * If no URL is provided, uses the component's `src` prop.
46
47
  * @type {(url?: string) => void}
47
- * @param {string} [url] - Optional URL to load. If not provided, uses the component's `src` prop
48
48
  * @example
49
49
  * ```svelte
50
50
  * <ImageLoader bind:this={loader} src="default.jpg" />
@@ -22,7 +22,7 @@
22
22
  export let translateWithId = (id) => defaultTranslations[id];
23
23
 
24
24
  /** Set an id for the top-level element */
25
- export let id = "ccs-" + Math.random().toString(36);
25
+ export let id = `ccs-${Math.random().toString(36)}`;
26
26
 
27
27
  /** Obtain a reference to the top-level HTML element */
28
28
  export let ref = null;
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  /** Set an id for the top-level element */
3
- export let id = "ccs-" + Math.random().toString(36);
3
+ export let id = `ccs-${Math.random().toString(36)}`;
4
4
 
5
5
  /** Obtain a reference to the HTML element */
6
6
  export let ref = null;
@@ -98,7 +98,7 @@
98
98
  export let preventCloseOnClickOutside = false;
99
99
 
100
100
  /** Set an id for the top-level element */
101
- export let id = "ccs-" + Math.random().toString(36);
101
+ export let id = `ccs-${Math.random().toString(36)}`;
102
102
 
103
103
  /** Obtain a reference to the top-level HTML element */
104
104
  export let ref = null;
@@ -145,7 +145,7 @@
145
145
  export let hideLabel = false;
146
146
 
147
147
  /** Set an id for the list box component */
148
- export let id = "ccs-" + Math.random().toString(36);
148
+ export let id = `ccs-${Math.random().toString(36)}`;
149
149
 
150
150
  /**
151
151
  * Specify a name attribute for the select.
@@ -546,6 +546,7 @@
546
546
  role="option"
547
547
  aria-labelledby="checkbox-{item.id}"
548
548
  aria-selected={item.checked}
549
+ aria-checked={item.checked}
549
550
  active={item.checked}
550
551
  highlighted={highlightedIndex === i}
551
552
  disabled={item.disabled}
@@ -32,7 +32,7 @@
32
32
  * Specify the ARIA label for the status icon.
33
33
  * @type {string}
34
34
  * */
35
- export let statusIconDescription = kind + " icon";
35
+ export let statusIconDescription = `${kind} icon`;
36
36
 
37
37
  /** Specify the ARIA label for the close button */
38
38
  export let closeButtonDescription = "Close notification";
@@ -52,8 +52,8 @@
52
52
  /**
53
53
  * Add a notification to the queue.
54
54
  * If a notification with the same id exists, the call is ignored.
55
- * @param {NotificationData} notification
56
- * @returns {string} The notification id
55
+ * Returns the notification id (either the provided id or a generated one).
56
+ * @type {(notification: NotificationData) => string}
57
57
  */
58
58
  export function add(notification) {
59
59
  const id = notification.id ?? generateId();
@@ -83,8 +83,8 @@
83
83
 
84
84
  /**
85
85
  * Remove a notification by id.
86
- * @param {string} id
87
- * @returns {boolean} True if the notification was found and removed
86
+ * Returns true if the notification was found and removed, false otherwise.
87
+ * @type {(id: string) => boolean}
88
88
  */
89
89
  export function remove(id) {
90
90
  const index = notifications.findIndex((n) => n.id === id);
@@ -32,7 +32,7 @@
32
32
  * Specify the ARIA label for the status icon.
33
33
  * @type {string}
34
34
  * */
35
- export let statusIconDescription = kind + " icon";
35
+ export let statusIconDescription = `${kind} icon`;
36
36
 
37
37
  /** Specify the ARIA label for the close button */
38
38
  export let closeButtonDescription = "Close notification";
@@ -97,7 +97,7 @@
97
97
  };
98
98
 
99
99
  /** Set an id for the input element */
100
- export let id = "ccs-" + Math.random().toString(36);
100
+ export let id = `ccs-${Math.random().toString(36)}`;
101
101
 
102
102
  /**
103
103
  * Specify a name attribute for the input.
@@ -48,7 +48,7 @@
48
48
  export let iconDescription = "Open and close list of options";
49
49
 
50
50
  /** Set an id for the button element */
51
- export let id = "ccs-" + Math.random().toString(36);
51
+ export let id = `ccs-${Math.random().toString(36)}`;
52
52
 
53
53
  /** Obtain a reference to the trigger button element */
54
54
  export let buttonRef = null;
@@ -170,14 +170,14 @@
170
170
 
171
171
  if (direction === "top") {
172
172
  menuRef.style.top = "auto";
173
- menuRef.style.bottom = height + "px";
173
+ menuRef.style.bottom = `${height}px`;
174
174
  } else if (direction === "bottom") {
175
- menuRef.style.top = height + "px";
175
+ menuRef.style.top = `${height}px`;
176
176
  }
177
177
 
178
178
  if (ctxBreadcrumbItem) {
179
- menuRef.style.top = height + 10 + "px";
180
- menuRef.style.left = -11 + "px";
179
+ menuRef.style.top = `${height + 10}px`;
180
+ menuRef.style.left = `${-11}px`;
181
181
  }
182
182
  }
183
183
 
@@ -198,7 +198,7 @@
198
198
  // Use CSS custom properties instead of dynamic style injection for better
199
199
  // performance. The previous approach created individual `style` tags per
200
200
  // instance, causing overhead when many OverflowMenu components are rendered.
201
- $: overflowMenuOptionsAfterWidth = buttonWidth ? buttonWidth + "px" : "2rem";
201
+ $: overflowMenuOptionsAfterWidth = buttonWidth ? `${buttonWidth}px` : "2rem";
202
202
  </script>
203
203
 
204
204
  <svelte:window
@@ -34,7 +34,7 @@
34
34
  export let requireTitle = true;
35
35
 
36
36
  /** Set an id for the top-level element */
37
- export let id = "ccs-" + Math.random().toString(36);
37
+ export let id = `ccs-${Math.random().toString(36)}`;
38
38
 
39
39
  /** Obtain a reference to the HTML element */
40
40
  export let ref = null;
@@ -94,7 +94,7 @@
94
94
  `of ${total.toLocaleString()} page${total === 1 ? "" : "s"}`;
95
95
 
96
96
  /** Set an id for the top-level element */
97
- export let id = "ccs-" + Math.random().toString(36);
97
+ export let id = `ccs-${Math.random().toString(36)}`;
98
98
 
99
99
  import { createEventDispatcher } from "svelte";
100
100
  import Button from "../Button/Button.svelte";
@@ -36,7 +36,7 @@
36
36
  export let helperText = "";
37
37
 
38
38
  /** Set an id for the progress bar element */
39
- export let id = "ccs-" + Math.random().toString(36);
39
+ export let id = `ccs-${Math.random().toString(36)}`;
40
40
 
41
41
  import CheckmarkFilled from "../icons/CheckmarkFilled.svelte";
42
42
  import ErrorFilled from "../icons/ErrorFilled.svelte";
@@ -46,7 +46,7 @@
46
46
  finished: CheckmarkFilled,
47
47
  };
48
48
 
49
- let helperId = "ccs-" + Math.random().toString(36);
49
+ let helperId = `ccs-${Math.random().toString(36)}`;
50
50
 
51
51
  $: indeterminate = value === undefined && status === "active";
52
52
  let capped;
@@ -21,7 +21,7 @@
21
21
  export let secondaryLabel = "";
22
22
 
23
23
  /** Set an id for the top-level element */
24
- export let id = "ccs-" + Math.random().toString(36);
24
+ export let id = `ccs-${Math.random().toString(36)}`;
25
25
 
26
26
  import { getContext, onMount } from "svelte";
27
27
  import CheckmarkOutline from "../icons/CheckmarkOutline.svelte";
@@ -27,7 +27,7 @@
27
27
  export let hideLabel = false;
28
28
 
29
29
  /** Set an id for the input element */
30
- export let id = "ccs-" + Math.random().toString(36);
30
+ export let id = `ccs-${Math.random().toString(36)}`;
31
31
 
32
32
  /**
33
33
  * Specify a name attribute for the radio button input.
@@ -60,7 +60,7 @@
60
60
  export let icon = IconSearch;
61
61
 
62
62
  /** Set an id for the input element */
63
- export let id = "ccs-" + Math.random().toString(36);
63
+ export let id = `ccs-${Math.random().toString(36)}`;
64
64
 
65
65
  /** Obtain a reference to the input HTML element */
66
66
  export let ref = null;
@@ -28,7 +28,7 @@
28
28
  export let disabled = false;
29
29
 
30
30
  /** Set an id for the select element */
31
- export let id = "ccs-" + Math.random().toString(36);
31
+ export let id = `ccs-${Math.random().toString(36)}`;
32
32
 
33
33
  /**
34
34
  * Specify a name attribute for the select element.
@@ -34,7 +34,7 @@
34
34
 
35
35
  import { getContext, onMount } from "svelte";
36
36
 
37
- const id = "ccs-" + Math.random().toString(36);
37
+ const id = `ccs-${Math.random().toString(36)}`;
38
38
  const ctx = getContext("Select") || getContext("TimePickerSelect");
39
39
 
40
40
  $: ctx?.setDefaultValue?.(id, value);
@@ -50,7 +50,7 @@
50
50
  export let fullWidth = false;
51
51
 
52
52
  /** Set an id for the slider div element */
53
- export let id = "ccs-" + Math.random().toString(36);
53
+ export let id = `ccs-${Math.random().toString(36)}`;
54
54
 
55
55
  /** Set to `true` to indicate an invalid state */
56
56
  export let invalid = false;
@@ -9,7 +9,7 @@
9
9
  export let value = "value";
10
10
 
11
11
  /** Set an id for the input element */
12
- export let id = "ccs-" + Math.random().toString(36);
12
+ export let id = `ccs-${Math.random().toString(36)}`;
13
13
 
14
14
  /** Specify a name attribute for the input */
15
15
  export let name = "";
@@ -21,7 +21,7 @@
21
21
  export let tabindex = "0";
22
22
 
23
23
  /** Set an id for the top-level element */
24
- export let id = "ccs-" + Math.random().toString(36);
24
+ export let id = `ccs-${Math.random().toString(36)}`;
25
25
 
26
26
  /** Obtain a reference to the anchor HTML element */
27
27
  export let ref = null;
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  /** Set an id for the top-level element */
3
- export let id = "ccs-" + Math.random().toString(36);
3
+ export let id = `ccs-${Math.random().toString(36)}`;
4
4
 
5
5
  import { getContext, onMount } from "svelte";
6
6
 
@@ -32,7 +32,7 @@
32
32
  export let icon = undefined;
33
33
 
34
34
  /** Set an id for the filterable tag */
35
- export let id = "ccs-" + Math.random().toString(36);
35
+ export let id = `ccs-${Math.random().toString(36)}`;
36
36
 
37
37
  import { createEventDispatcher } from "svelte";
38
38
  import Close from "../icons/Close.svelte";
@@ -56,7 +56,7 @@
56
56
  export let warnText = "";
57
57
 
58
58
  /** Set an id for the textarea element */
59
- export let id = "ccs-" + Math.random().toString(36);
59
+ export let id = `ccs-${Math.random().toString(36)}`;
60
60
 
61
61
  /**
62
62
  * Specify a name attribute for the input.
@@ -69,7 +69,7 @@
69
69
  export let inline = false;
70
70
 
71
71
  /** Set an id for the input element */
72
- export let id = "ccs-" + Math.random().toString(36);
72
+ export let id = `ccs-${Math.random().toString(36)}`;
73
73
 
74
74
  /**
75
75
  * Specify a name attribute for the input.
@@ -31,7 +31,7 @@
31
31
  export let helperText = "";
32
32
 
33
33
  /** Set an id for the input element */
34
- export let id = "ccs-" + Math.random().toString(36);
34
+ export let id = `ccs-${Math.random().toString(36)}`;
35
35
 
36
36
  /**
37
37
  * Specify a name attribute for the input.
@@ -27,7 +27,7 @@
27
27
  export let tabindex = "0";
28
28
 
29
29
  /** Set an id for the top-level div element */
30
- export let id = "ccs-" + Math.random().toString(36);
30
+ export let id = `ccs-${Math.random().toString(36)}`;
31
31
 
32
32
  /** Obtain a reference to the top-level element */
33
33
  export let ref = null;
@@ -25,7 +25,7 @@
25
25
  export let iconDescription = "Tile checkmark";
26
26
 
27
27
  /** Set an id for the input element */
28
- export let id = "ccs-" + Math.random().toString(36);
28
+ export let id = `ccs-${Math.random().toString(36)}`;
29
29
 
30
30
  /**
31
31
  * Specify a name attribute for the radio tile input.
@@ -26,7 +26,7 @@
26
26
  export let iconDescription = "Tile checkmark";
27
27
 
28
28
  /** Set an id for the input element */
29
- export let id = "ccs-" + Math.random().toString(36);
29
+ export let id = `ccs-${Math.random().toString(36)}`;
30
30
 
31
31
  /**
32
32
  * Specify a name attribute for the input.
@@ -39,7 +39,7 @@
39
39
  export let invalidText = "";
40
40
 
41
41
  /** Set an id for the input element */
42
- export let id = "ccs-" + Math.random().toString(36);
42
+ export let id = `ccs-${Math.random().toString(36)}`;
43
43
 
44
44
  /**
45
45
  * Specify a name attribute for the input.
@@ -15,7 +15,7 @@
15
15
  export let labelText = "";
16
16
 
17
17
  /** Set an id for the select element */
18
- export let id = "ccs-" + Math.random().toString(36);
18
+ export let id = `ccs-${Math.random().toString(36)}`;
19
19
 
20
20
  /**
21
21
  * Specify a name attribute for the select element.
@@ -28,7 +28,7 @@
28
28
  export let hideLabel = false;
29
29
 
30
30
  /** Set an id for the input element */
31
- export let id = "ccs-" + Math.random().toString(36);
31
+ export let id = `ccs-${Math.random().toString(36)}`;
32
32
 
33
33
  /**
34
34
  * Specify a name attribute for the checkbox input.
@@ -9,7 +9,7 @@
9
9
  export let labelText = "";
10
10
 
11
11
  /** Set an id for the input element */
12
- export let id = "ccs-" + Math.random().toString(36);
12
+ export let id = `ccs-${Math.random().toString(36)}`;
13
13
  </script>
14
14
 
15
15
  <!-- svelte-ignore a11y-mouse-events-have-key-events -->