carbon-components-svelte 0.108.1 → 0.110.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.
Files changed (500) hide show
  1. package/README.md +160 -44
  2. package/css/_badge-indicator.scss +48 -0
  3. package/css/_box.scss +71 -0
  4. package/css/_breadcrumb.scss +19 -2
  5. package/css/_checkbox-readonly.scss +0 -7
  6. package/css/_code-snippet.scss +46 -0
  7. package/css/_combo-button.scss +50 -0
  8. package/css/_combobox-readonly.scss +0 -6
  9. package/css/_contained-list.scss +3 -21
  10. package/css/_content-switcher-low-contrast.scss +128 -0
  11. package/css/_content-switcher.scss +65 -0
  12. package/css/_copy-button.scss +68 -0
  13. package/css/_copy-input.scss +120 -0
  14. package/css/_data-table-highlighted-row.scss +55 -0
  15. package/css/_data-table-sticky-column-menu.scss +28 -0
  16. package/css/_data-table-toolbar.scss +146 -0
  17. package/css/_data-table-zebra-hidden.scss +24 -0
  18. package/css/_datepicker.scss +71 -2
  19. package/css/_dialog.scss +47 -0
  20. package/css/_disclosure.scss +132 -0
  21. package/css/_dropdown-readonly.scss +0 -6
  22. package/css/_fluid-combo-box.scss +67 -0
  23. package/css/_fluid-date-picker.scss +336 -0
  24. package/css/_fluid-list-box.scss +344 -0
  25. package/css/_fluid-multiselect.scss +51 -0
  26. package/css/_fluid-number-input.scss +423 -0
  27. package/css/_fluid-pin-code-input.scss +222 -0
  28. package/css/_fluid-search.scss +118 -0
  29. package/css/_fluid-select.scss +188 -0
  30. package/css/_fluid-text-area.scss +217 -0
  31. package/css/_fluid-text-input.scss +211 -0
  32. package/css/_fluid-time-picker.scss +398 -0
  33. package/css/_icon-indicator.scss +130 -0
  34. package/css/_link.scss +57 -0
  35. package/css/_list-box-menu-item.scss +41 -0
  36. package/css/_list-box-xs.scss +45 -0
  37. package/css/_menu-button.scss +30 -0
  38. package/css/_menu-xs.scss +17 -0
  39. package/css/_modal-full-width.scss +17 -0
  40. package/css/_multiselect-readonly.scss +0 -6
  41. package/css/_multiselect.scss +3 -8
  42. package/css/_number-input.scss +1 -2
  43. package/css/_overflow-menu.scss +68 -0
  44. package/css/_pagination.scss +32 -0
  45. package/css/_pin-code-input.scss +112 -0
  46. package/css/_popover.scss +1 -26
  47. package/css/_profile-menu.scss +238 -0
  48. package/css/_radiobutton-readonly.scss +0 -6
  49. package/css/_search-menu.scss +240 -0
  50. package/css/_search.scss +41 -0
  51. package/css/_select-readonly.scss +0 -6
  52. package/css/_select.scss +21 -0
  53. package/css/_shape-indicator.scss +130 -0
  54. package/css/_slider.scss +1 -15
  55. package/css/_spacing-scale.scss +17 -0
  56. package/css/_stack.scss +13 -68
  57. package/css/_tabs.scss +847 -2
  58. package/css/_tag-set.scss +65 -0
  59. package/css/_tag.scss +13 -0
  60. package/css/_text-area-readonly.scss +0 -6
  61. package/css/_text-area-warn.scss +0 -7
  62. package/css/_text-input.scss +26 -0
  63. package/css/_toggle-readonly.scss +0 -6
  64. package/css/_toggletip.scss +93 -0
  65. package/css/_tooltip.scss +11 -4
  66. package/css/_truncate-multiline.scss +24 -0
  67. package/css/_type.scss +71 -0
  68. package/css/_ui-shell-classic.scss +8 -3
  69. package/css/_ui-shell.scss +86 -50
  70. package/css/_user-avatar-group.scss +67 -0
  71. package/css/_user-avatar.scss +119 -0
  72. package/css/all.css +1 -1
  73. package/css/all.scss +50 -14
  74. package/css/css.d.ts +2 -2
  75. package/css/g10.css +1 -1
  76. package/css/g10.scss +48 -3
  77. package/css/g100.css +1 -1
  78. package/css/g100.scss +48 -3
  79. package/css/g80.css +1 -1
  80. package/css/g80.scss +48 -3
  81. package/css/g90.css +1 -1
  82. package/css/g90.scss +48 -3
  83. package/css/white.css +1 -1
  84. package/css/white.scss +48 -3
  85. package/package.json +1 -1
  86. package/src/Accordion/AccordionItem.svelte +7 -3
  87. package/src/Accordion/AccordionItem.svelte.d.ts +13 -9
  88. package/src/AspectRatio/AspectRatio.svelte.d.ts +1 -10
  89. package/src/BadgeIndicator/BadgeIndicator.svelte +37 -0
  90. package/src/BadgeIndicator/BadgeIndicator.svelte.d.ts +31 -0
  91. package/src/BadgeIndicator/index.js +1 -0
  92. package/src/Box/Box.svelte +150 -0
  93. package/src/Box/Box.svelte.d.ts +100 -0
  94. package/src/Box/index.js +1 -0
  95. package/src/Breadcrumb/BreadcrumbItem.svelte.d.ts +12 -5
  96. package/src/Breakpoint/Breakpoint.svelte.d.ts +13 -8
  97. package/src/Breakpoint/breakpointObserver.d.ts +10 -0
  98. package/src/Breakpoint/breakpointObserver.js +53 -44
  99. package/src/Breakpoint/hideAtBreakpoint.d.ts +24 -0
  100. package/src/Breakpoint/hideAtBreakpoint.js +46 -0
  101. package/src/Breakpoint/index.d.ts +1 -0
  102. package/src/Breakpoint/index.js +1 -0
  103. package/src/Button/Button.svelte +308 -54
  104. package/src/Button/Button.svelte.d.ts +36 -36
  105. package/src/Checkbox/Checkbox.svelte +6 -3
  106. package/src/Checkbox/Checkbox.svelte.d.ts +1 -2
  107. package/src/Checkbox/CheckboxGroup.svelte +2 -2
  108. package/src/Checkbox/CheckboxGroup.svelte.d.ts +12 -11
  109. package/src/CodeSnippet/CodeSnippet.svelte +89 -22
  110. package/src/CodeSnippet/CodeSnippet.svelte.d.ts +32 -11
  111. package/src/ComboBox/ComboBox.svelte +334 -104
  112. package/src/ComboBox/ComboBox.svelte.d.ts +78 -32
  113. package/src/ComboBox/FluidComboBoxSkeleton.svelte +16 -0
  114. package/src/ComboBox/FluidComboBoxSkeleton.svelte.d.ts +21 -0
  115. package/src/ComboBox/index.js +1 -0
  116. package/src/ComboButton/ComboButton.svelte +196 -0
  117. package/src/ComboButton/ComboButton.svelte.d.ts +106 -0
  118. package/src/ComboButton/index.js +1 -0
  119. package/src/ComposedModal/ComposedModal.svelte +26 -29
  120. package/src/ComposedModal/ComposedModal.svelte.d.ts +10 -4
  121. package/src/ComposedModal/ModalFooter.svelte +1 -1
  122. package/src/ComposedModal/ModalFooter.svelte.d.ts +3 -7
  123. package/src/ContainedList/ContainedListItem.svelte.d.ts +4 -1
  124. package/src/ContentSwitcher/ContentSwitcher.svelte +39 -39
  125. package/src/ContentSwitcher/ContentSwitcher.svelte.d.ts +13 -9
  126. package/src/ContentSwitcher/Switch.svelte +109 -16
  127. package/src/ContentSwitcher/Switch.svelte.d.ts +23 -9
  128. package/src/ContextMenu/ContextMenu.svelte +39 -25
  129. package/src/ContextMenu/ContextMenu.svelte.d.ts +4 -2
  130. package/src/ContextMenu/ContextMenuGroup.svelte +4 -4
  131. package/src/ContextMenu/ContextMenuOption.svelte +8 -3
  132. package/src/ContextMenu/ContextMenuOption.svelte.d.ts +11 -15
  133. package/src/ContextMenu/ContextMenuRadioGroup.svelte +4 -4
  134. package/src/CopyButton/CopyButton.svelte +162 -23
  135. package/src/CopyButton/CopyButton.svelte.d.ts +40 -6
  136. package/src/CopyInput/CopyInput.svelte +270 -0
  137. package/src/CopyInput/CopyInput.svelte.d.ts +178 -0
  138. package/src/CopyInput/CopyInputSkeleton.svelte +20 -0
  139. package/src/CopyInput/CopyInputSkeleton.svelte.d.ts +27 -0
  140. package/src/CopyInput/FluidCopyInputSkeleton.svelte +14 -0
  141. package/src/CopyInput/FluidCopyInputSkeleton.svelte.d.ts +21 -0
  142. package/src/CopyInput/index.js +3 -0
  143. package/src/DataTable/DataTable.svelte +188 -37
  144. package/src/DataTable/DataTable.svelte.d.ts +163 -153
  145. package/src/DataTable/DataTableSkeleton.svelte.d.ts +1 -3
  146. package/src/DataTable/TableHeader.svelte.d.ts +2 -7
  147. package/src/DataTable/Toolbar.svelte +28 -7
  148. package/src/DataTable/Toolbar.svelte.d.ts +4 -2
  149. package/src/DataTable/ToolbarBatchActions.svelte.d.ts +5 -6
  150. package/src/DataTable/ToolbarMenuItem.svelte.d.ts +4 -1
  151. package/src/DataTable/ToolbarSearch.svelte.d.ts +7 -16
  152. package/src/DatePicker/DatePicker.svelte +228 -67
  153. package/src/DatePicker/DatePicker.svelte.d.ts +33 -13
  154. package/src/DatePicker/DatePickerInput.svelte +6 -0
  155. package/src/DatePicker/FluidDatePickerSkeleton.svelte +32 -0
  156. package/src/DatePicker/FluidDatePickerSkeleton.svelte.d.ts +27 -0
  157. package/src/DatePicker/createCalendar.d.ts +1 -1
  158. package/src/DatePicker/createCalendar.js +26 -4
  159. package/src/DatePicker/datePickerTopLayer.d.ts +1 -0
  160. package/src/DatePicker/datePickerTopLayer.js +6 -1
  161. package/src/DatePicker/flatpickr-monthSelectPlugin.d.ts +11 -0
  162. package/src/DatePicker/index.js +1 -0
  163. package/src/Dialog/Dialog.svelte +73 -0
  164. package/src/Dialog/Dialog.svelte.d.ts +36 -0
  165. package/src/Dialog/index.js +1 -0
  166. package/src/Disclosure/Disclosure.svelte +84 -0
  167. package/src/Disclosure/Disclosure.svelte.d.ts +58 -0
  168. package/src/Disclosure/index.js +1 -0
  169. package/src/Dropdown/Dropdown.svelte +253 -87
  170. package/src/Dropdown/Dropdown.svelte.d.ts +69 -25
  171. package/src/Dropdown/FluidDropdownSkeleton.svelte +16 -0
  172. package/src/Dropdown/FluidDropdownSkeleton.svelte.d.ts +21 -0
  173. package/src/Dropdown/index.js +1 -0
  174. package/src/FileUploader/FileUploader.svelte +25 -15
  175. package/src/FileUploader/FileUploader.svelte.d.ts +29 -32
  176. package/src/FileUploader/FileUploaderButton.svelte.d.ts +3 -9
  177. package/src/FileUploader/FileUploaderDropContainer.svelte +18 -5
  178. package/src/FileUploader/FileUploaderDropContainer.svelte.d.ts +5 -2
  179. package/src/FileUploader/FileUploaderItem.svelte.d.ts +2 -5
  180. package/src/FileUploader/FileUploaderSkeleton.svelte +12 -2
  181. package/src/FileUploader/FileUploaderSkeleton.svelte.d.ts +12 -0
  182. package/src/FileUploader/Filename.svelte.d.ts +6 -8
  183. package/src/FluidForm/FluidForm.svelte.d.ts +3 -3
  184. package/src/Grid/Column.svelte.d.ts +19 -10
  185. package/src/Grid/Grid.svelte.d.ts +19 -10
  186. package/src/Grid/Row.svelte.d.ts +19 -10
  187. package/src/Heading/Section.svelte.d.ts +18 -18
  188. package/src/IconIndicator/IconIndicator.svelte +62 -0
  189. package/src/IconIndicator/IconIndicator.svelte.d.ts +36 -0
  190. package/src/IconIndicator/index.js +1 -0
  191. package/src/ImageLoader/ImageLoader.svelte +2 -2
  192. package/src/ImageLoader/ImageLoader.svelte.d.ts +14 -8
  193. package/src/InlineLoading/InlineLoading.svelte +7 -9
  194. package/src/Link/Link.svelte +10 -2
  195. package/src/Link/Link.svelte.d.ts +14 -5
  196. package/src/ListBox/ListBox.svelte +2 -2
  197. package/src/ListBox/ListBox.svelte.d.ts +5 -2
  198. package/src/ListBox/ListBoxField.svelte +4 -3
  199. package/src/ListBox/ListBoxField.svelte.d.ts +3 -3
  200. package/src/ListBox/ListBoxMenu.svelte +2 -0
  201. package/src/ListBox/ListBoxMenu.svelte.d.ts +4 -1
  202. package/src/ListBox/ListBoxMenuIcon.svelte.d.ts +1 -1
  203. package/src/ListBox/ListBoxMenuItem.svelte +16 -5
  204. package/src/ListBox/ListBoxMenuItem.svelte.d.ts +6 -0
  205. package/src/ListBox/ListBoxSelection.svelte +1 -0
  206. package/src/ListBox/ListBoxSelection.svelte.d.ts +1 -1
  207. package/src/ListBox/list-box-utils.d.ts +25 -1
  208. package/src/ListBox/list-box-utils.js +34 -2
  209. package/src/Loading/Loading.svelte.d.ts +1 -5
  210. package/src/LocalStorage/LocalStorage.svelte +59 -25
  211. package/src/LocalStorage/LocalStorage.svelte.d.ts +19 -12
  212. package/src/Menu/Menu.svelte +215 -0
  213. package/src/Menu/Menu.svelte.d.ts +131 -0
  214. package/src/Menu/MenuDivider.svelte +1 -0
  215. package/src/Menu/MenuDivider.svelte.d.ts +9 -0
  216. package/src/Menu/MenuItem.svelte +206 -0
  217. package/src/Menu/MenuItem.svelte.d.ts +61 -0
  218. package/src/Menu/index.js +3 -0
  219. package/src/MenuButton/MenuButton.svelte +142 -0
  220. package/src/MenuButton/MenuButton.svelte.d.ts +78 -0
  221. package/src/MenuButton/index.js +1 -0
  222. package/src/Modal/Modal.svelte +23 -15
  223. package/src/Modal/Modal.svelte.d.ts +13 -8
  224. package/src/MultiSelect/FluidMultiSelectSkeleton.svelte +16 -0
  225. package/src/MultiSelect/FluidMultiSelectSkeleton.svelte.d.ts +21 -0
  226. package/src/MultiSelect/MultiSelect.svelte +322 -142
  227. package/src/MultiSelect/MultiSelect.svelte.d.ts +53 -35
  228. package/src/MultiSelect/index.js +1 -0
  229. package/src/Notification/InlineNotification.svelte.d.ts +3 -9
  230. package/src/Notification/NotificationButton.svelte.d.ts +3 -9
  231. package/src/Notification/NotificationIcon.svelte.d.ts +1 -7
  232. package/src/Notification/NotificationQueue.svelte.d.ts +1 -7
  233. package/src/Notification/ToastNotification.svelte.d.ts +3 -9
  234. package/src/NumberInput/FluidNumberInputSkeleton.svelte +14 -0
  235. package/src/NumberInput/FluidNumberInputSkeleton.svelte.d.ts +21 -0
  236. package/src/NumberInput/NumberInput.svelte +56 -21
  237. package/src/NumberInput/NumberInput.svelte.d.ts +29 -25
  238. package/src/NumberInput/index.js +1 -0
  239. package/src/OverflowMenu/OverflowMenu.svelte +71 -49
  240. package/src/OverflowMenu/OverflowMenu.svelte.d.ts +30 -39
  241. package/src/OverflowMenu/OverflowMenuItem.svelte +69 -35
  242. package/src/OverflowMenu/OverflowMenuItem.svelte.d.ts +45 -12
  243. package/src/Pagination/Pagination.svelte +51 -10
  244. package/src/Pagination/Pagination.svelte.d.ts +34 -12
  245. package/src/Pagination/PaginationSkeleton.svelte +9 -0
  246. package/src/Pagination/PaginationSkeleton.svelte.d.ts +6 -0
  247. package/src/PaginationNav/PaginationNav.svelte +1 -1
  248. package/src/PaginationNav/PaginationNav.svelte.d.ts +6 -6
  249. package/src/PaginationNav/PaginationOverflow.svelte +1 -1
  250. package/src/PinCodeInput/FluidPinCodeInputSkeleton.svelte +14 -0
  251. package/src/PinCodeInput/FluidPinCodeInputSkeleton.svelte.d.ts +21 -0
  252. package/src/PinCodeInput/PinCodeInput.svelte +517 -0
  253. package/src/PinCodeInput/PinCodeInput.svelte.d.ts +226 -0
  254. package/src/PinCodeInput/PinCodeInputSkeleton.svelte +20 -0
  255. package/src/PinCodeInput/PinCodeInputSkeleton.svelte.d.ts +27 -0
  256. package/src/PinCodeInput/index.js +3 -0
  257. package/src/Popover/Popover.svelte +15 -6
  258. package/src/Popover/Popover.svelte.d.ts +6 -15
  259. package/src/Portal/FloatingPortal.svelte +109 -215
  260. package/src/Portal/FloatingPortal.svelte.d.ts +19 -9
  261. package/src/Portal/PortalTooltip.svelte +1 -0
  262. package/src/Portal/iconTooltipPortalGaps.d.ts +14 -0
  263. package/src/Portal/iconTooltipPortalGaps.js +41 -0
  264. package/src/ProgressIndicator/ProgressIndicator.svelte +6 -6
  265. package/src/ProgressIndicator/ProgressIndicator.svelte.d.ts +15 -18
  266. package/src/ProgressIndicator/ProgressIndicatorSkeleton.svelte.d.ts +1 -2
  267. package/src/ProgressIndicator/ProgressStep.svelte.d.ts +3 -11
  268. package/src/RadioButton/RadioButton.svelte.d.ts +2 -5
  269. package/src/RadioButtonGroup/RadioButtonGroup.svelte +6 -14
  270. package/src/RadioButtonGroup/RadioButtonGroup.svelte.d.ts +19 -19
  271. package/src/RecursiveList/RecursiveList.svelte.d.ts +2 -6
  272. package/src/Search/FluidSearchSkeleton.svelte +14 -0
  273. package/src/Search/FluidSearchSkeleton.svelte.d.ts +21 -0
  274. package/src/Search/Search.svelte +20 -3
  275. package/src/Search/Search.svelte.d.ts +11 -6
  276. package/src/Search/SearchSkeleton.svelte +8 -2
  277. package/src/Search/SearchSkeleton.svelte.d.ts +7 -1
  278. package/src/Search/index.js +1 -0
  279. package/src/SearchMenu/SearchMenu.svelte +462 -0
  280. package/src/SearchMenu/SearchMenu.svelte.d.ts +190 -0
  281. package/src/SearchMenu/SearchMenuGroup.svelte +72 -0
  282. package/src/SearchMenu/SearchMenuGroup.svelte.d.ts +43 -0
  283. package/src/SearchMenu/SearchMenuItem.svelte +205 -0
  284. package/src/SearchMenu/SearchMenuItem.svelte.d.ts +105 -0
  285. package/src/SearchMenu/SearchMenuSkeleton.svelte +31 -0
  286. package/src/SearchMenu/SearchMenuSkeleton.svelte.d.ts +33 -0
  287. package/src/SearchMenu/index.js +4 -0
  288. package/src/Select/FluidSelectSkeleton.svelte +14 -0
  289. package/src/Select/FluidSelectSkeleton.svelte.d.ts +21 -0
  290. package/src/Select/Select.svelte +61 -16
  291. package/src/Select/Select.svelte.d.ts +18 -11
  292. package/src/Select/SelectItem.svelte +8 -2
  293. package/src/Select/SelectItem.svelte.d.ts +1 -3
  294. package/src/Select/index.js +1 -0
  295. package/src/SessionStorage/SessionStorage.svelte +59 -25
  296. package/src/SessionStorage/SessionStorage.svelte.d.ts +19 -12
  297. package/src/ShapeIndicator/ShapeIndicator.svelte +57 -0
  298. package/src/ShapeIndicator/ShapeIndicator.svelte.d.ts +36 -0
  299. package/src/ShapeIndicator/ShapeIndicatorIncomplete.svelte +37 -0
  300. package/src/ShapeIndicator/ShapeIndicatorIncomplete.svelte.d.ts +26 -0
  301. package/src/ShapeIndicator/index.js +1 -0
  302. package/src/SkeletonIcon/SkeletonIcon.svelte.d.ts +1 -1
  303. package/src/SkeletonText/SkeletonText.svelte +1 -1
  304. package/src/Slider/RangeSlider.svelte +18 -12
  305. package/src/Slider/RangeSlider.svelte.d.ts +14 -8
  306. package/src/Slider/Slider.svelte +25 -14
  307. package/src/Slider/Slider.svelte.d.ts +5 -5
  308. package/src/Stack/Stack.svelte +9 -0
  309. package/src/Stack/Stack.svelte.d.ts +9 -22
  310. package/src/StructuredList/StructuredList.svelte +36 -8
  311. package/src/StructuredList/StructuredList.svelte.d.ts +33 -17
  312. package/src/StructuredList/StructuredListInput.svelte +6 -2
  313. package/src/StructuredList/StructuredListInput.svelte.d.ts +3 -9
  314. package/src/StructuredList/StructuredListRow.svelte +23 -4
  315. package/src/StructuredList/StructuredListSkeleton.svelte.d.ts +1 -2
  316. package/src/Tabs/Tab.svelte +170 -16
  317. package/src/Tabs/Tab.svelte.d.ts +29 -10
  318. package/src/Tabs/Tabs.svelte +195 -64
  319. package/src/Tabs/Tabs.svelte.d.ts +51 -27
  320. package/src/Tabs/TabsSkeleton.svelte +1 -1
  321. package/src/Tabs/TabsVertical.svelte +357 -0
  322. package/src/Tabs/TabsVertical.svelte.d.ts +69 -0
  323. package/src/Tabs/TabsVerticalSkeleton.svelte +27 -0
  324. package/src/Tabs/TabsVerticalSkeleton.svelte.d.ts +27 -0
  325. package/src/Tabs/index.js +2 -0
  326. package/src/Tag/SelectableTag.svelte.d.ts +6 -19
  327. package/src/Tag/Tag.svelte +88 -18
  328. package/src/Tag/Tag.svelte.d.ts +18 -20
  329. package/src/TagSet/TagSet.svelte +237 -0
  330. package/src/TagSet/TagSet.svelte.d.ts +117 -0
  331. package/src/TagSet/TagSetOverflow.svelte +69 -0
  332. package/src/TagSet/TagSetOverflow.svelte.d.ts +60 -0
  333. package/src/TagSet/index.js +1 -0
  334. package/src/Text/Text.svelte +114 -0
  335. package/src/Text/Text.svelte.d.ts +90 -0
  336. package/src/Text/index.js +1 -0
  337. package/src/TextArea/FluidTextAreaSkeleton.svelte +14 -0
  338. package/src/TextArea/FluidTextAreaSkeleton.svelte.d.ts +21 -0
  339. package/src/TextArea/TextArea.svelte +56 -14
  340. package/src/TextArea/TextArea.svelte.d.ts +8 -0
  341. package/src/TextArea/index.js +1 -0
  342. package/src/TextInput/FluidTextInputSkeleton.svelte +14 -0
  343. package/src/TextInput/FluidTextInputSkeleton.svelte.d.ts +21 -0
  344. package/src/TextInput/PasswordInput.svelte +90 -65
  345. package/src/TextInput/PasswordInput.svelte.d.ts +16 -1
  346. package/src/TextInput/PasswordInputSkeleton.svelte +20 -0
  347. package/src/TextInput/PasswordInputSkeleton.svelte.d.ts +27 -0
  348. package/src/TextInput/TextInput.svelte +39 -25
  349. package/src/TextInput/TextInput.svelte.d.ts +10 -1
  350. package/src/TextInput/index.js +2 -0
  351. package/src/Theme/Theme.svelte +13 -11
  352. package/src/Theme/Theme.svelte.d.ts +6 -15
  353. package/src/Tile/ExpandableTile.svelte +5 -1
  354. package/src/Tile/ExpandableTile.svelte.d.ts +6 -1
  355. package/src/Tile/RadioTile.svelte.d.ts +2 -8
  356. package/src/Tile/SelectableTileGroup.svelte +6 -6
  357. package/src/Tile/SelectableTileGroup.svelte.d.ts +23 -17
  358. package/src/Tile/TileGroup.svelte +4 -4
  359. package/src/Tile/TileGroup.svelte.d.ts +15 -15
  360. package/src/TimePicker/FluidTimePickerSkeleton.svelte +25 -0
  361. package/src/TimePicker/FluidTimePickerSkeleton.svelte.d.ts +27 -0
  362. package/src/TimePicker/TimePicker.svelte +198 -81
  363. package/src/TimePicker/TimePicker.svelte.d.ts +16 -1
  364. package/src/TimePicker/TimePickerSelect.svelte +131 -56
  365. package/src/TimePicker/TimePickerSelect.svelte.d.ts +4 -1
  366. package/src/TimePicker/index.js +1 -0
  367. package/src/Toggletip/Toggletip.svelte +294 -0
  368. package/src/Toggletip/Toggletip.svelte.d.ts +85 -0
  369. package/src/Toggletip/ToggletipFooter.svelte +3 -0
  370. package/src/Toggletip/ToggletipFooter.svelte.d.ts +18 -0
  371. package/src/Toggletip/index.js +2 -0
  372. package/src/Tooltip/Tooltip.svelte +12 -1
  373. package/src/Tooltip/Tooltip.svelte.d.ts +5 -2
  374. package/src/Tooltip/TooltipFooter.svelte +12 -4
  375. package/src/TooltipDefinition/TooltipDefinition.svelte +5 -6
  376. package/src/TooltipDefinition/TooltipDefinition.svelte.d.ts +4 -1
  377. package/src/TooltipIcon/TooltipIcon.svelte +5 -5
  378. package/src/TooltipIcon/TooltipIcon.svelte.d.ts +6 -7
  379. package/src/TreeView/TreeView.svelte +70 -9
  380. package/src/TreeView/TreeView.svelte.d.ts +94 -69
  381. package/src/TreeView/TreeViewNode.svelte +11 -12
  382. package/src/TreeView/TreeViewNode.svelte.d.ts +24 -30
  383. package/src/TreeView/TreeViewNodeList.svelte +19 -16
  384. package/src/TreeView/TreeViewNodeList.svelte.d.ts +7 -18
  385. package/src/Truncate/Truncate.svelte +21 -3
  386. package/src/Truncate/Truncate.svelte.d.ts +7 -0
  387. package/src/Truncate/truncate.d.ts +4 -2
  388. package/src/Truncate/truncate.js +21 -10
  389. package/src/UIShell/HamburgerMenu.svelte.d.ts +1 -5
  390. package/src/UIShell/Header.svelte.d.ts +11 -12
  391. package/src/UIShell/HeaderAction.svelte +17 -12
  392. package/src/UIShell/HeaderAction.svelte.d.ts +16 -15
  393. package/src/UIShell/HeaderActionLink.svelte.d.ts +1 -5
  394. package/src/UIShell/HeaderGlobalAction.svelte +12 -3
  395. package/src/UIShell/HeaderGlobalAction.svelte.d.ts +4 -4
  396. package/src/UIShell/HeaderNavItem.svelte +19 -2
  397. package/src/UIShell/HeaderNavItem.svelte.d.ts +15 -5
  398. package/src/UIShell/HeaderNavMenu.svelte +34 -22
  399. package/src/UIShell/HeaderNavMenu.svelte.d.ts +8 -2
  400. package/src/UIShell/HeaderSearch.svelte +285 -16
  401. package/src/UIShell/HeaderSearch.svelte.d.ts +107 -14
  402. package/src/UIShell/HeaderSideNavItems.svelte +15 -0
  403. package/src/UIShell/HeaderSideNavItems.svelte.d.ts +25 -0
  404. package/src/UIShell/ProfileMenu.svelte +108 -0
  405. package/src/UIShell/ProfileMenu.svelte.d.ts +60 -0
  406. package/src/UIShell/ProfileMenuDetail.svelte +23 -0
  407. package/src/UIShell/ProfileMenuDetail.svelte.d.ts +22 -0
  408. package/src/UIShell/ProfileMenuDivider.svelte +1 -0
  409. package/src/UIShell/ProfileMenuDivider.svelte.d.ts +9 -0
  410. package/src/UIShell/ProfileMenuHeader.svelte +80 -0
  411. package/src/UIShell/ProfileMenuHeader.svelte.d.ts +54 -0
  412. package/src/UIShell/ProfileMenuItem.svelte +53 -0
  413. package/src/UIShell/ProfileMenuItem.svelte.d.ts +41 -0
  414. package/src/UIShell/ProfileMenuList.svelte +17 -0
  415. package/src/UIShell/ProfileMenuList.svelte.d.ts +25 -0
  416. package/src/UIShell/SideNavLink.svelte.d.ts +5 -6
  417. package/src/UIShell/SideNavMenu.svelte.d.ts +5 -6
  418. package/src/UIShell/index.js +7 -0
  419. package/src/UserAvatar/UserAvatar.svelte +262 -0
  420. package/src/UserAvatar/UserAvatar.svelte.d.ts +101 -0
  421. package/src/UserAvatar/index.js +1 -0
  422. package/src/UserAvatarGroup/UserAvatarGroup.svelte +200 -0
  423. package/src/UserAvatarGroup/UserAvatarGroup.svelte.d.ts +81 -0
  424. package/src/UserAvatarGroup/UserAvatarGroupOverflow.svelte +38 -0
  425. package/src/UserAvatarGroup/UserAvatarGroupOverflow.svelte.d.ts +29 -0
  426. package/src/UserAvatarGroup/index.js +1 -0
  427. package/src/icons/Add.svelte.d.ts +1 -5
  428. package/src/icons/ArrowUp.svelte.d.ts +1 -5
  429. package/src/icons/Calendar.svelte.d.ts +1 -5
  430. package/src/icons/Caution.svelte +29 -0
  431. package/src/icons/Caution.svelte.d.ts +22 -0
  432. package/src/icons/ChevronLeft.svelte +28 -0
  433. package/src/icons/ChevronLeft.svelte.d.ts +26 -0
  434. package/src/icons/CircleFill.svelte +28 -0
  435. package/src/icons/{Menu.svelte.d.ts → CircleFill.svelte.d.ts} +3 -3
  436. package/src/icons/CircleStroke.svelte +30 -0
  437. package/src/icons/CircleStroke.svelte.d.ts +26 -0
  438. package/src/icons/Close.svelte.d.ts +1 -5
  439. package/src/icons/Copy.svelte.d.ts +1 -5
  440. package/src/icons/Critical.svelte +29 -0
  441. package/src/icons/Critical.svelte.d.ts +22 -0
  442. package/src/icons/CriticalSeverity.svelte +28 -0
  443. package/src/icons/CriticalSeverity.svelte.d.ts +26 -0
  444. package/src/icons/DiamondFill.svelte +31 -0
  445. package/src/icons/DiamondFill.svelte.d.ts +26 -0
  446. package/src/icons/EditOff.svelte.d.ts +1 -5
  447. package/src/icons/InProgress.svelte +30 -0
  448. package/src/icons/InProgress.svelte.d.ts +26 -0
  449. package/src/icons/InformationSquareFilled.svelte.d.ts +1 -2
  450. package/src/icons/Launch.svelte.d.ts +1 -5
  451. package/src/icons/LowSeverity.svelte +29 -0
  452. package/src/icons/LowSeverity.svelte.d.ts +26 -0
  453. package/src/icons/OverflowMenuHorizontal.svelte.d.ts +1 -2
  454. package/src/icons/PendingFilled.svelte +35 -0
  455. package/src/icons/PendingFilled.svelte.d.ts +26 -0
  456. package/src/icons/Settings.svelte.d.ts +1 -5
  457. package/src/icons/Subtract.svelte.d.ts +1 -5
  458. package/src/icons/Switcher.svelte.d.ts +1 -5
  459. package/src/icons/UndefinedFilled.svelte +31 -0
  460. package/src/icons/UndefinedFilled.svelte.d.ts +26 -0
  461. package/src/icons/UnknownFilled.svelte +35 -0
  462. package/src/icons/UnknownFilled.svelte.d.ts +26 -0
  463. package/src/icons/User.svelte +33 -0
  464. package/src/icons/User.svelte.d.ts +22 -0
  465. package/src/icons/View.svelte.d.ts +1 -5
  466. package/src/icons/ViewOff.svelte.d.ts +1 -5
  467. package/src/icons/Warning.svelte.d.ts +1 -5
  468. package/src/icons/WarningAltInvertedFilled.svelte +38 -0
  469. package/src/icons/WarningAltInvertedFilled.svelte.d.ts +26 -0
  470. package/src/icons/WarningSquareFilled.svelte +35 -0
  471. package/src/icons/WarningSquareFilled.svelte.d.ts +26 -0
  472. package/src/index.d.ts +50 -5
  473. package/src/index.js +49 -0
  474. package/src/node_modules/.cache/sveld/parse-cache.json +1 -0
  475. package/src/utils/avatarColor.d.ts +19 -0
  476. package/src/utils/avatarColor.js +50 -0
  477. package/src/utils/dismiss.d.ts +21 -0
  478. package/src/utils/dismiss.js +181 -0
  479. package/src/utils/floatingPosition.d.ts +52 -0
  480. package/src/utils/floatingPosition.js +204 -0
  481. package/src/utils/fuzzyMatch.d.ts +37 -0
  482. package/src/utils/fuzzyMatch.js +207 -0
  483. package/src/utils/getScrollableAncestors.d.ts +7 -0
  484. package/src/utils/getScrollableAncestors.js +28 -0
  485. package/src/utils/outsideDismiss.d.ts +6 -0
  486. package/src/utils/outsideDismiss.js +28 -0
  487. package/src/utils/overflowTitle.d.ts +15 -0
  488. package/src/utils/overflowTitle.js +35 -0
  489. package/src/utils/rafThrottle.d.ts +10 -0
  490. package/src/utils/rafThrottle.js +38 -0
  491. package/src/utils/rovingFocus.d.ts +35 -0
  492. package/src/utils/rovingFocus.js +129 -0
  493. package/src/utils/scrollIntoViewWithinMenu.d.ts +15 -0
  494. package/src/utils/scrollIntoViewWithinMenu.js +31 -0
  495. package/src/utils/tagOverflow.d.ts +17 -0
  496. package/src/utils/tagOverflow.js +39 -0
  497. package/src/utils/typeahead.d.ts +13 -0
  498. package/src/utils/typeahead.js +37 -0
  499. package/src/utils/virtualize.d.ts +17 -0
  500. package/src/utils/virtualize.js +63 -18
