@gitlab/ui 128.13.2 → 128.13.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 (53) hide show
  1. package/dist/components/base/toast/toast.js +26 -24
  2. package/dist/index.css.map +1 -1
  3. package/dist/vendor/bootstrap-vue/src/components/toast/helpers/bv-toast.js +17 -3
  4. package/dist/vendor/bootstrap-vue/src/components/toast/toast.js +6 -1
  5. package/package.json +2 -2
  6. package/src/components/base/alert/alert.scss +11 -6
  7. package/src/components/base/animated_icon/animated_icon.scss +31 -20
  8. package/src/components/base/avatar/avatar.scss +8 -9
  9. package/src/components/base/avatars_inline/avatars_inline.scss +12 -4
  10. package/src/components/base/breadcrumb/breadcrumb.scss +2 -2
  11. package/src/components/base/button/button.scss +16 -14
  12. package/src/components/base/button_group/button_group.scss +9 -9
  13. package/src/components/base/datepicker/datepicker.scss +6 -6
  14. package/src/components/base/drawer/drawer.scss +2 -2
  15. package/src/components/base/dropdown/dropdown.scss +4 -4
  16. package/src/components/base/dropdown/dropdown_divider.scss +1 -1
  17. package/src/components/base/form/form_checkbox/form_checkbox.scss +12 -12
  18. package/src/components/base/form/form_combobox/form_combobox.scss +3 -2
  19. package/src/components/base/form/form_input/form_input.scss +3 -1
  20. package/src/components/base/form/form_select/form_select.scss +2 -2
  21. package/src/components/base/label/label.scss +5 -2
  22. package/src/components/base/link/link.scss +1 -1
  23. package/src/components/base/loading_icon/loading_icon.scss +1 -1
  24. package/src/components/base/markdown/markdown.scss +1 -1
  25. package/src/components/base/new_dropdowns/dropdown.scss +15 -3
  26. package/src/components/base/new_dropdowns/dropdown_item.scss +3 -2
  27. package/src/components/base/pagination/pagination.scss +5 -4
  28. package/src/components/base/path/path.scss +8 -3
  29. package/src/components/base/progress_bar/progress_bar.scss +2 -2
  30. package/src/components/base/table/table.scss +4 -4
  31. package/src/components/base/tabs/tabs/tabs.scss +7 -6
  32. package/src/components/base/toast/toast.js +31 -29
  33. package/src/components/base/toast/toast.scss +2 -2
  34. package/src/components/charts/legend/legend.scss +12 -8
  35. package/src/components/charts/single_stat/single_stat.scss +2 -2
  36. package/src/components/dashboards/dashboard_layout/grid_layout/grid_layout.scss +1 -1
  37. package/src/components/regions/empty_state/empty_state.scss +1 -1
  38. package/src/components/utilities/truncate/truncate.scss +1 -1
  39. package/src/scss/bootstrap.scss +34 -34
  40. package/src/scss/bootstrap_vue.scss +10 -10
  41. package/src/scss/components.scss +77 -77
  42. package/src/scss/fonts.scss +10 -10
  43. package/src/scss/functions.scss +6 -6
  44. package/src/scss/gitlab_ui.scss +10 -10
  45. package/src/scss/mixins.scss +23 -23
  46. package/src/scss/storybook.scss +14 -15
  47. package/src/scss/tokens.scss +2 -2
  48. package/src/scss/typescale/_index.scss +1 -1
  49. package/src/scss/typescale/typescale_demo.scss +4 -4
  50. package/src/scss/typography.scss +16 -6
  51. package/src/scss/variables.scss +29 -14
  52. package/src/vendor/bootstrap-vue/src/components/toast/helpers/bv-toast.js +19 -3
  53. package/src/vendor/bootstrap-vue/src/components/toast/toast.js +6 -1
@@ -10,7 +10,7 @@ import { concat } from '../../../utils/array'
10
10
  import { getComponentConfig } from '../../../utils/config'
11
11
  import { requestAF } from '../../../utils/dom'
12
12
  import { getRootEventName, getRootActionEventName } from '../../../utils/events'
13
- import { isUndefined } from '../../../utils/inspect'
13
+ import { isUndefined, isFunction } from '../../../utils/inspect'
14
14
  import {
15
15
  assign,
16
16
  defineProperties,
@@ -24,6 +24,7 @@ import { pluginFactory } from '../../../utils/plugins'
24
24
  import { warn, warnNotClient } from '../../../utils/warn'
25
25
  import { createNewChildComponent } from '../../../utils/create-new-child-component'
26
26
  import { getEventRoot } from '../../../utils/get-event-root'
27
+ import { isVue3 } from '../../../vue'
27
28
  import { BToast, props as toastProps } from '../toast'
28
29
 
29
30
  // --- Constants ---
@@ -129,9 +130,24 @@ const plugin = Vue => {
129
130
  })
130
131
  // Convert certain props to slots
131
132
  keys(propsToSlots).forEach(prop => {
132
- const value = props[prop]
133
+ let value = props[prop]
133
134
  if (!isUndefined(value)) {
134
- toast.$slots[propsToSlots[prop]] = concat(value)
135
+ if (isVue3(toast)) {
136
+ // In Vue 3 compat, $slots is readonly. Set slots on the internal
137
+ // instance as functions so VNodes are available during the
138
+ // component's render cycle. When the value is a render function,
139
+ // defer calling it until the slot is evaluated during render so
140
+ // that $createElement runs within an active component context.
141
+ const slotFn = isFunction(value)
142
+ ? () => concat(value(toast.$createElement))
143
+ : () => concat(value)
144
+ toast.$.slots[propsToSlots[prop]] = slotFn
145
+ } else {
146
+ if (isFunction(value)) {
147
+ value = value(toast.$createElement)
148
+ }
149
+ toast.$slots[propsToSlots[prop]] = concat(value)
150
+ }
135
151
  }
136
152
  })
137
153
  // Create a mount point (a DIV) and mount it (which triggers the show)
@@ -259,7 +259,12 @@ export const BToast = /*#__PURE__*/ extend({
259
259
  }
260
260
 
261
261
  const { computedToaster } = this
262
- if (!Wormhole.hasTarget(computedToaster)) {
262
+ const hasTarget = Wormhole.hasTarget(computedToaster)
263
+ const hasDOM = document.getElementById(computedToaster)
264
+ if (!hasTarget || !hasDOM) {
265
+ if (hasTarget && !hasDOM) {
266
+ Wormhole.unregisterTarget(computedToaster)
267
+ }
263
268
  const div = document.createElement('div')
264
269
  document.body.appendChild(div)
265
270