@doist/reactist 21.3.0 → 22.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.
@@ -20,7 +20,6 @@ var Ariakit = require('ariakit/menu');
20
20
  var ReactDOM = _interopDefault(require('react-dom'));
21
21
  var dayjs = _interopDefault(require('dayjs'));
22
22
  var LocalizedFormat = _interopDefault(require('dayjs/plugin/localizedFormat'));
23
- var dialog$1 = require('@reach/dialog');
24
23
 
25
24
  function ownKeys(object, enumerableOnly) {
26
25
  var keys = Object.keys(object);
@@ -3739,212 +3738,6 @@ Select.defaultProps = {
3739
3738
  disabled: false
3740
3739
  };
3741
3740
 
3742
- var modules_8f59d13b$1 = {"reach-portal":"ad18b0a0","fadein":"f7a1b219","fitContent":"_8ed9bb5c","container":"f67e892e","full":"_4139421e","large":"_649eb5fe","medium":"_5323e676","small":"_56ca7ae6","xlarge":"a7be0fce","overlay":"_88a7a680","expand":"b29456b8","buttonContainer":"_09ef1f4f","headerContent":"_0e5b530a"};
3743
-
3744
- const _excluded$y = ["isOpen", "onDismiss", "height", "width", "exceptionallySetClassName", "autoFocus", "children"],
3745
- _excluded2$4 = ["children", "button", "withDivider", "exceptionallySetClassName"],
3746
- _excluded3$3 = ["exceptionallySetClassName", "children"],
3747
- _excluded4$2 = ["exceptionallySetClassName", "withDivider"],
3748
- _excluded5$2 = ["children"];
3749
- const ModalContext$1 = /*#__PURE__*/React.createContext({
3750
- onDismiss: undefined,
3751
- height: 'fitContent'
3752
- });
3753
-
3754
- function isNotInternalFrame$1(element) {
3755
- return !(element.ownerDocument === document && element.tagName.toLowerCase() === 'iframe');
3756
- }
3757
- /**
3758
- * Renders a modal that sits on top of the rest of the content in the entire page.
3759
- *
3760
- * Follows the WAI-ARIA Dialog (Modal) Pattern.
3761
- *
3762
- * @see DeprecatedModalHeader
3763
- * @see DeprecatedModalFooter
3764
- * @see DeprecatedModalBody
3765
- * @deprecated
3766
- */
3767
-
3768
-
3769
- function DeprecatedModal(_ref) {
3770
- let {
3771
- isOpen,
3772
- onDismiss,
3773
- height = 'fitContent',
3774
- width = 'medium',
3775
- exceptionallySetClassName,
3776
- autoFocus = true,
3777
- children
3778
- } = _ref,
3779
- props = _objectWithoutProperties(_ref, _excluded$y);
3780
-
3781
- const contextValue = React.useMemo(() => ({
3782
- onDismiss,
3783
- height
3784
- }), [onDismiss, height]);
3785
- return /*#__PURE__*/React.createElement(dialog$1.DialogOverlay, {
3786
- isOpen: isOpen,
3787
- onDismiss: onDismiss,
3788
- dangerouslyBypassFocusLock // We're setting up our own focus lock below
3789
- : true,
3790
- className: classNames(modules_8f59d13b$1.overlay, modules_8f59d13b$1[height], modules_8f59d13b$1[width]),
3791
- "data-testid": "modal-overlay"
3792
- }, /*#__PURE__*/React.createElement(FocusLock, {
3793
- autoFocus: autoFocus,
3794
- whiteList: isNotInternalFrame$1,
3795
- returnFocus: true
3796
- }, /*#__PURE__*/React.createElement(dialog$1.DialogContent, _objectSpread2(_objectSpread2({}, props), {}, {
3797
- as: Box,
3798
- borderRadius: "full",
3799
- background: "default",
3800
- display: "flex",
3801
- flexDirection: "column",
3802
- overflow: "hidden",
3803
- height: height === 'expand' ? 'full' : undefined,
3804
- flexGrow: height === 'expand' ? 1 : 0,
3805
- className: [exceptionallySetClassName, modules_8f59d13b$1.container]
3806
- }), /*#__PURE__*/React.createElement(ModalContext$1.Provider, {
3807
- value: contextValue
3808
- }, children))));
3809
- }
3810
- /**
3811
- * The close button rendered by ModalHeader. Provided independently so that consumers can customize
3812
- * the button's label.
3813
- *
3814
- * @see DeprecatedModalHeader
3815
- */
3816
-
3817
- function DeprecatedModalCloseButton(props) {
3818
- const {
3819
- onDismiss
3820
- } = React.useContext(ModalContext$1);
3821
- const [includeInTabOrder, setIncludeInTabOrder] = React.useState(false);
3822
- const [isMounted, setIsMounted] = React.useState(false);
3823
- React.useEffect(function skipAutoFocus() {
3824
- if (isMounted) {
3825
- setIncludeInTabOrder(true);
3826
- } else {
3827
- setIsMounted(true);
3828
- }
3829
- }, [isMounted]);
3830
- return /*#__PURE__*/React.createElement(Button, _objectSpread2(_objectSpread2({}, props), {}, {
3831
- variant: "quaternary",
3832
- onClick: onDismiss,
3833
- icon: /*#__PURE__*/React.createElement(CloseIcon, null),
3834
- tabIndex: includeInTabOrder ? 0 : -1
3835
- }));
3836
- }
3837
- /**
3838
- * Renders a standard modal header area with an optional close button.
3839
- *
3840
- * @see DeprecatedModal
3841
- * @see DeprecatedModalFooter
3842
- * @see DeprecatedModalBody
3843
- */
3844
-
3845
- function DeprecatedModalHeader(_ref2) {
3846
- let {
3847
- children,
3848
- button = true,
3849
- withDivider = false,
3850
- exceptionallySetClassName
3851
- } = _ref2,
3852
- props = _objectWithoutProperties(_ref2, _excluded2$4);
3853
-
3854
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, _objectSpread2(_objectSpread2({}, props), {}, {
3855
- as: "header",
3856
- paddingLeft: "large",
3857
- paddingRight: button === false || button === null ? 'large' : 'small',
3858
- paddingY: "small",
3859
- className: exceptionallySetClassName
3860
- }), /*#__PURE__*/React.createElement(Columns, {
3861
- space: "large",
3862
- alignY: "center"
3863
- }, /*#__PURE__*/React.createElement(Column, {
3864
- width: "auto"
3865
- }, children), button === false || button === null ? /*#__PURE__*/React.createElement("div", {
3866
- className: modules_8f59d13b$1.headerContent
3867
- }) : /*#__PURE__*/React.createElement(Column, {
3868
- width: "content",
3869
- exceptionallySetClassName: modules_8f59d13b$1.buttonContainer,
3870
- "data-testid": "button-container"
3871
- }, typeof button === 'boolean' ? /*#__PURE__*/React.createElement(DeprecatedModalCloseButton, {
3872
- "aria-label": "Close modal",
3873
- autoFocus: false
3874
- }) : button))), withDivider ? /*#__PURE__*/React.createElement(Divider, null) : null);
3875
- }
3876
- /**
3877
- * Renders the body of a modal.
3878
- *
3879
- * Convenient to use alongside ModalHeader and/or ModalFooter as needed. It ensures, among other
3880
- * things, that the contet of the modal body expands or contracts depending on the modal height
3881
- * setting or the size of the content. The body content also automatically scrolls when it's too
3882
- * large to fit the available space.
3883
- *
3884
- * @see DeprecatedModal
3885
- * @see DeprecatedModalHeader
3886
- * @see DeprecatedModalFooter
3887
- */
3888
-
3889
- function DeprecatedModalBody(_ref3) {
3890
- let {
3891
- exceptionallySetClassName,
3892
- children
3893
- } = _ref3,
3894
- props = _objectWithoutProperties(_ref3, _excluded3$3);
3895
-
3896
- const {
3897
- height
3898
- } = React.useContext(ModalContext$1);
3899
- return /*#__PURE__*/React.createElement(Box, _objectSpread2(_objectSpread2({}, props), {}, {
3900
- className: exceptionallySetClassName,
3901
- flexGrow: height === 'expand' ? 1 : 0,
3902
- height: height === 'expand' ? 'full' : undefined,
3903
- overflow: "auto"
3904
- }), /*#__PURE__*/React.createElement(Box, {
3905
- padding: "large",
3906
- paddingBottom: "xxlarge"
3907
- }, children));
3908
- }
3909
- /**
3910
- * Renders a standard modal footer area.
3911
- *
3912
- * @see DeprecatedModal
3913
- * @see DeprecatedModalHeader
3914
- * @see DeprecatedModalBody
3915
- */
3916
-
3917
- function DeprecatedModalFooter(_ref4) {
3918
- let {
3919
- exceptionallySetClassName,
3920
- withDivider = false
3921
- } = _ref4,
3922
- props = _objectWithoutProperties(_ref4, _excluded4$2);
3923
-
3924
- return /*#__PURE__*/React.createElement(React.Fragment, null, withDivider ? /*#__PURE__*/React.createElement(Divider, null) : null, /*#__PURE__*/React.createElement(Box, _objectSpread2(_objectSpread2({
3925
- as: "footer"
3926
- }, props), {}, {
3927
- className: exceptionallySetClassName,
3928
- padding: "large"
3929
- })));
3930
- }
3931
- /**
3932
- * A specific version of the ModalFooter, tailored to showing an inline list of actions (buttons).
3933
- * @see DeprecatedModalFooter
3934
- */
3935
-
3936
- function DeprecatedModalActions(_ref5) {
3937
- let {
3938
- children
3939
- } = _ref5,
3940
- props = _objectWithoutProperties(_ref5, _excluded5$2);
3941
-
3942
- return /*#__PURE__*/React.createElement(DeprecatedModalFooter, _objectSpread2({}, props), /*#__PURE__*/React.createElement(Inline, {
3943
- align: "right",
3944
- space: "large"
3945
- }, children));
3946
- }
3947
-
3948
3741
  exports.Alert = Alert;
3949
3742
  exports.Avatar = Avatar;
3950
3743
  exports.Badge = Badge;
@@ -3961,12 +3754,6 @@ exports.ContextMenuTrigger = ContextMenuTrigger;
3961
3754
  exports.DeprecatedButton = Button$1;
3962
3755
  exports.DeprecatedDropdown = Dropdown;
3963
3756
  exports.DeprecatedInput = Input;
3964
- exports.DeprecatedModal = DeprecatedModal;
3965
- exports.DeprecatedModalActions = DeprecatedModalActions;
3966
- exports.DeprecatedModalBody = DeprecatedModalBody;
3967
- exports.DeprecatedModalCloseButton = DeprecatedModalCloseButton;
3968
- exports.DeprecatedModalFooter = DeprecatedModalFooter;
3969
- exports.DeprecatedModalHeader = DeprecatedModalHeader;
3970
3757
  exports.DeprecatedSelect = Select;
3971
3758
  exports.Divider = Divider;
3972
3759
  exports.Heading = Heading;