package/README.md CHANGED
@@ -6,13 +6,16 @@
6
6
  <img src="https://img.shields.io/discord/689212587170201628?color=5865F2&style=for-the-badge" alt="Chat with us on Discord">
7
7
  </a>
8
8
 
9
- Carbon Components Svelte is a [Svelte](https://github.com/sveltejs/svelte) component library that implements the [Carbon Design System](https://github.com/carbon-design-system), an open source design system by IBM.
9
+ Carbon Components Svelte is a [Svelte](https://github.com/sveltejs/svelte) component library that implements the [Carbon Design System](https://www.carbondesignsystem.com/), an open source design system by IBM. Ship accessible, consistent, production-ready interfaces.
10
10
 
11
- Design systems facilitate design and development through reuse, consistency, and extensibility.
11
+ - **70+ components**: from inputs to data tables
12
+ - **5 built-in themes**: two light, three dark
13
+ - **Fully typed TypeScript API**: props, events, and slots
14
+ - **WCAG 2.1 AA**: keyboard and screen-reader ready
12
15
 
13
- The Carbon Svelte portfolio also includes:
16
+ The Carbon Svelte ecosystem also includes:
14
17
 
15
- - **[Carbon Icons Svelte](https://github.com/carbon-design-system/carbon-icons-svelte)**: 2,600+ Carbon icons as Svelte components
18
+ - **[Carbon Icons Svelte](https://github.com/carbon-design-system/carbon-icons-svelte)**: 2,700+ Carbon icons as Svelte components
16
19
  - **[Carbon Pictograms Svelte](https://github.com/carbon-design-system/carbon-pictograms-svelte)**: 1,500+ Carbon pictograms as Svelte components
17
20
  - **[Carbon Charts Svelte](https://github.com/carbon-design-system/carbon-charts/tree/master/packages/svelte)**: 25+ charts, powered by d3
18
21
  - **[Carbon Preprocess Svelte](https://github.com/carbon-design-system/carbon-preprocess-svelte)**: Collection of Svelte preprocessors for Carbon
@@ -26,7 +29,7 @@ The Carbon Svelte portfolio also includes:
26
29
  npm i carbon-components-svelte
27
30
 
28
31
  # pnpm
29
- pnpm i carbon-components-svelte
32
+ pnpm add carbon-components-svelte
30
33
 
31
34
  # Yarn
32
35
  yarn add carbon-components-svelte
@@ -46,9 +49,9 @@ Before importing components, you will need to first apply Carbon component style
46
49
  - **g80.css**: Gray 80 theme (dark)
47
50
  - **g90.css**: Gray 90 theme (dark)
48
51
  - **g100.css**: Gray 100 theme (dark)
49
- - **all.css**: All themes (White, Gray 10, Gray 90, Gray 100) using [CSS variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties)
52
+ - **all.css**: All five themes (White, Gray 10, Gray 80, Gray 90, Gray 100) using [CSS variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties)
50
53
 
51
- Each StyleSheet is [generated](scripts/build-css.js) from the flagship [carbon-components](https://github.com/carbon-design-system/carbon/tree/main/packages/carbon-components) library.
54
+ Each StyleSheet is [generated](scripts/build-css.ts) from the flagship [carbon-components](https://github.com/carbon-design-system/carbon/tree/main/packages/carbon-components) library.
52
55
 
53
56
  The compiled CSS is generated from the following `.scss` files:
54
57
 
@@ -59,6 +62,8 @@ The compiled CSS is generated from the following `.scss` files:
59
62
  - [css/g100.scss](css/g100.scss)
60
63
  - [css/all.scss](css/all.scss)
61
64
 
65
+ Import one theme once at the top-level entry point of your app, like `index.js` or `src/+layout.svelte`.
66
+
62
67
  #### CSS StyleSheet
63
68
 
64
69
  ```js
@@ -89,7 +94,7 @@ Refer to the [official Carbon guide on SASS](https://github.com/carbon-design-sy
89
94
 
90
95
  ### Dynamic theming
91
96
 
92
- Use the "all.css" StyleSheet for dynamic, client-side theming.
97
+ To switch themes at runtime, import the combined "all.css" StyleSheet instead of a single theme. It bundles all five themes and toggles between them through a `theme` attribute on the HTML element.
93
98
 
94
99
  ```js
95
100
  import "carbon-components-svelte/css/all.css";
@@ -106,7 +111,7 @@ Update the theme by setting the `theme` attribute on the `html` element. The def
106
111
  </html>
107
112
  ```
108
113
 
109
- Programmatically switch between each of the five Carbon themes by setting the "theme" attribute on the HTML element.
114
+ Or programmatically switch between each of the five Carbon themes by setting the `theme` attribute on the HTML element.
110
115
 
111
116
  ```html
112
117
  <script>
@@ -116,6 +121,8 @@ Programmatically switch between each of the five Carbon themes by setting the "t
116
121
  </script>
117
122
  ```
118
123
 
124
+ Alternatively, use the [Theme component](https://svelte.carbondesignsystem.com/components/Theme) to manage the theme reactively.
125
+
119
126
  ### Importing components
120
127
 
121
128
  Import components from `carbon-components-svelte` in the `script` tag of your Svelte file. Visit the [documentation site](https://svelte.carbondesignsystem.com) for examples.
@@ -137,7 +144,7 @@ Import components from `carbon-components-svelte` in the `script` tag of your Sv
137
144
 
138
145
  ## Preprocessors & Plugins
139
146
 
140
- [carbon-preprocess-svelte](https://github.com/carbon-design-system/carbon-preprocess-svelte) is a collection of Svelte preprocessors for Carbon.
147
+ [carbon-preprocess-svelte](https://github.com/carbon-design-system/carbon-preprocess-svelte) is a collection of Svelte preprocessors for Carbon. It trims build times and bundle size with two drop-in tools for faster HMR in development and leaner CSS when you ship.
141
148
 
142
149
  > [!NOTE]
143
150
  > Using `carbon-preprocess-svelte` is optional and not a prerequisite for this library. It should be installed as a development dependency.
@@ -147,7 +154,7 @@ Import components from `carbon-components-svelte` in the `script` tag of your Sv
147
154
  npm i -D carbon-preprocess-svelte
148
155
 
149
156
  # pnpm
150
- pnpm i -D carbon-preprocess-svelte
157
+ pnpm add -D carbon-preprocess-svelte
151
158
 
152
159
  # Yarn
153
160
  yarn add -D carbon-preprocess-svelte
@@ -179,39 +186,9 @@ The preprocessor optimizes imports from the following packages:
179
186
  + import Airplane from "carbon-pictograms-svelte/lib/Airplane.svelte";
180
187
  ```
181
188
 
182
- #### Usage
183
-
184
- See [examples](examples) for full configurations.
185
-
186
- ```js
187
- // svelte.config.js
188
- import { optimizeImports } from "carbon-preprocess-svelte";
189
-
190
- export default {
191
- preprocess: [optimizeImports()],
192
- };
193
- ```
194
-
195
- Any other preprocessors that transpile code in the `script` block should be invoked before `optimizeImports`.
196
-
197
- For example, `vitePreprocess` should precede `optimizeImports`.
198
-
199
- ```diff
200
- // svelte.config.js
201
- + import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
202
- import { optimizeImports } from "carbon-preprocess-svelte";
203
-
204
- export default {
205
- preprocess: [
206
- + vitePreprocess(),
207
- optimizeImports()
208
- ],
209
- };
210
- ```
211
-
212
189
  ### `optimizeCss`
213
190
 
214
- `optimizeCss` is a Vite plugin that removes unused Carbon styles at build time. The plugin is compatible with Rollup ([Vite](https://vitejs.dev/guide/api-plugin) extends the Rollup plugin API).
191
+ `optimizeCss` is a Vite plugin that removes unused Carbon styles at build time, often removing hundreds of kilobytes from production bundles. The plugin is compatible with Rollup ([Vite](https://vitejs.dev/guide/api-plugin) extends the Rollup plugin API).
215
192
 
216
193
  `carbon-components-svelte@0.85.0` or greater is required.
217
194
 
@@ -230,9 +207,42 @@ dist/assets/index-Ceijs3eO.js 53.65 kB │ gzip: 15.88 kB
230
207
  > [!NOTE]
231
208
  > This is a plugin and not a Svelte preprocessor. It should be added to the list of `vite.plugins`. For Vite set-ups, this plugin is only run when building the app. For Rollup and Webpack, you should conditionally apply the plugin to only execute when building for production.
232
209
 
233
- #### Usage
210
+ ### Configure your bundler
211
+
212
+ Add `optimizeImports` to your Svelte preprocessor and `optimizeCss` to your bundler plugins. See [examples](examples) for full configurations.
234
213
 
235
- See [examples](examples) for full configurations.
214
+ **Vite**
215
+
216
+ ```js
217
+ // vite.config.js
218
+ import { svelte, vitePreprocess } from "@sveltejs/vite-plugin-svelte";
219
+ import { optimizeCss, optimizeImports } from "carbon-preprocess-svelte";
220
+
221
+ export default {
222
+ plugins: [
223
+ svelte({
224
+ preprocess: [vitePreprocess(), optimizeImports()],
225
+ }),
226
+ optimizeCss(),
227
+ ],
228
+ };
229
+ ```
230
+
231
+ **SvelteKit**
232
+
233
+ ```js
234
+ // svelte.config.js
235
+ import adapter from "@sveltejs/adapter-static";
236
+ import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
237
+ import { optimizeImports } from "carbon-preprocess-svelte";
238
+
239
+ const config = {
240
+ preprocess: [vitePreprocess(), optimizeImports()],
241
+ kit: { adapter: adapter() },
242
+ };
243
+
244
+ export default config;
245
+ ```
236
246
 
237
247
  ```js
238
248
  // vite.config.js
@@ -245,6 +255,112 @@ export default defineConfig({
245
255
  });
246
256
  ```
247
257
 
258
+ **Rollup**
259
+
260
+ ```js
261
+ // rollup.config.js
262
+ import svelte from "rollup-plugin-svelte";
263
+ import { optimizeCss, optimizeImports } from "carbon-preprocess-svelte";
264
+
265
+ const production = !process.env.ROLLUP_WATCH;
266
+
267
+ export default {
268
+ plugins: [
269
+ svelte({
270
+ preprocess: [optimizeImports()],
271
+ }),
272
+ production && optimizeCss(),
273
+ ],
274
+ };
275
+ ```
276
+
277
+ **Webpack**
278
+
279
+ ```js
280
+ // webpack.config.mjs
281
+ import { OptimizeCssPlugin, optimizeImports } from "carbon-preprocess-svelte";
282
+
283
+ export default {
284
+ module: {
285
+ rules: [
286
+ {
287
+ test: /\.svelte$/,
288
+ use: {
289
+ loader: "svelte-loader",
290
+ options: {
291
+ preprocess: [optimizeImports()],
292
+ },
293
+ },
294
+ },
295
+ ],
296
+ },
297
+ plugins: [new OptimizeCssPlugin()],
298
+ };
299
+ ```
300
+
301
+ ## Icons and pictograms
302
+
303
+ The icon and pictogram sets ship as separate packages of individual Svelte components. Each is optional, so install only what you need.
304
+
305
+ ### Icons
306
+
307
+ 2,700+ icons designed for product UI, in four sizes (16, 20, 24, and 32 pixels), set with a single prop.
308
+
309
+ ```sh
310
+ # npm
311
+ npm i carbon-icons-svelte
312
+
313
+ # pnpm
314
+ pnpm add carbon-icons-svelte
315
+
316
+ # Yarn
317
+ yarn add carbon-icons-svelte
318
+
319
+ # Bun
320
+ bun add carbon-icons-svelte
321
+ ```
322
+
323
+ ```svelte
324
+ <script>
325
+ import Add from "carbon-icons-svelte/lib/Add.svelte";
326
+ </script>
327
+
328
+ <Add size={24} />
329
+ ```
330
+
331
+ ### Pictograms
332
+
333
+ 1,500+ illustrative pictograms for empty states, onboarding, hero sections, and feature callouts. Larger than icons, 64px by default.
334
+
335
+ ```sh
336
+ # npm
337
+ npm i carbon-pictograms-svelte
338
+
339
+ # pnpm
340
+ pnpm add carbon-pictograms-svelte
341
+
342
+ # Yarn
343
+ yarn add carbon-pictograms-svelte
344
+
345
+ # Bun
346
+ bun add carbon-pictograms-svelte
347
+ ```
348
+
349
+ ```svelte
350
+ <script>
351
+ import Cloud from "carbon-pictograms-svelte/lib/Cloud.svelte";
352
+ </script>
353
+
354
+ <Cloud />
355
+ ```
356
+
357
+ ## Documentation for LLMs
358
+
359
+ Documentation is available in LLM-friendly plain text for use with coding assistants, plus a standalone Markdown document for every component. Append `.md` to any component's URL to read it.
360
+
361
+ - **[llms.txt](https://svelte.carbondesignsystem.com/llms.txt)**: a component index where each entry links to its per-component Markdown doc, sized for model context windows.
362
+ - **[llms-full.txt](https://svelte.carbondesignsystem.com/llms-full.txt)**: the full component documentation in a single plain-text file.
363
+
248
364
  ## Examples
249
365
 
250
366
  - [examples/rollup](examples/rollup/)
@@ -0,0 +1,48 @@
1
+ @import "carbon-components/scss/globals/scss/vars";
2
+ @import "carbon-components/scss/globals/scss/vendor/@carbon/elements/scss/import-once/import-once";
3
+ @import "carbon-components/scss/globals/scss/typography";
4
+
5
+ /// Badge indicator (Carbon React BadgeIndicator; absent from v10).
6
+ /// An empty dot or a numbered count overlaid on a positioned ancestor.
7
+ /// @access private
8
+ /// @group components
9
+ @mixin badge-indicator {
10
+ .#{$prefix}--badge-indicator {
11
+ @include type-style("helper-text-01");
12
+
13
+ position: absolute;
14
+ display: flex;
15
+ padding: 0 $carbon--spacing-02 $carbon--spacing-01;
16
+ border-radius: 100px;
17
+ background: $support-error;
18
+ color: $text-on-color;
19
+
20
+ inset-block-start: 0;
21
+ inset-inline-end: 0;
22
+
23
+ margin-block-start: $carbon--spacing-03;
24
+ margin-inline-end: $carbon--spacing-03;
25
+
26
+ max-block-size: $carbon--spacing-05;
27
+ min-block-size: $carbon--spacing-03;
28
+ min-inline-size: $carbon--spacing-03;
29
+ }
30
+
31
+ .#{$prefix}--badge-indicator--count {
32
+ margin-block-start: $carbon--spacing-02;
33
+ margin-inline-end: $carbon--spacing-02;
34
+ }
35
+
36
+ .#{$prefix}--btn__badge-wrapper {
37
+ position: relative;
38
+ display: inline-flex;
39
+
40
+ .#{$prefix}--badge-indicator {
41
+ pointer-events: none;
42
+ }
43
+ }
44
+ }
45
+
46
+ @include exports("badge-indicator") {
47
+ @include badge-indicator;
48
+ }
package/css/_box.scss ADDED
@@ -0,0 +1,71 @@
1
+ @import "carbon-components/scss/globals/scss/vars";
2
+ @import "carbon-components/scss/globals/scss/vendor/@carbon/elements/scss/import-once/import-once";
3
+ @import "./spacing-scale";
4
+
5
+ /// Box utility classes for fill, inset, and border tokens.
6
+ /// @access private
7
+ /// @group components
8
+ @mixin box {
9
+ // Token names follow Carbon v11; values resolve through v10 theme variables.
10
+ $fill-tokens: (
11
+ background: $background,
12
+ layer-01: $ui-01,
13
+ layer-02: $ui-02,
14
+ layer-03: $ui-03,
15
+ field: $field-01,
16
+ inverse: $background-inverse,
17
+ );
18
+
19
+ @each $name, $value in $fill-tokens {
20
+ .#{$prefix}--box-fill-#{$name} {
21
+ background-color: $value;
22
+ }
23
+ }
24
+
25
+ $border-tokens: (
26
+ subtle: $border-subtle,
27
+ strong: $border-strong,
28
+ interactive: $border-interactive,
29
+ disabled: $border-disabled,
30
+ );
31
+
32
+ @each $name, $value in $border-tokens {
33
+ .#{$prefix}--box-border-#{$name} {
34
+ border: 1px solid $value;
35
+ }
36
+ }
37
+
38
+ @each $step, $size in $ccs-spacing-scale {
39
+ .#{$prefix}--box-p-#{$step} {
40
+ padding: $size;
41
+ }
42
+
43
+ .#{$prefix}--box-px-#{$step} {
44
+ padding-inline: $size;
45
+ }
46
+
47
+ .#{$prefix}--box-py-#{$step} {
48
+ padding-block: $size;
49
+ }
50
+
51
+ .#{$prefix}--box-m-#{$step} {
52
+ margin: $size;
53
+ }
54
+
55
+ .#{$prefix}--box-mx-#{$step} {
56
+ margin-inline: $size;
57
+ }
58
+
59
+ .#{$prefix}--box-my-#{$step} {
60
+ margin-block: $size;
61
+ }
62
+ }
63
+
64
+ .#{$prefix}--box-full-width {
65
+ width: 100%;
66
+ }
67
+ }
68
+
69
+ @include exports("box") {
70
+ @include box;
71
+ }
@@ -3,7 +3,7 @@
3
3
  @import "carbon-components/scss/globals/scss/vendor/@carbon/elements/scss/import-once/import-once";
4
4
  @import "carbon-components/scss/globals/scss/typography";
5
5
 
6
- /// Small breadcrumb variant (Carbon React `size="sm"` parity)
6
+ /// Small breadcrumb (Carbon React size="sm")
7
7
  /// @access private
8
8
  /// @group components
9
9
  @mixin breadcrumb-sm {
@@ -35,8 +35,10 @@
35
35
  height: $carbon--spacing-05;
36
36
  min-height: $carbon--spacing-05;
37
37
 
38
+ // Carbon shifts this icon down 4px inside breadcrumb items. At 1rem trigger
39
+ // size the icon is already centered, so reset `transform`.
38
40
  .#{$prefix}--overflow-menu__icon {
39
- transform: translateY(3px);
41
+ transform: none;
40
42
  }
41
43
  }
42
44
  }
