@doist/reactist 25.0.0-beta → 25.0.0-beta.2
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 +120 -93
- 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/avatar/avatar.js.map +1 -1
- package/es/banner/banner.js.map +1 -1
- package/es/button/button.js +1 -1
- package/es/button/button.js.map +1 -1
- package/es/checkbox-field/checkbox-field.js.map +1 -1
- package/es/components/deprecated-dropdown/dropdown.js.map +1 -1
- package/es/components/deprecated-input/input.js +5 -1
- package/es/components/deprecated-input/input.js.map +1 -1
- package/es/heading/heading.js.map +1 -1
- package/es/loading/loading.js.map +1 -1
- package/es/menu/menu.js +56 -34
- package/es/menu/menu.js.map +1 -1
- package/es/modal/modal.js +16 -14
- package/es/modal/modal.js.map +1 -1
- package/es/password-field/password-field.js.map +1 -1
- package/es/prose/prose.js.map +1 -1
- package/es/select-field/select-field.js.map +1 -1
- package/es/switch-field/switch-field.js.map +1 -1
- package/es/tabs/tabs.js +30 -34
- package/es/tabs/tabs.js.map +1 -1
- package/es/text-area/text-area.js.map +1 -1
- package/es/text-field/text-field.js.map +1 -1
- package/es/tooltip/tooltip.js +13 -12
- package/es/tooltip/tooltip.js.map +1 -1
- package/es/utils/polymorphism.js +1 -1
- package/es/utils/polymorphism.js.map +1 -1
- package/lib/alert/alert.d.ts +1 -1
- package/lib/avatar/avatar.d.ts +4 -4
- package/lib/avatar/avatar.js.map +1 -1
- package/lib/badge/badge.d.ts +2 -2
- package/lib/banner/banner.d.ts +2 -2
- package/lib/banner/banner.js.map +1 -1
- package/lib/base-field/base-field.d.ts +3 -3
- package/lib/button/button.d.ts +2 -2
- package/lib/button/button.js.map +1 -1
- package/lib/checkbox-field/checkbox-field.d.ts +29 -17
- package/lib/checkbox-field/checkbox-field.js.map +1 -1
- package/lib/checkbox-field/checkbox-icon.d.ts +1 -1
- package/lib/components/color-picker/color-picker.d.ts +2 -2
- package/lib/components/deprecated-dropdown/dropdown.d.ts +5 -5
- package/lib/components/deprecated-dropdown/dropdown.js.map +1 -1
- package/lib/components/deprecated-input/input.d.ts +6 -6
- package/lib/components/deprecated-input/input.js +1 -1
- package/lib/components/deprecated-input/input.js.map +1 -1
- package/lib/components/deprecated-select/select.d.ts +2 -2
- package/lib/components/icons/CloseIcon.svg.d.ts +2 -2
- package/lib/components/icons/ThinQuestionMarkIcon.svg.d.ts +2 -2
- package/lib/components/icons/ThreeDotsIcon.svg.d.ts +2 -2
- package/lib/components/keyboard-shortcut/keyboard-shortcut.d.ts +1 -1
- package/lib/components/progress-bar/progress-bar.d.ts +2 -2
- package/lib/components/time/time.d.ts +1 -1
- package/lib/divider/divider.d.ts +2 -2
- package/lib/heading/heading.d.ts +4 -12
- package/lib/heading/heading.js.map +1 -1
- package/lib/icons/alert-icon.d.ts +2 -2
- package/lib/icons/close-icon.d.ts +2 -2
- package/lib/icons/password-hidden-icon.d.ts +2 -2
- package/lib/icons/password-visible-icon.d.ts +2 -2
- package/lib/loading/loading.d.ts +4 -5
- package/lib/loading/loading.js.map +1 -1
- package/lib/menu/menu.d.ts +20 -19
- package/lib/menu/menu.js +1 -1
- package/lib/menu/menu.js.map +1 -1
- package/lib/modal/modal-stories-components.d.ts +9 -9
- package/lib/modal/modal.d.ts +20 -28
- package/lib/modal/modal.js +1 -1
- package/lib/modal/modal.js.map +1 -1
- package/lib/notice/notice.d.ts +1 -1
- package/lib/password-field/password-field.d.ts +3 -8
- package/lib/password-field/password-field.js.map +1 -1
- package/lib/prose/prose.d.ts +4 -7
- package/lib/prose/prose.js.map +1 -1
- package/lib/select-field/select-field.d.ts +3 -7
- package/lib/select-field/select-field.js.map +1 -1
- package/lib/spinner/spinner.d.ts +2 -2
- package/lib/switch-field/switch-field.d.ts +12 -11
- package/lib/switch-field/switch-field.js.map +1 -1
- package/lib/tabs/tabs.d.ts +24 -16
- package/lib/tabs/tabs.js +1 -1
- package/lib/tabs/tabs.js.map +1 -1
- package/lib/text-area/text-area.d.ts +3 -8
- package/lib/text-area/text-area.js.map +1 -1
- package/lib/text-field/text-field.d.ts +5 -10
- package/lib/text-field/text-field.js.map +1 -1
- package/lib/toast/use-toasts.d.ts +1 -1
- package/lib/tooltip/tooltip.d.ts +4 -7
- package/lib/tooltip/tooltip.js +1 -1
- package/lib/tooltip/tooltip.js.map +1 -1
- package/lib/utils/polymorphism.d.ts +4 -2
- package/lib/utils/polymorphism.js.map +1 -1
- package/lib/utils/test-helpers.d.ts +2 -2
- package/package.json +3 -3
|
@@ -111,7 +111,7 @@ function _objectWithoutProperties(source, excluded) {
|
|
|
111
111
|
* convenience over merely using React.forwardRef directly, and then manually forcing the resulting
|
|
112
112
|
* value to be typed using `as PolymorphicComponent<…>`.
|
|
113
113
|
*
|
|
114
|
-
* @
|
|
114
|
+
* @deprecated Use Ariakit's composition instead (https://ariakit.org/guide/composition)
|
|
115
115
|
*/
|
|
116
116
|
|
|
117
117
|
function polymorphicComponent(render) {
|
|
@@ -577,19 +577,20 @@ function Tooltip({
|
|
|
577
577
|
render: child,
|
|
578
578
|
store: tooltip,
|
|
579
579
|
ref: child.ref
|
|
580
|
-
}), isOpen && content ? /*#__PURE__*/React.createElement(
|
|
581
|
-
as: react.Tooltip,
|
|
582
|
-
gutter: gapSize,
|
|
580
|
+
}), isOpen && content ? /*#__PURE__*/React.createElement(react.Tooltip, {
|
|
583
581
|
store: tooltip,
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
582
|
+
gutter: gapSize,
|
|
583
|
+
render: /*#__PURE__*/React.createElement(Box, {
|
|
584
|
+
className: [modules_95f1407a.tooltip, exceptionallySetClassName],
|
|
585
|
+
background: "toast",
|
|
586
|
+
borderRadius: "standard",
|
|
587
|
+
paddingX: "small",
|
|
588
|
+
paddingY: "xsmall",
|
|
589
|
+
maxWidth: "medium",
|
|
590
|
+
width: "fitContent",
|
|
591
|
+
overflow: "hidden",
|
|
592
|
+
textAlign: "center"
|
|
593
|
+
})
|
|
593
594
|
}, withArrow ? /*#__PURE__*/React.createElement(react.TooltipArrow, null) : null, typeof content === 'function' ? content() : content) : null);
|
|
594
595
|
}
|
|
595
596
|
|
|
@@ -663,7 +664,7 @@ const Button = /*#__PURE__*/React.forwardRef(function Button(_ref, ref) {
|
|
|
663
664
|
* [WAI-ARIA Button Pattern](https://www.w3.org/TR/wai-aria-practices/#button).
|
|
664
665
|
*/
|
|
665
666
|
|
|
666
|
-
const IconButton = /*#__PURE__*/React.forwardRef(function
|
|
667
|
+
const IconButton = /*#__PURE__*/React.forwardRef(function IconButton(_ref2, ref) {
|
|
667
668
|
let {
|
|
668
669
|
variant,
|
|
669
670
|
tone = 'normal',
|
|
@@ -2192,7 +2193,7 @@ function Badge(_ref) {
|
|
|
2192
2193
|
|
|
2193
2194
|
var modules_8f59d13b = {"overlay":"_8aa86dd3","fadein":"_20c07ee6","fitContent":"_713bc08f","container":"_45139719","full":"ec8619a2","large":"_86a1d5a4","medium":"_11d61de3","small":"aee19643","xlarge":"fe449c81","expand":"_61ffb38f","buttonContainer":"_49ffdac0","headerContent":"ee92ccb3"};
|
|
2194
2195
|
|
|
2195
|
-
const _excluded$p = ["isOpen", "onDismiss", "height", "width", "exceptionallySetClassName", "exceptionallySetOverlayClassName", "autoFocus", "hideOnEscape", "hideOnInteractOutside", "children", "portalElement", "onKeyDown"],
|
|
2196
|
+
const _excluded$p = ["isOpen", "onDismiss", "height", "width", "exceptionallySetClassName", "exceptionallySetOverlayClassName", "autoFocus", "hideOnEscape", "hideOnInteractOutside", "children", "portalElement", "onKeyDown", "className"],
|
|
2196
2197
|
_excluded2$2 = ["children", "button", "withDivider", "exceptionallySetClassName"],
|
|
2197
2198
|
_excluded3 = ["exceptionallySetClassName", "children"],
|
|
2198
2199
|
_excluded4 = ["exceptionallySetClassName", "withDivider"],
|
|
@@ -2229,7 +2230,9 @@ function Modal(_ref) {
|
|
|
2229
2230
|
hideOnInteractOutside = true,
|
|
2230
2231
|
children,
|
|
2231
2232
|
portalElement,
|
|
2232
|
-
onKeyDown
|
|
2233
|
+
onKeyDown,
|
|
2234
|
+
// @ts-expect-error we want to make sure to not pass it to the Dialog component
|
|
2235
|
+
className
|
|
2233
2236
|
} = _ref,
|
|
2234
2237
|
props = _objectWithoutProperties(_ref, _excluded$p);
|
|
2235
2238
|
|
|
@@ -2289,9 +2292,8 @@ function Modal(_ref) {
|
|
|
2289
2292
|
className: classNames(modules_8f59d13b.overlay, modules_8f59d13b[height], modules_8f59d13b[width], exceptionallySetOverlayClassName),
|
|
2290
2293
|
|
|
2291
2294
|
/**
|
|
2292
|
-
* We're using `onPointerDown` instead of `onClick` to prevent
|
|
2293
|
-
*
|
|
2294
|
-
* and ends on the backdrop.
|
|
2295
|
+
* We're using `onPointerDown` instead of `onClick` to prevent the modal from
|
|
2296
|
+
* closing when the click starts inside the modal and ends on the backdrop.
|
|
2295
2297
|
*/
|
|
2296
2298
|
onPointerDown: hideOnInteractOutside ? handleBackdropClick : undefined,
|
|
2297
2299
|
ref: backdropRef
|
|
@@ -2301,17 +2303,18 @@ function Modal(_ref) {
|
|
|
2301
2303
|
returnFocus: true
|
|
2302
2304
|
}, /*#__PURE__*/React.createElement(react.Dialog, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2303
2305
|
ref: dialogRef,
|
|
2304
|
-
|
|
2306
|
+
render: /*#__PURE__*/React.createElement(Box, {
|
|
2307
|
+
borderRadius: "full",
|
|
2308
|
+
background: "default",
|
|
2309
|
+
display: "flex",
|
|
2310
|
+
flexDirection: "column",
|
|
2311
|
+
overflow: "hidden",
|
|
2312
|
+
height: height === 'expand' ? 'full' : undefined,
|
|
2313
|
+
flexGrow: height === 'expand' ? 1 : 0
|
|
2314
|
+
}),
|
|
2315
|
+
className: classNames(exceptionallySetClassName, modules_8f59d13b.container),
|
|
2305
2316
|
store: store,
|
|
2306
2317
|
preventBodyScroll: true,
|
|
2307
|
-
borderRadius: "full",
|
|
2308
|
-
background: "default",
|
|
2309
|
-
display: "flex",
|
|
2310
|
-
flexDirection: "column",
|
|
2311
|
-
overflow: "hidden",
|
|
2312
|
-
height: height === 'expand' ? 'full' : undefined,
|
|
2313
|
-
flexGrow: height === 'expand' ? 1 : 0,
|
|
2314
|
-
className: [exceptionallySetClassName, modules_8f59d13b.container],
|
|
2315
2318
|
// Disable focus lock as we set up our own using ReactFocusLock
|
|
2316
2319
|
modal: false,
|
|
2317
2320
|
autoFocus: false,
|
|
@@ -2467,9 +2470,8 @@ function ModalActions(_ref5) {
|
|
|
2467
2470
|
|
|
2468
2471
|
var modules_40c67f5b = {"tab":"e96bf360","track":"_430e252d","tab-neutral":"f631ccbe","tab-themed":"_6ba96acc","track-neutral":"ef4cd8d3","track-themed":"_344b3b10"};
|
|
2469
2472
|
|
|
2470
|
-
const _excluded$q = ["
|
|
2471
|
-
_excluded2$3 = ["children", "
|
|
2472
|
-
_excluded3$1 = ["children", "id", "as", "render"];
|
|
2473
|
+
const _excluded$q = ["children", "space"],
|
|
2474
|
+
_excluded2$3 = ["children", "id", "renderMode"];
|
|
2473
2475
|
const TabsContext = /*#__PURE__*/React.createContext(null);
|
|
2474
2476
|
/**
|
|
2475
2477
|
* Used to group components that compose a set of tabs. There can only be one active tab within the same `<Tabs>` group.
|
|
@@ -2506,15 +2508,13 @@ function Tabs({
|
|
|
2506
2508
|
*/
|
|
2507
2509
|
|
|
2508
2510
|
|
|
2509
|
-
const Tab = /*#__PURE__*/
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
props = _objectWithoutProperties(_ref2, _excluded$q);
|
|
2517
|
-
|
|
2511
|
+
const Tab = /*#__PURE__*/React.forwardRef(function Tab({
|
|
2512
|
+
children,
|
|
2513
|
+
id,
|
|
2514
|
+
exceptionallySetClassName,
|
|
2515
|
+
render,
|
|
2516
|
+
onClick
|
|
2517
|
+
}, ref) {
|
|
2518
2518
|
const tabContextValue = React.useContext(TabsContext);
|
|
2519
2519
|
if (!tabContextValue) return null;
|
|
2520
2520
|
const {
|
|
@@ -2522,24 +2522,25 @@ const Tab = /*#__PURE__*/polymorphicComponent(function Tab(_ref2, ref) {
|
|
|
2522
2522
|
tabStore
|
|
2523
2523
|
} = tabContextValue;
|
|
2524
2524
|
const className = classNames(exceptionallySetClassName, modules_40c67f5b.tab, modules_40c67f5b["tab-" + variant]);
|
|
2525
|
-
return /*#__PURE__*/React.createElement(react.Tab,
|
|
2526
|
-
as: as,
|
|
2527
|
-
className: className,
|
|
2525
|
+
return /*#__PURE__*/React.createElement(react.Tab, {
|
|
2528
2526
|
id: id,
|
|
2527
|
+
ref: ref,
|
|
2529
2528
|
store: tabStore,
|
|
2530
|
-
|
|
2531
|
-
|
|
2529
|
+
render: render,
|
|
2530
|
+
className: className,
|
|
2531
|
+
onClick: onClick
|
|
2532
|
+
}, children);
|
|
2532
2533
|
});
|
|
2533
2534
|
/**
|
|
2534
2535
|
* A component used to group `<Tab>` elements together.
|
|
2535
2536
|
*/
|
|
2536
2537
|
|
|
2537
|
-
function TabList(
|
|
2538
|
+
function TabList(_ref2) {
|
|
2538
2539
|
let {
|
|
2539
2540
|
children,
|
|
2540
2541
|
space
|
|
2541
|
-
} =
|
|
2542
|
-
props = _objectWithoutProperties(
|
|
2542
|
+
} = _ref2,
|
|
2543
|
+
props = _objectWithoutProperties(_ref2, _excluded$q);
|
|
2543
2544
|
|
|
2544
2545
|
const tabContextValue = React.useContext(TabsContext);
|
|
2545
2546
|
|
|
@@ -2553,13 +2554,14 @@ function TabList(_ref3) {
|
|
|
2553
2554
|
} = tabContextValue;
|
|
2554
2555
|
return (
|
|
2555
2556
|
/*#__PURE__*/
|
|
2556
|
-
// The extra <
|
|
2557
|
+
// The extra <div> prevents <Inline>'s negative margins from collapsing when used in a flex container
|
|
2557
2558
|
// which will render the track with the wrong height
|
|
2558
|
-
React.createElement(
|
|
2559
|
+
React.createElement("div", null, /*#__PURE__*/React.createElement(react.TabList, _objectSpread2({
|
|
2559
2560
|
store: tabStore,
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2561
|
+
render: /*#__PURE__*/React.createElement(Box, {
|
|
2562
|
+
position: "relative",
|
|
2563
|
+
width: "maxContent"
|
|
2564
|
+
})
|
|
2563
2565
|
}, props), /*#__PURE__*/React.createElement(Box, {
|
|
2564
2566
|
className: [modules_40c67f5b.track, modules_40c67f5b["track-" + variant]]
|
|
2565
2567
|
}), /*#__PURE__*/React.createElement(Inline, {
|
|
@@ -2573,14 +2575,13 @@ function TabList(_ref3) {
|
|
|
2573
2575
|
*/
|
|
2574
2576
|
|
|
2575
2577
|
|
|
2576
|
-
const TabPanel = /*#__PURE__*/
|
|
2578
|
+
const TabPanel = /*#__PURE__*/React.forwardRef(function TabPanel(_ref3, ref) {
|
|
2577
2579
|
let {
|
|
2578
2580
|
children,
|
|
2579
2581
|
id,
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
props = _objectWithoutProperties(_ref4, _excluded3$1);
|
|
2582
|
+
renderMode = 'always'
|
|
2583
|
+
} = _ref3,
|
|
2584
|
+
props = _objectWithoutProperties(_ref3, _excluded2$3);
|
|
2584
2585
|
|
|
2585
2586
|
const tabContextValue = React.useContext(TabsContext);
|
|
2586
2587
|
const [tabRendered, setTabRendered] = React.useState(false);
|
|
@@ -2599,11 +2600,10 @@ const TabPanel = /*#__PURE__*/polymorphicComponent(function TabPanel(_ref4, ref)
|
|
|
2599
2600
|
const {
|
|
2600
2601
|
tabStore
|
|
2601
2602
|
} = tabContextValue;
|
|
2602
|
-
const shouldRender =
|
|
2603
|
+
const shouldRender = renderMode === 'always' || renderMode === 'active' && tabIsActive || renderMode === 'lazy' && (tabIsActive || tabRendered);
|
|
2603
2604
|
return shouldRender ? /*#__PURE__*/React.createElement(react.TabPanel, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2604
2605
|
tabId: id,
|
|
2605
2606
|
store: tabStore,
|
|
2606
|
-
as: as,
|
|
2607
2607
|
ref: ref
|
|
2608
2608
|
}), children) : null;
|
|
2609
2609
|
});
|
|
@@ -2624,16 +2624,16 @@ function TabAwareSlot({
|
|
|
2624
2624
|
|
|
2625
2625
|
const _excluded$r = ["children", "onItemSelect"],
|
|
2626
2626
|
_excluded2$4 = ["exceptionallySetClassName"],
|
|
2627
|
-
_excluded3$
|
|
2627
|
+
_excluded3$1 = ["render"],
|
|
2628
2628
|
_excluded4$1 = ["exceptionallySetClassName", "modal"],
|
|
2629
|
-
_excluded5$1 = ["value", "children", "onSelect", "hideOnSelect", "onClick", "exceptionallySetClassName"
|
|
2629
|
+
_excluded5$1 = ["value", "children", "onSelect", "hideOnSelect", "onClick", "exceptionallySetClassName"],
|
|
2630
2630
|
_excluded6 = ["label", "children", "exceptionallySetClassName"];
|
|
2631
|
-
const MenuContext = /*#__PURE__*/React.createContext(
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2631
|
+
const MenuContext = /*#__PURE__*/React.createContext({
|
|
2632
|
+
menuStore: null,
|
|
2633
|
+
handleItemSelect: () => undefined,
|
|
2634
|
+
getAnchorRect: null,
|
|
2635
|
+
setAnchorRect: () => undefined
|
|
2636
|
+
});
|
|
2637
2637
|
/**
|
|
2638
2638
|
* Wrapper component to control a menu. It does not render anything, only providing the state
|
|
2639
2639
|
* management for the menu components inside it.
|
|
@@ -2666,7 +2666,7 @@ function Menu(_ref) {
|
|
|
2666
2666
|
*/
|
|
2667
2667
|
|
|
2668
2668
|
|
|
2669
|
-
const MenuButton = /*#__PURE__*/
|
|
2669
|
+
const MenuButton = /*#__PURE__*/React.forwardRef(function MenuButton(_ref2, ref) {
|
|
2670
2670
|
let {
|
|
2671
2671
|
exceptionallySetClassName
|
|
2672
2672
|
} = _ref2,
|
|
@@ -2675,25 +2675,32 @@ const MenuButton = /*#__PURE__*/polymorphicComponent(function MenuButton(_ref2,
|
|
|
2675
2675
|
const {
|
|
2676
2676
|
menuStore
|
|
2677
2677
|
} = React.useContext(MenuContext);
|
|
2678
|
+
|
|
2679
|
+
if (!menuStore) {
|
|
2680
|
+
throw new Error('MenuButton must be wrapped in <Menu/>');
|
|
2681
|
+
}
|
|
2682
|
+
|
|
2678
2683
|
return /*#__PURE__*/React.createElement(react.MenuButton, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2679
2684
|
store: menuStore,
|
|
2680
2685
|
ref: ref,
|
|
2681
2686
|
className: classNames('reactist_menubutton', exceptionallySetClassName)
|
|
2682
2687
|
}));
|
|
2683
|
-
});
|
|
2684
|
-
|
|
2685
|
-
//
|
|
2686
|
-
|
|
2687
|
-
const ContextMenuTrigger = /*#__PURE__*/polymorphicComponent(function ContextMenuTrigger(_ref3, ref) {
|
|
2688
|
+
});
|
|
2689
|
+
const ContextMenuTrigger = /*#__PURE__*/React.forwardRef(function ContextMenuTrigger(_ref3, ref) {
|
|
2688
2690
|
let {
|
|
2689
|
-
|
|
2691
|
+
render
|
|
2690
2692
|
} = _ref3,
|
|
2691
|
-
props = _objectWithoutProperties(_ref3, _excluded3$
|
|
2693
|
+
props = _objectWithoutProperties(_ref3, _excluded3$1);
|
|
2692
2694
|
|
|
2693
2695
|
const {
|
|
2694
2696
|
setAnchorRect,
|
|
2695
2697
|
menuStore
|
|
2696
2698
|
} = React.useContext(MenuContext);
|
|
2699
|
+
|
|
2700
|
+
if (!menuStore) {
|
|
2701
|
+
throw new Error('ContextMenuTrigger must be wrapped in <Menu/>');
|
|
2702
|
+
}
|
|
2703
|
+
|
|
2697
2704
|
const handleContextMenu = React.useCallback(function handleContextMenu(event) {
|
|
2698
2705
|
event.preventDefault();
|
|
2699
2706
|
setAnchorRect({
|
|
@@ -2706,16 +2713,17 @@ const ContextMenuTrigger = /*#__PURE__*/polymorphicComponent(function ContextMen
|
|
|
2706
2713
|
React.useEffect(() => {
|
|
2707
2714
|
if (!isOpen) setAnchorRect(null);
|
|
2708
2715
|
}, [isOpen, setAnchorRect]);
|
|
2709
|
-
return /*#__PURE__*/React.createElement(
|
|
2716
|
+
return /*#__PURE__*/React.createElement(react.Role.div, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2710
2717
|
onContextMenu: handleContextMenu,
|
|
2711
|
-
ref
|
|
2718
|
+
ref: ref,
|
|
2719
|
+
render: render
|
|
2712
2720
|
}));
|
|
2713
2721
|
});
|
|
2714
2722
|
/**
|
|
2715
2723
|
* The dropdown menu itself, containing a list of menu items.
|
|
2716
2724
|
*/
|
|
2717
2725
|
|
|
2718
|
-
const MenuList = /*#__PURE__*/
|
|
2726
|
+
const MenuList = /*#__PURE__*/React.forwardRef(function MenuList(_ref4, ref) {
|
|
2719
2727
|
let {
|
|
2720
2728
|
exceptionallySetClassName,
|
|
2721
2729
|
modal = true
|
|
@@ -2726,6 +2734,11 @@ const MenuList = /*#__PURE__*/polymorphicComponent(function MenuList(_ref4, ref)
|
|
|
2726
2734
|
menuStore,
|
|
2727
2735
|
getAnchorRect
|
|
2728
2736
|
} = React.useContext(MenuContext);
|
|
2737
|
+
|
|
2738
|
+
if (!menuStore) {
|
|
2739
|
+
throw new Error('MenuList must be wrapped in <Menu/>');
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2729
2742
|
const isOpen = menuStore.useState('open');
|
|
2730
2743
|
return isOpen ? /*#__PURE__*/React.createElement(react.Portal, {
|
|
2731
2744
|
preserveTabOrder: true
|
|
@@ -2744,15 +2757,14 @@ const MenuList = /*#__PURE__*/polymorphicComponent(function MenuList(_ref4, ref)
|
|
|
2744
2757
|
* callback.
|
|
2745
2758
|
*/
|
|
2746
2759
|
|
|
2747
|
-
const MenuItem = /*#__PURE__*/
|
|
2760
|
+
const MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(_ref5, ref) {
|
|
2748
2761
|
let {
|
|
2749
2762
|
value,
|
|
2750
2763
|
children,
|
|
2751
2764
|
onSelect,
|
|
2752
2765
|
hideOnSelect = true,
|
|
2753
2766
|
onClick,
|
|
2754
|
-
exceptionallySetClassName
|
|
2755
|
-
as = 'button'
|
|
2767
|
+
exceptionallySetClassName
|
|
2756
2768
|
} = _ref5,
|
|
2757
2769
|
props = _objectWithoutProperties(_ref5, _excluded5$1);
|
|
2758
2770
|
|
|
@@ -2760,6 +2772,11 @@ const MenuItem = /*#__PURE__*/polymorphicComponent(function MenuItem(_ref5, ref)
|
|
|
2760
2772
|
handleItemSelect,
|
|
2761
2773
|
menuStore
|
|
2762
2774
|
} = React.useContext(MenuContext);
|
|
2775
|
+
|
|
2776
|
+
if (!menuStore) {
|
|
2777
|
+
throw new Error('MenuItem must be wrapped in <Menu/>');
|
|
2778
|
+
}
|
|
2779
|
+
|
|
2763
2780
|
const {
|
|
2764
2781
|
hide
|
|
2765
2782
|
} = menuStore;
|
|
@@ -2771,7 +2788,6 @@ const MenuItem = /*#__PURE__*/polymorphicComponent(function MenuItem(_ref5, ref)
|
|
|
2771
2788
|
if (shouldClose) hide();
|
|
2772
2789
|
}, [onSelect, onClick, handleItemSelect, hideOnSelect, hide, value]);
|
|
2773
2790
|
return /*#__PURE__*/React.createElement(react.MenuItem, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2774
|
-
as: as,
|
|
2775
2791
|
store: menuStore,
|
|
2776
2792
|
ref: ref,
|
|
2777
2793
|
onClick: handleClick,
|
|
@@ -2809,6 +2825,11 @@ const SubMenu = /*#__PURE__*/React.forwardRef(function SubMenu({
|
|
|
2809
2825
|
handleItemSelect: parentMenuItemSelect,
|
|
2810
2826
|
menuStore
|
|
2811
2827
|
} = React.useContext(MenuContext);
|
|
2828
|
+
|
|
2829
|
+
if (!menuStore) {
|
|
2830
|
+
throw new Error('SubMenu must be wrapped in <Menu/>');
|
|
2831
|
+
}
|
|
2832
|
+
|
|
2812
2833
|
const {
|
|
2813
2834
|
hide: parentMenuHide
|
|
2814
2835
|
} = menuStore;
|
|
@@ -2817,19 +2838,16 @@ const SubMenu = /*#__PURE__*/React.forwardRef(function SubMenu({
|
|
|
2817
2838
|
parentMenuItemSelect == null ? void 0 : parentMenuItemSelect(value);
|
|
2818
2839
|
parentMenuHide();
|
|
2819
2840
|
}, [parentMenuHide, parentMenuItemSelect, onItemSelect]);
|
|
2820
|
-
const [button, list] = React.Children.toArray(children);
|
|
2821
|
-
|
|
2822
|
-
const renderMenuButton = React.useCallback(function renderMenuButton(props) {
|
|
2823
|
-
return /*#__PURE__*/React.cloneElement(button, props);
|
|
2824
|
-
}, [button]);
|
|
2841
|
+
const [button, list] = React.Children.toArray(children);
|
|
2842
|
+
const buttonElement = button;
|
|
2825
2843
|
return /*#__PURE__*/React.createElement(Menu, {
|
|
2826
2844
|
onItemSelect: handleSubItemSelect
|
|
2827
2845
|
}, /*#__PURE__*/React.createElement(react.MenuItem, {
|
|
2828
|
-
as: "div",
|
|
2829
2846
|
store: menuStore,
|
|
2830
2847
|
ref: ref,
|
|
2831
|
-
hideOnClick: false
|
|
2832
|
-
|
|
2848
|
+
hideOnClick: false,
|
|
2849
|
+
render: buttonElement
|
|
2850
|
+
}, buttonElement.props.children), list);
|
|
2833
2851
|
});
|
|
2834
2852
|
/**
|
|
2835
2853
|
* A way to semantically group some menu items.
|
|
@@ -2838,7 +2856,7 @@ const SubMenu = /*#__PURE__*/React.forwardRef(function SubMenu({
|
|
|
2838
2856
|
* before and/or after the group if you so wish.
|
|
2839
2857
|
*/
|
|
2840
2858
|
|
|
2841
|
-
const MenuGroup = /*#__PURE__*/
|
|
2859
|
+
const MenuGroup = /*#__PURE__*/React.forwardRef(function MenuGroup(_ref6, ref) {
|
|
2842
2860
|
let {
|
|
2843
2861
|
label,
|
|
2844
2862
|
children,
|
|
@@ -2849,6 +2867,11 @@ const MenuGroup = /*#__PURE__*/polymorphicComponent(function MenuGroup(_ref6, re
|
|
|
2849
2867
|
const {
|
|
2850
2868
|
menuStore
|
|
2851
2869
|
} = React.useContext(MenuContext);
|
|
2870
|
+
|
|
2871
|
+
if (!menuStore) {
|
|
2872
|
+
throw new Error('MenuGroup must be wrapped in <Menu/>');
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2852
2875
|
return /*#__PURE__*/React.createElement(react.MenuGroup, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
2853
2876
|
ref: ref,
|
|
2854
2877
|
store: menuStore,
|
|
@@ -3666,7 +3689,11 @@ Time.defaultProps = {
|
|
|
3666
3689
|
}
|
|
3667
3690
|
};
|
|
3668
3691
|
|
|
3669
|
-
|
|
3692
|
+
/**
|
|
3693
|
+
* @deprecated
|
|
3694
|
+
*/
|
|
3695
|
+
|
|
3696
|
+
const Input = /*#__PURE__*/React.forwardRef(function Input(props, ref) {
|
|
3670
3697
|
const className = classNames('reactist_input', props.className);
|
|
3671
3698
|
return /*#__PURE__*/React.createElement("input", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
3672
3699
|
className: className,
|