@photoroom/ui 0.1.136 → 0.1.138

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/index.mjs CHANGED
@@ -1786,17 +1786,18 @@ function xr({ icon: e, stacked: t, children: n }) {
1786
1786
  var Sr = W("focus-visible:misc-border-size-focus-ring relative inline-flex w-fit max-w-full appearance-none items-center justify-center truncate overflow-hidden text-center outline-hidden transition-all duration-200 disabled:pointer-events-none disabled:cursor-not-allowed", {
1787
1787
  variants: {
1788
1788
  variant: {
1789
- accent: "bg-content-accent hover:bg-accent-400 focus-visible:bg-accent-400 focus-visible:ring-accent-alpha-5 active:bg-accent-600 text-white",
1790
- "secondary-accent": "bg-accent-alpha-1 text-content-accent hover:bg-accent-alpha-2 focus-visible:bg-accent-alpha-3 focus-visible:ring-accent-alpha-5 active:bg-accent-alpha-3",
1791
- "borderless-accent": "text-content-accent hover:bg-accent-alpha-2 focus-visible:bg-accent-alpha-3 focus-visible:ring-accent-alpha-5 active:bg-accent-alpha-3 bg-transparent",
1792
- primary: "bg-background-default text-content-white-primary-inverted hover:bg-background-hover focus-visible:bg-background-hover focus-visible:ring-accent-alpha-5 active:bg-background-down",
1793
- secondary: "bg-background-subdued text-content-primary hover:bg-background-subdued-hover focus-visible:bg-background-subdued-hover focus-visible:ring-accent-alpha-5 active:bg-background-subdued-down",
1794
- borderless: "text-content-primary hover:bg-background-subdued-hover focus-visible:bg-background-subdued-hover focus-visible:ring-accent-alpha-5 active:bg-background-subdued-down",
1795
- negative: "bg-negative-alpha-1 text-content-negative hover:bg-negative-alpha-2 focus-visible:bg-negative-alpha-2 focus-visible:ring-accent-alpha-5 active:bg-negative-alpha-3",
1796
- pro: "bg-content-accent! bg-background-pro hover:bg-background-pro-hover focus-visible:ring-accent-alpha-5 focus-visible:bg-background-pro-hover active:bg-background-pro-down text-white",
1789
+ accent: "bg-content-accent hover:bg-accent-400 focus-visible:bg-accent-400 focus-visible:ring-misc-focus-indicator active:bg-accent-600 text-white",
1790
+ "secondary-accent": "bg-accent-alpha-1 text-content-accent hover:bg-accent-alpha-2 focus-visible:bg-accent-alpha-3 focus-visible:ring-misc-focus-indicator active:bg-accent-alpha-3",
1791
+ "borderless-accent": "text-content-accent hover:bg-accent-alpha-2 focus-visible:bg-accent-alpha-3 focus-visible:ring-misc-focus-indicator active:bg-accent-alpha-3 bg-transparent",
1792
+ primary: "bg-background-default text-content-white-primary-inverted hover:bg-background-hover focus-visible:bg-background-hover focus-visible:ring-misc-focus-indicator active:bg-background-down",
1793
+ secondary: "bg-background-subdued text-content-primary hover:bg-background-subdued-hover focus-visible:bg-background-subdued-hover focus-visible:ring-misc-focus-indicator active:bg-background-subdued-down",
1794
+ borderless: "text-content-primary hover:bg-background-subdued-hover focus-visible:bg-background-subdued-hover focus-visible:ring-misc-focus-indicator active:bg-background-subdued-down",
1795
+ "secondary-outline": "border-misc-border misc-border-size-default text-content-primary hover:bg-background-subdued-hover focus-visible:bg-background-subdued-hover focus-visible:ring-misc-focus-indicator active:bg-background-subdued-down bg-transparent",
1796
+ negative: "bg-negative-alpha-1 text-content-negative hover:bg-negative-alpha-2 focus-visible:bg-negative-alpha-2 focus-visible:ring-misc-focus-indicator active:bg-negative-alpha-3",
1797
+ pro: "bg-content-accent! bg-background-pro hover:bg-background-pro-hover focus-visible:ring-misc-focus-indicator focus-visible:bg-background-pro-hover active:bg-background-pro-down text-white",
1797
1798
  "on-dark": "bg-background-white hover:bg-background-white-hover focus-visible:bg-background-white-hover focus-visible:ring-misc-white-focus-indicator active:bg-background-white text-black",
1798
1799
  "secondary-on-dark": "bg-background-white-subdued text-content-white-primary hover:bg-background-white-subdued-hover focus-visible:bg-background-white-subdued-hover focus-visible:ring-misc-white-focus-indicator active:bg-background-white-subdued-down",
1799
- "borderless-on-dark": "hover:bg-background-white-subdued-hover focus-visible:bg-background-white-subdued-hover active:bg-background-white-subdued-down text-white focus-visible:ring-white"
1800
+ "borderless-on-dark": "hover:bg-background-white-subdued-hover focus-visible:bg-background-white-subdued-hover active:bg-background-white-subdued-down focus-visible:ring-misc-white-focus-indicator text-white"
1800
1801
  },
1801
1802
  density: {
1802
1803
  compact: "rounded-400",
@@ -35067,7 +35068,7 @@ var Nq = {
35067
35068
  return e instanceof iJ ? e : new iJ(e);
35068
35069
  };
35069
35070
  //#endregion
35070
- //#region ../../node_modules/.pnpm/react-colorful@5.6.1_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-colorful/dist/index.mjs
35071
+ //#region ../../node_modules/.pnpm/react-colorful@5.7.0_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/react-colorful/dist/index.mjs
35071
35072
  function oJ() {
35072
35073
  return (oJ = Object.assign || function(e) {
35073
35074
  for (var t = 1; t < arguments.length; t++) {
@@ -35107,48 +35108,61 @@ var lJ = function(e, t, n) {
35107
35108
  }, pJ = function(e) {
35108
35109
  !uJ(e) && e.preventDefault();
35109
35110
  }, mJ = t.memo(function(e) {
35110
- var n = e.onMove, r = e.onKey, i = sJ(e, ["onMove", "onKey"]), a = S(null), o = cJ(n), s = cJ(r), c = S(null), l = S(!1), u = b(function() {
35111
+ var n = e.onMove, r = e.onKey, i = e.onEnd, a = sJ(e, [
35112
+ "onMove",
35113
+ "onKey",
35114
+ "onEnd"
35115
+ ]), o = S(null), s = cJ(n), c = cJ(r), l = cJ(i), u = S(null), d = S(!1), f = b(function() {
35111
35116
  var e = function(e) {
35112
- pJ(e), (uJ(e) ? e.touches.length > 0 : e.buttons > 0) && a.current ? o(fJ(a.current, e, c.current)) : n(!1);
35117
+ pJ(e), (uJ(e) ? e.touches.length > 0 : e.buttons > 0) && o.current ? s(fJ(o.current, e, u.current)) : (n(!1), l());
35113
35118
  }, t = function() {
35114
- return n(!1);
35119
+ n(!1), l();
35115
35120
  };
35116
35121
  function n(n) {
35117
- var r = l.current, i = dJ(a.current), o = n ? i.addEventListener : i.removeEventListener;
35118
- o(r ? "touchmove" : "mousemove", e), o(r ? "touchend" : "mouseup", t);
35122
+ var r = d.current, i = dJ(o.current), a = n ? i.addEventListener : i.removeEventListener;
35123
+ a(r ? "touchmove" : "mousemove", e), a(r ? "touchend" : "mouseup", t);
35119
35124
  }
35120
35125
  return [
35121
35126
  function(e) {
35122
- var t = e.nativeEvent, r = a.current;
35127
+ var t = e.nativeEvent, r = o.current;
35123
35128
  if (r && (pJ(t), !function(e, t) {
35124
35129
  return t && !uJ(e);
35125
- }(t, l.current) && r)) {
35130
+ }(t, d.current) && r)) {
35126
35131
  if (uJ(t)) {
35127
- l.current = !0;
35132
+ d.current = !0;
35128
35133
  var i = t.changedTouches || [];
35129
- i.length && (c.current = i[0].identifier);
35134
+ i.length && (u.current = i[0].identifier);
35130
35135
  }
35131
- r.focus(), o(fJ(r, t, c.current)), n(!0);
35136
+ r.focus(), s(fJ(r, t, u.current)), n(!0);
35132
35137
  }
35133
35138
  },
35134
35139
  function(e) {
35135
35140
  var t = e.which || e.keyCode;
35136
- t < 37 || t > 40 || (e.preventDefault(), s({
35141
+ t < 37 || t > 40 || (e.preventDefault(), c({
35137
35142
  left: t === 39 ? .05 : t === 37 ? -.05 : 0,
35138
35143
  top: t === 40 ? .05 : t === 38 ? -.05 : 0
35139
35144
  }));
35140
35145
  },
35146
+ function(e) {
35147
+ var t = e.which || e.keyCode;
35148
+ t >= 37 && t <= 40 && l();
35149
+ },
35141
35150
  n
35142
35151
  ];
35143
- }, [s, o]), d = u[0], f = u[1], p = u[2];
35152
+ }, [
35153
+ c,
35154
+ s,
35155
+ l
35156
+ ]), p = f[0], m = f[1], g = f[2], _ = f[3];
35144
35157
  return h(function() {
35145
- return p;
35146
- }, [p]), t.createElement("div", oJ({}, i, {
35147
- onTouchStart: d,
35148
- onMouseDown: d,
35158
+ return _;
35159
+ }, [_]), t.createElement("div", oJ({}, a, {
35160
+ onTouchStart: p,
35161
+ onMouseDown: p,
35149
35162
  className: "react-colorful__interactive",
35150
- ref: a,
35151
- onKeyDown: f,
35163
+ ref: o,
35164
+ onKeyDown: m,
35165
+ onKeyUp: g,
35152
35166
  tabIndex: 0,
35153
35167
  role: "slider"
35154
35168
  }));
@@ -35243,14 +35257,15 @@ var vJ = function(e) {
35243
35257
  a: i
35244
35258
  };
35245
35259
  }, DJ = t.memo(function(e) {
35246
- var n = e.hue, r = e.onChange, i = hJ(["react-colorful__hue", e.className]);
35247
- return t.createElement("div", { className: i }, t.createElement(mJ, {
35260
+ var n = e.hue, r = e.onChange, i = e.onChangeEnd, a = hJ(["react-colorful__hue", e.className]);
35261
+ return t.createElement("div", { className: a }, t.createElement(mJ, {
35248
35262
  onMove: function(e) {
35249
35263
  r({ h: 360 * e.left });
35250
35264
  },
35251
35265
  onKey: function(e) {
35252
35266
  r({ h: lJ(n + 360 * e.left, 0, 360) });
35253
35267
  },
35268
+ onEnd: i,
35254
35269
  "aria-label": "Hue",
35255
35270
  "aria-valuenow": _J(n),
35256
35271
  "aria-valuemax": "360",
@@ -35266,7 +35281,7 @@ var vJ = function(e) {
35266
35281
  })
35267
35282
  })));
35268
35283
  }), OJ = t.memo(function(e) {
35269
- var n = e.hsva, r = e.onChange, i = { backgroundColor: SJ({
35284
+ var n = e.hsva, r = e.onChange, i = e.onChangeEnd, a = { backgroundColor: SJ({
35270
35285
  h: n.h,
35271
35286
  s: 100,
35272
35287
  v: 100,
@@ -35274,7 +35289,7 @@ var vJ = function(e) {
35274
35289
  }) };
35275
35290
  return t.createElement("div", {
35276
35291
  className: "react-colorful__saturation",
35277
- style: i
35292
+ style: a
35278
35293
  }, t.createElement(mJ, {
35279
35294
  onMove: function(e) {
35280
35295
  r({
@@ -35288,6 +35303,7 @@ var vJ = function(e) {
35288
35303
  v: lJ(n.v - 100 * e.top, 0, 100)
35289
35304
  });
35290
35305
  },
35306
+ onEnd: i,
35291
35307
  "aria-label": "Color",
35292
35308
  "aria-valuetext": "Saturation " + _J(n.s) + "%, Brightness " + _J(n.v) + "%"
35293
35309
  }, t.createElement(gJ, {
@@ -35303,36 +35319,42 @@ var vJ = function(e) {
35303
35319
  }, AJ = function(e, t) {
35304
35320
  return e.toLowerCase() === t.toLowerCase() || kJ(yJ(e), yJ(t));
35305
35321
  };
35306
- function jJ(e, t, n) {
35307
- var r = cJ(n), i = C(function() {
35322
+ function jJ(e, t, n, r) {
35323
+ var i = cJ(n), a = cJ(r), o = C(function() {
35308
35324
  return e.toHsva(t);
35309
- }), a = i[0], o = i[1], s = S({
35325
+ }), s = o[0], c = o[1], l = S({
35310
35326
  color: t,
35311
- hsva: a
35312
- });
35327
+ hsva: s
35328
+ }), u = S(!1);
35313
35329
  return h(function() {
35314
- if (!e.equal(t, s.current.color)) {
35330
+ if (!e.equal(t, l.current.color)) {
35315
35331
  var n = e.toHsva(t);
35316
- s.current = {
35332
+ l.current = {
35317
35333
  hsva: n,
35318
35334
  color: t
35319
- }, o(n);
35335
+ }, c(n), u.current = !1;
35320
35336
  }
35321
35337
  }, [t, e]), h(function() {
35322
35338
  var t;
35323
- kJ(a, s.current.hsva) || e.equal(t = e.fromHsva(a), s.current.color) || (s.current = {
35324
- hsva: a,
35339
+ kJ(s, l.current.hsva) || e.equal(t = e.fromHsva(s), l.current.color) || (l.current = {
35340
+ hsva: s,
35325
35341
  color: t
35326
- }, r(t));
35342
+ }, i(t), u.current = !0);
35327
35343
  }, [
35328
- a,
35344
+ s,
35329
35345
  e,
35330
- r
35331
- ]), [a, p(function(e) {
35332
- o(function(t) {
35333
- return Object.assign({}, t, e);
35334
- });
35335
- }, [])];
35346
+ i
35347
+ ]), [
35348
+ s,
35349
+ p(function(e) {
35350
+ c(function(t) {
35351
+ return Object.assign({}, t, e);
35352
+ });
35353
+ }, []),
35354
+ p(function() {
35355
+ u.current && (u.current = !1, a(l.current.color));
35356
+ }, [a])
35357
+ ];
35336
35358
  }
35337
35359
  var MJ, NJ = typeof window < "u" ? y : h, PJ = function() {
35338
35360
  return MJ || (typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : void 0);
@@ -35347,23 +35369,26 @@ var MJ, NJ = typeof window < "u" ? y : h, PJ = function() {
35347
35369
  }
35348
35370
  }, []);
35349
35371
  }, LJ = function(e) {
35350
- var n = e.className, r = e.colorModel, i = e.color, a = i === void 0 ? r.defaultColor : i, o = e.onChange, s = sJ(e, [
35372
+ var n = e.className, r = e.colorModel, i = e.color, a = i === void 0 ? r.defaultColor : i, o = e.onChange, s = e.onChangeEnd, c = sJ(e, [
35351
35373
  "className",
35352
35374
  "colorModel",
35353
35375
  "color",
35354
- "onChange"
35355
- ]), c = S(null);
35356
- IJ(c);
35357
- var l = jJ(r, a, o), u = l[0], d = l[1], f = hJ(["react-colorful", n]);
35358
- return t.createElement("div", oJ({}, s, {
35359
- ref: c,
35360
- className: f
35376
+ "onChange",
35377
+ "onChangeEnd"
35378
+ ]), l = S(null);
35379
+ IJ(l);
35380
+ var u = jJ(r, a, o, s), d = u[0], f = u[1], p = u[2], m = hJ(["react-colorful", n]);
35381
+ return t.createElement("div", oJ({}, c, {
35382
+ ref: l,
35383
+ className: m
35361
35384
  }), t.createElement(OJ, {
35362
- hsva: u,
35363
- onChange: d
35385
+ hsva: d,
35386
+ onChange: f,
35387
+ onChangeEnd: p
35364
35388
  }), t.createElement(DJ, {
35365
- hue: u.h,
35366
- onChange: d,
35389
+ hue: d.h,
35390
+ onChange: f,
35391
+ onChangeEnd: p,
35367
35392
  className: "react-colorful__last-control"
35368
35393
  }));
35369
35394
  }, RJ = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@photoroom/ui",
3
- "version": "0.1.136",
3
+ "version": "0.1.138",
4
4
  "private": false,
5
5
  "description": "Photoroom design system components",
6
6
  "sideEffects": [
@@ -60,7 +60,7 @@
60
60
  "fuse.js": "7.3.0",
61
61
  "lodash-es": "4.18.1",
62
62
  "motion": "12.38.0",
63
- "react-colorful": "5.6.1",
63
+ "react-colorful": "5.7.0",
64
64
  "react-device-detect": "2.2.3",
65
65
  "react-intersection-observer": "10.0.3",
66
66
  "react-moveable": "0.56.0",