@@ -44,3 +46,18 @@
44
46
  @include exports('breadcrumb-sm') {
45
47
  @include breadcrumb-sm;
46
48
  }
49
+
50
+ /// Carbon's `--sm`/`--xl` caret sets `width: 40px` on `::after`. Same
51
+ /// specificity as the breadcrumb rule, but Carbon loads first. Force `width: 0`
52
+ /// here so the caret stays a triangle.
53
+ /// @access private
54
+ /// @group components
55
+ @mixin breadcrumb-menu-caret {
56
+ .#{$prefix}--breadcrumb-menu-options.#{$prefix}--overflow-menu-options[data-floating-menu-direction='bottom']::after {
57
+ width: 0;
58
+ }
59
+ }
60
+
61
+ @include exports('breadcrumb-menu-caret') {
62
+ @include breadcrumb-menu-caret;
63
+ }
@@ -1,7 +1,3 @@
1
- // This file backports readonly checkbox styles from carbon-components v11+
2
- // to ensure compatibility with carbon-components v10.58.12.
3
- // The readonly checkbox feature was added to Carbon Design System in Nov 2022.
4
-
5
1
  @import "carbon-components/scss/globals/scss/vars";
6
2
  @import "carbon-components/scss/globals/scss/helper-mixins";
7
3
  @import "carbon-components/scss/globals/scss/vendor/@carbon/elements/scss/import-once/import-once";
