@dataloop-ai/components 0.20.219 → 0.20.220

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.219",
3
+ "version": "0.20.220",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -8,7 +8,7 @@
8
8
  :style="rootStyle"
9
9
  data-test="root"
10
10
  >
11
- <div>
11
+ <div class="content">
12
12
  <dl-icon
13
13
  data-test="icon"
14
14
  :style="iconStyle"
@@ -16,12 +16,12 @@
16
16
  :color="iconColor"
17
17
  :size="iconSize"
18
18
  />
19
- <span class="text" :style="textStyle">
19
+ <div class="text" :style="textStyle">
20
20
  <slot v-if="!text" />
21
21
  <span v-else>
22
22
  {{ text }}
23
23
  </span>
24
- </span>
24
+ </div>
25
25
  </div>
26
26
  <div
27
27
  v-if="$slots.actions"
@@ -250,7 +250,7 @@ export default defineComponent({
250
250
  const iconS: Record<string, any> = {
251
251
  display: 'flex',
252
252
  alignSelf: 'flex-start',
253
- paddingTop: '2px'
253
+ marginTop: '2px'
254
254
  }
255
255
  const closeS: Record<string, any> = {
256
256
  display: 'flex',
@@ -277,7 +277,7 @@ export default defineComponent({
277
277
  if (padding.value) {
278
278
  rootS['--dl-alert-padding'] = padding.value
279
279
  } else {
280
- rootS['--dl-alert-padding'] = '8px 16px'
280
+ rootS['--dl-alert-padding'] = '8px 16px 8px 12px'
281
281
  }
282
282
 
283
283
  iconStyle.value = iconS
@@ -335,6 +335,7 @@ export default defineComponent({
335
335
  display: inline-flex;
336
336
  flex-direction: row;
337
337
  justify-content: space-between;
338
+ align-items: stretch;
338
339
  min-height: 36px;
339
340
  border-left: 4px solid var(--dl-alert-indicator-color, transparent);
340
341
  border-top: 1px solid var(--dl-alert-border-color, transparent);
@@ -363,22 +364,24 @@ export default defineComponent({
363
364
  text-decoration: underline;
364
365
  }
365
366
 
366
- > div {
367
+ .content {
367
368
  display: flex;
368
369
  flex-direction: row;
369
- padding: var(--dl-alert-padding, 10px 16px);
370
+ align-items: center;
371
+ gap: 8px;
372
+ padding: var(--dl-alert-padding);
373
+ min-width: 0;
374
+ flex: 1 1 auto;
370
375
  }
371
376
 
372
377
  .text {
373
- padding-left: 8px;
374
- padding-top: 2px;
375
- font-size: var(--dl-font-size-body);
376
- line-height: normal;
377
- align-self: flex-start;
378
+ color: var(--dell-gray-800);
379
+ align-self: center;
378
380
  font-size: 14px;
379
- line-height: 16px;
381
+ line-height: 20px;
380
382
  font-weight: 400;
381
383
  word-break: break-word;
384
+ min-width: 0;
382
385
  }
383
386
 
384
387
  .close-button {
@@ -342,12 +342,15 @@ export default defineComponent({
342
342
  .toast-text {
343
343
  min-width: 0;
344
344
  flex: 1 1 auto;
345
+ display: inline-block;
346
+ vertical-align: top;
345
347
  }
346
348
 
347
349
  .toast-title {
348
- font-size: var(--dl-font-size-alert-title, 16px);
350
+ color: var(--dell-gray-800);
351
+ font-size: 16px;
352
+ font-weight: 400;
349
353
  line-height: 150%;
350
- margin-bottom: 2px;
351
354
  }
352
355
 
353
356
  .toast-text--single {
@@ -358,7 +361,7 @@ export default defineComponent({
358
361
 
359
362
  .toast-caption {
360
363
  margin-top: 2px;
361
- opacity: 0.8;
364
+ font-size: inherit;
362
365
  }
363
366
 
364
367
  .toast-message--pre-line {
@@ -104,6 +104,12 @@
104
104
  :left-label="htmlEnabled ? 'HTML true' : 'HTML false'"
105
105
  />
106
106
  </div>
107
+ <dl-button @click="showToastWithTitleTextCaption" style="margin-top: 8px">
108
+ Toast with Title + Text + Caption
109
+ </dl-button>
110
+ <dl-button style="margin-top: 8px" @click="showToastWithTwoActions">
111
+ Toast with buttons
112
+ </dl-button>
107
113
  </div>
108
114
  </template>
109
115
 
@@ -139,6 +145,33 @@ export default defineComponent({
139
145
  const width = ref('auto')
140
146
  const collapseCount = ref(null)
141
147
  const htmlEnabled = ref(false)
148
+
149
+ function showToastWithTwoActions() {
150
+ DlToast.open({
151
+ message: '',
152
+ caption: 'This is a single-line caption toast with 2 actions.',
153
+ multiLine: false,
154
+ position: position.value as DlToastPositions,
155
+ type: type.value as DlToastTypes,
156
+ duration: Number(duration.value) || 1000,
157
+ closable: closable.value,
158
+ width: width.value,
159
+ collapseCount: collapseCount.value,
160
+ actions: [
161
+ {
162
+ label: 'Action 1',
163
+ closeOnClick: true,
164
+ handler: () => undefined
165
+ },
166
+ {
167
+ label: 'Action 2',
168
+ closeOnClick: true,
169
+ handler: () => undefined
170
+ }
171
+ ]
172
+ })
173
+ }
174
+
142
175
  function showToastMessage() {
143
176
  DlToast.open({
144
177
  message: message.value,
@@ -202,11 +235,27 @@ export default defineComponent({
202
235
  multiLine: true
203
236
  } as any)
204
237
  }
238
+
239
+ function showToastWithTitleTextCaption() {
240
+ DlToast.open({
241
+ title: 'Toast Title',
242
+ message: 'This is the main message text that appears in the toast.',
243
+ caption: 'This is the caption that appears below the message.',
244
+ position: position.value as DlToastPositions,
245
+ type: type.value as DlToastTypes,
246
+ duration: Number(duration.value) || 1000,
247
+ closable: closable.value,
248
+ width: width.value,
249
+ collapseCount: collapseCount.value
250
+ })
251
+ }
205
252
  return {
206
253
  showToastMessageCustom,
207
254
  showToastMessage,
208
255
  showToastMultiLine,
209
256
  showToastWithLink,
257
+ showToastWithTitleTextCaption,
258
+ showToastWithTwoActions,
210
259
  message,
211
260
  duration,
212
261
  type,