@ttoss/components 2.23.1 → 2.23.3

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.
Files changed (2) hide show
  1. package/dist/index.mjs +204 -155
  2. package/package.json +7 -7
package/dist/index.mjs CHANGED
@@ -757,7 +757,7 @@ var Drawer = ({
757
757
 
758
758
  //#endregion
759
759
  //#region src/components/EnhancedTitle/EnhancedTitle.styles.ts
760
- var gradientFlow = keyframes({
760
+ var gradientFlow$1 = keyframes({
761
761
  "0%": {
762
762
  backgroundPosition: "0% 50%"
763
763
  },
@@ -799,7 +799,7 @@ var getEnhancedTitleIconSx = variant => {
799
799
  borderColor: "display.border.muted.default",
800
800
  background: getAccentGradientBackground,
801
801
  backgroundSize: "400% 400%",
802
- animation: `${gradientFlow} 6s ease infinite`
802
+ animation: `${gradientFlow$1} 6s ease infinite`
803
803
  },
804
804
  "spotlight-primary": {
805
805
  backgroundColor: "action.background.primary.default",
@@ -807,7 +807,7 @@ var getEnhancedTitleIconSx = variant => {
807
807
  borderColor: "display.border.muted.default",
808
808
  background: getPrimaryGradientBackground,
809
809
  backgroundSize: "400% 400%",
810
- animation: `${gradientFlow} 6s ease infinite`
810
+ animation: `${gradientFlow$1} 6s ease infinite`
811
811
  },
812
812
  primary: {
813
813
  backgroundColor: "action.background.primary.default",
@@ -1470,208 +1470,254 @@ ListItem.displayName = "ListItem";
1470
1470
 
1471
1471
  //#endregion
1472
1472
  //#region src/components/SpotlightCard/SpotlightCard.tsx
1473
- var SpotlightCard = ({
1473
+ var TOKENS = {
1474
+ accent: {
1475
+ text: "action.text.accent.default",
1476
+ icon: "action.text.accent.default",
1477
+ iconBg: "rgba(255,255,255,0.3)",
1478
+ badgeBg: "action.background.primary.default",
1479
+ badgeText: "action.text.primary.default",
1480
+ primaryButtonVariant: "primary",
1481
+ primaryButtonText: "action.text.primary.default",
1482
+ secondaryButtonBorder: "currentColor",
1483
+ border: "transparent",
1484
+ backgroundSize: "200% 100%, auto"
1485
+ },
1486
+ primary: {
1487
+ text: "action.text.primary.default",
1488
+ icon: "display.text.accent.default",
1489
+ iconBg: "action.background.secondary.default",
1490
+ badgeBg: "action.background.accent.default",
1491
+ badgeText: "action.text.accent.default",
1492
+ primaryButtonVariant: "accent",
1493
+ primaryButtonText: "action.text.accent.default",
1494
+ secondaryButtonBorder: "display.border.muted.default",
1495
+ border: "display.border.muted.default",
1496
+ backgroundSize: "400% 400%"
1497
+ }
1498
+ };
1499
+ var gradientFlow = keyframes({
1500
+ "0%": {
1501
+ backgroundPosition: "0% 50%"
1502
+ },
1503
+ "50%": {
1504
+ backgroundPosition: "100% 50%"
1505
+ },
1506
+ "100%": {
1507
+ backgroundPosition: "0% 50%"
1508
+ }
1509
+ });
1510
+ var getAccentBackground = theme => {
1511
+ const bg = theme.colors?.action?.background?.accent?.default;
1512
+ return `linear-gradient(270deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%),
1513
+ linear-gradient(0deg, ${bg}, ${bg})`;
1514
+ };
1515
+ var getPrimaryBackground = theme => {
1516
+ const background = theme.colors?.action?.background;
1517
+ const bgStart = background?.primary?.default;
1518
+ return `linear-gradient(270deg, ${bgStart}, ${background?.secondary?.default}, ${bgStart})`;
1519
+ };
1520
+ var SpotlightButton = ({
1521
+ prop,
1522
+ variant,
1523
+ textColor,
1524
+ styles
1525
+ }) => {
1526
+ if (!prop) return null;
1527
+ if (React.isValidElement(prop)) return prop;
1528
+ if (typeof prop !== "object") return /* @__PURE__ */jsx(Fragment, {
1529
+ children: prop
1530
+ });
1531
+ const {
1532
+ sx,
1533
+ ...rest
1534
+ } = prop;
1535
+ return /* @__PURE__ */jsx(Button, {
1536
+ variant,
1537
+ sx: {
1538
+ display: "flex",
1539
+ alignItems: "center",
1540
+ justifyContent: "center",
1541
+ gap: "2",
1542
+ px: "6",
1543
+ py: "3",
1544
+ fontSize: "15px",
1545
+ fontWeight: "bold",
1546
+ whiteSpace: "nowrap",
1547
+ transition: "all 0.2s",
1548
+ flex: ["1 1 auto", "0 1 auto"],
1549
+ color: textColor,
1550
+ ...styles,
1551
+ ...sx
1552
+ },
1553
+ ...rest
1554
+ });
1555
+ };
1556
+ var SpotlightContent = ({
1474
1557
  icon,
1475
1558
  title,
1476
1559
  badge,
1477
1560
  description,
1478
- firstButton,
1479
- secondButton,
1480
- variant = "accent"
1561
+ tokens
1481
1562
  }) => {
1482
- const gradientFlow = keyframes({
1483
- "0%": {
1484
- backgroundPosition: "0% 50%"
1485
- },
1486
- "50%": {
1487
- backgroundPosition: "100% 50%"
1563
+ return /* @__PURE__ */jsxs(Flex, {
1564
+ sx: {
1565
+ alignItems: "center",
1566
+ gap: ["4", "5"],
1567
+ flex: 1,
1568
+ minWidth: 0
1488
1569
  },
1489
- "100%": {
1490
- backgroundPosition: "0% 50%"
1491
- }
1492
- });
1493
- const hasButtons = !!firstButton || !!secondButton;
1494
- const isAccent = variant === "accent";
1495
- const textColorToken = isAccent ? "action.text.accent.default" : "action.text.primary.default";
1496
- const iconColorToken = isAccent ? "action.text.accent.default" : "display.text.accent.default";
1497
- const iconBgToken = isAccent ? "rgba(255,255,255,0.3)" : "action.background.secondary.default";
1498
- const badgeBgToken = isAccent ? "action.background.primary.default" : "action.background.accent.default";
1499
- const badgeTextToken = isAccent ? "action.text.primary.default" : "action.text.accent.default";
1500
- const btnPrimaryVariant = isAccent ? "primary" : "accent";
1501
- const btnPrimaryColorToken = isAccent ? "action.text.primary.default" : "action.text.accent.default";
1502
- const btnSecondaryColorToken = textColorToken;
1503
- const btnSecondaryBorderColorToken = isAccent ? "currentColor" : "display.border.muted.default";
1504
- const renderButton = (prop, config) => {
1505
- if (!prop) return null;
1506
- if (React.isValidElement(prop)) return prop;
1507
- if (typeof prop !== "object") return prop;
1508
- const {
1509
- sx,
1510
- ...rest
1511
- } = prop;
1512
- const {
1513
- variant: defaultVariant,
1514
- textColor,
1515
- styles = {}
1516
- } = config;
1517
- return /* @__PURE__ */jsx(Button, {
1518
- variant: defaultVariant,
1570
+ children: [/* @__PURE__ */jsx(Box, {
1519
1571
  sx: {
1572
+ width: [48, 64],
1573
+ height: [48, 64],
1574
+ borderRadius: "2xl",
1575
+ backgroundColor: tokens.iconBg,
1520
1576
  display: "flex",
1521
1577
  alignItems: "center",
1522
1578
  justifyContent: "center",
1523
- gap: "2",
1524
- px: "6",
1525
- py: "3",
1526
- fontSize: "15px",
1527
- fontWeight: "bold",
1528
- whiteSpace: "nowrap",
1529
- transition: "all 0.2s",
1530
- color: textColor,
1531
- ...styles,
1532
- ...sx
1579
+ flexShrink: 0,
1580
+ color: tokens.icon
1533
1581
  },
1534
- ...rest
1535
- });
1536
- };
1582
+ children: /* @__PURE__ */jsx(Icon, {
1583
+ icon,
1584
+ width: 32
1585
+ })
1586
+ }), /* @__PURE__ */jsxs(Box, {
1587
+ sx: {
1588
+ minWidth: 0
1589
+ },
1590
+ children: [/* @__PURE__ */jsxs(Text, {
1591
+ as: "div",
1592
+ sx: {
1593
+ fontFamily: "mono",
1594
+ fontSize: ["24px", "32px"],
1595
+ lineHeight: 1.1,
1596
+ color: "inherit",
1597
+ whiteSpace: "nowrap",
1598
+ display: "flex",
1599
+ alignItems: "center",
1600
+ gap: "3"
1601
+ },
1602
+ children: [title, badge && /* @__PURE__ */jsx(Box, {
1603
+ as: "span",
1604
+ sx: {
1605
+ backgroundColor: tokens.badgeBg,
1606
+ color: tokens.badgeText,
1607
+ fontFamily: "mono",
1608
+ fontWeight: "bold",
1609
+ fontSize: "11px",
1610
+ lineHeight: 1,
1611
+ paddingX: "6px",
1612
+ paddingY: "3px",
1613
+ borderRadius: "md",
1614
+ textTransform: "uppercase",
1615
+ letterSpacing: "0.05em",
1616
+ display: "inline-flex",
1617
+ alignItems: "center",
1618
+ boxShadow: "0 2px 4px rgba(0,0,0,0.1)",
1619
+ transform: "translateY(3px)"
1620
+ },
1621
+ children: badge
1622
+ })]
1623
+ }), /* @__PURE__ */jsx(Text, {
1624
+ as: "div",
1625
+ sx: {
1626
+ fontFamily: "body",
1627
+ fontWeight: 400,
1628
+ fontSize: ["14px", "16px"],
1629
+ color: "inherit",
1630
+ opacity: .9,
1631
+ mt: "1",
1632
+ overflow: "hidden",
1633
+ textOverflow: "ellipsis",
1634
+ display: "-webkit-box",
1635
+ WebkitLineClamp: [4, 2],
1636
+ WebkitBoxOrient: "vertical"
1637
+ },
1638
+ children: description
1639
+ })]
1640
+ })]
1641
+ });
1642
+ };
1643
+ var SpotlightCard = ({
1644
+ icon,
1645
+ title,
1646
+ badge,
1647
+ description,
1648
+ firstButton,
1649
+ secondButton,
1650
+ variant = "accent"
1651
+ }) => {
1652
+ const hasButtons = !!firstButton || !!secondButton;
1653
+ const isAccent = variant === "accent";
1654
+ const tokens = TOKENS[isAccent ? "accent" : "primary"];
1537
1655
  return /* @__PURE__ */jsxs(Card, {
1538
1656
  sx: {
1539
1657
  display: "flex",
1540
1658
  flexDirection: ["row"],
1541
- flexWrap: "nowrap",
1659
+ flexWrap: ["wrap", "nowrap"],
1542
1660
  alignItems: "center",
1543
1661
  justifyContent: "space-between",
1544
1662
  background: t => {
1545
1663
  const theme = t;
1546
- const bgStart = isAccent ? theme.colors?.action?.background?.accent?.default : theme.colors?.action?.background?.primary?.default;
1547
- const bgMiddle = isAccent ? theme.colors?.action?.background?.accent?.active : theme.colors?.action?.background?.secondary?.default;
1548
- if (isAccent) return `linear-gradient(270deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%),
1549
- linear-gradient(0deg, ${bgStart}, ${bgStart})`;
1550
- return `linear-gradient(270deg, ${bgStart}, ${bgMiddle}, ${bgStart})`;
1664
+ return isAccent ? getAccentBackground(theme) : getPrimaryBackground(theme);
1551
1665
  },
1552
- backgroundSize: isAccent ? "200% 100%, auto" : "400% 400%",
1666
+ backgroundSize: tokens.backgroundSize,
1553
1667
  animation: `${gradientFlow} 6s ease infinite`,
1554
1668
  width: "100%",
1555
1669
  minHeight: "104px",
1556
1670
  borderRadius: "xl",
1557
1671
  boxShadow: "0 4px 20px rgba(0,0,0,0.1)",
1558
- py: "7",
1559
- px: "8",
1560
- gap: "5",
1561
- color: textColorToken,
1672
+ py: ["5", "7"],
1673
+ px: ["5", "8"],
1674
+ gap: ["4", "5"],
1675
+ color: tokens.text,
1562
1676
  overflow: "hidden",
1563
1677
  borderWidth: "1px",
1564
1678
  borderStyle: "solid",
1565
- borderColor: isAccent ? "transparent" : "display.border.muted.default"
1679
+ borderColor: tokens.border
1566
1680
  },
1567
1681
  "data-testid": "spotlight-card",
1568
- children: [/* @__PURE__ */jsxs(Flex, {
1569
- sx: {
1570
- alignItems: "center",
1571
- gap: "5",
1572
- flex: 1,
1573
- minWidth: 0
1574
- },
1575
- children: [/* @__PURE__ */jsx(Box, {
1576
- sx: {
1577
- width: 64,
1578
- height: 64,
1579
- borderRadius: "2xl",
1580
- backgroundColor: iconBgToken,
1581
- display: "flex",
1582
- alignItems: "center",
1583
- justifyContent: "center",
1584
- flexShrink: 0,
1585
- color: iconColorToken
1586
- },
1587
- children: /* @__PURE__ */jsx(Icon, {
1588
- icon,
1589
- width: 32
1590
- })
1591
- }), /* @__PURE__ */jsxs(Box, {
1592
- sx: {
1593
- minWidth: 0
1594
- },
1595
- children: [/* @__PURE__ */jsxs(Text, {
1596
- as: "div",
1597
- sx: {
1598
- fontFamily: "mono",
1599
- fontSize: "32px",
1600
- lineHeight: 1.1,
1601
- color: "inherit",
1602
- whiteSpace: "nowrap",
1603
- display: "flex",
1604
- alignItems: "center",
1605
- gap: "3"
1606
- },
1607
- children: [title, badge && /* @__PURE__ */jsx(Box, {
1608
- as: "span",
1609
- sx: {
1610
- backgroundColor: badgeBgToken,
1611
- color: badgeTextToken,
1612
- fontFamily: "mono",
1613
- fontWeight: "bold",
1614
- fontSize: "11px",
1615
- lineHeight: 1,
1616
- paddingX: "6px",
1617
- paddingY: "3px",
1618
- borderRadius: "md",
1619
- textTransform: "uppercase",
1620
- letterSpacing: "0.05em",
1621
- display: "inline-flex",
1622
- alignItems: "center",
1623
- boxShadow: "0 2px 4px rgba(0,0,0,0.1)",
1624
- transform: "translateY(3px)"
1625
- },
1626
- children: badge
1627
- })]
1628
- }), /* @__PURE__ */jsx(Text, {
1629
- as: "div",
1630
- sx: {
1631
- fontFamily: "body",
1632
- fontWeight: 400,
1633
- fontSize: "16px",
1634
- color: "inherit",
1635
- opacity: .9,
1636
- mt: "1",
1637
- overflow: "hidden",
1638
- textOverflow: "ellipsis",
1639
- display: "-webkit-box",
1640
- WebkitLineClamp: 2,
1641
- WebkitBoxOrient: "vertical"
1642
- },
1643
- children: description
1644
- })]
1645
- })]
1682
+ children: [/* @__PURE__ */jsx(SpotlightContent, {
1683
+ icon,
1684
+ title,
1685
+ badge,
1686
+ description,
1687
+ tokens
1646
1688
  }), hasButtons && /* @__PURE__ */jsxs(Flex, {
1647
1689
  sx: {
1648
- gap: "4",
1690
+ gap: ["3", "4"],
1649
1691
  alignItems: "center",
1650
1692
  flexShrink: 0,
1693
+ flexWrap: ["wrap", "nowrap"],
1694
+ width: ["100%", "auto"],
1651
1695
  ml: "auto"
1652
1696
  },
1653
- children: [renderButton(firstButton, {
1654
- variant: btnPrimaryVariant,
1655
- textColor: btnPrimaryColorToken,
1697
+ children: [/* @__PURE__ */jsx(SpotlightButton, {
1698
+ prop: firstButton,
1699
+ variant: tokens.primaryButtonVariant,
1700
+ textColor: tokens.primaryButtonText,
1656
1701
  styles: {
1657
1702
  ":hover": {
1658
1703
  transform: "translateY(-1px)"
1659
1704
  }
1660
1705
  }
1661
- }), renderButton(secondButton, {
1706
+ }), /* @__PURE__ */jsx(SpotlightButton, {
1707
+ prop: secondButton,
1662
1708
  variant: "secondary",
1663
- textColor: btnSecondaryColorToken,
1709
+ textColor: tokens.text,
1664
1710
  styles: {
1665
1711
  backgroundColor: "transparent",
1666
1712
  borderWidth: "1px",
1667
1713
  borderStyle: "solid",
1668
- borderColor: btnSecondaryBorderColorToken,
1714
+ borderColor: tokens.secondaryButtonBorder,
1669
1715
  opacity: isAccent ? .6 : 1,
1670
1716
  cursor: "pointer",
1671
1717
  ":hover": {
1672
1718
  backgroundColor: "rgba(255,255,255,0.2)",
1673
1719
  opacity: 1,
1674
- borderColor: btnSecondaryBorderColorToken
1720
+ borderColor: tokens.secondaryButtonBorder
1675
1721
  }
1676
1722
  }
1677
1723
  })]
@@ -3679,6 +3725,7 @@ Table.Footer = TableFooter;
3679
3725
 
3680
3726
  //#endregion
3681
3727
  //#region src/components/Tabs/Tabs.tsx
3728
+ var REACT_TABS_ONLY_PROPS = new Set(["defaultFocus", "defaultIndex", "direction", "disabledTabClassName", "disableUpDownKeys", "disableLeftRightKeys", "domRef", "environment", "focusTabOnClick", "forceRenderTabPanel", "onSelect", "selectedIndex", "selectedTabClassName", "selectedTabPanelClassName"]);
3682
3729
  var Tabs = props => {
3683
3730
  const {
3684
3731
  sx: customSx,
@@ -3743,7 +3790,9 @@ var Tabs = props => {
3743
3790
  ...customSx
3744
3791
  };
3745
3792
  },
3746
- ...restProps,
3793
+ ...Object.fromEntries(Object.entries(restProps).filter(([key]) => {
3794
+ return !REACT_TABS_ONLY_PROPS.has(key);
3795
+ })),
3747
3796
  children: /* @__PURE__ */jsx(Tabs$1, {
3748
3797
  ...restProps,
3749
3798
  children: props.children
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttoss/components",
3
- "version": "2.23.1",
3
+ "version": "2.23.3",
4
4
  "description": "React components for ttoss ecosystem.",
5
5
  "keywords": [
6
6
  "React",
@@ -55,19 +55,19 @@
55
55
  "tsdown": "^0.22.2",
56
56
  "tsx": "^4.21.0",
57
57
  "@ttoss/i18n-cli": "^0.13.0",
58
- "@ttoss/react-icons": "^0.11.1",
59
- "@ttoss/ui": "^6.11.0",
60
58
  "@ttoss/react-hooks": "^2.5.0",
59
+ "@ttoss/react-i18n": "^2.7.0",
61
60
  "@ttoss/test-utils": "^4.4.0",
61
+ "@ttoss/react-icons": "^0.11.1",
62
62
  "@ttoss/config": "^1.41.0",
63
- "@ttoss/react-i18n": "^2.7.0"
63
+ "@ttoss/ui": "^6.11.1"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "react": ">=16.8.0",
67
- "@ttoss/react-i18n": "^2.7.0",
68
- "@ttoss/react-icons": "^0.11.1",
69
67
  "@ttoss/react-hooks": "^2.5.0",
70
- "@ttoss/ui": "^6.11.0"
68
+ "@ttoss/react-icons": "^0.11.1",
69
+ "@ttoss/ui": "^6.11.1",
70
+ "@ttoss/react-i18n": "^2.7.0"
71
71
  },
72
72
  "publishConfig": {
73
73
  "access": "public",