@doist/reactist 13.0.0 → 14.0.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/reactist.cjs.development.js +37 -22
- package/dist/reactist.cjs.development.js.map +1 -1
- package/dist/reactist.cjs.production.min.js +1 -1
- package/dist/reactist.cjs.production.min.js.map +1 -1
- package/es/components/tooltip/tooltip.js +12 -6
- package/es/components/tooltip/tooltip.js.map +1 -1
- package/es/new-components/tabs/tabs.js +25 -15
- package/es/new-components/tabs/tabs.js.map +1 -1
- package/es/new-components/tabs/tabs.module.css.js +1 -1
- package/lib/components/tooltip/tooltip.d.ts +1 -1
- package/lib/components/tooltip/tooltip.js +1 -1
- package/lib/components/tooltip/tooltip.js.map +1 -1
- package/lib/new-components/tabs/tabs.d.ts +5 -10
- package/lib/new-components/tabs/tabs.js +1 -1
- package/lib/new-components/tabs/tabs.js.map +1 -1
- package/lib/new-components/tabs/tabs.module.css.js +1 -1
- package/package.json +1 -1
- package/styles/reactist.css +1 -1
- package/styles/tabs.css +3 -3
- package/styles/tabs.module.css.css +1 -1
|
@@ -479,9 +479,13 @@ function Tooltip(_ref) {
|
|
|
479
479
|
});
|
|
480
480
|
const child = React__default.Children.only(children);
|
|
481
481
|
|
|
482
|
-
if (!content) {
|
|
482
|
+
if (!content || !child) {
|
|
483
483
|
return child;
|
|
484
484
|
}
|
|
485
|
+
|
|
486
|
+
if (typeof child.ref === 'string') {
|
|
487
|
+
throw new Error('Tooltip: String refs cannot be used as they cannot be forwarded');
|
|
488
|
+
}
|
|
485
489
|
/**
|
|
486
490
|
* Prevents the tooltip from automatically firing on focus all the time. This is to prevent
|
|
487
491
|
* tooltips from showing when the trigger element is focused back after a popover or dialog that
|
|
@@ -513,13 +517,15 @@ function Tooltip(_ref) {
|
|
|
513
517
|
child == null ? void 0 : (_child$props = child.props) == null ? void 0 : _child$props.onFocus == null ? void 0 : _child$props.onFocus(event);
|
|
514
518
|
}
|
|
515
519
|
|
|
516
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(tooltip.TooltipAnchor,
|
|
517
|
-
state: state
|
|
518
|
-
}, child.props), {}, {
|
|
520
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(tooltip.TooltipAnchor, {
|
|
521
|
+
state: state,
|
|
519
522
|
ref: child.ref,
|
|
520
523
|
onFocus: handleFocus
|
|
521
|
-
}
|
|
522
|
-
|
|
524
|
+
}, anchorProps => {
|
|
525
|
+
// Let child props override anchor props so user can specify attributes like tabIndex
|
|
526
|
+
// Also, do not apply the child's props to TooltipAnchor as props like `as` can create problems
|
|
527
|
+
// by applying the replacement component/element twice
|
|
528
|
+
return /*#__PURE__*/React__default.cloneElement(child, _objectSpread2(_objectSpread2({}, anchorProps), child.props));
|
|
523
529
|
}), state.visible ? /*#__PURE__*/React__default.createElement(tooltip.Tooltip, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
524
530
|
state: state,
|
|
525
531
|
className: classNames('reactist_tooltip', className)
|
|
@@ -1552,7 +1558,7 @@ function usePrevious(value) {
|
|
|
1552
1558
|
return ref.current;
|
|
1553
1559
|
}
|
|
1554
1560
|
|
|
1555
|
-
var modules_40c67f5b = {"tab":"
|
|
1561
|
+
var modules_40c67f5b = {"tab":"_76bbcdaa","track":"_531eb92b","tab-neutral":"_13321d47","tab-themed":"_58c4d63d","track-neutral":"_11ef0184","track-themed":"ce590259","track-xsmall":"d8366aff","track-small":"e28fbcf0","track-medium":"_1e1d7d0e","track-large":"_611e18a3","track-xlarge":"_7e083426","track-xxlarge":"_37c54913"};
|
|
1556
1562
|
|
|
1557
1563
|
const _excluded$m = ["as", "children", "id", "exceptionallySetClassName"],
|
|
1558
1564
|
_excluded2$1 = ["children", "space"],
|
|
@@ -1566,8 +1572,7 @@ function Tabs({
|
|
|
1566
1572
|
children,
|
|
1567
1573
|
selectedId,
|
|
1568
1574
|
defaultSelectedId,
|
|
1569
|
-
|
|
1570
|
-
variant = 'normal',
|
|
1575
|
+
variant = 'neutral',
|
|
1571
1576
|
onSelectedIdChange
|
|
1572
1577
|
}) {
|
|
1573
1578
|
const tabState = tab.useTabState({
|
|
@@ -1587,10 +1592,9 @@ function Tabs({
|
|
|
1587
1592
|
const memoizedTabState = React.useMemo(function memoizeTabState() {
|
|
1588
1593
|
return {
|
|
1589
1594
|
tabState,
|
|
1590
|
-
color,
|
|
1591
1595
|
variant
|
|
1592
1596
|
};
|
|
1593
|
-
}, [
|
|
1597
|
+
}, [variant, tabState]);
|
|
1594
1598
|
return /*#__PURE__*/React.createElement(TabsContext.Provider, {
|
|
1595
1599
|
value: memoizedTabState
|
|
1596
1600
|
}, children);
|
|
@@ -1615,13 +1619,12 @@ const Tab = /*#__PURE__*/polymorphicComponent(function Tab(_ref, ref) {
|
|
|
1615
1619
|
}
|
|
1616
1620
|
|
|
1617
1621
|
const {
|
|
1618
|
-
color,
|
|
1619
1622
|
variant,
|
|
1620
1623
|
tabState
|
|
1621
1624
|
} = tabContextValue;
|
|
1622
1625
|
return /*#__PURE__*/React.createElement(tab.Tab, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
1623
1626
|
as: as,
|
|
1624
|
-
className: classNames(exceptionallySetClassName, modules_40c67f5b.tab, modules_40c67f5b["tab-" +
|
|
1627
|
+
className: classNames(exceptionallySetClassName, modules_40c67f5b.tab, modules_40c67f5b["tab-" + variant]),
|
|
1625
1628
|
id: id,
|
|
1626
1629
|
state: tabState,
|
|
1627
1630
|
ref: ref
|
|
@@ -1634,7 +1637,7 @@ const Tab = /*#__PURE__*/polymorphicComponent(function Tab(_ref, ref) {
|
|
|
1634
1637
|
function TabList(_ref2) {
|
|
1635
1638
|
let {
|
|
1636
1639
|
children,
|
|
1637
|
-
space = '
|
|
1640
|
+
space = 'xsmall'
|
|
1638
1641
|
} = _ref2,
|
|
1639
1642
|
props = _objectWithoutProperties(_ref2, _excluded2$1);
|
|
1640
1643
|
|
|
@@ -1645,13 +1648,24 @@ function TabList(_ref2) {
|
|
|
1645
1648
|
}
|
|
1646
1649
|
|
|
1647
1650
|
const {
|
|
1648
|
-
tabState
|
|
1651
|
+
tabState,
|
|
1652
|
+
variant
|
|
1649
1653
|
} = tabContextValue;
|
|
1650
|
-
return
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1654
|
+
return (
|
|
1655
|
+
/*#__PURE__*/
|
|
1656
|
+
// The extra <Box> prevents <Inline>'s negative margins from collapsing when used in a flex container
|
|
1657
|
+
// which will render the track with the wrong height
|
|
1658
|
+
React.createElement(Box, null, /*#__PURE__*/React.createElement(tab.TabList, _objectSpread2({
|
|
1659
|
+
state: tabState,
|
|
1660
|
+
as: Box,
|
|
1661
|
+
position: "relative",
|
|
1662
|
+
width: "maxContent"
|
|
1663
|
+
}, props), /*#__PURE__*/React.createElement(Box, {
|
|
1664
|
+
className: classNames(modules_40c67f5b.track, modules_40c67f5b["track-" + space], modules_40c67f5b["track-" + variant])
|
|
1665
|
+
}), /*#__PURE__*/React.createElement(Inline, {
|
|
1666
|
+
space: space
|
|
1667
|
+
}, children)))
|
|
1668
|
+
);
|
|
1655
1669
|
}
|
|
1656
1670
|
/**
|
|
1657
1671
|
* Used to define the content to be rendered when a tab is active. Each `<TabPanel>` must have a corresponding `<Tab>` component.
|
|
@@ -1682,13 +1696,14 @@ const TabPanel = /*#__PURE__*/polymorphicComponent(function TabPanel(_ref3, ref)
|
|
|
1682
1696
|
const {
|
|
1683
1697
|
tabState
|
|
1684
1698
|
} = tabContextValue;
|
|
1685
|
-
|
|
1699
|
+
const shouldRender = render === 'always' || render === 'active' && tabIsActive || render === 'lazy' && (tabIsActive || tabRendered);
|
|
1700
|
+
return shouldRender ? /*#__PURE__*/React.createElement(tab.TabPanel, _objectSpread2(_objectSpread2({
|
|
1686
1701
|
tabId: id
|
|
1687
1702
|
}, props), {}, {
|
|
1688
1703
|
state: tabState,
|
|
1689
1704
|
as: as,
|
|
1690
1705
|
ref: ref
|
|
1691
|
-
}),
|
|
1706
|
+
}), children) : null;
|
|
1692
1707
|
});
|
|
1693
1708
|
/**
|
|
1694
1709
|
* Allows content to be rendered based on the current tab being selected while outside of the TabPanel
|