@cerberus-design/react 0.9.2-next-dd3210f → 0.9.2-next-863daf6
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/build/legacy/_tsup-dts-rollup.d.cts +10 -0
- package/build/legacy/components/Spinner.cjs +104 -0
- package/build/legacy/components/Spinner.cjs.map +1 -0
- package/build/legacy/index.cjs +166 -88
- package/build/legacy/index.cjs.map +1 -1
- package/build/modern/_tsup-dts-rollup.d.ts +10 -0
- package/build/modern/chunk-RN6HSKIG.js +80 -0
- package/build/modern/chunk-RN6HSKIG.js.map +1 -0
- package/build/modern/components/Spinner.js +7 -0
- package/build/modern/components/Spinner.js.map +1 -0
- package/build/modern/index.js +12 -8
- package/build/modern/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Spinner.tsx +60 -0
- package/src/index.ts +1 -0
package/build/legacy/index.cjs
CHANGED
|
@@ -56,6 +56,7 @@ __export(src_exports, {
|
|
|
56
56
|
Radio: () => Radio,
|
|
57
57
|
Select: () => Select,
|
|
58
58
|
Show: () => Show,
|
|
59
|
+
Spinner: () => Spinner,
|
|
59
60
|
THEME_KEY: () => THEME_KEY,
|
|
60
61
|
Tab: () => Tab,
|
|
61
62
|
TabList: () => TabList,
|
|
@@ -1285,13 +1286,89 @@ function Option(props) {
|
|
|
1285
1286
|
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("option", { ...props });
|
|
1286
1287
|
}
|
|
1287
1288
|
|
|
1289
|
+
// src/components/Spinner.tsx
|
|
1290
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1291
|
+
function Spinner(props) {
|
|
1292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1293
|
+
"svg",
|
|
1294
|
+
{
|
|
1295
|
+
"aria-busy": "true",
|
|
1296
|
+
role: "status",
|
|
1297
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1298
|
+
height: props.size,
|
|
1299
|
+
width: props.size,
|
|
1300
|
+
viewBox: "0 0 24 24",
|
|
1301
|
+
...props,
|
|
1302
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1303
|
+
"g",
|
|
1304
|
+
{
|
|
1305
|
+
fill: "none",
|
|
1306
|
+
stroke: "currentColor",
|
|
1307
|
+
strokeLinecap: "round",
|
|
1308
|
+
strokeLinejoin: "round",
|
|
1309
|
+
strokeWidth: 2,
|
|
1310
|
+
children: [
|
|
1311
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
1312
|
+
"path",
|
|
1313
|
+
{
|
|
1314
|
+
strokeDasharray: 16,
|
|
1315
|
+
strokeDashoffset: 16,
|
|
1316
|
+
d: "M12 3c4.97 0 9 4.03 9 9",
|
|
1317
|
+
children: [
|
|
1318
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1319
|
+
"animate",
|
|
1320
|
+
{
|
|
1321
|
+
fill: "freeze",
|
|
1322
|
+
attributeName: "stroke-dashoffset",
|
|
1323
|
+
dur: "0.15s",
|
|
1324
|
+
values: "16;0"
|
|
1325
|
+
}
|
|
1326
|
+
),
|
|
1327
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1328
|
+
"animateTransform",
|
|
1329
|
+
{
|
|
1330
|
+
attributeName: "transform",
|
|
1331
|
+
dur: "0.75s",
|
|
1332
|
+
repeatCount: "indefinite",
|
|
1333
|
+
type: "rotate",
|
|
1334
|
+
values: "0 12 12;360 12 12"
|
|
1335
|
+
}
|
|
1336
|
+
)
|
|
1337
|
+
]
|
|
1338
|
+
}
|
|
1339
|
+
),
|
|
1340
|
+
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1341
|
+
"path",
|
|
1342
|
+
{
|
|
1343
|
+
strokeDasharray: 64,
|
|
1344
|
+
strokeDashoffset: 64,
|
|
1345
|
+
strokeOpacity: 0.3,
|
|
1346
|
+
d: "M12 3c4.97 0 9 4.03 9 9c0 4.97 -4.03 9 -9 9c-4.97 0 -9 -4.03 -9 -9c0 -4.97 4.03 -9 9 -9Z",
|
|
1347
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
1348
|
+
"animate",
|
|
1349
|
+
{
|
|
1350
|
+
fill: "freeze",
|
|
1351
|
+
attributeName: "stroke-dashoffset",
|
|
1352
|
+
dur: "0.6s",
|
|
1353
|
+
values: "64;0"
|
|
1354
|
+
}
|
|
1355
|
+
)
|
|
1356
|
+
}
|
|
1357
|
+
)
|
|
1358
|
+
]
|
|
1359
|
+
}
|
|
1360
|
+
)
|
|
1361
|
+
}
|
|
1362
|
+
);
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1288
1365
|
// src/components/Tab.tsx
|
|
1289
1366
|
var import_react13 = require("react");
|
|
1290
1367
|
|
|
1291
1368
|
// src/context/tabs.tsx
|
|
1292
1369
|
var import_recipes20 = require("@cerberus/styled-system/recipes");
|
|
1293
1370
|
var import_react11 = require("react");
|
|
1294
|
-
var
|
|
1371
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
1295
1372
|
var TabsContext = (0, import_react11.createContext)(null);
|
|
1296
1373
|
function Tabs(props) {
|
|
1297
1374
|
const { cache, active, id, palette } = props;
|
|
@@ -1323,7 +1400,7 @@ function Tabs(props) {
|
|
|
1323
1400
|
window.localStorage.setItem(uuid, activeTab);
|
|
1324
1401
|
}
|
|
1325
1402
|
}, [activeTab, cache]);
|
|
1326
|
-
return /* @__PURE__ */ (0,
|
|
1403
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TabsContext.Provider, { value, children: props.children });
|
|
1327
1404
|
}
|
|
1328
1405
|
function useTabsContext() {
|
|
1329
1406
|
const context = (0, import_react11.useContext)(TabsContext);
|
|
@@ -1393,7 +1470,7 @@ function useTabsKeyboardNavigation() {
|
|
|
1393
1470
|
}
|
|
1394
1471
|
|
|
1395
1472
|
// src/components/Tab.tsx
|
|
1396
|
-
var
|
|
1473
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
1397
1474
|
function Tab(props) {
|
|
1398
1475
|
const { value, ...nativeProps } = props;
|
|
1399
1476
|
const { active, onTabUpdate, styles } = useTabsContext();
|
|
@@ -1405,7 +1482,7 @@ function Tab(props) {
|
|
|
1405
1482
|
(_a = props.onClick) == null ? void 0 : _a.call(props, e);
|
|
1406
1483
|
startTransition(() => onTabUpdate(e.currentTarget.value));
|
|
1407
1484
|
}
|
|
1408
|
-
return /* @__PURE__ */ (0,
|
|
1485
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
1409
1486
|
"button",
|
|
1410
1487
|
{
|
|
1411
1488
|
...nativeProps,
|
|
@@ -1426,11 +1503,11 @@ function Tab(props) {
|
|
|
1426
1503
|
// src/components/TabList.tsx
|
|
1427
1504
|
var import_css25 = require("@cerberus/styled-system/css");
|
|
1428
1505
|
var import_patterns11 = require("@cerberus/styled-system/patterns");
|
|
1429
|
-
var
|
|
1506
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
1430
1507
|
function TabList(props) {
|
|
1431
1508
|
const { description, ...nativeProps } = props;
|
|
1432
1509
|
const { id, styles } = useTabsContext();
|
|
1433
|
-
return /* @__PURE__ */ (0,
|
|
1510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
1434
1511
|
"div",
|
|
1435
1512
|
{
|
|
1436
1513
|
...nativeProps,
|
|
@@ -1450,12 +1527,12 @@ function TabList(props) {
|
|
|
1450
1527
|
// src/components/TabPanel.tsx
|
|
1451
1528
|
var import_css26 = require("@cerberus/styled-system/css");
|
|
1452
1529
|
var import_react14 = require("react");
|
|
1453
|
-
var
|
|
1530
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
1454
1531
|
function TabPanel(props) {
|
|
1455
1532
|
const { tab, ...nativeProps } = props;
|
|
1456
1533
|
const { active, styles } = useTabsContext();
|
|
1457
1534
|
const isActive = (0, import_react14.useMemo)(() => active === tab, [active, tab]);
|
|
1458
|
-
return /* @__PURE__ */ (0,
|
|
1535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Show, { when: isActive, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
1459
1536
|
"div",
|
|
1460
1537
|
{
|
|
1461
1538
|
...nativeProps,
|
|
@@ -1471,52 +1548,52 @@ function TabPanel(props) {
|
|
|
1471
1548
|
// src/components/Table.tsx
|
|
1472
1549
|
var import_css27 = require("@cerberus/styled-system/css");
|
|
1473
1550
|
var import_recipes21 = require("@cerberus/styled-system/recipes");
|
|
1474
|
-
var
|
|
1551
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1475
1552
|
function Table(props) {
|
|
1476
1553
|
const { caption, children, ...nativeProps } = props;
|
|
1477
1554
|
const styles = (0, import_recipes21.table)();
|
|
1478
|
-
return /* @__PURE__ */ (0,
|
|
1555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: styles.container, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
1479
1556
|
"table",
|
|
1480
1557
|
{
|
|
1481
1558
|
...nativeProps,
|
|
1482
1559
|
className: (0, import_css27.cx)(nativeProps.className, styles.table),
|
|
1483
1560
|
children: [
|
|
1484
|
-
/* @__PURE__ */ (0,
|
|
1561
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("caption", { className: styles.caption, children: caption }),
|
|
1485
1562
|
children
|
|
1486
1563
|
]
|
|
1487
1564
|
}
|
|
1488
1565
|
) });
|
|
1489
1566
|
}
|
|
1490
1567
|
function Tr(props) {
|
|
1491
|
-
return /* @__PURE__ */ (0,
|
|
1568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("tr", { ...props });
|
|
1492
1569
|
}
|
|
1493
1570
|
|
|
1494
1571
|
// src/components/Thead.tsx
|
|
1495
1572
|
var import_css28 = require("@cerberus/styled-system/css");
|
|
1496
1573
|
var import_recipes22 = require("@cerberus/styled-system/recipes");
|
|
1497
|
-
var
|
|
1574
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1498
1575
|
function Thead(props) {
|
|
1499
|
-
return /* @__PURE__ */ (0,
|
|
1576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("thead", { ...props, className: (0, import_css28.cx)(props.className, (0, import_recipes22.thead)()) });
|
|
1500
1577
|
}
|
|
1501
1578
|
|
|
1502
1579
|
// src/components/Th.tsx
|
|
1503
1580
|
var import_css29 = require("@cerberus/styled-system/css");
|
|
1504
1581
|
var import_recipes23 = require("@cerberus/styled-system/recipes");
|
|
1505
|
-
var
|
|
1582
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
1506
1583
|
function Th(props) {
|
|
1507
1584
|
const { size, onClick, ...nativeProps } = props;
|
|
1508
|
-
return /* @__PURE__ */ (0,
|
|
1585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1509
1586
|
Show,
|
|
1510
1587
|
{
|
|
1511
1588
|
when: Boolean(onClick),
|
|
1512
|
-
fallback: /* @__PURE__ */ (0,
|
|
1589
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1513
1590
|
"th",
|
|
1514
1591
|
{
|
|
1515
1592
|
...nativeProps,
|
|
1516
1593
|
className: (0, import_css29.cx)(nativeProps.className, (0, import_recipes23.th)({ size }))
|
|
1517
1594
|
}
|
|
1518
1595
|
),
|
|
1519
|
-
children: /* @__PURE__ */ (0,
|
|
1596
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("th", { ...nativeProps, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
1520
1597
|
"button",
|
|
1521
1598
|
{
|
|
1522
1599
|
className: (0, import_css29.cx)(
|
|
@@ -1541,10 +1618,10 @@ function Th(props) {
|
|
|
1541
1618
|
// src/components/Td.tsx
|
|
1542
1619
|
var import_css30 = require("@cerberus/styled-system/css");
|
|
1543
1620
|
var import_recipes24 = require("@cerberus/styled-system/recipes");
|
|
1544
|
-
var
|
|
1621
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
1545
1622
|
function Td(props) {
|
|
1546
1623
|
const { size, ...nativeProps } = props;
|
|
1547
|
-
return /* @__PURE__ */ (0,
|
|
1624
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1548
1625
|
"td",
|
|
1549
1626
|
{
|
|
1550
1627
|
...nativeProps,
|
|
@@ -1561,10 +1638,10 @@ function Td(props) {
|
|
|
1561
1638
|
// src/components/Tbody.tsx
|
|
1562
1639
|
var import_recipes25 = require("@cerberus/styled-system/recipes");
|
|
1563
1640
|
var import_css31 = require("@cerberus/styled-system/css");
|
|
1564
|
-
var
|
|
1641
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
1565
1642
|
function Tbody(props) {
|
|
1566
1643
|
const { decoration, ...nativeProps } = props;
|
|
1567
|
-
return /* @__PURE__ */ (0,
|
|
1644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
1568
1645
|
"tbody",
|
|
1569
1646
|
{
|
|
1570
1647
|
...nativeProps,
|
|
@@ -1582,14 +1659,14 @@ function Tbody(props) {
|
|
|
1582
1659
|
var import_icons3 = require("@cerberus/icons");
|
|
1583
1660
|
var import_css32 = require("@cerberus/styled-system/css");
|
|
1584
1661
|
var import_recipes26 = require("@cerberus/styled-system/recipes");
|
|
1585
|
-
var
|
|
1662
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
1586
1663
|
function Tag(props) {
|
|
1587
1664
|
const { shape: initShape, gradient, onClick, usage, ...nativeProps } = props;
|
|
1588
1665
|
const palette = (props == null ? void 0 : props.palette) ?? "page";
|
|
1589
1666
|
const isClosable = Boolean(onClick);
|
|
1590
1667
|
const shape = isClosable ? "pill" : initShape;
|
|
1591
1668
|
const closableStyles = isClosable ? closableCss : "";
|
|
1592
|
-
return /* @__PURE__ */ (0,
|
|
1669
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
|
|
1593
1670
|
"span",
|
|
1594
1671
|
{
|
|
1595
1672
|
...nativeProps,
|
|
@@ -1605,7 +1682,7 @@ function Tag(props) {
|
|
|
1605
1682
|
),
|
|
1606
1683
|
children: [
|
|
1607
1684
|
props.children,
|
|
1608
|
-
/* @__PURE__ */ (0,
|
|
1685
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Show, { when: isClosable, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
1609
1686
|
"button",
|
|
1610
1687
|
{
|
|
1611
1688
|
"aria-label": "Close",
|
|
@@ -1615,7 +1692,7 @@ function Tag(props) {
|
|
|
1615
1692
|
size: "sm"
|
|
1616
1693
|
}),
|
|
1617
1694
|
onClick,
|
|
1618
|
-
children: /* @__PURE__ */ (0,
|
|
1695
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_icons3.Close, {})
|
|
1619
1696
|
}
|
|
1620
1697
|
) })
|
|
1621
1698
|
]
|
|
@@ -1631,11 +1708,11 @@ var closableCss = (0, import_css32.css)({
|
|
|
1631
1708
|
// src/components/Textarea.tsx
|
|
1632
1709
|
var import_css33 = require("@cerberus/styled-system/css");
|
|
1633
1710
|
var import_recipes27 = require("@cerberus/styled-system/recipes");
|
|
1634
|
-
var
|
|
1711
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
1635
1712
|
function Textarea(props) {
|
|
1636
1713
|
const { describedBy, ...nativeProps } = props;
|
|
1637
1714
|
const { invalid, ...fieldState } = useFieldContext();
|
|
1638
|
-
return /* @__PURE__ */ (0,
|
|
1715
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
1639
1716
|
"textarea",
|
|
1640
1717
|
{
|
|
1641
1718
|
...nativeProps,
|
|
@@ -1660,19 +1737,19 @@ function Textarea(props) {
|
|
|
1660
1737
|
var import_css34 = require("@cerberus/styled-system/css");
|
|
1661
1738
|
var import_patterns12 = require("@cerberus/styled-system/patterns");
|
|
1662
1739
|
var import_recipes28 = require("@cerberus/styled-system/recipes");
|
|
1663
|
-
var
|
|
1740
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
1664
1741
|
function Toggle(props) {
|
|
1665
1742
|
const { size, describedBy, ...nativeProps } = props;
|
|
1666
1743
|
const styles = (0, import_recipes28.toggle)({ size });
|
|
1667
1744
|
const { invalid, ...state } = useFieldContext();
|
|
1668
1745
|
const Icon = $cerberusIcons.toggleChecked;
|
|
1669
|
-
return /* @__PURE__ */ (0,
|
|
1746
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
|
|
1670
1747
|
"span",
|
|
1671
1748
|
{
|
|
1672
1749
|
className: (0, import_css34.cx)("group", styles.track, (0, import_patterns12.hstack)()),
|
|
1673
1750
|
"data-checked": props.checked || props.defaultChecked,
|
|
1674
1751
|
children: [
|
|
1675
|
-
/* @__PURE__ */ (0,
|
|
1752
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1676
1753
|
"input",
|
|
1677
1754
|
{
|
|
1678
1755
|
...nativeProps,
|
|
@@ -1684,7 +1761,7 @@ function Toggle(props) {
|
|
|
1684
1761
|
type: "checkbox"
|
|
1685
1762
|
}
|
|
1686
1763
|
),
|
|
1687
|
-
/* @__PURE__ */ (0,
|
|
1764
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
1688
1765
|
"span",
|
|
1689
1766
|
{
|
|
1690
1767
|
className: (0, import_css34.cx)(
|
|
@@ -1693,7 +1770,7 @@ function Toggle(props) {
|
|
|
1693
1770
|
justify: "center"
|
|
1694
1771
|
})
|
|
1695
1772
|
),
|
|
1696
|
-
children: /* @__PURE__ */ (0,
|
|
1773
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Icon, {})
|
|
1697
1774
|
}
|
|
1698
1775
|
)
|
|
1699
1776
|
]
|
|
@@ -1728,7 +1805,7 @@ function useModal() {
|
|
|
1728
1805
|
}
|
|
1729
1806
|
|
|
1730
1807
|
// src/context/confirm-modal.tsx
|
|
1731
|
-
var
|
|
1808
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
1732
1809
|
var ConfirmModalContext = (0, import_react16.createContext)(null);
|
|
1733
1810
|
function ConfirmModal(props) {
|
|
1734
1811
|
const { modalRef, show, close } = useModal();
|
|
@@ -1768,36 +1845,36 @@ function ConfirmModal(props) {
|
|
|
1768
1845
|
}),
|
|
1769
1846
|
[handleShow]
|
|
1770
1847
|
);
|
|
1771
|
-
return /* @__PURE__ */ (0,
|
|
1848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(ConfirmModalContext.Provider, { value, children: [
|
|
1772
1849
|
props.children,
|
|
1773
|
-
/* @__PURE__ */ (0,
|
|
1774
|
-
/* @__PURE__ */ (0,
|
|
1775
|
-
/* @__PURE__ */ (0,
|
|
1850
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
|
|
1851
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(ModalHeader, { children: [
|
|
1852
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1776
1853
|
"div",
|
|
1777
1854
|
{
|
|
1778
1855
|
className: (0, import_patterns13.hstack)({
|
|
1779
1856
|
justify: "center",
|
|
1780
1857
|
w: "full"
|
|
1781
1858
|
}),
|
|
1782
|
-
children: /* @__PURE__ */ (0,
|
|
1859
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1783
1860
|
Show,
|
|
1784
1861
|
{
|
|
1785
1862
|
when: palette === "danger",
|
|
1786
|
-
fallback: /* @__PURE__ */ (0,
|
|
1863
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1787
1864
|
Avatar,
|
|
1788
1865
|
{
|
|
1789
1866
|
ariaLabel: "",
|
|
1790
1867
|
gradient: "charon-light",
|
|
1791
|
-
icon: /* @__PURE__ */ (0,
|
|
1868
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ConfirmIcon, { size: 24 }),
|
|
1792
1869
|
src: ""
|
|
1793
1870
|
}
|
|
1794
1871
|
),
|
|
1795
|
-
children: /* @__PURE__ */ (0,
|
|
1872
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1796
1873
|
Avatar,
|
|
1797
1874
|
{
|
|
1798
1875
|
ariaLabel: "",
|
|
1799
1876
|
gradient: "hades-dark",
|
|
1800
|
-
icon: /* @__PURE__ */ (0,
|
|
1877
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ConfirmIcon, { size: 24 }),
|
|
1801
1878
|
src: ""
|
|
1802
1879
|
}
|
|
1803
1880
|
)
|
|
@@ -1805,17 +1882,17 @@ function ConfirmModal(props) {
|
|
|
1805
1882
|
)
|
|
1806
1883
|
}
|
|
1807
1884
|
),
|
|
1808
|
-
/* @__PURE__ */ (0,
|
|
1809
|
-
/* @__PURE__ */ (0,
|
|
1885
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ModalHeading, { children: content == null ? void 0 : content.heading }),
|
|
1886
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(ModalDescription, { children: content == null ? void 0 : content.description })
|
|
1810
1887
|
] }),
|
|
1811
|
-
/* @__PURE__ */ (0,
|
|
1888
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
1812
1889
|
"div",
|
|
1813
1890
|
{
|
|
1814
1891
|
className: (0, import_patterns13.hstack)({
|
|
1815
1892
|
gap: "4"
|
|
1816
1893
|
}),
|
|
1817
1894
|
children: [
|
|
1818
|
-
/* @__PURE__ */ (0,
|
|
1895
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1819
1896
|
Button,
|
|
1820
1897
|
{
|
|
1821
1898
|
autoFocus: true,
|
|
@@ -1829,7 +1906,7 @@ function ConfirmModal(props) {
|
|
|
1829
1906
|
children: content == null ? void 0 : content.actionText
|
|
1830
1907
|
}
|
|
1831
1908
|
),
|
|
1832
|
-
/* @__PURE__ */ (0,
|
|
1909
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
1833
1910
|
Button,
|
|
1834
1911
|
{
|
|
1835
1912
|
className: (0, import_css35.css)({
|
|
@@ -1863,7 +1940,7 @@ var import_react17 = require("react");
|
|
|
1863
1940
|
var import_patterns14 = require("@cerberus/styled-system/patterns");
|
|
1864
1941
|
var import_recipes29 = require("@cerberus/styled-system/recipes");
|
|
1865
1942
|
var import_css36 = require("@cerberus/styled-system/css");
|
|
1866
|
-
var
|
|
1943
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
1867
1944
|
var NotificationsContext = (0, import_react17.createContext)(null);
|
|
1868
1945
|
function NotificationCenter(props) {
|
|
1869
1946
|
const [activeNotifications, setActiveNotifications] = (0, import_react17.useState)([]);
|
|
@@ -1896,10 +1973,10 @@ function NotificationCenter(props) {
|
|
|
1896
1973
|
}),
|
|
1897
1974
|
[handleNotify]
|
|
1898
1975
|
);
|
|
1899
|
-
return /* @__PURE__ */ (0,
|
|
1976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(NotificationsContext.Provider, { value, children: [
|
|
1900
1977
|
props.children,
|
|
1901
|
-
/* @__PURE__ */ (0,
|
|
1902
|
-
/* @__PURE__ */ (0,
|
|
1978
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Show, { when: activeNotifications.length > 0, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Portal, { container: props.container, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: styles.center, children: [
|
|
1979
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Show, { when: activeNotifications.length >= 4, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
1903
1980
|
Button,
|
|
1904
1981
|
{
|
|
1905
1982
|
className: (0, import_css36.cx)(styles.closeAll, (0, import_patterns14.animateIn)()),
|
|
@@ -1911,7 +1988,7 @@ function NotificationCenter(props) {
|
|
|
1911
1988
|
children: "Close all"
|
|
1912
1989
|
}
|
|
1913
1990
|
) }),
|
|
1914
|
-
/* @__PURE__ */ (0,
|
|
1991
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
1915
1992
|
"div",
|
|
1916
1993
|
{
|
|
1917
1994
|
className: (0, import_patterns14.vstack)({
|
|
@@ -1921,7 +1998,7 @@ function NotificationCenter(props) {
|
|
|
1921
1998
|
style: {
|
|
1922
1999
|
alignItems: "flex-end"
|
|
1923
2000
|
},
|
|
1924
|
-
children: activeNotifications.map((option) => /* @__PURE__ */ (0,
|
|
2001
|
+
children: activeNotifications.map((option) => /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
1925
2002
|
MatchNotification,
|
|
1926
2003
|
{
|
|
1927
2004
|
...option,
|
|
@@ -1938,7 +2015,7 @@ function MatchNotification(props) {
|
|
|
1938
2015
|
const { palette, id, onClose, heading, description } = props;
|
|
1939
2016
|
switch (palette) {
|
|
1940
2017
|
case "success":
|
|
1941
|
-
return /* @__PURE__ */ (0,
|
|
2018
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
1942
2019
|
Notification,
|
|
1943
2020
|
{
|
|
1944
2021
|
id,
|
|
@@ -1946,14 +2023,14 @@ function MatchNotification(props) {
|
|
|
1946
2023
|
open: true,
|
|
1947
2024
|
palette: "success",
|
|
1948
2025
|
children: [
|
|
1949
|
-
/* @__PURE__ */ (0,
|
|
1950
|
-
/* @__PURE__ */ (0,
|
|
2026
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(NotificationHeading, { palette: "success", children: heading }),
|
|
2027
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(NotificationDescription, { palette: "success", children: description })
|
|
1951
2028
|
]
|
|
1952
2029
|
},
|
|
1953
2030
|
id
|
|
1954
2031
|
);
|
|
1955
2032
|
case "warning":
|
|
1956
|
-
return /* @__PURE__ */ (0,
|
|
2033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
1957
2034
|
Notification,
|
|
1958
2035
|
{
|
|
1959
2036
|
id,
|
|
@@ -1961,22 +2038,22 @@ function MatchNotification(props) {
|
|
|
1961
2038
|
open: true,
|
|
1962
2039
|
palette: "warning",
|
|
1963
2040
|
children: [
|
|
1964
|
-
/* @__PURE__ */ (0,
|
|
1965
|
-
/* @__PURE__ */ (0,
|
|
2041
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(NotificationHeading, { palette: "warning", children: heading }),
|
|
2042
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(NotificationDescription, { palette: "warning", children: description })
|
|
1966
2043
|
]
|
|
1967
2044
|
},
|
|
1968
2045
|
id
|
|
1969
2046
|
);
|
|
1970
2047
|
case "danger":
|
|
1971
|
-
return /* @__PURE__ */ (0,
|
|
1972
|
-
/* @__PURE__ */ (0,
|
|
1973
|
-
/* @__PURE__ */ (0,
|
|
2048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Notification, { id, onClose, open: true, palette: "danger", children: [
|
|
2049
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(NotificationHeading, { palette: "danger", children: heading }),
|
|
2050
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(NotificationDescription, { palette: "danger", children: description })
|
|
1974
2051
|
] }, id);
|
|
1975
2052
|
case "info":
|
|
1976
2053
|
default:
|
|
1977
|
-
return /* @__PURE__ */ (0,
|
|
1978
|
-
/* @__PURE__ */ (0,
|
|
1979
|
-
/* @__PURE__ */ (0,
|
|
2054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Notification, { id, onClose, open: true, palette: "info", children: [
|
|
2055
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(NotificationHeading, { palette: "info", children: heading }),
|
|
2056
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(NotificationDescription, { palette: "info", children: description })
|
|
1980
2057
|
] }, id);
|
|
1981
2058
|
}
|
|
1982
2059
|
}
|
|
@@ -1994,7 +2071,7 @@ function useNotificationCenter() {
|
|
|
1994
2071
|
var import_react18 = require("react");
|
|
1995
2072
|
var import_css37 = require("@cerberus/styled-system/css");
|
|
1996
2073
|
var import_patterns15 = require("@cerberus/styled-system/patterns");
|
|
1997
|
-
var
|
|
2074
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
1998
2075
|
var PromptModalContext = (0, import_react18.createContext)(null);
|
|
1999
2076
|
function PromptModal(props) {
|
|
2000
2077
|
const { modalRef, show, close } = useModal();
|
|
@@ -2044,36 +2121,36 @@ function PromptModal(props) {
|
|
|
2044
2121
|
}),
|
|
2045
2122
|
[handleShow]
|
|
2046
2123
|
);
|
|
2047
|
-
return /* @__PURE__ */ (0,
|
|
2124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(PromptModalContext.Provider, { value, children: [
|
|
2048
2125
|
props.children,
|
|
2049
|
-
/* @__PURE__ */ (0,
|
|
2050
|
-
/* @__PURE__ */ (0,
|
|
2051
|
-
/* @__PURE__ */ (0,
|
|
2126
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Modal, { onKeyDown: focusTrap, ref: modalRef, children: [
|
|
2127
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(ModalHeader, { children: [
|
|
2128
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2052
2129
|
"div",
|
|
2053
2130
|
{
|
|
2054
2131
|
className: (0, import_patterns15.hstack)({
|
|
2055
2132
|
justify: "center",
|
|
2056
2133
|
w: "full"
|
|
2057
2134
|
}),
|
|
2058
|
-
children: /* @__PURE__ */ (0,
|
|
2135
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2059
2136
|
Show,
|
|
2060
2137
|
{
|
|
2061
2138
|
when: palette === "danger",
|
|
2062
|
-
fallback: /* @__PURE__ */ (0,
|
|
2139
|
+
fallback: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2063
2140
|
Avatar,
|
|
2064
2141
|
{
|
|
2065
2142
|
ariaLabel: "",
|
|
2066
2143
|
gradient: "charon-light",
|
|
2067
|
-
icon: /* @__PURE__ */ (0,
|
|
2144
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(PromptIcon, { size: 24 }),
|
|
2068
2145
|
src: ""
|
|
2069
2146
|
}
|
|
2070
2147
|
),
|
|
2071
|
-
children: /* @__PURE__ */ (0,
|
|
2148
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2072
2149
|
Avatar,
|
|
2073
2150
|
{
|
|
2074
2151
|
ariaLabel: "",
|
|
2075
2152
|
gradient: "hades-dark",
|
|
2076
|
-
icon: /* @__PURE__ */ (0,
|
|
2153
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(PromptIcon, { size: 24 }),
|
|
2077
2154
|
src: ""
|
|
2078
2155
|
}
|
|
2079
2156
|
)
|
|
@@ -2081,10 +2158,10 @@ function PromptModal(props) {
|
|
|
2081
2158
|
)
|
|
2082
2159
|
}
|
|
2083
2160
|
),
|
|
2084
|
-
/* @__PURE__ */ (0,
|
|
2085
|
-
/* @__PURE__ */ (0,
|
|
2161
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ModalHeading, { children: content == null ? void 0 : content.heading }),
|
|
2162
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(ModalDescription, { children: content == null ? void 0 : content.description })
|
|
2086
2163
|
] }),
|
|
2087
|
-
/* @__PURE__ */ (0,
|
|
2164
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2088
2165
|
"div",
|
|
2089
2166
|
{
|
|
2090
2167
|
className: (0, import_patterns15.vstack)({
|
|
@@ -2092,10 +2169,10 @@ function PromptModal(props) {
|
|
|
2092
2169
|
mt: "4",
|
|
2093
2170
|
mb: "8"
|
|
2094
2171
|
}),
|
|
2095
|
-
children: /* @__PURE__ */ (0,
|
|
2096
|
-
/* @__PURE__ */ (0,
|
|
2172
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Field, { invalid: !isValid, children: [
|
|
2173
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Label, { htmlFor: "confirm", size: "md", children: [
|
|
2097
2174
|
"Type",
|
|
2098
|
-
/* @__PURE__ */ (0,
|
|
2175
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2099
2176
|
"strong",
|
|
2100
2177
|
{
|
|
2101
2178
|
className: (0, import_css37.css)({
|
|
@@ -2106,7 +2183,7 @@ function PromptModal(props) {
|
|
|
2106
2183
|
),
|
|
2107
2184
|
"to confirm"
|
|
2108
2185
|
] }),
|
|
2109
|
-
/* @__PURE__ */ (0,
|
|
2186
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2110
2187
|
Input,
|
|
2111
2188
|
{
|
|
2112
2189
|
id: "confirm",
|
|
@@ -2118,7 +2195,7 @@ function PromptModal(props) {
|
|
|
2118
2195
|
] })
|
|
2119
2196
|
}
|
|
2120
2197
|
),
|
|
2121
|
-
/* @__PURE__ */ (0,
|
|
2198
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
2122
2199
|
"div",
|
|
2123
2200
|
{
|
|
2124
2201
|
className: (0, import_patterns15.hstack)({
|
|
@@ -2126,7 +2203,7 @@ function PromptModal(props) {
|
|
|
2126
2203
|
gap: "4"
|
|
2127
2204
|
}),
|
|
2128
2205
|
children: [
|
|
2129
|
-
/* @__PURE__ */ (0,
|
|
2206
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2130
2207
|
Button,
|
|
2131
2208
|
{
|
|
2132
2209
|
autoFocus: true,
|
|
@@ -2141,7 +2218,7 @@ function PromptModal(props) {
|
|
|
2141
2218
|
children: content == null ? void 0 : content.actionText
|
|
2142
2219
|
}
|
|
2143
2220
|
),
|
|
2144
|
-
/* @__PURE__ */ (0,
|
|
2221
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
2145
2222
|
Button,
|
|
2146
2223
|
{
|
|
2147
2224
|
className: (0, import_css37.css)({
|
|
@@ -2235,7 +2312,7 @@ function useTheme(defaultTheme = "cerberus", defaultColorMode = "light", options
|
|
|
2235
2312
|
}
|
|
2236
2313
|
|
|
2237
2314
|
// src/context/theme.tsx
|
|
2238
|
-
var
|
|
2315
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
2239
2316
|
var ThemeContext = (0, import_react20.createContext)(
|
|
2240
2317
|
null
|
|
2241
2318
|
);
|
|
@@ -2245,7 +2322,7 @@ function ThemeProvider(props) {
|
|
|
2245
2322
|
updateMode: props.updateMode,
|
|
2246
2323
|
updateTheme: props.updateTheme
|
|
2247
2324
|
});
|
|
2248
|
-
return /* @__PURE__ */ (0,
|
|
2325
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ThemeContext.Provider, { value: state, children: props.children });
|
|
2249
2326
|
}
|
|
2250
2327
|
function useThemeContext() {
|
|
2251
2328
|
const context = (0, import_react20.useContext)(ThemeContext);
|
|
@@ -2312,6 +2389,7 @@ __reExport(src_exports, require("@dnd-kit/core"), module.exports);
|
|
|
2312
2389
|
Radio,
|
|
2313
2390
|
Select,
|
|
2314
2391
|
Show,
|
|
2392
|
+
Spinner,
|
|
2315
2393
|
THEME_KEY,
|
|
2316
2394
|
Tab,
|
|
2317
2395
|
TabList,
|