@spark-ui/cli-utils 2.2.7 → 2.3.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [2.3.0](https://github.com/adevinta/spark/compare/@spark-ui/cli-utils@2.2.7...@spark-ui/cli-utils@2.3.0) (2023-03-02)
7
+
8
+ ### Features
9
+
10
+ - **cli-utils:** update toTailwindConfig mapper to handle edge cases ([2af919a](https://github.com/adevinta/spark/commit/2af919a3dd7bbab02d00cd9892c1e9a7971aec38))
11
+
6
12
  ## [2.2.7](https://github.com/adevinta/spark/compare/@spark-ui/cli-utils@2.2.6...@spark-ui/cli-utils@2.2.7) (2023-03-02)
7
13
 
8
14
  **Note:** Version bump only for package @spark-ui/cli-utils
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spark-ui/cli-utils",
3
- "version": "2.2.7",
3
+ "version": "2.3.0",
4
4
  "description": "Spark CLI utils",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -29,5 +29,5 @@
29
29
  "url": "git@github.com:adevinta/spark.git",
30
30
  "directory": "packages/utils/cli"
31
31
  },
32
- "gitHead": "84648617bfcf9bd9feac25d86c2d9a68a2a9cc72"
32
+ "gitHead": "3507d96e9064fe42e519ea143866c683d954074d"
33
33
  }
@@ -3,3 +3,11 @@ export const tailwindKeys = {
3
3
  fontSize: 'fontSize',
4
4
  screens: 'screens',
5
5
  }
6
+
7
+ export const DEFAULT_KEY = 'DEFAULT'
8
+
9
+ export const defaultColors = {
10
+ inherit: 'inherit',
11
+ current: 'currentColor',
12
+ transparent: 'transparent',
13
+ }
@@ -3,7 +3,7 @@ import { join } from 'node:path'
3
3
 
4
4
  import { defaultTheme } from '@spark-ui/theme-utils'
5
5
 
6
- import { tailwindKeys } from './constants.js'
6
+ import { DEFAULT_KEY, defaultColors, tailwindKeys } from './constants.js'
7
7
  import {
8
8
  doubleHyphensRegex,
9
9
  hasNumber,
@@ -60,6 +60,10 @@ function toTailwindConfig(_theme) {
60
60
 
61
61
  if (isObject(value)) {
62
62
  Object.keys(value).forEach(k => {
63
+ if (k === DEFAULT_KEY) {
64
+ return
65
+ }
66
+
63
67
  if (!isObject(value[k]) && !isCamelCase(k)) {
64
68
  return
65
69
  }
@@ -85,7 +89,7 @@ function toTailwindConfig(_theme) {
85
89
  return String(value).toLowerCase()
86
90
  }
87
91
 
88
- return `var(--${paths.join('-')}-${key})`
92
+ return `var(--${paths.join('-')}-${key.toLowerCase()})`
89
93
  })()
90
94
 
91
95
  theme[key] = isScreenValue
@@ -97,7 +101,7 @@ function toTailwindConfig(_theme) {
97
101
 
98
102
  traverse(themeCpy)
99
103
 
100
- return themeCpy
104
+ return { ...themeCpy, colors: { ...themeCpy.colors, ...defaultColors } }
101
105
  }
102
106
 
103
107
  /**