@northlight/ui 2.28.6 → 2.28.8
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/es/northlight.d.ts +4 -3
- package/dist/es/northlight.js +22 -2
- package/dist/es/northlight.js.map +1 -1
- package/dist/umd/northlight.cjs +22 -2
- package/dist/umd/northlight.cjs.map +1 -1
- package/dist/umd/northlight.min.cjs +3 -3
- package/dist/umd/northlight.min.cjs.map +1 -1
- package/package.json +3 -3
package/dist/umd/northlight.cjs
CHANGED
|
@@ -2465,6 +2465,7 @@
|
|
|
2465
2465
|
var _b = _a, {
|
|
2466
2466
|
onChange = () => {
|
|
2467
2467
|
},
|
|
2468
|
+
clearable = false,
|
|
2468
2469
|
colors = defaultColors,
|
|
2469
2470
|
expandedColors = paletteColors,
|
|
2470
2471
|
value = null,
|
|
@@ -2473,6 +2474,7 @@
|
|
|
2473
2474
|
popoverProps
|
|
2474
2475
|
} = _b, rest = __objRest$1l(_b, [
|
|
2475
2476
|
"onChange",
|
|
2477
|
+
"clearable",
|
|
2476
2478
|
"colors",
|
|
2477
2479
|
"expandedColors",
|
|
2478
2480
|
"value",
|
|
@@ -2528,6 +2530,10 @@
|
|
|
2528
2530
|
setSelectedColor(color);
|
|
2529
2531
|
onChange(color);
|
|
2530
2532
|
};
|
|
2533
|
+
const clearSelection = () => {
|
|
2534
|
+
setSelectedColor(null);
|
|
2535
|
+
onChange(null);
|
|
2536
|
+
};
|
|
2531
2537
|
return /* @__PURE__ */ React.createElement(react.Box, { "data-testid": "color-picker-test-id" }, /* @__PURE__ */ React.createElement(
|
|
2532
2538
|
Popover$1,
|
|
2533
2539
|
__spreadValues$1O({
|
|
@@ -2550,9 +2556,23 @@
|
|
|
2550
2556
|
react.PopoverHeader,
|
|
2551
2557
|
{
|
|
2552
2558
|
color: "text.default",
|
|
2553
|
-
sx: heading
|
|
2559
|
+
sx: heading,
|
|
2560
|
+
display: "flex",
|
|
2561
|
+
alignItems: "center",
|
|
2562
|
+
justifyContent: "space-between",
|
|
2563
|
+
width: "full"
|
|
2554
2564
|
},
|
|
2555
|
-
"Pick a color"
|
|
2565
|
+
"Pick a color",
|
|
2566
|
+
clearable && trigger.color !== "unset" && /* @__PURE__ */ React.createElement(
|
|
2567
|
+
Button$1,
|
|
2568
|
+
{
|
|
2569
|
+
size: "sm",
|
|
2570
|
+
h: "5",
|
|
2571
|
+
onClick: clearSelection,
|
|
2572
|
+
variant: "ghost"
|
|
2573
|
+
},
|
|
2574
|
+
"Clear"
|
|
2575
|
+
)
|
|
2556
2576
|
), /* @__PURE__ */ React.createElement(react.PopoverBody, { p: 0 }, /* @__PURE__ */ React.createElement(react.Stack, { alignItems: "center", p: 0, spacing: 0 }, /* @__PURE__ */ React.createElement(focus.FocusScope, null, /* @__PURE__ */ React.createElement(
|
|
2557
2577
|
react.SimpleGrid,
|
|
2558
2578
|
{
|