@dataloop-ai/components 0.20.203 → 0.20.204

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.203",
3
+ "version": "0.20.204",
4
4
  "exports": {
5
5
  ".": "./index.ts",
6
6
  "./models": "./models.ts",
@@ -264,7 +264,7 @@ export default defineComponent({
264
264
  color: this.color,
265
265
  filled: this.filled,
266
266
  shaded: this.shaded,
267
- textColor: this.iconColor ?? this.textColor
267
+ textColor: this.iconColor || this.textColor
268
268
  })
269
269
  }
270
270
 
@@ -278,7 +278,7 @@ export default defineComponent({
278
278
  return setTextOnPressed({
279
279
  disabled: this.disabled,
280
280
  flat: this.flat,
281
- textColor: this.iconColor ?? this.textColor
281
+ textColor: this.iconColor || this.textColor
282
282
  })
283
283
  }
284
284
 
@@ -290,7 +290,7 @@ export default defineComponent({
290
290
  outlined: this.outlined,
291
291
  shaded: this.shaded,
292
292
  flat: this.flat,
293
- color: this.iconColor ?? this.textColor
293
+ color: this.iconColor || this.textColor
294
294
  })
295
295
  )
296
296
  }
@@ -81,29 +81,29 @@ export const setTextColor = ({
81
81
  textColor
82
82
  }: DlButtonProps): string => {
83
83
  if (disabled) {
84
- return getColor('', 'dl-color-disabled')
84
+ return getColor('', 'dell-gray-500')
85
85
  }
86
86
  if (shaded && outlined) {
87
- return getColor(textColor, 'dl-color-text-darker-buttons')
87
+ return getColor(textColor, 'dell-gray-800')
88
88
  }
89
89
  if (outlined) {
90
- return getColor(textColor, 'dl-color-secondary')
90
+ return getColor(textColor, 'dell-blue-500')
91
91
  }
92
92
  if (flat) {
93
93
  if (color === 'secondary') {
94
- return getColor(textColor, 'dl-color-darker')
94
+ return getColor(textColor, 'dell-gray-800')
95
95
  }
96
96
 
97
- return getColor(textColor, 'dl-color-secondary')
97
+ return getColor(textColor, 'dell-blue-500')
98
98
  }
99
99
  if (shaded) {
100
- return getColor(textColor, 'dl-color-darker')
100
+ return getColor(textColor, 'dell-gray-800')
101
101
  }
102
102
  if (filled) {
103
- return getColor(textColor, 'dl-color-text-buttons')
103
+ return getColor(textColor, 'dell-white')
104
104
  }
105
105
 
106
- return getColor(textColor, 'dl-color-text-buttons')
106
+ return getColor(textColor, 'dell-white')
107
107
  }
108
108
 
109
109
  export const setBgColor = ({
@@ -8,13 +8,32 @@ const allColorNames = {
8
8
  }
9
9
 
10
10
  const getLighterGradient = (color: string, magnitude = MAGNITUDE) => {
11
- color = color.replace('dl', '--dl')
11
+ if (color.startsWith('dl-') || color.startsWith('dell-')) {
12
+ color = `--${color}`
13
+ }
14
+ if (color.startsWith('--dell-')) {
15
+ const colorMatch = color.match(/--dell-(\w+)-(\d+)/)
16
+ if (colorMatch) {
17
+ try {
18
+ const colorName = colorMatch[1]
19
+ const colorValue = parseInt(colorMatch[2])
20
+ const nextColorValue = colorValue + 100
21
+ const colorToReplace = `--dell-${colorName}-${nextColorValue}`
22
+ if (colorToReplace in allColorNames) {
23
+ return allColorNames[
24
+ colorToReplace as keyof typeof allColorNames
25
+ ]
26
+ }
27
+ } catch (error) {
28
+ // skip error
29
+ }
30
+ }
31
+ }
12
32
  let newColor =
13
33
  color in allColorNames
14
34
  ? allColorNames[color as keyof typeof allColorNames]
15
35
  : color
16
36
  newColor = newColor.replace(`#`, ``).trim()
17
-
18
37
  if (newColor.length === 6) {
19
38
  const decimalColor = parseInt(newColor, 16)
20
39