@dataloop-ai/components 0.20.242 → 0.20.243

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dataloop-ai/components",
3
- "version": "0.20.242",
3
+ "version": "0.20.243",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -16,7 +16,7 @@
16
16
  :color="iconColor"
17
17
  :size="iconSize"
18
18
  />
19
- <div class="text" :style="textStyle">
19
+ <div ref="textRef" class="text" :style="textStyle">
20
20
  <slot v-if="!text" />
21
21
  <span v-else>
22
22
  {{ text }}
@@ -208,6 +208,7 @@ export default defineComponent({
208
208
  }))
209
209
 
210
210
  const rootRef = ref(null)
211
+ const textRef = ref(null)
211
212
  const rootStyle = ref()
212
213
  const iconStyle = ref()
213
214
  const closeButtonStyle = ref()
@@ -245,7 +246,7 @@ export default defineComponent({
245
246
  return
246
247
  }
247
248
 
248
- const { height } = rootElement.getBoundingClientRect()
249
+ const textElement = (textRef as Ref<HTMLElement | null>).value
249
250
  const iconS: Record<string, any> = {
250
251
  display: 'flex',
251
252
  alignSelf: 'flex-start',
@@ -279,6 +280,14 @@ export default defineComponent({
279
280
  rootS['--dl-alert-padding'] = '8px 16px 8px 12px'
280
281
  }
281
282
 
283
+ if (
284
+ textElement?.querySelector(
285
+ '.toast-text--single, .toast-text--with-title'
286
+ )
287
+ ) {
288
+ iconS.marginTop = '4px'
289
+ }
290
+
282
291
  iconStyle.value = iconS
283
292
  rootStyle.value = rootS
284
293
  closeButtonStyle.value = closeS
@@ -311,6 +320,7 @@ export default defineComponent({
311
320
  return {
312
321
  uuid: `dl-alert-${v4()}`,
313
322
  rootRef,
323
+ textRef,
314
324
  show,
315
325
  icon,
316
326
  iconColor,
@@ -143,6 +143,7 @@ export default defineComponent({
143
143
  function showToastMessage() {
144
144
  DlToast.open({
145
145
  message: message.value,
146
+ multiLine: false,
146
147
  position: position.value as DlToastPositions,
147
148
  type: type.value as DlToastTypes,
148
149
  duration: Number(duration.value) || 1000,