@@ -10,9 +6,6 @@
10
6
  /// @access private
11
7
  /// @group checkbox
12
8
  @mixin checkbox-readonly {
13
- //----------------------------------------------
14
- // Read-only
15
- // ---------------------------------------------
16
9
  .#{$prefix}--checkbox-wrapper--readonly .#{$prefix}--checkbox-label {
17
10
  cursor: default;
18
11
  }
@@ -0,0 +1,46 @@
1
+ @import "carbon-components/scss/globals/scss/vars";
2
+
3
+ /// Edge fade for code snippets (Carbon React v11 parity). v10 uses
4
+ /// `--overflow-indicator` gradient elements that this library's markup does not
5
+ /// render. v11 masks the scroll container instead, which is background-agnostic
6
+ /// and works across themes, the light variant, and skeleton state.
7
+ /// @access private
8
+ /// @group components
9
+ @mixin code-snippet-fade {
10
+ .#{$prefix}--snippet--single .#{$prefix}--snippet-container {
11
+ mask-image: linear-gradient(
12
+ 90deg,
13
+ $black-100 calc(100% - #{$carbon--spacing-07}),
14
+ transparent 100%
15
+ );
16
+
17
+ // The focus outline is drawn on this same element, so the edge fade would
18
+ // clip the ring. Drop the mask while focused so the outline is unbroken.
19
+ &:focus {
20
+ mask-image: none;
21
+ }
22
+ }
23
+
24
+ // Expanded multi-line adds padding-bottom: $spacing-05, so the bottom fade
25
+ // offset matches that padding when content no longer scrolls.
26
+ .#{$prefix}--snippet--multi .#{$prefix}--snippet-container {
27
+ mask-image: linear-gradient(
28
+ 90deg,
29
+ $black-100 calc(100% - #{$carbon--spacing-07}),
30
+ transparent 100%
31
+ ),
32
+ linear-gradient(
33
+ $black-100 calc(100% - #{$spacing-05}),
34
+ transparent 100%
35
+ );
36
+ mask-composite: intersect;
37
+
38
+ &:focus {
39
+ mask-image: none;
40
+ }
41
+ }
42
+ }
43
+
44
+ @include exports("code-snippet-fade") {
45
+ @include code-snippet-fade;
46
+ }
@@ -0,0 +1,50 @@
1
+ @import "carbon-components/scss/globals/scss/vars";
2
+ @import "carbon-components/scss/globals/scss/helper-mixins";
3
+ @import "carbon-components/scss/globals/scss/vendor/@carbon/elements/scss/import-once/import-once";
4
+
5
+ /// Groups a `ComboButton`'s primary action and icon-only trigger button into
6
+ /// a single visual unit. The divider mirrors v10's own `.bx--btn-set`
7
+ /// technique (a box-shadow on the trigger, since adjacent buttons have no
8
+ /// margin between them); the chevron rotates on open.
9
+ /// @access private
10
+ /// @group components
11
+ @mixin combo-button {
12
+ .#{$prefix}--combo-button {
13
+ display: inline-flex;
14
+ }
15
+
16
+ .#{$prefix}--combo-button .#{$prefix}--combo-button__trigger:not(:focus) {
17
+ box-shadow: to-rem(-1px) 0 0 0 $button-separator;
18
+ }
19
+
20
+ .#{$prefix}--combo-button
21
+ .#{$prefix}--combo-button__trigger.#{$prefix}--btn--disabled {
22
+ box-shadow: to-rem(-1px) 0 0 0 $disabled-03;
23
+ }
24
+
25
+ .#{$prefix}--combo-button__trigger .#{$prefix}--btn__icon {
26
+ transition: transform $duration--fast-01 motion(standard, productive);
27
+ }
28
+
29
+ .#{$prefix}--combo-button__trigger--open .#{$prefix}--btn__icon {
30
+ transform: rotate(180deg);
31
+ }
32
+
33
+ // Extra-small (Carbon React size="xs", 24px). Neither Button's "small"
34
+ // class (32px) nor any other Button size lands on 24px, so shrink further
35
+ // on top of the "small" size already passed to both buttons.
36
+ .#{$prefix}--combo-button--xs .#{$prefix}--btn {
37
+ min-height: to-rem(24px);
38
+ padding-top: 0;
39
+ padding-bottom: 0;
40
+ }
41
+
42
+ .#{$prefix}--combo-button--xs .#{$prefix}--btn--icon-only {
43
+ padding-right: to-rem(4px);
44
+ padding-left: to-rem(4px);
45
+ }
46
+ }
47
+
48
+ @include exports("combo-button") {
49
+ @include combo-button;
50
+ }
@@ -1,6 +1,3 @@
1
- // This file backports readonly combo-box styles from carbon-components v11+
2
- // to ensure compatibility with carbon-components v10.58.12.
3
-
4
1
  @import "carbon-components/scss/globals/scss/vars";
