@hashicorp/mds-react 0.9.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 (511) hide show
  1. package/LICENSE +336 -0
  2. package/README.md +109 -0
  3. package/dist/components/accordion/index.d.ts +14 -0
  4. package/dist/components/accordion/index.js +9 -0
  5. package/dist/components/accordion/index.js.map +1 -0
  6. package/dist/components/accordion/item/button.d.ts +6 -0
  7. package/dist/components/accordion/item/button.js +44 -0
  8. package/dist/components/accordion/item/button.js.map +1 -0
  9. package/dist/components/accordion/item/index.d.ts +24 -0
  10. package/dist/components/accordion/item/index.js +59 -0
  11. package/dist/components/accordion/item/index.js.map +1 -0
  12. package/dist/components/accordion/style.module.scss +110 -0
  13. package/dist/components/accordion/style.module.scss.js +24 -0
  14. package/dist/components/accordion/style.module.scss.js.map +1 -0
  15. package/dist/components/alert/alert.module.scss +229 -0
  16. package/dist/components/alert/alert.module.scss.js +29 -0
  17. package/dist/components/alert/alert.module.scss.js.map +1 -0
  18. package/dist/components/alert/icon.d.ts +9 -0
  19. package/dist/components/alert/icon.js +34 -0
  20. package/dist/components/alert/icon.js.map +1 -0
  21. package/dist/components/alert/index.d.ts +62 -0
  22. package/dist/components/alert/index.js +97 -0
  23. package/dist/components/alert/index.js.map +1 -0
  24. package/dist/components/badge/index.d.ts +30 -0
  25. package/dist/components/badge/index.js +50 -0
  26. package/dist/components/badge/index.js.map +1 -0
  27. package/dist/components/badge/style.module.scss +130 -0
  28. package/dist/components/badge/style.module.scss.js +22 -0
  29. package/dist/components/badge/style.module.scss.js.map +1 -0
  30. package/dist/components/badge-count/index.d.ts +16 -0
  31. package/dist/components/badge-count/index.js +29 -0
  32. package/dist/components/badge-count/index.js.map +1 -0
  33. package/dist/components/badge-count/style.module.scss +108 -0
  34. package/dist/components/badge-count/style.module.scss.js +15 -0
  35. package/dist/components/badge-count/style.module.scss.js.map +1 -0
  36. package/dist/components/breadcrumbs/index.d.ts +7 -0
  37. package/dist/components/breadcrumbs/index.js +38 -0
  38. package/dist/components/breadcrumbs/index.js.map +1 -0
  39. package/dist/components/breadcrumbs/item/index.d.ts +2 -0
  40. package/dist/components/breadcrumbs/item/index.js +32 -0
  41. package/dist/components/breadcrumbs/item/index.js.map +1 -0
  42. package/dist/components/breadcrumbs/style.module.scss +183 -0
  43. package/dist/components/breadcrumbs/style.module.scss.js +27 -0
  44. package/dist/components/breadcrumbs/style.module.scss.js.map +1 -0
  45. package/dist/components/breadcrumbs/truncation-button/index.d.ts +3 -0
  46. package/dist/components/breadcrumbs/truncation-button/index.js +25 -0
  47. package/dist/components/breadcrumbs/truncation-button/index.js.map +1 -0
  48. package/dist/components/breadcrumbs/types/index.d.ts +51 -0
  49. package/dist/components/button/index.d.ts +31 -0
  50. package/dist/components/button/index.js +119 -0
  51. package/dist/components/button/index.js.map +1 -0
  52. package/dist/components/button/styles.module.scss +221 -0
  53. package/dist/components/button/styles.module.scss.js +32 -0
  54. package/dist/components/button/styles.module.scss.js.map +1 -0
  55. package/dist/components/card/card-thumbnail/card-thumbnail.module.css +10 -0
  56. package/dist/components/card/card-thumbnail/card-thumbnail.module.css.js +8 -0
  57. package/dist/components/card/card-thumbnail/card-thumbnail.module.css.js.map +1 -0
  58. package/dist/components/card/card-thumbnail/index.d.ts +2 -0
  59. package/dist/components/card/card-thumbnail/index.js +23 -0
  60. package/dist/components/card/card-thumbnail/index.js.map +1 -0
  61. package/dist/components/card/index.d.ts +3 -0
  62. package/dist/components/card/index.js +157 -0
  63. package/dist/components/card/index.js.map +1 -0
  64. package/dist/components/card/styles.module.css +98 -0
  65. package/dist/components/card/styles.module.css.js +29 -0
  66. package/dist/components/card/styles.module.css.js.map +1 -0
  67. package/dist/components/card/types.d.ts +52 -0
  68. package/dist/components/code-block/code-block.module.scss +511 -0
  69. package/dist/components/code-block/code-block.module.scss.js +34 -0
  70. package/dist/components/code-block/code-block.module.scss.js.map +1 -0
  71. package/dist/components/code-block/code-lines/index.d.ts +12 -0
  72. package/dist/components/code-block/code-lines/index.js +59 -0
  73. package/dist/components/code-block/code-lines/index.js.map +1 -0
  74. package/dist/components/code-block/code-lines/utils/split-html-into-lines.d.ts +19 -0
  75. package/dist/components/code-block/code-lines/utils/split-html-into-lines.js +19 -0
  76. package/dist/components/code-block/code-lines/utils/split-html-into-lines.js.map +1 -0
  77. package/dist/components/code-block/code-lines/utils/split-jsx-into-lines.d.ts +21 -0
  78. package/dist/components/code-block/code-lines/utils/split-jsx-into-lines.js +31 -0
  79. package/dist/components/code-block/code-lines/utils/split-jsx-into-lines.js.map +1 -0
  80. package/dist/components/code-block/hidden-copy-content/index.d.ts +5 -0
  81. package/dist/components/code-block/hidden-copy-content/index.js +13 -0
  82. package/dist/components/code-block/hidden-copy-content/index.js.map +1 -0
  83. package/dist/components/code-block/index.d.ts +55 -0
  84. package/dist/components/code-block/index.js +88 -0
  85. package/dist/components/code-block/index.js.map +1 -0
  86. package/dist/components/code-block/utils/parse-highlighted-lines.d.ts +2 -0
  87. package/dist/components/code-block/utils/parse-highlighted-lines.js +39 -0
  88. package/dist/components/code-block/utils/parse-highlighted-lines.js.map +1 -0
  89. package/dist/components/code-block/utils/process-snippet.d.ts +12 -0
  90. package/dist/components/code-block/utils/process-snippet.js +20 -0
  91. package/dist/components/code-block/utils/process-snippet.js.map +1 -0
  92. package/dist/components/code-block/utils/shellwords.d.ts +14 -0
  93. package/dist/components/code-block/utils/shellwords.js +33 -0
  94. package/dist/components/code-block/utils/shellwords.js.map +1 -0
  95. package/dist/components/combo-box-primitive/index.d.ts +69 -0
  96. package/dist/components/combo-box-primitive/index.js +302 -0
  97. package/dist/components/combo-box-primitive/index.js.map +1 -0
  98. package/dist/components/dialog-primitive/dialog.module.scss +38 -0
  99. package/dist/components/dialog-primitive/dialog.module.scss.js +12 -0
  100. package/dist/components/dialog-primitive/dialog.module.scss.js.map +1 -0
  101. package/dist/components/dialog-primitive/index.d.ts +12 -0
  102. package/dist/components/dialog-primitive/index.js +15 -0
  103. package/dist/components/dialog-primitive/index.js.map +1 -0
  104. package/dist/components/disclosure-primitive/index.d.ts +19 -0
  105. package/dist/components/disclosure-primitive/index.js +57 -0
  106. package/dist/components/disclosure-primitive/index.js.map +1 -0
  107. package/dist/components/disclosure-primitive/styles.module.css +3 -0
  108. package/dist/components/disclosure-primitive/styles.module.css.js +7 -0
  109. package/dist/components/disclosure-primitive/styles.module.css.js.map +1 -0
  110. package/dist/components/disclosure-primitive/use-disclosure-primitive.d.ts +11 -0
  111. package/dist/components/disclosure-primitive/use-disclosure-primitive.js +17 -0
  112. package/dist/components/disclosure-primitive/use-disclosure-primitive.js.map +1 -0
  113. package/dist/components/dismiss-button/index.d.ts +9 -0
  114. package/dist/components/dismiss-button/index.js +22 -0
  115. package/dist/components/dismiss-button/index.js.map +1 -0
  116. package/dist/components/dismiss-button/styles.module.scss +31 -0
  117. package/dist/components/dismiss-button/styles.module.scss.js +7 -0
  118. package/dist/components/dismiss-button/styles.module.scss.js.map +1 -0
  119. package/dist/components/dropdown/index.d.ts +72 -0
  120. package/dist/components/dropdown/index.js +79 -0
  121. package/dist/components/dropdown/index.js.map +1 -0
  122. package/dist/components/dropdown/list-item/custom.d.ts +10 -0
  123. package/dist/components/dropdown/list-item/custom.js +9 -0
  124. package/dist/components/dropdown/list-item/custom.js.map +1 -0
  125. package/dist/components/dropdown/list-item/index.d.ts +19 -0
  126. package/dist/components/dropdown/list-item/index.js +14 -0
  127. package/dist/components/dropdown/list-item/index.js.map +1 -0
  128. package/dist/components/dropdown/list-item/interactive.d.ts +29 -0
  129. package/dist/components/dropdown/list-item/interactive.js +49 -0
  130. package/dist/components/dropdown/list-item/interactive.js.map +1 -0
  131. package/dist/components/dropdown/list-item/separator.d.ts +8 -0
  132. package/dist/components/dropdown/list-item/separator.js +17 -0
  133. package/dist/components/dropdown/list-item/separator.js.map +1 -0
  134. package/dist/components/dropdown/list-item/styles.module.css +222 -0
  135. package/dist/components/dropdown/list-item/styles.module.css.js +26 -0
  136. package/dist/components/dropdown/list-item/styles.module.css.js.map +1 -0
  137. package/dist/components/dropdown/list-item/title.d.ts +10 -0
  138. package/dist/components/dropdown/list-item/title.js +9 -0
  139. package/dist/components/dropdown/list-item/title.js.map +1 -0
  140. package/dist/components/dropdown/styles.module.css +74 -0
  141. package/dist/components/dropdown/styles.module.css.js +24 -0
  142. package/dist/components/dropdown/styles.module.css.js.map +1 -0
  143. package/dist/components/dropdown/toggle-button/index.d.ts +30 -0
  144. package/dist/components/dropdown/toggle-button/index.js +54 -0
  145. package/dist/components/dropdown/toggle-button/index.js.map +1 -0
  146. package/dist/components/dropdown/toggle-button/styles.module.scss +54 -0
  147. package/dist/components/dropdown/toggle-button/styles.module.scss.js +14 -0
  148. package/dist/components/dropdown/toggle-button/styles.module.scss.js.map +1 -0
  149. package/dist/components/flight-icon/flight-icon.module.css +31 -0
  150. package/dist/components/flight-icon/flight-icon.module.css.js +12 -0
  151. package/dist/components/flight-icon/flight-icon.module.css.js.map +1 -0
  152. package/dist/components/flight-icon/index.d.ts +44 -0
  153. package/dist/components/flight-icon/index.js +58 -0
  154. package/dist/components/flight-icon/index.js.map +1 -0
  155. package/dist/components/form/checkbox/form-checkbox.module.css +88 -0
  156. package/dist/components/form/checkbox/form-checkbox.module.css.js +8 -0
  157. package/dist/components/form/checkbox/form-checkbox.module.css.js.map +1 -0
  158. package/dist/components/form/checkbox/index.d.ts +45 -0
  159. package/dist/components/form/checkbox/index.js +109 -0
  160. package/dist/components/form/checkbox/index.js.map +1 -0
  161. package/dist/components/form/error/form-error.module.css +23 -0
  162. package/dist/components/form/error/form-error.module.css.js +14 -0
  163. package/dist/components/form/error/form-error.module.css.js.map +1 -0
  164. package/dist/components/form/error/index.d.ts +16 -0
  165. package/dist/components/form/error/index.js +22 -0
  166. package/dist/components/form/error/index.js.map +1 -0
  167. package/dist/components/form/field/form-field.module.css +79 -0
  168. package/dist/components/form/field/form-field.module.css.js +17 -0
  169. package/dist/components/form/field/form-field.module.css.js.map +1 -0
  170. package/dist/components/form/field/index.d.ts +19 -0
  171. package/dist/components/form/field/index.js +46 -0
  172. package/dist/components/form/field/index.js.map +1 -0
  173. package/dist/components/form/fieldset/form-fieldset.module.css +48 -0
  174. package/dist/components/form/fieldset/form-fieldset.module.css.js +19 -0
  175. package/dist/components/form/fieldset/form-fieldset.module.css.js.map +1 -0
  176. package/dist/components/form/fieldset/index.d.ts +19 -0
  177. package/dist/components/form/fieldset/index.js +65 -0
  178. package/dist/components/form/fieldset/index.js.map +1 -0
  179. package/dist/components/form/file-input/form-file-input.module.scss +81 -0
  180. package/dist/components/form/file-input/form-file-input.module.scss.js +7 -0
  181. package/dist/components/form/file-input/form-file-input.module.scss.js.map +1 -0
  182. package/dist/components/form/file-input/index.d.ts +27 -0
  183. package/dist/components/form/file-input/index.js +68 -0
  184. package/dist/components/form/file-input/index.js.map +1 -0
  185. package/dist/components/form/helper-text/form-helper-text.module.css +10 -0
  186. package/dist/components/form/helper-text/form-helper-text.module.css.js +7 -0
  187. package/dist/components/form/helper-text/form-helper-text.module.css.js.map +1 -0
  188. package/dist/components/form/helper-text/index.d.ts +11 -0
  189. package/dist/components/form/helper-text/index.js +22 -0
  190. package/dist/components/form/helper-text/index.js.map +1 -0
  191. package/dist/components/form/indicator/form-indicator.module.css +10 -0
  192. package/dist/components/form/indicator/form-indicator.module.css.js +8 -0
  193. package/dist/components/form/indicator/form-indicator.module.css.js.map +1 -0
  194. package/dist/components/form/indicator/index.d.ts +9 -0
  195. package/dist/components/form/indicator/index.js +22 -0
  196. package/dist/components/form/indicator/index.js.map +1 -0
  197. package/dist/components/form/label/form-label.module.css +15 -0
  198. package/dist/components/form/label/form-label.module.css.js +10 -0
  199. package/dist/components/form/label/form-label.module.css.js.map +1 -0
  200. package/dist/components/form/label/index.d.ts +14 -0
  201. package/dist/components/form/label/index.js +33 -0
  202. package/dist/components/form/label/index.js.map +1 -0
  203. package/dist/components/form/legend/form-legend.module.css +17 -0
  204. package/dist/components/form/legend/form-legend.module.css.js +10 -0
  205. package/dist/components/form/legend/form-legend.module.css.js.map +1 -0
  206. package/dist/components/form/legend/index.d.ts +12 -0
  207. package/dist/components/form/legend/index.js +19 -0
  208. package/dist/components/form/legend/index.js.map +1 -0
  209. package/dist/components/form/radio/form-radio.module.scss +74 -0
  210. package/dist/components/form/radio/form-radio.module.scss.js +8 -0
  211. package/dist/components/form/radio/form-radio.module.scss.js.map +1 -0
  212. package/dist/components/form/radio/index.d.ts +44 -0
  213. package/dist/components/form/radio/index.js +100 -0
  214. package/dist/components/form/radio/index.js.map +1 -0
  215. package/dist/components/form/radio-card/description.d.ts +3 -0
  216. package/dist/components/form/radio-card/description.js +10 -0
  217. package/dist/components/form/radio-card/description.js.map +1 -0
  218. package/dist/components/form/radio-card/form-radio-card.module.css +153 -0
  219. package/dist/components/form/radio-card/form-radio-card.module.css.js +30 -0
  220. package/dist/components/form/radio-card/form-radio-card.module.css.js.map +1 -0
  221. package/dist/components/form/radio-card/group.d.ts +11 -0
  222. package/dist/components/form/radio-card/group.js +31 -0
  223. package/dist/components/form/radio-card/group.js.map +1 -0
  224. package/dist/components/form/radio-card/index.d.ts +48 -0
  225. package/dist/components/form/radio-card/index.js +67 -0
  226. package/dist/components/form/radio-card/index.js.map +1 -0
  227. package/dist/components/form/radio-card/label.d.ts +3 -0
  228. package/dist/components/form/radio-card/label.js +10 -0
  229. package/dist/components/form/radio-card/label.js.map +1 -0
  230. package/dist/components/form/select/form-select.module.css +89 -0
  231. package/dist/components/form/select/form-select.module.css.js +14 -0
  232. package/dist/components/form/select/form-select.module.css.js.map +1 -0
  233. package/dist/components/form/select/index.d.ts +21 -0
  234. package/dist/components/form/select/index.js +79 -0
  235. package/dist/components/form/select/index.js.map +1 -0
  236. package/dist/components/form/super-select/form-super-select.module.css +155 -0
  237. package/dist/components/form/super-select/form-super-select.module.css.js +22 -0
  238. package/dist/components/form/super-select/form-super-select.module.css.js.map +1 -0
  239. package/dist/components/form/super-select/index.d.ts +55 -0
  240. package/dist/components/form/super-select/index.js +170 -0
  241. package/dist/components/form/super-select/index.js.map +1 -0
  242. package/dist/components/form/text-input/index.d.ts +98 -0
  243. package/dist/components/form/text-input/index.js +91 -0
  244. package/dist/components/form/text-input/index.js.map +1 -0
  245. package/dist/components/form/text-input/styles.module.css +158 -0
  246. package/dist/components/form/text-input/styles.module.css.js +15 -0
  247. package/dist/components/form/text-input/styles.module.css.js.map +1 -0
  248. package/dist/components/form/textarea/form-textarea.module.css +88 -0
  249. package/dist/components/form/textarea/form-textarea.module.css.js +14 -0
  250. package/dist/components/form/textarea/form-textarea.module.css.js.map +1 -0
  251. package/dist/components/form/textarea/index.d.ts +19 -0
  252. package/dist/components/form/textarea/index.js +74 -0
  253. package/dist/components/form/textarea/index.js.map +1 -0
  254. package/dist/components/form/toggle/form-toggle.module.scss +164 -0
  255. package/dist/components/form/toggle/form-toggle.module.scss.js +12 -0
  256. package/dist/components/form/toggle/form-toggle.module.scss.js.map +1 -0
  257. package/dist/components/form/toggle/index.d.ts +78 -0
  258. package/dist/components/form/toggle/index.js +102 -0
  259. package/dist/components/form/toggle/index.js.map +1 -0
  260. package/dist/components/hds/wrappers/tooltip.d.ts +13 -0
  261. package/dist/components/hds/wrappers/tooltip.js +51 -0
  262. package/dist/components/hds/wrappers/tooltip.js.map +1 -0
  263. package/dist/components/icon-tile/index.d.ts +21 -0
  264. package/dist/components/icon-tile/index.js +50 -0
  265. package/dist/components/icon-tile/index.js.map +1 -0
  266. package/dist/components/icon-tile/style.module.scss +136 -0
  267. package/dist/components/icon-tile/style.module.scss.js +29 -0
  268. package/dist/components/icon-tile/style.module.scss.js.map +1 -0
  269. package/dist/components/index.d.ts +60 -0
  270. package/dist/components/index.js +119 -0
  271. package/dist/components/index.js.map +1 -0
  272. package/dist/components/inline-link/index.d.ts +40 -0
  273. package/dist/components/inline-link/index.js +33 -0
  274. package/dist/components/inline-link/index.js.map +1 -0
  275. package/dist/components/inline-link/inline-link.module.css +49 -0
  276. package/dist/components/inline-link/inline-link.module.css.js +11 -0
  277. package/dist/components/inline-link/inline-link.module.css.js.map +1 -0
  278. package/dist/components/interactive/index.d.ts +26 -0
  279. package/dist/components/interactive/index.js +59 -0
  280. package/dist/components/interactive/index.js.map +1 -0
  281. package/dist/components/legacy-button/index.d.ts +5 -0
  282. package/dist/components/legacy-button/index.js +65 -0
  283. package/dist/components/legacy-button/index.js.map +1 -0
  284. package/dist/components/legacy-button/types.d.ts +37 -0
  285. package/dist/components/legacy-button/utils.d.ts +9 -0
  286. package/dist/components/legacy-button/utils.js +39 -0
  287. package/dist/components/legacy-button/utils.js.map +1 -0
  288. package/dist/components/menu-primitive/index.d.ts +14 -0
  289. package/dist/components/menu-primitive/index.js +68 -0
  290. package/dist/components/menu-primitive/index.js.map +1 -0
  291. package/dist/components/menu-primitive/styles.module.css +16 -0
  292. package/dist/components/menu-primitive/styles.module.css.js +12 -0
  293. package/dist/components/menu-primitive/styles.module.css.js.map +1 -0
  294. package/dist/components/menu-primitive/use-menu-primitive.d.ts +9 -0
  295. package/dist/components/menu-primitive/use-menu-primitive.js +17 -0
  296. package/dist/components/menu-primitive/use-menu-primitive.js.map +1 -0
  297. package/dist/components/modal/index.d.ts +13 -0
  298. package/dist/components/modal/index.js +61 -0
  299. package/dist/components/modal/index.js.map +1 -0
  300. package/dist/components/modal/modal.module.css +22 -0
  301. package/dist/components/modal/modal.module.css.js +8 -0
  302. package/dist/components/modal/modal.module.css.js.map +1 -0
  303. package/dist/components/modal/use-modal.d.ts +8 -0
  304. package/dist/components/modal/use-modal.js +17 -0
  305. package/dist/components/modal/use-modal.js.map +1 -0
  306. package/dist/components/separator/index.d.ts +10 -0
  307. package/dist/components/separator/index.js +15 -0
  308. package/dist/components/separator/index.js.map +1 -0
  309. package/dist/components/separator/separator.module.css +15 -0
  310. package/dist/components/separator/separator.module.css.js +10 -0
  311. package/dist/components/separator/separator.module.css.js.map +1 -0
  312. package/dist/components/standalone-link/index.d.ts +23 -0
  313. package/dist/components/standalone-link/index.js +54 -0
  314. package/dist/components/standalone-link/index.js.map +1 -0
  315. package/dist/components/standalone-link/styles.module.scss +166 -0
  316. package/dist/components/standalone-link/styles.module.scss.js +17 -0
  317. package/dist/components/standalone-link/styles.module.scss.js.map +1 -0
  318. package/dist/components/table/index.d.ts +58 -0
  319. package/dist/components/table/index.js +52 -0
  320. package/dist/components/table/index.js.map +1 -0
  321. package/dist/components/table/table.module.scss +192 -0
  322. package/dist/components/table/table.module.scss.js +33 -0
  323. package/dist/components/table/table.module.scss.js.map +1 -0
  324. package/dist/components/table/td.d.ts +17 -0
  325. package/dist/components/table/td.js +28 -0
  326. package/dist/components/table/td.js.map +1 -0
  327. package/dist/components/table/th-button-tooltip.d.ts +6 -0
  328. package/dist/components/table/th-button-tooltip.js +24 -0
  329. package/dist/components/table/th-button-tooltip.js.map +1 -0
  330. package/dist/components/table/th.d.ts +34 -0
  331. package/dist/components/table/th.js +43 -0
  332. package/dist/components/table/th.js.map +1 -0
  333. package/dist/components/table/tr.d.ts +12 -0
  334. package/dist/components/table/tr.js +9 -0
  335. package/dist/components/table/tr.js.map +1 -0
  336. package/dist/components/table/utils.d.ts +16 -0
  337. package/dist/components/table/utils.js +28 -0
  338. package/dist/components/table/utils.js.map +1 -0
  339. package/dist/components/tabs/index.d.ts +21 -0
  340. package/dist/components/tabs/index.js +117 -0
  341. package/dist/components/tabs/index.js.map +1 -0
  342. package/dist/components/tabs/tab-panel.d.ts +5 -0
  343. package/dist/components/tabs/tab-panel.js +35 -0
  344. package/dist/components/tabs/tab-panel.js.map +1 -0
  345. package/dist/components/tabs/tab.d.ts +24 -0
  346. package/dist/components/tabs/tab.js +70 -0
  347. package/dist/components/tabs/tab.js.map +1 -0
  348. package/dist/components/tabs/tabs.module.scss +163 -0
  349. package/dist/components/tabs/tabs.module.scss.js +22 -0
  350. package/dist/components/tabs/tabs.module.scss.js.map +1 -0
  351. package/dist/components/tabs/use-tabs-context.d.ts +15 -0
  352. package/dist/components/tabs/use-tabs-context.js +16 -0
  353. package/dist/components/tabs/use-tabs-context.js.map +1 -0
  354. package/dist/components/text/index.d.ts +44 -0
  355. package/dist/components/text/index.js +112 -0
  356. package/dist/components/text/index.js.map +1 -0
  357. package/dist/components/text/style.module.scss +11 -0
  358. package/dist/components/text/style.module.scss.js +9 -0
  359. package/dist/components/text/style.module.scss.js.map +1 -0
  360. package/dist/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.d.ts +8 -0
  361. package/dist/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.js +62 -0
  362. package/dist/components/visualizations/bar-chart/horizontal-chart/dataset-value/index.js.map +1 -0
  363. package/dist/components/visualizations/bar-chart/horizontal-chart/dataset-value/style.module.css +76 -0
  364. package/dist/components/visualizations/bar-chart/horizontal-chart/dataset-value/style.module.css.js +20 -0
  365. package/dist/components/visualizations/bar-chart/horizontal-chart/dataset-value/style.module.css.js.map +1 -0
  366. package/dist/components/visualizations/bar-chart/horizontal-chart/index.d.ts +44 -0
  367. package/dist/components/visualizations/bar-chart/horizontal-chart/index.js +104 -0
  368. package/dist/components/visualizations/bar-chart/horizontal-chart/index.js.map +1 -0
  369. package/dist/components/visualizations/bar-chart/horizontal-chart/legend/index.d.ts +10 -0
  370. package/dist/components/visualizations/bar-chart/horizontal-chart/legend/index.js +13 -0
  371. package/dist/components/visualizations/bar-chart/horizontal-chart/legend/index.js.map +1 -0
  372. package/dist/components/visualizations/bar-chart/horizontal-chart/legend/style.module.css +29 -0
  373. package/dist/components/visualizations/bar-chart/horizontal-chart/legend/style.module.css.js +14 -0
  374. package/dist/components/visualizations/bar-chart/horizontal-chart/legend/style.module.css.js.map +1 -0
  375. package/dist/components/visualizations/bar-chart/horizontal-chart/style.module.css +76 -0
  376. package/dist/components/visualizations/bar-chart/horizontal-chart/style.module.css.js +28 -0
  377. package/dist/components/visualizations/bar-chart/horizontal-chart/style.module.css.js.map +1 -0
  378. package/dist/components/visualizations/bar-chart/index.d.ts +13 -0
  379. package/dist/components/visualizations/bar-chart/index.js +37 -0
  380. package/dist/components/visualizations/bar-chart/index.js.map +1 -0
  381. package/dist/components/visualizations/bar-chart/style.module.css +39 -0
  382. package/dist/components/visualizations/bar-chart/style.module.css.js +12 -0
  383. package/dist/components/visualizations/bar-chart/style.module.css.js.map +1 -0
  384. package/dist/components/visualizations/donut-chart/components/arc-tooltip/index.d.ts +3 -0
  385. package/dist/components/visualizations/donut-chart/components/arc-tooltip/index.js +14 -0
  386. package/dist/components/visualizations/donut-chart/components/arc-tooltip/index.js.map +1 -0
  387. package/dist/components/visualizations/donut-chart/components/arc-tooltip/styles.module.css +14 -0
  388. package/dist/components/visualizations/donut-chart/components/arc-tooltip/styles.module.css.js +10 -0
  389. package/dist/components/visualizations/donut-chart/components/arc-tooltip/styles.module.css.js.map +1 -0
  390. package/dist/components/visualizations/donut-chart/components/external-arc-label/index.d.ts +3 -0
  391. package/dist/components/visualizations/donut-chart/components/external-arc-label/index.js +58 -0
  392. package/dist/components/visualizations/donut-chart/components/external-arc-label/index.js.map +1 -0
  393. package/dist/components/visualizations/donut-chart/components/external-arc-label/styles.module.css +32 -0
  394. package/dist/components/visualizations/donut-chart/components/external-arc-label/styles.module.css.js +16 -0
  395. package/dist/components/visualizations/donut-chart/components/external-arc-label/styles.module.css.js.map +1 -0
  396. package/dist/components/visualizations/donut-chart/components/index.d.ts +3 -0
  397. package/dist/components/visualizations/donut-chart/components/internal-arc-label/index.d.ts +3 -0
  398. package/dist/components/visualizations/donut-chart/components/internal-arc-label/index.js +42 -0
  399. package/dist/components/visualizations/donut-chart/components/internal-arc-label/index.js.map +1 -0
  400. package/dist/components/visualizations/donut-chart/components/internal-arc-label/styles.module.css +20 -0
  401. package/dist/components/visualizations/donut-chart/components/internal-arc-label/styles.module.css.js +14 -0
  402. package/dist/components/visualizations/donut-chart/components/internal-arc-label/styles.module.css.js.map +1 -0
  403. package/dist/components/visualizations/donut-chart/index.d.ts +10 -0
  404. package/dist/components/visualizations/donut-chart/index.js +90 -0
  405. package/dist/components/visualizations/donut-chart/index.js.map +1 -0
  406. package/dist/components/visualizations/donut-chart/styles.module.css +73 -0
  407. package/dist/components/visualizations/donut-chart/styles.module.css.js +20 -0
  408. package/dist/components/visualizations/donut-chart/styles.module.css.js.map +1 -0
  409. package/dist/components/visualizations/donut-chart/types.d.ts +16 -0
  410. package/dist/hooks/use-media-query/index.js +16 -0
  411. package/dist/hooks/use-media-query/index.js.map +1 -0
  412. package/dist/index.d.ts +3 -0
  413. package/dist/index.js +158 -0
  414. package/dist/index.js.map +1 -0
  415. package/dist/patterns/card/index.d.ts +5 -0
  416. package/dist/patterns/card/newsroom-card/index.d.ts +15 -0
  417. package/dist/patterns/card/newsroom-card/index.js +26 -0
  418. package/dist/patterns/card/newsroom-card/index.js.map +1 -0
  419. package/dist/patterns/card/newsroom-card/style.module.css +12 -0
  420. package/dist/patterns/card/newsroom-card/style.module.css.js +8 -0
  421. package/dist/patterns/card/newsroom-card/style.module.css.js.map +1 -0
  422. package/dist/patterns/card/partner-card/index.d.ts +18 -0
  423. package/dist/patterns/card/partner-card/index.js +42 -0
  424. package/dist/patterns/card/partner-card/index.js.map +1 -0
  425. package/dist/patterns/card/partner-card/style.module.css +24 -0
  426. package/dist/patterns/card/partner-card/style.module.css.js +12 -0
  427. package/dist/patterns/card/partner-card/style.module.css.js.map +1 -0
  428. package/dist/patterns/card/person-card/index.d.ts +15 -0
  429. package/dist/patterns/card/person-card/index.js +52 -0
  430. package/dist/patterns/card/person-card/index.js.map +1 -0
  431. package/dist/patterns/card/person-card/style.module.css +28 -0
  432. package/dist/patterns/card/person-card/style.module.css.js +12 -0
  433. package/dist/patterns/card/person-card/style.module.css.js.map +1 -0
  434. package/dist/patterns/card/primitives.d.ts +37 -0
  435. package/dist/patterns/card/primitives.js +77 -0
  436. package/dist/patterns/card/primitives.js.map +1 -0
  437. package/dist/patterns/card/promo-card/index.d.ts +18 -0
  438. package/dist/patterns/card/promo-card/index.js +36 -0
  439. package/dist/patterns/card/promo-card/index.js.map +1 -0
  440. package/dist/patterns/card/resource-card/index.d.ts +16 -0
  441. package/dist/patterns/card/resource-card/index.js +26 -0
  442. package/dist/patterns/card/resource-card/index.js.map +1 -0
  443. package/dist/patterns/card/style.module.css +121 -0
  444. package/dist/patterns/card/style.module.css.js +30 -0
  445. package/dist/patterns/card/style.module.css.js.map +1 -0
  446. package/dist/patterns/card/thumbnails/index.d.ts +13 -0
  447. package/dist/patterns/card/thumbnails/index.js +25 -0
  448. package/dist/patterns/card/thumbnails/index.js.map +1 -0
  449. package/dist/patterns/card/types.d.ts +41 -0
  450. package/dist/patterns/card/unified-card/index.d.ts +10 -0
  451. package/dist/patterns/card/unified-card/index.js +37 -0
  452. package/dist/patterns/card/unified-card/index.js.map +1 -0
  453. package/dist/patterns/copy-button/clipboard.d.ts +16 -0
  454. package/dist/patterns/copy-button/clipboard.js +78 -0
  455. package/dist/patterns/copy-button/clipboard.js.map +1 -0
  456. package/dist/patterns/copy-button/index.d.ts +19 -0
  457. package/dist/patterns/copy-button/index.js +57 -0
  458. package/dist/patterns/copy-button/index.js.map +1 -0
  459. package/dist/patterns/copy-button/style.module.css +23 -0
  460. package/dist/patterns/copy-button/style.module.css.js +13 -0
  461. package/dist/patterns/copy-button/style.module.css.js.map +1 -0
  462. package/dist/patterns/index.d.ts +15 -0
  463. package/dist/patterns/index.js +35 -0
  464. package/dist/patterns/index.js.map +1 -0
  465. package/dist/patterns/layout/index.d.ts +69 -0
  466. package/dist/patterns/layout/index.js +47 -0
  467. package/dist/patterns/layout/index.js.map +1 -0
  468. package/dist/patterns/layout/layout.module.css +72 -0
  469. package/dist/patterns/layout/layout.module.css.js +20 -0
  470. package/dist/patterns/layout/layout.module.css.js.map +1 -0
  471. package/dist/patterns/product-badge/index.d.ts +11 -0
  472. package/dist/patterns/product-badge/index.js +22 -0
  473. package/dist/patterns/product-badge/index.js.map +1 -0
  474. package/dist/patterns/product-badge/style.module.css +3 -0
  475. package/dist/patterns/product-badge/style.module.css.js +8 -0
  476. package/dist/patterns/product-badge/style.module.css.js.map +1 -0
  477. package/dist/patterns/product-logo/index.d.ts +48 -0
  478. package/dist/patterns/product-logo/index.js +130 -0
  479. package/dist/patterns/product-logo/index.js.map +1 -0
  480. package/dist/patterns/product-logo/product-logo.module.css +24 -0
  481. package/dist/patterns/product-logo/product-logo.module.css.js +13 -0
  482. package/dist/patterns/product-logo/product-logo.module.css.js.map +1 -0
  483. package/dist/patterns/related-content/index.d.ts +6 -0
  484. package/dist/patterns/related-content/index.js +65 -0
  485. package/dist/patterns/related-content/index.js.map +1 -0
  486. package/dist/patterns/related-content/style.module.css +74 -0
  487. package/dist/patterns/related-content/style.module.css.js +22 -0
  488. package/dist/patterns/related-content/style.module.css.js.map +1 -0
  489. package/dist/patterns/related-content/types.d.ts +14 -0
  490. package/dist/style.css +1 -0
  491. package/dist/styles/mixins/button.scss +284 -0
  492. package/dist/styles/mixins/focus-ring.scss +75 -0
  493. package/dist/utils/get-contrast-yiq.d.ts +20 -0
  494. package/dist/utils/get-contrast-yiq.js +13 -0
  495. package/dist/utils/get-contrast-yiq.js.map +1 -0
  496. package/dist/utils/hooks/use-screen-size.d.ts +5 -0
  497. package/dist/utils/hooks/use-screen-size.js +10 -0
  498. package/dist/utils/hooks/use-screen-size.js.map +1 -0
  499. package/dist/utils/i18n/index.d.ts +1 -0
  500. package/dist/utils/i18n/index.js +41 -0
  501. package/dist/utils/i18n/index.js.map +1 -0
  502. package/dist/utils/index.d.ts +3 -0
  503. package/dist/utils/index.js +10 -0
  504. package/dist/utils/index.js.map +1 -0
  505. package/dist/utils/make-normalizer/index.d.ts +30 -0
  506. package/dist/utils/make-normalizer/index.js +34 -0
  507. package/dist/utils/make-normalizer/index.js.map +1 -0
  508. package/dist/utils/mds-context/index.d.ts +59 -0
  509. package/dist/utils/mds-context/index.js +85 -0
  510. package/dist/utils/mds-context/index.js.map +1 -0
  511. package/package.json +113 -0
