@ember-eui/core 4.3.0 → 5.0.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (635) hide show
  1. package/addon/components/common.ts +1 -0
  2. package/addon/components/eui-accordion/index.hbs +106 -85
  3. package/addon/components/eui-accordion/index.ts +58 -19
  4. package/addon/components/eui-auto-sizer/index.hbs +3 -0
  5. package/addon/components/eui-auto-sizer/index.ts +175 -0
  6. package/addon/components/eui-avatar/index.hbs +7 -3
  7. package/addon/components/eui-badge/index.hbs +9 -3
  8. package/addon/components/eui-beta-badge/index.hbs +171 -19
  9. package/addon/components/eui-bottom-bar/index.hbs +43 -12
  10. package/addon/components/eui-bottom-bar/index.ts +75 -32
  11. package/addon/components/eui-breadcrumbs/index.hbs +98 -0
  12. package/addon/components/eui-breadcrumbs/index.ts +194 -0
  13. package/addon/components/eui-button/index.hbs +4 -4
  14. package/addon/components/eui-button-content/index.hbs +6 -2
  15. package/addon/components/eui-button-empty/index.hbs +60 -52
  16. package/addon/components/eui-button-icon/index.hbs +17 -3
  17. package/addon/components/eui-call-out/index.hbs +1 -0
  18. package/addon/components/eui-card/index.hbs +61 -47
  19. package/addon/components/eui-card/index.ts +27 -0
  20. package/addon/components/{eui-card/eui-card-select → eui-card-select}/index.hbs +2 -5
  21. package/addon/components/eui-card-select/index.ts +35 -0
  22. package/addon/components/eui-checkable-card/index.hbs +17 -11
  23. package/addon/components/eui-checkbox/index.hbs +11 -5
  24. package/addon/components/eui-checkbox/index.ts +15 -0
  25. package/addon/components/eui-code/index.hbs +14 -8
  26. package/addon/components/eui-code/index.ts +73 -0
  27. package/addon/components/eui-code-block/controls/index.hbs +26 -0
  28. package/addon/components/eui-code-block/full-screen-display/index.hbs +12 -0
  29. package/addon/components/eui-code-block/index.hbs +144 -9
  30. package/addon/components/eui-code-block/index.ts +290 -0
  31. package/addon/components/eui-code-block/virtualized/index.hbs +30 -0
  32. package/addon/components/eui-code-block/virtualized/index.ts +22 -0
  33. package/addon/components/eui-collapsible-nav/index.hbs +35 -44
  34. package/addon/components/eui-collapsible-nav/index.ts +161 -0
  35. package/addon/components/eui-collapsible-nav-group/index.hbs +114 -66
  36. package/addon/components/eui-combo-box/group/index.hbs +3 -3
  37. package/addon/components/eui-combo-box/index.hbs +8 -5
  38. package/addon/components/eui-combo-box/index.ts +89 -4
  39. package/addon/components/eui-combo-box/options/index.hbs +14 -2
  40. package/addon/components/eui-combo-box/options/index.js +22 -9
  41. package/addon/components/eui-combo-box/trigger/index.hbs +3 -1
  42. package/addon/components/eui-confirm-modal/index.hbs +1 -1
  43. package/addon/components/eui-copy/index.hbs +1 -4
  44. package/addon/components/eui-described-form-group/index.hbs +3 -2
  45. package/addon/components/eui-description-list/index.hbs +23 -0
  46. package/addon/components/eui-description-list-description/index.hbs +3 -0
  47. package/addon/components/eui-description-list-title/index.hbs +3 -0
  48. package/addon/components/eui-dual-range/index.hbs +30 -18
  49. package/addon/components/eui-dual-range/index.ts +36 -10
  50. package/addon/components/eui-empty-prompt/index.hbs +83 -0
  51. package/addon/components/eui-field-number/index.hbs +3 -3
  52. package/addon/components/eui-field-number/types.ts +4 -1
  53. package/addon/components/eui-field-search/index.hbs +2 -1
  54. package/addon/components/eui-field-text/index.hbs +3 -1
  55. package/addon/components/eui-file-picker/index.hbs +15 -11
  56. package/addon/components/eui-file-picker/index.ts +26 -8
  57. package/addon/components/eui-flyout/index.hbs +130 -43
  58. package/addon/components/eui-flyout/index.ts +233 -0
  59. package/addon/components/eui-flyout-body/index.hbs +21 -7
  60. package/addon/components/eui-form-control-layout-custom-icon/types.ts +3 -1
  61. package/addon/components/eui-form-control-layout-icons/types.ts +4 -1
  62. package/addon/components/eui-form-label/index.hbs +1 -1
  63. package/addon/components/eui-form-row/index.hbs +13 -9
  64. package/addon/components/eui-global-toast-list/index.ts +5 -6
  65. package/addon/components/eui-header/index.hbs +18 -3
  66. package/addon/{modifiers/fixed-header.ts → components/eui-header/index.ts} +10 -1
  67. package/addon/components/eui-header-alert/index.hbs +25 -0
  68. package/addon/components/eui-header-breadcrumbs/index.hbs +7 -0
  69. package/addon/components/eui-header-links/index.hbs +41 -0
  70. package/addon/components/eui-header-links/index.ts +14 -0
  71. package/addon/components/eui-header-section-item-button/index.hbs +30 -12
  72. package/addon/components/eui-header-section-item-button/index.ts +131 -0
  73. package/addon/components/eui-health/index.hbs +15 -13
  74. package/addon/components/eui-hide-for/index.hbs +3 -0
  75. package/addon/components/eui-hide-for/index.ts +33 -0
  76. package/addon/components/eui-icon/index.hbs +6 -3
  77. package/addon/components/eui-icon/index.ts +4 -0
  78. package/addon/components/eui-image/index.hbs +63 -25
  79. package/addon/components/eui-image/index.ts +7 -2
  80. package/addon/components/eui-input-popover/index.ts +6 -4
  81. package/addon/components/eui-key-pad-menu/index.hbs +16 -0
  82. package/addon/components/eui-key-pad-menu/key/index.hbs +1 -0
  83. package/addon/components/eui-key-pad-menu-item/index.hbs +66 -0
  84. package/addon/components/eui-key-pad-menu-item/index.ts +11 -0
  85. package/addon/components/eui-link/index.hbs +50 -0
  86. package/addon/components/eui-list-group-item/index.hbs +10 -2
  87. package/addon/components/eui-loading-logo/index.hbs +14 -0
  88. package/addon/components/eui-markdown-editor/index.hbs +4 -1
  89. package/addon/components/eui-markdown-editor/index.ts +54 -0
  90. package/addon/components/eui-markdown-editor-footer/index.hbs +39 -40
  91. package/addon/components/eui-markdown-format/index.ts +1 -1
  92. package/addon/components/eui-markdown-format/markdown-code/index.hbs +2 -2
  93. package/addon/components/eui-markdown-format/markdown-code-block/index.hbs +1 -0
  94. package/addon/components/eui-modal/index.hbs +28 -24
  95. package/addon/components/eui-overlay-mask/index.hbs +4 -4
  96. package/addon/components/eui-overlay-mask/index.ts +14 -1
  97. package/addon/components/eui-page/index.hbs +3 -6
  98. package/addon/components/eui-page-body/index.hbs +47 -15
  99. package/addon/components/eui-page-content/index.hbs +6 -8
  100. package/addon/components/eui-page-content-body/index.hbs +13 -1
  101. package/addon/components/eui-page-content-header/index.hbs +6 -0
  102. package/addon/components/eui-page-header/index.hbs +31 -6
  103. package/addon/components/eui-page-header-content/index.hbs +219 -0
  104. package/addon/components/eui-page-header-content/index.ts +49 -0
  105. package/addon/components/eui-page-side-bar/index.hbs +8 -1
  106. package/addon/components/eui-page-template/index.hbs +417 -0
  107. package/addon/components/eui-page-template/index.ts +89 -0
  108. package/addon/components/eui-panel/index.hbs +58 -12
  109. package/addon/components/eui-popover/index.hbs +8 -4
  110. package/addon/components/eui-popover/index.ts +28 -12
  111. package/addon/components/eui-portal/index.ts +2 -1
  112. package/addon/components/eui-progress/index.hbs +16 -13
  113. package/addon/components/eui-radio/index.hbs +9 -3
  114. package/addon/components/eui-range/index.hbs +33 -11
  115. package/addon/components/eui-range/index.ts +7 -4
  116. package/addon/components/eui-range-input/index.hbs +37 -31
  117. package/addon/components/eui-range-input/types.ts +2 -1
  118. package/addon/components/eui-range-levels/index.hbs +3 -3
  119. package/addon/components/eui-range-levels/index.ts +14 -3
  120. package/addon/components/eui-range-ticks/index.hbs +2 -2
  121. package/addon/components/eui-range-track/index.hbs +10 -2
  122. package/addon/components/eui-range-track/index.ts +23 -6
  123. package/addon/components/eui-show-for/index.hbs +3 -0
  124. package/addon/components/eui-show-for/index.ts +79 -0
  125. package/addon/components/eui-side-nav/index.hbs +161 -36
  126. package/addon/components/eui-side-nav/index.ts +28 -0
  127. package/addon/components/eui-side-nav-item/button/index.hbs +26 -14
  128. package/addon/components/eui-side-nav-item/index.hbs +52 -25
  129. package/addon/components/eui-split-panel/inner/index.hbs +11 -0
  130. package/addon/components/eui-split-panel/outer/index.hbs +27 -0
  131. package/addon/components/eui-split-panel/outer/index.ts +37 -0
  132. package/addon/components/eui-step/eui-step-number/index.hbs +21 -4
  133. package/addon/components/eui-steps/index.hbs +7 -1
  134. package/addon/components/eui-tab/index.hbs +60 -46
  135. package/addon/components/eui-tab/index.ts +23 -0
  136. package/addon/components/eui-tabs/index.hbs +6 -9
  137. package/addon/components/eui-tool-tip/index.hbs +6 -7
  138. package/addon/components/eui-tool-tip/index.ts +27 -11
  139. package/addon/helpers/arg-or-default.ts +4 -1
  140. package/addon/helpers/class-names.ts +2 -0
  141. package/addon/helpers/eui-palette.ts +4 -1
  142. package/addon/helpers/get-range-tick.ts +53 -8
  143. package/addon/helpers/get-tab-id.ts +8 -2
  144. package/addon/helpers/hex-to-rgb.ts +4 -1
  145. package/addon/helpers/inline-styles.ts +10 -3
  146. package/addon/helpers/is-within-number.ts +4 -1
  147. package/addon/helpers/starts-with.ts +3 -1
  148. package/addon/helpers/unique-id.ts +4 -1
  149. package/addon/initializers/eui-config.ts +12 -0
  150. package/addon/modifiers/mutation-observer.ts +4 -1
  151. package/addon/modifiers/outside-click-detector.ts +4 -4
  152. package/addon/styles/ember-eui.css +2 -10
  153. package/addon/utils/accesibility/cascading-menu-keys.ts +8 -1
  154. package/addon/utils/breakpoint.ts +114 -0
  155. package/addon/utils/code/utils.ts +304 -0
  156. package/addon/utils/color/color_palette.ts +3 -3
  157. package/addon/utils/color/eui_palettes.ts +23 -6
  158. package/addon/utils/css-mappings/eui-avatar.ts +51 -9
  159. package/addon/utils/css-mappings/eui-badge.ts +6 -2
  160. package/addon/utils/css-mappings/eui-beta-badge.ts +22 -0
  161. package/addon/utils/css-mappings/eui-bottom-bar.ts +8 -1
  162. package/addon/utils/css-mappings/eui-button-empty.ts +4 -4
  163. package/addon/utils/css-mappings/eui-button-icon.ts +19 -6
  164. package/addon/utils/css-mappings/eui-button.ts +2 -1
  165. package/addon/utils/css-mappings/eui-card-select.ts +1 -11
  166. package/addon/utils/css-mappings/eui-card.ts +1 -18
  167. package/addon/utils/css-mappings/{eui-code-block-impl.ts → eui-code-block.ts} +0 -0
  168. package/addon/utils/css-mappings/eui-description-list.ts +29 -0
  169. package/addon/utils/css-mappings/eui-empty-prompt.ts +17 -0
  170. package/addon/utils/css-mappings/eui-flyout.ts +21 -1
  171. package/addon/utils/css-mappings/eui-header-links.ts +27 -0
  172. package/addon/utils/css-mappings/eui-health.ts +17 -0
  173. package/addon/utils/css-mappings/eui-icon.ts +93 -70
  174. package/addon/utils/css-mappings/eui-image.ts +17 -2
  175. package/addon/utils/css-mappings/eui-link.ts +21 -0
  176. package/addon/utils/css-mappings/eui-list-group.ts +5 -1
  177. package/addon/utils/css-mappings/eui-modal.ts +5 -1
  178. package/addon/utils/css-mappings/eui-page-body.ts +25 -0
  179. package/addon/utils/css-mappings/eui-page-content-body.ts +17 -0
  180. package/addon/utils/css-mappings/eui-page-content.ts +7 -1
  181. package/addon/utils/css-mappings/eui-page-header.ts +17 -0
  182. package/addon/utils/css-mappings/eui-page-side-bar.ts +17 -0
  183. package/addon/utils/css-mappings/eui-panel.ts +1 -0
  184. package/addon/utils/css-mappings/eui-progress-data.ts +0 -1
  185. package/addon/utils/css-mappings/eui-progress.ts +0 -2
  186. package/addon/utils/css-mappings/eui-range-levels.ts +22 -4
  187. package/addon/utils/css-mappings/eui-tabs.ts +3 -1
  188. package/addon/utils/css-mappings/eui-text-color.ts +3 -2
  189. package/addon/utils/css-mappings/index.ts +23 -3
  190. package/addon/utils/detect-element-resize.js +248 -0
  191. package/addon/utils/markdown/markdown-types.ts +10 -11
  192. package/addon/utils/markdown/plugins/markdown-add-components/index.ts +1 -0
  193. package/addon/utils/markdown/plugins/{markdown-add-components.ts → markdown-add-components/processor.ts} +14 -7
  194. package/addon/utils/markdown/plugins/markdown-checkbox/index.ts +9 -0
  195. package/addon/utils/markdown/plugins/{markdown-checkbox.ts → markdown-checkbox/parser.ts} +3 -5
  196. package/addon/utils/markdown/plugins/markdown-default-plugins/index.ts +12 -0
  197. package/addon/utils/markdown/plugins/{markdown-default-plugins.ts → markdown-default-plugins/parsing-plugins.ts} +13 -25
  198. package/addon/utils/markdown/plugins/markdown-default-plugins/plugins.ts +32 -0
  199. package/addon/utils/markdown/plugins/markdown-default-plugins/processing-plugins.ts +67 -0
  200. package/addon/utils/markdown/plugins/markdown-default-plugins/ui-plugins.ts +27 -0
  201. package/addon/utils/markdown/plugins/markdown-tooltip/index.ts +2 -0
  202. package/addon/utils/markdown/plugins/{markdown-tooltip.ts → markdown-tooltip/parser.ts} +3 -23
  203. package/addon/utils/markdown/plugins/markdown-tooltip/plugin.ts +17 -0
  204. package/addon/utils/markdown/plugins/to-dom.ts +3 -1
  205. package/addon/utils/markdown/remark/remark-prismjs.ts +41 -0
  206. package/addon/utils/popover/index.ts +87 -35
  207. package/addon/utils/range/index.ts +1 -0
  208. package/addon/utils/transition.ts +10 -3
  209. package/addon/version.ts +6 -0
  210. package/app/components/eui-auto-sizer/index.js +1 -0
  211. package/app/components/eui-avatar/index.js +1 -1
  212. package/app/components/eui-badge-group/badge-group-item/index.js +1 -1
  213. package/app/components/eui-badge-group/index.js +1 -1
  214. package/app/components/eui-breadcrumbs/index.js +1 -0
  215. package/app/components/eui-button-icon/index.js +1 -1
  216. package/app/components/eui-card-select/index.js +1 -0
  217. package/app/components/{eui-code-block-impl → eui-code-block/controls}/index.js +1 -1
  218. package/app/components/{eui-code-block-impl/code-block-controls → eui-code-block/full-screen-display}/index.js +1 -1
  219. package/app/components/eui-code-block/virtualized/index.js +1 -0
  220. package/app/components/eui-combo-box/create-option/index.js +1 -1
  221. package/app/components/eui-comment/eui-comment-timeline/index.js +1 -1
  222. package/app/components/eui-comment/index.js +1 -1
  223. package/app/components/eui-description-list/index.js +1 -0
  224. package/app/components/eui-description-list-description/index.js +1 -0
  225. package/app/components/eui-description-list-title/index.js +1 -0
  226. package/app/components/eui-dual-range/index.js +1 -1
  227. package/app/components/eui-empty-prompt/index.js +1 -0
  228. package/app/components/eui-field-number/index.js +1 -1
  229. package/app/components/eui-field-password/index.js +1 -1
  230. package/app/components/eui-field-search/index.js +1 -1
  231. package/app/components/eui-field-text/index.js +1 -1
  232. package/app/components/eui-file-picker/index.js +1 -1
  233. package/app/components/eui-form/index.js +1 -1
  234. package/app/components/eui-form-control-layout/index.js +1 -1
  235. package/app/components/eui-form-control-layout-clear-button/index.js +1 -1
  236. package/app/components/eui-form-control-layout-custom-icon/index.js +1 -1
  237. package/app/components/eui-form-control-layout-delimited/index.js +1 -1
  238. package/app/components/eui-form-control-layout-icons/index.js +1 -1
  239. package/app/components/eui-form-error-text/index.js +1 -1
  240. package/app/components/eui-form-fieldset/index.js +1 -1
  241. package/app/components/eui-form-help-text/index.js +1 -1
  242. package/app/components/eui-form-label/index.js +1 -1
  243. package/app/components/eui-form-legend/index.js +1 -1
  244. package/app/components/eui-form-row/index.js +1 -1
  245. package/app/components/eui-header-alert/index.js +1 -0
  246. package/app/components/eui-header-breadcrumbs/index.js +1 -0
  247. package/app/components/eui-header-links/index.js +1 -0
  248. package/app/components/eui-hide-for/index.js +1 -0
  249. package/app/components/eui-image.js +1 -1
  250. package/app/components/eui-key-pad-menu/index.js +1 -0
  251. package/app/components/eui-key-pad-menu/key/index.js +1 -0
  252. package/app/components/eui-key-pad-menu-item/index.js +1 -0
  253. package/app/components/eui-link/index.js +1 -0
  254. package/app/components/eui-list-group/index.js +1 -1
  255. package/app/components/eui-list-group-item/index.js +1 -1
  256. package/app/components/eui-loading-logo/index.js +1 -0
  257. package/app/components/eui-overlay-mask.js +1 -1
  258. package/app/components/eui-page/index.js +1 -1
  259. package/app/components/eui-page-body/index.js +1 -1
  260. package/app/components/eui-page-content/index.js +1 -1
  261. package/app/components/eui-page-content-body/index.js +1 -1
  262. package/app/components/eui-page-content-header/index.js +1 -1
  263. package/app/components/eui-page-content-header-section/index.js +1 -1
  264. package/app/components/eui-page-header/index.js +1 -1
  265. package/app/components/eui-page-header-content/index.js +1 -0
  266. package/app/components/eui-page-header-section/index.js +1 -1
  267. package/app/components/eui-page-template/index.js +1 -0
  268. package/app/components/eui-panel/index.js +1 -1
  269. package/app/components/eui-popover/index.js +1 -1
  270. package/app/components/eui-popover-footer/index.js +1 -1
  271. package/app/components/eui-popover-title/index.js +1 -1
  272. package/app/components/eui-portal/index.js +1 -1
  273. package/app/components/eui-progress/index.js +1 -1
  274. package/app/components/eui-radio/index.js +1 -1
  275. package/app/components/eui-radio-group/index.js +1 -1
  276. package/app/components/eui-range/index.js +1 -1
  277. package/app/components/eui-range-highlight/index.js +1 -1
  278. package/app/components/eui-range-input/index.js +1 -1
  279. package/app/components/eui-range-label/index.js +1 -1
  280. package/app/components/eui-range-levels/index.js +1 -1
  281. package/app/components/eui-range-slider/index.js +1 -1
  282. package/app/components/eui-range-thumb/index.js +1 -1
  283. package/app/components/eui-range-ticks/index.js +1 -1
  284. package/app/components/eui-range-tooltip/index.js +1 -1
  285. package/app/components/eui-range-track/index.js +1 -1
  286. package/app/components/eui-range-wrapper/index.js +1 -1
  287. package/app/components/eui-select/index.js +1 -1
  288. package/app/components/eui-show-for/index.js +1 -0
  289. package/app/components/eui-side-nav/index.js +1 -1
  290. package/app/components/eui-side-nav-item/button/index.js +1 -1
  291. package/app/components/eui-side-nav-item/index.js +1 -1
  292. package/app/components/eui-spacer/index.js +1 -1
  293. package/app/components/eui-split-panel/inner/index.js +1 -0
  294. package/app/components/eui-split-panel/outer/index.js +1 -0
  295. package/app/components/eui-switch/index.js +1 -1
  296. package/app/components/eui-tab/index.js +1 -1
  297. package/app/components/eui-tabs/index.js +1 -1
  298. package/app/components/eui-text/index.js +1 -1
  299. package/app/components/eui-text-align/index.js +1 -1
  300. package/app/components/eui-text-area/index.js +1 -1
  301. package/app/components/eui-text-color/index.js +1 -1
  302. package/app/components/eui-title/index.js +1 -1
  303. package/app/components/eui-tool-tip/index.js +1 -1
  304. package/app/components/eui-tool-tip-popover/index.js +1 -1
  305. package/app/helpers/eui-palette.js +1 -1
  306. package/app/helpers/hex-to-rgb.js +1 -1
  307. package/app/initializers/eui-config.js +1 -0
  308. package/app/utils/copy-to-clipboard.js +1 -0
  309. package/docs/display/avatar-demo/demo1.md +43 -49
  310. package/docs/display/avatar-demo/demo2.md +42 -0
  311. package/docs/display/avatar-demo/demo3.md +33 -0
  312. package/docs/display/avatar-demo/demo4.md +53 -0
  313. package/docs/display/avatar-demo/demo5.md +38 -0
  314. package/docs/display/avatar.md +1 -1
  315. package/docs/display/badge-demo/demo1.md +78 -137
  316. package/docs/display/badge-demo/demo2.md +32 -0
  317. package/docs/display/badge-demo/demo3.md +70 -0
  318. package/docs/display/badge-demo/demo4.md +27 -0
  319. package/docs/display/badge-demo/demo5.md +31 -0
  320. package/docs/display/badge-demo/demo6.md +59 -0
  321. package/docs/display/badge-demo/demo7.md +97 -0
  322. package/docs/display/badge-demo/demo8.md +19 -0
  323. package/docs/display/badge.md +1 -1
  324. package/docs/display/callout-demo/demo1.md +29 -81
  325. package/docs/display/callout-demo/demo2.md +28 -0
  326. package/docs/display/callout-demo/demo3.md +29 -0
  327. package/docs/display/callout-demo/demo4.md +26 -0
  328. package/docs/display/callout.md +9 -1
  329. package/docs/display/card/basic-card-demo/demo1.md +22 -316
  330. package/docs/display/card/basic-card.md +9 -1
  331. package/docs/display/card/beta-badge-demo/demo1.md +47 -0
  332. package/docs/display/card/beta-badge.md +9 -0
  333. package/docs/display/card/checkable-demo/demo1.md +20 -94
  334. package/docs/display/card/checkable-demo/demo2.md +63 -0
  335. package/docs/display/card/checkable.md +9 -1
  336. package/docs/display/card/custom-children-demo/demo1.md +93 -0
  337. package/docs/display/card/custom-children.md +9 -0
  338. package/docs/display/card/footer-demo/demo1.md +77 -0
  339. package/docs/display/card/footer.md +9 -0
  340. package/docs/display/card/images-demo/demo1.md +57 -0
  341. package/docs/display/card/images.md +9 -0
  342. package/docs/display/card/layout-demo/demo1.md +40 -0
  343. package/docs/display/card/layout.md +9 -0
  344. package/docs/display/card/selectable-demo/demo1.md +60 -53
  345. package/docs/display/card/selectable.md +9 -1
  346. package/docs/display/comment-list.md +1 -1
  347. package/docs/display/description-list-demo/demo1.md +53 -0
  348. package/docs/display/description-list-demo/demo2.md +43 -0
  349. package/docs/display/description-list-demo/demo3.md +58 -0
  350. package/docs/display/description-list-demo/demo4.md +42 -0
  351. package/docs/display/description-list-demo/demo5.md +62 -0
  352. package/docs/display/description-list-demo/demo6.md +46 -0
  353. package/docs/display/description-list.md +1 -0
  354. package/docs/display/empty-prompt-demo/demo1.md +25 -0
  355. package/docs/display/empty-prompt-demo/demo2.md +16 -0
  356. package/docs/display/empty-prompt-demo/demo3.md +67 -0
  357. package/docs/display/empty-prompt-demo/demo4.md +21 -0
  358. package/docs/display/empty-prompt-demo/demo5.md +33 -0
  359. package/docs/display/empty-prompt-demo/demo6.md +43 -0
  360. package/docs/display/empty-prompt-demo/demo7.md +162 -0
  361. package/docs/display/empty-prompt-demo/demo8.md +57 -0
  362. package/docs/display/empty-prompt.md +1 -0
  363. package/docs/display/health-demo/demo1.md +11 -8
  364. package/docs/display/health-demo/demo2.md +31 -0
  365. package/docs/display/health.md +9 -1
  366. package/docs/display/icons-demo/demo1.md +270 -57
  367. package/docs/display/icons-demo/demo2.md +76 -0
  368. package/docs/display/icons-demo/demo3.md +76 -0
  369. package/docs/display/icons-demo/demo4.md +104 -0
  370. package/docs/display/icons-demo/demo5.md +64 -0
  371. package/docs/display/icons-demo/demo6.md +63 -0
  372. package/docs/display/icons-demo/demo7.md +101 -0
  373. package/docs/display/icons-demo/demo8.md +47 -0
  374. package/docs/display/icons.md +1 -1
  375. package/docs/display/image-demo/demo1.md +15 -50
  376. package/docs/display/image-demo/demo2.md +35 -0
  377. package/docs/display/image-demo/demo3.md +75 -0
  378. package/docs/display/image-demo/demo4.md +80 -0
  379. package/docs/display/image.md +9 -1
  380. package/docs/display/list-group.md +1 -1
  381. package/docs/display/loading/logo-demo/demo1.md +15 -0
  382. package/docs/display/loading/logo.md +1 -0
  383. package/docs/display/progress-demo/demo1.md +10 -5
  384. package/docs/display/progress-demo/demo2.md +11 -26
  385. package/docs/display/progress-demo/demo3.md +27 -0
  386. package/docs/display/progress-demo/demo4.md +77 -0
  387. package/docs/display/progress.md +1 -1
  388. package/docs/display/stat-demo/demo1.md +0 -118
  389. package/docs/display/stat-demo/demo2.md +24 -22
  390. package/docs/display/stat-demo/demo3.md +39 -0
  391. package/docs/display/stat-demo/demo4.md +50 -0
  392. package/docs/display/stat-demo/demo5.md +25 -0
  393. package/docs/display/stat-demo/demo6.md +40 -0
  394. package/docs/display/stat-demo/demo7.md +84 -0
  395. package/docs/display/stat.md +8 -1
  396. package/docs/display/text-demo/demo1.md +79 -130
  397. package/docs/display/text-demo/demo2.md +71 -0
  398. package/docs/display/text-demo/demo3.md +39 -0
  399. package/docs/display/text.md +12 -1
  400. package/docs/display/title-demo/demo1.md +50 -26
  401. package/docs/display/title.md +1 -1
  402. package/docs/display/tool-tip-demo/demo1.md +26 -71
  403. package/docs/display/tool-tip-demo/demo2.md +33 -30
  404. package/docs/display/tool-tip-demo/demo3.md +50 -0
  405. package/docs/display/tool-tip-demo/demo4.md +74 -0
  406. package/docs/display/tool-tip.md +11 -1
  407. package/docs/editors/code/code-block-demo/demo1.md +21 -40
  408. package/docs/editors/code/code-block-demo/demo2.md +35 -0
  409. package/docs/editors/code/code-block-demo/demo3.md +43 -0
  410. package/docs/editors/code/code-block-demo/demo4.md +28 -0
  411. package/docs/editors/code/code-block-demo/demo5.md +42 -0
  412. package/docs/editors/code/code-block-demo/demo6.md +42 -0
  413. package/docs/editors/code/code-block-demo/demo7.md +853 -0
  414. package/docs/editors/code/code-block-demo/demo8.md +855 -0
  415. package/docs/editors/code/code-block.md +21 -1
  416. package/docs/editors/code/inline-demo/demo1.md +6 -3
  417. package/docs/editors/code/inline.md +1 -1
  418. package/docs/editors/markdown-editor/base-editor-demo/demo1.md +9 -28
  419. package/docs/editors/markdown-editor/base-editor.md +1 -1
  420. package/docs/forms/form-controls/checkbox/demo/demo1.md +49 -0
  421. package/docs/forms/form-controls/checkbox/index.md +26 -0
  422. package/docs/forms/form-controls/{checkbox-group-demo → checkbox-group/demo}/demo1.md +4 -13
  423. package/docs/forms/form-controls/checkbox-group/index.md +27 -0
  424. package/docs/forms/form-controls/{combo-box-demo → combo-box/demo}/demo1.md +8 -2
  425. package/docs/forms/form-controls/{combo-box-demo → combo-box/demo}/demo2.md +10 -8
  426. package/docs/forms/form-controls/combo-box/demo/demo3.md +60 -0
  427. package/docs/forms/form-controls/{combo-box-demo/demo3.md → combo-box/demo/demo4.md} +17 -14
  428. package/docs/forms/form-controls/combo-box/demo/demo5.md +151 -0
  429. package/docs/forms/form-controls/combo-box/index.md +6 -0
  430. package/docs/forms/form-controls/file-picker/demo/demo1.md +29 -0
  431. package/docs/forms/form-controls/file-picker/demo/demo2.md +44 -0
  432. package/docs/forms/form-controls/file-picker/demo/demo3.md +45 -0
  433. package/docs/forms/form-controls/file-picker/demo/demo4.md +63 -0
  434. package/docs/forms/form-controls/file-picker/index.md +22 -0
  435. package/docs/forms/form-controls/{form-control-layout-demo → form-control-layout/demo}/demo1.md +0 -0
  436. package/docs/forms/form-controls/form-control-layout/index.md +30 -0
  437. package/docs/forms/form-controls/{form-control-layout-delimited-demo → form-control-layout-delimited/demo}/demo1.md +41 -37
  438. package/docs/forms/form-controls/form-control-layout-delimited/index.md +24 -0
  439. package/docs/forms/form-controls/number-field/demo/demo1.md +20 -0
  440. package/docs/forms/form-controls/{number-field-demo/demo1.md → number-field/demo/demo2.md} +23 -11
  441. package/docs/forms/form-controls/number-field/index.md +12 -0
  442. package/docs/forms/form-controls/password-field/demo/demo1.md +19 -0
  443. package/docs/forms/form-controls/{password-field-demo/demo1.md → password-field/demo/demo2.md} +12 -8
  444. package/docs/forms/form-controls/password-field/index.md +19 -0
  445. package/docs/forms/form-controls/radio/demo/demo1.md +43 -0
  446. package/docs/forms/form-controls/radio/index.md +24 -0
  447. package/docs/forms/form-controls/radio-group/demo/demo1.md +50 -0
  448. package/docs/forms/form-controls/radio-group/index.md +18 -0
  449. package/docs/forms/form-controls/range/demo/demo1.md +96 -0
  450. package/docs/forms/form-controls/range/demo/demo2.md +62 -0
  451. package/docs/forms/form-controls/{range-demo → range/demo}/demo3.md +10 -12
  452. package/docs/forms/form-controls/{range-demo → range/demo}/demo4.md +16 -18
  453. package/docs/forms/form-controls/{range-demo → range/demo}/demo5.md +18 -20
  454. package/docs/forms/form-controls/range/demo/demo6.md +57 -0
  455. package/docs/forms/form-controls/range/demo/demo7.md +350 -0
  456. package/docs/forms/form-controls/range/index.md +18 -0
  457. package/docs/forms/form-controls/search-field/demo/demo1.md +29 -0
  458. package/docs/forms/form-controls/search-field/index.md +14 -0
  459. package/docs/forms/form-controls/select/demo/demo1.md +29 -0
  460. package/docs/forms/form-controls/select/demo/demo2.md +44 -0
  461. package/docs/forms/form-controls/{select-demo/demo1.md → select/demo/demo3.md} +20 -10
  462. package/docs/forms/form-controls/select/index.md +19 -0
  463. package/docs/forms/form-controls/{switch-demo → switch/demo}/demo1.md +10 -10
  464. package/docs/forms/form-controls/switch/index.md +13 -0
  465. package/docs/forms/form-controls/text-field/demo/demo1.md +35 -0
  466. package/docs/forms/form-controls/text-field/demo/demo2.md +40 -0
  467. package/docs/forms/form-controls/{text-field-demo/demo2.md → text-field/demo/demo3.md} +14 -17
  468. package/docs/forms/form-controls/{text-field-demo/demo1.md → text-field/demo/demo4.md} +18 -32
  469. package/docs/forms/form-controls/text-field/index.md +14 -0
  470. package/docs/forms/form-controls/textarea/demo/demo1.md +21 -0
  471. package/docs/forms/form-controls/textarea/demo/demo2.md +24 -0
  472. package/docs/forms/form-controls/textarea/index.md +13 -0
  473. package/docs/forms/form-layouts/described-form-groups-demo/demo1.md +13 -4
  474. package/docs/forms/form-layouts/described-form-groups.md +1 -1
  475. package/docs/layout/accordion-demo/demo1.md +21 -102
  476. package/docs/layout/accordion-demo/demo2.md +76 -0
  477. package/docs/layout/accordion-demo/demo3.md +25 -0
  478. package/docs/layout/accordion-demo/demo4.md +26 -0
  479. package/docs/layout/accordion-demo/demo5.md +65 -0
  480. package/docs/layout/accordion-demo/demo6.md +78 -0
  481. package/docs/layout/accordion-demo/demo7.md +66 -0
  482. package/docs/layout/accordion-demo/demo8.md +64 -0
  483. package/docs/layout/accordion-demo/demo9.md +114 -0
  484. package/docs/layout/accordion.md +39 -9
  485. package/docs/layout/bottom-bar-demo/demo1.md +32 -49
  486. package/docs/layout/bottom-bar-demo/demo2.md +54 -0
  487. package/docs/layout/bottom-bar-demo/demo3.md +81 -0
  488. package/docs/layout/bottom-bar.md +1 -1
  489. package/docs/layout/flex.md +1 -1
  490. package/docs/layout/flyout-demo/demo1.md +19 -11
  491. package/docs/layout/flyout-demo/demo2.md +43 -28
  492. package/docs/layout/flyout-demo/demo3.md +99 -0
  493. package/docs/layout/flyout-demo/demo4.md +115 -0
  494. package/docs/layout/flyout-demo/demo5.md +59 -0
  495. package/docs/layout/flyout-demo/demo6.md +57 -0
  496. package/docs/layout/flyout-demo/demo7.md +51 -0
  497. package/docs/layout/flyout.md +1 -1
  498. package/docs/layout/header-demo/demo1.md +284 -35
  499. package/docs/layout/header-demo/demo2.md +42 -0
  500. package/docs/layout/header-demo/demo3.md +48 -0
  501. package/docs/layout/header-demo/demo4.md +57 -0
  502. package/docs/layout/header-demo/demo5.md +232 -0
  503. package/docs/layout/header-demo/demo6.md +85 -0
  504. package/docs/layout/header-demo/demo7.md +94 -0
  505. package/docs/layout/header.md +1 -1
  506. package/docs/layout/horizontal-rule.md +1 -1
  507. package/docs/layout/modal-demo/demo1.md +64 -167
  508. package/docs/layout/modal-demo/demo2.md +126 -0
  509. package/docs/layout/modal-demo/demo3.md +55 -0
  510. package/docs/layout/modal-demo/demo4.md +65 -0
  511. package/docs/layout/modal-demo/demo5.md +96 -0
  512. package/docs/layout/modal.md +1 -1
  513. package/docs/layout/page-demo/demo1.md +96 -3
  514. package/docs/layout/page-demo/demo10.md +42 -0
  515. package/docs/layout/page-demo/demo2.md +46 -0
  516. package/docs/layout/page-demo/demo3.md +50 -0
  517. package/docs/layout/page-demo/demo4.md +38 -0
  518. package/docs/layout/page-demo/demo5.md +30 -0
  519. package/docs/layout/page-demo/demo6.md +51 -0
  520. package/docs/layout/page-demo/demo7.md +59 -0
  521. package/docs/layout/page-demo/demo8.md +19 -0
  522. package/docs/layout/page-demo/demo9.md +29 -0
  523. package/docs/layout/page.md +1 -1
  524. package/docs/layout/panel-demo/demo1.md +28 -19
  525. package/docs/layout/panel-demo/demo2.md +22 -0
  526. package/docs/layout/panel-demo/demo3.md +27 -0
  527. package/docs/layout/panel-demo/demo4.md +46 -0
  528. package/docs/layout/panel-demo/demo5.md +81 -0
  529. package/docs/layout/panel.md +7 -1
  530. package/docs/layout/popover-demo/demo1.md +42 -300
  531. package/docs/layout/popover-demo/demo10.md +72 -0
  532. package/docs/layout/popover-demo/demo2.md +306 -96
  533. package/docs/layout/popover-demo/demo3.md +20 -12
  534. package/docs/layout/popover-demo/demo4.md +118 -0
  535. package/docs/layout/popover-demo/demo5.md +252 -0
  536. package/docs/layout/popover-demo/demo6.md +44 -0
  537. package/docs/layout/popover-demo/demo7.md +44 -0
  538. package/docs/layout/popover-demo/demo8.md +50 -0
  539. package/docs/layout/popover-demo/demo9.md +80 -0
  540. package/docs/layout/popover.md +1 -1
  541. package/docs/navigation/breadcrumbs-demo/demo1.md +77 -0
  542. package/docs/navigation/breadcrumbs-demo/demo2.md +61 -0
  543. package/docs/navigation/breadcrumbs-demo/demo3.md +61 -0
  544. package/docs/navigation/breadcrumbs-demo/demo4.md +61 -0
  545. package/docs/navigation/breadcrumbs-demo/demo5.md +61 -0
  546. package/docs/navigation/breadcrumbs-demo/demo6.md +61 -0
  547. package/docs/navigation/breadcrumbs.md +1 -0
  548. package/docs/navigation/button-demo/demo1.md +210 -158
  549. package/docs/navigation/button.md +1 -1
  550. package/docs/navigation/collapsible-nav-demo/demo1.md +21 -44
  551. package/docs/navigation/collapsible-nav-demo/demo2.md +108 -0
  552. package/docs/navigation/collapsible-nav.md +1 -1
  553. package/docs/navigation/key-pad-menu-demo/demo1.md +77 -0
  554. package/docs/navigation/key-pad-menu-demo/demo2.md +102 -0
  555. package/docs/navigation/key-pad-menu-demo/demo3.md +54 -0
  556. package/docs/navigation/key-pad-menu-demo/demo4.md +71 -0
  557. package/docs/navigation/key-pad-menu-demo/demo5.md +65 -0
  558. package/docs/navigation/key-pad-menu.md +1 -0
  559. package/docs/navigation/link-demo/demo1.md +44 -0
  560. package/docs/navigation/link-demo/demo2.md +41 -0
  561. package/docs/navigation/link-demo/demo3.md +45 -0
  562. package/docs/navigation/link-demo/demo4.md +61 -0
  563. package/docs/navigation/link.md +1 -0
  564. package/docs/navigation/side-nav-demo/demo1.md +34 -18
  565. package/docs/navigation/side-nav.md +1 -1
  566. package/docs/navigation/steps-demo/demo1.md +16 -18
  567. package/docs/navigation/steps-demo/demo2.md +18 -21
  568. package/docs/navigation/steps-demo/demo3.md +12 -10
  569. package/docs/navigation/steps-demo/demo4.md +84 -0
  570. package/docs/navigation/steps-demo/demo5.md +29 -0
  571. package/docs/navigation/steps.md +1 -1
  572. package/docs/navigation/tabs-demo/demo1.md +38 -111
  573. package/docs/navigation/tabs-demo/demo2.md +56 -0
  574. package/docs/navigation/tabs-demo/demo3.md +79 -0
  575. package/docs/navigation/tabs-demo/demo4.md +102 -0
  576. package/docs/navigation/tabs.md +1 -1
  577. package/docs/utilities/auto-sizer-demo/demo1.md +34 -0
  578. package/docs/utilities/auto-sizer.md +1 -0
  579. package/docs/utilities/copy-demo/demo1.md +37 -0
  580. package/docs/utilities/copy-demo/demo2.md +70 -0
  581. package/docs/utilities/copy.md +1 -0
  582. package/docs/utilities/mutation-observer.md +1 -1
  583. package/docs/utilities/outside-click-detector.md +1 -1
  584. package/docs/utilities/overlay-mask.md +1 -1
  585. package/docs/utilities/portal.md +1 -1
  586. package/docs/utilities/resize-observer.md +1 -1
  587. package/docs/utilities/responsive-demo/demo1.md +108 -0
  588. package/docs/utilities/responsive.md +1 -0
  589. package/index.js +8 -3
  590. package/package.json +13 -7
  591. package/CHANGELOG.md +0 -1340
  592. package/addon/components/eui-code-block-impl/code-block-controls/index.hbs +0 -33
  593. package/addon/components/eui-code-block-impl/index.hbs +0 -111
  594. package/addon/components/eui-code-block-impl/index.ts +0 -121
  595. package/addon/components/eui-flyout-body/banner/index.hbs +0 -3
  596. package/addon/components/eui-flyout-body/content/index.hbs +0 -3
  597. package/addon/helpers/create-event.ts +0 -30
  598. package/addon/modifiers/focus-tab.ts +0 -19
  599. package/addon/modifiers/get-cursor-node.ts +0 -54
  600. package/addon/modifiers/invalidate-indeterminate.ts +0 -10
  601. package/addon/modifiers/on-event-simulate-event.ts +0 -32
  602. package/app/components/eui-card/eui-card-select/index.js +0 -1
  603. package/app/components/eui-flyout-body/banner/index.js +0 -1
  604. package/app/components/eui-flyout-body/content/index.js +0 -1
  605. package/app/helpers/create-event.js +0 -1
  606. package/app/modifiers/fixed-header.js +0 -1
  607. package/app/modifiers/focus-tab.js +0 -1
  608. package/app/modifiers/get-cursor-node.js +0 -1
  609. package/app/modifiers/invalidate-indeterminate.js +0 -1
  610. package/app/modifiers/on-event-simulate-event.js +0 -1
  611. package/docs/forms/form-controls/checkbox-demo/demo1.md +0 -40
  612. package/docs/forms/form-controls/checkbox-group.md +0 -1
  613. package/docs/forms/form-controls/checkbox.md +0 -1
  614. package/docs/forms/form-controls/combo-box.md +0 -1
  615. package/docs/forms/form-controls/file-picker-demo/demo1.md +0 -28
  616. package/docs/forms/form-controls/file-picker.md +0 -1
  617. package/docs/forms/form-controls/form-control-layout-delimited.md +0 -1
  618. package/docs/forms/form-controls/form-control-layout.md +0 -1
  619. package/docs/forms/form-controls/number-field.md +0 -1
  620. package/docs/forms/form-controls/password-field.md +0 -1
  621. package/docs/forms/form-controls/radio-demo/demo1.md +0 -39
  622. package/docs/forms/form-controls/radio-group-demo/demo1.md +0 -60
  623. package/docs/forms/form-controls/radio-group.md +0 -1
  624. package/docs/forms/form-controls/radio.md +0 -1
  625. package/docs/forms/form-controls/range-demo/demo1.md +0 -61
  626. package/docs/forms/form-controls/range-demo/demo2.md +0 -59
  627. package/docs/forms/form-controls/range-demo/demo6.md +0 -59
  628. package/docs/forms/form-controls/range.md +0 -1
  629. package/docs/forms/form-controls/search-field-demo/demo1.md +0 -31
  630. package/docs/forms/form-controls/search-field.md +0 -1
  631. package/docs/forms/form-controls/select.md +0 -1
  632. package/docs/forms/form-controls/switch.md +0 -1
  633. package/docs/forms/form-controls/text-field.md +0 -1
  634. package/docs/forms/form-controls/textarea-demo/demo1.md +0 -36
  635. package/docs/forms/form-controls/textarea.md +0 -1
