@dataloop-ai/components 0.20.189 → 0.20.190

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.189",
3
+ "version": "0.20.190",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -16,8 +16,12 @@
16
16
  @click="onClick"
17
17
  @dblclick="onDblClick"
18
18
  @mousedown="onMouseDown"
19
+ @mouseup="mouseDown = false"
19
20
  @mouseenter="mouseOver = true"
20
- @mouseleave="mouseOver = false"
21
+ @mouseleave="
22
+ mouseOver = false;
23
+ mouseDown = false
24
+ "
21
25
  >
22
26
  <dl-tooltip
23
27
  v-if="!tooltip && overflow && isOverflowing && hasLabel"
@@ -219,6 +223,7 @@ export default defineComponent({
219
223
  const buttonLabelRef = ref(null)
220
224
  const { hasEllipsis } = useSizeObserver(buttonLabelRef)
221
225
  const mouseOver = ref(false)
226
+ const mouseDown = ref(false)
222
227
 
223
228
  const buttonClass = computed(() => {
224
229
  const classes = ['dl-button']
@@ -239,6 +244,7 @@ export default defineComponent({
239
244
  isOverflowing: hasEllipsis,
240
245
  buttonClass,
241
246
  mouseOver,
247
+ mouseDown,
242
248
  buttonTimeout
243
249
  }
244
250
  },
@@ -264,6 +270,21 @@ export default defineComponent({
264
270
  textColor: this.iconColor ?? this.textColor
265
271
  })
266
272
  }
273
+
274
+ if (this.mouseDown) {
275
+ if (this.colorsObject?.PRESSED?.TEXT) {
276
+ return this.colorsObject.PRESSED.TEXT
277
+ }
278
+ if (!this.flat) {
279
+ return 'var(--dl-button-text-color)'
280
+ }
281
+ return setTextOnPressed({
282
+ disabled: this.disabled,
283
+ flat: this.flat,
284
+ textColor: this.iconColor ?? this.textColor
285
+ })
286
+ }
287
+
267
288
  if (this.mouseOver) {
268
289
  return (
269
290
  this.hoverTextColor ??
@@ -416,8 +437,10 @@ export default defineComponent({
416
437
  color: this.color
417
438
  }),
418
439
  '--dl-button-text-color-pressed': setTextOnPressed({
419
- shaded: this.shaded,
420
- outlined: this.shaded
440
+ disabled: this.disabled,
441
+ flat: this.flat,
442
+ color: this.color,
443
+ textColor: this.textColor
421
444
  }),
422
445
  '--dl-button-bg-pressed':
423
446
  this.pressedBgColor ??
@@ -497,6 +520,7 @@ export default defineComponent({
497
520
  }
498
521
  }
499
522
 
523
+ this.mouseDown = true
500
524
  this.$emit('mousedown', e)
501
525
  }
502
526
  }
@@ -542,6 +566,7 @@ export default defineComponent({
542
566
  transition: var(--dl-button-text-transition-duration);
543
567
  }
544
568
  }
569
+ outline: none;
545
570
 
546
571
  &--dense {
547
572
  border: none;
@@ -562,6 +587,11 @@ export default defineComponent({
562
587
  color: var(--dl-button-text-color-hover) !important;
563
588
  }
564
589
  }
590
+ &:focus-visible {
591
+ outline: 1px solid var(--dell-blue-500);
592
+ outline-offset: 2px;
593
+ border-radius: var(--dl-button-border-radius);
594
+ }
565
595
  }
566
596
 
567
597
  .dl-button-content {
@@ -213,10 +213,14 @@ export const setBgOnPressed = ({ shaded }: Partial<DlButtonProps>) => {
213
213
  }
214
214
 
215
215
  export const setTextOnPressed = ({
216
- shaded,
217
- outlined
216
+ disabled,
217
+ flat,
218
+ textColor
218
219
  }: Partial<DlButtonProps>) => {
219
- return 'var(--dl-button-text-color)'
220
+ if (textColor) return getColor(textColor, 'dl-color-secondary')
221
+ if (disabled) return getColor('', 'dl-color-disabled')
222
+ if (!flat) return 'var(--dl-button-text-color)'
223
+ return 'var(--dl-color-secondary)'
220
224
  }
221
225
 
222
226
  export const setBorderOnPressed = ({