@kbach/react 0.2.9 → 0.3.1
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/dist/index.d.mts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +4 -2
package/dist/index.d.mts
CHANGED
|
@@ -148,13 +148,14 @@ interface ColorScale {
|
|
|
148
148
|
readonly [key: string]: string;
|
|
149
149
|
}
|
|
150
150
|
interface ColorsAPI {
|
|
151
|
-
/**
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
*
|
|
156
|
-
|
|
157
|
-
alpha(color: string, opacity
|
|
151
|
+
/**
|
|
152
|
+
* Pass any CSS color through, optionally applying an opacity (0–100).
|
|
153
|
+
* - `colors.alpha('#3b82f6', 50)` → `'rgba(59,130,246,0.5)'`
|
|
154
|
+
* - `colors.alpha('rgb(0,0,0)', 10)` → `'rgba(0,0,0,0.1)'`
|
|
155
|
+
* - `colors.alpha('rgba(0,0,0,0.5)')` → `'rgba(0,0,0,0.5)'` (passthrough)
|
|
156
|
+
*/
|
|
157
|
+
readonly alpha: (color: string, opacity?: number) => string;
|
|
158
|
+
[color: string]: any;
|
|
158
159
|
}
|
|
159
160
|
declare function wrapColors(rawColors: ThemeColors): ColorsAPI;
|
|
160
161
|
declare function useColors(): ColorsAPI;
|
package/dist/index.d.ts
CHANGED
|
@@ -148,13 +148,14 @@ interface ColorScale {
|
|
|
148
148
|
readonly [key: string]: string;
|
|
149
149
|
}
|
|
150
150
|
interface ColorsAPI {
|
|
151
|
-
/**
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
*
|
|
156
|
-
|
|
157
|
-
alpha(color: string, opacity
|
|
151
|
+
/**
|
|
152
|
+
* Pass any CSS color through, optionally applying an opacity (0–100).
|
|
153
|
+
* - `colors.alpha('#3b82f6', 50)` → `'rgba(59,130,246,0.5)'`
|
|
154
|
+
* - `colors.alpha('rgb(0,0,0)', 10)` → `'rgba(0,0,0,0.1)'`
|
|
155
|
+
* - `colors.alpha('rgba(0,0,0,0.5)')` → `'rgba(0,0,0,0.5)'` (passthrough)
|
|
156
|
+
*/
|
|
157
|
+
readonly alpha: (color: string, opacity?: number) => string;
|
|
158
|
+
[color: string]: any;
|
|
158
159
|
}
|
|
159
160
|
declare function wrapColors(rawColors: ThemeColors): ColorsAPI;
|
|
160
161
|
declare function useColors(): ColorsAPI;
|
package/dist/index.js
CHANGED
|
@@ -103,7 +103,7 @@ function makeShadeProxy(shades) {
|
|
|
103
103
|
}
|
|
104
104
|
function wrapColors(rawColors) {
|
|
105
105
|
const cache = /* @__PURE__ */ new Map();
|
|
106
|
-
const alpha = (color, opacity) => applyOpacity(color, opacity);
|
|
106
|
+
const alpha = (color, opacity) => opacity === void 0 ? color : applyOpacity(color, opacity);
|
|
107
107
|
return new Proxy({ alpha }, {
|
|
108
108
|
get(_, prop) {
|
|
109
109
|
const key = String(prop);
|
package/dist/index.mjs
CHANGED
|
@@ -64,7 +64,7 @@ function makeShadeProxy(shades) {
|
|
|
64
64
|
}
|
|
65
65
|
function wrapColors(rawColors) {
|
|
66
66
|
const cache = /* @__PURE__ */ new Map();
|
|
67
|
-
const alpha = (color, opacity) => applyOpacity(color, opacity);
|
|
67
|
+
const alpha = (color, opacity) => opacity === void 0 ? color : applyOpacity(color, opacity);
|
|
68
68
|
return new Proxy({ alpha }, {
|
|
69
69
|
get(_, prop) {
|
|
70
70
|
const key = String(prop);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kbach/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "React / React Native components and hooks for the Kbach framework",
|
|
5
5
|
"source": "./src/index.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -52,5 +52,7 @@
|
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
|
-
"files": [
|
|
55
|
+
"files": [
|
|
56
|
+
"dist"
|
|
57
|
+
]
|
|
56
58
|
}
|