@doist/reactist 12.1.1 → 14.1.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 +99 -645
- 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/color-picker/color-picker.js +5 -4
- package/es/components/color-picker/color-picker.js.map +1 -1
- package/es/components/{dropdown → deprecated-dropdown}/dropdown.js +4 -2
- package/es/components/deprecated-dropdown/dropdown.js.map +1 -0
- package/es/components/{dropdown → deprecated-dropdown}/index.js +0 -0
- package/es/components/{checkbox → deprecated-dropdown}/index.js.map +0 -0
- package/es/components/{input → deprecated-input}/index.js +0 -0
- package/es/components/{dropdown → deprecated-input}/index.js.map +0 -0
- package/es/components/{input → deprecated-input}/input.js +0 -0
- package/es/components/deprecated-input/input.js.map +1 -0
- package/es/components/{select → deprecated-select}/index.js +0 -0
- package/es/components/{input → deprecated-select}/index.js.map +0 -0
- package/es/components/{select → deprecated-select}/select.js +0 -0
- package/es/components/deprecated-select/select.js.map +1 -0
- package/es/components/tooltip/tooltip.js +12 -6
- package/es/components/tooltip/tooltip.js.map +1 -1
- package/es/index.js +3 -7
- package/es/index.js.map +1 -1
- package/es/new-components/base-button/base-button.js +12 -9
- package/es/new-components/base-button/base-button.js.map +1 -1
- package/es/new-components/base-button/base-button.module.css.js +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/color-picker/color-picker.js +1 -1
- package/lib/components/color-picker/color-picker.js.map +1 -1
- package/lib/components/deprecated-dropdown/dropdown.d.ts +55 -0
- package/lib/components/{dropdown → deprecated-dropdown}/dropdown.js +1 -1
- package/lib/components/deprecated-dropdown/dropdown.js.map +1 -0
- package/lib/components/{dropdown → deprecated-dropdown}/dropdown.test.d.ts +0 -0
- package/lib/components/{dropdown → deprecated-dropdown}/index.d.ts +0 -0
- package/lib/components/{dropdown → deprecated-dropdown}/index.js +0 -0
- package/lib/components/{checkbox → deprecated-dropdown}/index.js.map +0 -0
- package/lib/components/{input → deprecated-input}/index.d.ts +0 -0
- package/lib/components/{input → deprecated-input}/index.js +0 -0
- package/lib/components/{dropdown → deprecated-input}/index.js.map +0 -0
- package/lib/components/{input → deprecated-input}/input.d.ts +0 -0
- package/lib/components/{input → deprecated-input}/input.js +0 -0
- package/lib/components/deprecated-input/input.js.map +1 -0
- package/lib/components/{input → deprecated-input}/input.test.d.ts +0 -0
- package/lib/components/{select → deprecated-select}/index.d.ts +0 -0
- package/lib/components/{select → deprecated-select}/index.js +0 -0
- package/lib/components/{input → deprecated-select}/index.js.map +0 -0
- package/lib/components/{select → deprecated-select}/select.d.ts +0 -0
- package/lib/components/{select → deprecated-select}/select.js +0 -0
- package/lib/components/deprecated-select/select.js.map +1 -0
- package/lib/components/{select → deprecated-select}/select.test.d.ts +0 -0
- 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/index.d.ts +3 -7
- package/lib/index.js +1 -1
- package/lib/new-components/base-button/base-button.d.ts +7 -4
- package/lib/new-components/base-button/base-button.js +1 -1
- package/lib/new-components/base-button/base-button.js.map +1 -1
- package/lib/new-components/base-button/base-button.module.css.js +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 +2 -4
- package/styles/alert.css +1 -1
- package/styles/base-button.css +1 -1
- package/styles/base-button.module.css.css +1 -1
- package/styles/modal.css +1 -1
- package/styles/reactist.css +5 -9
- package/styles/tabs.css +3 -3
- package/styles/tabs.module.css.css +1 -1
- package/es/components/checkbox/checkbox.js +0 -24
- package/es/components/checkbox/checkbox.js.map +0 -1
- package/es/components/checkbox/index.js +0 -6
- package/es/components/deprecated-loading/deprecated-loading.js +0 -39
- package/es/components/deprecated-loading/deprecated-loading.js.map +0 -1
- package/es/components/deprecated-modal/deprecated-modal.js +0 -207
- package/es/components/deprecated-modal/deprecated-modal.js.map +0 -1
- package/es/components/deprecated-modal/index.js +0 -11
- package/es/components/deprecated-modal/index.js.map +0 -1
- package/es/components/dropdown/dropdown.js.map +0 -1
- package/es/components/input/input.js.map +0 -1
- package/es/components/popover/index.js +0 -6
- package/es/components/popover/index.js.map +0 -1
- package/es/components/popover/popover.js +0 -206
- package/es/components/popover/popover.js.map +0 -1
- package/es/components/popover/positioning-utils.js +0 -104
- package/es/components/popover/positioning-utils.js.map +0 -1
- package/es/components/select/index.js.map +0 -1
- package/es/components/select/select.js.map +0 -1
- package/lib/components/checkbox/checkbox.d.ts +0 -13
- package/lib/components/checkbox/checkbox.js +0 -2
- package/lib/components/checkbox/checkbox.js.map +0 -1
- package/lib/components/checkbox/checkbox.test.d.ts +0 -1
- package/lib/components/checkbox/index.d.ts +0 -2
- package/lib/components/checkbox/index.js +0 -2
- package/lib/components/deprecated-loading/deprecated-loading.d.ts +0 -19
- package/lib/components/deprecated-loading/deprecated-loading.js +0 -2
- package/lib/components/deprecated-loading/deprecated-loading.js.map +0 -1
- package/lib/components/deprecated-loading/deprecated-loading.test.d.ts +0 -1
- package/lib/components/deprecated-loading/index.d.ts +0 -1
- package/lib/components/deprecated-modal/deprecated-modal.d.ts +0 -88
- package/lib/components/deprecated-modal/deprecated-modal.js +0 -2
- package/lib/components/deprecated-modal/deprecated-modal.js.map +0 -1
- package/lib/components/deprecated-modal/deprecated-modal.test.d.ts +0 -1
- package/lib/components/deprecated-modal/index.d.ts +0 -10
- package/lib/components/deprecated-modal/index.js +0 -2
- package/lib/components/deprecated-modal/index.js.map +0 -1
- package/lib/components/dropdown/dropdown.d.ts +0 -51
- package/lib/components/dropdown/dropdown.js.map +0 -1
- package/lib/components/input/input.js.map +0 -1
- package/lib/components/popover/index.d.ts +0 -2
- package/lib/components/popover/index.js +0 -2
- package/lib/components/popover/index.js.map +0 -1
- package/lib/components/popover/popover.d.ts +0 -54
- package/lib/components/popover/popover.js +0 -2
- package/lib/components/popover/popover.js.map +0 -1
- package/lib/components/popover/popover.test.d.ts +0 -1
- package/lib/components/popover/positioning-utils.d.ts +0 -19
- package/lib/components/popover/positioning-utils.js +0 -2
- package/lib/components/popover/positioning-utils.js.map +0 -1
- package/lib/components/popover/positioning-utils.test.d.ts +0 -1
- package/lib/components/select/index.js.map +0 -1
- package/lib/components/select/select.js.map +0 -1
- package/styles/checkbox.css +0 -1
- package/styles/deprecated-loading.css +0 -1
- package/styles/deprecated-modal.css +0 -1
- package/styles/popover.css +0 -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)
|
|
@@ -579,9 +585,9 @@ function Spinner({
|
|
|
579
585
|
})));
|
|
580
586
|
}
|
|
581
587
|
|
|
582
|
-
var modules_b9569bce = {"baseButton":"
|
|
588
|
+
var modules_b9569bce = {"baseButton":"a8af2163","label":"bbdb467b","shape-rounded":"ca02fc07","size-small":"_45ffe137","size-normal":"_352995bd","size-large":"_3991076f","disabled":"f82232b7","iconButton":"ef4c88db","startIcon":"a08c25c7","endIcon":"_2f6adc11","variant-primary":"_3d1243b2","variant-secondary":"_16b6b062","variant-tertiary":"cffaea5e","variant-quaternary":"_98cd5c3f","tone-destructive":"_99cb1c4d"};
|
|
583
589
|
|
|
584
|
-
const _excluded$7 = ["as", "variant", "tone", "size", "
|
|
590
|
+
const _excluded$7 = ["as", "variant", "tone", "size", "shape", "disabled", "loading", "tooltip", "onClick", "exceptionallySetClassName", "children", "startIcon", "endIcon", "icon", "width", "align"];
|
|
585
591
|
|
|
586
592
|
function preventDefault(event) {
|
|
587
593
|
event.preventDefault();
|
|
@@ -601,10 +607,10 @@ const BaseButton = /*#__PURE__*/polymorphicComponent(function BaseButton(_ref, r
|
|
|
601
607
|
variant,
|
|
602
608
|
tone = 'normal',
|
|
603
609
|
size = 'normal',
|
|
610
|
+
shape = 'normal',
|
|
604
611
|
disabled = false,
|
|
605
612
|
loading = false,
|
|
606
613
|
tooltip,
|
|
607
|
-
tooltipGapSize,
|
|
608
614
|
onClick,
|
|
609
615
|
exceptionallySetClassName,
|
|
610
616
|
children,
|
|
@@ -612,7 +618,7 @@ const BaseButton = /*#__PURE__*/polymorphicComponent(function BaseButton(_ref, r
|
|
|
612
618
|
endIcon,
|
|
613
619
|
icon,
|
|
614
620
|
width = 'auto',
|
|
615
|
-
align
|
|
621
|
+
align = 'center'
|
|
616
622
|
} = _ref,
|
|
617
623
|
props = _objectWithoutProperties(_ref, _excluded$7);
|
|
618
624
|
|
|
@@ -623,23 +629,26 @@ const BaseButton = /*#__PURE__*/polymorphicComponent(function BaseButton(_ref, r
|
|
|
623
629
|
"aria-disabled": isDisabled,
|
|
624
630
|
onClick: isDisabled ? preventDefault : onClick,
|
|
625
631
|
width: icon ? undefined : width,
|
|
626
|
-
className: [exceptionallySetClassName, modules_b9569bce.baseButton, modules_b9569bce["variant-" + variant], modules_b9569bce["tone-" + tone], modules_b9569bce["size-" + size],
|
|
632
|
+
className: [exceptionallySetClassName, modules_b9569bce.baseButton, modules_b9569bce["variant-" + variant], modules_b9569bce["tone-" + tone], modules_b9569bce["size-" + size], shape === 'rounded' ? modules_b9569bce['shape-rounded'] : null, icon ? modules_b9569bce.iconButton : null, disabled ? modules_b9569bce.disabled : null]
|
|
627
633
|
}), icon ? loading && /*#__PURE__*/React.createElement(Spinner, null) || icon : /*#__PURE__*/React.createElement(React.Fragment, null, startIcon ? /*#__PURE__*/React.createElement(Box, {
|
|
628
634
|
display: "flex",
|
|
629
635
|
className: modules_b9569bce.startIcon,
|
|
630
636
|
"aria-hidden": true
|
|
631
|
-
}, loading && !endIcon ? /*#__PURE__*/React.createElement(Spinner, null) : startIcon) : null, children ? /*#__PURE__*/React.createElement(
|
|
632
|
-
|
|
637
|
+
}, loading && !endIcon ? /*#__PURE__*/React.createElement(Spinner, null) : startIcon) : null, children ? /*#__PURE__*/React.createElement(Box, {
|
|
638
|
+
as: "span",
|
|
639
|
+
className: modules_b9569bce.label,
|
|
640
|
+
overflow: "hidden",
|
|
641
|
+
width: width === 'full' ? 'full' : undefined,
|
|
642
|
+
textAlign: width === 'auto' ? 'center' : align
|
|
633
643
|
}, children) : null, endIcon || loading && !startIcon ? /*#__PURE__*/React.createElement(Box, {
|
|
634
644
|
display: "flex",
|
|
635
645
|
className: modules_b9569bce.endIcon,
|
|
636
646
|
"aria-hidden": true
|
|
637
647
|
}, loading ? /*#__PURE__*/React.createElement(Spinner, null) : endIcon) : null)); // If it's an icon-only button, make sure it uses the aria-label as tooltip if no tooltip was provided
|
|
638
648
|
|
|
639
|
-
const tooltipContent = icon
|
|
649
|
+
const tooltipContent = icon && tooltip === undefined ? props['aria-label'] : tooltip;
|
|
640
650
|
return tooltipContent ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
641
|
-
content: tooltipContent
|
|
642
|
-
gapSize: tooltipGapSize
|
|
651
|
+
content: tooltipContent
|
|
643
652
|
}, buttonElement) : buttonElement;
|
|
644
653
|
});
|
|
645
654
|
|
|
@@ -1549,7 +1558,7 @@ function usePrevious(value) {
|
|
|
1549
1558
|
return ref.current;
|
|
1550
1559
|
}
|
|
1551
1560
|
|
|
1552
|
-
var modules_40c67f5b = {"tab":"
|
|
1561
|
+
var modules_40c67f5b = {"tab":"a1064a3b","track":"_06f1b8a1","tab-neutral":"dabbec7d","tab-themed":"e6f5ae4e","track-neutral":"_43913ce5","track-themed":"_39bdfdde","track-xsmall":"_1c148f4e","track-small":"_2a370df5","track-medium":"_77430437","track-large":"_33db5352","track-xlarge":"_60bf9564","track-xxlarge":"_29a35080"};
|
|
1553
1562
|
|
|
1554
1563
|
const _excluded$m = ["as", "children", "id", "exceptionallySetClassName"],
|
|
1555
1564
|
_excluded2$1 = ["children", "space"],
|
|
@@ -1563,8 +1572,7 @@ function Tabs({
|
|
|
1563
1572
|
children,
|
|
1564
1573
|
selectedId,
|
|
1565
1574
|
defaultSelectedId,
|
|
1566
|
-
|
|
1567
|
-
variant = 'normal',
|
|
1575
|
+
variant = 'neutral',
|
|
1568
1576
|
onSelectedIdChange
|
|
1569
1577
|
}) {
|
|
1570
1578
|
const tabState = tab.useTabState({
|
|
@@ -1584,10 +1592,9 @@ function Tabs({
|
|
|
1584
1592
|
const memoizedTabState = React.useMemo(function memoizeTabState() {
|
|
1585
1593
|
return {
|
|
1586
1594
|
tabState,
|
|
1587
|
-
color,
|
|
1588
1595
|
variant
|
|
1589
1596
|
};
|
|
1590
|
-
}, [
|
|
1597
|
+
}, [variant, tabState]);
|
|
1591
1598
|
return /*#__PURE__*/React.createElement(TabsContext.Provider, {
|
|
1592
1599
|
value: memoizedTabState
|
|
1593
1600
|
}, children);
|
|
@@ -1612,13 +1619,12 @@ const Tab = /*#__PURE__*/polymorphicComponent(function Tab(_ref, ref) {
|
|
|
1612
1619
|
}
|
|
1613
1620
|
|
|
1614
1621
|
const {
|
|
1615
|
-
color,
|
|
1616
1622
|
variant,
|
|
1617
1623
|
tabState
|
|
1618
1624
|
} = tabContextValue;
|
|
1619
1625
|
return /*#__PURE__*/React.createElement(tab.Tab, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
1620
1626
|
as: as,
|
|
1621
|
-
className: classNames(exceptionallySetClassName, modules_40c67f5b.tab, modules_40c67f5b["tab-" +
|
|
1627
|
+
className: classNames(exceptionallySetClassName, modules_40c67f5b.tab, modules_40c67f5b["tab-" + variant]),
|
|
1622
1628
|
id: id,
|
|
1623
1629
|
state: tabState,
|
|
1624
1630
|
ref: ref
|
|
@@ -1631,7 +1637,7 @@ const Tab = /*#__PURE__*/polymorphicComponent(function Tab(_ref, ref) {
|
|
|
1631
1637
|
function TabList(_ref2) {
|
|
1632
1638
|
let {
|
|
1633
1639
|
children,
|
|
1634
|
-
space = '
|
|
1640
|
+
space = 'xsmall'
|
|
1635
1641
|
} = _ref2,
|
|
1636
1642
|
props = _objectWithoutProperties(_ref2, _excluded2$1);
|
|
1637
1643
|
|
|
@@ -1642,13 +1648,24 @@ function TabList(_ref2) {
|
|
|
1642
1648
|
}
|
|
1643
1649
|
|
|
1644
1650
|
const {
|
|
1645
|
-
tabState
|
|
1651
|
+
tabState,
|
|
1652
|
+
variant
|
|
1646
1653
|
} = tabContextValue;
|
|
1647
|
-
return
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
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
|
+
);
|
|
1652
1669
|
}
|
|
1653
1670
|
/**
|
|
1654
1671
|
* Used to define the content to be rendered when a tab is active. Each `<TabPanel>` must have a corresponding `<Tab>` component.
|
|
@@ -1679,13 +1696,14 @@ const TabPanel = /*#__PURE__*/polymorphicComponent(function TabPanel(_ref3, ref)
|
|
|
1679
1696
|
const {
|
|
1680
1697
|
tabState
|
|
1681
1698
|
} = tabContextValue;
|
|
1682
|
-
|
|
1699
|
+
const shouldRender = render === 'always' || render === 'active' && tabIsActive || render === 'lazy' && (tabIsActive || tabRendered);
|
|
1700
|
+
return shouldRender ? /*#__PURE__*/React.createElement(tab.TabPanel, _objectSpread2(_objectSpread2({
|
|
1683
1701
|
tabId: id
|
|
1684
1702
|
}, props), {}, {
|
|
1685
1703
|
state: tabState,
|
|
1686
1704
|
as: as,
|
|
1687
1705
|
ref: ref
|
|
1688
|
-
}),
|
|
1706
|
+
}), children) : null;
|
|
1689
1707
|
});
|
|
1690
1708
|
/**
|
|
1691
1709
|
* Allows content to be rendered based on the current tab being selected while outside of the TabPanel
|
|
@@ -1967,26 +1985,6 @@ function Avatar(_ref) {
|
|
|
1967
1985
|
|
|
1968
1986
|
Avatar.displayName = 'Avatar';
|
|
1969
1987
|
|
|
1970
|
-
function Checkbox({
|
|
1971
|
-
label,
|
|
1972
|
-
disabled,
|
|
1973
|
-
checked = false,
|
|
1974
|
-
onChange
|
|
1975
|
-
}) {
|
|
1976
|
-
return /*#__PURE__*/React__default.createElement("label", {
|
|
1977
|
-
className: "reactist_checkbox"
|
|
1978
|
-
}, /*#__PURE__*/React__default.createElement("input", {
|
|
1979
|
-
className: "reactist_checkbox--input",
|
|
1980
|
-
value: label,
|
|
1981
|
-
checked: checked,
|
|
1982
|
-
disabled: disabled,
|
|
1983
|
-
onChange: disabled || !onChange ? undefined : event => onChange(event.target.checked),
|
|
1984
|
-
type: "checkbox"
|
|
1985
|
-
}), label);
|
|
1986
|
-
}
|
|
1987
|
-
|
|
1988
|
-
Checkbox.displayName = 'Checkbox';
|
|
1989
|
-
|
|
1990
1988
|
const _excluded$p = ["type", "variant", "size", "loading", "disabled", "tooltip", "onClick", "children"];
|
|
1991
1989
|
/**
|
|
1992
1990
|
* @deprecated
|
|
@@ -2163,7 +2161,8 @@ class Box$1 extends React__default.Component {
|
|
|
2163
2161
|
style: {
|
|
2164
2162
|
display: 'inline-block'
|
|
2165
2163
|
},
|
|
2166
|
-
className: className
|
|
2164
|
+
className: className,
|
|
2165
|
+
"data-testid": "reactist-dropdown-box"
|
|
2167
2166
|
}, top && this._getBodyComponent(), this._getTriggerComponent(), !top && this._getBodyComponent());
|
|
2168
2167
|
}
|
|
2169
2168
|
|
|
@@ -2221,7 +2220,8 @@ function Body({
|
|
|
2221
2220
|
ref: setPosition,
|
|
2222
2221
|
style: style,
|
|
2223
2222
|
className: "body",
|
|
2224
|
-
id: "reactist-dropdown-body"
|
|
2223
|
+
id: "reactist-dropdown-body",
|
|
2224
|
+
"data-testid": "reactist-dropdown-body"
|
|
2225
2225
|
}, children);
|
|
2226
2226
|
}
|
|
2227
2227
|
|
|
@@ -2288,6 +2288,7 @@ function ColorItem({
|
|
|
2288
2288
|
tooltip
|
|
2289
2289
|
}) {
|
|
2290
2290
|
const item = /*#__PURE__*/React__default.createElement("span", {
|
|
2291
|
+
"data-testid": "reactist-color-item",
|
|
2291
2292
|
className: 'reactist color_item' + (isActive ? ' active' : ''),
|
|
2292
2293
|
style: {
|
|
2293
2294
|
backgroundColor: color
|
|
@@ -2303,15 +2304,6 @@ function ColorItem({
|
|
|
2303
2304
|
|
|
2304
2305
|
ColorItem.displayName = 'ColorItem';
|
|
2305
2306
|
|
|
2306
|
-
const Input = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
2307
|
-
const className = classNames('reactist_input', props.className);
|
|
2308
|
-
return /*#__PURE__*/React__default.createElement("input", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2309
|
-
className: className,
|
|
2310
|
-
ref: ref
|
|
2311
|
-
}));
|
|
2312
|
-
});
|
|
2313
|
-
Input.displayName = 'Input';
|
|
2314
|
-
|
|
2315
2307
|
const _excluded$r = ["children", "className", "translateKey", "isMac"];
|
|
2316
2308
|
// Support for setting up how to translate modifiers globally.
|
|
2317
2309
|
//
|
|
@@ -2590,308 +2582,6 @@ function KeyCapturer(props) {
|
|
|
2590
2582
|
}, composingEventHandlers));
|
|
2591
2583
|
}
|
|
2592
2584
|
|
|
2593
|
-
const hasEnoughSpace = (windowDimensions, elementDimensions, wrapperDimensions, wrapperPosition, position, gap = 0) => {
|
|
2594
|
-
const {
|
|
2595
|
-
height: windowHeight,
|
|
2596
|
-
width: windowWidth
|
|
2597
|
-
} = windowDimensions;
|
|
2598
|
-
const {
|
|
2599
|
-
height: elementHeight,
|
|
2600
|
-
width: elementWidth
|
|
2601
|
-
} = elementDimensions;
|
|
2602
|
-
const {
|
|
2603
|
-
height: wrapperHeight,
|
|
2604
|
-
width: wrapperWidth
|
|
2605
|
-
} = wrapperDimensions;
|
|
2606
|
-
const {
|
|
2607
|
-
x: wrapperX,
|
|
2608
|
-
y: wrapperY
|
|
2609
|
-
} = wrapperPosition;
|
|
2610
|
-
|
|
2611
|
-
const verticalPosition = _calculateVerticalPosition(wrapperPosition, wrapperDimensions, elementDimensions);
|
|
2612
|
-
|
|
2613
|
-
const horizontalPosition = _calculateHorizontalPosition(wrapperPosition, wrapperDimensions, elementDimensions);
|
|
2614
|
-
|
|
2615
|
-
const canPlaceVertically = verticalPosition >= 0 && verticalPosition + elementWidth <= windowWidth;
|
|
2616
|
-
const canPlaceHorizontally = horizontalPosition >= 0 && horizontalPosition + elementHeight <= windowHeight;
|
|
2617
|
-
|
|
2618
|
-
if (position === 'top') {
|
|
2619
|
-
return canPlaceVertically && wrapperY - elementHeight - gap >= 0;
|
|
2620
|
-
} else if (position === 'right') {
|
|
2621
|
-
return canPlaceHorizontally && wrapperX + wrapperWidth + elementWidth + gap <= windowWidth;
|
|
2622
|
-
} else if (position === 'left') {
|
|
2623
|
-
return canPlaceHorizontally && wrapperX - elementWidth - gap >= 0;
|
|
2624
|
-
} else if (position === 'bottom') {
|
|
2625
|
-
return canPlaceVertically && wrapperY + wrapperHeight + elementHeight + gap <= windowHeight;
|
|
2626
|
-
}
|
|
2627
|
-
|
|
2628
|
-
return false;
|
|
2629
|
-
};
|
|
2630
|
-
|
|
2631
|
-
function _calculateVerticalPosition(wrapperPosition, wrapperDimensions, elementDimensions) {
|
|
2632
|
-
return wrapperPosition.x + (wrapperDimensions.width - elementDimensions.width) / 2;
|
|
2633
|
-
}
|
|
2634
|
-
|
|
2635
|
-
function _calculateHorizontalPosition(wrapperPosition, wrapperDimensions, elementDimensions) {
|
|
2636
|
-
return wrapperPosition.y + (wrapperDimensions.height - elementDimensions.height) / 2;
|
|
2637
|
-
}
|
|
2638
|
-
|
|
2639
|
-
const calculateTopCenterPosition = (wrapperDimensions, wrapperPosition, elementDimensions, gap = 0) => {
|
|
2640
|
-
const x = _calculateVerticalPosition(wrapperPosition, wrapperDimensions, elementDimensions);
|
|
2641
|
-
|
|
2642
|
-
const y = wrapperPosition.y - elementDimensions.height - gap;
|
|
2643
|
-
return {
|
|
2644
|
-
x,
|
|
2645
|
-
y
|
|
2646
|
-
};
|
|
2647
|
-
};
|
|
2648
|
-
|
|
2649
|
-
const calculateBottomCenterPosition = (wrapperDimensions, wrapperPosition, elementDimensions, gap = 0) => {
|
|
2650
|
-
const x = _calculateVerticalPosition(wrapperPosition, wrapperDimensions, elementDimensions);
|
|
2651
|
-
|
|
2652
|
-
const y = wrapperPosition.y + wrapperDimensions.height + gap;
|
|
2653
|
-
return {
|
|
2654
|
-
x,
|
|
2655
|
-
y
|
|
2656
|
-
};
|
|
2657
|
-
};
|
|
2658
|
-
|
|
2659
|
-
const calculateRightCenterPosition = (wrapperDimensions, wrapperPosition, elementDimensions, gap = 0) => {
|
|
2660
|
-
const x = wrapperPosition.x + wrapperDimensions.width + gap;
|
|
2661
|
-
|
|
2662
|
-
const y = _calculateHorizontalPosition(wrapperPosition, wrapperDimensions, elementDimensions);
|
|
2663
|
-
|
|
2664
|
-
return {
|
|
2665
|
-
x,
|
|
2666
|
-
y
|
|
2667
|
-
};
|
|
2668
|
-
};
|
|
2669
|
-
|
|
2670
|
-
const calculateLeftCenterPosition = (wrapperDimensions, wrapperPosition, elementDimensions, gap = 0) => {
|
|
2671
|
-
const x = wrapperPosition.x - elementDimensions.width - gap;
|
|
2672
|
-
|
|
2673
|
-
const y = _calculateHorizontalPosition(wrapperPosition, wrapperDimensions, elementDimensions);
|
|
2674
|
-
|
|
2675
|
-
return {
|
|
2676
|
-
x,
|
|
2677
|
-
y
|
|
2678
|
-
};
|
|
2679
|
-
};
|
|
2680
|
-
|
|
2681
|
-
const calculatePosition = (position, wrapperDimensions, wrapperPosition, elementDimensions, gap = 0) => {
|
|
2682
|
-
if (position === 'top') {
|
|
2683
|
-
return calculateTopCenterPosition(wrapperDimensions, wrapperPosition, elementDimensions, gap);
|
|
2684
|
-
} else if (position === 'right') {
|
|
2685
|
-
return calculateRightCenterPosition(wrapperDimensions, wrapperPosition, elementDimensions, gap);
|
|
2686
|
-
} else if (position === 'bottom') {
|
|
2687
|
-
return calculateBottomCenterPosition(wrapperDimensions, wrapperPosition, elementDimensions, gap);
|
|
2688
|
-
} else if (position === 'left') {
|
|
2689
|
-
return calculateLeftCenterPosition(wrapperDimensions, wrapperPosition, elementDimensions, gap);
|
|
2690
|
-
}
|
|
2691
|
-
|
|
2692
|
-
return wrapperPosition;
|
|
2693
|
-
};
|
|
2694
|
-
|
|
2695
|
-
class Popover extends React__default.Component {
|
|
2696
|
-
constructor(...args) {
|
|
2697
|
-
super(...args);
|
|
2698
|
-
this.popover = void 0;
|
|
2699
|
-
this.wrapper = void 0;
|
|
2700
|
-
|
|
2701
|
-
this._updatePopoverPosition = () => {
|
|
2702
|
-
const {
|
|
2703
|
-
position,
|
|
2704
|
-
allowVaguePositioning,
|
|
2705
|
-
gapSize
|
|
2706
|
-
} = this.props;
|
|
2707
|
-
const wrapperRect = this.wrapper.getBoundingClientRect();
|
|
2708
|
-
const popoverRect = this.popover.getBoundingClientRect(); // Instead of using the documentElement find the nearest absolutely positioned element
|
|
2709
|
-
|
|
2710
|
-
const documentEl = document.documentElement;
|
|
2711
|
-
let node = this.wrapper;
|
|
2712
|
-
let foundParent = false;
|
|
2713
|
-
|
|
2714
|
-
while (!foundParent) {
|
|
2715
|
-
const styles = getComputedStyle(node);
|
|
2716
|
-
const position = styles.getPropertyValue('position');
|
|
2717
|
-
|
|
2718
|
-
if (position === 'absolute' || node === documentEl || !node.parentElement) {
|
|
2719
|
-
foundParent = true;
|
|
2720
|
-
} else {
|
|
2721
|
-
node = node.parentElement;
|
|
2722
|
-
}
|
|
2723
|
-
}
|
|
2724
|
-
|
|
2725
|
-
const nodeRect = node.getBoundingClientRect();
|
|
2726
|
-
const windowDimensions = {
|
|
2727
|
-
height: nodeRect.height,
|
|
2728
|
-
width: nodeRect.width
|
|
2729
|
-
};
|
|
2730
|
-
const popoverDimensions = {
|
|
2731
|
-
height: popoverRect.height,
|
|
2732
|
-
width: popoverRect.width
|
|
2733
|
-
};
|
|
2734
|
-
const wrapperDimensions = {
|
|
2735
|
-
height: wrapperRect.height,
|
|
2736
|
-
width: wrapperRect.width
|
|
2737
|
-
};
|
|
2738
|
-
const wrapperPositionRelative = {
|
|
2739
|
-
x: wrapperRect.left - nodeRect.left,
|
|
2740
|
-
y: wrapperRect.top - nodeRect.top
|
|
2741
|
-
};
|
|
2742
|
-
const wrapperPositionAbsolute = {
|
|
2743
|
-
x: wrapperRect.left,
|
|
2744
|
-
y: wrapperRect.top
|
|
2745
|
-
};
|
|
2746
|
-
const positionsToTry = position === 'auto' ? ['top', 'right', 'bottom', 'left', 'top'] : position === 'vertical' ? ['top', 'bottom'] : position === 'horizontal' ? ['left', 'right'] : [position];
|
|
2747
|
-
|
|
2748
|
-
for (let index = 0; index < positionsToTry.length; index++) {
|
|
2749
|
-
const currentPosition = positionsToTry[index];
|
|
2750
|
-
const enoughSpaceAtPosition = currentPosition != null ? hasEnoughSpace(windowDimensions, popoverDimensions, wrapperDimensions, wrapperPositionRelative, currentPosition, gapSize) : false;
|
|
2751
|
-
|
|
2752
|
-
if (enoughSpaceAtPosition || index === positionsToTry.length - 1) {
|
|
2753
|
-
const popoverPosition = currentPosition != null ? calculatePosition(currentPosition, wrapperDimensions, wrapperPositionAbsolute, popoverDimensions, gapSize) : wrapperPositionAbsolute;
|
|
2754
|
-
this.popover.style.top = popoverPosition.y + "px";
|
|
2755
|
-
this.popover.style.left = popoverPosition.x + "px";
|
|
2756
|
-
/**
|
|
2757
|
-
* Correct placement if vague positioning is allowed.
|
|
2758
|
-
* When it's not allowed we "cut off" popovers and display them
|
|
2759
|
-
* out of the viewport to maintain their centered position.
|
|
2760
|
-
*/
|
|
2761
|
-
|
|
2762
|
-
if (allowVaguePositioning) {
|
|
2763
|
-
// correct horizontally
|
|
2764
|
-
if (popoverPosition.x < 0) {
|
|
2765
|
-
this.popover.style.left = 2 * gapSize + "px";
|
|
2766
|
-
} // correct vertically
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
if (popoverPosition.y + popoverDimensions.height > windowDimensions.height) {
|
|
2770
|
-
this.popover.style.top = windowDimensions.height - popoverDimensions.height - 2 * gapSize + "px";
|
|
2771
|
-
}
|
|
2772
|
-
}
|
|
2773
|
-
|
|
2774
|
-
if (currentPosition !== position) {
|
|
2775
|
-
this.popover.className = this._getClassNameForPosition(currentPosition);
|
|
2776
|
-
}
|
|
2777
|
-
|
|
2778
|
-
break;
|
|
2779
|
-
}
|
|
2780
|
-
}
|
|
2781
|
-
};
|
|
2782
|
-
|
|
2783
|
-
this._getClassNameForPosition = position => {
|
|
2784
|
-
const {
|
|
2785
|
-
visible,
|
|
2786
|
-
withArrow,
|
|
2787
|
-
arrowClassName
|
|
2788
|
-
} = this.props;
|
|
2789
|
-
const className = classNames('reactist_popover', {
|
|
2790
|
-
visible
|
|
2791
|
-
});
|
|
2792
|
-
|
|
2793
|
-
if (visible && withArrow) {
|
|
2794
|
-
return classNames(className, arrowClassName, {
|
|
2795
|
-
arrow_top: position === 'bottom',
|
|
2796
|
-
arrow_right: position === 'left',
|
|
2797
|
-
arrow_bottom: position === 'auto' || position === 'top',
|
|
2798
|
-
arrow_left: position === 'right'
|
|
2799
|
-
});
|
|
2800
|
-
}
|
|
2801
|
-
|
|
2802
|
-
return className;
|
|
2803
|
-
};
|
|
2804
|
-
|
|
2805
|
-
this._updatePopoverRef = popover => {
|
|
2806
|
-
this.popover = popover;
|
|
2807
|
-
|
|
2808
|
-
if (typeof this.props.popoverRef === 'function') {
|
|
2809
|
-
this.props.popoverRef(popover);
|
|
2810
|
-
}
|
|
2811
|
-
};
|
|
2812
|
-
|
|
2813
|
-
this._updateWrapperRef = wrapper => {
|
|
2814
|
-
this.wrapper = wrapper;
|
|
2815
|
-
|
|
2816
|
-
if (typeof this.props.wrapperRef === 'function') {
|
|
2817
|
-
this.props.wrapperRef(wrapper);
|
|
2818
|
-
}
|
|
2819
|
-
};
|
|
2820
|
-
}
|
|
2821
|
-
|
|
2822
|
-
componentDidMount() {
|
|
2823
|
-
if (this.props.visible) {
|
|
2824
|
-
this._updatePopoverPosition();
|
|
2825
|
-
}
|
|
2826
|
-
}
|
|
2827
|
-
|
|
2828
|
-
componentDidUpdate(prevProps) {
|
|
2829
|
-
if (this.wrapper && this.props.visible) {
|
|
2830
|
-
const positionChanged = prevProps.position !== this.props.position;
|
|
2831
|
-
const vaguePositioningChanged = prevProps.allowVaguePositioning !== this.props.allowVaguePositioning;
|
|
2832
|
-
const visibilityChanged = prevProps.visible !== this.props.visible;
|
|
2833
|
-
const arrowChanged = prevProps.withArrow !== this.props.withArrow;
|
|
2834
|
-
const gapSizeChanged = prevProps.gapSize !== this.props.gapSize;
|
|
2835
|
-
const contentChanged = prevProps.content !== this.props.content;
|
|
2836
|
-
|
|
2837
|
-
if (positionChanged || vaguePositioningChanged || visibilityChanged || arrowChanged || gapSizeChanged || contentChanged) {
|
|
2838
|
-
this._updatePopoverPosition();
|
|
2839
|
-
}
|
|
2840
|
-
}
|
|
2841
|
-
}
|
|
2842
|
-
|
|
2843
|
-
render() {
|
|
2844
|
-
const {
|
|
2845
|
-
position,
|
|
2846
|
-
wrapperClassName,
|
|
2847
|
-
popoverClassName,
|
|
2848
|
-
onMouseEnter,
|
|
2849
|
-
onMouseLeave,
|
|
2850
|
-
onClick,
|
|
2851
|
-
trigger,
|
|
2852
|
-
content
|
|
2853
|
-
} = this.props;
|
|
2854
|
-
const popoverClass = position ? this._getClassNameForPosition(position) : '';
|
|
2855
|
-
const popoverContentClass = classNames('reactist_popover__content', popoverClassName);
|
|
2856
|
-
const wrapperClass = classNames('reactist_popover__wrapper', wrapperClassName);
|
|
2857
|
-
const triggerElement = React__default.Children.only(trigger);
|
|
2858
|
-
|
|
2859
|
-
function handleTriggerClick(event) {
|
|
2860
|
-
// @ts-expect-error This is temporary while we revisit the Popover interface
|
|
2861
|
-
if (onClick) onClick(event); // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
2862
|
-
|
|
2863
|
-
if (typeof triggerElement.props.onClick === 'function') {
|
|
2864
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-unsafe-call
|
|
2865
|
-
triggerElement.props.onClick(event);
|
|
2866
|
-
}
|
|
2867
|
-
}
|
|
2868
|
-
|
|
2869
|
-
return /*#__PURE__*/React__default.createElement("span", {
|
|
2870
|
-
className: wrapperClass,
|
|
2871
|
-
onMouseEnter: onMouseEnter,
|
|
2872
|
-
onMouseLeave: onMouseLeave,
|
|
2873
|
-
ref: this._updateWrapperRef
|
|
2874
|
-
}, /*#__PURE__*/React__default.cloneElement(triggerElement, {
|
|
2875
|
-
onClick: handleTriggerClick
|
|
2876
|
-
}), /*#__PURE__*/React__default.createElement("span", {
|
|
2877
|
-
className: popoverClass,
|
|
2878
|
-
ref: this._updatePopoverRef
|
|
2879
|
-
}, this.props.visible ? /*#__PURE__*/React__default.createElement("span", {
|
|
2880
|
-
className: popoverContentClass
|
|
2881
|
-
}, typeof content === 'function' ? content() : content) : null));
|
|
2882
|
-
}
|
|
2883
|
-
|
|
2884
|
-
}
|
|
2885
|
-
|
|
2886
|
-
Popover.displayName = void 0;
|
|
2887
|
-
Popover.defaultProps = void 0;
|
|
2888
|
-
Popover.displayName = 'Popover';
|
|
2889
|
-
Popover.defaultProps = {
|
|
2890
|
-
position: 'auto',
|
|
2891
|
-
gapSize: 5 // default size of the arrow (see `tooltip.less`)
|
|
2892
|
-
|
|
2893
|
-
};
|
|
2894
|
-
|
|
2895
2585
|
function ProgressBar({
|
|
2896
2586
|
fillPercentage = 0,
|
|
2897
2587
|
className,
|
|
@@ -2915,41 +2605,6 @@ function ProgressBar({
|
|
|
2915
2605
|
|
|
2916
2606
|
ProgressBar.displayName = 'ProgressBar';
|
|
2917
2607
|
|
|
2918
|
-
const _excluded$s = ["value", "options", "onChange", "disabled", "className", "defaultValue"];
|
|
2919
|
-
|
|
2920
|
-
function Select(_ref) {
|
|
2921
|
-
let {
|
|
2922
|
-
value,
|
|
2923
|
-
options = [],
|
|
2924
|
-
onChange,
|
|
2925
|
-
disabled = true,
|
|
2926
|
-
className = '',
|
|
2927
|
-
defaultValue
|
|
2928
|
-
} = _ref,
|
|
2929
|
-
otherProps = _objectWithoutProperties(_ref, _excluded$s);
|
|
2930
|
-
|
|
2931
|
-
const selectClassName = classNames('reactist_select', {
|
|
2932
|
-
disabled
|
|
2933
|
-
}, className);
|
|
2934
|
-
return /*#__PURE__*/React__default.createElement("select", _objectSpread2({
|
|
2935
|
-
className: selectClassName,
|
|
2936
|
-
value: value,
|
|
2937
|
-
onChange: event => onChange ? onChange(event.target.value) : undefined,
|
|
2938
|
-
disabled: disabled,
|
|
2939
|
-
defaultValue: defaultValue
|
|
2940
|
-
}, otherProps), options == null ? void 0 : options.map(option => /*#__PURE__*/React__default.createElement("option", {
|
|
2941
|
-
key: option.key || option.value,
|
|
2942
|
-
value: option.value,
|
|
2943
|
-
disabled: option.disabled
|
|
2944
|
-
}, option.text)));
|
|
2945
|
-
}
|
|
2946
|
-
|
|
2947
|
-
Select.displayName = 'Select';
|
|
2948
|
-
Select.defaultProps = {
|
|
2949
|
-
options: [],
|
|
2950
|
-
disabled: false
|
|
2951
|
-
};
|
|
2952
|
-
|
|
2953
2608
|
dayjs.extend(LocalizedFormat);
|
|
2954
2609
|
const TimeUtils = {
|
|
2955
2610
|
SHORT_FORMAT_CURRENT_YEAR: 'L',
|
|
@@ -3147,7 +2802,7 @@ const CloseIcon$1 = () => /*#__PURE__*/React__default.createElement("svg", {
|
|
|
3147
2802
|
d: "M11.293 12L5.146 5.854a.5.5 0 1 1 .708-.708L12 11.293l6.146-6.147a.5.5 0 0 1 .708.708L12.707 12l6.147 6.146a.5.5 0 0 1-.708.708L12 12.707l-6.146 6.147a.5.5 0 0 1-.708-.708L11.293 12z"
|
|
3148
2803
|
}));
|
|
3149
2804
|
|
|
3150
|
-
const _excluded$
|
|
2805
|
+
const _excluded$s = ["id", "icon", "title", "subtitle", "children", "customCloseButton", "onClick", "onClose", "closeAltText", "className", "aria-live"];
|
|
3151
2806
|
|
|
3152
2807
|
function Notification(_ref) {
|
|
3153
2808
|
let {
|
|
@@ -3163,7 +2818,7 @@ function Notification(_ref) {
|
|
|
3163
2818
|
className,
|
|
3164
2819
|
'aria-live': ariaLive = 'polite'
|
|
3165
2820
|
} = _ref,
|
|
3166
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
2821
|
+
rest = _objectWithoutProperties(_ref, _excluded$s);
|
|
3167
2822
|
|
|
3168
2823
|
const titleId = title ? id + "-title" : null;
|
|
3169
2824
|
const titleIdAttribute = titleId ? {
|
|
@@ -3213,7 +2868,7 @@ function Notification(_ref) {
|
|
|
3213
2868
|
}, customCloseButton != null ? customCloseButton : /*#__PURE__*/React__default.createElement(CloseIcon$1, null)) : null);
|
|
3214
2869
|
}
|
|
3215
2870
|
|
|
3216
|
-
const _excluded$
|
|
2871
|
+
const _excluded$t = ["children", "onItemSelect"],
|
|
3217
2872
|
_excluded2$3 = ["exceptionallySetClassName"],
|
|
3218
2873
|
_excluded3$2 = ["exceptionallySetClassName"],
|
|
3219
2874
|
_excluded4$1 = ["value", "children", "onSelect", "hideOnSelect", "onClick", "exceptionallySetClassName", "as"],
|
|
@@ -3235,7 +2890,7 @@ function Menu(_ref) {
|
|
|
3235
2890
|
children,
|
|
3236
2891
|
onItemSelect
|
|
3237
2892
|
} = _ref,
|
|
3238
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
2893
|
+
props = _objectWithoutProperties(_ref, _excluded$t);
|
|
3239
2894
|
|
|
3240
2895
|
const state = Ariakit.useMenuState(_objectSpread2({
|
|
3241
2896
|
focusLoop: true,
|
|
@@ -3411,268 +3066,69 @@ const MenuGroup = /*#__PURE__*/polymorphicComponent(function MenuGroup(_ref5, re
|
|
|
3411
3066
|
}, label) : null, children);
|
|
3412
3067
|
});
|
|
3413
3068
|
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
const modalElement = document.getElementById('modal_box');
|
|
3423
|
-
ReactDOM.unmountComponentAtNode(modalElement);
|
|
3424
|
-
};
|
|
3425
|
-
|
|
3426
|
-
this._handleKeyDown = event => {
|
|
3427
|
-
if (event.keyCode === 27) {
|
|
3428
|
-
// ESC
|
|
3429
|
-
this._closeModal();
|
|
3430
|
-
|
|
3431
|
-
if (event.preventDefault) event.preventDefault();
|
|
3432
|
-
}
|
|
3433
|
-
};
|
|
3434
|
-
|
|
3435
|
-
this._handleOverlayClick = event => {
|
|
3436
|
-
if (event.target instanceof Element && (event.target.id === 'reactist-overlay' || event.target.id === 'reactist-overlay-inner')) {
|
|
3437
|
-
this._closeModal();
|
|
3438
|
-
}
|
|
3439
|
-
};
|
|
3440
|
-
}
|
|
3441
|
-
|
|
3442
|
-
componentDidMount() {
|
|
3443
|
-
window.addEventListener('keydown', this._handleKeyDown);
|
|
3444
|
-
}
|
|
3445
|
-
|
|
3446
|
-
componentWillUnmount() {
|
|
3447
|
-
window.removeEventListener('keydown', this._handleKeyDown);
|
|
3448
|
-
}
|
|
3449
|
-
|
|
3450
|
-
render() {
|
|
3451
|
-
const {
|
|
3452
|
-
large,
|
|
3453
|
-
medium,
|
|
3454
|
-
style,
|
|
3455
|
-
children,
|
|
3456
|
-
closeOnOverlayClick
|
|
3457
|
-
} = this.props;
|
|
3458
|
-
const className = classNames('reactist_modal_box', {
|
|
3459
|
-
large,
|
|
3460
|
-
medium
|
|
3461
|
-
}, this.props.className);
|
|
3462
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
3463
|
-
className: "reactist_overlay",
|
|
3464
|
-
id: "reactist-overlay",
|
|
3465
|
-
onClick: closeOnOverlayClick ? this._handleOverlayClick : undefined
|
|
3466
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
3467
|
-
className: "reactist_overlay_inner",
|
|
3468
|
-
id: "reactist-overlay-inner"
|
|
3469
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
3470
|
-
style: style,
|
|
3471
|
-
className: className
|
|
3472
|
-
}, children)));
|
|
3473
|
-
}
|
|
3474
|
-
|
|
3475
|
-
}
|
|
3476
|
-
|
|
3477
|
-
Box$2.displayName = void 0;
|
|
3478
|
-
Box$2.defaultProps = void 0;
|
|
3479
|
-
Box$2.displayName = 'Modal.Box';
|
|
3480
|
-
Box$2.defaultProps = {
|
|
3481
|
-
large: false,
|
|
3482
|
-
closeOnOverlayClick: false
|
|
3483
|
-
};
|
|
3484
|
-
/** @deprecated */
|
|
3485
|
-
|
|
3486
|
-
class Header extends React__default.Component {
|
|
3487
|
-
_closeModal(event) {
|
|
3488
|
-
event.preventDefault();
|
|
3489
|
-
|
|
3490
|
-
if (typeof this.props.beforeClose === 'function') {
|
|
3491
|
-
this.props.beforeClose();
|
|
3492
|
-
} // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
const modalElement = document.getElementById('modal_box');
|
|
3496
|
-
ReactDOM.unmountComponentAtNode(modalElement);
|
|
3497
|
-
}
|
|
3498
|
-
|
|
3499
|
-
render() {
|
|
3500
|
-
return (
|
|
3501
|
-
/*#__PURE__*/
|
|
3502
|
-
|
|
3503
|
-
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
3504
|
-
React__default.createElement("div", {
|
|
3505
|
-
className: "reactist_modal_box__header"
|
|
3506
|
-
}, /*#__PURE__*/React__default.createElement("p", null, this.props.title && /*#__PURE__*/React__default.createElement("span", {
|
|
3507
|
-
className: "title"
|
|
3508
|
-
}, this.props.title), this.props.subtitle && /*#__PURE__*/React__default.createElement("span", {
|
|
3509
|
-
className: "subtitle"
|
|
3510
|
-
}, this.props.subtitle), this.props.children), /*#__PURE__*/React__default.createElement("a", {
|
|
3511
|
-
className: "close",
|
|
3512
|
-
onClick: this._closeModal.bind(this),
|
|
3513
|
-
href: "#"
|
|
3514
|
-
}, /*#__PURE__*/React__default.createElement(CloseIcon$1, null)))
|
|
3515
|
-
/* eslint-enable jsx-a11y/anchor-is-valid */
|
|
3516
|
-
|
|
3517
|
-
);
|
|
3518
|
-
}
|
|
3519
|
-
|
|
3520
|
-
}
|
|
3521
|
-
|
|
3522
|
-
Header.displayName = void 0;
|
|
3523
|
-
Header.defaultProps = void 0;
|
|
3524
|
-
Header.displayName = 'Modal.Header';
|
|
3525
|
-
/** @deprecated */
|
|
3526
|
-
|
|
3527
|
-
class Body$1 extends React__default.Component {
|
|
3528
|
-
_closeModal(event) {
|
|
3529
|
-
event.preventDefault(); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3530
|
-
|
|
3531
|
-
const modalElement = document.getElementById('modal_box');
|
|
3532
|
-
ReactDOM.unmountComponentAtNode(modalElement);
|
|
3533
|
-
}
|
|
3534
|
-
|
|
3535
|
-
render() {
|
|
3536
|
-
const {
|
|
3537
|
-
icon,
|
|
3538
|
-
plain,
|
|
3539
|
-
children,
|
|
3540
|
-
style,
|
|
3541
|
-
showCloseIcon
|
|
3542
|
-
} = this.props;
|
|
3543
|
-
const className = classNames('reactist_modal_box__body', {
|
|
3544
|
-
plain
|
|
3545
|
-
}, this.props.className);
|
|
3546
|
-
return (
|
|
3547
|
-
/*#__PURE__*/
|
|
3548
|
-
|
|
3549
|
-
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
3550
|
-
React__default.createElement("div", {
|
|
3551
|
-
className: className,
|
|
3552
|
-
style: style
|
|
3553
|
-
}, showCloseIcon && /*#__PURE__*/React__default.createElement("a", {
|
|
3554
|
-
className: "close",
|
|
3555
|
-
onClick: this._closeModal.bind(this),
|
|
3556
|
-
href: "#"
|
|
3557
|
-
}, /*#__PURE__*/React__default.createElement(CloseIcon$1, null)), icon ? /*#__PURE__*/React__default.createElement("div", {
|
|
3558
|
-
className: "dialog"
|
|
3559
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
3560
|
-
className: "reactist_icon"
|
|
3561
|
-
}, icon), /*#__PURE__*/React__default.createElement("div", {
|
|
3562
|
-
className: "content"
|
|
3563
|
-
}, children)) : children)
|
|
3564
|
-
/* eslint-enable jsx-a11y/anchor-is-valid */
|
|
3565
|
-
|
|
3566
|
-
);
|
|
3567
|
-
}
|
|
3568
|
-
|
|
3569
|
-
}
|
|
3570
|
-
|
|
3571
|
-
Body$1.displayName = void 0;
|
|
3572
|
-
Body$1.defaultProps = void 0;
|
|
3573
|
-
Body$1.displayName = 'Modal.Body';
|
|
3574
|
-
Body$1.defaultProps = {
|
|
3575
|
-
showCloseIcon: false
|
|
3576
|
-
};
|
|
3577
|
-
/** @deprecated */
|
|
3578
|
-
|
|
3579
|
-
class Actions extends React__default.Component {
|
|
3580
|
-
_onClick(onClick) {
|
|
3581
|
-
if (onClick) {
|
|
3582
|
-
onClick();
|
|
3583
|
-
} // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3584
|
-
|
|
3069
|
+
const Input = /*#__PURE__*/React__default.forwardRef((props, ref) => {
|
|
3070
|
+
const className = classNames('reactist_input', props.className);
|
|
3071
|
+
return /*#__PURE__*/React__default.createElement("input", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
3072
|
+
className: className,
|
|
3073
|
+
ref: ref
|
|
3074
|
+
}));
|
|
3075
|
+
});
|
|
3076
|
+
Input.displayName = 'Input';
|
|
3585
3077
|
|
|
3586
|
-
|
|
3587
|
-
ReactDOM.unmountComponentAtNode(modalElement);
|
|
3588
|
-
}
|
|
3078
|
+
const _excluded$u = ["value", "options", "onChange", "disabled", "className", "defaultValue"];
|
|
3589
3079
|
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
} else {
|
|
3601
|
-
return child ? /*#__PURE__*/React__default.cloneElement(child) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
|
|
3602
|
-
}
|
|
3603
|
-
});
|
|
3604
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
3605
|
-
className: "reactist_modal_box__actions"
|
|
3606
|
-
}, children);
|
|
3607
|
-
}
|
|
3080
|
+
function Select(_ref) {
|
|
3081
|
+
let {
|
|
3082
|
+
value,
|
|
3083
|
+
options = [],
|
|
3084
|
+
onChange,
|
|
3085
|
+
disabled = true,
|
|
3086
|
+
className = '',
|
|
3087
|
+
defaultValue
|
|
3088
|
+
} = _ref,
|
|
3089
|
+
otherProps = _objectWithoutProperties(_ref, _excluded$u);
|
|
3608
3090
|
|
|
3091
|
+
const selectClassName = classNames('reactist_select', {
|
|
3092
|
+
disabled
|
|
3093
|
+
}, className);
|
|
3094
|
+
return /*#__PURE__*/React__default.createElement("select", _objectSpread2({
|
|
3095
|
+
className: selectClassName,
|
|
3096
|
+
value: value,
|
|
3097
|
+
onChange: event => onChange ? onChange(event.target.value) : undefined,
|
|
3098
|
+
disabled: disabled,
|
|
3099
|
+
defaultValue: defaultValue
|
|
3100
|
+
}, otherProps), options == null ? void 0 : options.map(option => /*#__PURE__*/React__default.createElement("option", {
|
|
3101
|
+
key: option.key || option.value,
|
|
3102
|
+
value: option.value,
|
|
3103
|
+
disabled: option.disabled
|
|
3104
|
+
}, option.text)));
|
|
3609
3105
|
}
|
|
3610
3106
|
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
Box: Box$2,
|
|
3616
|
-
Header,
|
|
3617
|
-
Body: Body$1,
|
|
3618
|
-
Actions
|
|
3107
|
+
Select.displayName = 'Select';
|
|
3108
|
+
Select.defaultProps = {
|
|
3109
|
+
options: [],
|
|
3110
|
+
disabled: false
|
|
3619
3111
|
};
|
|
3620
3112
|
|
|
3621
|
-
/** @deprecated */
|
|
3622
|
-
|
|
3623
|
-
function Loading$1({
|
|
3624
|
-
className,
|
|
3625
|
-
spinnerColor = '#3F82EF',
|
|
3626
|
-
bgColor = '#D9E6FB',
|
|
3627
|
-
size = 24,
|
|
3628
|
-
'aria-label': ariaLabel = 'Loading'
|
|
3629
|
-
}) {
|
|
3630
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
3631
|
-
className: classNames('reactist_loading', className),
|
|
3632
|
-
"aria-label": ariaLabel,
|
|
3633
|
-
"aria-live": "assertive",
|
|
3634
|
-
role: "alert"
|
|
3635
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
3636
|
-
className: "reactist_loading--spinner"
|
|
3637
|
-
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
3638
|
-
width: size,
|
|
3639
|
-
height: size,
|
|
3640
|
-
viewBox: '0 0 24 24'
|
|
3641
|
-
}, /*#__PURE__*/React__default.createElement("g", {
|
|
3642
|
-
fill: "none",
|
|
3643
|
-
fillRule: "nonzero"
|
|
3644
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
3645
|
-
fill: spinnerColor,
|
|
3646
|
-
d: "M17.945 3.958A9.955 9.955 0 0 0 12 2c-2.19 0-4.217.705-5.865 1.9L5.131 2.16A11.945 11.945 0 0 1 12 0c2.59 0 4.99.82 6.95 2.217l-1.005 1.741z"
|
|
3647
|
-
}), /*#__PURE__*/React__default.createElement("path", {
|
|
3648
|
-
fill: bgColor,
|
|
3649
|
-
d: "M5.13 2.16L6.136 3.9A9.987 9.987 0 0 0 2 12c0 5.523 4.477 10 10 10s10-4.477 10-10a9.986 9.986 0 0 0-4.055-8.042l1.006-1.741A11.985 11.985 0 0 1 24 12c0 6.627-5.373 12-12 12S0 18.627 0 12c0-4.073 2.029-7.671 5.13-9.84z"
|
|
3650
|
-
})))));
|
|
3651
|
-
}
|
|
3652
|
-
|
|
3653
|
-
Loading$1.displayName = 'Loading';
|
|
3654
|
-
|
|
3655
3113
|
exports.Alert = Alert;
|
|
3656
3114
|
exports.Avatar = Avatar;
|
|
3657
3115
|
exports.Box = Box;
|
|
3658
3116
|
exports.Button = Button;
|
|
3659
3117
|
exports.ButtonLink = ButtonLink;
|
|
3660
3118
|
exports.COLORS = COLORS;
|
|
3661
|
-
exports.Checkbox = Checkbox;
|
|
3662
3119
|
exports.CheckboxField = CheckboxField;
|
|
3663
3120
|
exports.ColorPicker = ColorPicker;
|
|
3664
3121
|
exports.Column = Column;
|
|
3665
3122
|
exports.Columns = Columns;
|
|
3666
3123
|
exports.DeprecatedButton = Button$1;
|
|
3667
|
-
exports.
|
|
3668
|
-
exports.
|
|
3124
|
+
exports.DeprecatedDropdown = Dropdown;
|
|
3125
|
+
exports.DeprecatedInput = Input;
|
|
3126
|
+
exports.DeprecatedSelect = Select;
|
|
3669
3127
|
exports.Divider = Divider;
|
|
3670
|
-
exports.Dropdown = Dropdown;
|
|
3671
3128
|
exports.Heading = Heading;
|
|
3672
3129
|
exports.Hidden = Hidden;
|
|
3673
3130
|
exports.HiddenVisually = HiddenVisually;
|
|
3674
3131
|
exports.Inline = Inline;
|
|
3675
|
-
exports.Input = Input;
|
|
3676
3132
|
exports.KeyCapturer = KeyCapturer;
|
|
3677
3133
|
exports.KeyboardShortcut = KeyboardShortcut;
|
|
3678
3134
|
exports.Loading = Loading;
|
|
@@ -3690,10 +3146,8 @@ exports.ModalHeader = ModalHeader;
|
|
|
3690
3146
|
exports.Notice = Notice;
|
|
3691
3147
|
exports.Notification = Notification;
|
|
3692
3148
|
exports.PasswordField = PasswordField;
|
|
3693
|
-
exports.Popover = Popover;
|
|
3694
3149
|
exports.ProgressBar = ProgressBar;
|
|
3695
3150
|
exports.SUPPORTED_KEYS = SUPPORTED_KEYS;
|
|
3696
|
-
exports.Select = Select;
|
|
3697
3151
|
exports.SelectField = SelectField;
|
|
3698
3152
|
exports.Stack = Stack;
|
|
3699
3153
|
exports.SubMenu = SubMenu;
|