@photoroom/ui 0.1.758 → 0.1.760
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/components/editor/ColorPicker/ColorPicker.d.ts +3 -1
- package/components/editor/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/components/editor/ColorPicker/InlineColorPicker/InlineColorPicker.d.ts +3 -1
- package/components/editor/ColorPicker/InlineColorPicker/InlineColorPicker.d.ts.map +1 -1
- package/index.mjs +30 -28
- package/package.json +1 -1
|
@@ -8,9 +8,11 @@ export type ColorPickerProps = Readonly<{
|
|
|
8
8
|
/** Extra classes for the popover content -- e.g. raising z-index above a floating parent. */
|
|
9
9
|
popoverClassName?: string;
|
|
10
10
|
onChange: (newColor: string) => void;
|
|
11
|
+
/** Fires when a drag or arrow-key change on the color area or hue slider ends. */
|
|
12
|
+
onChangeEnd?: () => void;
|
|
11
13
|
onConfirm?: (newColor?: string) => void;
|
|
12
14
|
onOpenChange?: (open: boolean) => void;
|
|
13
15
|
selected?: boolean;
|
|
14
16
|
} & Pick<PopoverProps, "side" | "align" | "sideOffset" | "alignOffset" | "collisionPadding">>;
|
|
15
|
-
export declare const ColorPicker: ({ label, buttonLabel, className, popoverClassName, color, side, align, sideOffset, alignOffset, collisionPadding, onChange, onConfirm, onOpenChange, selected, }: ColorPickerProps) => import("react").JSX.Element;
|
|
17
|
+
export declare const ColorPicker: ({ label, buttonLabel, className, popoverClassName, color, side, align, sideOffset, alignOffset, collisionPadding, onChange, onChangeEnd, onConfirm, onOpenChange, selected, }: ColorPickerProps) => import("react").JSX.Element;
|
|
16
18
|
//# sourceMappingURL=ColorPicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../../../src/components/editor/ColorPicker/ColorPicker.tsx"],"names":[],"mappings":"AACA,OAAO,EAAW,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAKlE,YAAY,EAAE,e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AAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,aAAa,GAAG,kBAAkB,CAAC,CAC7F,CAAC;AAEF,eAAO,MAAM,WAAW,kLAgBrB,gBAAgB,gCA4BlB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export type InlineColorPickerProps = Readonly<{
|
|
2
2
|
color: string;
|
|
3
3
|
onChange: (newColor: string) => void;
|
|
4
|
+
/** Fires when a drag or arrow-key change on the color area or hue slider ends. */
|
|
5
|
+
onChangeEnd?: () => void;
|
|
4
6
|
onConfirm?: (newColor?: string) => void;
|
|
5
7
|
initialMode?: "hex" | "rgb" | "hsl";
|
|
6
8
|
inputLabel?: string;
|
|
@@ -8,5 +10,5 @@ export type InlineColorPickerProps = Readonly<{
|
|
|
8
10
|
buttonLabel?: string;
|
|
9
11
|
className?: string;
|
|
10
12
|
}>;
|
|
11
|
-
export declare const InlineColorPicker: ({ color, onChange, onConfirm, initialMode, inputLabel, selectLabel, buttonLabel, className, }: InlineColorPickerProps) => import("react").JSX.Element;
|
|
13
|
+
export declare const InlineColorPicker: ({ color, onChange, onChangeEnd, onConfirm, initialMode, inputLabel, selectLabel, buttonLabel, className, }: InlineColorPickerProps) => import("react").JSX.Element;
|
|
12
14
|
//# sourceMappingURL=InlineColorPicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineColorPicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/editor/ColorPicker/InlineColorPicker/InlineColorPicker.tsx"],"names":[],"mappings":"AAuBA,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"InlineColorPicker.d.ts","sourceRoot":"","sources":["../../../../../src/components/editor/ColorPicker/InlineColorPicker/InlineColorPicker.tsx"],"names":[],"mappings":"AAuBA,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACrC,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,SAAS,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,eAAO,MAAM,iBAAiB,+GAU3B,sBAAsB,gCAuExB,CAAC"}
|
package/index.mjs
CHANGED
|
@@ -39137,58 +39137,59 @@ var Qme = ({ color: e, onChange: t, label: n }) => {
|
|
|
39137
39137
|
label: "HSL",
|
|
39138
39138
|
value: "hsl"
|
|
39139
39139
|
}
|
|
39140
|
-
], hX = ({ color: e, onChange: t,
|
|
39141
|
-
let [
|
|
39140
|
+
], hX = ({ color: e, onChange: t, onChangeEnd: n, onConfirm: r, initialMode: i = "hex", inputLabel: a, selectLabel: o, buttonLabel: s, className: c }) => {
|
|
39141
|
+
let [l, u] = Pe(i), d = B((e) => {
|
|
39142
39142
|
t(WY(e).toHex());
|
|
39143
|
-
}, [t]),
|
|
39143
|
+
}, [t]), f = Ne(() => WY(e).toHex(), [e]);
|
|
39144
39144
|
return /* @__PURE__ */ L("div", {
|
|
39145
|
-
className: U("misc-color-picker", "flex flex-col gap-3",
|
|
39145
|
+
className: U("misc-color-picker", "flex flex-col gap-3", c),
|
|
39146
39146
|
children: [
|
|
39147
39147
|
/* @__PURE__ */ I(zme, {
|
|
39148
|
-
color:
|
|
39149
|
-
onChange: (e) => t(e)
|
|
39148
|
+
color: f,
|
|
39149
|
+
onChange: (e) => t(e),
|
|
39150
|
+
onChangeEnd: n
|
|
39150
39151
|
}),
|
|
39151
39152
|
/* @__PURE__ */ L("div", {
|
|
39152
39153
|
className: "flex items-center gap-2",
|
|
39153
39154
|
children: [
|
|
39154
39155
|
/* @__PURE__ */ I(cX, {
|
|
39155
|
-
"aria-label":
|
|
39156
|
-
value:
|
|
39157
|
-
onChange: (e) =>
|
|
39156
|
+
"aria-label": o,
|
|
39157
|
+
value: l,
|
|
39158
|
+
onChange: (e) => u(e.target.value),
|
|
39158
39159
|
children: ehe.map((e) => /* @__PURE__ */ I("option", {
|
|
39159
39160
|
value: e.value,
|
|
39160
39161
|
children: e.label
|
|
39161
39162
|
}, e.value))
|
|
39162
39163
|
}),
|
|
39163
|
-
|
|
39164
|
-
label:
|
|
39165
|
-
color:
|
|
39166
|
-
onChange: (e) =>
|
|
39164
|
+
l === "hex" && /* @__PURE__ */ I(Wme, {
|
|
39165
|
+
label: a,
|
|
39166
|
+
color: f,
|
|
39167
|
+
onChange: (e) => d(e)
|
|
39167
39168
|
}),
|
|
39168
|
-
|
|
39169
|
-
label:
|
|
39170
|
-
color:
|
|
39171
|
-
onChange: (e) =>
|
|
39169
|
+
l === "rgb" && /* @__PURE__ */ I($me, {
|
|
39170
|
+
label: a,
|
|
39171
|
+
color: f,
|
|
39172
|
+
onChange: (e) => d(e)
|
|
39172
39173
|
}),
|
|
39173
|
-
|
|
39174
|
-
label:
|
|
39175
|
-
color:
|
|
39176
|
-
onChange: (e) =>
|
|
39174
|
+
l === "hsl" && /* @__PURE__ */ I(Qme, {
|
|
39175
|
+
label: a,
|
|
39176
|
+
color: f,
|
|
39177
|
+
onChange: (e) => d(e)
|
|
39177
39178
|
})
|
|
39178
39179
|
]
|
|
39179
39180
|
}),
|
|
39180
|
-
|
|
39181
|
+
r && /* @__PURE__ */ I(rd, {
|
|
39181
39182
|
variant: "secondary-accent",
|
|
39182
39183
|
className: "w-full",
|
|
39183
39184
|
density: "regular",
|
|
39184
|
-
onClick: () =>
|
|
39185
|
-
children:
|
|
39185
|
+
onClick: () => r(),
|
|
39186
|
+
children: s
|
|
39186
39187
|
})
|
|
39187
39188
|
]
|
|
39188
39189
|
});
|
|
39189
|
-
}, the = ({ label: e, buttonLabel: t, className: n, popoverClassName: r, color: i = "#FFFFFF", side: a = "bottom", align: o = "start", sideOffset: s, alignOffset: c, collisionPadding: l, onChange: u,
|
|
39190
|
+
}, the = ({ label: e, buttonLabel: t, className: n, popoverClassName: r, color: i = "#FFFFFF", side: a = "bottom", align: o = "start", sideOffset: s, alignOffset: c, collisionPadding: l, onChange: u, onChangeEnd: d, onConfirm: f, onOpenChange: p, selected: m }) => /* @__PURE__ */ I(cW, {
|
|
39190
39191
|
withBorder: !1,
|
|
39191
|
-
onOpenChange:
|
|
39192
|
+
onOpenChange: p,
|
|
39192
39193
|
side: a,
|
|
39193
39194
|
align: o,
|
|
39194
39195
|
sideOffset: s,
|
|
@@ -39199,7 +39200,7 @@ var Qme = ({ color: e, onChange: t, label: n }) => {
|
|
|
39199
39200
|
"aria-label": e,
|
|
39200
39201
|
color: i,
|
|
39201
39202
|
className: n,
|
|
39202
|
-
selected:
|
|
39203
|
+
selected: m
|
|
39203
39204
|
}),
|
|
39204
39205
|
children: /* @__PURE__ */ I("div", {
|
|
39205
39206
|
className: "p-4",
|
|
@@ -39208,7 +39209,8 @@ var Qme = ({ color: e, onChange: t, label: n }) => {
|
|
|
39208
39209
|
buttonLabel: t,
|
|
39209
39210
|
color: i,
|
|
39210
39211
|
onChange: u,
|
|
39211
|
-
|
|
39212
|
+
onChangeEnd: d,
|
|
39213
|
+
onConfirm: f,
|
|
39212
39214
|
className: "w-[328px]"
|
|
39213
39215
|
})
|
|
39214
39216
|
})
|