@@ -0,0 +1,110 @@
1
+ //
2
+ // ACCORDION
3
+ //
4
+
5
+ @use 'styles/mixins/button' as *;
6
+ @use 'styles/mixins/focus-ring' as *;
7
+
8
+ $item-padding: 16px;
9
+ $item-border-radius: 6px;
10
+
11
+ // ACCORDION COMPONENT (wrapper)
12
+
13
+ .accordion {
14
+ display: flex;
15
+ flex-direction: column;
16
+ gap: 12px;
17
+ }
18
+
19
+ // ACCORDION ITEM COMPONENT (nested child)
20
+
21
+ .item {
22
+ background: var(--mds-color-surface-primary);
23
+ border-radius: $item-border-radius;
24
+
25
+ &.does-not-contain-interactive {
26
+ box-shadow: var(--mds-surface-mid-box-shadow);
27
+
28
+ &:hover,
29
+ &:global(.mock-hover) {
30
+ box-shadow: var(--mds-surface-high-box-shadow);
31
+ }
32
+ }
33
+
34
+ &.contains-interactive {
35
+ box-shadow: var(--mds-surface-base-box-shadow);
36
+ }
37
+ }
38
+
39
+ // TOGGLE BLOCK
40
+
41
+ .toggle {
42
+ position: relative;
43
+ display: flex;
44
+ gap: 12px;
45
+ align-items: center;
46
+ padding: $item-padding $item-padding $item-padding 12px; // by design
47
+ }
48
+
49
+ .button {
50
+ padding: 0;
51
+
52
+ &:hover {
53
+ cursor: pointer;
54
+ }
55
+
56
+ & .icon {
57
+ @media (prefers-reduced-motion: no-preference) {
58
+ transition: transform 0.3s;
59
+ }
60
+
61
+ &.icon-rotate {
62
+ transform: rotate(-180deg);
63
+ }
64
+ }
65
+
66
+ // entire toggle area is interactive
67
+ &.parent-does-not-contain-interactive {
68
+ @include hds-focus-ring-with-pseudo-element();
69
+ position: static;
70
+ margin: -1px 0;
71
+ color: var(--mds-color-foreground-primary);
72
+ background: transparent;
73
+ border: 1px solid transparent;
74
+
75
+ // expand button target to cover entire AccordionItem Toggle block (depending on the `@containsInteractive/@parentContainsInteractive` argument)
76
+ &::after {
77
+ position: absolute;
78
+ display: block;
79
+ border-radius: $item-border-radius;
80
+ content: '';
81
+ inset: 0;
82
+ }
83
+ }
84
+
85
+ // only chevron button area is interactive
86
+ &.parent-contains-interactive {
87
+ @include hds-button();
88
+ width: 24px;
89
+ height: 24px;
90
+
91
+ &:focus,
92
+ &:global(.mock-focus) {
93
+ @include hds-button-state-focus();
94
+ }
95
+
96
+ // `hds-button-color-secondary` determines the focus color and needs to be placed after `hds-button-state-focus`
97
+ @include hds-button-color-secondary();
98
+ }
99
+ }
100
+
101
+ // Consumer added content that appears next to the chevron button:
102
+ .toggle-content {
103
+ flex: 1;
104
+ }
105
+
106
+ // CONTENT BLOCK
107
+
108
+ .content {
109
+ padding: 4px $item-padding $item-padding $item-padding;
110
+ }
@@ -0,0 +1,24 @@
1
+ const t = "accordion__tWR7C", n = "item__MYeus", o = "toggle__cD-PM", e = "button__e63te", c = "icon__xZL-n", i = "content__RNHA7", a = {
2
+ accordion: t,
3
+ item: n,
4
+ "does-not-contain-interactive": "does-not-contain-interactive__9u5oz",
5
+ "contains-interactive": "contains-interactive__7-Y60",
6
+ toggle: o,
7
+ button: e,
8
+ icon: c,
9
+ "icon-rotate": "icon-rotate__OTQtF",
10
+ "parent-does-not-contain-interactive": "parent-does-not-contain-interactive__H4GPb",
11
+ "parent-contains-interactive": "parent-contains-interactive__FGVlz",
12
+ "toggle-content": "toggle-content__6cjUu",
13
+ content: i
14
+ };
15
+ export {
16
+ t as accordion,
17
+ e as button,
18
+ i as content,
19
+ a as default,
20
+ c as icon,
21
+ n as item,
22
+ o as toggle
23
+ };
24
+ //# sourceMappingURL=style.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
@@ -0,0 +1,229 @@
1
+ //
2
+ // ALERT COMPONENT
3
+ //
4
+
5
+ .alert {
6
+ display: flex;
7
+ align-items: flex-start;
8
+ }
9
+
10
+ // ICON
11
+
12
+ .icon {
13
+ flex: none;
14
+ width: 20px;
15
+ height: 20px;
16
+ margin-right: 12px;
17
+
18
+ .type-compact & {
19
+ width: 14px;
20
+ height: 14px;
21
+ }
22
+ }
23
+
24
+ // CONTENT (TEXT + ACTIONS + GENERIC)
25
+
26
+ .content {
27
+ flex: 1 1 auto;
28
+ }
29
+
30
+ // TEXT (TITLE & DESCRIPTION)
31
+
32
+ .text {
33
+ display: flex;
34
+ flex-direction: column;
35
+ gap: 4px;
36
+ justify-content: center;
37
+ color: var(--mds-color-foreground-warning-on-surface);
38
+ }
39
+
40
+ .description {
41
+ word-break: break-word;
42
+
43
+ // we add very basic styling for elements that may be injected via the "description" string
44
+
45
+ strong {
46
+ font-weight: var(--mds-typography-font-weight-semibold);
47
+ }
48
+
49
+ code,
50
+ pre {
51
+ display: inline;
52
+ padding: 1px 5px;
53
+ font-size: 0.9em; // as discussed with designers, we reduce the size for optical/visual balance
54
+ font-family: var(--mds-typography-font-stack-mono);
55
+ line-height: 1em;
56
+ background-color: var(--mds-color-surface-primary);
57
+ border: 1px solid var(--mds-color-palette-neutral-200);
58
+ border-radius: 5px;
59
+ }
60
+
61
+ // Default styling for bare HTML links not using HDS::Link components
62
+ a:not([class*='hds-']) {
63
+ color: var(--mds-color-foreground-strong);
64
+
65
+ &:focus,
66
+ &:focus-visible {
67
+ text-decoration: none;
68
+ outline: 2px solid var(--mds-color-focus-action-internal);
69
+ outline-offset: 1px;
70
+ }
71
+
72
+ &:hover {
73
+ color: var(--mds-color-foreground-primary);
74
+ }
75
+
76
+ &:active {
77
+ color: var(--mds-color-foreground-faint);
78
+ }
79
+ }
80
+
81
+ *:where(p, ul, ol, h1, h2, h3, h4, h5, h6):first-child {
82
+ margin-top: 0;
83
+ }
84
+
85
+ *:where(p, ul, ol, h1, h2, h3, h4, h5, h6):last-child {
86
+ margin-bottom: 0;
87
+ }
88
+ }
89
+
90
+ // ACTIONS
91
+
92
+ .actions {
93
+ display: flex;
94
+ gap: 16px;
95
+ align-items: center;
96
+
97
+ > * {
98
+ margin-top: 16px;
99
+ }
100
+ }
101
+
102
+ // DISMISS
103
+
104
+ .dismiss-button-wrapper {
105
+ margin-top: 2px; // for alignment with the main icon and text
106
+ margin-left: 16px;
107
+ }
108
+
109
+ // TYPES
110
+
111
+ .type-page {
112
+ padding: 16px 48px; // by design
113
+ }
114
+
115
+ .type-inline {
116
+ padding: 16px;
117
+ border-style: solid;
118
+ border-width: 1px;
119
+ border-radius: 6px;
120
+ }
121
+
122
+ .type-compact {
123
+ .icon {
124
+ margin-top: 2px; // notice: the icon size for the "compact" type is 14px, not 20px, so this 2px extra are needed to reach the exact same height as the "description" text line-height
125
+ margin-right: 8px;
126
+ }
127
+
128
+ // extra safety
129
+ .title {
130
+ display: none;
131
+
132
+ & + .description {
133
+ margin-top: 0;
134
+ }
135
+ }
136
+ }
137
+
138
+ // COLORS (& TYPES)
139
+
140
+ .color-neutral {
141
+ &.type-page {
142
+ background-color: var(--mds-color-surface-faint);
143
+ box-shadow: 0 1px 0 0 var(--mds-color-palette-alpha-300);
144
+ }
145
+
146
+ &.type-inline {
147
+ background-color: var(--mds-color-surface-faint);
148
+ border-color: var(
149
+ --mds-color-border-strong
150
+ ); // notice: in the "neutral" color the "inline" has a slightly darker border color compared to the others to increase contrast (eg. could be used on a light gray background)
151
+ }
152
+
153
+ // different color by design
154
+ .icon {
155
+ color: var(--mds-color-foreground-faint);
156
+ }
157
+
158
+ .title {
159
+ color: var(--mds-color-foreground-primary);
160
+ }
161
+ }
162
+
163
+ .color-highlight {
164
+ &.type-page {
165
+ background-color: var(--mds-color-surface-highlight);
166
+ box-shadow: 0 1px 0 0 var(--mds-color-border-highlight);
167
+ }
168
+
169
+ &.type-inline {
170
+ background-color: var(--mds-color-surface-highlight);
171
+ border-color: var(--mds-color-border-highlight);
172
+ }
173
+
174
+ .icon,
175
+ .title {
176
+ color: var(--mds-color-foreground-highlight-on-surface);
177
+ }
178
+ }
179
+
180
+ .color-success {
181
+ &.type-page {
182
+ background-color: var(--mds-color-surface-success);
183
+ box-shadow: 0 1px 0 0 var(--mds-color-border-success);
184
+ }
185
+
186
+ &.type-inline {
187
+ background-color: var(--mds-color-surface-success);
188
+ border-color: var(--mds-color-border-success);
189
+ }
190
+
191
+ .icon,
192
+ .title {
193
+ color: var(--mds-color-foreground-success-on-surface);
194
+ }
195
+ }
196
+
197
+ .color-warning {
198
+ &.type-page {
199
+ background-color: var(--mds-color-surface-warning);
200
+ box-shadow: 0 1px 0 0 var(--mds-color-border-warning);
201
+ }
202
+
203
+ &.type-inline {
204
+ background-color: var(--mds-color-surface-warning);
205
+ border-color: var(--mds-color-border-warning);
206
+ }
207
+
208
+ .icon,
209
+ .title {
210
+ color: var(--mds-color-foreground-warning-on-surface);
211
+ }
212
+ }
213
+
214
+ .color-critical {
215
+ &.type-page {
216
+ background-color: var(--mds-color-surface-critical);
217
+ box-shadow: 0 1px 0 0 var(--mds-color-border-critical);
218
+ }
219
+
220
+ &.type-inline {
221
+ background-color: var(--mds-color-surface-critical);
222
+ border-color: var(--mds-color-border-critical);
223
+ }
224
+
225
+ .icon,
226
+ .title {
227
+ color: var(--mds-color-foreground-critical-on-surface);
228
+ }
229
+ }
@@ -0,0 +1,29 @@
1
+ const t = "alert__j7ZRS", o = "icon__vbZHd", c = "content__0FEM2", n = "text__qorMN", e = "description__PMywu", i = "actions__vQ07y", _ = "title__MWel2", s = {
2
+ alert: t,
3
+ icon: o,
4
+ "type-compact": "type-compact__ptTlw",
5
+ content: c,
6
+ text: n,
7
+ description: e,
8
+ actions: i,
9
+ "dismiss-button-wrapper": "dismiss-button-wrapper__vcfJ-",
10
+ "type-page": "type-page__tP9-W",
11
+ "type-inline": "type-inline__7sxYA",
12
+ title: _,
13
+ "color-neutral": "color-neutral__x4pkI",
14
+ "color-highlight": "color-highlight__64nTZ",
15
+ "color-success": "color-success__UMfyG",
16
+ "color-warning": "color-warning__V1hfX",
17
+ "color-critical": "color-critical__3hs0B"
18
+ };
19
+ export {
20
+ i as actions,
21
+ t as alert,
22
+ c as content,
23
+ s as default,
24
+ e as description,
25
+ o as icon,
26
+ n as text,
27
+ _ as title
28
+ };
29
+ //# sourceMappingURL=alert.module.scss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alert.module.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,9 @@
1
+ import { AlertColor, AlertProps } from '.';
2
+ import { FlightIconName } from '../flight-icon';
3
+ interface IconProps {
4
+ icon?: FlightIconName | false;
5
+ color: AlertColor;
6
+ type: AlertProps['type'];
7
+ }
8
+ declare const Icon: ({ icon, type, color }: IconProps) => import("react/jsx-runtime").JSX.Element | null;
9
+ export { Icon };
@@ -0,0 +1,34 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { FlightIcon as n } from "../flight-icon/index.js";
3
+ import r from "./alert.module.scss.js";
4
+ const a = {
5
+ neutral: {
6
+ compact: "info-fill",
7
+ default: "info"
8
+ },
9
+ highlight: {
10
+ compact: "info-fill",
11
+ default: "info"
12
+ },
13
+ success: {
14
+ compact: "check-circle-fill",
15
+ default: "check-circle"
16
+ },
17
+ warning: {
18
+ compact: "alert-triangle-fill",
19
+ default: "alert-triangle"
20
+ },
21
+ critical: {
22
+ compact: "alert-diamond-fill",
23
+ default: "alert-diamond"
24
+ }
25
+ }, s = ({ icon: t, type: e, color: c }) => {
26
+ if (t === !1)
27
+ return null;
28
+ const i = e === "compact" ? a[c].compact : a[c].default, o = t ?? i;
29
+ return /* @__PURE__ */ l("div", { className: r.icon, children: /* @__PURE__ */ l(n, { name: o, stretched: !0 }) });
30
+ };
31
+ export {
32
+ s as Icon
33
+ };
34
+ //# sourceMappingURL=icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon.js","sources":["../../../src/components/alert/icon.tsx"],"sourcesContent":["import type { AlertColor, AlertProps } from '.'\nimport type { FlightIconName } from '../flight-icon'\nimport { FlightIcon } from '../flight-icon'\nimport s from './alert.module.scss'\n\nconst ICON_BY_COLOR_AND_TYPE = {\n\tneutral: {\n\t\tcompact: 'info-fill',\n\t\tdefault: 'info',\n\t},\n\thighlight: {\n\t\tcompact: 'info-fill',\n\t\tdefault: 'info',\n\t},\n\tsuccess: {\n\t\tcompact: 'check-circle-fill',\n\t\tdefault: 'check-circle',\n\t},\n\twarning: {\n\t\tcompact: 'alert-triangle-fill',\n\t\tdefault: 'alert-triangle',\n\t},\n\tcritical: {\n\t\tcompact: 'alert-diamond-fill',\n\t\tdefault: 'alert-diamond',\n\t},\n} as const satisfies Record<\n\tAlertColor,\n\tRecord<'compact' | 'default', FlightIconName>\n>\n\ninterface IconProps {\n\ticon?: FlightIconName | false\n\tcolor: AlertColor\n\ttype: AlertProps['type']\n}\n\nconst Icon = ({ icon, type, color }: IconProps) => {\n\tif (icon === false) {\n\t\treturn null\n\t}\n\n\tconst defaultIconName: FlightIconName =\n\t\ttype === 'compact'\n\t\t\t? ICON_BY_COLOR_AND_TYPE[color].compact\n\t\t\t: ICON_BY_COLOR_AND_TYPE[color].default\n\n\tconst iconName = icon ?? defaultIconName\n\n\treturn (\n\t\t<div className={s.icon}>\n\t\t\t<FlightIcon name={iconName} stretched />\n\t\t</div>\n\t)\n}\n\nexport { Icon }\n"],"names":["ICON_BY_COLOR_AND_TYPE","Icon","icon","type","color","defaultIconName","iconName","jsx","s","FlightIcon"],"mappings":";;;AAKA,MAAMA,IAAyB;AAAA,EAC9B,SAAS;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,EAAA;AAAA,EAEV,WAAW;AAAA,IACV,SAAS;AAAA,IACT,SAAS;AAAA,EAAA;AAAA,EAEV,SAAS;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,EAAA;AAAA,EAEV,SAAS;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,EAAA;AAAA,EAEV,UAAU;AAAA,IACT,SAAS;AAAA,IACT,SAAS;AAAA,EAAA;AAEX,GAWMC,IAAO,CAAC,EAAE,MAAAC,GAAM,MAAAC,GAAM,OAAAC,QAAuB;AAClD,MAAIF,MAAS;AACZ,WAAO;AAGR,QAAMG,IACLF,MAAS,YACNH,EAAuBI,CAAK,EAAE,UAC9BJ,EAAuBI,CAAK,EAAE,SAE5BE,IAAWJ,KAAQG;AAEzB,SACC,gBAAAE,EAAC,OAAA,EAAI,WAAWC,EAAE,MACjB,UAAA,gBAAAD,EAACE,GAAA,EAAW,MAAMH,GAAU,WAAS,GAAA,CAAC,GACvC;AAEF;"}
@@ -0,0 +1,62 @@
1
+ import { StandaloneLinkProps } from '../standalone-link';
2
+ import { HTMLAttributes, PropsWithChildren, ReactNode } from 'react';
3
+ import { ButtonProps } from '../button';
4
+ import { FlightIconName } from '../flight-icon';
5
+ type AlertColor = 'neutral' | 'highlight' | 'success' | 'warning' | 'critical';
6
+ interface CommonAlertProps extends HTMLAttributes<HTMLDivElement> {
7
+ /**
8
+ * Sets the color scheme for `background`, `border`, `title`, and `description`, which cannot be overridden.
9
+ * `color` results in a default icon, which can be overridden.
10
+ * default: `neutral`
11
+ */
12
+ color?: AlertColor;
13
+ /**
14
+ * The alert can be dismissed by the user. When a function is passed, the "dismiss" button is displayed.
15
+ */
16
+ onDismiss?: () => void;
17
+ /**
18
+ * A string used for the title of the alert.
19
+ * Alert must have either a title or a description, or both.
20
+ */
21
+ title?: string;
22
+ /**
23
+ * A plain text string or basic html that is used for the description.
24
+ * Alert must have either a title or a description, or both.
25
+ */
26
+ description?: ReactNode;
27
+ /**
28
+ * Role for the alert.
29
+ * `alertdialog` should be used when the alert includes interactive elements (<Alert.Actions>).
30
+ * `alert` should be used for all other scenarios.
31
+ */
32
+ role: 'alert' | 'alertdialog';
33
+ }
34
+ type AlertProps = (CommonAlertProps & {
35
+ /** compact alerts must specify an icon */
36
+ type: 'compact';
37
+ /** an icon from the Flight Icon set or false to hide the default icon */
38
+ icon?: FlightIconName;
39
+ }) | (CommonAlertProps & {
40
+ /** page & inline alerts get an optional icon override */
41
+ type: 'page' | 'inline';
42
+ /** an icon from the Flight Icon set or false to hide the default icon */
43
+ icon?: FlightIconName | false;
44
+ });
45
+ declare const Alert: {
46
+ ({ type, color, icon, onDismiss, title, description, children, role, className, ...rest }: AlertProps): import("react/jsx-runtime").JSX.Element;
47
+ displayName: string;
48
+ };
49
+ declare const AlertActions: {
50
+ ({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
51
+ displayName: string;
52
+ };
53
+ declare const AlertButton: {
54
+ ({ ...props }: Exclude<ButtonProps, 'size'>): import("react/jsx-runtime").JSX.Element;
55
+ displayName: string;
56
+ };
57
+ declare const AlertStandaloneLink: {
58
+ ({ ...props }: Exclude<StandaloneLinkProps, 'size'>): import("react/jsx-runtime").JSX.Element;
59
+ displayName: string;
60
+ };
61
+ export { Alert, AlertActions, AlertButton, AlertStandaloneLink };
62
+ export type { AlertProps, AlertColor };
@@ -0,0 +1,97 @@
1
+ import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
+ import o from "classnames";
3
+ import { useId as u } from "react";
4
+ import { DismissButton as f } from "../dismiss-button/index.js";
5
+ import { StandaloneLink as N } from "../standalone-link/index.js";
6
+ import { Icon as g } from "./icon.js";
7
+ import { Button as A } from "../button/index.js";
8
+ import t from "./alert.module.scss.js";
9
+ const v = ({
10
+ type: r,
11
+ color: n = "neutral",
12
+ icon: d,
13
+ onDismiss: m,
14
+ title: a,
15
+ description: i,
16
+ children: c,
17
+ role: p,
18
+ className: y,
19
+ ...h
20
+ }) => {
21
+ if (!a && !i)
22
+ throw new Error(
23
+ "Alert must include either a title or a description, or both"
24
+ );
25
+ const s = u();
26
+ return /* @__PURE__ */ l(
27
+ "div",
28
+ {
29
+ className: o(
30
+ t.alert,
31
+ t[`type-${r}`],
32
+ t[`color-${n}`],
33
+ y
34
+ ),
35
+ role: p,
36
+ "aria-live": "polite",
37
+ "aria-labelledby": s,
38
+ ...h,
39
+ children: [
40
+ /* @__PURE__ */ e(g, { icon: d, type: r, color: n }),
41
+ /* @__PURE__ */ l("div", { className: t.content, children: [
42
+ /* @__PURE__ */ l(
43
+ "div",
44
+ {
45
+ className: o(
46
+ t.text,
47
+ r === "compact" ? "mds-typography-legacy-body-100" : "mds-typography-legacy-body-200"
48
+ ),
49
+ children: [
50
+ a && /* @__PURE__ */ e(
51
+ "div",
52
+ {
53
+ className: o(
54
+ t.title,
55
+ "mds-typography-font-weight-semibold"
56
+ ),
57
+ id: s,
58
+ children: a
59
+ }
60
+ ),
61
+ i && /* @__PURE__ */ e(
62
+ "div",
63
+ {
64
+ className: o(
65
+ t.description,
66
+ "mds-typography-font-weight-regular mds-foreground-primary"
67
+ ),
68
+ id: a ? void 0 : s,
69
+ children: i
70
+ }
71
+ )
72
+ ]
73
+ }
74
+ ),
75
+ c
76
+ ] }),
77
+ m && /* @__PURE__ */ e("div", { className: t["dismiss-button-wrapper"], children: /* @__PURE__ */ e(f, { onClick: m }) })
78
+ ]
79
+ }
80
+ );
81
+ };
82
+ v.displayName = "Alert";
83
+ const b = ({ children: r }) => /* @__PURE__ */ e("div", { className: t.actions, children: r });
84
+ b.displayName = "AlertActions";
85
+ const w = ({ ...r }) => /* @__PURE__ */ e(A, { size: "small", ...r });
86
+ w.displayName = "AlertButton";
87
+ const k = ({
88
+ ...r
89
+ }) => /* @__PURE__ */ e(N, { size: "small", ...r });
90
+ k.displayName = "AlertStandaloneLink";
91
+ export {
92
+ v as Alert,
93
+ b as AlertActions,
94
+ w as AlertButton,
95
+ k as AlertStandaloneLink
96
+ };
97
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/alert/index.tsx"],"sourcesContent":["import classNames from 'classnames'\nimport { useId } from 'react'\nimport { DismissButton } from '../dismiss-button'\nimport { StandaloneLink, type StandaloneLinkProps } from '../standalone-link'\nimport { Icon } from './icon'\nimport type { HTMLAttributes, PropsWithChildren, ReactNode } from 'react'\nimport type { ButtonProps } from '../button'\nimport { Button } from '../button'\nimport s from './alert.module.scss'\nimport type { FlightIconName } from '../flight-icon'\n\ntype AlertColor = 'neutral' | 'highlight' | 'success' | 'warning' | 'critical'\n\ninterface CommonAlertProps extends HTMLAttributes<HTMLDivElement> {\n\t/**\n\t * Sets the color scheme for `background`, `border`, `title`, and `description`, which cannot be overridden.\n\t * `color` results in a default icon, which can be overridden.\n\t * default: `neutral`\n\t */\n\tcolor?: AlertColor\n\t/**\n\t * The alert can be dismissed by the user. When a function is passed, the \"dismiss\" button is displayed.\n\t */\n\tonDismiss?: () => void\n\t/**\n\t * A string used for the title of the alert.\n\t * Alert must have either a title or a description, or both.\n\t */\n\ttitle?: string\n\t/**\n\t * A plain text string or basic html that is used for the description.\n\t * Alert must have either a title or a description, or both.\n\t */\n\tdescription?: ReactNode\n\t/**\n\t * Role for the alert.\n\t * `alertdialog` should be used when the alert includes interactive elements (<Alert.Actions>).\n\t * `alert` should be used for all other scenarios.\n\t */\n\trole: 'alert' | 'alertdialog'\n}\n\ntype AlertProps =\n\t| (CommonAlertProps & {\n\t\t\t/** compact alerts must specify an icon */\n\t\t\ttype: 'compact'\n\t\t\t/** an icon from the Flight Icon set or false to hide the default icon */\n\t\t\ticon?: FlightIconName\n\t })\n\t| (CommonAlertProps & {\n\t\t\t/** page & inline alerts get an optional icon override */\n\t\t\ttype: 'page' | 'inline'\n\t\t\t/** an icon from the Flight Icon set or false to hide the default icon */\n\t\t\ticon?: FlightIconName | false\n\t })\n\nconst Alert = ({\n\ttype,\n\tcolor = 'neutral',\n\ticon,\n\tonDismiss,\n\ttitle,\n\tdescription,\n\tchildren,\n\trole,\n\tclassName,\n\t...rest\n}: AlertProps) => {\n\tif (!title && !description) {\n\t\tthrow new Error(\n\t\t\t'Alert must include either a title or a description, or both'\n\t\t)\n\t}\n\n\t// `alertdialog` must have an accessible name so we use either the\n\t// title or the description as label for the alert\n\tconst generatedLabelId = useId()\n\n\treturn (\n\t\t<div\n\t\t\tclassName={classNames(\n\t\t\t\ts.alert,\n\t\t\t\ts[`type-${type}`],\n\t\t\t\ts[`color-${color}`],\n\t\t\t\tclassName\n\t\t\t)}\n\t\t\trole={role}\n\t\t\taria-live=\"polite\"\n\t\t\taria-labelledby={generatedLabelId}\n\t\t\t{...rest}\n\t\t>\n\t\t\t<Icon icon={icon} type={type} color={color} />\n\t\t\t<div className={s.content}>\n\t\t\t\t<div\n\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\ts.text,\n\t\t\t\t\t\ttype === 'compact'\n\t\t\t\t\t\t\t? 'mds-typography-legacy-body-100'\n\t\t\t\t\t\t\t: 'mds-typography-legacy-body-200'\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{title && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\ts.title,\n\t\t\t\t\t\t\t\t'mds-typography-font-weight-semibold'\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tid={generatedLabelId}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t\t{description && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={classNames(\n\t\t\t\t\t\t\t\ts.description,\n\t\t\t\t\t\t\t\t'mds-typography-font-weight-regular mds-foreground-primary'\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tid={!title ? generatedLabelId : undefined}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{description}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t\t{onDismiss && (\n\t\t\t\t<div className={s['dismiss-button-wrapper']}>\n\t\t\t\t\t<DismissButton onClick={onDismiss} />\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t)\n}\n\nAlert.displayName = 'Alert'\n\nconst AlertActions = ({ children }: PropsWithChildren) => {\n\treturn <div className={s.actions}>{children}</div>\n}\n\nAlertActions.displayName = 'AlertActions'\n\nconst AlertButton = ({ ...props }: Exclude<ButtonProps, 'size'>) => {\n\treturn <Button size=\"small\" {...props} />\n}\n\nAlertButton.displayName = 'AlertButton'\n\nconst AlertStandaloneLink = ({\n\t...props\n}: Exclude<StandaloneLinkProps, 'size'>) => {\n\treturn <StandaloneLink size=\"small\" {...props} />\n}\n\nAlertStandaloneLink.displayName = 'AlertStandaloneLink'\n\nexport { Alert, AlertActions, AlertButton, AlertStandaloneLink }\nexport type { AlertProps, AlertColor }\n"],"names":["Alert","type","color","icon","onDismiss","title","description","children","role","className","rest","generatedLabelId","useId","jsxs","classNames","s","jsx","Icon","DismissButton","AlertActions","AlertButton","props","Button","AlertStandaloneLink","StandaloneLink"],"mappings":";;;;;;;;AAwDA,MAAMA,IAAQ,CAAC;AAAA,EACd,MAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC;AAAA,EACA,GAAGC;AACJ,MAAkB;AACjB,MAAI,CAACL,KAAS,CAACC;AACd,UAAM,IAAI;AAAA,MACT;AAAA,IAAA;AAMF,QAAMK,IAAmBC,EAAA;AAEzB,SACC,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACA,WAAWC;AAAA,QACVC,EAAE;AAAA,QACFA,EAAE,QAAQd,CAAI,EAAE;AAAA,QAChBc,EAAE,SAASb,CAAK,EAAE;AAAA,QAClBO;AAAA,MAAA;AAAA,MAED,MAAAD;AAAA,MACA,aAAU;AAAA,MACV,mBAAiBG;AAAA,MAChB,GAAGD;AAAA,MAEJ,UAAA;AAAA,QAAA,gBAAAM,EAACC,GAAA,EAAK,MAAAd,GAAY,MAAAF,GAAY,OAAAC,EAAA,CAAc;AAAA,QAC5C,gBAAAW,EAAC,OAAA,EAAI,WAAWE,EAAE,SACjB,UAAA;AAAA,UAAA,gBAAAF;AAAA,YAAC;AAAA,YAAA;AAAA,cACA,WAAWC;AAAA,gBACVC,EAAE;AAAA,gBACFd,MAAS,YACN,mCACA;AAAA,cAAA;AAAA,cAGH,UAAA;AAAA,gBAAAI,KACA,gBAAAW;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACA,WAAWF;AAAA,sBACVC,EAAE;AAAA,sBACF;AAAA,oBAAA;AAAA,oBAED,IAAIJ;AAAA,oBAEH,UAAAN;AAAA,kBAAA;AAAA,gBAAA;AAAA,gBAGFC,KACA,gBAAAU;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACA,WAAWF;AAAA,sBACVC,EAAE;AAAA,sBACF;AAAA,oBAAA;AAAA,oBAED,IAAKV,IAA2B,SAAnBM;AAAA,oBAEZ,UAAAL;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UAAA;AAAA,UAGDC;AAAA,QAAA,GACF;AAAA,QACCH,KACA,gBAAAY,EAAC,OAAA,EAAI,WAAWD,EAAE,wBAAwB,GACzC,UAAA,gBAAAC,EAACE,GAAA,EAAc,SAASd,EAAA,CAAW,EAAA,CACpC;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAIJ;AAEAJ,EAAM,cAAc;AAEpB,MAAMmB,IAAe,CAAC,EAAE,UAAAZ,QAChB,gBAAAS,EAAC,OAAA,EAAI,WAAWD,EAAE,SAAU,UAAAR,GAAS;AAG7CY,EAAa,cAAc;AAE3B,MAAMC,IAAc,CAAC,EAAE,GAAGC,QAClB,gBAAAL,EAACM,GAAA,EAAO,MAAK,SAAS,GAAGD,GAAO;AAGxCD,EAAY,cAAc;AAE1B,MAAMG,IAAsB,CAAC;AAAA,EAC5B,GAAGF;AACJ,MACQ,gBAAAL,EAACQ,GAAA,EAAe,MAAK,SAAS,GAAGH,GAAO;AAGhDE,EAAoB,cAAc;"}
@@ -0,0 +1,30 @@
1
+ import { FlightIconName } from '../flight-icon';
2
+ declare const BADGE_SIZES: readonly ["small", "medium", "large"];
3
+ type BadgeSize = (typeof BADGE_SIZES)[number];
4
+ declare const BADGE_TYPES: readonly ["filled", "inverted", "outlined"];
5
+ type BadgeType = (typeof BADGE_TYPES)[number];
6
+ declare const BADGE_COLORS: readonly ["neutral", "neutral-dark-mode", "highlight", "success", "warning", "critical"];
7
+ type BadgeColor = (typeof BADGE_COLORS)[number];
8
+ interface BadgeProps {
9
+ /** Use this parameter to show an icon. */
10
+ icon?: FlightIconName;
11
+ /**
12
+ * The `iconColor` prop can be used to change the icon color. It works by setting
13
+ * the value of the icon SVG’s fill property.
14
+ */
15
+ iconColor?: string;
16
+ /** This indicates if the button will only contain an icon. An internal check is in place to ensure that accessible text is still applied to the component. */
17
+ iconOnly?: boolean;
18
+ /** The text of the Badge or value of the screen-reader only element if isIconOnly is set to true. If no text value is defined an error will be thrown. */
19
+ text: string;
20
+ size?: BadgeSize;
21
+ type?: BadgeType;
22
+ color?: BadgeColor;
23
+ className?: string;
24
+ }
25
+ declare const Badge: {
26
+ ({ icon, iconColor, iconOnly, text, size, type, color, className, ...rest }: BadgeProps): import("react/jsx-runtime").JSX.Element;
27
+ displayName: string;
28
+ };
29
+ export type { BadgeProps, BadgeColor, BadgeSize, BadgeType };
30
+ export { Badge, BADGE_COLORS, BADGE_SIZES, BADGE_TYPES };