@mbpockets/shared-ui 0.1.19 → 0.1.20

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.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import React7, { createContext, useState, useEffect, useContext, useMemo, useRef } from 'react';
3
3
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
4
- import { Box, Grid, TextField, Tooltip, IconButton, Button, CircularProgress, Dialog, DialogTitle, DialogContent, DialogActions, Card, CardContent, Typography, FormControl, InputLabel, Select, MenuItem, Chip as Chip$1, LinearProgress, CardMedia, useTheme, useMediaQuery, CardHeader } from '@mui/material';
4
+ import { Box, Grid, TextField, Tooltip, IconButton, Button, CircularProgress, Dialog, DialogTitle, DialogContent, DialogActions, Card, CardContent, Typography, FormControl, InputLabel, Select, MenuItem, Chip as Chip$1, LinearProgress, CardMedia, CardHeader, useTheme, useMediaQuery, NoSsr } from '@mui/material';
5
5
  import DeleteIcon from '@mui/icons-material/Delete';
6
6
  import EditIcon from '@mui/icons-material/Edit';
7
7
  import AddIcon from '@mui/icons-material/Add';
@@ -9,7 +9,7 @@ import ColorizeIcon from '@mui/icons-material/Colorize';
9
9
  import CancelIcon from '@mui/icons-material/Cancel';
10
10
  import CheckCircleIcon from '@mui/icons-material/CheckCircle';
11
11
  import Box2 from '@mui/material/Box';
12
- import Grid9 from '@mui/material/Grid';
12
+ import Grid8 from '@mui/material/Grid';
13
13
  import Card10 from '@mui/material/Card';
14
14
  import CardContent10 from '@mui/material/CardContent';
15
15
  import CardHeader4 from '@mui/material/CardHeader';
@@ -21,12 +21,12 @@ import LocationOnIcon from '@mui/icons-material/LocationOn';
21
21
  import EventIcon from '@mui/icons-material/Event';
22
22
  import Autocomplete from '@mui/material/Autocomplete';
23
23
  import Popper from '@mui/material/Popper';
24
- import TextField3 from '@mui/material/TextField';
25
24
  import Typography10 from '@mui/material/Typography';
26
25
  import FormControl2 from '@mui/material/FormControl';
27
26
  import RadioGroup from '@mui/material/RadioGroup';
28
27
  import FormControlLabel from '@mui/material/FormControlLabel';
29
28
  import Radio from '@mui/material/Radio';
29
+ import TextField4 from '@mui/material/TextField';
30
30
  import FormGroup from '@mui/material/FormGroup';
31
31
  import Checkbox from '@mui/material/Checkbox';
32
32
  import Button7 from '@mui/material/Button';
@@ -478,7 +478,7 @@ function EventBasicInfo(props) {
478
478
  );
479
479
  }
