@trops/dash-react 1.0.53 → 1.0.55

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
@@ -30,7 +30,7 @@ var ThemeContext = /*#__PURE__*/createContext({
30
30
  rawThemes: null
31
31
  });
32
32
 
33
- function _createForOfIteratorHelper$2(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$k(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
33
+ function _createForOfIteratorHelper$3(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$k(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
34
34
  function _typeof$K(o) { "@babel/helpers - typeof"; return _typeof$K = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof$K(o); }
35
35
  function ownKeys$E(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
36
36
  function _objectSpread$E(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$E(Object(t), !0).forEach(function (r) { _defineProperty$F(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$E(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -101,7 +101,7 @@ var ThemePreviewProvider = function ThemePreviewProvider(_ref) {
101
101
  }
102
102
  }
103
103
  // Remove any vars from a prior theme that aren't in the new set.
104
- var _iterator = _createForOfIteratorHelper$2(writtenVarsRef.current),
104
+ var _iterator = _createForOfIteratorHelper$3(writtenVarsRef.current),
105
105
  _step;
106
106
  try {
107
107
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
@@ -125,7 +125,7 @@ var ThemePreviewProvider = function ThemePreviewProvider(_ref) {
125
125
  return function () {
126
126
  var root = typeof document !== "undefined" ? document.documentElement : null;
127
127
  if (!root) return;
128
- var _iterator2 = _createForOfIteratorHelper$2(writtenVarsRef.current),
128
+ var _iterator2 = _createForOfIteratorHelper$3(writtenVarsRef.current),
129
129
  _step2;
130
130
  try {
131
131
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
@@ -984,6 +984,7 @@ var getDefaultStylesForItem = function getDefaultStylesForItem(itemName) {
984
984
  return itemName in colorMap ? _objectSpread$D({}, colorMap[itemName]) : {};
985
985
  };
986
986
 
987
+ function _createForOfIteratorHelper$2(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray$i(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
987
988
  function _slicedToArray$f(r, e) { return _arrayWithHoles$f(r) || _iterableToArrayLimit$f(r, e) || _unsupportedIterableToArray$i(r, e) || _nonIterableRest$f(); }
988
989
  function _nonIterableRest$f() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
989
990
  function _unsupportedIterableToArray$i(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$i(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$i(r, a) : void 0; } }
@@ -1230,6 +1231,244 @@ function contrastRatio(hexA, hexB) {
1230
1231
  return (lighter + 0.05) / (darker + 0.05);
1231
1232
  }
1232
1233
 
1234
+ /**
1235
+ * Color harmony helpers — emit hex partners for a base hex using
1236
+ * classic hue-rotation rules. Saturation + lightness are preserved
1237
+ * from the base, so the generated palette has consistent intensity.
1238
+ * `null` is returned when the input hex is invalid.
1239
+ */
1240
+ function rotateHex(hex, deltaH) {
1241
+ var rgb = hexToRgb(hex);
1242
+ if (!rgb) return null;
1243
+ var _rgbToHsl2 = rgbToHsl(rgb),
1244
+ h = _rgbToHsl2.h,
1245
+ s = _rgbToHsl2.s,
1246
+ l = _rgbToHsl2.l;
1247
+ var newH = ((h + deltaH) % 360 + 360) % 360;
1248
+ return rgbToHex(hslToRgb({
1249
+ h: newH,
1250
+ s: s,
1251
+ l: l
1252
+ }));
1253
+ }
1254
+ function complementHex(hex) {
1255
+ return rotateHex(hex, 180);
1256
+ }
1257
+ function analogousHexes(hex) {
1258
+ var a = rotateHex(hex, -30);
1259
+ var b = rotateHex(hex, 30);
1260
+ if (!a || !b) return null;
1261
+ return [a, b];
1262
+ }
1263
+ function triadicHexes(hex) {
1264
+ var a = rotateHex(hex, 120);
1265
+ var b = rotateHex(hex, 240);
1266
+ if (!a || !b) return null;
1267
+ return [a, b];
1268
+ }
1269
+ function splitComplementaryHexes(hex) {
1270
+ var a = rotateHex(hex, 150);
1271
+ var b = rotateHex(hex, 210);
1272
+ if (!a || !b) return null;
1273
+ return [a, b];
1274
+ }
1275
+ function tetradicHexes(hex) {
1276
+ var a = rotateHex(hex, 90);
1277
+ var b = rotateHex(hex, 180);
1278
+ var c = rotateHex(hex, 270);
1279
+ if (!a || !b || !c) return null;
1280
+ return [a, b, c];
1281
+ }
1282
+
1283
+ /**
1284
+ * Monochromatic palette: same hue as the base, varied saturation +
1285
+ * lightness. Returns `count` hexes evenly distributed across the
1286
+ * lightness band (0.15..0.85) with mild saturation variation.
1287
+ * Useful for single-hue brand palettes.
1288
+ */
1289
+ function monochromaticHexes(hex) {
1290
+ var count = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
1291
+ var rgb = hexToRgb(hex);
1292
+ if (!rgb) return null;
1293
+ var _rgbToHsl3 = rgbToHsl(rgb),
1294
+ h = _rgbToHsl3.h,
1295
+ s = _rgbToHsl3.s;
1296
+ var out = [];
1297
+ for (var i = 0; i < count; i++) {
1298
+ var t = count === 1 ? 0.5 : i / (count - 1);
1299
+ var l = 0.15 + t * 0.7;
1300
+ // Slightly dampen saturation at the extremes so the lightest
1301
+ // and darkest mono shades don't feel oversaturated.
1302
+ var sAdj = s * (1 - 0.3 * Math.abs(t - 0.5) * 2);
1303
+ out.push(rgbToHex(hslToRgb({
1304
+ h: h,
1305
+ s: sAdj,
1306
+ l: l
1307
+ })));
1308
+ }
1309
+ return out;
1310
+ }
1311
+
1312
+ /**
1313
+ * Apply an HSL nudge to a hex color. Accepts deltas in:
1314
+ * - dH: degrees [-360..360], wraps through 0/360
1315
+ * - dS: fraction [-1..1], clamped to [0..1] after add
1316
+ * - dL: fraction [-1..1], clamped to [0..1] after add
1317
+ */
1318
+ function adjustHsl(hex) {
1319
+ var dH = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1320
+ var dS = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
1321
+ var dL = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
1322
+ var rgb = hexToRgb(hex);
1323
+ if (!rgb) return null;
1324
+ var hsl = rgbToHsl(rgb);
1325
+ var h = ((hsl.h + dH) % 360 + 360) % 360;
1326
+ var s = Math.max(0, Math.min(1, hsl.s + dS));
1327
+ var l = Math.max(0, Math.min(1, hsl.l + dL));
1328
+ return rgbToHex(hslToRgb({
1329
+ h: h,
1330
+ s: s,
1331
+ l: l
1332
+ }));
1333
+ }
1334
+
1335
+ /**
1336
+ * Color families for the categorized picker grid. Each chromatic
1337
+ * family declares a hue range (inclusive, may wrap through 0/360);
1338
+ * Neutrals has `hueRange: null` and is handled specially.
1339
+ *
1340
+ * Used by `getCuratedColorGrid(familyName)` to derive a curated set
1341
+ * of ~36 swatches per family — varied lightness + saturation across
1342
+ * the family's hue range. Discoverable for users who don't think in
1343
+ * hex but want more colors than Tailwind's 22 named families.
1344
+ *
1345
+ * The grid is generated, not hand-curated, so it stays consistent
1346
+ * if we tune the lightness/saturation curve later.
1347
+ */
1348
+ var COLOR_FAMILIES = [{
1349
+ name: "Reds & Pinks",
1350
+ hueRange: [340, 20]
1351
+ },
1352
+ // wraps through 0
1353
+ {
1354
+ name: "Oranges & Yellows",
1355
+ hueRange: [20, 65]
1356
+ }, {
1357
+ name: "Greens",
1358
+ hueRange: [80, 170]
1359
+ }, {
1360
+ name: "Blues & Cyans",
1361
+ hueRange: [180, 250]
1362
+ }, {
1363
+ name: "Purples & Magentas",
1364
+ hueRange: [260, 320]
1365
+ }, {
1366
+ name: "Neutrals",
1367
+ hueRange: null
1368
+ }];
1369
+ function getColorFamilies() {
1370
+ return COLOR_FAMILIES.map(function (f) {
1371
+ return f.name;
1372
+ });
1373
+ }
1374
+
1375
+ /**
1376
+ * Return a curated array of hex colors for the given family name.
1377
+ * Chromatic families produce 6 hues × 6 lightnesses (36 swatches),
1378
+ * with saturation lowered at the extremes for legibility.
1379
+ * Neutrals produce 3 tints (pure, warm, cool) × 6 lightnesses
1380
+ * (18 swatches).
1381
+ *
1382
+ * Returns [] if the family name isn't recognized.
1383
+ */
1384
+ function getCuratedColorGrid(familyName) {
1385
+ var family = COLOR_FAMILIES.find(function (f) {
1386
+ return f.name === familyName;
1387
+ });
1388
+ if (!family) return [];
1389
+ if (family.hueRange === null) {
1390
+ // Neutrals: vary the tint × lightness. Pure / warm / cool
1391
+ // mirror the bands designers tend to reach for.
1392
+ var tints = [{
1393
+ h: 0,
1394
+ s: 0
1395
+ },
1396
+ // pure gray
1397
+ {
1398
+ h: 30,
1399
+ s: 0.08
1400
+ },
1401
+ // warm
1402
+ {
1403
+ h: 215,
1404
+ s: 0.08
1405
+ } // cool
1406
+ ];
1407
+ var _lightnesses = [0.1, 0.25, 0.4, 0.55, 0.7, 0.88];
1408
+ var _out = [];
1409
+ for (var _i2 = 0, _lightnesses2 = _lightnesses; _i2 < _lightnesses2.length; _i2++) {
1410
+ var l = _lightnesses2[_i2];
1411
+ var _iterator = _createForOfIteratorHelper$2(tints),
1412
+ _step;
1413
+ try {
1414
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
1415
+ var tint = _step.value;
1416
+ _out.push(rgbToHex(hslToRgb({
1417
+ h: tint.h,
1418
+ s: tint.s,
1419
+ l: l
1420
+ })));
1421
+ }
1422
+ } catch (err) {
1423
+ _iterator.e(err);
1424
+ } finally {
1425
+ _iterator.f();
1426
+ }
1427
+ }
1428
+ return _out;
1429
+ }
1430
+ var _family$hueRange = _slicedToArray$f(family.hueRange, 2),
1431
+ hMin = _family$hueRange[0],
1432
+ hMax = _family$hueRange[1];
1433
+ var hues = [];
1434
+ if (hMin > hMax) {
1435
+ // Wraps through 0/360.
1436
+ var span = 360 - hMin + hMax;
1437
+ for (var i = 0; i < 6; i++) {
1438
+ hues.push((hMin + i * span / 5) % 360);
1439
+ }
1440
+ } else {
1441
+ var _span = hMax - hMin;
1442
+ for (var _i3 = 0; _i3 < 6; _i3++) {
1443
+ hues.push(hMin + _i3 * _span / 5);
1444
+ }
1445
+ }
1446
+ var lightnesses = [0.2, 0.35, 0.5, 0.65, 0.8, 0.9];
1447
+ var out = [];
1448
+ for (var _i4 = 0, _lightnesses3 = lightnesses; _i4 < _lightnesses3.length; _i4++) {
1449
+ var _l = _lightnesses3[_i4];
1450
+ var _iterator2 = _createForOfIteratorHelper$2(hues),
1451
+ _step2;
1452
+ try {
1453
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
1454
+ var h = _step2.value;
1455
+ // Saturation curve: full at mid-lightness, lower at extremes.
1456
+ var s = _l < 0.3 || _l > 0.85 ? 0.5 : 0.85;
1457
+ out.push(rgbToHex(hslToRgb({
1458
+ h: h,
1459
+ s: s,
1460
+ l: _l
1461
+ })));
1462
+ }
1463
+ } catch (err) {
1464
+ _iterator2.e(err);
1465
+ } finally {
1466
+ _iterator2.f();
1467
+ }
1468
+ }
1469
+ return out;
1470
+ }
1471
+
1233
1472
  function _slicedToArray$e(r, e) { return _arrayWithHoles$e(r) || _iterableToArrayLimit$e(r, e) || _unsupportedIterableToArray$h(r, e) || _nonIterableRest$e(); }
1234
1473
  function _nonIterableRest$e() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
1235
1474
  function _unsupportedIterableToArray$h(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray$h(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$h(r, a) : void 0; } }
@@ -5719,25 +5958,20 @@ function _toPropertyKey$j(t) { var i = _toPrimitive$j(t, "string"); return "symb
5719
5958
  function _toPrimitive$j(t, r) { if ("object" != _typeof$j(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof$j(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5720
5959
  function _objectWithoutProperties$d(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose$d(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
5721
5960
  function _objectWithoutPropertiesLoose$d(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
5722
- var OriginalResizeObserver = window.ResizeObserver;
5723
-
5724
- // Create a new ResizeObserver constructor
5725
- window.ResizeObserver = function (callback) {
5726
- var wrappedCallback = function wrappedCallback(entries, observer) {
5727
- window.requestAnimationFrame(function () {
5728
- callback(entries, observer);
5729
- });
5961
+ if (typeof window !== "undefined" && window.ResizeObserver) {
5962
+ var OriginalResizeObserver = window.ResizeObserver;
5963
+ window.ResizeObserver = function (callback) {
5964
+ var wrappedCallback = function wrappedCallback(entries, observer) {
5965
+ window.requestAnimationFrame(function () {
5966
+ callback(entries, observer);
5967
+ });
5968
+ };
5969
+ return new OriginalResizeObserver(wrappedCallback);
5730
5970
  };
5731
-
5732
- // Create an instance of the original ResizeObserver
5733
- // with the wrapped callback
5734
- return new OriginalResizeObserver(wrappedCallback);
5735
- };
5736
-
5737
- // Copy over static methods, if any
5738
- for (var staticMethod in OriginalResizeObserver) {
5739
- if (OriginalResizeObserver.hasOwnProperty(staticMethod)) {
5740
- window.ResizeObserver[staticMethod] = OriginalResizeObserver[staticMethod];
5971
+ for (var staticMethod in OriginalResizeObserver) {
5972
+ if (OriginalResizeObserver.hasOwnProperty(staticMethod)) {
5973
+ window.ResizeObserver[staticMethod] = OriginalResizeObserver[staticMethod];
5974
+ }
5741
5975
  }
5742
5976
  }
5743
5977
  function CodeEditorVS(_ref) {
@@ -6150,7 +6384,7 @@ function _setPrototypeOf$2(t, e) { return _setPrototypeOf$2 = Object.setPrototyp
6150
6384
  function _defineProperty$c(e, r, t) { return (r = _toPropertyKey$e(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
6151
6385
  function _toPropertyKey$e(t) { var i = _toPrimitive$e(t, "string"); return "symbol" == _typeof$e(i) ? i : i + ""; }
6152
6386
  function _toPrimitive$e(t, r) { if ("object" != _typeof$e(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof$e(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6153
- var mainApi = window.mainApi;
6387
+ var mainApi = typeof window !== "undefined" ? window.mainApi : undefined;
6154
6388
  /*#__PURE__*/(function (_React$Component) {
6155
6389
  function Header() {
6156
6390
  var _this;
@@ -9688,7 +9922,7 @@ var ColorSwatch = function ColorSwatch(_ref) {
9688
9922
  var hex = (color === null || color === void 0 ? void 0 : color.hex) || (color === null || color === void 0 ? void 0 : color.value) || "#888";
9689
9923
  var label = (color === null || color === void 0 ? void 0 : color.family) || (color === null || color === void 0 ? void 0 : color.name) || hex;
9690
9924
  return /*#__PURE__*/jsxs("div", {
9691
- className: "flex flex-col items-center gap-1.5 flex-1 cursor-pointer group transition-all ".concat(isDragOver ? "scale-110 ring-2 ring-blue-400 rounded-lg" : "", " ").concat(isDragging ? "opacity-40 scale-95" : "", " ").concat(focused ? "ring-2 ring-white/50 rounded-lg" : "", " ").concat(className),
9925
+ className: "flex flex-col items-center gap-1.5 flex-1 min-h-0 min-w-0 cursor-pointer group transition-all ".concat(isDragOver ? "scale-110 ring-2 ring-blue-400 rounded-lg" : "", " ").concat(isDragging ? "opacity-40 scale-95" : "", " ").concat(focused ? "ring-2 ring-white/50 rounded-lg" : "", " ").concat(className),
9692
9926
  onClick: onClick,
9693
9927
  title: "".concat(ROLE_LABELS[role] || role, " \u2014 drag to reorder or click to cycle"),
9694
9928
  draggable: true,
@@ -9703,7 +9937,7 @@ var ColorSwatch = function ColorSwatch(_ref) {
9703
9937
  "aria-label": "".concat(ROLE_LABELS[role], " color: ").concat(label, ". Drag to reorder or use arrow keys."),
9704
9938
  "aria-grabbed": isDragging,
9705
9939
  children: [/*#__PURE__*/jsx("div", {
9706
- className: "h-12 w-full rounded-lg transition-all group-hover:scale-105 group-hover:shadow-lg ring-1 ring-white/10 ".concat(isDragOver ? "shadow-lg shadow-blue-400/30" : ""),
9940
+ className: "flex-1 min-h-0 w-full rounded-lg transition-all group-hover:scale-105 group-hover:shadow-lg ring-1 ring-white/10 ".concat(isDragOver ? "shadow-lg shadow-blue-400/30" : ""),
9707
9941
  style: {
9708
9942
  backgroundColor: hex
9709
9943
  }
@@ -9867,14 +10101,11 @@ var PalettePreviewPane = function PalettePreviewPane(_ref2) {
9867
10101
  var hasReorder = onReorderRoles != null;
9868
10102
  var helpText = hasReorder ? "Drag colors to swap roles, or use arrow keys + Enter" : "Click a color to cycle its role assignment";
9869
10103
  return /*#__PURE__*/jsxs("div", {
9870
- className: "flex flex-col gap-3 ".concat(styles.string || "", " ").concat(className),
10104
+ className: "flex flex-col gap-3 flex-1 min-h-0 ".concat(styles.string || "", " ").concat(className),
9871
10105
  role: "group",
9872
10106
  "aria-label": "Color role assignments",
9873
- children: [/*#__PURE__*/jsx("span", {
9874
- className: "text-sm font-semibold opacity-50",
9875
- children: "Color Roles"
9876
- }), /*#__PURE__*/jsx("div", {
9877
- className: "flex flex-row gap-3",
10107
+ children: [/*#__PURE__*/jsx("div", {
10108
+ className: "flex flex-row gap-3 flex-1 min-h-0",
9878
10109
  role: "listbox",
9879
10110
  children: activeRoles.map(function (role, index) {
9880
10111
  var colorIndex = roleAssignments[role];
@@ -10014,7 +10245,6 @@ var ThemeFromUrlPane = function ThemeFromUrlPane(_ref) {
10014
10245
  var timeoutRef = useRef(null);
10015
10246
  var isValidUrl = URL_REGEX.test(url.trim());
10016
10247
  var canExtract = isValidUrl && !loading;
10017
- var canGenerate = palette && roleAssignments && !loading;
10018
10248
  var inputId = getUUID$1("", "theme-url-input");
10019
10249
  var handleExtract = useCallback(/*#__PURE__*/function () {
10020
10250
  var _handleExtract = _asyncToGenerator$2(/*#__PURE__*/_regenerator$2().m(function _callee() {
@@ -10127,13 +10357,19 @@ var ThemeFromUrlPane = function ThemeFromUrlPane(_ref) {
10127
10357
  })["catch"](function () {});
10128
10358
  }
10129
10359
  }
10130
- function handleGenerate() {
10360
+
10361
+ // Auto-commit: whenever the derived theme changes (after extract
10362
+ // or a role swap), push it up to the parent wizard. Drops the
10363
+ // explicit "Generate Theme" button — the parent's Create Theme
10364
+ // is the single commit action.
10365
+ useEffect(function () {
10131
10366
  if (!onGenerate || !generatedTheme) return;
10132
10367
  var theme = _objectSpread$2(_objectSpread$2({}, generatedTheme), {}, {
10133
10368
  name: suggestedName || deriveNameFromUrl(url)
10134
10369
  });
10135
10370
  onGenerate(theme);
10136
- }
10371
+ // eslint-disable-next-line react-hooks/exhaustive-deps
10372
+ }, [generatedTheme, suggestedName]);
10137
10373
  function handleKeyDown(e) {
10138
10374
  if (e.key === "Enter" && canExtract) {
10139
10375
  handleExtract();
@@ -10148,12 +10384,9 @@ var ThemeFromUrlPane = function ThemeFromUrlPane(_ref) {
10148
10384
  grow: false
10149
10385
  });
10150
10386
  return /*#__PURE__*/jsxs("div", {
10151
- className: inline ? "flex flex-col gap-4 ".concat(styles.string || "", " ").concat(className) : "flex flex-col gap-4 p-6 overflow-y-auto flex-1 min-h-0 ".concat(styles.string || "", " ").concat(className),
10152
- children: [/*#__PURE__*/jsx("span", {
10153
- className: "text-sm font-semibold opacity-50",
10154
- children: "Generate from Website"
10155
- }), /*#__PURE__*/jsxs("div", {
10156
- className: "flex flex-col gap-2",
10387
+ className: inline ? "flex flex-col gap-4 flex-1 min-h-0 ".concat(styles.string || "", " ").concat(className) : "flex flex-col gap-4 p-6 flex-1 min-h-0 ".concat(styles.string || "", " ").concat(className),
10388
+ children: [/*#__PURE__*/jsxs("div", {
10389
+ className: "flex flex-col gap-2 shrink-0",
10157
10390
  children: [/*#__PURE__*/jsxs("div", {
10158
10391
  className: "flex flex-row gap-2",
10159
10392
  children: [/*#__PURE__*/jsx("input", {
@@ -10220,22 +10453,14 @@ var ThemeFromUrlPane = function ThemeFromUrlPane(_ref) {
10220
10453
  children: "Try Again"
10221
10454
  })]
10222
10455
  })]
10223
- }), palette && roleAssignments && /*#__PURE__*/jsx(PalettePreviewPane, {
10224
- palette: palette,
10225
- roleAssignments: roleAssignments,
10226
- onSwapRole: handleSwapRole,
10227
- onReorderRoles: handleReorderRoles
10228
- }), canGenerate && generatedTheme && /*#__PURE__*/jsxs("button", {
10229
- type: "button",
10230
- onClick: handleGenerate,
10231
- className: "flex flex-row items-center justify-center gap-2 h-10 w-full ".concat(buttonStyles.string, " focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 ").concat(buttonStyles.focusRingColor || ""),
10232
- children: [/*#__PURE__*/jsx(FontAwesomeIcon, {
10233
- icon: "wand-magic-sparkles",
10234
- className: "h-3.5 w-3.5"
10235
- }), /*#__PURE__*/jsx("span", {
10236
- className: "text-sm",
10237
- children: "Generate Theme"
10238
- })]
10456
+ }), palette && roleAssignments && /*#__PURE__*/jsx("div", {
10457
+ className: "flex-1 min-h-0 flex flex-col",
10458
+ children: /*#__PURE__*/jsx(PalettePreviewPane, {
10459
+ palette: palette,
10460
+ roleAssignments: roleAssignments,
10461
+ onSwapRole: handleSwapRole,
10462
+ onReorderRoles: handleReorderRoles
10463
+ })
10239
10464
  })]
10240
10465
  });
10241
10466
  };
@@ -11020,5 +11245,5 @@ if (process.env.NODE_ENV !== "development") {
11020
11245
  console.log = function () {};
11021
11246
  }
11022
11247
 
11023
- export { Accordion, Accordion2, Accordion3, Alert, Alert2, Alert3, AlertBanner, AlgoliaRefinementList, AlgoliaSearchBox, Breadcrumbs, Breadcrumbs2, Breadcrumbs3, Button, Button2, Button3, ButtonIcon, ButtonIcon2, ButtonIcon3, Caption, Caption2, Caption3, Card, Card2, Card3, Checkbox, Code, Code2, Code3, CodeEditorInline, CodeEditorVS, CodeRenderer, CommandPalette, ConfirmationModal, Container, DashPanel, DashPanel2, DashPanel3, DataList, Divider, Divider2, Divider3, DragComponent, Drawer, DropComponent, DropdownPanel, DropdownPanel2, DropdownPanel3, EmptyState, ErrorMessage, FormField, FormLabel, Heading, Heading2, Heading3, Icon, Icon2, Icon3, InputText, LayoutContainer, MainSection, Menu, Menu2, Menu3, MenuItem, MenuItem2, MenuItem3, MockAlgolia, MockLayout, MockWrapper, Modal, Navbar, PalettePreviewPane, Panel, Panel2, Panel3, Paragraph, Paragraph2, Paragraph3, ProgressBar, ProgressBar2, ProgressBar3, RadioGroup, RichText, SLACK_QUICK_REACTION_SHORTCODES, SearchInput, SelectInput, SelectMenu, SelectableCard, SettingsModal, Sidebar, Skeleton, Slider, StatCard, StatusBadge, Stepper, SubHeading, SubHeading2, SubHeading3, Switch, TAILWIND_PALETTE, TabbedNavbar, Table, Table2, Table3, Tabs, Tabs2, Tabs3, Tag, Tag2, Tag3, TextArea, ThemeContext, ThemeFromUrlPane, ThemePreviewBanner, ThemePreviewContext, ThemePreviewProvider, Toast, Toast2, Toast3, Toggle, Toggle2, Toggle3, Tooltip, WS_STATES, WebSocketStatus, WidgetChrome, WidgetContext, capitalizeFirstLetter, colorNames, colorTypes, contrastRatio, deepCopy, deriveShades, getCSSStyleForClassname, getClassForObjectType, getDefaultStylesForItem, getRandomInt, getStyleName, getStylesForItem, getUUID$1 as getUUID, hexForTailwindClass, hexToRgb, hslToRgb, isHexColor, isObject, mock, mockText, normalizeHex, objectTypes, rgbToHex, rgbToHsl, shades, slackEmojiForName, styleClassNames, tailwindHeightFractions, themeObjects, themeVariants, useLazyEnrichment, useSidebar, useThemePreview, withRouter };
11248
+ export { Accordion, Accordion2, Accordion3, Alert, Alert2, Alert3, AlertBanner, AlgoliaRefinementList, AlgoliaSearchBox, Breadcrumbs, Breadcrumbs2, Breadcrumbs3, Button, Button2, Button3, ButtonIcon, ButtonIcon2, ButtonIcon3, Caption, Caption2, Caption3, Card, Card2, Card3, Checkbox, Code, Code2, Code3, CodeEditorInline, CodeEditorVS, CodeRenderer, CommandPalette, ConfirmationModal, Container, DashPanel, DashPanel2, DashPanel3, DataList, Divider, Divider2, Divider3, DragComponent, Drawer, DropComponent, DropdownPanel, DropdownPanel2, DropdownPanel3, EmptyState, ErrorMessage, FormField, FormLabel, Heading, Heading2, Heading3, Icon, Icon2, Icon3, InputText, LayoutContainer, MainSection, Menu, Menu2, Menu3, MenuItem, MenuItem2, MenuItem3, MockAlgolia, MockLayout, MockWrapper, Modal, Navbar, PalettePreviewPane, Panel, Panel2, Panel3, Paragraph, Paragraph2, Paragraph3, ProgressBar, ProgressBar2, ProgressBar3, RadioGroup, RichText, SLACK_QUICK_REACTION_SHORTCODES, SearchInput, SelectInput, SelectMenu, SelectableCard, SettingsModal, Sidebar, Skeleton, Slider, StatCard, StatusBadge, Stepper, SubHeading, SubHeading2, SubHeading3, Switch, TAILWIND_PALETTE, TabbedNavbar, Table, Table2, Table3, Tabs, Tabs2, Tabs3, Tag, Tag2, Tag3, TextArea, ThemeContext, ThemeFromUrlPane, ThemePreviewBanner, ThemePreviewContext, ThemePreviewProvider, Toast, Toast2, Toast3, Toggle, Toggle2, Toggle3, Tooltip, WS_STATES, WebSocketStatus, WidgetChrome, WidgetContext, adjustHsl, analogousHexes, capitalizeFirstLetter, colorNames, colorTypes, complementHex, contrastRatio, deepCopy, deriveShades, getCSSStyleForClassname, getClassForObjectType, getColorFamilies, getCuratedColorGrid, getDefaultStylesForItem, getRandomInt, getStyleName, getStylesForItem, getUUID$1 as getUUID, hexForTailwindClass, hexToRgb, hslToRgb, isHexColor, isObject, mock, mockText, monochromaticHexes, normalizeHex, objectTypes, rgbToHex, rgbToHsl, shades, slackEmojiForName, splitComplementaryHexes, styleClassNames, tailwindHeightFractions, tetradicHexes, themeObjects, themeVariants, triadicHexes, useLazyEnrichment, useSidebar, useThemePreview, withRouter };
11024
11249
  //# sourceMappingURL=index.js.map