@dataloop-ai/components 0.20.224 → 0.20.226

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.224",
3
+ "version": "0.20.226",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -1,8 +1,8 @@
1
1
  export const itemHoverColor = (isActionable: boolean) =>
2
- isActionable ? 'var(--dl-color-fill-hover)' : 'transparent'
2
+ isActionable ? 'var(--dell-blue-100)' : 'transparent'
3
3
 
4
4
  export const itemActiveColor = (isActionable: boolean) =>
5
- isActionable ? 'var(--dl-color-fill)' : 'transparent'
5
+ isActionable ? 'var(--dell-blue-100)' : 'transparent'
6
6
 
7
7
  export const itemCursor = (actionable: boolean, disabled: boolean) =>
8
8
  actionable ? 'pointer' : disabled ? 'not-allowed' : 'cursor'
@@ -281,7 +281,7 @@ export default defineComponent({
281
281
  right: 0;
282
282
  bottom: 0;
283
283
  left: 0;
284
- background-color: var(--dl-backdrop-color);
284
+ background-color: var(--dell-overlay);
285
285
  z-index: var(
286
286
  --dialog-z-index
287
287
  ); // todo: check if this should be overlay instead.
@@ -292,7 +292,7 @@ export default defineComponent({
292
292
  width: 100%;
293
293
  background-color: var(--dl-color-panel-background);
294
294
  border: 1px solid var(--dl-color-separator);
295
- color: var(--dell-gray-200);
295
+ color: var(--dell-gray-800);
296
296
  display: flex;
297
297
  flex-direction: column;
298
298
  z-index: var(--dialog-z-index);
@@ -177,7 +177,7 @@ export default defineComponent({
177
177
  }
178
178
  }
179
179
  &-active {
180
- background-color: var(--dl-color-back-tint-light);
180
+ background-color: var(--dell-blue-200);
181
181
  }
182
182
  }
183
183
 
@@ -119,7 +119,7 @@ import { Animation } from '../types'
119
119
  import { v4 } from 'uuid'
120
120
 
121
121
  const DEFAULT_ACTION_BUTTON_STYLES =
122
- 'min-width:73px; max-width:100px; height:24px; max-height:24px; padding:0 8px; border-radius:2px;'
122
+ 'min-width:73px; max-width:150px; height:24px; max-height:24px; padding:0 8px; border-radius:2px;'
123
123
 
124
124
  export default defineComponent({
125
125
  name: 'ToastComponent',
@@ -3,6 +3,8 @@
3
3
  v-if="!isSVG"
4
4
  :id="uuid"
5
5
  :style="[inlineStyles, computedStyles]"
6
+ @mouseenter="onMouseEnter"
7
+ @mouseleave="onMouseLeave"
6
8
  @click="$emit('click', $event)"
7
9
  @mousedown="$emit('mousedown', $event)"
8
10
  @mouseup="$emit('mouseup', $event)"
@@ -26,6 +28,8 @@
26
28
  v-else
27
29
  :id="uuid"
28
30
  :style="[inlineStyles, computedStyles]"
31
+ @mouseenter="onMouseEnter"
32
+ @mouseleave="onMouseLeave"
29
33
  @click="$emit('click', $event)"
30
34
  @mousedown="$emit('mousedown', $event)"
31
35
  @mouseup="$emit('mouseup', $event)"
@@ -46,6 +50,7 @@ import {
46
50
  onMounted,
47
51
  onUnmounted,
48
52
  ref,
53
+ useSlots,
49
54
  toRefs,
50
55
  watch
51
56
  } from 'vue-demi'
@@ -97,11 +102,34 @@ export default defineComponent({
97
102
  const { styles, color, size, icon, svg, inline, svgSource, tooltip } =
98
103
  toRefs(props)
99
104
 
105
+ const slots = useSlots()
100
106
  const svgIcon = ref(null)
101
107
  const isDestroyed = ref(false)
102
108
  const uuid = `dl-icon-${v4()}`
103
109
  const externalIconSource = 'material-icons'
104
110
  const logger = loggerFactory('dl-icon')
111
+ const isHovered = ref(false)
112
+
113
+ const hasDefaultSlot = computed<boolean>(() => {
114
+ const slot = slots.default
115
+ if (!slot) return false
116
+ return slot().length > 0
117
+ })
118
+
119
+ const isInfoDefault = computed<boolean>(() => {
120
+ return (
121
+ icon.value === 'icon-dl-info' &&
122
+ !color.value &&
123
+ !hasDefaultSlot.value
124
+ )
125
+ })
126
+
127
+ const effectiveColor = computed<string | null>(() => {
128
+ if (isInfoDefault.value) {
129
+ return isHovered.value ? 'dell-blue-600' : 'dell-blue-500'
130
+ }
131
+ return color.value
132
+ })
105
133
 
106
134
  const computedStyles = computed<Record<string, string>>(() => {
107
135
  const generatedStyles = isString(styles.value)
@@ -121,12 +149,12 @@ export default defineComponent({
121
149
  const cssIconVars = computed<Record<string, string>>(() => {
122
150
  return {
123
151
  '--dl-icon-font-size': `${size.value}`,
124
- '--dl-icon-color': color.value
152
+ '--dl-icon-color': effectiveColor.value
125
153
  ? // todo: remove this. this is needed for now until the swap of DLBTN in OA
126
154
  getColor(
127
- color.value === 'secondary'
155
+ effectiveColor.value === 'secondary'
128
156
  ? 'q-color-secondary'
129
- : color.value,
157
+ : effectiveColor.value,
130
158
  'dell-gray-800'
131
159
  )
132
160
  : 'inherit'
@@ -164,6 +192,18 @@ export default defineComponent({
164
192
  return { display: inline.value ? 'inline-flex' : 'flex' }
165
193
  })
166
194
 
195
+ const onMouseEnter = () => {
196
+ if (isInfoDefault.value) {
197
+ isHovered.value = true
198
+ }
199
+ }
200
+
201
+ const onMouseLeave = () => {
202
+ if (isInfoDefault.value) {
203
+ isHovered.value = false
204
+ }
205
+ }
206
+
167
207
  const loadSvg = () => {
168
208
  return new Promise<void>((resolve, reject) => {
169
209
  const loadedIcon = icon.value
@@ -239,7 +279,9 @@ export default defineComponent({
239
279
  loadSvg,
240
280
  isDestroyed,
241
281
  externalIcon,
242
- inlineStyles
282
+ inlineStyles,
283
+ onMouseEnter,
284
+ onMouseLeave
243
285
  }
244
286
  }
245
287
  })
@@ -26,6 +26,9 @@
26
26
  title="Custom Label"
27
27
  />
28
28
  <DlIcon size="50px" :icon="inputValue" />
29
+ <div style="margin-top: 24px">
30
+ <DlIcon size="24px" icon="icon-dl-info" />
31
+ </div>
29
32
  </div>
30
33
  </template>
31
34