5
2
  @import "carbon-components/scss/globals/scss/helper-mixins";
6
3
  @import "carbon-components/scss/globals/scss/vendor/@carbon/elements/scss/import-once/import-once";
@@ -9,9 +6,6 @@
9
6
  /// @access private
10
7
  /// @group combobox
11
8
  @mixin combobox-readonly {
12
- //----------------------------------------------
13
- // Read-only
14
- // ---------------------------------------------
15
9
  .#{$prefix}--list-box.#{$prefix}--combo-box--readonly,
16
10
  .#{$prefix}--list-box.#{$prefix}--combo-box--readonly:hover {
17
11
  background-color: transparent;
@@ -1,7 +1,3 @@
1
- // This file adds contained list styles from carbon-components v11+
2
- // to ensure compatibility with carbon-components v10.58.12.
3
- // The ContainedList component provides a structured list with header and items.
4
-
5
1
  @import "carbon-components/scss/globals/scss/vars";
6
2
  @import "carbon-components/scss/globals/scss/helper-mixins";
7
3
  @import "carbon-components/scss/globals/scss/vendor/@carbon/elements/scss/import-once/import-once";
@@ -10,19 +6,15 @@
10
6
  /// @access private
11
7
  /// @group contained-list
12
8
  @mixin contained-list {
13
- // Tag within contained list
14
9
  .#{$prefix}--contained-list .#{$prefix}--tag {
15
- // Tag size adjustments for contained list context
16
10
  height: 1.5rem; // 24px equivalent to md size
17
11
  }
18
12
 
19
- // List container
20
13
  .#{$prefix}--contained-list > ul {
21
14
  padding: 0;
22
15
  margin: 0;
23
16
  }
