@oliasoft-open-source/react-ui-library 6.10.0-beta-9 → 6.10.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/dist/index.js
CHANGED
|
@@ -1439,17 +1439,18 @@ var Rr = /* @__PURE__ */ function(e) {
|
|
|
1439
1439
|
children: o
|
|
1440
1440
|
});
|
|
1441
1441
|
}, Ea = {
|
|
1442
|
-
colorInput: "
|
|
1443
|
-
swatch: "
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1442
|
+
colorInput: "_colorInput_1ieww_1",
|
|
1443
|
+
swatch: "_swatch_1ieww_5",
|
|
1444
|
+
transparent: "_transparent_1ieww_12",
|
|
1445
|
+
small: "_small_1ieww_15",
|
|
1446
|
+
adjustColorsInDarkMode: "_adjustColorsInDarkMode_1ieww_18",
|
|
1447
|
+
swatchPicker: "_swatchPicker_1ieww_21",
|
|
1448
|
+
popoverContent: "_popoverContent_1ieww_26",
|
|
1449
|
+
areaPicker: "_areaPicker_1ieww_31",
|
|
1450
|
+
colorArea: "_colorArea_1ieww_36",
|
|
1451
|
+
colorThumb: "_colorThumb_1ieww_42",
|
|
1452
|
+
hueSliderTrack: "_hueSliderTrack_1ieww_51",
|
|
1453
|
+
hueSlider: "_hueSlider_1ieww_51"
|
|
1453
1454
|
}, Da = ({ disabled: e }) => /* @__PURE__ */ y("div", {
|
|
1454
1455
|
className: Ea.areaPicker,
|
|
1455
1456
|
children: [/* @__PURE__ */ v(bn, {
|
|
@@ -1532,27 +1533,27 @@ var Oa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), ka =
|
|
|
1532
1533
|
}, e.value);
|
|
1533
1534
|
})
|
|
1534
1535
|
}), Ra = 100, za = ({ adjustColorsInDarkMode: e = !1, children: t, columns: n, disabled: r, hideAreaPicker: i = !1, onChange: a, onConfirm: o, options: s = [], testId: l, value: u }) => {
|
|
1535
|
-
let { locale: f } = On(), [p, h] = m(!1), [_, b] = m(() => Ma(u)), x = ja(u), S = d(() => Qt((e) => a == null ? void 0 : a(e), Ra), [a]);
|
|
1536
|
-
c(() => () =>
|
|
1536
|
+
let { locale: f } = On(), [p, h] = m(!1), [_, b] = m(() => Ma(u)), x = ja(u), S = !Fa(Ma(u), _), C = d(() => Qt((e) => a == null ? void 0 : a(e), Ra), [a]);
|
|
1537
|
+
c(() => () => C.cancel(), [C]), c(() => {
|
|
1537
1538
|
if (p) return;
|
|
1538
1539
|
let e = Ma(u);
|
|
1539
1540
|
b((t) => Ia(e, t));
|
|
1540
1541
|
}, [u, p]);
|
|
1541
|
-
let
|
|
1542
|
+
let w = (e) => {
|
|
1542
1543
|
let t = e.toFormat("hsb");
|
|
1543
|
-
b(t), !o &&
|
|
1544
|
-
},
|
|
1545
|
-
|
|
1546
|
-
}, T = (e) => {
|
|
1547
|
-
e ? b((e) => Ia(Ma(u), e)) : o || w(), h(e);
|
|
1544
|
+
b(t), !o && C(Na(t));
|
|
1545
|
+
}, T = () => {
|
|
1546
|
+
C.cancel(), Fa(Ma(u), _) || a == null || a(Na(_));
|
|
1548
1547
|
}, E = (e) => {
|
|
1548
|
+
e ? b((e) => Ia(Ma(u), e)) : o || T(), h(e);
|
|
1549
|
+
}, D = (e) => {
|
|
1549
1550
|
let t = e.toFormat("hsb");
|
|
1550
|
-
|
|
1551
|
-
}, D = () => {
|
|
1552
|
-
w(), o == null || o(Na(_)), h(!1);
|
|
1551
|
+
C.cancel(), b(t), !o && (a == null || a(Na(t)), h(!1));
|
|
1553
1552
|
}, O = () => {
|
|
1553
|
+
T(), o == null || o(Na(_)), h(!1);
|
|
1554
|
+
}, k = () => {
|
|
1554
1555
|
h(!1);
|
|
1555
|
-
},
|
|
1556
|
+
}, A = d(() => {
|
|
1556
1557
|
var e;
|
|
1557
1558
|
let t = (e = s.find((e) => {
|
|
1558
1559
|
let t = ja(e.value);
|
|
@@ -1565,30 +1566,30 @@ var Oa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), ka =
|
|
|
1565
1566
|
s,
|
|
1566
1567
|
_,
|
|
1567
1568
|
f
|
|
1568
|
-
]),
|
|
1569
|
+
]), j = e ? Ea.adjustColorsInDarkMode : void 0, M = typeof t == "function" ? t({
|
|
1569
1570
|
isOpen: p,
|
|
1570
|
-
colorName:
|
|
1571
|
+
colorName: A,
|
|
1571
1572
|
valueColor: x
|
|
1572
1573
|
}) : t;
|
|
1573
1574
|
return /* @__PURE__ */ v("div", {
|
|
1574
|
-
className: g(Ea.colorInput,
|
|
1575
|
+
className: g(Ea.colorInput, j),
|
|
1575
1576
|
children: /* @__PURE__ */ v(xn, {
|
|
1576
1577
|
value: _,
|
|
1577
|
-
onChange:
|
|
1578
|
+
onChange: w,
|
|
1578
1579
|
children: /* @__PURE__ */ v(xa, {
|
|
1579
1580
|
placement: "bottom-start",
|
|
1580
1581
|
isOpen: p,
|
|
1581
|
-
onToggle:
|
|
1582
|
+
onToggle: E,
|
|
1582
1583
|
disabled: r,
|
|
1583
1584
|
testId: l,
|
|
1584
1585
|
content: /* @__PURE__ */ y("div", {
|
|
1585
|
-
className: g(Ea.popoverContent,
|
|
1586
|
+
className: g(Ea.popoverContent, j),
|
|
1586
1587
|
children: [
|
|
1587
1588
|
!i && /* @__PURE__ */ v(Da, { disabled: r }),
|
|
1588
1589
|
s.length > 0 && /* @__PURE__ */ v(La, {
|
|
1589
1590
|
columns: n,
|
|
1590
1591
|
options: s,
|
|
1591
|
-
onSwatchSelect:
|
|
1592
|
+
onSwatchSelect: D,
|
|
1592
1593
|
selectedValue: _
|
|
1593
1594
|
}),
|
|
1594
1595
|
o && /* @__PURE__ */ y(Ta, {
|
|
@@ -1597,20 +1598,21 @@ var Oa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), ka =
|
|
|
1597
1598
|
children: [/* @__PURE__ */ v(K, {
|
|
1598
1599
|
small: !0,
|
|
1599
1600
|
icon: "check",
|
|
1600
|
-
|
|
1601
|
+
disabled: !S,
|
|
1602
|
+
onClick: O,
|
|
1601
1603
|
testId: l ? `${l}-confirm` : void 0,
|
|
1602
1604
|
width: "100%"
|
|
1603
1605
|
}), /* @__PURE__ */ v(K, {
|
|
1604
1606
|
small: !0,
|
|
1605
1607
|
icon: "times",
|
|
1606
|
-
onClick:
|
|
1608
|
+
onClick: k,
|
|
1607
1609
|
testId: l ? `${l}-cancel` : void 0,
|
|
1608
1610
|
width: "100%"
|
|
1609
1611
|
})]
|
|
1610
1612
|
})
|
|
1611
1613
|
]
|
|
1612
1614
|
}),
|
|
1613
|
-
children:
|
|
1615
|
+
children: M
|
|
1614
1616
|
})
|
|
1615
1617
|
})
|
|
1616
1618
|
});
|
|
@@ -1630,10 +1632,13 @@ var Oa = (e) => e.replace(/^lch\(\s*(\d+(?:\.\d+)?)(?!%)\s+/, "lch($1% "), ka =
|
|
|
1630
1632
|
basic: !0,
|
|
1631
1633
|
small: s,
|
|
1632
1634
|
active: e,
|
|
1633
|
-
tooltip: t,
|
|
1634
|
-
icon: /* @__PURE__ */ v(Cn, {
|
|
1635
|
+
tooltip: r ? t : void 0,
|
|
1636
|
+
icon: r ? /* @__PURE__ */ v(Cn, {
|
|
1635
1637
|
className: g(Ea.swatch, s && Ea.small),
|
|
1636
1638
|
color: r
|
|
1639
|
+
}) : /* @__PURE__ */ v("span", {
|
|
1640
|
+
className: g(Ea.swatch, Ea.transparent, s && Ea.small),
|
|
1641
|
+
"aria-hidden": !0
|
|
1637
1642
|
})
|
|
1638
1643
|
})
|
|
1639
1644
|
}), Va = {
|
package/package.json
CHANGED