@@ -18,14 +18,6 @@
18
18
  font-weight: 500;
19
19
  }
20
20
 
21
- .euiMarkdownEditor--fullHeight {
22
- display: -webkit-flex;
23
- display: flex;
24
- -webkit-flex-direction: column;
25
- flex-direction: column;
26
- height: 100%;
27
- }
28
-
29
- .euiMarkdownEditor--isPreviewing .euiMarkdownEditor__toggleContainer {
30
- display: none;
21
+ .ember-basic-dropdown-content {
22
+ z-index: 99999
31
23
  }
@@ -28,7 +28,14 @@
28
28
  * TAB: Normal tabbing navigation is still supported.
29
29
  */
30
30
 
31
- import { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, ESCAPE, TAB } from '../keys';
31
+ import {
32
+ ARROW_DOWN,
33
+ ARROW_LEFT,
34
+ ARROW_RIGHT,
35
+ ARROW_UP,
36
+ ESCAPE,
37
+ TAB
38
+ } from '../keys';
32
39
 
33
40
  export const cascadingMenuKeys = {
34
41
  ARROW_DOWN,
@@ -0,0 +1,114 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+
9
+ import { keysOf } from '../components/common';
10
+
11
+ export type EuiBreakpointSize = 'xs' | 's' | 'm' | 'l' | 'xl';
12
+
13
+ export type EuiBreakpoints = {
14
+ /**
15
+ * Set the minimum window width at which to start to the breakpoint
16
+ */
17
+ [key in EuiBreakpointSize]: number;
18
+ };
19
+
20
+ export const BREAKPOINTS: EuiBreakpoints = {
21
+ xl: 1200,
22
+ l: 992,
23
+ m: 768,
24
+ s: 575,
25
+ xs: 0
26
+ };
27
+
28
+ export const BREAKPOINT_KEYS = keysOf(BREAKPOINTS);
29
+
30
+ /**
31
+ * Given the current `width` and an object of `EuiBreakpoints`,
32
+ * this function returns the string that is the name of the breakpoint key
33
+ * that is less than or equal to the width
34
+ *
35
+ * @param {number} width Can either be the full window width or any width
36
+ * @param {EuiBreakpoints} breakpoints An object with keys for sizing and values for minimum width
37
+ * @returns {string | undefined} Name of the breakpoint key or `undefined` if a key doesn't exist
38
+ */
39
+ export function getBreakpoint(
40
+ width: number,
41
+ breakpoints: EuiBreakpoints = BREAKPOINTS
42
+ ): EuiBreakpointSize | undefined {
43
+ // Find the breakpoint (key) whose value is <= windowWidth starting with largest first
44
+ return keysOf(BREAKPOINTS).find((key) => breakpoints[key] <= width);
45
+ }
46
+
47
+ /**
48
+ * Given the current `width` and a max breakpoint key,
49
+ * this function returns true or false if the `width` falls within the max
50
+ * breakpoint or any breakpoints below
51
+ *
52
+ * @param {number} width Can either be the full window width or any width
53
+ * @param {EuiBreakpointSize | number} max The named breakpoint or custom number to check against
54
+ * @param {EuiBreakpoints} breakpoints An object with keys for sizing and values for minimum width
55
+ * @returns {boolean} Will return `false` if it can't find a value for the `max` breakpoint
56
+ */
57
+ export function isWithinMaxBreakpoint(
58
+ width: number,
59
+ max: EuiBreakpointSize | number,
60
+ breakpoints: EuiBreakpoints = BREAKPOINTS
61
+ ): boolean {
62
+ if (typeof max === 'number') {
63
+ return width <= max;
64
+ } else {
65
+ const currentBreakpoint = getBreakpoint(width, breakpoints);
66
+ return currentBreakpoint
67
+ ? breakpoints[currentBreakpoint] <= breakpoints[max]
68
+ : false;
69
+ }
70
+ }
71
+
72
+ /**
73
+ * Given the current `width` and a min breakpoint key,
74
+ * this function returns true or false if the `width` falls within the min
75
+ * breakpoint or any breakpoints above
76
+ *
77
+ * @param {number} width Can either be the full window width or any width
78
+ * @param {EuiBreakpointSize | number} min The named breakpoint or custom number to check against
79
+ * @param {EuiBreakpoints} breakpoints An object with keys for sizing and values for minimum width
80
+ * @returns {boolean} Will return `false` if it can't find a value for the `min` breakpoint
81
+ */
82
+ export function isWithinMinBreakpoint(
83
+ width: number,
84
+ min: EuiBreakpointSize | number,
85
+ breakpoints: EuiBreakpoints = BREAKPOINTS
86
+ ): boolean {
87
+ if (typeof min === 'number') {
88
+ return width >= min;
89
+ } else {
90
+ const currentBreakpoint = getBreakpoint(width, breakpoints);
91
+ return currentBreakpoint
92
+ ? breakpoints[currentBreakpoint] >= breakpoints[min]
93
+ : false;
94
+ }
95
+ }
96
+
97
+ /**
98
+ * Given the current `width` and an array of breakpoint keys,
99
+ * this function returns true or false if the `width` falls within
100
+ * any of the named breakpoints
101
+ *
102
+ * @param {number} width Can either be the full window width or any width
103
+ * @param {EuiBreakpointSize[]} sizes An array of named breakpoints
104
+ * @param {EuiBreakpoints} breakpoints An object with keys for sizing and values for minimum width
105
+ * @returns {boolean} Returns `true` if current breakpoint name is included in `sizes`
106
+ */
107
+ export function isWithinBreakpoints(
108
+ width: number,
109
+ sizes: EuiBreakpointSize[],
110
+ breakpoints: EuiBreakpoints = BREAKPOINTS
111
+ ): boolean {
112
+ const currentBreakpoint = getBreakpoint(width, breakpoints);
113
+ return currentBreakpoint ? sizes.includes(currentBreakpoint) : false;
114
+ }
@@ -0,0 +1,304 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+
9
+ import { listLanguages, highlight, AST, RefractorNode } from 'refractor';
10
+ import { CommonArgs } from '../../components/common';
11
+
12
+ /**
13
+ * Utils shared between EuiCode and EuiCodeBlock
14
+ */
15
+
16
+ export type EuiCodeSharedProps = CommonArgs & {
17
+ /**
18
+ * Sets the syntax highlighting for a specific language
19
+ * @see [https://prismjs.com/#supported-languages](https://prismjs.com/#supported-languages) for options
20
+ */
21
+ language?: string;
22
+ transparentBackground?: boolean;
23
+ };
24
+
25
+ export const SUPPORTED_LANGUAGES = listLanguages();
26
+ export const DEFAULT_LANGUAGE = 'text';
27
+
28
+ export const checkSupportedLanguage = (language: string): string => {
29
+ return SUPPORTED_LANGUAGES.includes(language) ? language : DEFAULT_LANGUAGE;
30
+ };
31
+
32
+ const createDocument = () => {
33
+ return document;
34
+ };
35
+
36
+ const attributes = [
37
+ 'src',
38
+ 'alt',
39
+ 'href',
40
+ 'target',
41
+ 'title',
42
+ 'data-line-number',
43
+ 'aria-hidden',
44
+ 'style'
45
+ ];
46
+ export interface DynamicComponent {}
47
+
48
+ export const getHtmlContent = (nodes: RefractorNode[]) => {
49
+ const document = createDocument();
50
+ let components: DynamicComponent[] = [];
51
+
52
+ const toElements = (parent: HTMLElement, nodes: RefractorNode[] = []) => {
53
+ nodes?.forEach((node) => {
54
+ let el = toElement(node);
55
+ if (el) {
56
+ parent.appendChild(el);
57
+ }
58
+ });
59
+ return parent;
60
+ };
61
+
62
+ const createElement = (
63
+ name: string,
64
+ node: RefractorNode,
65
+ className?: string
66
+ ) => {
67
+ let element = document.createElement(name);
68
+ if (isAstElement(node)) {
69
+ let properties = node.properties;
70
+ let classNames = [];
71
+ if (properties) {
72
+ if (properties.className) {
73
+ classNames.push(...properties.className);
74
+ }
75
+ for (let key in properties) {
76
+ if (attributes.includes(key)) {
77
+ let value = properties[key];
78
+ if (key === 'style') {
79
+ Object.keys(value).forEach((k: string) => {
80
+ //@ts-ignore
81
+ element.style[k] = `${value[k]}`;
82
+ });
83
+ } else {
84
+ element.setAttribute(key, value as string);
85
+ }
86
+ } else {
87
+ // temporary
88
+ if (key !== 'className') {
89
+ console.warn('Unmapped node property', key);
90
+ }
91
+ }
92
+ }
93
+ }
94
+ if (className) {
95
+ classNames.push(className);
96
+ }
97
+ if (classNames.length) {
98
+ element.setAttribute('class', classNames.join(' '));
99
+ }
100
+ }
101
+ return element;
102
+ };
103
+
104
+ const toElement = (node: RefractorNode) => {
105
+ if (isAstElement(node)) {
106
+ let { type } = node;
107
+ if (type === 'element') {
108
+ let element = createElement(node.tagName, node);
109
+ return toElements(element, node.children);
110
+ } else if (type === 'text') {
111
+ //@ts-ignore
112
+ return document.createTextNode(node.value);
113
+ } else if (type === 'component') {
114
+ let { inline } = node.properties;
115
+ let element = createElement(inline ? 'span' : 'div', node, 'component');
116
+ let { _children, ...properties } = node.properties;
117
+ let content = toElements(document.createElement('span'), node.children);
118
+ components.push({
119
+ element,
120
+ content,
121
+ ...properties
122
+ });
123
+ return element;
124
+ }
125
+ }
126
+ return;
127
+ };
128
+
129
+ const element = toElements(document.createElement('div'), nodes);
130
+
131
+ return {
132
+ element: element,
133
+ components
134
+ };
135
+ };
136
+
137
+ export const isAstElement = (node: RefractorNode): node is AST.Element =>
138
+ node.hasOwnProperty('type') &&
139
+ (node.type === 'element' || node.type === 'text');
140
+
141
+ /**
142
+ * Line utils specific to EuiCodeBlock
143
+ */
144
+
145
+ type ExtendedRefractorNode = RefractorNode & {
146
+ lineStart?: number;
147
+ lineEnd?: number;
148
+ };
149
+
150
+ interface LineNumbersConfig {
151
+ start: number;
152
+ show: boolean;
153
+ highlight?: string;
154
+ }
155
+
156
+ // Approximate width of a single digit/character
157
+ const CHAR_SIZE = 8;
158
+ const $euiSizeS = 8;
159
+
160
+ // Creates an array of numbers from comma-separeated
161
+ // string of numbers or number ranges using `-`
162
+ // (e.g., "1, 3-10, 15")
163
+ export const parseLineRanges = (ranges: string) => {
164
+ const highlights: number[] = [];
165
+ ranges
166
+ .replace(/\s/g, '')
167
+ .split(',')
168
+ .forEach((line: string) => {
169
+ if (line.includes('-')) {
170
+ const range = line.split('-').map(Number);
171
+ for (let i = range[0]; i <= range[1]; i++) {
172
+ highlights.push(i);
173
+ }
174
+ } else {
175
+ highlights.push(Number(line));
176
+ }
177
+ });
178
+ return highlights;
179
+ };
180
+
181
+ const addLineData = (
182
+ nodes: ExtendedRefractorNode[],
183
+ data: { lineNumber: number }
184
+ ): ExtendedRefractorNode[] => {
185
+ return nodes.reduce<ExtendedRefractorNode[]>((result, node) => {
186
+ const lineStart = data.lineNumber;
187
+ if (node.type === 'text') {
188
+ if (!node.value.match(/\r\n?|\n/)) {
189
+ node.lineStart = lineStart;
190
+ node.lineEnd = lineStart;
191
+ result.push(node);
192
+ } else {
193
+ const lines = node.value.split(/\r\n?|\n/);
194
+ lines.forEach((line, i) => {
195
+ const num = i === 0 ? data.lineNumber : ++data.lineNumber;
196
+ result.push({
197
+ type: 'text',
198
+ value: i === lines.length - 1 ? line : `${line}\n`,
199
+ lineStart: num,
200
+ lineEnd: num
201
+ });
202
+ });
203
+ }
204
+ return result;
205
+ }
206
+
207
+ if (node.children && node.children.length) {
208
+ const children = addLineData(node.children, data);
209
+ const first = children[0];
210
+ const last = children[children.length - 1];
211
+ const start = first.lineStart ?? lineStart;
212
+ const end = last.lineEnd ?? lineStart;
213
+ if (start !== end) {
214
+ children.forEach((node) => {
215
+ result.push(node);
216
+ });
217
+ } else {
218
+ node.lineStart = start;
219
+ node.lineEnd = end;
220
+ node.children = children;
221
+ result.push(node);
222
+ }
223
+ return result;
224
+ }
225
+
226
+ result.push(node);
227
+ return result;
228
+ }, []);
229
+ };
230
+
231
+ function wrapLines(
232
+ nodes: ExtendedRefractorNode[],
233
+ options: { showLineNumbers: boolean; highlight?: string }
234
+ ) {
235
+ const highlights = options.highlight
236
+ ? parseLineRanges(options.highlight)
237
+ : [];
238
+ const grouped: ExtendedRefractorNode[][] = [];
239
+ nodes.forEach((node) => {
240
+ const lineStart = node.lineStart! - 1;
241
+ if (grouped[lineStart]) {
242
+ grouped[lineStart].push(node);
243
+ } else {
244
+ grouped[lineStart] = [node];
245
+ }
246
+ });
247
+ const wrapped: RefractorNode[] = [];
248
+ const digits = grouped.length.toString().length;
249
+ const width = digits * CHAR_SIZE;
250
+ grouped.forEach((node, i) => {
251
+ const lineNumber = i + 1;
252
+ const classes = ['euiCodeBlock__line'];
253
+ if (highlights.includes(lineNumber)) {
254
+ classes.push('euiCodeBlock__line--isHighlighted');
255
+ }
256
+ const children: RefractorNode[] = options.showLineNumbers
257
+ ? [
258
+ {
259
+ type: 'element',
260
+ tagName: 'span',
261
+ properties: {
262
+ style: { width: `${width}px` },
263
+ ['data-line-number']: lineNumber,
264
+ ['aria-hidden']: true,
265
+ className: ['euiCodeBlock__lineNumber']
266
+ },
267
+ children: []
268
+ },
269
+ {
270
+ type: 'element',
271
+ tagName: 'span',
272
+ properties: {
273
+ style: {
274
+ marginLeft: `${width + $euiSizeS}px`,
275
+ width: `calc(100% - ${width}px)`
276
+ },
277
+ className: ['euiCodeBlock__lineText']
278
+ },
279
+ children: node
280
+ }
281
+ ]
282
+ : node;
283
+ wrapped.push({
284
+ type: 'element',
285
+ tagName: 'span',
286
+ properties: {
287
+ className: [classes.join(' ')]
288
+ },
289
+ children
290
+ });
291
+ });
292
+ return wrapped;
293
+ }
294
+
295
+ export const highlightByLine = (
296
+ children: string,
297
+ language: string,
298
+ data: LineNumbersConfig
299
+ ) => {
300
+ return wrapLines(
301
+ addLineData(highlight(children, language), { lineNumber: data.start }),
302
+ { showLineNumbers: data.show, highlight: data.highlight }
303
+ );
304
+ };
@@ -102,7 +102,7 @@ export function colorPalette(
102
102
  const stepsLeft = createSteps(hexStart, numColorsLeft);
103
103
  const stepsRight = createSteps(hexEnd, numColorsRight);
104
104
 
105
- return (even && diverging ? stepsLeft.slice(0, stepsLeft.length - 1) : stepsLeft).concat(
106
- stepsRight.slice(1)
107
- );
105
+ return (
106
+ even && diverging ? stepsLeft.slice(0, stepsLeft.length - 1) : stepsLeft
107
+ ).concat(stepsRight.slice(1));
108
108
  }
@@ -96,7 +96,8 @@ export const euiPaletteColorBlind = ({
96
96
  // Sort the colors based on the color wheel, but shifting the values based on sortShift
97
97
  base = [...base].sort(function (a, b) {
98
98
  return (
99
- chroma(a).set('hsl.h', sortShift).hsl()[0] - chroma(b).set('hsl.h', sortShift).hsl()[0]
99
+ chroma(a).set('hsl.h', sortShift).hsl()[0] -
100
+ chroma(b).set('hsl.h', sortShift).hsl()[0]
100
101
  );
101
102
  });
102
103
  }
@@ -134,9 +135,13 @@ export const euiPaletteColorBlind = ({
134
135
  return colors;
135
136
  };
136
137
 
137
- export const euiPaletteColorBlindBehindText = (paletteProps: EuiPaletteColorBlindProps = {}) => {
138
+ export const euiPaletteColorBlindBehindText = (
139
+ paletteProps: EuiPaletteColorBlindProps = {}
140
+ ) => {
138
141
  const originalPalette = euiPaletteColorBlind(paletteProps);
139
- const newPalette = originalPalette.map((color) => chroma(color).brighten(0.5).hex());
142
+ const newPalette = originalPalette.map((color) =>
143
+ chroma(color).brighten(0.5).hex()
144
+ );
140
145
  return newPalette;
141
146
  };
142
147
 
@@ -160,7 +165,11 @@ export const euiPaletteForStatus = function (steps: number): EuiPalette {
160
165
  }
161
166
  if (steps <= 3) {
162
167
  return euiPalette(
163
- [euiPaletteColorBlind()[0], euiPaletteColorBlind()[5], lightNegativeColor],
168
+ [
169
+ euiPaletteColorBlind()[0],
170
+ euiPaletteColorBlind()[5],
171
+ lightNegativeColor
172
+ ],
164
173
  steps,
165
174
  true
166
175
  );
@@ -196,7 +205,11 @@ export const euiPaletteComplimentary = function (steps: number): EuiPalette {
196
205
  return [euiPaletteColorBlind()[1]];
197
206
  }
198
207
 
199
- return euiPalette([euiPaletteColorBlind()[1], euiPaletteColorBlind()[7]], steps, true);
208
+ return euiPalette(
209
+ [euiPaletteColorBlind()[1], euiPaletteColorBlind()[7]],
210
+ steps,
211
+ true
212
+ );
200
213
  };
201
214
 
202
215
  export const euiPaletteNegative = function (steps: number): EuiPalette {
@@ -236,5 +249,9 @@ export const euiPaletteGray = function (steps: number): EuiPalette {
236
249
  return ['#98a2b3'];
237
250
  }
238
251
 
239
- return euiPalette(['white', '#d3dae6', '#98a2b3', '#69707d', '#343741'], steps, false);
252
+ return euiPalette(
253
+ ['white', '#d3dae6', '#98a2b3', '#69707d', '#343741'],
254
+ steps,
255
+ false
256
+ );
240
257
  };
@@ -1,6 +1,8 @@
1
1
  import { isColorDark } from '../../helpers/is-color-dark';
2
2
  import { hexToRgb } from '../../helpers/hex-to-rgb';
3
3
  import { euiPaletteColorBlindBehindText } from '../../utils/color/eui_palettes';
4
+ import { isValidHex } from '../../helpers/is-valid-hex';
5
+ import { assert, warn } from '@ember/debug';
4
6
 
5
7
  export const baseClass = 'euiAvatar';
6
8
  export const VIS_COLORS = euiPaletteColorBlindBehindText();
@@ -19,30 +21,70 @@ export const typeMapping = {
19
21
 
20
22
  export function inlineStyles({
21
23
  name,
22
- color
24
+ color,
25
+ imageUrl,
26
+ initials
23
27
  }: {
24
28
  name: string;
25
29
  color: string;
26
30
  iconColor: string;
31
+ imageUrl?: string;
32
+ initials?: string;
27
33
  }): Styling {
28
34
  let assignedColor = color;
35
+ // let iconCustomColor = iconColor;
36
+ let avatarStyle: {
37
+ backgroundColor?: string;
38
+ color?: string;
39
+ backgroundImage?: string;
40
+ } = {};
41
+
42
+ checkValidInitials(initials);
29
43
 
30
44
  const isNamedColor = color === 'plain' || color === null;
31
45
 
46
+ if (imageUrl) {
47
+ avatarStyle.backgroundImage = `url(${imageUrl})`;
48
+ }
49
+
32
50
  if (!isNamedColor) {
33
- if (name && !assignedColor) {
34
- assignedColor = VIS_COLORS[Math.floor(name.length % VIS_COLORS.length)];
35
- }
51
+ checkValidColor(color);
52
+
53
+ assignedColor =
54
+ color || VIS_COLORS[Math.floor(name.length % VIS_COLORS.length)];
55
+
36
56
  const textColor = isColorDark(...hexToRgb(assignedColor || 'base'))
37
57
  ? '#FFFFFF'
38
58
  : '#000000';
39
- return {
40
- 'background-color': assignedColor,
41
- color: textColor
42
- };
59
+
60
+ avatarStyle.backgroundColor = assignedColor;
61
+ avatarStyle.color = textColor;
62
+ return avatarStyle;
43
63
  }
44
64
 
45
- return {};
65
+ return avatarStyle;
66
+ }
67
+
68
+ export const checkValidColor = (color: string | 'plain' | null) => {
69
+ const validHex = (color && isValidHex(color)) || color === 'plain';
70
+ if (color && !validHex) {
71
+ assert(
72
+ 'EuiAvatar needs to pass a valid color. This can either be a three or six character hex value',
73
+ true
74
+ );
75
+ }
76
+ };
77
+
78
+ function checkValidInitials(initials?: string) {
79
+ // Must be a string of 1 or 2 characters
80
+ if (initials && initials.length > 2) {
81
+ warn(
82
+ 'EuiAvatar only accepts a max of 2 characters for the initials as a string. It is displaying only the first 2 characters.',
83
+ {
84
+ id: 'EuiAvatar-initials-excedeed'
85
+ }
86
+ );
87
+ }
46
88
  }
47
89
 
48
90
  const mapping: ComponentMapping = {
@@ -8,7 +8,7 @@ export const VIS_COLORS = euiPaletteColorBlindBehindText();
8
8
  export const colorToHexMap = {
9
9
  default: '#d3dae6',
10
10
  primary: VIS_COLORS[1],
11
- secondary: VIS_COLORS[0],
11
+ success: VIS_COLORS[0],
12
12
  accent: VIS_COLORS[2],
13
13
  warning: VIS_COLORS[5],
14
14
  danger: VIS_COLORS[9]
@@ -22,7 +22,11 @@ export type ColorType = EuiBadgeColorType | string;
22
22
 
23
23
  export const baseClass = 'euiBadge';
24
24
 
25
- export function inlineStyles({ badgeColor }: { badgeColor: ColorType }): Styling {
25
+ export function inlineStyles({
26
+ badgeColor
27
+ }: {
28
+ badgeColor: ColorType;
29
+ }): Styling {
26
30
  let textColor = null;
27
31
  let colorHex = 'default';
28
32
 
@@ -0,0 +1,22 @@
1
+ export const baseClass = 'euiBetaBadge';
2
+
3
+ export const colorMapping = {
4
+ accent: `${baseClass}--accent`,
5
+ subdued: `${baseClass}--subdued`,
6
+ hollow: `${baseClass}--hollow`
7
+ };
8
+
9
+ export const sizeMapping = {
10
+ s: `${baseClass}--small`,
11
+ m: ''
12
+ };
13
+
14
+ const mapping: ComponentMapping = {
15
+ base: baseClass,
16
+ properties: {
17
+ color: colorMapping,
18
+ size: sizeMapping
19
+ }
20
+ };
21
+
22
+ export default mapping;
@@ -7,10 +7,17 @@ const paddingSizeMapping = {
7
7
  l: `${baseClass}--paddingLarge`
8
8
  };
9
9
 
10
+ const positionTypeMapping = {
11
+ fixed: `${baseClass}--fixed`,
12
+ sticky: `${baseClass}--sticky`,
13
+ static: `${baseClass}--static`
14
+ };
15
+
10
16
  const mapping: ComponentMapping = {
11
17
  base: baseClass,
12
18
  properties: {
13
- paddingSize: paddingSizeMapping
19
+ paddingSize: paddingSizeMapping,
20
+ positionType: positionTypeMapping
14
21
  }
15
22
  };
16
23
 
@@ -1,18 +1,18 @@
1
1
  export const baseClass = 'euiButtonEmpty';
2
2
 
3
3
  const colorMapping = {
4
- text: `${baseClass}--text`,
4
+ primary: `${baseClass}--primary`,
5
5
  danger: `${baseClass}--danger`,
6
- warning: `${baseClass}--warning`,
6
+ text: `${baseClass}--text`,
7
7
  ghost: `${baseClass}--ghost`,
8
- primary: `${baseClass}--primary`,
8
+ warning: `${baseClass}--warning`,
9
9
  success: `${baseClass}--success`
10
10
  };
11
11
 
12
12
  const sizeMapping = {
13
13
  xs: `${baseClass}--xSmall`,
14
14
  s: `${baseClass}--small`,
15
- l: `${baseClass}--large`
15
+ m: ''
16
16
  };
17
17
 
18
18
  const flushMapping = {