24
17
 
25
- // Header
26
18
  .#{$prefix}--contained-list__header {
27
19
  position: sticky;
28
20
  z-index: 1;
@@ -37,7 +29,6 @@
37
29
  width: 100%;
38
30
  }
39
31
 
40
- // Search within contained list
41
32
  .#{$prefix}--contained-list .#{$prefix}--search {
42
33
  position: sticky;
43
34
  z-index: 1;
@@ -47,12 +38,10 @@
47
38
  }
48
39
  }
49
40
 
50
- // Search top offset for disclosed variant (fixed height)
51
41
  .#{$prefix}--contained-list--disclosed .#{$prefix}--search {
52
42
  top: 2rem; // Fixed header height for disclosed variant
53
43
  }
54
44
 
55
- // Search top offset for on-page variant (size-dependent)
56
45
  .#{$prefix}--contained-list--on-page .#{$prefix}--search {
57
46
  top: 3rem; // Default md size header height
58
47
  }
@@ -72,7 +61,6 @@
72
61
  top: 4.5rem; // xl size header height
73
62
  }
74
63
 
75
- // Omit search input background when used inside contained list
76
64
  .#{$prefix}--contained-list .#{$prefix}--search .#{$prefix}--search-input {
77
65
  background-color: $ui-background;
78
66
  border-bottom: 1px solid $ui-03;
