@sanity/color-input 3.1.0 → 3.1.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/LICENSE +1 -1
- package/lib/index.d.ts +2 -3
- package/lib/index.esm.js +19 -9
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +19 -9
- package/lib/index.js.map +1 -1
- package/package.json +25 -25
package/lib/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
4
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
5
3
|
Object.defineProperty(exports, '__esModule', {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
@@ -1364,9 +1362,15 @@ function validateWCAG2Parms(parms) {
|
|
|
1364
1362
|
size: size
|
|
1365
1363
|
};
|
|
1366
1364
|
}
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1365
|
+
var __freeze$1 = Object.freeze;
|
|
1366
|
+
var __defProp$1 = Object.defineProperty;
|
|
1367
|
+
var __template$1 = (cooked, raw) => __freeze$1(__defProp$1(cooked, "raw", {
|
|
1368
|
+
value: __freeze$1(raw || cooked.slice())
|
|
1369
|
+
}));
|
|
1370
|
+
var _a$1, _b$1, _c;
|
|
1371
|
+
const ColorListWrap = styled__default.default(ui.Flex)(_a$1 || (_a$1 = __template$1(["\n gap: 0.25em;\n"])));
|
|
1372
|
+
const ColorBoxContainer = styled__default.default.div(_b$1 || (_b$1 = __template$1(["\n width: 2.1em;\n height: 2.1em;\n cursor: pointer;\n position: relative;\n overflow: hidden;\n border-radius: 3px;\n background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAADFJREFUOE9jZGBgEGHAD97gk2YcNYBhmIQBgWSAP52AwoAQwJvQRg1gACckQoC2gQgAIF8IscwEtKYAAAAASUVORK5CYII=') left center #fff;\n"])));
|
|
1373
|
+
const ColorBox$1 = styled__default.default.div(_c || (_c = __template$1(["\n content: '';\n position: absolute;\n inset: 0;\n z-index: 1;\n"])));
|
|
1370
1374
|
const validateColors = colors => colors.reduce((cls, c) => {
|
|
1371
1375
|
const color = c.hex ? tinycolor(c.hex) : tinycolor(c);
|
|
1372
1376
|
if (color.isValid()) {
|
|
@@ -1403,10 +1407,16 @@ const ColorList = _ref2 => {
|
|
|
1403
1407
|
})
|
|
1404
1408
|
});
|
|
1405
1409
|
};
|
|
1406
|
-
|
|
1407
|
-
|
|
1410
|
+
var __freeze = Object.freeze;
|
|
1411
|
+
var __defProp = Object.defineProperty;
|
|
1412
|
+
var __template = (cooked, raw) => __freeze(__defProp(cooked, "raw", {
|
|
1413
|
+
value: __freeze(raw || cooked.slice())
|
|
1414
|
+
}));
|
|
1415
|
+
var _a, _b;
|
|
1416
|
+
const ColorBox = styled__default.default(ui.Box)(_a || (_a = __template(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n"])));
|
|
1417
|
+
const ReadOnlyContainer = styled__default.default(ui.Flex)(_b || (_b = __template(["\n margin-top: 6rem;\n background-color: var(--card-bg-color);\n position: relative;\n width: 100%;\n"])));
|
|
1408
1418
|
const ColorPickerInner = props => {
|
|
1409
|
-
var
|
|
1419
|
+
var _a2, _b2, _c;
|
|
1410
1420
|
const {
|
|
1411
1421
|
width,
|
|
1412
1422
|
color: {
|
|
@@ -1510,7 +1520,7 @@ const ColorPickerInner = props => {
|
|
|
1510
1520
|
size: 1,
|
|
1511
1521
|
children: [/* @__PURE__ */jsxRuntime.jsx("strong", {
|
|
1512
1522
|
children: "HSL: "
|
|
1513
|
-
}), " ", Math.round((
|
|
1523
|
+
}), " ", Math.round((_a2 = hsl == null ? void 0 : hsl.h) != null ? _a2 : 0), " ", Math.round((_b2 = hsl == null ? void 0 : hsl.s) != null ? _b2 : 0), "%", " ", Math.round((_c = hsl == null ? void 0 : hsl.l) != null ? _c : 0)]
|
|
1514
1524
|
})]
|
|
1515
1525
|
})]
|
|
1516
1526
|
})
|