@ostack.tech/ui 0.7.0 → 0.8.0
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/ostack-ui.css +2 -2
- package/dist/ostack-ui.css.map +1 -1
- package/dist/ostack-ui.js +233 -210
- package/dist/ostack-ui.js.map +1 -1
- package/dist/types/components/Alert/Alert.d.ts +1 -1
- package/dist/types/components/Alert/AlertTitle.d.ts +7 -3
- package/dist/types/components/AlertDialog/AlertDialogTitle.d.ts +7 -2
- package/dist/types/components/Button/Button.d.ts +8 -3
- package/dist/types/components/Calendar/Calendar.d.ts +2 -2
- package/dist/types/components/Card/CardTitle.d.ts +8 -11
- package/dist/types/components/CloseButton/CloseButton.d.ts +1 -1
- package/dist/types/components/DataTable/DataTablePagination.d.ts +2 -2
- package/dist/types/components/DataTable/DataTableSelectionTrigger.d.ts +1 -1
- package/dist/types/components/Dialog/DialogTitle.d.ts +7 -2
- package/dist/types/components/ErrorBoundary/ErrorBoundary.d.ts +1 -1
- package/dist/types/components/FeedbackPopover/FeedbackPopover.d.ts +1 -1
- package/dist/types/components/FieldGroup/FieldGroupTitle.d.ts +7 -10
- package/dist/types/components/Heading/Heading.d.ts +13 -6
- package/dist/types/components/IconButton/IconButton.d.ts +9 -4
- package/dist/types/components/Label/Label.d.ts +1 -1
- package/dist/types/components/Link/Link.d.ts +8 -3
- package/dist/types/components/MenuList/MenuListItem.d.ts +6 -4
- package/dist/types/components/Select/Select.d.ts +1 -1
- package/dist/types/components/Table/TableColumn.d.ts +2 -2
- package/dist/types/index.d.ts +1 -0
- package/dist/types/providers/AlertDialogProvider/AlertDialogProviderContext.d.ts +2 -2
- package/dist/types/utils/polymorphicTypes.d.ts +23 -0
- package/package.json +1 -1
- package/scss/components/ControlAddon/_ControlAddon.scss +3 -3
- package/scss/components/FieldGroup/_FieldGroup-variables.scss +3 -3
- package/scss/components/Select/_Select-variables.scss +1 -1
- package/scss/components/Select/_Select.scss +1 -1
- package/scss/scss/placeholders/popover/_popover.scss +10 -12
- package/scss/scss/utils/_breakpoints.scss +4 -5
- package/scss/scss/utils/_css-color-functions.scss +10 -6
- package/scss/scss/utils/_declare-var.scss +1 -1
- package/scss/scss/utils/_maybe-important.scss +1 -1
- package/scss/scss/utils/_spacing.scss +10 -5
package/dist/ostack-ui.js
CHANGED
|
@@ -139,20 +139,18 @@ const CardHeader = forwardRef(
|
|
|
139
139
|
);
|
|
140
140
|
}
|
|
141
141
|
);
|
|
142
|
-
const CardTitle = forwardRef(
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
);
|
|
142
|
+
const CardTitle = forwardRef(function CardTitle2({ as = "div", asChild, className, ...otherProps }, forwardedRef) {
|
|
143
|
+
const prefix = usePrefix();
|
|
144
|
+
const As = asChild ? Slot : as;
|
|
145
|
+
return /* @__PURE__ */ jsx(
|
|
146
|
+
As,
|
|
147
|
+
{
|
|
148
|
+
className: cx(prefix("card__title"), className),
|
|
149
|
+
...otherProps,
|
|
150
|
+
ref: forwardedRef
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
});
|
|
156
154
|
const DialogBody = forwardRef(function DialogBody2({ className, ...otherProps }, forwardedRef) {
|
|
157
155
|
const prefix = usePrefix();
|
|
158
156
|
return /* @__PURE__ */ jsx(
|
|
@@ -1408,86 +1406,86 @@ const Tooltip = forwardRef(function Tooltip2({
|
|
|
1408
1406
|
});
|
|
1409
1407
|
const TooltipProvider = Tooltip$1.Provider;
|
|
1410
1408
|
const VisuallyHidden = VisuallyHidden$1.Root;
|
|
1411
|
-
const IconButton = forwardRef(
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
}
|
|
1445
|
-
);
|
|
1446
|
-
let content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1447
|
-
spinnerEl,
|
|
1448
|
-
iconEl,
|
|
1449
|
-
labelEl
|
|
1450
|
-
] });
|
|
1451
|
-
if (asChild) {
|
|
1452
|
-
content = cloneElement(children, void 0, content);
|
|
1409
|
+
const IconButton = forwardRef(function IconButton2({
|
|
1410
|
+
as = "button",
|
|
1411
|
+
asChild,
|
|
1412
|
+
variant = "solid",
|
|
1413
|
+
color = "neutral",
|
|
1414
|
+
size = "md",
|
|
1415
|
+
circle,
|
|
1416
|
+
icon,
|
|
1417
|
+
label,
|
|
1418
|
+
active,
|
|
1419
|
+
disabled,
|
|
1420
|
+
loading,
|
|
1421
|
+
loadingLabel,
|
|
1422
|
+
showSpinner = loading,
|
|
1423
|
+
disableTooltip,
|
|
1424
|
+
iconProps,
|
|
1425
|
+
spinnerProps,
|
|
1426
|
+
tooltipProps,
|
|
1427
|
+
type,
|
|
1428
|
+
onClick,
|
|
1429
|
+
className,
|
|
1430
|
+
children,
|
|
1431
|
+
...otherProps
|
|
1432
|
+
}, forwardedRef) {
|
|
1433
|
+
const prefix = usePrefix();
|
|
1434
|
+
const relevantLabel = loading ? loadingLabel || label : label;
|
|
1435
|
+
const labelEl = relevantLabel && /* @__PURE__ */ jsx(VisuallyHidden, { children: relevantLabel });
|
|
1436
|
+
const iconEl = icon && !showSpinner && /* @__PURE__ */ jsx(Slot, { className: cx(prefix("icon-button__icon"), iconProps?.className), children: isValidElement(icon) ? icon : /* @__PURE__ */ jsx(Icon, { icon, fixedWidth: true, ...iconProps }) });
|
|
1437
|
+
const spinnerEl = showSpinner && /* @__PURE__ */ jsx(
|
|
1438
|
+
Spinner,
|
|
1439
|
+
{
|
|
1440
|
+
...spinnerProps,
|
|
1441
|
+
className: cx(prefix("icon-button__spinner"), spinnerProps?.className)
|
|
1453
1442
|
}
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
[disabled, loading, onClick]
|
|
1463
|
-
);
|
|
1464
|
-
const As = asChild ? Slot : "button";
|
|
1465
|
-
const button = /* @__PURE__ */ jsx(
|
|
1466
|
-
As,
|
|
1467
|
-
{
|
|
1468
|
-
type: !asChild && !type ? "button" : type,
|
|
1469
|
-
className: cx(
|
|
1470
|
-
prefix("icon-button"),
|
|
1471
|
-
prefix(`icon-button--${variant}`),
|
|
1472
|
-
prefix(`icon-button--${size}`),
|
|
1473
|
-
circle && prefix("icon-button--circle"),
|
|
1474
|
-
className
|
|
1475
|
-
),
|
|
1476
|
-
onClick: handleClick,
|
|
1477
|
-
"data-accent": color,
|
|
1478
|
-
disabled,
|
|
1479
|
-
"data-disabled": boolDataAttr(loading || asChild && disabled),
|
|
1480
|
-
"aria-disabled": loading || asChild && disabled || void 0,
|
|
1481
|
-
"data-active": boolDataAttr(active),
|
|
1482
|
-
tabIndex: asChild && disabled ? -1 : void 0,
|
|
1483
|
-
ref: forwardedRef,
|
|
1484
|
-
...otherProps,
|
|
1485
|
-
children: content
|
|
1486
|
-
}
|
|
1487
|
-
);
|
|
1488
|
-
return relevantLabel && !disableTooltip ? /* @__PURE__ */ jsx(Tooltip, { ...tooltipProps, content: relevantLabel, children: button }) : button;
|
|
1443
|
+
);
|
|
1444
|
+
let content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1445
|
+
spinnerEl,
|
|
1446
|
+
iconEl,
|
|
1447
|
+
labelEl
|
|
1448
|
+
] });
|
|
1449
|
+
if (asChild) {
|
|
1450
|
+
content = cloneElement(children, void 0, content);
|
|
1489
1451
|
}
|
|
1490
|
-
|
|
1452
|
+
const handleClick = useCallback(
|
|
1453
|
+
(evt) => {
|
|
1454
|
+
if (disabled || loading) {
|
|
1455
|
+
evt.preventDefault();
|
|
1456
|
+
return;
|
|
1457
|
+
}
|
|
1458
|
+
onClick?.(evt);
|
|
1459
|
+
},
|
|
1460
|
+
[disabled, loading, onClick]
|
|
1461
|
+
);
|
|
1462
|
+
const isButton = as === "button" && !asChild;
|
|
1463
|
+
const As = asChild ? Slot : as;
|
|
1464
|
+
const button = /* @__PURE__ */ jsx(
|
|
1465
|
+
As,
|
|
1466
|
+
{
|
|
1467
|
+
type: type ?? (isButton ? "button" : void 0),
|
|
1468
|
+
className: cx(
|
|
1469
|
+
prefix("icon-button"),
|
|
1470
|
+
prefix(`icon-button--${variant}`),
|
|
1471
|
+
prefix(`icon-button--${size}`),
|
|
1472
|
+
circle && prefix("icon-button--circle"),
|
|
1473
|
+
className
|
|
1474
|
+
),
|
|
1475
|
+
onClick: handleClick,
|
|
1476
|
+
"data-accent": color,
|
|
1477
|
+
disabled,
|
|
1478
|
+
"data-disabled": boolDataAttr(loading || !isButton && disabled),
|
|
1479
|
+
"aria-disabled": loading || !isButton && disabled || void 0,
|
|
1480
|
+
"data-active": boolDataAttr(active),
|
|
1481
|
+
tabIndex: !isButton && disabled ? -1 : void 0,
|
|
1482
|
+
ref: forwardedRef,
|
|
1483
|
+
...otherProps,
|
|
1484
|
+
children: content
|
|
1485
|
+
}
|
|
1486
|
+
);
|
|
1487
|
+
return relevantLabel && !disableTooltip ? /* @__PURE__ */ jsx(Tooltip, { ...tooltipProps, content: relevantLabel, children: button }) : button;
|
|
1488
|
+
});
|
|
1491
1489
|
const CloseButton = forwardRef(
|
|
1492
1490
|
function CloseIconButton({ icon, label, disableTooltip = true, className, ...otherProps }, forwardedRef) {
|
|
1493
1491
|
const prefix = usePrefix();
|
|
@@ -1555,14 +1553,20 @@ const DialogHeader = forwardRef(function DialogHeader2({
|
|
|
1555
1553
|
}
|
|
1556
1554
|
);
|
|
1557
1555
|
});
|
|
1558
|
-
const DialogTitle = forwardRef(function DialogTitle2({
|
|
1556
|
+
const DialogTitle = forwardRef(function DialogTitle2({
|
|
1557
|
+
as = "h2",
|
|
1558
|
+
asChild,
|
|
1559
|
+
className,
|
|
1560
|
+
...otherProps
|
|
1561
|
+
}, forwardedRef) {
|
|
1559
1562
|
const prefix = usePrefix();
|
|
1560
|
-
|
|
1561
|
-
|
|
1563
|
+
const As = asChild ? Slot : as;
|
|
1564
|
+
return /* @__PURE__ */ jsx(Dialog$1.Title, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
1565
|
+
As,
|
|
1562
1566
|
{
|
|
1563
1567
|
className: cx(prefix("dialog__title"), className),
|
|
1564
|
-
|
|
1565
|
-
|
|
1568
|
+
...otherProps,
|
|
1569
|
+
ref: forwardedRef
|
|
1566
1570
|
}
|
|
1567
1571
|
) });
|
|
1568
1572
|
});
|
|
@@ -1652,108 +1656,114 @@ const AlertDialogHeader = forwardRef(function AlertDialogHeader2({ className, ..
|
|
|
1652
1656
|
}
|
|
1653
1657
|
);
|
|
1654
1658
|
});
|
|
1655
|
-
const AlertDialogTitle = forwardRef(function AlertDialogTitle2({
|
|
1659
|
+
const AlertDialogTitle = forwardRef(function AlertDialogTitle2({
|
|
1660
|
+
as = "h2",
|
|
1661
|
+
asChild,
|
|
1662
|
+
className,
|
|
1663
|
+
...otherProps
|
|
1664
|
+
}, forwardedRef) {
|
|
1656
1665
|
const prefix = usePrefix();
|
|
1657
|
-
|
|
1658
|
-
|
|
1666
|
+
const As = asChild ? Slot : as;
|
|
1667
|
+
return /* @__PURE__ */ jsx(AlertDialog$1.Title, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
1668
|
+
As,
|
|
1659
1669
|
{
|
|
1660
1670
|
className: cx(prefix("dialog__title"), className),
|
|
1661
|
-
|
|
1662
|
-
|
|
1671
|
+
...otherProps,
|
|
1672
|
+
ref: forwardedRef
|
|
1663
1673
|
}
|
|
1664
1674
|
) });
|
|
1665
1675
|
});
|
|
1666
1676
|
const AlertDialogTrigger = forwardRef(function AlertDialogTrigger2(props, forwardedRef) {
|
|
1667
1677
|
return /* @__PURE__ */ jsx(AlertDialog$1.Trigger, { ...props, asChild: true, ref: forwardedRef });
|
|
1668
1678
|
});
|
|
1669
|
-
const Button = forwardRef(
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
}
|
|
1721
|
-
onClick?.(evt);
|
|
1722
|
-
},
|
|
1723
|
-
[disabled, loading, onClick]
|
|
1724
|
-
);
|
|
1725
|
-
const As = asChild ? Slot : "button";
|
|
1726
|
-
return /* @__PURE__ */ jsxs(
|
|
1727
|
-
As,
|
|
1728
|
-
{
|
|
1729
|
-
type: !asChild && !type ? "button" : type,
|
|
1730
|
-
className: cx(
|
|
1731
|
-
prefix("button"),
|
|
1732
|
-
prefix(`button--${variant}`),
|
|
1733
|
-
prefix(`button--${size}`),
|
|
1734
|
-
vertical && prefix("button--vertical"),
|
|
1735
|
-
className
|
|
1736
|
-
),
|
|
1737
|
-
onClick: handleClick,
|
|
1738
|
-
"data-accent": color,
|
|
1739
|
-
disabled,
|
|
1740
|
-
"data-disabled": boolDataAttr(loading || asChild && disabled),
|
|
1741
|
-
"aria-disabled": loading || asChild && disabled || void 0,
|
|
1742
|
-
"data-active": boolDataAttr(active),
|
|
1743
|
-
tabIndex: asChild && disabled ? -1 : void 0,
|
|
1744
|
-
ref: forwardedRef,
|
|
1745
|
-
...otherProps,
|
|
1746
|
-
children: [
|
|
1747
|
-
iconPlacement === "start" && spinnerEl,
|
|
1748
|
-
iconPlacement === "start" && iconEl,
|
|
1749
|
-
/* @__PURE__ */ jsx(Slottable, { children: content }),
|
|
1750
|
-
iconPlacement === "end" && iconEl,
|
|
1751
|
-
iconPlacement === "end" && spinnerEl
|
|
1752
|
-
]
|
|
1679
|
+
const Button = forwardRef(function Button2({
|
|
1680
|
+
as = "button",
|
|
1681
|
+
asChild,
|
|
1682
|
+
variant = "solid",
|
|
1683
|
+
color = "neutral",
|
|
1684
|
+
size = "md",
|
|
1685
|
+
vertical,
|
|
1686
|
+
icon = null,
|
|
1687
|
+
iconPlacement = "start",
|
|
1688
|
+
active,
|
|
1689
|
+
disabled,
|
|
1690
|
+
loading,
|
|
1691
|
+
loadingContent,
|
|
1692
|
+
showSpinner = loading,
|
|
1693
|
+
iconProps,
|
|
1694
|
+
spinnerProps,
|
|
1695
|
+
type,
|
|
1696
|
+
onClick,
|
|
1697
|
+
className,
|
|
1698
|
+
children,
|
|
1699
|
+
...otherProps
|
|
1700
|
+
}, forwardedRef) {
|
|
1701
|
+
const prefix = usePrefix();
|
|
1702
|
+
const iconEl = icon && !showSpinner && /* @__PURE__ */ jsx(
|
|
1703
|
+
Slot,
|
|
1704
|
+
{
|
|
1705
|
+
className: cx(
|
|
1706
|
+
prefix("button__icon"),
|
|
1707
|
+
prefix(`button__icon--${iconPlacement}`),
|
|
1708
|
+
iconProps?.className
|
|
1709
|
+
),
|
|
1710
|
+
children: isValidElement(icon) ? icon : /* @__PURE__ */ jsx(Icon, { icon, ...iconProps })
|
|
1711
|
+
}
|
|
1712
|
+
);
|
|
1713
|
+
const spinnerEl = showSpinner && /* @__PURE__ */ jsx(
|
|
1714
|
+
Spinner,
|
|
1715
|
+
{
|
|
1716
|
+
...spinnerProps,
|
|
1717
|
+
className: cx(
|
|
1718
|
+
prefix("button__spinner"),
|
|
1719
|
+
prefix(`button__spinner--${iconPlacement}`),
|
|
1720
|
+
spinnerProps?.className
|
|
1721
|
+
)
|
|
1722
|
+
}
|
|
1723
|
+
);
|
|
1724
|
+
const content = loading && loadingContent ? asChild ? cloneElement(children, void 0, loadingContent) : loadingContent : children;
|
|
1725
|
+
const handleClick = useCallback(
|
|
1726
|
+
(evt) => {
|
|
1727
|
+
if (disabled || loading) {
|
|
1728
|
+
evt.preventDefault();
|
|
1729
|
+
return;
|
|
1753
1730
|
}
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1731
|
+
onClick?.(evt);
|
|
1732
|
+
},
|
|
1733
|
+
[disabled, loading, onClick]
|
|
1734
|
+
);
|
|
1735
|
+
const isButton = as === "button" && !asChild;
|
|
1736
|
+
const As = asChild ? Slot : as;
|
|
1737
|
+
return /* @__PURE__ */ jsxs(
|
|
1738
|
+
As,
|
|
1739
|
+
{
|
|
1740
|
+
type: type ?? (isButton ? "button" : void 0),
|
|
1741
|
+
className: cx(
|
|
1742
|
+
prefix("button"),
|
|
1743
|
+
prefix(`button--${variant}`),
|
|
1744
|
+
prefix(`button--${size}`),
|
|
1745
|
+
vertical && prefix("button--vertical"),
|
|
1746
|
+
className
|
|
1747
|
+
),
|
|
1748
|
+
onClick: handleClick,
|
|
1749
|
+
"data-accent": color,
|
|
1750
|
+
disabled,
|
|
1751
|
+
"data-disabled": boolDataAttr(loading || !isButton && disabled),
|
|
1752
|
+
"aria-disabled": loading || !isButton && disabled || void 0,
|
|
1753
|
+
"data-active": boolDataAttr(active),
|
|
1754
|
+
tabIndex: !isButton && disabled ? -1 : void 0,
|
|
1755
|
+
ref: forwardedRef,
|
|
1756
|
+
...otherProps,
|
|
1757
|
+
children: [
|
|
1758
|
+
iconPlacement === "start" && spinnerEl,
|
|
1759
|
+
iconPlacement === "start" && iconEl,
|
|
1760
|
+
/* @__PURE__ */ jsx(Slottable, { children: content }),
|
|
1761
|
+
iconPlacement === "end" && iconEl,
|
|
1762
|
+
iconPlacement === "end" && spinnerEl
|
|
1763
|
+
]
|
|
1764
|
+
}
|
|
1765
|
+
);
|
|
1766
|
+
});
|
|
1757
1767
|
const AlertDialogProviderContext = createContext(void 0);
|
|
1758
1768
|
function AlertDialogProvider({ children }) {
|
|
1759
1769
|
const [locale7] = useLocale();
|
|
@@ -2529,20 +2539,23 @@ const Alert = forwardRef(function Alert2({
|
|
|
2529
2539
|
}
|
|
2530
2540
|
);
|
|
2531
2541
|
});
|
|
2532
|
-
const AlertTitle = forwardRef(
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2542
|
+
const AlertTitle = forwardRef(function AlertTitle2({
|
|
2543
|
+
as = "div",
|
|
2544
|
+
asChild,
|
|
2545
|
+
className,
|
|
2546
|
+
...otherProps
|
|
2547
|
+
}, forwardedRef) {
|
|
2548
|
+
const prefix = usePrefix();
|
|
2549
|
+
const As = asChild ? Slot : as;
|
|
2550
|
+
return /* @__PURE__ */ jsx(
|
|
2551
|
+
As,
|
|
2552
|
+
{
|
|
2553
|
+
className: cx(prefix("alert__title"), className),
|
|
2554
|
+
...otherProps,
|
|
2555
|
+
ref: forwardedRef
|
|
2556
|
+
}
|
|
2557
|
+
);
|
|
2558
|
+
});
|
|
2546
2559
|
const Code = forwardRef(function Code2({ asChild, color = "neutral", className, ...otherProps }, forwardedRef) {
|
|
2547
2560
|
const prefix = usePrefix();
|
|
2548
2561
|
const As = asChild ? Slot : "code";
|
|
@@ -9676,7 +9689,13 @@ const FieldGroupHeader = forwardRef(function FieldGroupHeader2({
|
|
|
9676
9689
|
}
|
|
9677
9690
|
);
|
|
9678
9691
|
});
|
|
9679
|
-
const FieldGroupTitle = forwardRef(function FieldGroupTitle2({
|
|
9692
|
+
const FieldGroupTitle = forwardRef(function FieldGroupTitle2({
|
|
9693
|
+
as = "div",
|
|
9694
|
+
asChild,
|
|
9695
|
+
id,
|
|
9696
|
+
className,
|
|
9697
|
+
...otherProps
|
|
9698
|
+
}, forwardedRef) {
|
|
9680
9699
|
const prefix = usePrefix();
|
|
9681
9700
|
const generatedId = useId();
|
|
9682
9701
|
const titleId = id ?? prefix(`field-group-title-${generatedId}`);
|
|
@@ -9684,7 +9703,7 @@ const FieldGroupTitle = forwardRef(function FieldGroupTitle2({ asChild, level =
|
|
|
9684
9703
|
useEffect(() => {
|
|
9685
9704
|
setTitleId(titleId);
|
|
9686
9705
|
}, [setTitleId, titleId]);
|
|
9687
|
-
const As = asChild ? Slot :
|
|
9706
|
+
const As = asChild ? Slot : as;
|
|
9688
9707
|
return /* @__PURE__ */ jsx(
|
|
9689
9708
|
As,
|
|
9690
9709
|
{
|
|
@@ -9775,9 +9794,9 @@ const Grid = forwardRef(function Grid2({
|
|
|
9775
9794
|
}
|
|
9776
9795
|
) });
|
|
9777
9796
|
});
|
|
9778
|
-
const Heading = forwardRef(function Heading2({ asChild, level = 2, className, ...otherProps }, forwardedRef) {
|
|
9797
|
+
const Heading = forwardRef(function Heading2({ as, asChild, level = 2, className, ...otherProps }, forwardedRef) {
|
|
9779
9798
|
const prefix = usePrefix();
|
|
9780
|
-
const As = asChild ? Slot : `h${level}`;
|
|
9799
|
+
const As = asChild ? Slot : as ?? `h${level}`;
|
|
9781
9800
|
return /* @__PURE__ */ jsx(
|
|
9782
9801
|
As,
|
|
9783
9802
|
{
|
|
@@ -9818,7 +9837,9 @@ const Keyboard = forwardRef(
|
|
|
9818
9837
|
}
|
|
9819
9838
|
);
|
|
9820
9839
|
const Link = forwardRef(function Link2({
|
|
9840
|
+
as = "a",
|
|
9821
9841
|
asChild,
|
|
9842
|
+
type,
|
|
9822
9843
|
color,
|
|
9823
9844
|
variant,
|
|
9824
9845
|
external,
|
|
@@ -9832,18 +9853,20 @@ const Link = forwardRef(function Link2({
|
|
|
9832
9853
|
const { defaultColor, defaultVariant } = useLinkContext();
|
|
9833
9854
|
color ??= defaultColor;
|
|
9834
9855
|
variant ??= defaultVariant;
|
|
9835
|
-
const
|
|
9856
|
+
const isLink = as === "a" && !asChild;
|
|
9857
|
+
const As = asChild ? Slot : as;
|
|
9836
9858
|
return /* @__PURE__ */ jsxs(
|
|
9837
9859
|
As,
|
|
9838
9860
|
{
|
|
9861
|
+
type: type ?? (as === "button" ? "button" : void 0),
|
|
9839
9862
|
className: cx(
|
|
9840
9863
|
prefix("link"),
|
|
9841
9864
|
variant !== "default" && prefix(`link--${variant}`),
|
|
9842
9865
|
className
|
|
9843
9866
|
),
|
|
9844
9867
|
"data-accent": color,
|
|
9845
|
-
target: external ? "_blank" : void 0,
|
|
9846
|
-
rel: external ? "noopener noreferrer" : void 0,
|
|
9868
|
+
target: isLink && external ? "_blank" : void 0,
|
|
9869
|
+
rel: isLink && external ? "noopener noreferrer" : void 0,
|
|
9847
9870
|
...otherProps,
|
|
9848
9871
|
ref: forwardedRef,
|
|
9849
9872
|
children: [
|