480
480
  function EventBasicInfoView({ description, locationId, startingDate, endingDate, timeInfo, timezone, isOwner, onEdit }) {
481
- return /* @__PURE__ */ jsx(Grid9, { sx: { position: "relative" }, children: /* @__PURE__ */ jsx(Card, { style: {
481
+ return /* @__PURE__ */ jsx(Grid8, { sx: { position: "relative" }, children: /* @__PURE__ */ jsx(Card, { style: {
482
482
  boxShadow: "0px 4px 10px rgba(0, 0, 0, 0.1)",
483
483
  background: "linear-gradient(135deg, rgba(225, 225, 225, 1), rgba(250, 250, 250, 1))"
484
484
  }, children: /* @__PURE__ */ jsxs(CardContent, { children: [
@@ -762,7 +762,7 @@ function EventBannerView({
762
762
  }) {
763
763
  const backgroundColor = bannerColor || "linear-gradient(135deg, rgba(25,118,210,0.8), rgba(25,118,210,1))";
764
764
  return /* @__PURE__ */ jsxs(
765
- Grid9,
765
+ Grid8,
766
766
  {
767
767
  sx: {
768
768
  background: backgroundColor,
@@ -770,7 +770,7 @@ function EventBannerView({
770
770
  position: "relative"
771
771
  },
772
772
  children: [
773
- /* @__PURE__ */ jsxs(Grid9, { children: [
773
+ /* @__PURE__ */ jsxs(Grid8, { children: [
774
774
  /* @__PURE__ */ jsxs(
775
775
  Box,
776
776
  {
@@ -829,7 +829,7 @@ function EventBannerView({
829
829
  }
830
830
  ),
831
831
  /* @__PURE__ */ jsxs(
832
- Grid9,
832
+ Grid8,
833
833
  {
834
834
  display: "flex",
835
835
  justifyContent: "center",
@@ -1228,27 +1228,28 @@ function EventPageLayout({
1228
1228
  tables,
1229
1229
  allTags
1230
1230
  }) {
1231
- return /* @__PURE__ */ jsx(Grid9, { container: true, flexDirection: "column", children: /* @__PURE__ */ jsxs(EventEditProvider, { initialEvent: mergedEvent, value: { isOwner, updateEvent, updateImages }, children: [
1232
- /* @__PURE__ */ jsx(Grid9, { children: /* @__PURE__ */ jsx(
1231
+ return /* @__PURE__ */ jsx(Grid8, { container: true, flexDirection: "column", children: /* @__PURE__ */ jsxs(EventEditProvider, { initialEvent: mergedEvent, value: { isOwner, updateEvent, updateImages }, children: [
1232
+ /* @__PURE__ */ jsx(Grid8, { children: /* @__PURE__ */ jsx(
1233
1233
  EventBanner,
1234
1234
  {
1235
1235
  attendees,
1236
1236
  numGames
1237
1237
  }
1238
1238
  ) }),
1239
- /* @__PURE__ */ jsxs(Grid9, { container: true, flexDirection: "row", spacing: 3, size: { xs: 12, md: 12 }, children: [
1240
- /* @__PURE__ */ jsx(Grid9, { size: { xs: 12, md: 4 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsx(
1239
+ /* @__PURE__ */ jsxs(Grid8, { container: true, flexDirection: "row", spacing: 3, size: { xs: 12, md: 12 }, children: [
1240
+ /* @__PURE__ */ jsx(Grid8, { size: { xs: 12, md: 4 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsx(
1241
1241
  EventBasicInfo,
1242
1242
  {
1243
1243
  locationId: mergedEvent.location || "0"
1244
1244
  }
1245
1245
  ) }),
1246
- /* @__PURE__ */ jsx(Grid9, { size: { xs: 12, md: 8 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsx(EventTablesCard_default, { tables, tags: allTags }) })
1246
+ /* @__PURE__ */ jsx(Grid8, { size: { xs: 12, md: 8 }, spacing: 3, padding: 3, children: /* @__PURE__ */ jsx(EventTablesCard_default, { tables, tags: allTags }) })
1247
1247
  ] }),
1248
- /* @__PURE__ */ jsx(Grid9, {})
1248
+ /* @__PURE__ */ jsx(Grid8, {})
1249
1249
  ] }) });
1250
1250
  }
1251
- var PlayerDetails = ({
1251
+ var PlayerDetailsCard = ({
1252
+ preferredPronouns,
1252
1253
  age,
1253
1254
  yearsPlaying,
1254
1255
  discordUsername,
@@ -1298,6 +1299,23 @@ var PlayerDetails = ({
1298
1299
  }
1299
1300
  ),
1300
1301
  /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
1302
+ preferredPronouns && /* @__PURE__ */ jsxs(
1303
+ Typography,
1304
+ {
1305
+ variant: "body2",
1306
+ className: "text-sm font-medium",
1307
+ sx: {
1308
+ color: "#FFFFFF",
1309
+ textShadow: "0px 2px 6px rgba(0, 0, 0, 0.5)",
1310
+ fontWeight: "bold"
1311
+ },
1312
+ children: [
1313
+ /* @__PURE__ */ jsx("span", { className: "font-extrabold text-cyan-300", children: "Preferred Pronouns:" }),
1314
+ " ",
1315
+ preferredPronouns
1316
+ ]
1317
+ }
1318
+ ),
1301
1319
  age !== null && /* @__PURE__ */ jsxs(
1302
1320
  Typography,
1303
1321
  {
@@ -1349,7 +1367,7 @@ var PlayerDetails = ({
1349
1367
  ]
1350
1368
  }
1351
1369
  ),
1352
- preferredGames && preferredGames.length > 0 && /* @__PURE__ */ jsxs(
1370
+ preferredGames && /* @__PURE__ */ jsxs(
1353
1371
  Typography,
1354
1372
  {
1355
1373
  variant: "body2",
@@ -1362,7 +1380,7 @@ var PlayerDetails = ({
1362
1380
  children: [
1363
1381
  /* @__PURE__ */ jsx("span", { className: "font-extrabold text-cyan-300", children: "Preferred Games:" }),
1364
1382
  " ",
1365
- preferredGames.join(", ")
1383
+ Array.isArray(preferredGames) ? preferredGames.join(", ") : preferredGames
1366
1384
  ]
1367
1385
  }
1368
1386
  )
@@ -1385,24 +1403,20 @@ var PlayerDetails = ({
1385
1403
  }
1386
1404
  );
1387
1405
  };
1388
- var PlayerDetailsCard_default = PlayerDetails;
1406
+ var PlayerDetailsCard_default = PlayerDetailsCard;
1389
1407
 
1390
1408
  // src/data/values.tsx
1391
1409
  var ProfilePictureSettings = {
1392
1410
  aspectRatio: 4 / 5};
1393
- var { aspectRatio } = ProfilePictureSettings;
1394
- var PlayerDisplayCard = ({
1395
- profilePicture,
1396
- username,
1397
- bio,
1398
- preferredPronouns
1399
- }) => {
1400
- const [imageSrc, setImageSrc] = useState("/man-walking-silhouette-clipart.jpg");
1411
+ var PlayerDisplayCard = ({ profilePicture, username, bio, preferredPronouns }) => {
1412
+ const defaultImg = "/man-walking-silhouette-clipart.jpg";
1413
+ const [imageSrc, setImageSrc] = useState(defaultImg);
1414
+ const { aspectRatio } = ProfilePictureSettings;
1401
1415
  useEffect(() => {
1402
1416
  async function validateImage() {
1403
- const newImage = profilePicture || "/man-walking-silhouette-clipart.jpg";
1417
+ const newImage = profilePicture || defaultImg;
1404
1418
  if (!profilePicture) {
1405
- setImageSrc("/man-walking-silhouette-clipart.jpg");
1419
+ setImageSrc(defaultImg);
1406
1420
  return;
1407
1421
  }
1408
1422
  const img = new Image();
@@ -1411,7 +1425,7 @@ var PlayerDisplayCard = ({
1411
1425
  setImageSrc(newImage);
1412
1426
  };
1413
1427
  img.onerror = () => {
1414
- setImageSrc("/man-walking-silhouette-clipart.jpg");
1428
+ setImageSrc(defaultImg);
1415
1429
  };
1416
1430
  }
1417
1431
  validateImage();
@@ -1445,7 +1459,7 @@ var PlayerDisplayCard = ({
1445
1459
  height: "auto",
1446
1460
  // Updates to maintain aspect ratio and fill space nicely
1447
1461
  width: "100%",
1448
- objectFit: "scale-down"
1462
+ objectFit: "cover"
1449
1463
  }
1450
1464
  }
1451
1465
  ),
@@ -1504,104 +1518,127 @@ var PlayerDisplayCard = ({
1504
1518
  );
1505
1519
  };
1506
1520
  var PlayerDisplayCard_default = PlayerDisplayCard;
1507
- var PlayerPromptCard = ({ title, description }) => {
1508
- return /* @__PURE__ */ jsx(
1509
- Card,
1510
- {
1511
- sx: {
1512
- margin: "1rem",
1513
- background: "linear-gradient(135deg, rgba(25, 118, 210, 0.8), rgba(25, 118, 210, 1))",
1514
- // Gradient color scheme
1515
- boxShadow: "0px 8px 15px rgba(25, 118, 210, 0.3)",
1516
- // Card shadow
1517
- borderRadius: "12px",
1518
- // Rounded corners
1519
- color: "#FFFFFF",
1520
- // Text contrast with the background
1521
- overflow: "hidden"
1522
- // Keeps consistent and clean card shape
1523
- },
1524
- className: "transition duration-300 transform hover:scale-105 hover:shadow-2xl",
1525
- children: /* @__PURE__ */ jsxs(CardContent, { className: "p-6", children: [
1526
- title && /* @__PURE__ */ jsx(
1527
- Typography,
1528
- {
1529
- variant: "h5",
1530
- className: "font-bold text-lg uppercase text-center tracking-wide mb-4",
1531
- sx: {
1532
- color: "#FFFFFF",
1533
- // Bright white for high visibility
1534
- textShadow: "0px 3px 6px rgba(0, 0, 0, 0.5)",
1535
- // Strong text shadow for contrast
1536
- fontSize: "1.5rem"
1537
- },
1538
- children: title
1539
- }
1540
- ),
1541
- description && /* @__PURE__ */ jsx(
1542
- Typography,
1543
- {
1544
- variant: "body2",
1545
- className: "text-sm font-medium text-center",
1546
- sx: {
1547
- color: "#E3F2FD",
1548
- // Softer light blue for description
1549
- textShadow: "0px 2px 4px rgba(0, 0, 0, 0.3)",
1550
- // Subtle shadow
1551
- lineHeight: 1.6,
1552
- marginTop: "1rem"
1553
- },
1554
- children: description
1521
+ var PlayerTagsCard = ({ tags = [] }) => {
1522
+ return /* @__PURE__ */ jsxs(Card, { sx: {
1523
+ margin: "1rem",
1524
+ borderRadius: "12px",
1525
+ boxShadow: "0px 8px 15px rgba(25, 118, 210, 0.3)",
1526
+ overflow: "hidden"
1527
+ }, className: "transition duration-300 transform hover:scale-105 hover:shadow-2xl", children: [
1528
+ /* @__PURE__ */ jsx(
1529
+ CardHeader,
1530
+ {
1531
+ title: "Player Tags",
1532
+ sx: {
1533
+ background: "linear-gradient(135deg, rgba(25, 118, 210, 0.8), rgba(25, 118, 210, 1))",
1534
+ color: "#FFFFFF",
1535
+ fontSize: "1.5rem",
1536
+ textShadow: "0px 3px 6px rgba(0, 0, 0, 0.5)",
1537
+ "& .MuiCardHeader-title": {
1538
+ fontWeight: "bold",
1539
+ fontSize: "1.5rem",
1540
+ textAlign: "center",
1541
+ textTransform: "uppercase",
1542
+ letterSpacing: "0.05em"
1555
1543
  }
1556
- )
1557
- ] })
1558
- }
1559
- );
1544
+ }
1545
+ }
1546
+ ),
1547
+ /* @__PURE__ */ jsx(CardContent, { className: "p-6", children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2", children: tags.map((tag) => /* @__PURE__ */ jsx(Chip, { tag }, tag.id)) }) })
1548
+ ] });
1560
1549
  };
1561
- var PlayerPromptCard_default = PlayerPromptCard;
1562
- function PlayerTagsCard(props) {
1563
- return /* @__PURE__ */ jsx(Grid9, { container: true, children: /* @__PURE__ */ jsx(Grid9, { size: { xs: 12, md: 3 }, children: /* @__PURE__ */ jsxs(Card10, { children: [
1564
- /* @__PURE__ */ jsx(CardHeader4, { title: "Player Tags", style: {
1550
+ var PlayerTagsCard_default = PlayerTagsCard;
1551
+ var PlayerPromptCard = ({ title, description }) => /* @__PURE__ */ jsx(
1552
+ Card,
1553
+ {
1554
+ sx: {
1555
+ margin: "1rem",
1565
1556
  background: "linear-gradient(135deg, rgba(25, 118, 210, 0.8), rgba(25, 118, 210, 1))",
1557
+ // Gradient color scheme
1558
+ boxShadow: "0px 8px 15px rgba(25, 118, 210, 0.3)",
1559
+ // Card shadow
1560
+ borderRadius: "12px",
1561
+ // Rounded corners
1566
1562
  color: "#FFFFFF",
1567
- // Pure white for username
1568
- fontSize: "1.5rem",
1569
- textShadow: "0px 3px 6px rgba(0, 0, 0, 0.5)"
1570
- // Strong shadow for visibility
1571
- } }),
1572
- /* @__PURE__ */ jsx(CardContent10, { children: renderLabels(props.PlayerTags) })
1573
- ] }) }) });
1574
- }
1575
- var renderLabels = (tags) => {
1576
- return /* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: tags.map((tag) => /* @__PURE__ */ jsx(Chip, { tag }, tag.id)) });
1577
- };
1578
- function TagEditor({
1579
- title = "Tags",
1580
- selectedTags,
1581
- possibleTags,
1563
+ // Text contrast with the background
1564
+ overflow: "hidden"
1565
+ // Keeps consistent and clean card shape
1566
+ },
1567
+ className: "transition duration-300 transform hover:scale-105 hover:shadow-2xl",
1568
+ children: /* @__PURE__ */ jsxs(CardContent, { className: "p-6", children: [
1569
+ title && /* @__PURE__ */ jsx(
1570
+ Typography,
1571
+ {
1572
+ variant: "h5",
1573
+ className: "font-bold text-lg uppercase text-center tracking-wide mb-4",
1574
+ sx: {
1575
+ color: "#FFFFFF",
1576
+ // Bright white for high visibility
1577
+ textShadow: "0px 3px 6px rgba(0, 0, 0, 0.5)",
1578
+ // Strong text shadow for contrast
1579
+ fontSize: "1.5rem"
1580
+ },
1581
+ children: title
1582
+ }
1583
+ ),
1584
+ description && /* @__PURE__ */ jsx(
1585
+ Typography,
1586
+ {
1587
+ variant: "body2",
1588
+ className: "text-sm font-medium text-center",
1589
+ sx: {
1590
+ color: "#E3F2FD",
1591
+ // Softer light blue for description
1592
+ textShadow: "0px 2px 4px rgba(0, 0, 0, 0.3)",
1593
+ // Subtle shadow
1594
+ lineHeight: 1.6,
1595
+ marginTop: "1rem"
1596
+ },
1597
+ children: description
1598
+ }
1599
+ )
1600
+ ] })
1601
+ }
1602
+ );
1603
+ var PlayerPromptCard_default = PlayerPromptCard;
1604
+ var PlayerTagsEdit = ({
1605
+ selectedTags = [],
1606
+ possibleTags = [],
1582
1607
  onToggleTag
1583
- }) {
1608
+ }) => {
1584
1609
  const [inputValue, setInputValue] = useState("");
1585
1610
  const selectedIds = useMemo(() => selectedTags.map((tag) => tag.id), [selectedTags]);
1586
1611
  const options = useMemo(
1587
- () => possibleTags.map((tag) => ({ value: tag.id, label: tag.label })),
1612
+ () => possibleTags.map((tag) => ({ value: tag.id, label: tag.label, alternate_title: tag.alternate_title })),
1588
1613
  [possibleTags]
1589
1614
  );
1590
- return /* @__PURE__ */ jsx(Grid9, { container: true, children: /* @__PURE__ */ jsx(Grid9, { size: { xs: 12 }, children: /* @__PURE__ */ jsxs(Card10, { children: [
1615
+ return /* @__PURE__ */ jsxs(Card, { sx: {
1616
+ margin: "1rem",
1617
+ borderRadius: "12px",
1618
+ boxShadow: "0px 8px 15px rgba(25, 118, 210, 0.3)",
1619
+ overflow: "hidden"
1620
+ }, children: [
1591
1621
  /* @__PURE__ */ jsx(
1592
- CardHeader4,
1622
+ CardHeader,
1593
1623
  {
1594
- title,
1595
- style: {
1624
+ title: "Player Tags",
1625
+ sx: {
1596
1626
  background: "linear-gradient(135deg, rgba(25, 118, 210, 0.8), rgba(25, 118, 210, 1))",
1597
1627
  color: "#FFFFFF",
1598
1628
  fontSize: "1.5rem",
1599
- textShadow: "0px 3px 6px rgba(0, 0, 0, 0.5)"
1629
+ textShadow: "0px 3px 6px rgba(0, 0, 0, 0.5)",
1630
+ "& .MuiCardHeader-title": {
1631
+ fontWeight: "bold",
1632
+ fontSize: "1.5rem",
1633
+ textAlign: "center",
1634
+ textTransform: "uppercase",
1635
+ letterSpacing: "0.05em"
1636
+ }
1600
1637
  }
1601
1638
  }
1602
1639
  ),
1603
- /* @__PURE__ */ jsxs(CardContent10, { children: [
1604
- /* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: selectedTags.map((tag) => /* @__PURE__ */ jsx(
1640
+ /* @__PURE__ */ jsxs(CardContent, { className: "p-6", children: [
1641
+ /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-2 mb-4", children: selectedTags.map((tag) => /* @__PURE__ */ jsx(
1605
1642
  Chip,
1606
1643
  {
1607
1644
  tag,
@@ -1609,13 +1646,19 @@ function TagEditor({
1609
1646
  },
1610
1647
  tag.id
1611
1648
  )) }),
1612
- /* @__PURE__ */ jsx(Grid9, { container: true, spacing: 3, children: /* @__PURE__ */ jsx(Grid9, { sx: { marginTop: 3, width: "100%" }, children: /* @__PURE__ */ jsx(
1649
+ /* @__PURE__ */ jsx(
1613
1650
  Autocomplete,
1614
1651
  {
1615
1652
  options,
1616
- filterOptions: (availableOptions, state) => availableOptions.filter(
1617
- (option) => !selectedIds.includes(option.value) && option.label.toLowerCase().includes(state.inputValue.toLowerCase())
1618
- ).slice(0, 3),
1653
+ filterOptions: (availableOptions, state) => {
1654
+ const query = state.inputValue.toLowerCase();
1655
+ return availableOptions.filter(
1656
+ (option) => {
1657
+ var _a;
1658
+ return !selectedIds.includes(option.value) && (option.label.toLowerCase().includes(query) || ((_a = option.alternate_title) == null ? void 0 : _a.some((title) => title.toLowerCase().includes(query))));
1659
+ }
1660
+ ).slice(0, 5);
1661
+ },
1619
1662
  value: null,
1620
1663
  inputValue,
1621
1664
  onInputChange: (event, newInputValue) => {
@@ -1630,13 +1673,20 @@ function TagEditor({
1630
1673
  setInputValue("");
1631
1674
  },
1632
1675
  slots: { popper: CustomPopper },
1633
- renderInput: (params) => /* @__PURE__ */ jsx(TextField3, { ...params, label: "Select Tags" })
1676
+ renderInput: (params) => /* @__PURE__ */ jsx(
1677
+ TextField,
1678
+ {
1679
+ ...params,
1680
+ label: "Select Tags",
1681
+ variant: "outlined"
1682
+ }
1683
+ )
1634
1684
  },
1635
1685
  selectedIds.join("-")
1636
- ) }) })
1686
+ )
1637
1687
  ] })
1638
- ] }) }) });
1639
- }
1688
+ ] });
1689
+ };
1640
1690
  var CustomPopper = (props) => {
1641
1691
  return /* @__PURE__ */ jsx(
1642
1692
  Popper,
@@ -1645,27 +1695,84 @@ var CustomPopper = (props) => {
1645
1695
  modifiers: [
1646
1696
  {
1647
1697
  name: "preventOverflow",
1648
- options: { boundary: "viewport" }
1698
+ options: {
1699
+ boundary: "viewport"
1700
+ }
1649
1701
  },
1650
1702
  {
1651
1703
  name: "offset",
1652
- options: { offset: [0, -10] }
1704
+ options: {
1705
+ offset: [0, -10]
1706
+ }
1653
1707
  }
1654
1708
  ],
1655
1709
  placement: "top-start"
1656
1710
  }
1657
1711
  );
1658
1712
  };
1659
- function PlayerTagsEdit(props) {
1660
- return /* @__PURE__ */ jsx(
1661
- TagEditor,
1713
+ var PlayerTagsEdit_default = PlayerTagsEdit;
1714
+ function PlayerPageLayout({
1715
+ playerData,
1716
+ tags = [],
1717
+ blurbs = [],
1718
+ isOwner = false,
1719
+ possibleTags = [],
1720
+ onToggleTag = () => {
1721
+ }
1722
+ }) {
1723
+ const theme = useTheme();
1724
+ const isSmallScreen = useMediaQuery(theme.breakpoints.down("lg"));
1725
+ const tagsElement = isOwner ? /* @__PURE__ */ jsx(
1726
+ PlayerTagsEdit_default,
1662
1727
  {
1663
- title: "Player Tags",
1664
- selectedTags: props.PlayerTags,
1665
- possibleTags: props.possibleTags,
1666
- onToggleTag: props.updatePlayerTags
1728
+ selectedTags: tags,
1729
+ possibleTags,
1730
+ onToggleTag
1667
1731
  }
1668
- );
1732
+ ) : /* @__PURE__ */ jsx(PlayerTagsCard_default, { tags });
1733
+ return /* @__PURE__ */ jsx(NoSsr, { children: /* @__PURE__ */ jsx(Box, { sx: { padding: "2rem", marginRight: "auto", marginLeft: "auto" }, justifyContent: "center", children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 3, justifyContent: "center", sx: { marginRight: "auto", marginLeft: "auto" }, children: [
1734
+ !isSmallScreen && /* @__PURE__ */ jsxs(Grid, { size: { xs: 12, lg: 3 }, children: [
1735
+ /* @__PURE__ */ jsx(
1736
+ PlayerDetailsCard_default,
1737
+ {
1738
+ preferredPronouns: playerData.preferredPronouns,
1739
+ age: playerData.age,
1740
+ yearsPlaying: playerData.yearsPlaying,
1741
+ discordUsername: playerData.discordUsername,
1742
+ preferredGames: playerData.preferredGames
1743
+ }
1744
+ ),
1745
+ tagsElement
1746
+ ] }),
1747
+ /* @__PURE__ */ jsx(Grid, { size: { xs: 12, lg: 6 }, children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 3, children: [
1748
+ /* @__PURE__ */ jsx(Grid, { size: { xs: 12, lg: 8 }, children: /* @__PURE__ */ jsx(
1749
+ PlayerDisplayCard_default,
1750
+ {
1751
+ profilePicture: playerData.profilePicture,
1752
+ username: playerData.username,
1753
+ bio: playerData.bio,
1754
+ preferredPronouns: playerData.preferredPronouns
1755
+ }
1756
+ ) }),
1757
+ isSmallScreen && /* @__PURE__ */ jsx(Grid, { size: { xs: 12, lg: 3 }, children: /* @__PURE__ */ jsx(
1758
+ PlayerDetailsCard_default,
1759
+ {
1760
+ preferredPronouns: playerData.preferredPronouns,
1761
+ age: playerData.age,
1762
+ yearsPlaying: playerData.yearsPlaying,
1763
+ discordUsername: playerData.discordUsername,
1764
+ preferredGames: playerData.preferredGames
1765
+ }
1766
+ ) }),
1767
+ blurbs.map((blurb, index) => /* @__PURE__ */ jsx(Grid, { size: { xs: 12, lg: 8 }, children: /* @__PURE__ */ jsx(
1768
+ PlayerPromptCard_default,
1769
+ {
1770
+ title: blurb.title,
1771
+ description: blurb.description
1772
+ }
1773
+ ) }, index))
1774
+ ] }) })
1775
+ ] }) }) });
1669
1776
  }
1670
1777
  var SORT_OPTIONS = [
1671
1778
  { id: "relevance", label: "Relevance" },
@@ -1824,7 +1931,7 @@ var TagsFilter = ({
1824
1931
  });
1825
1932
  },
1826
1933
  slots: { popper: CustomPopper2 },
1827
- renderInput: (params) => /* @__PURE__ */ jsx(TextField3, { ...params, label: `Select ${label}` })
1934
+ renderInput: (params) => /* @__PURE__ */ jsx(TextField4, { ...params, label: `Select ${label}` })
1828
1935
  },
1829
1936
  `${category}-${selectedTags.join("-")}`
1830
1937
  )
@@ -1994,8 +2101,8 @@ function SearchPageLayout({
1994
2101
  }
1995
2102
  }
1996
2103
  ) }),
1997
- /* @__PURE__ */ jsxs(Grid9, { container: true, spacing: 2, children: [
1998
- /* @__PURE__ */ jsx(Grid9, { size: { xs: 12, md: 3 }, children: /* @__PURE__ */ jsxs(Card10, { sx: { marginBottom: isMobile ? 2 : 0 }, children: [
2104
+ /* @__PURE__ */ jsxs(Grid8, { container: true, spacing: 2, children: [
2105
+ /* @__PURE__ */ jsx(Grid8, { size: { xs: 12, md: 3 }, children: /* @__PURE__ */ jsxs(Card10, { sx: { marginBottom: isMobile ? 2 : 0 }, children: [
1999
2106
  /* @__PURE__ */ jsx(
2000
2107
  CardHeader4,
2001
2108
  {
@@ -2018,7 +2125,7 @@ function SearchPageLayout({
2018
2125
  }
2019
2126
  ) })
2020
2127
  ] }) }),
2021
- /* @__PURE__ */ jsx(Grid9, { size: { xs: 12, md: 9 }, children: /* @__PURE__ */ jsxs(Card10, { children: [
2128
+ /* @__PURE__ */ jsx(Grid8, { size: { xs: 12, md: 9 }, children: /* @__PURE__ */ jsxs(Card10, { children: [
2022
2129
  /* @__PURE__ */ jsx(
2023
2130
  CardHeader4,
2024
2131
  {
@@ -2136,14 +2243,14 @@ var PlayerHighlightsCard = function(props) {
2136
2243
  removeFromTable
2137
2244
  } = props;
2138
2245
  return /* @__PURE__ */ jsx(Card, { elevation: 3, sx: { backgroundColor: canEdit ? "#fffbea" : "#f5f9fa", marginBottom: "6px" }, children: /* @__PURE__ */ jsxs(CardContent, { children: [
2139
- /* @__PURE__ */ jsxs(Grid9, { container: true, spacing: 2, direction: "column", children: [
2140
- /* @__PURE__ */ jsxs(Grid9, { container: true, direction: "row", children: [
2141
- /* @__PURE__ */ jsx(Grid9, { children: /* @__PURE__ */ jsx(Image2, { alt: player.username + "'s profile pic", height: 64, src: player.miniPic || "", width: 64 }) }),
2142
- /* @__PURE__ */ jsx(Grid9, { children: /* @__PURE__ */ jsx(Typography, { variant: "h5", children: player.username }) })
2246
+ /* @__PURE__ */ jsxs(Grid8, { container: true, spacing: 2, direction: "column", children: [
2247
+ /* @__PURE__ */ jsxs(Grid8, { container: true, direction: "row", children: [
2248
+ /* @__PURE__ */ jsx(Grid8, { children: /* @__PURE__ */ jsx(Image2, { alt: player.username + "'s profile pic", height: 64, src: player.miniPic || "", width: 64 }) }),
2249
+ /* @__PURE__ */ jsx(Grid8, { children: /* @__PURE__ */ jsx(Typography, { variant: "h5", children: player.username }) })
2143
2250
  ] }),
2144
- /* @__PURE__ */ jsx(Grid9, { children: renderTagsFromIds(player.tags, allTags) })
2251
+ /* @__PURE__ */ jsx(Grid8, { children: renderTagsFromIds(player.tags, allTags) })
2145
2252
  ] }),
2146
- canEdit && /* @__PURE__ */ jsxs(Grid9, { children: [
2253
+ canEdit && /* @__PURE__ */ jsxs(Grid8, { children: [
2147
2254
  /* @__PURE__ */ jsx(Button7, { onClick: () => removeFromTable(player), children: isWaitList ? /* @__PURE__ */ jsx("p", { children: "Deny Player" }) : /* @__PURE__ */ jsx("p", { children: "Remove Player" }) }),
2148
2255
  canChangeDungeonMaster && /* @__PURE__ */ jsx(Button7, { onClick: () => {
2149
2256
  handleAssignToDungeonMaster(player);
@@ -2155,11 +2262,11 @@ var PlayerHighlightsCard = function(props) {
2155
2262
  var DMHighlightsCard = function({ canEdit, player, allTags }) {
2156
2263
  return /* @__PURE__ */ jsxs(Card, { elevation: 3, sx: { backgroundColor: "#f5f9fa", marginBottom: "6px" }, children: [
2157
2264
  /* @__PURE__ */ jsx(CardHeader, { slotProps: { title: { variant: "h4" } }, title: "Game Master" }),
2158
- /* @__PURE__ */ jsx(CardContent, { sx: { backgroundColor: canEdit ? "#fffbea" : "inherit" }, children: /* @__PURE__ */ jsxs(Grid9, { container: true, spacing: 2, direction: "column", children: [
2159
- /* @__PURE__ */ jsx(Grid9, { children: /* @__PURE__ */ jsx(Typography, { variant: "h5", children: player.username }) }),
2160
- /* @__PURE__ */ jsxs(Grid9, { container: true, direction: "row", children: [
2161
- /* @__PURE__ */ jsx(Grid9, { children: /* @__PURE__ */ jsx(Image2, { alt: player.username + "'s profile pic", height: 120, src: player.imageUrl ? player.imageUrl : "", width: 256 }) }),
2162
- /* @__PURE__ */ jsx(Grid9, { children: renderTagsFromIds(player.tags, allTags) }),
2265
+ /* @__PURE__ */ jsx(CardContent, { sx: { backgroundColor: canEdit ? "#fffbea" : "inherit" }, children: /* @__PURE__ */ jsxs(Grid8, { container: true, spacing: 2, direction: "column", children: [
2266
+ /* @__PURE__ */ jsx(Grid8, { children: /* @__PURE__ */ jsx(Typography, { variant: "h5", children: player.username }) }),
2267
+ /* @__PURE__ */ jsxs(Grid8, { container: true, direction: "row", children: [
2268
+ /* @__PURE__ */ jsx(Grid8, { children: /* @__PURE__ */ jsx(Image2, { alt: player.username + "'s profile pic", height: 120, src: player.imageUrl ? player.imageUrl : "", width: 256 }) }),
2269
+ /* @__PURE__ */ jsx(Grid8, { children: renderTagsFromIds(player.tags, allTags) }),
2163
2270
  /* @__PURE__ */ jsx(Typography, { children: player.description })
2164
2271
  ] })
2165
2272
  ] }) })
@@ -2313,6 +2420,87 @@ var NextGameCountdown = ({ nextGameTime }) => {
2313
2420
  timeLeft
2314
2421
  ] });
2315
2422
  };
2423
+ function TagEditor({
2424
+ title = "Tags",
2425
+ selectedTags,
2426
+ possibleTags,
2427
+ onToggleTag
2428
+ }) {
2429
+ const [inputValue, setInputValue] = useState("");
2430
+ const selectedIds = useMemo(() => selectedTags.map((tag) => tag.id), [selectedTags]);
2431
+ const options = useMemo(
2432
+ () => possibleTags.map((tag) => ({ value: tag.id, label: tag.label })),
2433
+ [possibleTags]
2434
+ );
2435
+ return /* @__PURE__ */ jsx(Grid8, { container: true, children: /* @__PURE__ */ jsx(Grid8, { size: { xs: 12 }, children: /* @__PURE__ */ jsxs(Card10, { children: [
2436
+ /* @__PURE__ */ jsx(
2437
+ CardHeader4,
2438
+ {
2439
+ title,
2440
+ style: {
2441
+ background: "linear-gradient(135deg, rgba(25, 118, 210, 0.8), rgba(25, 118, 210, 1))",
2442
+ color: "#FFFFFF",
2443
+ fontSize: "1.5rem",
2444
+ textShadow: "0px 3px 6px rgba(0, 0, 0, 0.5)"
2445
+ }
2446
+ }
2447
+ ),
2448
+ /* @__PURE__ */ jsxs(CardContent10, { children: [
2449
+ /* @__PURE__ */ jsx("div", { className: "mt-2 flex flex-wrap gap-2", children: selectedTags.map((tag) => /* @__PURE__ */ jsx(
2450
+ Chip,
2451
+ {
2452
+ tag,
2453
+ removeCallback: () => onToggleTag(tag.id)
2454
+ },
2455
+ tag.id
2456
+ )) }),
2457
+ /* @__PURE__ */ jsx(Grid8, { container: true, spacing: 3, children: /* @__PURE__ */ jsx(Grid8, { sx: { marginTop: 3, width: "100%" }, children: /* @__PURE__ */ jsx(
2458
+ Autocomplete,
2459
+ {
2460
+ options,
2461
+ filterOptions: (availableOptions, state) => availableOptions.filter(
2462
+ (option) => !selectedIds.includes(option.value) && option.label.toLowerCase().includes(state.inputValue.toLowerCase())
2463
+ ).slice(0, 3),
2464
+ value: null,
2465
+ inputValue,
2466
+ onInputChange: (event, newInputValue) => {
2467
+ if (event && event.type === "change") {
2468
+ setInputValue(newInputValue);
2469
+ }
2470
+ },
2471
+ onChange: (event, newValue) => {
2472
+ if (newValue) {
2473
+ onToggleTag(newValue.value);
2474
+ }
2475
+ setInputValue("");
2476
+ },
2477
+ slots: { popper: CustomPopper3 },
2478
+ renderInput: (params) => /* @__PURE__ */ jsx(TextField4, { ...params, label: "Select Tags" })
2479
+ },
2480
+ selectedIds.join("-")
2481
+ ) }) })
2482
+ ] })
2483
+ ] }) }) });
2484
+ }
2485
+ var CustomPopper3 = (props) => {
2486
+ return /* @__PURE__ */ jsx(
2487
+ Popper,
2488
+ {
2489
+ ...props,
2490
+ modifiers: [
2491
+ {
2492
+ name: "preventOverflow",
2493
+ options: { boundary: "viewport" }
2494
+ },
2495
+ {
2496
+ name: "offset",
2497
+ options: { offset: [0, -10] }
2498
+ }
2499
+ ],
2500
+ placement: "top-start"
2501
+ }
2502
+ );
2503
+ };
2316
2504
  function TablePageLayout(props) {
2317
2505
  var _a;
2318
2506
  const { allTags, dungeonMaster, onDeleteTable, onJoinWaitlist, onLeaveTable, onSaveDraft, players, table, tableStatus, waitlistPlayers } = props;
@@ -2383,9 +2571,9 @@ function TablePageLayout(props) {
2383
2571
  p: 2,
2384
2572
  boxShadow: "0px 8px 15px rgba(25, 118, 210, 0.3)"
2385
2573
  },
2386
- children: /* @__PURE__ */ jsxs(Grid9, { container: true, direction: "column", children: [
2574
+ children: /* @__PURE__ */ jsxs(Grid8, { container: true, direction: "column", children: [
2387
2575
  /* @__PURE__ */ jsxs(
2388
- Grid9,
2576
+ Grid8,
2389
2577
  {
2390
2578
  container: true,
2391
2579
  direction: "column",
@@ -2430,7 +2618,7 @@ function TablePageLayout(props) {
2430
2618
  value: currentShortDescription
2431
2619
  }
2432
2620
  ) : /* @__PURE__ */ jsx(Typography, { sx: { color: "white", opacity: 0.95 }, children: currentShortDescription }),
2433
- /* @__PURE__ */ jsx(Grid9, { container: true, children: isTableInEditMode ? renderEditableTags(currentTags, allTags, handleToggleTag) : renderTags(currentTagIds, allTags) }),
2621
+ /* @__PURE__ */ jsx(Grid8, { container: true, children: isTableInEditMode ? renderEditableTags(currentTags, allTags, handleToggleTag) : renderTags(currentTagIds, allTags) }),
2434
2622
  /* @__PURE__ */ jsx(
2435
2623
  TableActionsBar,
2436
2624
  {
@@ -2450,8 +2638,8 @@ function TablePageLayout(props) {
2450
2638
  ]
2451
2639
  }
2452
2640
  ),
2453
- /* @__PURE__ */ jsxs(Grid9, { container: true, spacing: 2, sx: { mt: 2 }, children: [
2454
- /* @__PURE__ */ jsx(Grid9, { size: { xs: 12, md: 8 }, children: /* @__PURE__ */ jsx(Card, { sx: { height: "100%" }, children: /* @__PURE__ */ jsx(CardContent, { children: isTableInEditMode ? /* @__PURE__ */ jsx(
2641
+ /* @__PURE__ */ jsxs(Grid8, { container: true, spacing: 2, sx: { mt: 2 }, children: [
2642
+ /* @__PURE__ */ jsx(Grid8, { size: { xs: 12, md: 8 }, children: /* @__PURE__ */ jsx(Card, { sx: { height: "100%" }, children: /* @__PURE__ */ jsx(CardContent, { children: isTableInEditMode ? /* @__PURE__ */ jsx(
2455
2643
  AutoResizingTextarea_default,
2456
2644
  {
2457
2645
  isInEditMode: isTableInEditMode,
@@ -2460,7 +2648,7 @@ function TablePageLayout(props) {
2460
2648
  value: currentDescription
2461
2649
  }
2462
2650
  ) : /* @__PURE__ */ jsx(Typography, { sx: { whiteSpace: "pre-wrap" }, children: currentDescription }) }) }) }),
2463
- /* @__PURE__ */ jsxs(Grid9, { size: { xs: 12, md: 4 }, children: [
2651
+ /* @__PURE__ */ jsxs(Grid8, { size: { xs: 12, md: 4 }, children: [
2464
2652
  /* @__PURE__ */ jsx(DMHighlightsCard, { canEdit: isTableInEditMode, player: currentDungeonMaster, allTags }),
2465
2653
  /* @__PURE__ */ jsxs(Card, { sx: { height: "100%" }, children: [
2466
2654
  /* @__PURE__ */ jsx(CardHeader, { slotProps: { title: { variant: "h4" } }, title: "Players: " }),
@@ -2487,13 +2675,13 @@ var renderTags = function(tags, allTags) {
2487
2675
  if (!tags || !allTags) {
2488
2676
  return /* @__PURE__ */ jsx(Fragment, {});
2489
2677
  }
2490
- return /* @__PURE__ */ jsx(Grid9, { container: true, spacing: 1, sx: { pb: 1.5 }, children: tags.map((tagId) => {
2678
+ return /* @__PURE__ */ jsx(Grid8, { container: true, spacing: 1, sx: { pb: 1.5 }, children: tags.map((tagId) => {
2491
2679
  const tag = allTags.find((potentialTag) => tagId === potentialTag.id);
2492
2680
  return tag ? generateTagsDisplay(tag) : /* @__PURE__ */ jsx(Fragment, {});
2493
2681
  }) });
2494
2682
  };
2495
2683
  var renderEditableTags = function(selectedTags, allTags, onToggleTag) {
2496
- return /* @__PURE__ */ jsx(Grid9, { size: { xs: 12 }, sx: { pb: 1.5 }, children: /* @__PURE__ */ jsx(
2684
+ return /* @__PURE__ */ jsx(Grid8, { size: { xs: 12 }, sx: { pb: 1.5 }, children: /* @__PURE__ */ jsx(
2497
2685
  TagEditor,
2498
2686
  {
2499
2687
  title: "Table Tags",
@@ -2508,6 +2696,6 @@ var renderEditableTags = function(selectedTags, allTags, onToggleTag) {
2508
2696
  };
2509
2697
  var TablePageLayout_default = TablePageLayout;
2510
2698
 
2511
- export { AutoResizingTextarea_default as AutoResizingTextarea, BaseSearchResultCard_default as BaseSearchResultCard, CANDIDATE_TIMEZONES, Chip, DMHighlightsCard, EventBanner, EventBannerEdit, EventBasicInfo, EventBasicInfoEdit, EventEditProvider, EventPageLayout, EventResultCard_default as EventResultCard, EventTablesCard_default as EventTablesCard, FiltersContainer_default as FiltersContainer, GameTableProvider, ModalContext, ModalProvider_default as ModalProvider, NextGameCountdown, PlayerDetailsCard_default as PlayerDetailsCard, PlayerDisplayCard_default as PlayerDisplayCard, PlayerHighlightsCard, PlayerPromptCard_default as PlayerPromptCard, PlayerResultCard_default as PlayerResultCard, PlayerTagsCard, PlayerTagsEdit, PlayersScrollableList_default as PlayersScrollableList, ResultsContainer_default as ResultsContainer, ScrollableResultsList_default as ScrollableResultsList, SearchPageLayout, SearchResultCard_default as SearchResultCard, SortOptions_default as SortOptions, TableActionsBar, TablePageLayout_default as TablePageLayout, TableResultCard_default as TableResultCard, TablesScrollableList_default as TablesScrollableList, TagEditor, TagsFilter_default as TagsFilter, TypeFilter_default as TypeFilter, generateTagsDisplay, renderTagsFromIds, useEventEdit, useGameTableContext, useModal };
2699
+ export { AutoResizingTextarea_default as AutoResizingTextarea, BaseSearchResultCard_default as BaseSearchResultCard, CANDIDATE_TIMEZONES, Chip, DMHighlightsCard, EventBanner, EventBannerEdit, EventBasicInfo, EventBasicInfoEdit, EventEditProvider, EventPageLayout, EventResultCard_default as EventResultCard, EventTablesCard_default as EventTablesCard, FiltersContainer_default as FiltersContainer, GameTableProvider, ModalContext, ModalProvider_default as ModalProvider, NextGameCountdown, PlayerDetailsCard_default as PlayerDetailsCard, PlayerDisplayCard_default as PlayerDisplayCard, PlayerHighlightsCard, PlayerPageLayout, PlayerPromptCard_default as PlayerPromptCard, PlayerResultCard_default as PlayerResultCard, PlayerTagsCard_default as PlayerTagsCard, PlayerTagsEdit_default as PlayerTagsEdit, PlayersScrollableList_default as PlayersScrollableList, ResultsContainer_default as ResultsContainer, ScrollableResultsList_default as ScrollableResultsList, SearchPageLayout, SearchResultCard_default as SearchResultCard, SortOptions_default as SortOptions, TableActionsBar, TablePageLayout_default as TablePageLayout, TableResultCard_default as TableResultCard, TablesScrollableList_default as TablesScrollableList, TagEditor, TagsFilter_default as TagsFilter, TypeFilter_default as TypeFilter, generateTagsDisplay, renderTagsFromIds, useEventEdit, useGameTableContext, useModal };
2512
2700
  //# sourceMappingURL=index.mjs.map
2513
2701
  //# sourceMappingURL=index.mjs.map