@dataloop-ai/components 0.17.74 → 0.17.75

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.17.74",
3
+ "version": "0.17.75",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -24,6 +24,7 @@
24
24
  "dependencies": {
25
25
  "@dataloop-ai/icons": "^3.0.6",
26
26
  "@types/lodash": "^4.14.184",
27
+ "@types/flat": "^5.0.2",
27
28
  "chart.js": "^3.9.1",
28
29
  "flat": "^5.0.2",
29
30
  "lodash": "^4.17.21",
@@ -46,7 +47,6 @@
46
47
  "@storybook/client-api": "^7.0.4",
47
48
  "@storybook/vue3": "^7.0.4",
48
49
  "@storybook/vue3-vite": "^7.0.4",
49
- "@types/flat": "^5.0.2",
50
50
  "@types/jsdom": "^16.2.14",
51
51
  "@types/node": "^18.7.18",
52
52
  "@types/resize-observer-browser": "^0.1.7",
@@ -24,6 +24,7 @@
24
24
  <div class="dl-button-content dl-anchor--skip">
25
25
  <dl-icon
26
26
  v-if="hasIcon"
27
+ class="dl-button-icon"
27
28
  :size="iconSizePX"
28
29
  :color="iconColor || textColor"
29
30
  :icon="icon"
@@ -135,7 +136,6 @@ export default defineComponent({
135
136
  /**
136
137
  * The width of the button will take that of its container
137
138
  */
138
- shaded: { type: Boolean, default: false },
139
139
  fluid: Boolean,
140
140
  /**
141
141
  * The button will not have an outline
@@ -154,7 +154,6 @@ export default defineComponent({
154
154
  validator: (value: string): boolean =>
155
155
  transformOptions.includes(value)
156
156
  },
157
- outlined: Boolean,
158
157
  /**
159
158
  * Doesn't allow the button's text to be wrapped along multiple rows
160
159
  */
@@ -172,7 +171,9 @@ export default defineComponent({
172
171
  * The button will maintain the styles it has when it's pressed if this prop is active
173
172
  */
174
173
  active: { type: Boolean, default: false, required: false },
175
- styles: { type: [Object, String], default: null }
174
+ styles: { type: [Object, String], default: null },
175
+ shaded: { type: Boolean, default: false },
176
+ outlined: Boolean
176
177
  },
177
178
  emits: ['click', 'mousedown'],
178
179
  setup(props) {
@@ -334,6 +335,8 @@ export default defineComponent({
334
335
  }
335
336
 
336
337
  return {
338
+ '--dl-button-transition-duration': 'all ease 0.15s',
339
+ '--dl-button-text-transition-duration': 'all ease 0.05s',
337
340
  '--dl-button-container-width': this.fluid ? '100%' : 'auto',
338
341
  '--dl-button-padding': this.dense
339
342
  ? '0'
@@ -416,27 +419,28 @@ export default defineComponent({
416
419
  align-items: stretch;
417
420
  position: relative;
418
421
  vertical-align: middle;
419
- transition: all ease-in 0.15s;
422
+ transition: var(--dl-button-transition-duration);
420
423
  justify-content: center;
421
424
 
422
425
  &:active {
423
- transition: all ease-in 0.15s;
426
+ transition: var(--dl-button-transition-duration);
424
427
  color: var(--dl-button-text-color-pressed) !important;
425
428
  background-color: var(--dl-button-bg-pressed) !important;
426
429
  border-color: var(--dl-button-border-pressed) !important;
427
430
 
428
431
  & > span > i {
429
- transition: all ease-in 0.15s;
432
+ transition: var(--dl-button-text-transition-duration);
430
433
  }
431
434
  }
432
435
 
433
436
  &:hover:enabled:not(:active) {
437
+ transition: var(--dl-button-transition-duration);
434
438
  color: var(--dl-button-text-color-hover);
435
439
  background-color: var(--dl-button-bg-hover);
436
440
  border-color: var(--dl-button-border-hover);
437
441
 
438
442
  & .dl-button-label {
439
- transition: all ease-in 0.15s;
443
+ transition: var(--dl-button-text-transition-duration);
440
444
  color: var(--dl-button-color-hover);
441
445
  }
442
446
  }
@@ -456,6 +460,10 @@ export default defineComponent({
456
460
  gap: var(--dl-button-content-gap, 7px);
457
461
  }
458
462
 
463
+ .dl-button-icon {
464
+ transition: var(--dl-button-text-transition-duration);
465
+ }
466
+
459
467
  .dl-button-container.first-letter-capitalized {
460
468
  &::first-letter,
461
469
  & > *::first-letter {
@@ -472,9 +480,11 @@ export default defineComponent({
472
480
  color: var(--dl-button-text-color-hover);
473
481
  background-color: var(--dl-button-bg-hover);
474
482
  border-color: var(--dl-button-border-hover);
483
+ transition: var(--dl-button-transition-duration);
484
+
475
485
  & .dl-button-label {
476
- transition: all ease-in 0.15s;
477
486
  color: var(--dl-button-color-hover);
487
+ transition: var(--dl-button-text-transition-duration);
478
488
  }
479
489
  }
480
490
  </style>
@@ -71,7 +71,7 @@ export const setTextColor = ({
71
71
  return getColor('', 'dl-color-disabled')
72
72
  }
73
73
  if (shaded && outlined) {
74
- return 'var(--dl-color-text-darker-buttons)'
74
+ return getColor(textColor, 'dl-color-text-darker-buttons')
75
75
  }
76
76
  if (outlined) {
77
77
  return getColor(textColor, 'dl-color-secondary')
@@ -82,7 +82,7 @@ export default defineComponent({
82
82
  }
83
83
  },
84
84
  // TODO: fix type issue here
85
- setup(props: any, { slots }) {
85
+ setup(props: any, { slots }: any) {
86
86
  const dlEllipsisRef = ref(null)
87
87
  const { hasEllipsis } = useSizeObserver(dlEllipsisRef)
88
88
 
@@ -284,6 +284,16 @@
284
284
  </div>
285
285
  </dl-button>
286
286
  </div>
287
+ <div>
288
+ <h3>Shaded and outlined</h3>
289
+ <dl-button
290
+ :active="activeButtonState"
291
+ icon="icon-dl-search"
292
+ label="test me"
293
+ shaded
294
+ outlined
295
+ />
296
+ </div>
287
297
  </div>
288
298
  </template>
289
299