@@ -109,7 +97,6 @@
109
97
  outline: none;
110
98
  }
111
99
 
112
- // "On Page" variant
113
100
  .#{$prefix}--contained-list--on-page + .#{$prefix}--contained-list--on-page {
114
101
  margin-top: $spacing-05;
115
102
  }
@@ -123,7 +110,6 @@
123
110
  color: $text-01;
124
111
  }
125
112
 
126
- // Size variants for on-page header
127
113
  .#{$prefix}--contained-list--on-page.#{$prefix}--contained-list--sm
128
114
  .#{$prefix}--contained-list__header {
129
115
  height: 2rem;
@@ -139,7 +125,7 @@
139
125
  height: 4.5rem;
140
126
  }
141
127
 
142
- // "Disclosed" variant
128
+ // Disclosed variant
143
129
  .#{$prefix}--contained-list--disclosed .#{$prefix}--contained-list__header {
144
130
  @include type-style('label-01');
145
131
 
@@ -148,7 +134,6 @@
148
134
  color: $text-02;
149
135
  }
150
136
 
151
- // List item
152
137
  .#{$prefix}--contained-list-item {
153
138
  position: relative;
154
139
  display: list-item;
@@ -176,15 +161,12 @@
176
161
  .#{$prefix}--contained-list-item__content {
177
162
  @include type-style('body-short-01');
178
163
 
179
- // Calculate padding based on line-height
180
- // body-short-01 line-height is typically 1.25rem (20px)
181
- // Height is 3rem (48px) for md size, so padding = (48px - 20px) / 2 = 14px
182
- padding: 0.875rem $spacing-05; // 14px vertical, 16px horizontal
164
+ // Vertical padding centers body-short-01 in the row height
165
+ padding: 0.875rem $spacing-05;
183
166
  color: $text-01;
184
167
  min-height: 3rem; // md size default
185
168
  }
186
169
 
187
- // Size variants for list items
188
170
  .#{$prefix}--contained-list--sm
189
171
  .#{$prefix}--contained-list-item__content,
190
172
  .#{$prefix}--contained-list--sm