@juv/codego-react-ui 1.1.2 → 1.1.5
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.cjs +536 -451
- package/dist/index.d.cts +29 -3
- package/dist/index.d.ts +29 -3
- package/dist/index.global.js +1176 -1094
- package/dist/index.js +535 -453
- package/package.json +1 -1
package/dist/index.global.js
CHANGED
|
@@ -1455,720 +1455,720 @@ var CodegoUI = (() => {
|
|
|
1455
1455
|
}
|
|
1456
1456
|
});
|
|
1457
1457
|
|
|
1458
|
-
// node_modules/react/cjs/react-
|
|
1459
|
-
var
|
|
1460
|
-
"node_modules/react/cjs/react-
|
|
1458
|
+
// node_modules/react-dom/cjs/react-dom.production.js
|
|
1459
|
+
var require_react_dom_production = __commonJS({
|
|
1460
|
+
"node_modules/react-dom/cjs/react-dom.production.js"(exports) {
|
|
1461
1461
|
"use strict";
|
|
1462
|
-
var
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1462
|
+
var React45 = require_react();
|
|
1463
|
+
function formatProdErrorMessage(code) {
|
|
1464
|
+
var url = "https://react.dev/errors/" + code;
|
|
1465
|
+
if (1 < arguments.length) {
|
|
1466
|
+
url += "?args[]=" + encodeURIComponent(arguments[1]);
|
|
1467
|
+
for (var i = 2; i < arguments.length; i++)
|
|
1468
|
+
url += "&args[]=" + encodeURIComponent(arguments[i]);
|
|
1469
|
+
}
|
|
1470
|
+
return "Minified React error #" + code + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
|
|
1471
|
+
}
|
|
1472
|
+
function noop() {
|
|
1473
|
+
}
|
|
1474
|
+
var Internals = {
|
|
1475
|
+
d: {
|
|
1476
|
+
f: noop,
|
|
1477
|
+
r: function() {
|
|
1478
|
+
throw Error(formatProdErrorMessage(522));
|
|
1479
|
+
},
|
|
1480
|
+
D: noop,
|
|
1481
|
+
C: noop,
|
|
1482
|
+
L: noop,
|
|
1483
|
+
m: noop,
|
|
1484
|
+
X: noop,
|
|
1485
|
+
S: noop,
|
|
1486
|
+
M: noop
|
|
1487
|
+
},
|
|
1488
|
+
p: 0,
|
|
1489
|
+
findDOMNode: null
|
|
1490
|
+
};
|
|
1491
|
+
var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
|
|
1492
|
+
function createPortal$1(children, containerInfo, implementation) {
|
|
1493
|
+
var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
|
|
1474
1494
|
return {
|
|
1475
|
-
$$typeof:
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1495
|
+
$$typeof: REACT_PORTAL_TYPE,
|
|
1496
|
+
key: null == key ? null : "" + key,
|
|
1497
|
+
children,
|
|
1498
|
+
containerInfo,
|
|
1499
|
+
implementation
|
|
1480
1500
|
};
|
|
1481
1501
|
}
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1502
|
+
var ReactSharedInternals = React45.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
1503
|
+
function getCrossOriginStringAs(as, input) {
|
|
1504
|
+
if ("font" === as) return "";
|
|
1505
|
+
if ("string" === typeof input)
|
|
1506
|
+
return "use-credentials" === input ? input : "";
|
|
1507
|
+
}
|
|
1508
|
+
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
|
|
1509
|
+
exports.createPortal = function(children, container) {
|
|
1510
|
+
var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
|
|
1511
|
+
if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType)
|
|
1512
|
+
throw Error(formatProdErrorMessage(299));
|
|
1513
|
+
return createPortal$1(children, container, null, key);
|
|
1514
|
+
};
|
|
1515
|
+
exports.flushSync = function(fn) {
|
|
1516
|
+
var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
|
|
1517
|
+
try {
|
|
1518
|
+
if (ReactSharedInternals.T = null, Internals.p = 2, fn) return fn();
|
|
1519
|
+
} finally {
|
|
1520
|
+
ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f();
|
|
1521
|
+
}
|
|
1522
|
+
};
|
|
1523
|
+
exports.preconnect = function(href, options) {
|
|
1524
|
+
"string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
|
|
1525
|
+
};
|
|
1526
|
+
exports.prefetchDNS = function(href) {
|
|
1527
|
+
"string" === typeof href && Internals.d.D(href);
|
|
1528
|
+
};
|
|
1529
|
+
exports.preinit = function(href, options) {
|
|
1530
|
+
if ("string" === typeof href && options && "string" === typeof options.as) {
|
|
1531
|
+
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
|
|
1532
|
+
"style" === as ? Internals.d.S(
|
|
1533
|
+
href,
|
|
1534
|
+
"string" === typeof options.precedence ? options.precedence : void 0,
|
|
1535
|
+
{
|
|
1536
|
+
crossOrigin,
|
|
1537
|
+
integrity,
|
|
1538
|
+
fetchPriority
|
|
1539
|
+
}
|
|
1540
|
+
) : "script" === as && Internals.d.X(href, {
|
|
1541
|
+
crossOrigin,
|
|
1542
|
+
integrity,
|
|
1543
|
+
fetchPriority,
|
|
1544
|
+
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
1545
|
+
});
|
|
1546
|
+
}
|
|
1547
|
+
};
|
|
1548
|
+
exports.preinitModule = function(href, options) {
|
|
1549
|
+
if ("string" === typeof href)
|
|
1550
|
+
if ("object" === typeof options && null !== options) {
|
|
1551
|
+
if (null == options.as || "script" === options.as) {
|
|
1552
|
+
var crossOrigin = getCrossOriginStringAs(
|
|
1553
|
+
options.as,
|
|
1554
|
+
options.crossOrigin
|
|
1555
|
+
);
|
|
1556
|
+
Internals.d.M(href, {
|
|
1557
|
+
crossOrigin,
|
|
1558
|
+
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
1559
|
+
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
1560
|
+
});
|
|
1561
|
+
}
|
|
1562
|
+
} else null == options && Internals.d.M(href);
|
|
1563
|
+
};
|
|
1564
|
+
exports.preload = function(href, options) {
|
|
1565
|
+
if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
|
|
1566
|
+
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
|
|
1567
|
+
Internals.d.L(href, as, {
|
|
1568
|
+
crossOrigin,
|
|
1569
|
+
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
1570
|
+
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
|
|
1571
|
+
type: "string" === typeof options.type ? options.type : void 0,
|
|
1572
|
+
fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
|
|
1573
|
+
referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
|
|
1574
|
+
imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
|
|
1575
|
+
imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
|
|
1576
|
+
media: "string" === typeof options.media ? options.media : void 0
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1579
|
+
};
|
|
1580
|
+
exports.preloadModule = function(href, options) {
|
|
1581
|
+
if ("string" === typeof href)
|
|
1582
|
+
if (options) {
|
|
1583
|
+
var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
|
|
1584
|
+
Internals.d.m(href, {
|
|
1585
|
+
as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
|
|
1586
|
+
crossOrigin,
|
|
1587
|
+
integrity: "string" === typeof options.integrity ? options.integrity : void 0
|
|
1588
|
+
});
|
|
1589
|
+
} else Internals.d.m(href);
|
|
1590
|
+
};
|
|
1591
|
+
exports.requestFormReset = function(form) {
|
|
1592
|
+
Internals.d.r(form);
|
|
1593
|
+
};
|
|
1594
|
+
exports.unstable_batchedUpdates = function(fn, a) {
|
|
1595
|
+
return fn(a);
|
|
1596
|
+
};
|
|
1597
|
+
exports.useFormState = function(action, initialState2, permalink) {
|
|
1598
|
+
return ReactSharedInternals.H.useFormState(action, initialState2, permalink);
|
|
1599
|
+
};
|
|
1600
|
+
exports.useFormStatus = function() {
|
|
1601
|
+
return ReactSharedInternals.H.useHostTransitionStatus();
|
|
1602
|
+
};
|
|
1603
|
+
exports.version = "19.2.4";
|
|
1485
1604
|
}
|
|
1486
1605
|
});
|
|
1487
1606
|
|
|
1488
|
-
// node_modules/react/cjs/react-
|
|
1489
|
-
var
|
|
1490
|
-
"node_modules/react/cjs/react-
|
|
1607
|
+
// node_modules/react-dom/cjs/react-dom.development.js
|
|
1608
|
+
var require_react_dom_development = __commonJS({
|
|
1609
|
+
"node_modules/react-dom/cjs/react-dom.development.js"(exports) {
|
|
1491
1610
|
"use strict";
|
|
1492
1611
|
"production" !== process.env.NODE_ENV && (function() {
|
|
1493
|
-
function
|
|
1494
|
-
if (null == type) return null;
|
|
1495
|
-
if ("function" === typeof type)
|
|
1496
|
-
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
|
1497
|
-
if ("string" === typeof type) return type;
|
|
1498
|
-
switch (type) {
|
|
1499
|
-
case REACT_FRAGMENT_TYPE:
|
|
1500
|
-
return "Fragment";
|
|
1501
|
-
case REACT_PROFILER_TYPE:
|
|
1502
|
-
return "Profiler";
|
|
1503
|
-
case REACT_STRICT_MODE_TYPE:
|
|
1504
|
-
return "StrictMode";
|
|
1505
|
-
case REACT_SUSPENSE_TYPE:
|
|
1506
|
-
return "Suspense";
|
|
1507
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
1508
|
-
return "SuspenseList";
|
|
1509
|
-
case REACT_ACTIVITY_TYPE:
|
|
1510
|
-
return "Activity";
|
|
1511
|
-
}
|
|
1512
|
-
if ("object" === typeof type)
|
|
1513
|
-
switch ("number" === typeof type.tag && console.error(
|
|
1514
|
-
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
1515
|
-
), type.$$typeof) {
|
|
1516
|
-
case REACT_PORTAL_TYPE:
|
|
1517
|
-
return "Portal";
|
|
1518
|
-
case REACT_CONTEXT_TYPE:
|
|
1519
|
-
return type.displayName || "Context";
|
|
1520
|
-
case REACT_CONSUMER_TYPE:
|
|
1521
|
-
return (type._context.displayName || "Context") + ".Consumer";
|
|
1522
|
-
case REACT_FORWARD_REF_TYPE:
|
|
1523
|
-
var innerType = type.render;
|
|
1524
|
-
type = type.displayName;
|
|
1525
|
-
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
|
1526
|
-
return type;
|
|
1527
|
-
case REACT_MEMO_TYPE:
|
|
1528
|
-
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
|
1529
|
-
case REACT_LAZY_TYPE:
|
|
1530
|
-
innerType = type._payload;
|
|
1531
|
-
type = type._init;
|
|
1532
|
-
try {
|
|
1533
|
-
return getComponentNameFromType(type(innerType));
|
|
1534
|
-
} catch (x) {
|
|
1535
|
-
}
|
|
1536
|
-
}
|
|
1537
|
-
return null;
|
|
1612
|
+
function noop() {
|
|
1538
1613
|
}
|
|
1539
1614
|
function testStringCoercion(value) {
|
|
1540
1615
|
return "" + value;
|
|
1541
1616
|
}
|
|
1542
|
-
function
|
|
1617
|
+
function createPortal$1(children, containerInfo, implementation) {
|
|
1618
|
+
var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
|
|
1543
1619
|
try {
|
|
1544
|
-
testStringCoercion(
|
|
1620
|
+
testStringCoercion(key);
|
|
1545
1621
|
var JSCompiler_inline_result = false;
|
|
1546
1622
|
} catch (e) {
|
|
1547
1623
|
JSCompiler_inline_result = true;
|
|
1548
1624
|
}
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
}
|
|
1560
|
-
}
|
|
1561
|
-
function getTaskName(type) {
|
|
1562
|
-
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
1563
|
-
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
|
1564
|
-
return "<...>";
|
|
1565
|
-
try {
|
|
1566
|
-
var name = getComponentNameFromType(type);
|
|
1567
|
-
return name ? "<" + name + ">" : "<...>";
|
|
1568
|
-
} catch (x) {
|
|
1569
|
-
return "<...>";
|
|
1570
|
-
}
|
|
1625
|
+
JSCompiler_inline_result && (console.error(
|
|
1626
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
1627
|
+
"function" === typeof Symbol && Symbol.toStringTag && key[Symbol.toStringTag] || key.constructor.name || "Object"
|
|
1628
|
+
), testStringCoercion(key));
|
|
1629
|
+
return {
|
|
1630
|
+
$$typeof: REACT_PORTAL_TYPE,
|
|
1631
|
+
key: null == key ? null : "" + key,
|
|
1632
|
+
children,
|
|
1633
|
+
containerInfo,
|
|
1634
|
+
implementation
|
|
1635
|
+
};
|
|
1571
1636
|
}
|
|
1572
|
-
function
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
function UnknownOwner() {
|
|
1577
|
-
return Error("react-stack-top-frame");
|
|
1578
|
-
}
|
|
1579
|
-
function hasValidKey(config) {
|
|
1580
|
-
if (hasOwnProperty.call(config, "key")) {
|
|
1581
|
-
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
1582
|
-
if (getter && getter.isReactWarning) return false;
|
|
1583
|
-
}
|
|
1584
|
-
return void 0 !== config.key;
|
|
1637
|
+
function getCrossOriginStringAs(as, input) {
|
|
1638
|
+
if ("font" === as) return "";
|
|
1639
|
+
if ("string" === typeof input)
|
|
1640
|
+
return "use-credentials" === input ? input : "";
|
|
1585
1641
|
}
|
|
1586
|
-
function
|
|
1587
|
-
|
|
1588
|
-
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
|
|
1589
|
-
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
1590
|
-
displayName
|
|
1591
|
-
));
|
|
1592
|
-
}
|
|
1593
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
1594
|
-
Object.defineProperty(props, "key", {
|
|
1595
|
-
get: warnAboutAccessingKey,
|
|
1596
|
-
configurable: true
|
|
1597
|
-
});
|
|
1642
|
+
function getValueDescriptorExpectingObjectForWarning(thing) {
|
|
1643
|
+
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : 'something with type "' + typeof thing + '"';
|
|
1598
1644
|
}
|
|
1599
|
-
function
|
|
1600
|
-
|
|
1601
|
-
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
|
1602
|
-
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
1603
|
-
));
|
|
1604
|
-
componentName = this.props.ref;
|
|
1605
|
-
return void 0 !== componentName ? componentName : null;
|
|
1645
|
+
function getValueDescriptorExpectingEnumForWarning(thing) {
|
|
1646
|
+
return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : "string" === typeof thing ? JSON.stringify(thing) : "number" === typeof thing ? "`" + thing + "`" : 'something with type "' + typeof thing + '"';
|
|
1606
1647
|
}
|
|
1607
|
-
function
|
|
1608
|
-
var
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
props,
|
|
1614
|
-
_owner: owner
|
|
1615
|
-
};
|
|
1616
|
-
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
|
1617
|
-
enumerable: false,
|
|
1618
|
-
get: elementRefGetterWithDeprecationWarning
|
|
1619
|
-
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
1620
|
-
type._store = {};
|
|
1621
|
-
Object.defineProperty(type._store, "validated", {
|
|
1622
|
-
configurable: false,
|
|
1623
|
-
enumerable: false,
|
|
1624
|
-
writable: true,
|
|
1625
|
-
value: 0
|
|
1626
|
-
});
|
|
1627
|
-
Object.defineProperty(type, "_debugInfo", {
|
|
1628
|
-
configurable: false,
|
|
1629
|
-
enumerable: false,
|
|
1630
|
-
writable: true,
|
|
1631
|
-
value: null
|
|
1632
|
-
});
|
|
1633
|
-
Object.defineProperty(type, "_debugStack", {
|
|
1634
|
-
configurable: false,
|
|
1635
|
-
enumerable: false,
|
|
1636
|
-
writable: true,
|
|
1637
|
-
value: debugStack
|
|
1638
|
-
});
|
|
1639
|
-
Object.defineProperty(type, "_debugTask", {
|
|
1640
|
-
configurable: false,
|
|
1641
|
-
enumerable: false,
|
|
1642
|
-
writable: true,
|
|
1643
|
-
value: debugTask
|
|
1644
|
-
});
|
|
1645
|
-
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
1646
|
-
return type;
|
|
1648
|
+
function resolveDispatcher() {
|
|
1649
|
+
var dispatcher = ReactSharedInternals.H;
|
|
1650
|
+
null === dispatcher && console.error(
|
|
1651
|
+
"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
|
|
1652
|
+
);
|
|
1653
|
+
return dispatcher;
|
|
1647
1654
|
}
|
|
1648
|
-
function
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1655
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
1656
|
+
var React45 = require_react(), Internals = {
|
|
1657
|
+
d: {
|
|
1658
|
+
f: noop,
|
|
1659
|
+
r: function() {
|
|
1660
|
+
throw Error(
|
|
1661
|
+
"Invalid form element. requestFormReset must be passed a form that was rendered by React."
|
|
1662
|
+
);
|
|
1663
|
+
},
|
|
1664
|
+
D: noop,
|
|
1665
|
+
C: noop,
|
|
1666
|
+
L: noop,
|
|
1667
|
+
m: noop,
|
|
1668
|
+
X: noop,
|
|
1669
|
+
S: noop,
|
|
1670
|
+
M: noop
|
|
1671
|
+
},
|
|
1672
|
+
p: 0,
|
|
1673
|
+
findDOMNode: null
|
|
1674
|
+
}, REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), ReactSharedInternals = React45.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
1675
|
+
"function" === typeof Map && null != Map.prototype && "function" === typeof Map.prototype.forEach && "function" === typeof Set && null != Set.prototype && "function" === typeof Set.prototype.clear && "function" === typeof Set.prototype.forEach || console.error(
|
|
1676
|
+
"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
|
|
1677
|
+
);
|
|
1678
|
+
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
|
|
1679
|
+
exports.createPortal = function(children, container) {
|
|
1680
|
+
var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
|
|
1681
|
+
if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType)
|
|
1682
|
+
throw Error("Target container is not a DOM element.");
|
|
1683
|
+
return createPortal$1(children, container, null, key);
|
|
1684
|
+
};
|
|
1685
|
+
exports.flushSync = function(fn) {
|
|
1686
|
+
var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
|
|
1687
|
+
try {
|
|
1688
|
+
if (ReactSharedInternals.T = null, Internals.p = 2, fn)
|
|
1689
|
+
return fn();
|
|
1690
|
+
} finally {
|
|
1691
|
+
ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f() && console.error(
|
|
1692
|
+
"flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."
|
|
1693
|
+
);
|
|
1694
|
+
}
|
|
1695
|
+
};
|
|
1696
|
+
exports.preconnect = function(href, options) {
|
|
1697
|
+
"string" === typeof href && href ? null != options && "object" !== typeof options ? console.error(
|
|
1698
|
+
"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
|
|
1699
|
+
getValueDescriptorExpectingEnumForWarning(options)
|
|
1700
|
+
) : null != options && "string" !== typeof options.crossOrigin && console.error(
|
|
1701
|
+
"ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
|
|
1702
|
+
getValueDescriptorExpectingObjectForWarning(options.crossOrigin)
|
|
1703
|
+
) : console.error(
|
|
1704
|
+
"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
1705
|
+
getValueDescriptorExpectingObjectForWarning(href)
|
|
1706
|
+
);
|
|
1707
|
+
"string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
|
|
1708
|
+
};
|
|
1709
|
+
exports.prefetchDNS = function(href) {
|
|
1710
|
+
if ("string" !== typeof href || !href)
|
|
1711
|
+
console.error(
|
|
1712
|
+
"ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
1713
|
+
getValueDescriptorExpectingObjectForWarning(href)
|
|
1714
|
+
);
|
|
1715
|
+
else if (1 < arguments.length) {
|
|
1716
|
+
var options = arguments[1];
|
|
1717
|
+
"object" === typeof options && options.hasOwnProperty("crossOrigin") ? console.error(
|
|
1718
|
+
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
|
1719
|
+
getValueDescriptorExpectingEnumForWarning(options)
|
|
1720
|
+
) : console.error(
|
|
1721
|
+
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
|
1722
|
+
getValueDescriptorExpectingEnumForWarning(options)
|
|
1723
|
+
);
|
|
1724
|
+
}
|
|
1725
|
+
"string" === typeof href && Internals.d.D(href);
|
|
1726
|
+
};
|
|
1727
|
+
exports.preinit = function(href, options) {
|
|
1728
|
+
"string" === typeof href && href ? null == options || "object" !== typeof options ? console.error(
|
|
1729
|
+
"ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",
|
|
1730
|
+
getValueDescriptorExpectingEnumForWarning(options)
|
|
1731
|
+
) : "style" !== options.as && "script" !== options.as && console.error(
|
|
1732
|
+
'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',
|
|
1733
|
+
getValueDescriptorExpectingEnumForWarning(options.as)
|
|
1734
|
+
) : console.error(
|
|
1735
|
+
"ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
1736
|
+
getValueDescriptorExpectingObjectForWarning(href)
|
|
1737
|
+
);
|
|
1738
|
+
if ("string" === typeof href && options && "string" === typeof options.as) {
|
|
1739
|
+
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
|
|
1740
|
+
"style" === as ? Internals.d.S(
|
|
1741
|
+
href,
|
|
1742
|
+
"string" === typeof options.precedence ? options.precedence : void 0,
|
|
1743
|
+
{
|
|
1744
|
+
crossOrigin,
|
|
1745
|
+
integrity,
|
|
1746
|
+
fetchPriority
|
|
1747
|
+
}
|
|
1748
|
+
) : "script" === as && Internals.d.X(href, {
|
|
1749
|
+
crossOrigin,
|
|
1750
|
+
integrity,
|
|
1751
|
+
fetchPriority,
|
|
1752
|
+
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
1665
1753
|
});
|
|
1666
|
-
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
1667
|
-
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
1668
|
-
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
1669
|
-
isStaticChildren,
|
|
1670
|
-
children,
|
|
1671
|
-
keys,
|
|
1672
|
-
children
|
|
1673
|
-
), didWarnAboutKeySpread[children + isStaticChildren] = true);
|
|
1674
1754
|
}
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1755
|
+
};
|
|
1756
|
+
exports.preinitModule = function(href, options) {
|
|
1757
|
+
var encountered = "";
|
|
1758
|
+
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
|
1759
|
+
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "script" !== options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingEnumForWarning(options.as) + ".");
|
|
1760
|
+
if (encountered)
|
|
1761
|
+
console.error(
|
|
1762
|
+
"ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",
|
|
1763
|
+
encountered
|
|
1764
|
+
);
|
|
1765
|
+
else
|
|
1766
|
+
switch (encountered = options && "string" === typeof options.as ? options.as : "script", encountered) {
|
|
1767
|
+
case "script":
|
|
1768
|
+
break;
|
|
1769
|
+
default:
|
|
1770
|
+
encountered = getValueDescriptorExpectingEnumForWarning(encountered), console.error(
|
|
1771
|
+
'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',
|
|
1772
|
+
encountered,
|
|
1773
|
+
href
|
|
1774
|
+
);
|
|
1775
|
+
}
|
|
1776
|
+
if ("string" === typeof href)
|
|
1777
|
+
if ("object" === typeof options && null !== options) {
|
|
1778
|
+
if (null == options.as || "script" === options.as)
|
|
1779
|
+
encountered = getCrossOriginStringAs(
|
|
1780
|
+
options.as,
|
|
1781
|
+
options.crossOrigin
|
|
1782
|
+
), Internals.d.M(href, {
|
|
1783
|
+
crossOrigin: encountered,
|
|
1784
|
+
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
1785
|
+
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
1786
|
+
});
|
|
1787
|
+
} else null == options && Internals.d.M(href);
|
|
1788
|
+
};
|
|
1789
|
+
exports.preload = function(href, options) {
|
|
1790
|
+
var encountered = "";
|
|
1791
|
+
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
|
1792
|
+
null == options || "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : "string" === typeof options.as && options.as || (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
|
1793
|
+
encountered && console.error(
|
|
1794
|
+
'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',
|
|
1795
|
+
encountered
|
|
1686
1796
|
);
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1797
|
+
if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
|
|
1798
|
+
encountered = options.as;
|
|
1799
|
+
var crossOrigin = getCrossOriginStringAs(
|
|
1800
|
+
encountered,
|
|
1801
|
+
options.crossOrigin
|
|
1802
|
+
);
|
|
1803
|
+
Internals.d.L(href, encountered, {
|
|
1804
|
+
crossOrigin,
|
|
1805
|
+
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
1806
|
+
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
|
|
1807
|
+
type: "string" === typeof options.type ? options.type : void 0,
|
|
1808
|
+
fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
|
|
1809
|
+
referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
|
|
1810
|
+
imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
|
|
1811
|
+
imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
|
|
1812
|
+
media: "string" === typeof options.media ? options.media : void 0
|
|
1813
|
+
});
|
|
1814
|
+
}
|
|
1815
|
+
};
|
|
1816
|
+
exports.preloadModule = function(href, options) {
|
|
1817
|
+
var encountered = "";
|
|
1818
|
+
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
|
1819
|
+
void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "string" !== typeof options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
|
1820
|
+
encountered && console.error(
|
|
1821
|
+
'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',
|
|
1822
|
+
encountered
|
|
1694
1823
|
);
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1824
|
+
"string" === typeof href && (options ? (encountered = getCrossOriginStringAs(
|
|
1825
|
+
options.as,
|
|
1826
|
+
options.crossOrigin
|
|
1827
|
+
), Internals.d.m(href, {
|
|
1828
|
+
as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
|
|
1829
|
+
crossOrigin: encountered,
|
|
1830
|
+
integrity: "string" === typeof options.integrity ? options.integrity : void 0
|
|
1831
|
+
})) : Internals.d.m(href));
|
|
1832
|
+
};
|
|
1833
|
+
exports.requestFormReset = function(form) {
|
|
1834
|
+
Internals.d.r(form);
|
|
1704
1835
|
};
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
return callStackForError();
|
|
1708
|
-
}
|
|
1836
|
+
exports.unstable_batchedUpdates = function(fn, a) {
|
|
1837
|
+
return fn(a);
|
|
1709
1838
|
};
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
var unknownOwnerDebugStack = React45.react_stack_bottom_frame.bind(
|
|
1713
|
-
React45,
|
|
1714
|
-
UnknownOwner
|
|
1715
|
-
)();
|
|
1716
|
-
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
1717
|
-
var didWarnAboutKeySpread = {};
|
|
1718
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
1719
|
-
exports.jsx = function(type, config, maybeKey) {
|
|
1720
|
-
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
1721
|
-
return jsxDEVImpl(
|
|
1722
|
-
type,
|
|
1723
|
-
config,
|
|
1724
|
-
maybeKey,
|
|
1725
|
-
false,
|
|
1726
|
-
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
1727
|
-
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
1728
|
-
);
|
|
1839
|
+
exports.useFormState = function(action, initialState2, permalink) {
|
|
1840
|
+
return resolveDispatcher().useFormState(action, initialState2, permalink);
|
|
1729
1841
|
};
|
|
1730
|
-
exports.
|
|
1731
|
-
|
|
1732
|
-
return jsxDEVImpl(
|
|
1733
|
-
type,
|
|
1734
|
-
config,
|
|
1735
|
-
maybeKey,
|
|
1736
|
-
true,
|
|
1737
|
-
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
1738
|
-
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
1739
|
-
);
|
|
1842
|
+
exports.useFormStatus = function() {
|
|
1843
|
+
return resolveDispatcher().useHostTransitionStatus();
|
|
1740
1844
|
};
|
|
1845
|
+
exports.version = "19.2.4";
|
|
1846
|
+
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1741
1847
|
})();
|
|
1742
1848
|
}
|
|
1743
1849
|
});
|
|
1744
1850
|
|
|
1745
|
-
// node_modules/react/
|
|
1746
|
-
var
|
|
1747
|
-
"node_modules/react/
|
|
1851
|
+
// node_modules/react-dom/index.js
|
|
1852
|
+
var require_react_dom = __commonJS({
|
|
1853
|
+
"node_modules/react-dom/index.js"(exports, module) {
|
|
1748
1854
|
"use strict";
|
|
1855
|
+
function checkDCE() {
|
|
1856
|
+
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") {
|
|
1857
|
+
return;
|
|
1858
|
+
}
|
|
1859
|
+
if (process.env.NODE_ENV !== "production") {
|
|
1860
|
+
throw new Error("^_^");
|
|
1861
|
+
}
|
|
1862
|
+
try {
|
|
1863
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
|
|
1864
|
+
} catch (err) {
|
|
1865
|
+
console.error(err);
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1749
1868
|
if (process.env.NODE_ENV === "production") {
|
|
1750
|
-
|
|
1869
|
+
checkDCE();
|
|
1870
|
+
module.exports = require_react_dom_production();
|
|
1751
1871
|
} else {
|
|
1752
|
-
module.exports =
|
|
1872
|
+
module.exports = require_react_dom_development();
|
|
1753
1873
|
}
|
|
1754
1874
|
}
|
|
1755
1875
|
});
|
|
1756
1876
|
|
|
1757
|
-
// node_modules/react
|
|
1758
|
-
var
|
|
1759
|
-
"node_modules/react
|
|
1877
|
+
// node_modules/react/cjs/react-jsx-runtime.production.js
|
|
1878
|
+
var require_react_jsx_runtime_production = __commonJS({
|
|
1879
|
+
"node_modules/react/cjs/react-jsx-runtime.production.js"(exports) {
|
|
1760
1880
|
"use strict";
|
|
1761
|
-
var
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
var Internals = {
|
|
1774
|
-
d: {
|
|
1775
|
-
f: noop,
|
|
1776
|
-
r: function() {
|
|
1777
|
-
throw Error(formatProdErrorMessage(522));
|
|
1778
|
-
},
|
|
1779
|
-
D: noop,
|
|
1780
|
-
C: noop,
|
|
1781
|
-
L: noop,
|
|
1782
|
-
m: noop,
|
|
1783
|
-
X: noop,
|
|
1784
|
-
S: noop,
|
|
1785
|
-
M: noop
|
|
1786
|
-
},
|
|
1787
|
-
p: 0,
|
|
1788
|
-
findDOMNode: null
|
|
1789
|
-
};
|
|
1790
|
-
var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
|
|
1791
|
-
function createPortal$1(children, containerInfo, implementation) {
|
|
1792
|
-
var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
|
|
1881
|
+
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
|
|
1882
|
+
var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
1883
|
+
function jsxProd(type, config, maybeKey) {
|
|
1884
|
+
var key = null;
|
|
1885
|
+
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
1886
|
+
void 0 !== config.key && (key = "" + config.key);
|
|
1887
|
+
if ("key" in config) {
|
|
1888
|
+
maybeKey = {};
|
|
1889
|
+
for (var propName in config)
|
|
1890
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
1891
|
+
} else maybeKey = config;
|
|
1892
|
+
config = maybeKey.ref;
|
|
1793
1893
|
return {
|
|
1794
|
-
$$typeof:
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1894
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
1895
|
+
type,
|
|
1896
|
+
key,
|
|
1897
|
+
ref: void 0 !== config ? config : null,
|
|
1898
|
+
props: maybeKey
|
|
1799
1899
|
};
|
|
1800
1900
|
}
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
if ("string" === typeof input)
|
|
1805
|
-
return "use-credentials" === input ? input : "";
|
|
1806
|
-
}
|
|
1807
|
-
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
|
|
1808
|
-
exports.createPortal = function(children, container) {
|
|
1809
|
-
var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
|
|
1810
|
-
if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType)
|
|
1811
|
-
throw Error(formatProdErrorMessage(299));
|
|
1812
|
-
return createPortal$1(children, container, null, key);
|
|
1813
|
-
};
|
|
1814
|
-
exports.flushSync = function(fn) {
|
|
1815
|
-
var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
|
|
1816
|
-
try {
|
|
1817
|
-
if (ReactSharedInternals.T = null, Internals.p = 2, fn) return fn();
|
|
1818
|
-
} finally {
|
|
1819
|
-
ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f();
|
|
1820
|
-
}
|
|
1821
|
-
};
|
|
1822
|
-
exports.preconnect = function(href, options) {
|
|
1823
|
-
"string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
|
|
1824
|
-
};
|
|
1825
|
-
exports.prefetchDNS = function(href) {
|
|
1826
|
-
"string" === typeof href && Internals.d.D(href);
|
|
1827
|
-
};
|
|
1828
|
-
exports.preinit = function(href, options) {
|
|
1829
|
-
if ("string" === typeof href && options && "string" === typeof options.as) {
|
|
1830
|
-
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
|
|
1831
|
-
"style" === as ? Internals.d.S(
|
|
1832
|
-
href,
|
|
1833
|
-
"string" === typeof options.precedence ? options.precedence : void 0,
|
|
1834
|
-
{
|
|
1835
|
-
crossOrigin,
|
|
1836
|
-
integrity,
|
|
1837
|
-
fetchPriority
|
|
1838
|
-
}
|
|
1839
|
-
) : "script" === as && Internals.d.X(href, {
|
|
1840
|
-
crossOrigin,
|
|
1841
|
-
integrity,
|
|
1842
|
-
fetchPriority,
|
|
1843
|
-
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
1844
|
-
});
|
|
1845
|
-
}
|
|
1846
|
-
};
|
|
1847
|
-
exports.preinitModule = function(href, options) {
|
|
1848
|
-
if ("string" === typeof href)
|
|
1849
|
-
if ("object" === typeof options && null !== options) {
|
|
1850
|
-
if (null == options.as || "script" === options.as) {
|
|
1851
|
-
var crossOrigin = getCrossOriginStringAs(
|
|
1852
|
-
options.as,
|
|
1853
|
-
options.crossOrigin
|
|
1854
|
-
);
|
|
1855
|
-
Internals.d.M(href, {
|
|
1856
|
-
crossOrigin,
|
|
1857
|
-
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
1858
|
-
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
1859
|
-
});
|
|
1860
|
-
}
|
|
1861
|
-
} else null == options && Internals.d.M(href);
|
|
1862
|
-
};
|
|
1863
|
-
exports.preload = function(href, options) {
|
|
1864
|
-
if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
|
|
1865
|
-
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
|
|
1866
|
-
Internals.d.L(href, as, {
|
|
1867
|
-
crossOrigin,
|
|
1868
|
-
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
1869
|
-
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
|
|
1870
|
-
type: "string" === typeof options.type ? options.type : void 0,
|
|
1871
|
-
fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
|
|
1872
|
-
referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
|
|
1873
|
-
imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
|
|
1874
|
-
imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
|
|
1875
|
-
media: "string" === typeof options.media ? options.media : void 0
|
|
1876
|
-
});
|
|
1877
|
-
}
|
|
1878
|
-
};
|
|
1879
|
-
exports.preloadModule = function(href, options) {
|
|
1880
|
-
if ("string" === typeof href)
|
|
1881
|
-
if (options) {
|
|
1882
|
-
var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
|
|
1883
|
-
Internals.d.m(href, {
|
|
1884
|
-
as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
|
|
1885
|
-
crossOrigin,
|
|
1886
|
-
integrity: "string" === typeof options.integrity ? options.integrity : void 0
|
|
1887
|
-
});
|
|
1888
|
-
} else Internals.d.m(href);
|
|
1889
|
-
};
|
|
1890
|
-
exports.requestFormReset = function(form) {
|
|
1891
|
-
Internals.d.r(form);
|
|
1892
|
-
};
|
|
1893
|
-
exports.unstable_batchedUpdates = function(fn, a) {
|
|
1894
|
-
return fn(a);
|
|
1895
|
-
};
|
|
1896
|
-
exports.useFormState = function(action, initialState2, permalink) {
|
|
1897
|
-
return ReactSharedInternals.H.useFormState(action, initialState2, permalink);
|
|
1898
|
-
};
|
|
1899
|
-
exports.useFormStatus = function() {
|
|
1900
|
-
return ReactSharedInternals.H.useHostTransitionStatus();
|
|
1901
|
-
};
|
|
1902
|
-
exports.version = "19.2.4";
|
|
1901
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
1902
|
+
exports.jsx = jsxProd;
|
|
1903
|
+
exports.jsxs = jsxProd;
|
|
1903
1904
|
}
|
|
1904
1905
|
});
|
|
1905
1906
|
|
|
1906
|
-
// node_modules/react
|
|
1907
|
-
var
|
|
1908
|
-
"node_modules/react
|
|
1907
|
+
// node_modules/react/cjs/react-jsx-runtime.development.js
|
|
1908
|
+
var require_react_jsx_runtime_development = __commonJS({
|
|
1909
|
+
"node_modules/react/cjs/react-jsx-runtime.development.js"(exports) {
|
|
1909
1910
|
"use strict";
|
|
1910
1911
|
"production" !== process.env.NODE_ENV && (function() {
|
|
1911
|
-
function
|
|
1912
|
+
function getComponentNameFromType(type) {
|
|
1913
|
+
if (null == type) return null;
|
|
1914
|
+
if ("function" === typeof type)
|
|
1915
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
|
|
1916
|
+
if ("string" === typeof type) return type;
|
|
1917
|
+
switch (type) {
|
|
1918
|
+
case REACT_FRAGMENT_TYPE:
|
|
1919
|
+
return "Fragment";
|
|
1920
|
+
case REACT_PROFILER_TYPE:
|
|
1921
|
+
return "Profiler";
|
|
1922
|
+
case REACT_STRICT_MODE_TYPE:
|
|
1923
|
+
return "StrictMode";
|
|
1924
|
+
case REACT_SUSPENSE_TYPE:
|
|
1925
|
+
return "Suspense";
|
|
1926
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
1927
|
+
return "SuspenseList";
|
|
1928
|
+
case REACT_ACTIVITY_TYPE:
|
|
1929
|
+
return "Activity";
|
|
1930
|
+
}
|
|
1931
|
+
if ("object" === typeof type)
|
|
1932
|
+
switch ("number" === typeof type.tag && console.error(
|
|
1933
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
1934
|
+
), type.$$typeof) {
|
|
1935
|
+
case REACT_PORTAL_TYPE:
|
|
1936
|
+
return "Portal";
|
|
1937
|
+
case REACT_CONTEXT_TYPE:
|
|
1938
|
+
return type.displayName || "Context";
|
|
1939
|
+
case REACT_CONSUMER_TYPE:
|
|
1940
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
|
1941
|
+
case REACT_FORWARD_REF_TYPE:
|
|
1942
|
+
var innerType = type.render;
|
|
1943
|
+
type = type.displayName;
|
|
1944
|
+
type || (type = innerType.displayName || innerType.name || "", type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef");
|
|
1945
|
+
return type;
|
|
1946
|
+
case REACT_MEMO_TYPE:
|
|
1947
|
+
return innerType = type.displayName || null, null !== innerType ? innerType : getComponentNameFromType(type.type) || "Memo";
|
|
1948
|
+
case REACT_LAZY_TYPE:
|
|
1949
|
+
innerType = type._payload;
|
|
1950
|
+
type = type._init;
|
|
1951
|
+
try {
|
|
1952
|
+
return getComponentNameFromType(type(innerType));
|
|
1953
|
+
} catch (x) {
|
|
1954
|
+
}
|
|
1955
|
+
}
|
|
1956
|
+
return null;
|
|
1912
1957
|
}
|
|
1913
1958
|
function testStringCoercion(value) {
|
|
1914
1959
|
return "" + value;
|
|
1915
1960
|
}
|
|
1916
|
-
function
|
|
1917
|
-
var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
|
|
1961
|
+
function checkKeyStringCoercion(value) {
|
|
1918
1962
|
try {
|
|
1919
|
-
testStringCoercion(
|
|
1963
|
+
testStringCoercion(value);
|
|
1920
1964
|
var JSCompiler_inline_result = false;
|
|
1921
1965
|
} catch (e) {
|
|
1922
1966
|
JSCompiler_inline_result = true;
|
|
1923
1967
|
}
|
|
1924
|
-
JSCompiler_inline_result
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
}
|
|
1935
|
-
}
|
|
1936
|
-
function getCrossOriginStringAs(as, input) {
|
|
1937
|
-
if ("font" === as) return "";
|
|
1938
|
-
if ("string" === typeof input)
|
|
1939
|
-
return "use-credentials" === input ? input : "";
|
|
1968
|
+
if (JSCompiler_inline_result) {
|
|
1969
|
+
JSCompiler_inline_result = console;
|
|
1970
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
1971
|
+
var JSCompiler_inline_result$jscomp$0 = "function" === typeof Symbol && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
|
|
1972
|
+
JSCompiler_temp_const.call(
|
|
1973
|
+
JSCompiler_inline_result,
|
|
1974
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
1975
|
+
JSCompiler_inline_result$jscomp$0
|
|
1976
|
+
);
|
|
1977
|
+
return testStringCoercion(value);
|
|
1978
|
+
}
|
|
1940
1979
|
}
|
|
1941
|
-
function
|
|
1942
|
-
|
|
1980
|
+
function getTaskName(type) {
|
|
1981
|
+
if (type === REACT_FRAGMENT_TYPE) return "<>";
|
|
1982
|
+
if ("object" === typeof type && null !== type && type.$$typeof === REACT_LAZY_TYPE)
|
|
1983
|
+
return "<...>";
|
|
1984
|
+
try {
|
|
1985
|
+
var name = getComponentNameFromType(type);
|
|
1986
|
+
return name ? "<" + name + ">" : "<...>";
|
|
1987
|
+
} catch (x) {
|
|
1988
|
+
return "<...>";
|
|
1989
|
+
}
|
|
1943
1990
|
}
|
|
1944
|
-
function
|
|
1945
|
-
|
|
1991
|
+
function getOwner() {
|
|
1992
|
+
var dispatcher = ReactSharedInternals.A;
|
|
1993
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
|
1946
1994
|
}
|
|
1947
|
-
function
|
|
1948
|
-
|
|
1949
|
-
null === dispatcher && console.error(
|
|
1950
|
-
"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
|
|
1951
|
-
);
|
|
1952
|
-
return dispatcher;
|
|
1995
|
+
function UnknownOwner() {
|
|
1996
|
+
return Error("react-stack-top-frame");
|
|
1953
1997
|
}
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
r: function() {
|
|
1959
|
-
throw Error(
|
|
1960
|
-
"Invalid form element. requestFormReset must be passed a form that was rendered by React."
|
|
1961
|
-
);
|
|
1962
|
-
},
|
|
1963
|
-
D: noop,
|
|
1964
|
-
C: noop,
|
|
1965
|
-
L: noop,
|
|
1966
|
-
m: noop,
|
|
1967
|
-
X: noop,
|
|
1968
|
-
S: noop,
|
|
1969
|
-
M: noop
|
|
1970
|
-
},
|
|
1971
|
-
p: 0,
|
|
1972
|
-
findDOMNode: null
|
|
1973
|
-
}, REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), ReactSharedInternals = React45.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
1974
|
-
"function" === typeof Map && null != Map.prototype && "function" === typeof Map.prototype.forEach && "function" === typeof Set && null != Set.prototype && "function" === typeof Set.prototype.clear && "function" === typeof Set.prototype.forEach || console.error(
|
|
1975
|
-
"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
|
|
1976
|
-
);
|
|
1977
|
-
exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
|
|
1978
|
-
exports.createPortal = function(children, container) {
|
|
1979
|
-
var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
|
|
1980
|
-
if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType)
|
|
1981
|
-
throw Error("Target container is not a DOM element.");
|
|
1982
|
-
return createPortal$1(children, container, null, key);
|
|
1983
|
-
};
|
|
1984
|
-
exports.flushSync = function(fn) {
|
|
1985
|
-
var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
|
|
1986
|
-
try {
|
|
1987
|
-
if (ReactSharedInternals.T = null, Internals.p = 2, fn)
|
|
1988
|
-
return fn();
|
|
1989
|
-
} finally {
|
|
1990
|
-
ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f() && console.error(
|
|
1991
|
-
"flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."
|
|
1992
|
-
);
|
|
1993
|
-
}
|
|
1994
|
-
};
|
|
1995
|
-
exports.preconnect = function(href, options) {
|
|
1996
|
-
"string" === typeof href && href ? null != options && "object" !== typeof options ? console.error(
|
|
1997
|
-
"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
|
|
1998
|
-
getValueDescriptorExpectingEnumForWarning(options)
|
|
1999
|
-
) : null != options && "string" !== typeof options.crossOrigin && console.error(
|
|
2000
|
-
"ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
|
|
2001
|
-
getValueDescriptorExpectingObjectForWarning(options.crossOrigin)
|
|
2002
|
-
) : console.error(
|
|
2003
|
-
"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
2004
|
-
getValueDescriptorExpectingObjectForWarning(href)
|
|
2005
|
-
);
|
|
2006
|
-
"string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
|
|
2007
|
-
};
|
|
2008
|
-
exports.prefetchDNS = function(href) {
|
|
2009
|
-
if ("string" !== typeof href || !href)
|
|
2010
|
-
console.error(
|
|
2011
|
-
"ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
2012
|
-
getValueDescriptorExpectingObjectForWarning(href)
|
|
2013
|
-
);
|
|
2014
|
-
else if (1 < arguments.length) {
|
|
2015
|
-
var options = arguments[1];
|
|
2016
|
-
"object" === typeof options && options.hasOwnProperty("crossOrigin") ? console.error(
|
|
2017
|
-
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
|
2018
|
-
getValueDescriptorExpectingEnumForWarning(options)
|
|
2019
|
-
) : console.error(
|
|
2020
|
-
"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
|
|
2021
|
-
getValueDescriptorExpectingEnumForWarning(options)
|
|
2022
|
-
);
|
|
1998
|
+
function hasValidKey(config) {
|
|
1999
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
2000
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
2001
|
+
if (getter && getter.isReactWarning) return false;
|
|
2023
2002
|
}
|
|
2024
|
-
|
|
2025
|
-
}
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
getValueDescriptorExpectingEnumForWarning(options.as)
|
|
2033
|
-
) : console.error(
|
|
2034
|
-
"ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
|
|
2035
|
-
getValueDescriptorExpectingObjectForWarning(href)
|
|
2036
|
-
);
|
|
2037
|
-
if ("string" === typeof href && options && "string" === typeof options.as) {
|
|
2038
|
-
var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
|
|
2039
|
-
"style" === as ? Internals.d.S(
|
|
2040
|
-
href,
|
|
2041
|
-
"string" === typeof options.precedence ? options.precedence : void 0,
|
|
2042
|
-
{
|
|
2043
|
-
crossOrigin,
|
|
2044
|
-
integrity,
|
|
2045
|
-
fetchPriority
|
|
2046
|
-
}
|
|
2047
|
-
) : "script" === as && Internals.d.X(href, {
|
|
2048
|
-
crossOrigin,
|
|
2049
|
-
integrity,
|
|
2050
|
-
fetchPriority,
|
|
2051
|
-
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
2052
|
-
});
|
|
2003
|
+
return void 0 !== config.key;
|
|
2004
|
+
}
|
|
2005
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
2006
|
+
function warnAboutAccessingKey() {
|
|
2007
|
+
specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error(
|
|
2008
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
2009
|
+
displayName
|
|
2010
|
+
));
|
|
2053
2011
|
}
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2012
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
2013
|
+
Object.defineProperty(props, "key", {
|
|
2014
|
+
get: warnAboutAccessingKey,
|
|
2015
|
+
configurable: true
|
|
2016
|
+
});
|
|
2017
|
+
}
|
|
2018
|
+
function elementRefGetterWithDeprecationWarning() {
|
|
2019
|
+
var componentName = getComponentNameFromType(this.type);
|
|
2020
|
+
didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error(
|
|
2021
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
2022
|
+
));
|
|
2023
|
+
componentName = this.props.ref;
|
|
2024
|
+
return void 0 !== componentName ? componentName : null;
|
|
2025
|
+
}
|
|
2026
|
+
function ReactElement(type, key, props, owner, debugStack, debugTask) {
|
|
2027
|
+
var refProp = props.ref;
|
|
2028
|
+
type = {
|
|
2029
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
2030
|
+
type,
|
|
2031
|
+
key,
|
|
2032
|
+
props,
|
|
2033
|
+
_owner: owner
|
|
2034
|
+
};
|
|
2035
|
+
null !== (void 0 !== refProp ? refProp : null) ? Object.defineProperty(type, "ref", {
|
|
2036
|
+
enumerable: false,
|
|
2037
|
+
get: elementRefGetterWithDeprecationWarning
|
|
2038
|
+
}) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
2039
|
+
type._store = {};
|
|
2040
|
+
Object.defineProperty(type._store, "validated", {
|
|
2041
|
+
configurable: false,
|
|
2042
|
+
enumerable: false,
|
|
2043
|
+
writable: true,
|
|
2044
|
+
value: 0
|
|
2045
|
+
});
|
|
2046
|
+
Object.defineProperty(type, "_debugInfo", {
|
|
2047
|
+
configurable: false,
|
|
2048
|
+
enumerable: false,
|
|
2049
|
+
writable: true,
|
|
2050
|
+
value: null
|
|
2051
|
+
});
|
|
2052
|
+
Object.defineProperty(type, "_debugStack", {
|
|
2053
|
+
configurable: false,
|
|
2054
|
+
enumerable: false,
|
|
2055
|
+
writable: true,
|
|
2056
|
+
value: debugStack
|
|
2057
|
+
});
|
|
2058
|
+
Object.defineProperty(type, "_debugTask", {
|
|
2059
|
+
configurable: false,
|
|
2060
|
+
enumerable: false,
|
|
2061
|
+
writable: true,
|
|
2062
|
+
value: debugTask
|
|
2063
|
+
});
|
|
2064
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
2065
|
+
return type;
|
|
2066
|
+
}
|
|
2067
|
+
function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
|
|
2068
|
+
var children = config.children;
|
|
2069
|
+
if (void 0 !== children)
|
|
2070
|
+
if (isStaticChildren)
|
|
2071
|
+
if (isArrayImpl(children)) {
|
|
2072
|
+
for (isStaticChildren = 0; isStaticChildren < children.length; isStaticChildren++)
|
|
2073
|
+
validateChildKeys(children[isStaticChildren]);
|
|
2074
|
+
Object.freeze && Object.freeze(children);
|
|
2075
|
+
} else
|
|
2076
|
+
console.error(
|
|
2077
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
2073
2078
|
);
|
|
2074
|
-
|
|
2075
|
-
if ("
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
options.as,
|
|
2080
|
-
options.crossOrigin
|
|
2081
|
-
), Internals.d.M(href, {
|
|
2082
|
-
crossOrigin: encountered,
|
|
2083
|
-
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
2084
|
-
nonce: "string" === typeof options.nonce ? options.nonce : void 0
|
|
2085
|
-
});
|
|
2086
|
-
} else null == options && Internals.d.M(href);
|
|
2087
|
-
};
|
|
2088
|
-
exports.preload = function(href, options) {
|
|
2089
|
-
var encountered = "";
|
|
2090
|
-
"string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
|
|
2091
|
-
null == options || "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : "string" === typeof options.as && options.as || (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
|
|
2092
|
-
encountered && console.error(
|
|
2093
|
-
'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',
|
|
2094
|
-
encountered
|
|
2095
|
-
);
|
|
2096
|
-
if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
|
|
2097
|
-
encountered = options.as;
|
|
2098
|
-
var crossOrigin = getCrossOriginStringAs(
|
|
2099
|
-
encountered,
|
|
2100
|
-
options.crossOrigin
|
|
2101
|
-
);
|
|
2102
|
-
Internals.d.L(href, encountered, {
|
|
2103
|
-
crossOrigin,
|
|
2104
|
-
integrity: "string" === typeof options.integrity ? options.integrity : void 0,
|
|
2105
|
-
nonce: "string" === typeof options.nonce ? options.nonce : void 0,
|
|
2106
|
-
type: "string" === typeof options.type ? options.type : void 0,
|
|
2107
|
-
fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
|
|
2108
|
-
referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
|
|
2109
|
-
imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
|
|
2110
|
-
imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
|
|
2111
|
-
media: "string" === typeof options.media ? options.media : void 0
|
|
2079
|
+
else validateChildKeys(children);
|
|
2080
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
2081
|
+
children = getComponentNameFromType(type);
|
|
2082
|
+
var keys = Object.keys(config).filter(function(k) {
|
|
2083
|
+
return "key" !== k;
|
|
2112
2084
|
});
|
|
2085
|
+
isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
2086
|
+
didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
2087
|
+
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
2088
|
+
isStaticChildren,
|
|
2089
|
+
children,
|
|
2090
|
+
keys,
|
|
2091
|
+
children
|
|
2092
|
+
), didWarnAboutKeySpread[children + isStaticChildren] = true);
|
|
2113
2093
|
}
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2094
|
+
children = null;
|
|
2095
|
+
void 0 !== maybeKey && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
|
|
2096
|
+
hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
|
|
2097
|
+
if ("key" in config) {
|
|
2098
|
+
maybeKey = {};
|
|
2099
|
+
for (var propName in config)
|
|
2100
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
2101
|
+
} else maybeKey = config;
|
|
2102
|
+
children && defineKeyPropWarningGetter(
|
|
2103
|
+
maybeKey,
|
|
2104
|
+
"function" === typeof type ? type.displayName || type.name || "Unknown" : type
|
|
2122
2105
|
);
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
}
|
|
2132
|
-
|
|
2133
|
-
|
|
2106
|
+
return ReactElement(
|
|
2107
|
+
type,
|
|
2108
|
+
children,
|
|
2109
|
+
maybeKey,
|
|
2110
|
+
getOwner(),
|
|
2111
|
+
debugStack,
|
|
2112
|
+
debugTask
|
|
2113
|
+
);
|
|
2114
|
+
}
|
|
2115
|
+
function validateChildKeys(node) {
|
|
2116
|
+
isValidElement(node) ? node._store && (node._store.validated = 1) : "object" === typeof node && null !== node && node.$$typeof === REACT_LAZY_TYPE && ("fulfilled" === node._payload.status ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
|
|
2117
|
+
}
|
|
2118
|
+
function isValidElement(object) {
|
|
2119
|
+
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
2120
|
+
}
|
|
2121
|
+
var React45 = require_react(), REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference"), ReactSharedInternals = React45.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
|
2122
|
+
return null;
|
|
2134
2123
|
};
|
|
2135
|
-
|
|
2136
|
-
|
|
2124
|
+
React45 = {
|
|
2125
|
+
react_stack_bottom_frame: function(callStackForError) {
|
|
2126
|
+
return callStackForError();
|
|
2127
|
+
}
|
|
2137
2128
|
};
|
|
2138
|
-
|
|
2139
|
-
|
|
2129
|
+
var specialPropKeyWarningShown;
|
|
2130
|
+
var didWarnAboutElementRef = {};
|
|
2131
|
+
var unknownOwnerDebugStack = React45.react_stack_bottom_frame.bind(
|
|
2132
|
+
React45,
|
|
2133
|
+
UnknownOwner
|
|
2134
|
+
)();
|
|
2135
|
+
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
2136
|
+
var didWarnAboutKeySpread = {};
|
|
2137
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
2138
|
+
exports.jsx = function(type, config, maybeKey) {
|
|
2139
|
+
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
2140
|
+
return jsxDEVImpl(
|
|
2141
|
+
type,
|
|
2142
|
+
config,
|
|
2143
|
+
maybeKey,
|
|
2144
|
+
false,
|
|
2145
|
+
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
2146
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
2147
|
+
);
|
|
2140
2148
|
};
|
|
2141
|
-
exports.
|
|
2142
|
-
|
|
2149
|
+
exports.jsxs = function(type, config, maybeKey) {
|
|
2150
|
+
var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
|
|
2151
|
+
return jsxDEVImpl(
|
|
2152
|
+
type,
|
|
2153
|
+
config,
|
|
2154
|
+
maybeKey,
|
|
2155
|
+
true,
|
|
2156
|
+
trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack,
|
|
2157
|
+
trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask
|
|
2158
|
+
);
|
|
2143
2159
|
};
|
|
2144
|
-
exports.version = "19.2.4";
|
|
2145
|
-
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
2146
2160
|
})();
|
|
2147
2161
|
}
|
|
2148
2162
|
});
|
|
2149
2163
|
|
|
2150
|
-
// node_modules/react-
|
|
2151
|
-
var
|
|
2152
|
-
"node_modules/react-
|
|
2164
|
+
// node_modules/react/jsx-runtime.js
|
|
2165
|
+
var require_jsx_runtime = __commonJS({
|
|
2166
|
+
"node_modules/react/jsx-runtime.js"(exports, module) {
|
|
2153
2167
|
"use strict";
|
|
2154
|
-
function checkDCE() {
|
|
2155
|
-
if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") {
|
|
2156
|
-
return;
|
|
2157
|
-
}
|
|
2158
|
-
if (process.env.NODE_ENV !== "production") {
|
|
2159
|
-
throw new Error("^_^");
|
|
2160
|
-
}
|
|
2161
|
-
try {
|
|
2162
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
|
|
2163
|
-
} catch (err) {
|
|
2164
|
-
console.error(err);
|
|
2165
|
-
}
|
|
2166
|
-
}
|
|
2167
2168
|
if (process.env.NODE_ENV === "production") {
|
|
2168
|
-
|
|
2169
|
-
module.exports = require_react_dom_production();
|
|
2169
|
+
module.exports = require_react_jsx_runtime_production();
|
|
2170
2170
|
} else {
|
|
2171
|
-
module.exports =
|
|
2171
|
+
module.exports = require_react_jsx_runtime_development();
|
|
2172
2172
|
}
|
|
2173
2173
|
}
|
|
2174
2174
|
});
|
|
@@ -2181,6 +2181,7 @@ var CodegoUI = (() => {
|
|
|
2181
2181
|
Badge: () => Badge,
|
|
2182
2182
|
Breadcrumb: () => Breadcrumb,
|
|
2183
2183
|
Button: () => Button,
|
|
2184
|
+
COLOR_PALETTE: () => COLOR_PALETTE,
|
|
2184
2185
|
Calendar: () => Calendar,
|
|
2185
2186
|
Card: () => Card,
|
|
2186
2187
|
CardContent: () => CardContent,
|
|
@@ -2250,6 +2251,7 @@ var CodegoUI = (() => {
|
|
|
2250
2251
|
Tabs: () => Tabs,
|
|
2251
2252
|
TagInput: () => TagInput,
|
|
2252
2253
|
Textarea: () => Textarea,
|
|
2254
|
+
ThemeProvider: () => ThemeProvider,
|
|
2253
2255
|
Timeline: () => Timeline,
|
|
2254
2256
|
ToastProvider: () => ToastProvider,
|
|
2255
2257
|
ToggleSwitch: () => ToggleSwitch,
|
|
@@ -2258,6 +2260,7 @@ var CodegoUI = (() => {
|
|
|
2258
2260
|
TreeView: () => TreeView,
|
|
2259
2261
|
Widget: () => Widget,
|
|
2260
2262
|
Wizard: () => Wizard,
|
|
2263
|
+
useTheme: () => useTheme,
|
|
2261
2264
|
useToast: () => useToast
|
|
2262
2265
|
});
|
|
2263
2266
|
|
|
@@ -6032,9 +6035,25 @@ var CodegoUI = (() => {
|
|
|
6032
6035
|
var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
|
|
6033
6036
|
|
|
6034
6037
|
// src/lib/utils.ts
|
|
6038
|
+
var ReactDOM = __toESM(require_react_dom(), 1);
|
|
6035
6039
|
function cn(...inputs) {
|
|
6036
6040
|
return twMerge(clsx(inputs));
|
|
6037
6041
|
}
|
|
6042
|
+
function getPortalPosition(triggerEl, dropdownHeight = 300, preferredPlacement = "bottom") {
|
|
6043
|
+
const r2 = triggerEl.getBoundingClientRect();
|
|
6044
|
+
const spaceBelow = window.innerHeight - r2.bottom;
|
|
6045
|
+
const spaceAbove = r2.top;
|
|
6046
|
+
const placement = preferredPlacement === "bottom" && spaceBelow < dropdownHeight && spaceAbove > spaceBelow ? "top" : preferredPlacement;
|
|
6047
|
+
return {
|
|
6048
|
+
top: placement === "bottom" ? r2.bottom + 4 : r2.top - 4,
|
|
6049
|
+
left: r2.left,
|
|
6050
|
+
width: r2.width,
|
|
6051
|
+
placement
|
|
6052
|
+
};
|
|
6053
|
+
}
|
|
6054
|
+
function FloatingPortal({ children }) {
|
|
6055
|
+
return ReactDOM.createPortal(children, document.body);
|
|
6056
|
+
}
|
|
6038
6057
|
|
|
6039
6058
|
// src/components/ui/accordion.tsx
|
|
6040
6059
|
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
|
@@ -6824,6 +6843,8 @@ var CodegoUI = (() => {
|
|
|
6824
6843
|
const [opacity, setOpacity] = React7.useState(100);
|
|
6825
6844
|
const [recent, setRecent] = React7.useState([]);
|
|
6826
6845
|
const ref = React7.useRef(null);
|
|
6846
|
+
const triggerRef = React7.useRef(null);
|
|
6847
|
+
const [dropStyle, setDropStyle] = React7.useState({});
|
|
6827
6848
|
const color = controlled ?? internal;
|
|
6828
6849
|
React7.useEffect(() => {
|
|
6829
6850
|
setHex(color);
|
|
@@ -6835,6 +6856,19 @@ var CodegoUI = (() => {
|
|
|
6835
6856
|
document.addEventListener("mousedown", handler);
|
|
6836
6857
|
return () => document.removeEventListener("mousedown", handler);
|
|
6837
6858
|
}, []);
|
|
6859
|
+
function openPicker() {
|
|
6860
|
+
if (triggerRef.current) {
|
|
6861
|
+
const pos = getPortalPosition(triggerRef.current, 280);
|
|
6862
|
+
setDropStyle({
|
|
6863
|
+
position: "fixed",
|
|
6864
|
+
top: pos.placement === "bottom" ? pos.top : void 0,
|
|
6865
|
+
bottom: pos.placement === "top" ? window.innerHeight - pos.top : void 0,
|
|
6866
|
+
left: pos.left,
|
|
6867
|
+
zIndex: 9999
|
|
6868
|
+
});
|
|
6869
|
+
}
|
|
6870
|
+
setOpen(true);
|
|
6871
|
+
}
|
|
6838
6872
|
function apply(c) {
|
|
6839
6873
|
if (!controlled) setInternal(c);
|
|
6840
6874
|
onChange?.(c);
|
|
@@ -6849,9 +6883,10 @@ var CodegoUI = (() => {
|
|
|
6849
6883
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
6850
6884
|
"button",
|
|
6851
6885
|
{
|
|
6886
|
+
ref: triggerRef,
|
|
6852
6887
|
type: "button",
|
|
6853
6888
|
disabled,
|
|
6854
|
-
onClick: () => setOpen(
|
|
6889
|
+
onClick: () => open ? setOpen(false) : openPicker(),
|
|
6855
6890
|
className: cn(
|
|
6856
6891
|
"flex items-center gap-2 h-9 px-3 rounded-xl border border-border bg-background text-sm transition-colors hover:border-primary/40 focus:outline-none focus:ring-2 focus:ring-ring",
|
|
6857
6892
|
disabled && "opacity-50 cursor-not-allowed pointer-events-none"
|
|
@@ -6862,7 +6897,7 @@ var CodegoUI = (() => {
|
|
|
6862
6897
|
]
|
|
6863
6898
|
}
|
|
6864
6899
|
),
|
|
6865
|
-
open && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "
|
|
6900
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "w-56 rounded-xl border border-border glass shadow-2xl p-3 space-y-3", style: dropStyle, children: [
|
|
6866
6901
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
6867
6902
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
6868
6903
|
"input",
|
|
@@ -6917,10 +6952,7 @@ var CodegoUI = (() => {
|
|
|
6917
6952
|
apply(s);
|
|
6918
6953
|
setHex(s);
|
|
6919
6954
|
},
|
|
6920
|
-
className: cn(
|
|
6921
|
-
"h-6 w-6 rounded-md border transition-transform hover:scale-110",
|
|
6922
|
-
color === s ? "border-primary ring-1 ring-primary" : "border-border/60"
|
|
6923
|
-
),
|
|
6955
|
+
className: cn("h-6 w-6 rounded-md border transition-transform hover:scale-110", color === s ? "border-primary ring-1 ring-primary" : "border-border/60"),
|
|
6924
6956
|
style: { backgroundColor: s },
|
|
6925
6957
|
title: s
|
|
6926
6958
|
},
|
|
@@ -6944,7 +6976,7 @@ var CodegoUI = (() => {
|
|
|
6944
6976
|
s
|
|
6945
6977
|
)) })
|
|
6946
6978
|
] })
|
|
6947
|
-
] })
|
|
6979
|
+
] }) })
|
|
6948
6980
|
] });
|
|
6949
6981
|
}
|
|
6950
6982
|
|
|
@@ -6970,7 +7002,9 @@ var CodegoUI = (() => {
|
|
|
6970
7002
|
const [open, setOpen] = React8.useState(false);
|
|
6971
7003
|
const [query, setQuery] = React8.useState("");
|
|
6972
7004
|
const ref = React8.useRef(null);
|
|
7005
|
+
const triggerRef = React8.useRef(null);
|
|
6973
7006
|
const inputRef = React8.useRef(null);
|
|
7007
|
+
const [dropStyle, setDropStyle] = React8.useState({});
|
|
6974
7008
|
const selected = controlled ?? internal;
|
|
6975
7009
|
function update(val) {
|
|
6976
7010
|
if (!controlled) setInternal(val);
|
|
@@ -6994,6 +7028,20 @@ var CodegoUI = (() => {
|
|
|
6994
7028
|
e.stopPropagation();
|
|
6995
7029
|
update(multiple ? [] : "");
|
|
6996
7030
|
}
|
|
7031
|
+
const openDropdown = () => {
|
|
7032
|
+
if (triggerRef.current) {
|
|
7033
|
+
const pos = getPortalPosition(triggerRef.current, 300);
|
|
7034
|
+
setDropStyle({
|
|
7035
|
+
position: "fixed",
|
|
7036
|
+
top: pos.placement === "bottom" ? pos.top : void 0,
|
|
7037
|
+
bottom: pos.placement === "top" ? window.innerHeight - pos.top : void 0,
|
|
7038
|
+
left: pos.left,
|
|
7039
|
+
width: pos.width,
|
|
7040
|
+
zIndex: 9999
|
|
7041
|
+
});
|
|
7042
|
+
}
|
|
7043
|
+
setOpen(true);
|
|
7044
|
+
};
|
|
6997
7045
|
React8.useEffect(() => {
|
|
6998
7046
|
function handler(e) {
|
|
6999
7047
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
@@ -7007,13 +7055,10 @@ var CodegoUI = (() => {
|
|
|
7007
7055
|
React8.useEffect(() => {
|
|
7008
7056
|
if (open) setTimeout(() => inputRef.current?.focus(), 50);
|
|
7009
7057
|
}, [open]);
|
|
7010
|
-
const filtered = options.filter(
|
|
7011
|
-
(o) => o.label.toLowerCase().includes(query.toLowerCase())
|
|
7012
|
-
);
|
|
7058
|
+
const filtered = options.filter((o) => o.label.toLowerCase().includes(query.toLowerCase()));
|
|
7013
7059
|
const groups = Array.from(new Set(filtered.map((o) => o.group ?? ""))).filter(Boolean);
|
|
7014
7060
|
const ungrouped = filtered.filter((o) => !o.group);
|
|
7015
7061
|
const showCreate = creatable && query && !options.find((o) => o.label.toLowerCase() === query.toLowerCase());
|
|
7016
|
-
const selectedLabels = multiple ? selected.map((v) => options.find((o) => o.value === v)?.label ?? v) : options.find((o) => o.value === selected)?.label;
|
|
7017
7062
|
const hasValue = multiple ? selected.length > 0 : !!selected;
|
|
7018
7063
|
function renderOptions(opts) {
|
|
7019
7064
|
return opts.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
@@ -7041,9 +7086,10 @@ var CodegoUI = (() => {
|
|
|
7041
7086
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
7042
7087
|
"button",
|
|
7043
7088
|
{
|
|
7089
|
+
ref: triggerRef,
|
|
7044
7090
|
type: "button",
|
|
7045
7091
|
disabled,
|
|
7046
|
-
onClick: () => setOpen(
|
|
7092
|
+
onClick: () => open ? setOpen(false) : openDropdown(),
|
|
7047
7093
|
className: cn(
|
|
7048
7094
|
"flex w-full items-center justify-between gap-2 rounded-xl border border-border bg-background px-3 py-2 text-sm transition-colors",
|
|
7049
7095
|
"hover:border-primary/40 focus:outline-none focus:ring-2 focus:ring-ring",
|
|
@@ -7051,7 +7097,7 @@ var CodegoUI = (() => {
|
|
|
7051
7097
|
disabled && "opacity-50 cursor-not-allowed pointer-events-none"
|
|
7052
7098
|
),
|
|
7053
7099
|
children: [
|
|
7054
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: cn("flex-1 truncate text-left", !hasValue && "text-muted-foreground"), children: multiple ? selected.length > 0 ? `${selected.length} selected` : placeholder :
|
|
7100
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: cn("flex-1 truncate text-left", !hasValue && "text-muted-foreground"), children: multiple ? selected.length > 0 ? `${selected.length} selected` : placeholder : options.find((o) => o.value === selected)?.label || placeholder }),
|
|
7055
7101
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "flex items-center gap-1 shrink-0", children: [
|
|
7056
7102
|
clearable && hasValue && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { onClick: clear, className: "text-muted-foreground hover:text-foreground transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(X, { className: "h-3.5 w-3.5" }) }),
|
|
7057
7103
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ChevronDown, { className: cn("h-4 w-4 text-muted-foreground transition-transform", open && "rotate-180") })
|
|
@@ -7059,50 +7105,57 @@ var CodegoUI = (() => {
|
|
|
7059
7105
|
]
|
|
7060
7106
|
}
|
|
7061
7107
|
),
|
|
7062
|
-
open && /* @__PURE__ */ (0, import_jsx_runtime10.
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7108
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
7109
|
+
"div",
|
|
7110
|
+
{
|
|
7111
|
+
className: "rounded-xl border border-border glass shadow-2xl overflow-hidden",
|
|
7112
|
+
style: dropStyle,
|
|
7113
|
+
children: [
|
|
7114
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex items-center gap-2 border-b border-border px-3 py-2", children: [
|
|
7115
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Search, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
|
|
7116
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
7117
|
+
"input",
|
|
7118
|
+
{
|
|
7119
|
+
ref: inputRef,
|
|
7120
|
+
value: query,
|
|
7121
|
+
onChange: (e) => setQuery(e.target.value),
|
|
7122
|
+
placeholder: searchPlaceholder,
|
|
7123
|
+
className: "flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"
|
|
7124
|
+
}
|
|
7125
|
+
)
|
|
7126
|
+
] }),
|
|
7127
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "overflow-y-auto p-1", style: { maxHeight }, children: [
|
|
7128
|
+
showCreate && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
7129
|
+
"button",
|
|
7130
|
+
{
|
|
7131
|
+
type: "button",
|
|
7132
|
+
onClick: () => {
|
|
7133
|
+
toggle(query);
|
|
7134
|
+
setQuery("");
|
|
7135
|
+
},
|
|
7136
|
+
className: "flex w-full items-center gap-2 px-3 py-2 text-sm rounded-lg hover:bg-accent text-primary",
|
|
7137
|
+
children: [
|
|
7138
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Plus, { className: "h-3.5 w-3.5" }),
|
|
7139
|
+
'Create "',
|
|
7140
|
+
query,
|
|
7141
|
+
'"'
|
|
7142
|
+
]
|
|
7143
|
+
}
|
|
7144
|
+
),
|
|
7145
|
+
groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
7146
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "px-3 py-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground", children: group }),
|
|
7147
|
+
renderOptions(filtered.filter((o) => o.group === group))
|
|
7148
|
+
] }, group)),
|
|
7149
|
+
renderOptions(ungrouped),
|
|
7150
|
+
filtered.length === 0 && !showCreate && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "px-3 py-4 text-center text-sm text-muted-foreground", children: "No results" })
|
|
7151
|
+
] }),
|
|
7152
|
+
multiple && selected.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "border-t border-border px-3 py-2 flex flex-wrap gap-1", children: selected.map((v) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full bg-primary/15 text-primary text-xs px-2 py-0.5", children: [
|
|
7153
|
+
options.find((o) => o.value === v)?.label ?? v,
|
|
7154
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", onClick: () => toggle(v), className: "opacity-60 hover:opacity-100", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(X, { className: "h-3 w-3" }) })
|
|
7155
|
+
] }, v)) })
|
|
7156
|
+
]
|
|
7157
|
+
}
|
|
7158
|
+
) })
|
|
7106
7159
|
] });
|
|
7107
7160
|
}
|
|
7108
7161
|
|
|
@@ -7560,12 +7613,12 @@ var CodegoUI = (() => {
|
|
|
7560
7613
|
const total = data.reduce((s, d) => s + d.value, 0) || 1;
|
|
7561
7614
|
const cx = 80, cy = height / 2, r2 = Math.min(cx, cy) - 10, inner = r2 * 0.58;
|
|
7562
7615
|
let angle = -Math.PI / 2;
|
|
7563
|
-
const
|
|
7616
|
+
const defaultColors = ["primary", "info", "success", "warning", "danger"];
|
|
7564
7617
|
const slices = data.map((d, i) => {
|
|
7565
7618
|
const sweep = d.value / total * 2 * Math.PI;
|
|
7566
7619
|
const start = angle;
|
|
7567
7620
|
angle += sweep;
|
|
7568
|
-
const c = d.color ??
|
|
7621
|
+
const c = d.color ?? defaultColors[i % defaultColors.length];
|
|
7569
7622
|
return { ...d, start, sweep, color: c };
|
|
7570
7623
|
});
|
|
7571
7624
|
const arc = (cx2, cy2, r3, start, end) => {
|
|
@@ -9911,6 +9964,20 @@ var CodegoUI = (() => {
|
|
|
9911
9964
|
return null;
|
|
9912
9965
|
}
|
|
9913
9966
|
}
|
|
9967
|
+
function getAnchorStyle(anchorEl, wide = false) {
|
|
9968
|
+
if (!anchorEl) return { position: "fixed", top: 0, left: 0, zIndex: 9999 };
|
|
9969
|
+
const r2 = anchorEl.getBoundingClientRect();
|
|
9970
|
+
const spaceBelow = window.innerHeight - r2.bottom;
|
|
9971
|
+
const dropH = wide ? 320 : 300;
|
|
9972
|
+
const placement = spaceBelow < dropH && r2.top > spaceBelow ? "top" : "bottom";
|
|
9973
|
+
return {
|
|
9974
|
+
position: "fixed",
|
|
9975
|
+
top: placement === "bottom" ? r2.bottom + 4 : void 0,
|
|
9976
|
+
bottom: placement === "top" ? window.innerHeight - r2.top + 4 : void 0,
|
|
9977
|
+
left: r2.left,
|
|
9978
|
+
zIndex: 9999
|
|
9979
|
+
};
|
|
9980
|
+
}
|
|
9914
9981
|
function TimePicker({
|
|
9915
9982
|
selected,
|
|
9916
9983
|
disabledDateTimes,
|
|
@@ -9976,27 +10043,11 @@ var CodegoUI = (() => {
|
|
|
9976
10043
|
}) {
|
|
9977
10044
|
const days = buildCalendarDays(month);
|
|
9978
10045
|
const isDisabled = (d) => disabledDates?.includes(format(d, "yyyy-MM-dd")) ?? false;
|
|
9979
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "p-3 select-none", children: [
|
|
9980
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [
|
|
9981
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9982
|
-
"button",
|
|
9983
|
-
{
|
|
9984
|
-
type: "button",
|
|
9985
|
-
onClick: onPrevMonth,
|
|
9986
|
-
className: "p-1 rounded hover:bg-white/10 text-muted-foreground hover:text-foreground transition-colors",
|
|
9987
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ChevronLeft, { size: 16 })
|
|
9988
|
-
}
|
|
9989
|
-
),
|
|
10046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "p-3 select-none", children: [
|
|
10047
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [
|
|
10048
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", onClick: onPrevMonth, className: "p-1 rounded hover:bg-white/10 text-muted-foreground hover:text-foreground transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ChevronLeft, { size: 16 }) }),
|
|
9990
10049
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-sm font-semibold text-foreground", children: format(month, "MMMM yyyy") }),
|
|
9991
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
9992
|
-
"button",
|
|
9993
|
-
{
|
|
9994
|
-
type: "button",
|
|
9995
|
-
onClick: onNextMonth,
|
|
9996
|
-
className: "p-1 rounded hover:bg-white/10 text-muted-foreground hover:text-foreground transition-colors",
|
|
9997
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ChevronRight, { size: 16 })
|
|
9998
|
-
}
|
|
9999
|
-
)
|
|
10050
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("button", { type: "button", onClick: onNextMonth, className: "p-1 rounded hover:bg-white/10 text-muted-foreground hover:text-foreground transition-colors", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ChevronRight, { size: 16 }) })
|
|
10000
10051
|
] }),
|
|
10001
10052
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "grid grid-cols-7 mb-1", children: DAYS2.map((d) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "text-center text-xs text-muted-foreground py-1", children: d }, d)) }),
|
|
10002
10053
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "grid grid-cols-7 gap-y-1", children: days.map((d, i) => {
|
|
@@ -10031,136 +10082,44 @@ var CodegoUI = (() => {
|
|
|
10031
10082
|
disabledDates,
|
|
10032
10083
|
disabledDateTimes,
|
|
10033
10084
|
onChange,
|
|
10034
|
-
onClose
|
|
10085
|
+
onClose,
|
|
10086
|
+
anchorEl
|
|
10035
10087
|
}) {
|
|
10036
10088
|
const parsed = parseValue(value, mode);
|
|
10037
10089
|
const [month, setMonth] = React13.useState(parsed ?? /* @__PURE__ */ new Date());
|
|
10038
10090
|
const [selected, setSelected] = React13.useState(parsed);
|
|
10039
|
-
const
|
|
10091
|
+
const anchorStyle = getAnchorStyle(anchorEl ?? null, mode === "dateTime");
|
|
10040
10092
|
const commit = (d) => {
|
|
10041
|
-
if (mode === "date")
|
|
10042
|
-
|
|
10043
|
-
|
|
10044
|
-
onChange(format(d, "yyyy-MM-dd'T'HH:mm"));
|
|
10045
|
-
} else {
|
|
10046
|
-
onChange(format(d, "HH:mm"));
|
|
10047
|
-
}
|
|
10093
|
+
if (mode === "date") onChange(format(d, "yyyy-MM-dd"));
|
|
10094
|
+
else if (mode === "dateTime") onChange(format(d, "yyyy-MM-dd'T'HH:mm"));
|
|
10095
|
+
else onChange(format(d, "HH:mm"));
|
|
10048
10096
|
setSelected(d);
|
|
10049
10097
|
};
|
|
10050
10098
|
const handleDayClick = (d) => {
|
|
10051
10099
|
const base = selected ?? /* @__PURE__ */ new Date();
|
|
10052
|
-
|
|
10053
|
-
commit(merged);
|
|
10100
|
+
commit(setMinutes(setHours(d, getHours(base)), getMinutes(base)));
|
|
10054
10101
|
};
|
|
10055
10102
|
const handleTimeChange = (h, m) => {
|
|
10056
|
-
|
|
10057
|
-
const merged = setMinutes(setHours(base, h), m);
|
|
10058
|
-
commit(merged);
|
|
10103
|
+
commit(setMinutes(setHours(selected ?? /* @__PURE__ */ new Date(), h), m));
|
|
10059
10104
|
};
|
|
10060
10105
|
const datePrefix = selected ? format(selected, "yyyy-MM-dd") : void 0;
|
|
10061
|
-
|
|
10062
|
-
|
|
10063
|
-
|
|
10106
|
+
const footer = (label) => /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "border-t border-white/10 px-3 py-2 flex items-center justify-between", children: [
|
|
10107
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-xs text-muted-foreground", children: label }),
|
|
10108
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
10109
|
+
"button",
|
|
10064
10110
|
{
|
|
10065
|
-
|
|
10066
|
-
|
|
10067
|
-
|
|
10068
|
-
children:
|
|
10069
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex", children: [
|
|
10070
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex-1 min-w-[240px]", children: [
|
|
10071
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-xs font-medium text-muted-foreground px-3 pt-3 pb-1", children: "Date" }),
|
|
10072
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
10073
|
-
Calendar2,
|
|
10074
|
-
{
|
|
10075
|
-
selected,
|
|
10076
|
-
month,
|
|
10077
|
-
disabledDates,
|
|
10078
|
-
onDayClick: handleDayClick,
|
|
10079
|
-
onPrevMonth: () => setMonth((m) => subMonths(m, 1)),
|
|
10080
|
-
onNextMonth: () => setMonth((m) => addMonths(m, 1))
|
|
10081
|
-
}
|
|
10082
|
-
)
|
|
10083
|
-
] }),
|
|
10084
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "w-px bg-white/10 my-3" }),
|
|
10085
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex-1 min-w-[140px] flex flex-col", children: [
|
|
10086
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-xs font-medium text-muted-foreground px-3 pt-3 pb-1", children: "Time" }),
|
|
10087
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex gap-2 px-3 pb-3 flex-1", children: [
|
|
10088
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex-1", children: [
|
|
10089
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-xs text-muted-foreground mb-1 text-center", children: "HH" }),
|
|
10090
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "grid grid-cols-1 gap-1 max-h-52 overflow-y-auto", children: HOURS.map((h) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
10091
|
-
"button",
|
|
10092
|
-
{
|
|
10093
|
-
type: "button",
|
|
10094
|
-
disabled: MINUTES.every((m) => {
|
|
10095
|
-
if (!disabledDateTimes || !datePrefix) return false;
|
|
10096
|
-
return disabledDateTimes.includes(`${datePrefix}T${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}`);
|
|
10097
|
-
}),
|
|
10098
|
-
onClick: () => handleTimeChange(h, selected ? getMinutes(selected) : 0),
|
|
10099
|
-
className: cn(
|
|
10100
|
-
"text-xs rounded py-1 transition-colors",
|
|
10101
|
-
selected && getHours(selected) === h ? "bg-primary text-primary-foreground" : "hover:bg-white/10 text-foreground",
|
|
10102
|
-
MINUTES.every((m) => {
|
|
10103
|
-
if (!disabledDateTimes || !datePrefix) return false;
|
|
10104
|
-
return disabledDateTimes.includes(`${datePrefix}T${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}`);
|
|
10105
|
-
}) && "opacity-30 cursor-not-allowed line-through"
|
|
10106
|
-
),
|
|
10107
|
-
children: String(h).padStart(2, "0")
|
|
10108
|
-
},
|
|
10109
|
-
h
|
|
10110
|
-
)) })
|
|
10111
|
-
] }),
|
|
10112
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "w-12", children: [
|
|
10113
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-xs text-muted-foreground mb-1 text-center", children: "MM" }),
|
|
10114
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "grid grid-cols-1 gap-1 max-h-52 overflow-y-auto", children: MINUTES.map((m) => {
|
|
10115
|
-
const h = selected ? getHours(selected) : 0;
|
|
10116
|
-
const isDisabled = disabledDateTimes && datePrefix ? disabledDateTimes.includes(`${datePrefix}T${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}`) : false;
|
|
10117
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
10118
|
-
"button",
|
|
10119
|
-
{
|
|
10120
|
-
type: "button",
|
|
10121
|
-
disabled: isDisabled,
|
|
10122
|
-
onClick: () => handleTimeChange(h, m),
|
|
10123
|
-
className: cn(
|
|
10124
|
-
"text-xs rounded py-1 transition-colors",
|
|
10125
|
-
selected && getMinutes(selected) === m ? "bg-primary text-primary-foreground" : "hover:bg-white/10 text-foreground",
|
|
10126
|
-
isDisabled && "opacity-30 cursor-not-allowed line-through"
|
|
10127
|
-
),
|
|
10128
|
-
children: [
|
|
10129
|
-
":",
|
|
10130
|
-
String(m).padStart(2, "0")
|
|
10131
|
-
]
|
|
10132
|
-
},
|
|
10133
|
-
m
|
|
10134
|
-
);
|
|
10135
|
-
}) })
|
|
10136
|
-
] })
|
|
10137
|
-
] })
|
|
10138
|
-
] })
|
|
10139
|
-
] }),
|
|
10140
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "border-t border-white/10 px-3 py-2 flex items-center justify-between", children: [
|
|
10141
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-xs text-muted-foreground", children: selected ? format(selected, "MMM d, yyyy HH:mm") : "No date selected" }),
|
|
10142
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
10143
|
-
"button",
|
|
10144
|
-
{
|
|
10145
|
-
type: "button",
|
|
10146
|
-
onClick: onClose,
|
|
10147
|
-
className: "text-xs rounded-lg bg-primary text-primary-foreground px-3 py-1 hover:opacity-90 transition-opacity",
|
|
10148
|
-
children: "Done"
|
|
10149
|
-
}
|
|
10150
|
-
)
|
|
10151
|
-
] })
|
|
10152
|
-
]
|
|
10111
|
+
type: "button",
|
|
10112
|
+
onClick: onClose,
|
|
10113
|
+
className: "text-xs rounded-lg bg-primary text-primary-foreground px-3 py-1 hover:opacity-90 transition-opacity",
|
|
10114
|
+
children: "Done"
|
|
10153
10115
|
}
|
|
10154
|
-
)
|
|
10155
|
-
}
|
|
10156
|
-
|
|
10157
|
-
"div",
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
style: { top: "100%", left: 0 },
|
|
10162
|
-
children: [
|
|
10163
|
-
mode === "date" && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
10116
|
+
)
|
|
10117
|
+
] });
|
|
10118
|
+
if (mode === "dateTime") {
|
|
10119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "rounded-xl border border-white/10 bg-card shadow-xl backdrop-blur-sm", style: anchorStyle, children: [
|
|
10120
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex", children: [
|
|
10121
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex-1 min-w-[240px]", children: [
|
|
10122
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-xs font-medium text-muted-foreground px-3 pt-3 pb-1", children: "Date" }),
|
|
10164
10123
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
10165
10124
|
Calendar2,
|
|
10166
10125
|
{
|
|
@@ -10171,46 +10130,91 @@ var CodegoUI = (() => {
|
|
|
10171
10130
|
onPrevMonth: () => setMonth((m) => subMonths(m, 1)),
|
|
10172
10131
|
onNextMonth: () => setMonth((m) => addMonths(m, 1))
|
|
10173
10132
|
}
|
|
10174
|
-
)
|
|
10175
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "border-t border-white/10 px-3 py-2 flex items-center justify-between", children: [
|
|
10176
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-xs text-muted-foreground", children: selected ? format(selected, "MMM d, yyyy") : "No date selected" }),
|
|
10177
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
10178
|
-
"button",
|
|
10179
|
-
{
|
|
10180
|
-
type: "button",
|
|
10181
|
-
onClick: onClose,
|
|
10182
|
-
className: "text-xs rounded-lg bg-primary text-primary-foreground px-3 py-1 hover:opacity-90 transition-opacity",
|
|
10183
|
-
children: "Done"
|
|
10184
|
-
}
|
|
10185
|
-
)
|
|
10186
|
-
] })
|
|
10133
|
+
)
|
|
10187
10134
|
] }),
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10197
|
-
|
|
10198
|
-
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
|
|
10204
|
-
|
|
10205
|
-
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
|
|
10135
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "w-px bg-white/10 my-3" }),
|
|
10136
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex-1 min-w-[140px] flex flex-col", children: [
|
|
10137
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-xs font-medium text-muted-foreground px-3 pt-3 pb-1", children: "Time" }),
|
|
10138
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex gap-2 px-3 pb-3 flex-1", children: [
|
|
10139
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "flex-1", children: [
|
|
10140
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-xs text-muted-foreground mb-1 text-center", children: "HH" }),
|
|
10141
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "grid grid-cols-1 gap-1 max-h-52 overflow-y-auto", children: HOURS.map((h) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
10142
|
+
"button",
|
|
10143
|
+
{
|
|
10144
|
+
type: "button",
|
|
10145
|
+
disabled: MINUTES.every((m) => {
|
|
10146
|
+
if (!disabledDateTimes || !datePrefix) return false;
|
|
10147
|
+
return disabledDateTimes.includes(`${datePrefix}T${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}`);
|
|
10148
|
+
}),
|
|
10149
|
+
onClick: () => handleTimeChange(h, selected ? getMinutes(selected) : 0),
|
|
10150
|
+
className: cn(
|
|
10151
|
+
"text-xs rounded py-1 transition-colors",
|
|
10152
|
+
selected && getHours(selected) === h ? "bg-primary text-primary-foreground" : "hover:bg-white/10 text-foreground"
|
|
10153
|
+
),
|
|
10154
|
+
children: String(h).padStart(2, "0")
|
|
10155
|
+
},
|
|
10156
|
+
h
|
|
10157
|
+
)) })
|
|
10158
|
+
] }),
|
|
10159
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "w-12", children: [
|
|
10160
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("p", { className: "text-xs text-muted-foreground mb-1 text-center", children: "MM" }),
|
|
10161
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("div", { className: "grid grid-cols-1 gap-1 max-h-52 overflow-y-auto", children: MINUTES.map((m) => {
|
|
10162
|
+
const h = selected ? getHours(selected) : 0;
|
|
10163
|
+
const dis = disabledDateTimes && datePrefix ? disabledDateTimes.includes(`${datePrefix}T${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}`) : false;
|
|
10164
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
|
|
10165
|
+
"button",
|
|
10166
|
+
{
|
|
10167
|
+
type: "button",
|
|
10168
|
+
disabled: dis,
|
|
10169
|
+
onClick: () => handleTimeChange(h, m),
|
|
10170
|
+
className: cn(
|
|
10171
|
+
"text-xs rounded py-1 transition-colors",
|
|
10172
|
+
selected && getMinutes(selected) === m ? "bg-primary text-primary-foreground" : "hover:bg-white/10 text-foreground",
|
|
10173
|
+
dis && "opacity-30 cursor-not-allowed line-through"
|
|
10174
|
+
),
|
|
10175
|
+
children: [
|
|
10176
|
+
":",
|
|
10177
|
+
String(m).padStart(2, "0")
|
|
10178
|
+
]
|
|
10179
|
+
},
|
|
10180
|
+
m
|
|
10181
|
+
);
|
|
10182
|
+
}) })
|
|
10183
|
+
] })
|
|
10209
10184
|
] })
|
|
10210
10185
|
] })
|
|
10211
|
-
]
|
|
10212
|
-
|
|
10213
|
-
|
|
10186
|
+
] }),
|
|
10187
|
+
footer(selected ? format(selected, "MMM d, yyyy HH:mm") : "No date selected")
|
|
10188
|
+
] }) });
|
|
10189
|
+
}
|
|
10190
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "rounded-xl border border-white/10 bg-card shadow-xl backdrop-blur-sm min-w-[260px]", style: anchorStyle, children: [
|
|
10191
|
+
mode === "date" && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
10192
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
10193
|
+
Calendar2,
|
|
10194
|
+
{
|
|
10195
|
+
selected,
|
|
10196
|
+
month,
|
|
10197
|
+
disabledDates,
|
|
10198
|
+
onDayClick: handleDayClick,
|
|
10199
|
+
onPrevMonth: () => setMonth((m) => subMonths(m, 1)),
|
|
10200
|
+
onNextMonth: () => setMonth((m) => addMonths(m, 1))
|
|
10201
|
+
}
|
|
10202
|
+
),
|
|
10203
|
+
footer(selected ? format(selected, "MMM d, yyyy") : "No date selected")
|
|
10204
|
+
] }),
|
|
10205
|
+
mode === "time" && /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
|
|
10206
|
+
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
10207
|
+
TimePicker,
|
|
10208
|
+
{
|
|
10209
|
+
selected,
|
|
10210
|
+
disabledDateTimes,
|
|
10211
|
+
datePrefix,
|
|
10212
|
+
onChange: handleTimeChange
|
|
10213
|
+
}
|
|
10214
|
+
),
|
|
10215
|
+
footer(selected ? format(selected, "HH:mm") : "No time selected")
|
|
10216
|
+
] })
|
|
10217
|
+
] }) });
|
|
10214
10218
|
}
|
|
10215
10219
|
|
|
10216
10220
|
// src/components/ui/date-range-picker.tsx
|
|
@@ -10247,6 +10251,8 @@ var CodegoUI = (() => {
|
|
|
10247
10251
|
const [viewMonth, setViewMonth] = React14.useState(today.getMonth());
|
|
10248
10252
|
const [viewYear, setViewYear] = React14.useState(today.getFullYear());
|
|
10249
10253
|
const ref = React14.useRef(null);
|
|
10254
|
+
const triggerRef = React14.useRef(null);
|
|
10255
|
+
const [dropStyle, setDropStyle] = React14.useState({});
|
|
10250
10256
|
const range2 = controlled ?? internal;
|
|
10251
10257
|
React14.useEffect(() => {
|
|
10252
10258
|
function handler(e) {
|
|
@@ -10259,6 +10265,19 @@ var CodegoUI = (() => {
|
|
|
10259
10265
|
if (!controlled) setInternal(r2);
|
|
10260
10266
|
onChange?.(r2);
|
|
10261
10267
|
}
|
|
10268
|
+
function openPicker() {
|
|
10269
|
+
if (triggerRef.current) {
|
|
10270
|
+
const pos = getPortalPosition(triggerRef.current, 340);
|
|
10271
|
+
setDropStyle({
|
|
10272
|
+
position: "fixed",
|
|
10273
|
+
top: pos.placement === "bottom" ? pos.top : void 0,
|
|
10274
|
+
bottom: pos.placement === "top" ? window.innerHeight - pos.top : void 0,
|
|
10275
|
+
left: pos.left,
|
|
10276
|
+
zIndex: 9999
|
|
10277
|
+
});
|
|
10278
|
+
}
|
|
10279
|
+
setOpen(true);
|
|
10280
|
+
}
|
|
10262
10281
|
function selectDay(d) {
|
|
10263
10282
|
if (selecting === "from") {
|
|
10264
10283
|
update({ from: d, to: null });
|
|
@@ -10293,9 +10312,10 @@ var CodegoUI = (() => {
|
|
|
10293
10312
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
10294
10313
|
"button",
|
|
10295
10314
|
{
|
|
10315
|
+
ref: triggerRef,
|
|
10296
10316
|
type: "button",
|
|
10297
10317
|
disabled,
|
|
10298
|
-
onClick: () => setOpen(
|
|
10318
|
+
onClick: () => open ? setOpen(false) : openPicker(),
|
|
10299
10319
|
className: cn(
|
|
10300
10320
|
"flex w-full items-center gap-2 rounded-xl border border-border bg-background px-3 py-2 text-sm transition-colors",
|
|
10301
10321
|
"hover:border-primary/40 focus:outline-none focus:ring-2 focus:ring-ring",
|
|
@@ -10321,25 +10341,41 @@ var CodegoUI = (() => {
|
|
|
10321
10341
|
]
|
|
10322
10342
|
}
|
|
10323
10343
|
),
|
|
10324
|
-
open && /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "
|
|
10344
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "rounded-xl border border-border glass shadow-2xl p-4 w-72", style: dropStyle, children: [
|
|
10325
10345
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [
|
|
10326
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10346
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
10347
|
+
"button",
|
|
10348
|
+
{
|
|
10349
|
+
type: "button",
|
|
10350
|
+
onClick: () => {
|
|
10351
|
+
if (viewMonth === 0) {
|
|
10352
|
+
setViewMonth(11);
|
|
10353
|
+
setViewYear((y) => y - 1);
|
|
10354
|
+
} else setViewMonth((m) => m - 1);
|
|
10355
|
+
},
|
|
10356
|
+
className: "p-1 rounded-md hover:bg-accent transition-colors",
|
|
10357
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChevronLeft, { className: "h-4 w-4" })
|
|
10358
|
+
}
|
|
10359
|
+
),
|
|
10332
10360
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("span", { className: "text-sm font-semibold", children: [
|
|
10333
10361
|
MONTHS2[viewMonth],
|
|
10334
10362
|
" ",
|
|
10335
10363
|
viewYear
|
|
10336
10364
|
] }),
|
|
10337
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
|
|
10341
|
-
|
|
10342
|
-
|
|
10365
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
10366
|
+
"button",
|
|
10367
|
+
{
|
|
10368
|
+
type: "button",
|
|
10369
|
+
onClick: () => {
|
|
10370
|
+
if (viewMonth === 11) {
|
|
10371
|
+
setViewMonth(0);
|
|
10372
|
+
setViewYear((y) => y + 1);
|
|
10373
|
+
} else setViewMonth((m) => m + 1);
|
|
10374
|
+
},
|
|
10375
|
+
className: "p-1 rounded-md hover:bg-accent transition-colors",
|
|
10376
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChevronRight, { className: "h-4 w-4" })
|
|
10377
|
+
}
|
|
10378
|
+
)
|
|
10343
10379
|
] }),
|
|
10344
10380
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "grid grid-cols-7 mb-1", children: DAYS3.map((d) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "text-center text-[10px] font-semibold text-muted-foreground py-1", children: d }, d)) }),
|
|
10345
10381
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "grid grid-cols-7 gap-y-0.5", children: days.map((d, i) => {
|
|
@@ -10374,7 +10410,7 @@ var CodegoUI = (() => {
|
|
|
10374
10410
|
);
|
|
10375
10411
|
}) }),
|
|
10376
10412
|
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("p", { className: "mt-3 text-center text-xs text-muted-foreground", children: selecting === "from" ? "Select start date" : "Select end date" })
|
|
10377
|
-
] })
|
|
10413
|
+
] }) })
|
|
10378
10414
|
] });
|
|
10379
10415
|
}
|
|
10380
10416
|
|
|
@@ -10475,10 +10511,10 @@ var CodegoUI = (() => {
|
|
|
10475
10511
|
var React16 = __toESM(require_react(), 1);
|
|
10476
10512
|
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
|
|
10477
10513
|
var widthMap = {
|
|
10478
|
-
sm:
|
|
10479
|
-
md:
|
|
10480
|
-
lg:
|
|
10481
|
-
auto:
|
|
10514
|
+
sm: 160,
|
|
10515
|
+
md: 224,
|
|
10516
|
+
lg: 288,
|
|
10517
|
+
auto: void 0
|
|
10482
10518
|
};
|
|
10483
10519
|
function Dropdown({
|
|
10484
10520
|
trigger,
|
|
@@ -10492,25 +10528,40 @@ var CodegoUI = (() => {
|
|
|
10492
10528
|
className
|
|
10493
10529
|
}) {
|
|
10494
10530
|
const [isOpen, setIsOpen] = React16.useState(false);
|
|
10495
|
-
const
|
|
10496
|
-
const
|
|
10531
|
+
const triggerRef = React16.useRef(null);
|
|
10532
|
+
const [dropStyle, setDropStyle] = React16.useState({});
|
|
10533
|
+
const open = () => {
|
|
10497
10534
|
if (disabled) return;
|
|
10498
|
-
|
|
10499
|
-
|
|
10500
|
-
|
|
10535
|
+
if (triggerRef.current) {
|
|
10536
|
+
const r2 = triggerRef.current.getBoundingClientRect();
|
|
10537
|
+
const pos = getPortalPosition(triggerRef.current, 320, placement);
|
|
10538
|
+
const w = widthMap[width];
|
|
10539
|
+
let left = r2.left;
|
|
10540
|
+
if (align === "right") left = r2.right - (w ?? r2.width);
|
|
10541
|
+
if (align === "center") left = r2.left + r2.width / 2 - (w ?? r2.width) / 2;
|
|
10542
|
+
setDropStyle({
|
|
10543
|
+
position: "fixed",
|
|
10544
|
+
top: pos.placement === "bottom" ? pos.top : void 0,
|
|
10545
|
+
bottom: pos.placement === "top" ? window.innerHeight - r2.top + 4 : void 0,
|
|
10546
|
+
left,
|
|
10547
|
+
width: w,
|
|
10548
|
+
minWidth: w ? void 0 : "10rem",
|
|
10549
|
+
zIndex: 9999
|
|
10550
|
+
});
|
|
10551
|
+
}
|
|
10552
|
+
setIsOpen(true);
|
|
10553
|
+
onOpenChange?.(true);
|
|
10501
10554
|
};
|
|
10502
10555
|
const close = () => {
|
|
10503
10556
|
setIsOpen(false);
|
|
10504
10557
|
onOpenChange?.(false);
|
|
10505
10558
|
};
|
|
10506
10559
|
React16.useEffect(() => {
|
|
10507
|
-
const handleClickOutside = (
|
|
10508
|
-
if (
|
|
10509
|
-
close();
|
|
10510
|
-
}
|
|
10560
|
+
const handleClickOutside = (e) => {
|
|
10561
|
+
if (triggerRef.current && !triggerRef.current.contains(e.target)) close();
|
|
10511
10562
|
};
|
|
10512
|
-
const handleKeyDown = (
|
|
10513
|
-
if (
|
|
10563
|
+
const handleKeyDown = (e) => {
|
|
10564
|
+
if (e.key === "Escape") close();
|
|
10514
10565
|
};
|
|
10515
10566
|
document.addEventListener("mousedown", handleClickOutside);
|
|
10516
10567
|
document.addEventListener("keydown", handleKeyDown);
|
|
@@ -10519,39 +10570,30 @@ var CodegoUI = (() => {
|
|
|
10519
10570
|
document.removeEventListener("keydown", handleKeyDown);
|
|
10520
10571
|
};
|
|
10521
10572
|
}, [isOpen]);
|
|
10522
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "relative inline-block text-left", ref:
|
|
10573
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "relative inline-block text-left", ref: triggerRef, children: [
|
|
10523
10574
|
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
10524
10575
|
"div",
|
|
10525
10576
|
{
|
|
10526
|
-
onClick:
|
|
10577
|
+
onClick: () => isOpen ? close() : open(),
|
|
10527
10578
|
"aria-expanded": isOpen,
|
|
10528
10579
|
"aria-haspopup": "true",
|
|
10529
10580
|
className: cn(disabled && "opacity-50 cursor-not-allowed pointer-events-none"),
|
|
10530
10581
|
children: trigger
|
|
10531
10582
|
}
|
|
10532
10583
|
),
|
|
10533
|
-
isOpen && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
10584
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
10534
10585
|
"div",
|
|
10535
10586
|
{
|
|
10536
10587
|
className: cn(
|
|
10537
|
-
"
|
|
10588
|
+
"rounded-xl border border-white/10 bg-background/90 backdrop-blur-2xl text-popover-foreground",
|
|
10538
10589
|
"shadow-[0_8px_32px_rgba(0,0,0,0.35)] ring-1 ring-white/5",
|
|
10539
10590
|
"animate-in fade-in-0 zoom-in-95 duration-150",
|
|
10540
|
-
widthMap[width],
|
|
10541
|
-
placement === "top" ? "bottom-full mb-2" : "top-full mt-2",
|
|
10542
|
-
align === "right" ? "right-0" : align === "center" ? "left-1/2 -translate-x-1/2" : "left-0",
|
|
10543
10591
|
className
|
|
10544
10592
|
),
|
|
10545
|
-
|
|
10546
|
-
|
|
10547
|
-
{
|
|
10548
|
-
className: "py-1.5",
|
|
10549
|
-
onClick: closeOnSelect ? close : void 0,
|
|
10550
|
-
children
|
|
10551
|
-
}
|
|
10552
|
-
)
|
|
10593
|
+
style: dropStyle,
|
|
10594
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "py-1.5", onClick: closeOnSelect ? close : void 0, children })
|
|
10553
10595
|
}
|
|
10554
|
-
)
|
|
10596
|
+
) })
|
|
10555
10597
|
] });
|
|
10556
10598
|
}
|
|
10557
10599
|
function DropdownItem({
|
|
@@ -10584,10 +10626,7 @@ var CodegoUI = (() => {
|
|
|
10584
10626
|
function DropdownSeparator({ className }) {
|
|
10585
10627
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: cn("my-1.5 h-px bg-white/8", className) });
|
|
10586
10628
|
}
|
|
10587
|
-
function DropdownLabel({
|
|
10588
|
-
children,
|
|
10589
|
-
className
|
|
10590
|
-
}) {
|
|
10629
|
+
function DropdownLabel({ children, className }) {
|
|
10591
10630
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: cn("px-3.5 py-1.5 text-xs font-semibold uppercase tracking-wider text-muted-foreground/60", className), children });
|
|
10592
10631
|
}
|
|
10593
10632
|
|
|
@@ -11448,6 +11487,7 @@ var CodegoUI = (() => {
|
|
|
11448
11487
|
value: internalValue,
|
|
11449
11488
|
disabledDates,
|
|
11450
11489
|
disabledDateTimes,
|
|
11490
|
+
anchorEl: containerRef.current,
|
|
11451
11491
|
onChange: (v) => {
|
|
11452
11492
|
setInternalValue(v);
|
|
11453
11493
|
setValidationError(null);
|
|
@@ -11835,30 +11875,43 @@ var CodegoUI = (() => {
|
|
|
11835
11875
|
const [search, setSearch] = React23.useState("");
|
|
11836
11876
|
const [isSearching, setIsSearching] = React23.useState(false);
|
|
11837
11877
|
const containerRef = React23.useRef(null);
|
|
11878
|
+
const triggerRef = React23.useRef(null);
|
|
11879
|
+
const [dropStyle, setDropStyle] = React23.useState({});
|
|
11838
11880
|
const getKey = (opt) => String(Object.keys(opt)[0]);
|
|
11839
11881
|
const getLabel = (opt) => Object.values(opt)[0];
|
|
11840
11882
|
const selectedValues = React23.useMemo(() => {
|
|
11841
|
-
if (multiple && Array.isArray(value))
|
|
11842
|
-
|
|
11843
|
-
} else if (typeof value === "string") {
|
|
11844
|
-
return [value];
|
|
11845
|
-
}
|
|
11883
|
+
if (multiple && Array.isArray(value)) return value;
|
|
11884
|
+
if (typeof value === "string") return [value];
|
|
11846
11885
|
return [];
|
|
11847
11886
|
}, [value, multiple]);
|
|
11848
|
-
const selectedOptions = React23.useMemo(
|
|
11849
|
-
|
|
11850
|
-
|
|
11851
|
-
|
|
11852
|
-
|
|
11853
|
-
)
|
|
11887
|
+
const selectedOptions = React23.useMemo(
|
|
11888
|
+
() => options.filter((opt) => selectedValues.includes(getKey(opt))),
|
|
11889
|
+
[options, selectedValues]
|
|
11890
|
+
);
|
|
11891
|
+
const filteredOptions = searchable ? options.filter((opt) => getLabel(opt).toLowerCase().includes(search.toLowerCase())) : options;
|
|
11892
|
+
const openDropdown = () => {
|
|
11893
|
+
if (disabled) return;
|
|
11894
|
+
if (triggerRef.current) {
|
|
11895
|
+
const pos = getPortalPosition(triggerRef.current, 260);
|
|
11896
|
+
setDropStyle({
|
|
11897
|
+
position: "fixed",
|
|
11898
|
+
top: pos.placement === "bottom" ? pos.top : void 0,
|
|
11899
|
+
bottom: pos.placement === "top" ? window.innerHeight - pos.top : void 0,
|
|
11900
|
+
left: pos.left,
|
|
11901
|
+
width: pos.width,
|
|
11902
|
+
zIndex: 9999
|
|
11903
|
+
});
|
|
11904
|
+
}
|
|
11905
|
+
setIsOpen(true);
|
|
11906
|
+
};
|
|
11854
11907
|
React23.useEffect(() => {
|
|
11855
|
-
const
|
|
11856
|
-
if (containerRef.current && !containerRef.current.contains(
|
|
11908
|
+
const handler = (e) => {
|
|
11909
|
+
if (containerRef.current && !containerRef.current.contains(e.target)) {
|
|
11857
11910
|
setIsOpen(false);
|
|
11858
11911
|
}
|
|
11859
11912
|
};
|
|
11860
|
-
document.addEventListener("mousedown",
|
|
11861
|
-
return () => document.removeEventListener("mousedown",
|
|
11913
|
+
document.addEventListener("mousedown", handler);
|
|
11914
|
+
return () => document.removeEventListener("mousedown", handler);
|
|
11862
11915
|
}, []);
|
|
11863
11916
|
const handleSelect = (optionValue) => {
|
|
11864
11917
|
if (multiple) {
|
|
@@ -11872,10 +11925,7 @@ var CodegoUI = (() => {
|
|
|
11872
11925
|
};
|
|
11873
11926
|
const handleRemove = (optionValue, e) => {
|
|
11874
11927
|
e.stopPropagation();
|
|
11875
|
-
if (multiple)
|
|
11876
|
-
const newValues = selectedValues.filter((v) => v !== optionValue);
|
|
11877
|
-
onChange?.(newValues);
|
|
11878
|
-
}
|
|
11928
|
+
if (multiple) onChange?.(selectedValues.filter((v) => v !== optionValue));
|
|
11879
11929
|
};
|
|
11880
11930
|
const handleReorder = (fromIndex, toIndex) => {
|
|
11881
11931
|
if (!multiple || !reorderable || !Array.isArray(value)) return;
|
|
@@ -11889,16 +11939,13 @@ var CodegoUI = (() => {
|
|
|
11889
11939
|
e.dataTransfer.setData("text/plain", index.toString());
|
|
11890
11940
|
};
|
|
11891
11941
|
const handleDragOver = (e) => {
|
|
11892
|
-
if (
|
|
11893
|
-
e.preventDefault();
|
|
11942
|
+
if (reorderable) e.preventDefault();
|
|
11894
11943
|
};
|
|
11895
11944
|
const handleDrop = (e, toIndex) => {
|
|
11896
11945
|
if (!reorderable) return;
|
|
11897
11946
|
e.preventDefault();
|
|
11898
11947
|
const fromIndex = parseInt(e.dataTransfer.getData("text/plain"));
|
|
11899
|
-
if (fromIndex !== toIndex)
|
|
11900
|
-
handleReorder(fromIndex, toIndex);
|
|
11901
|
-
}
|
|
11948
|
+
if (fromIndex !== toIndex) handleReorder(fromIndex, toIndex);
|
|
11902
11949
|
};
|
|
11903
11950
|
if (native) {
|
|
11904
11951
|
if (multiple) {
|
|
@@ -11908,58 +11955,29 @@ var CodegoUI = (() => {
|
|
|
11908
11955
|
"w-full rounded-xl border border-slate-900/30 bg-background/50 backdrop-blur-sm overflow-hidden ring-offset-background focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
|
|
11909
11956
|
disabled && "opacity-50 pointer-events-none"
|
|
11910
11957
|
), children: [
|
|
11911
|
-
selectedValues.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex flex-wrap gap-1 px-3 pt-2 pb-1 border-b border-slate-900/10", children: selectedOptions.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
11912
|
-
|
|
11913
|
-
{
|
|
11914
|
-
|
|
11915
|
-
children: [
|
|
11916
|
-
getLabel(opt),
|
|
11917
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11918
|
-
"button",
|
|
11919
|
-
{
|
|
11920
|
-
type: "button",
|
|
11921
|
-
disabled,
|
|
11922
|
-
onClick: () => onChange?.(selectedValues.filter((v) => v !== getKey(opt))),
|
|
11923
|
-
className: "hover:text-destructive",
|
|
11924
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(X, { className: "h-3 w-3" })
|
|
11925
|
-
}
|
|
11926
|
-
)
|
|
11927
|
-
]
|
|
11928
|
-
},
|
|
11929
|
-
getKey(opt)
|
|
11930
|
-
)) }),
|
|
11958
|
+
selectedValues.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex flex-wrap gap-1 px-3 pt-2 pb-1 border-b border-slate-900/10", children: selectedOptions.map((opt) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-sm bg-primary/15 text-primary px-2 py-0.5 text-xs", children: [
|
|
11959
|
+
getLabel(opt),
|
|
11960
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "button", disabled, onClick: () => onChange?.(selectedValues.filter((v) => v !== getKey(opt))), className: "hover:text-destructive", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(X, { className: "h-3 w-3" }) })
|
|
11961
|
+
] }, getKey(opt))) }),
|
|
11931
11962
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "max-h-48 overflow-y-auto p-1", children: options.map((option) => {
|
|
11932
11963
|
const checked = selectedValues.includes(getKey(option));
|
|
11933
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
11934
|
-
"
|
|
11935
|
-
|
|
11936
|
-
|
|
11937
|
-
|
|
11938
|
-
|
|
11939
|
-
|
|
11940
|
-
|
|
11941
|
-
|
|
11942
|
-
|
|
11943
|
-
checked ?
|
|
11944
|
-
|
|
11945
|
-
|
|
11946
|
-
|
|
11947
|
-
|
|
11948
|
-
|
|
11949
|
-
|
|
11950
|
-
checked,
|
|
11951
|
-
disabled,
|
|
11952
|
-
onChange: () => {
|
|
11953
|
-
const newValues = checked ? selectedValues.filter((v) => v !== getKey(option)) : [...selectedValues, getKey(option)];
|
|
11954
|
-
onChange?.(newValues);
|
|
11955
|
-
}
|
|
11956
|
-
}
|
|
11957
|
-
),
|
|
11958
|
-
getLabel(option)
|
|
11959
|
-
]
|
|
11960
|
-
},
|
|
11961
|
-
getKey(option)
|
|
11962
|
-
);
|
|
11964
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { className: cn("flex items-center gap-3 rounded-lg px-3 py-2 text-sm cursor-pointer transition-colors hover:bg-accent", checked && "bg-primary/8 text-primary"), children: [
|
|
11965
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: cn("flex h-4 w-4 shrink-0 items-center justify-center rounded border transition-colors", checked ? "bg-primary border-primary text-primary-foreground" : "border-slate-900/30 bg-background/50"), children: checked && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Check, { className: "h-3 w-3" }) }),
|
|
11966
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11967
|
+
"input",
|
|
11968
|
+
{
|
|
11969
|
+
type: "checkbox",
|
|
11970
|
+
className: "sr-only",
|
|
11971
|
+
checked,
|
|
11972
|
+
disabled,
|
|
11973
|
+
onChange: () => {
|
|
11974
|
+
const newValues = checked ? selectedValues.filter((v) => v !== getKey(option)) : [...selectedValues, getKey(option)];
|
|
11975
|
+
onChange?.(newValues);
|
|
11976
|
+
}
|
|
11977
|
+
}
|
|
11978
|
+
),
|
|
11979
|
+
getLabel(option)
|
|
11980
|
+
] }, getKey(option));
|
|
11963
11981
|
}) })
|
|
11964
11982
|
] })
|
|
11965
11983
|
] });
|
|
@@ -11990,14 +12008,15 @@ var CodegoUI = (() => {
|
|
|
11990
12008
|
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
11991
12009
|
"button",
|
|
11992
12010
|
{
|
|
12011
|
+
ref: triggerRef,
|
|
11993
12012
|
type: "button",
|
|
11994
12013
|
className: cn(
|
|
11995
12014
|
"relative flex w-full items-center min-h-[2.5rem] rounded-xl border border-slate-900/30 bg-background/50 backdrop-blur-sm px-4 py-2 text-sm ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 transition-colors hover:bg-background/80",
|
|
11996
12015
|
multiple && selectedValues.length > 0 && "flex-wrap gap-1",
|
|
11997
|
-
|
|
12016
|
+
"pr-10",
|
|
11998
12017
|
disabled && "cursor-not-allowed opacity-50"
|
|
11999
12018
|
),
|
|
12000
|
-
onClick: () =>
|
|
12019
|
+
onClick: () => isOpen ? setIsOpen(false) : openDropdown(),
|
|
12001
12020
|
disabled,
|
|
12002
12021
|
children: multiple && selectedOptions.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "flex flex-wrap gap-1 flex-1 min-w-0", children: selectedOptions.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
12003
12022
|
"span",
|
|
@@ -12006,22 +12025,11 @@ var CodegoUI = (() => {
|
|
|
12006
12025
|
onDragStart: (e) => handleDragStart(e, index),
|
|
12007
12026
|
onDragOver: handleDragOver,
|
|
12008
12027
|
onDrop: (e) => handleDrop(e, index),
|
|
12009
|
-
className: cn(
|
|
12010
|
-
"inline-flex items-center gap-1 rounded-sm bg-primary/15 text-primary px-2 py-1 text-xs",
|
|
12011
|
-
reorderable && "cursor-move"
|
|
12012
|
-
),
|
|
12028
|
+
className: cn("inline-flex items-center gap-1 rounded-sm bg-primary/15 text-primary px-2 py-1 text-xs", reorderable && "cursor-move"),
|
|
12013
12029
|
children: [
|
|
12014
12030
|
reorderable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(GripVertical, { className: "h-3 w-3 opacity-50" }),
|
|
12015
12031
|
getLabel(option),
|
|
12016
|
-
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
12017
|
-
"button",
|
|
12018
|
-
{
|
|
12019
|
-
type: "button",
|
|
12020
|
-
onClick: (e) => handleRemove(getKey(option), e),
|
|
12021
|
-
className: "ml-1 hover:text-destructive",
|
|
12022
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(X, { className: "h-3 w-3" })
|
|
12023
|
-
}
|
|
12024
|
-
)
|
|
12032
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("button", { type: "button", onClick: (e) => handleRemove(getKey(option), e), className: "ml-1 hover:text-destructive", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(X, { className: "h-3 w-3" }) })
|
|
12025
12033
|
]
|
|
12026
12034
|
},
|
|
12027
12035
|
getKey(option)
|
|
@@ -12034,50 +12042,56 @@ var CodegoUI = (() => {
|
|
|
12034
12042
|
{
|
|
12035
12043
|
type: "button",
|
|
12036
12044
|
disabled,
|
|
12037
|
-
onClick: () =>
|
|
12045
|
+
onClick: () => isOpen ? setIsOpen(false) : openDropdown(),
|
|
12038
12046
|
className: "absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground transition-colors z-10 disabled:opacity-50",
|
|
12039
|
-
"aria-label": "Open options",
|
|
12040
12047
|
style: iconColor ? { color: iconColor } : void 0,
|
|
12041
12048
|
children: suffixIcon
|
|
12042
12049
|
}
|
|
12043
12050
|
),
|
|
12044
|
-
isOpen && /* @__PURE__ */ (0, import_jsx_runtime28.
|
|
12045
|
-
|
|
12046
|
-
|
|
12047
|
-
|
|
12048
|
-
|
|
12049
|
-
|
|
12050
|
-
|
|
12051
|
-
|
|
12052
|
-
|
|
12053
|
-
|
|
12054
|
-
|
|
12055
|
-
|
|
12056
|
-
|
|
12057
|
-
|
|
12058
|
-
|
|
12059
|
-
|
|
12060
|
-
|
|
12061
|
-
|
|
12062
|
-
|
|
12063
|
-
|
|
12064
|
-
|
|
12065
|
-
|
|
12066
|
-
|
|
12067
|
-
|
|
12068
|
-
|
|
12069
|
-
|
|
12070
|
-
|
|
12071
|
-
|
|
12072
|
-
|
|
12073
|
-
|
|
12074
|
-
|
|
12075
|
-
|
|
12076
|
-
|
|
12077
|
-
|
|
12078
|
-
|
|
12079
|
-
|
|
12080
|
-
|
|
12051
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
12052
|
+
"div",
|
|
12053
|
+
{
|
|
12054
|
+
className: "max-h-60 overflow-auto rounded-md border border-white/10 bg-background/80 backdrop-blur-xl text-popover-foreground shadow-lg animate-in fade-in-80",
|
|
12055
|
+
style: dropStyle,
|
|
12056
|
+
children: [
|
|
12057
|
+
searchable && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "sticky top-0 z-10 flex items-center border-b border-white/10 bg-background/90 px-3 py-2", children: [
|
|
12058
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Search, { className: "mr-2 h-4 w-4 shrink-0 opacity-50" }),
|
|
12059
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
12060
|
+
"input",
|
|
12061
|
+
{
|
|
12062
|
+
className: "flex h-8 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground",
|
|
12063
|
+
placeholder: searchingMessage,
|
|
12064
|
+
value: search,
|
|
12065
|
+
onChange: (e) => {
|
|
12066
|
+
setSearch(e.target.value);
|
|
12067
|
+
setIsSearching(true);
|
|
12068
|
+
setTimeout(() => setIsSearching(false), 300);
|
|
12069
|
+
},
|
|
12070
|
+
onClick: (e) => e.stopPropagation()
|
|
12071
|
+
}
|
|
12072
|
+
)
|
|
12073
|
+
] }),
|
|
12074
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "p-1", children: isSearching ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "py-6 text-center text-sm text-muted-foreground", children: loadingMessage }) : filteredOptions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "py-6 text-center text-sm text-muted-foreground", children: search ? noSearchResultsMessage : "No options available." }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
|
|
12075
|
+
filteredOptions.map((option) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
12076
|
+
"div",
|
|
12077
|
+
{
|
|
12078
|
+
className: cn(
|
|
12079
|
+
"relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground",
|
|
12080
|
+
(multiple ? selectedValues.includes(getKey(option)) : value === getKey(option)) && "bg-accent text-accent-foreground"
|
|
12081
|
+
),
|
|
12082
|
+
onClick: () => handleSelect(getKey(option)),
|
|
12083
|
+
children: [
|
|
12084
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: (multiple ? selectedValues.includes(getKey(option)) : value === getKey(option)) && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Check, { className: "h-4 w-4" }) }),
|
|
12085
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: "truncate", children: getLabel(option) })
|
|
12086
|
+
]
|
|
12087
|
+
},
|
|
12088
|
+
getKey(option)
|
|
12089
|
+
)),
|
|
12090
|
+
createOptionForm && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "border-t border-white/10 mt-1 pt-1", children: createOptionForm })
|
|
12091
|
+
] }) })
|
|
12092
|
+
]
|
|
12093
|
+
}
|
|
12094
|
+
) })
|
|
12081
12095
|
] })
|
|
12082
12096
|
] });
|
|
12083
12097
|
}
|
|
@@ -12917,7 +12931,7 @@ var CodegoUI = (() => {
|
|
|
12917
12931
|
|
|
12918
12932
|
// src/components/ui/tooltip.tsx
|
|
12919
12933
|
var React28 = __toESM(require_react(), 1);
|
|
12920
|
-
var
|
|
12934
|
+
var ReactDOM2 = __toESM(require_react_dom(), 1);
|
|
12921
12935
|
var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
|
|
12922
12936
|
function Tooltip({
|
|
12923
12937
|
content,
|
|
@@ -12972,7 +12986,7 @@ var CodegoUI = (() => {
|
|
|
12972
12986
|
onBlur: () => setVisible(false),
|
|
12973
12987
|
children: [
|
|
12974
12988
|
children,
|
|
12975
|
-
visible &&
|
|
12989
|
+
visible && ReactDOM2.createPortal(
|
|
12976
12990
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
12977
12991
|
"div",
|
|
12978
12992
|
{
|
|
@@ -12995,24 +13009,36 @@ var CodegoUI = (() => {
|
|
|
12995
13009
|
|
|
12996
13010
|
// src/components/theme-provider.tsx
|
|
12997
13011
|
var import_react3 = __toESM(require_react(), 1);
|
|
13012
|
+
|
|
13013
|
+
// src/components/conf/settingConfig.json
|
|
13014
|
+
var settingConfig_default = {
|
|
13015
|
+
theme: "dark",
|
|
13016
|
+
fontSize: "16px",
|
|
13017
|
+
fontFamily: '"Space Grotesk", "Inter", sans-serif',
|
|
13018
|
+
colors: {
|
|
13019
|
+
primary: "#8b5cf6",
|
|
13020
|
+
primaryHover: "#7c3aed",
|
|
13021
|
+
secondary: "#171717",
|
|
13022
|
+
secondaryHover: "#262626",
|
|
13023
|
+
info: "#3b82f6",
|
|
13024
|
+
infoHover: "#2563eb",
|
|
13025
|
+
warning: "#f59e0b",
|
|
13026
|
+
warningHover: "#d97706",
|
|
13027
|
+
danger: "#ef4444",
|
|
13028
|
+
dangerHover: "#dc2626"
|
|
13029
|
+
}
|
|
13030
|
+
};
|
|
13031
|
+
|
|
13032
|
+
// src/components/theme-provider.tsx
|
|
12998
13033
|
var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
|
|
12999
|
-
var
|
|
13000
|
-
|
|
13001
|
-
|
|
13002
|
-
|
|
13003
|
-
|
|
13004
|
-
info: "#3b82f6",
|
|
13005
|
-
infoHover: "#2563eb",
|
|
13006
|
-
warning: "#f59e0b",
|
|
13007
|
-
warningHover: "#d97706",
|
|
13008
|
-
danger: "#ef4444",
|
|
13009
|
-
dangerHover: "#dc2626"
|
|
13034
|
+
var configDefaults = {
|
|
13035
|
+
theme: settingConfig_default.theme,
|
|
13036
|
+
fontSize: settingConfig_default.fontSize,
|
|
13037
|
+
fontFamily: settingConfig_default.fontFamily,
|
|
13038
|
+
colors: settingConfig_default.colors
|
|
13010
13039
|
};
|
|
13011
13040
|
var initialState = {
|
|
13012
|
-
|
|
13013
|
-
colors: defaultColors,
|
|
13014
|
-
fontSize: "16px",
|
|
13015
|
-
fontFamily: '"Space Grotesk", "Inter", sans-serif',
|
|
13041
|
+
...configDefaults,
|
|
13016
13042
|
setTheme: () => null,
|
|
13017
13043
|
setColors: () => null,
|
|
13018
13044
|
setFontSize: () => null,
|
|
@@ -13022,26 +13048,60 @@ var CodegoUI = (() => {
|
|
|
13022
13048
|
var ThemeProviderContext = (0, import_react3.createContext)(initialState);
|
|
13023
13049
|
var COLOR_PALETTE = [
|
|
13024
13050
|
{ base: "#6366f1", hover: "#4f46e5" },
|
|
13025
|
-
// Indigo
|
|
13026
13051
|
{ base: "#8b5cf6", hover: "#7c3aed" },
|
|
13027
|
-
// Violet
|
|
13028
13052
|
{ base: "#3b82f6", hover: "#2563eb" },
|
|
13029
|
-
// Blue
|
|
13030
13053
|
{ base: "#10b981", hover: "#059669" },
|
|
13031
|
-
// Emerald
|
|
13032
13054
|
{ base: "#22c55e", hover: "#16a34a" },
|
|
13033
|
-
// Green
|
|
13034
13055
|
{ base: "#eab308", hover: "#ca8a04" },
|
|
13035
|
-
// Yellow
|
|
13036
13056
|
{ base: "#f59e0b", hover: "#d97706" },
|
|
13037
|
-
// Amber
|
|
13038
13057
|
{ base: "#f97316", hover: "#ea580c" },
|
|
13039
|
-
// Orange
|
|
13040
13058
|
{ base: "#ef4444", hover: "#dc2626" },
|
|
13041
|
-
// Red
|
|
13042
13059
|
{ base: "#ec4899", hover: "#db2777" }
|
|
13043
|
-
// Pink
|
|
13044
13060
|
];
|
|
13061
|
+
function ThemeProvider({
|
|
13062
|
+
children,
|
|
13063
|
+
storageKey = "codego-ui-theme-settings",
|
|
13064
|
+
...props
|
|
13065
|
+
}) {
|
|
13066
|
+
const [settings, setSettings] = (0, import_react3.useState)(() => {
|
|
13067
|
+
try {
|
|
13068
|
+
const stored = localStorage.getItem(storageKey);
|
|
13069
|
+
if (stored) return { ...configDefaults, ...JSON.parse(stored) };
|
|
13070
|
+
} catch {
|
|
13071
|
+
}
|
|
13072
|
+
return configDefaults;
|
|
13073
|
+
});
|
|
13074
|
+
(0, import_react3.useEffect)(() => {
|
|
13075
|
+
localStorage.setItem(storageKey, JSON.stringify(settings));
|
|
13076
|
+
}, [settings, storageKey]);
|
|
13077
|
+
(0, import_react3.useEffect)(() => {
|
|
13078
|
+
const root = window.document.documentElement;
|
|
13079
|
+
root.classList.remove("light", "dark");
|
|
13080
|
+
const resolved = settings.theme === "system" ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : settings.theme;
|
|
13081
|
+
root.classList.add(resolved);
|
|
13082
|
+
root.style.setProperty("--primary", settings.colors.primary);
|
|
13083
|
+
root.style.setProperty("--primary-hover", settings.colors.primaryHover);
|
|
13084
|
+
root.style.setProperty("--secondary", settings.colors.secondary);
|
|
13085
|
+
root.style.setProperty("--secondary-hover", settings.colors.secondaryHover);
|
|
13086
|
+
root.style.setProperty("--info", settings.colors.info);
|
|
13087
|
+
root.style.setProperty("--info-hover", settings.colors.infoHover);
|
|
13088
|
+
root.style.setProperty("--warning", settings.colors.warning);
|
|
13089
|
+
root.style.setProperty("--warning-hover", settings.colors.warningHover);
|
|
13090
|
+
root.style.setProperty("--danger", settings.colors.danger);
|
|
13091
|
+
root.style.setProperty("--danger-hover", settings.colors.dangerHover);
|
|
13092
|
+
root.style.setProperty("font-size", settings.fontSize);
|
|
13093
|
+
root.style.setProperty("--font-sans", settings.fontFamily);
|
|
13094
|
+
}, [settings]);
|
|
13095
|
+
const value = {
|
|
13096
|
+
...settings,
|
|
13097
|
+
setTheme: (theme) => setSettings((s) => ({ ...s, theme })),
|
|
13098
|
+
setColors: (colors) => setSettings((s) => ({ ...s, colors: { ...s.colors, ...colors } })),
|
|
13099
|
+
setFontSize: (fontSize) => setSettings((s) => ({ ...s, fontSize })),
|
|
13100
|
+
setFontFamily: (fontFamily) => setSettings((s) => ({ ...s, fontFamily })),
|
|
13101
|
+
resetSettings: () => setSettings(configDefaults)
|
|
13102
|
+
};
|
|
13103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ThemeProviderContext.Provider, { ...props, value, children });
|
|
13104
|
+
}
|
|
13045
13105
|
var useTheme = () => {
|
|
13046
13106
|
const context = (0, import_react3.useContext)(ThemeProviderContext);
|
|
13047
13107
|
if (context === void 0)
|
|
@@ -13201,16 +13261,28 @@ var CodegoUI = (() => {
|
|
|
13201
13261
|
// src/components/ui/popover.tsx
|
|
13202
13262
|
var React31 = __toESM(require_react(), 1);
|
|
13203
13263
|
var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
|
|
13204
|
-
|
|
13205
|
-
|
|
13206
|
-
|
|
13207
|
-
|
|
13208
|
-
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
|
|
13212
|
-
|
|
13213
|
-
|
|
13264
|
+
function calcStyle(triggerEl, placement) {
|
|
13265
|
+
const r2 = triggerEl.getBoundingClientRect();
|
|
13266
|
+
const GAP = 8;
|
|
13267
|
+
switch (placement) {
|
|
13268
|
+
case "bottom":
|
|
13269
|
+
return { top: r2.bottom + GAP, left: r2.left + r2.width / 2, transform: "translateX(-50%)" };
|
|
13270
|
+
case "bottom-start":
|
|
13271
|
+
return { top: r2.bottom + GAP, left: r2.left };
|
|
13272
|
+
case "bottom-end":
|
|
13273
|
+
return { top: r2.bottom + GAP, left: r2.right, transform: "translateX(-100%)" };
|
|
13274
|
+
case "top":
|
|
13275
|
+
return { top: r2.top - GAP, left: r2.left + r2.width / 2, transform: "translate(-50%, -100%)" };
|
|
13276
|
+
case "top-start":
|
|
13277
|
+
return { top: r2.top - GAP, left: r2.left, transform: "translateY(-100%)" };
|
|
13278
|
+
case "top-end":
|
|
13279
|
+
return { top: r2.top - GAP, left: r2.right, transform: "translate(-100%, -100%)" };
|
|
13280
|
+
case "left":
|
|
13281
|
+
return { top: r2.top + r2.height / 2, left: r2.left - GAP, transform: "translate(-100%, -50%)" };
|
|
13282
|
+
case "right":
|
|
13283
|
+
return { top: r2.top + r2.height / 2, left: r2.right + GAP, transform: "translateY(-50%)" };
|
|
13284
|
+
}
|
|
13285
|
+
}
|
|
13214
13286
|
function Popover({
|
|
13215
13287
|
trigger,
|
|
13216
13288
|
content,
|
|
@@ -13222,11 +13294,18 @@ var CodegoUI = (() => {
|
|
|
13222
13294
|
}) {
|
|
13223
13295
|
const [internal, setInternal] = React31.useState(false);
|
|
13224
13296
|
const ref = React31.useRef(null);
|
|
13297
|
+
const [popStyle, setPopStyle] = React31.useState({});
|
|
13225
13298
|
const open = controlled ?? internal;
|
|
13226
13299
|
function setOpen(v) {
|
|
13227
13300
|
if (controlled === void 0) setInternal(v);
|
|
13228
13301
|
onOpenChange?.(v);
|
|
13229
13302
|
}
|
|
13303
|
+
function openPopover() {
|
|
13304
|
+
if (ref.current) {
|
|
13305
|
+
setPopStyle({ position: "fixed", zIndex: 9999, ...calcStyle(ref.current, placement) });
|
|
13306
|
+
}
|
|
13307
|
+
setOpen(true);
|
|
13308
|
+
}
|
|
13230
13309
|
React31.useEffect(() => {
|
|
13231
13310
|
if (triggerOn !== "click") return;
|
|
13232
13311
|
function handler(e) {
|
|
@@ -13235,14 +13314,17 @@ var CodegoUI = (() => {
|
|
|
13235
13314
|
document.addEventListener("mousedown", handler);
|
|
13236
13315
|
return () => document.removeEventListener("mousedown", handler);
|
|
13237
13316
|
}, [triggerOn]);
|
|
13238
|
-
const hoverProps = triggerOn === "hover" ? { onMouseEnter:
|
|
13317
|
+
const hoverProps = triggerOn === "hover" ? { onMouseEnter: openPopover, onMouseLeave: () => setOpen(false) } : {};
|
|
13239
13318
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { ref, className: "relative inline-block", ...hoverProps, children: [
|
|
13240
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { onClick: () => triggerOn === "click" && setOpen(
|
|
13241
|
-
open && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
13242
|
-
"
|
|
13243
|
-
|
|
13244
|
-
|
|
13245
|
-
|
|
13319
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { onClick: () => triggerOn === "click" && (open ? setOpen(false) : openPopover()), children: trigger }),
|
|
13320
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(FloatingPortal, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
13321
|
+
"div",
|
|
13322
|
+
{
|
|
13323
|
+
className: cn("min-w-max rounded-xl border border-border glass shadow-2xl", className),
|
|
13324
|
+
style: popStyle,
|
|
13325
|
+
children: content
|
|
13326
|
+
}
|
|
13327
|
+
) })
|
|
13246
13328
|
] });
|
|
13247
13329
|
}
|
|
13248
13330
|
|
|
@@ -15711,10 +15793,10 @@ react/cjs/react.development.js:
|
|
|
15711
15793
|
* LICENSE file in the root directory of this source tree.
|
|
15712
15794
|
*)
|
|
15713
15795
|
|
|
15714
|
-
react/cjs/react-
|
|
15796
|
+
react-dom/cjs/react-dom.production.js:
|
|
15715
15797
|
(**
|
|
15716
15798
|
* @license React
|
|
15717
|
-
* react-
|
|
15799
|
+
* react-dom.production.js
|
|
15718
15800
|
*
|
|
15719
15801
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15720
15802
|
*
|
|
@@ -15722,10 +15804,10 @@ react/cjs/react-jsx-runtime.production.js:
|
|
|
15722
15804
|
* LICENSE file in the root directory of this source tree.
|
|
15723
15805
|
*)
|
|
15724
15806
|
|
|
15725
|
-
react/cjs/react-
|
|
15807
|
+
react-dom/cjs/react-dom.development.js:
|
|
15726
15808
|
(**
|
|
15727
15809
|
* @license React
|
|
15728
|
-
* react-
|
|
15810
|
+
* react-dom.development.js
|
|
15729
15811
|
*
|
|
15730
15812
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15731
15813
|
*
|
|
@@ -15733,10 +15815,10 @@ react/cjs/react-jsx-runtime.development.js:
|
|
|
15733
15815
|
* LICENSE file in the root directory of this source tree.
|
|
15734
15816
|
*)
|
|
15735
15817
|
|
|
15736
|
-
react
|
|
15818
|
+
react/cjs/react-jsx-runtime.production.js:
|
|
15737
15819
|
(**
|
|
15738
15820
|
* @license React
|
|
15739
|
-
* react-
|
|
15821
|
+
* react-jsx-runtime.production.js
|
|
15740
15822
|
*
|
|
15741
15823
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15742
15824
|
*
|
|
@@ -15744,10 +15826,10 @@ react-dom/cjs/react-dom.production.js:
|
|
|
15744
15826
|
* LICENSE file in the root directory of this source tree.
|
|
15745
15827
|
*)
|
|
15746
15828
|
|
|
15747
|
-
react
|
|
15829
|
+
react/cjs/react-jsx-runtime.development.js:
|
|
15748
15830
|
(**
|
|
15749
15831
|
* @license React
|
|
15750
|
-
* react-
|
|
15832
|
+
* react-jsx-runtime.development.js
|
|
15751
15833
|
*
|
|
15752
15834
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15753
15835
|
*
|