@arc-ui/components 11.7.0 → 11.9.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/Alert/Alert.cjs.d.ts +1 -1
- package/dist/Alert/Alert.cjs.js +10 -89
- package/dist/Alert/Alert.esm.d.ts +1 -1
- package/dist/Alert/Alert.esm.js +3 -82
- package/dist/Badge/Badge.cjs.d.ts +4 -0
- package/dist/Badge/Badge.cjs.js +4 -4
- package/dist/Badge/Badge.esm.d.ts +4 -0
- package/dist/Badge/Badge.esm.js +5 -5
- package/dist/Box/Box.cjs.d.ts +40 -1
- package/dist/Box/Box.cjs.js +25 -6
- package/dist/Box/Box.esm.d.ts +40 -1
- package/dist/Box/Box.esm.js +24 -5
- package/dist/Breadcrumbs/Breadcrumbs.cjs.d.ts +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.cjs.js +2 -2
- package/dist/Breadcrumbs/Breadcrumbs.esm.d.ts +1 -1
- package/dist/Breadcrumbs/Breadcrumbs.esm.js +2 -2
- package/dist/Button/Button.cjs.d.ts +1 -1
- package/dist/Button/Button.cjs.js +1 -1
- package/dist/Button/Button.esm.d.ts +1 -1
- package/dist/Button/Button.esm.js +1 -1
- package/dist/Card/Card.cjs.d.ts +1 -1
- package/dist/Card/Card.cjs.js +2 -2
- package/dist/Card/Card.esm.d.ts +1 -1
- package/dist/Card/Card.esm.js +2 -2
- package/dist/Checkbox/Checkbox.cjs.d.ts +1 -1
- package/dist/Checkbox/Checkbox.cjs.js +4 -4
- package/dist/Checkbox/Checkbox.esm.d.ts +1 -1
- package/dist/Checkbox/Checkbox.esm.js +4 -4
- package/dist/Columns/Columns.cjs.d.ts +1 -1
- package/dist/Columns/Columns.esm.d.ts +1 -1
- package/dist/Curve/Curve.cjs.d.ts +1 -1
- package/dist/Curve/Curve.cjs.js +1 -1
- package/dist/Curve/Curve.esm.d.ts +1 -1
- package/dist/Curve/Curve.esm.js +1 -1
- package/dist/Disclosure/Disclosure.cjs.d.ts +1 -1
- package/dist/Disclosure/Disclosure.cjs.js +1 -1
- package/dist/Disclosure/Disclosure.esm.d.ts +1 -1
- package/dist/Disclosure/Disclosure.esm.js +1 -1
- package/dist/DisclosureMini/DisclosureMini.cjs.d.ts +1 -1
- package/dist/DisclosureMini/DisclosureMini.cjs.js +2 -2
- package/dist/DisclosureMini/DisclosureMini.esm.d.ts +1 -1
- package/dist/DisclosureMini/DisclosureMini.esm.js +2 -2
- package/dist/FormControl/FormControl.cjs.d.ts +1 -1
- package/dist/FormControl/FormControl.cjs.js +3 -3
- package/dist/FormControl/FormControl.esm.d.ts +1 -1
- package/dist/FormControl/FormControl.esm.js +3 -3
- package/dist/Heading/Heading.cjs.d.ts +1 -1
- package/dist/Heading/Heading.cjs.js +1 -1
- package/dist/Heading/Heading.esm.d.ts +1 -1
- package/dist/Heading/Heading.esm.js +1 -1
- package/dist/Modal/Modal.cjs.d.ts +31 -9
- package/dist/Modal/Modal.cjs.js +450 -161
- package/dist/Modal/Modal.esm.d.ts +31 -9
- package/dist/Modal/Modal.esm.js +423 -134
- package/dist/Pagination/Pagination.cjs.js +4 -4
- package/dist/Pagination/Pagination.esm.js +4 -4
- package/dist/PaginationSimple/PaginationSimple.cjs.js +4 -4
- package/dist/PaginationSimple/PaginationSimple.esm.js +4 -4
- package/dist/ProgressBar/ProgressBar.cjs.js +5 -5
- package/dist/ProgressBar/ProgressBar.esm.js +6 -6
- package/dist/ProgressStepper/ProgressStepper.cjs.d.ts +1 -89
- package/dist/ProgressStepper/ProgressStepper.cjs.js +10 -144
- package/dist/ProgressStepper/ProgressStepper.esm.d.ts +1 -89
- package/dist/ProgressStepper/ProgressStepper.esm.js +9 -143
- package/dist/RadioGroup/RadioGroup.cjs.d.ts +1 -1
- package/dist/RadioGroup/RadioGroup.cjs.js +4 -4
- package/dist/RadioGroup/RadioGroup.esm.d.ts +1 -1
- package/dist/RadioGroup/RadioGroup.esm.js +4 -4
- package/dist/Select/Select.cjs.d.ts +1 -1
- package/dist/Select/Select.cjs.js +995 -60
- package/dist/Select/Select.esm.d.ts +1 -1
- package/dist/Select/Select.esm.js +948 -32
- package/dist/SiteFooter/SiteFooter.cjs.d.ts +1 -1
- package/dist/SiteFooter/SiteFooter.cjs.js +2 -2
- package/dist/SiteFooter/SiteFooter.esm.d.ts +1 -1
- package/dist/SiteFooter/SiteFooter.esm.js +3 -3
- package/dist/SiteHeader/SiteHeader.cjs.d.ts +1 -1
- package/dist/SiteHeader/SiteHeader.cjs.js +3 -3
- package/dist/SiteHeader/SiteHeader.esm.d.ts +1 -1
- package/dist/SiteHeader/SiteHeader.esm.js +3 -3
- package/dist/Switch/Switch.cjs.d.ts +1 -1
- package/dist/Switch/Switch.cjs.js +241 -18
- package/dist/Switch/Switch.esm.d.ts +1 -1
- package/dist/Switch/Switch.esm.js +234 -11
- package/dist/Tabs/Tabs.cjs.d.ts +1 -0
- package/dist/Tabs/Tabs.cjs.js +20 -0
- package/dist/Tabs/Tabs.esm.d.ts +1 -0
- package/dist/Tabs/Tabs.esm.js +12 -0
- package/dist/Tabs/package.json +7 -0
- package/dist/Text/Text.cjs.d.ts +1 -1
- package/dist/Text/Text.cjs.js +1 -1
- package/dist/Text/Text.esm.d.ts +1 -1
- package/dist/Text/Text.esm.js +1 -1
- package/dist/TextArea/TextArea.cjs.d.ts +4 -1
- package/dist/TextArea/TextArea.cjs.js +30 -17
- package/dist/TextArea/TextArea.esm.d.ts +4 -1
- package/dist/TextArea/TextArea.esm.js +30 -17
- package/dist/TextInput/TextInput.cjs.d.ts +1 -1
- package/dist/TextInput/TextInput.cjs.js +4 -4
- package/dist/TextInput/TextInput.esm.d.ts +1 -1
- package/dist/TextInput/TextInput.esm.js +4 -4
- package/dist/Toast/Toast.cjs.d.ts +1 -0
- package/dist/Toast/Toast.cjs.js +23 -0
- package/dist/Toast/Toast.esm.d.ts +1 -0
- package/dist/Toast/Toast.esm.js +15 -0
- package/dist/Toast/package.json +7 -0
- package/dist/Truncate/Truncate.cjs.js +3 -2
- package/dist/Truncate/Truncate.esm.js +3 -2
- package/dist/_shared/cjs/{Breadcrumbs-9f580f69.js → Breadcrumbs-0906dd10.js} +9 -9
- package/dist/_shared/cjs/BtIconTick-42fcc5ec.js +91 -0
- package/dist/_shared/{esm/Button-9c3b0b11.d.ts → cjs/Button-5aaa6776.d.ts} +4 -0
- package/dist/_shared/cjs/{Button-b4d6ccc8.js → Button-5aaa6776.js} +2 -2
- package/dist/_shared/cjs/{Card-f1108bfe.js → Card-fd189ba8.js} +1 -1
- package/dist/_shared/cjs/{Checkbox-c927b62f.js → Checkbox-02c546ca.js} +1 -1
- package/dist/_shared/cjs/Columns-e90798f8.d.ts +1 -1
- package/dist/_shared/cjs/{Curve-b05589d8.d.ts → Curve-781ef633.d.ts} +5 -2
- package/dist/_shared/cjs/{Curve-b05589d8.js → Curve-781ef633.js} +5 -2
- package/dist/_shared/cjs/{DisclosureMini-2a10006e.js → DisclosureMini-52706ee6.js} +1 -1
- package/dist/_shared/cjs/{FormControl-78b007b7.js → FormControl-1e1bf2bf.js} +1 -1
- package/dist/_shared/cjs/{Heading-ed1cb455.d.ts → Heading-e3332dcf.d.ts} +4 -0
- package/dist/_shared/cjs/{Heading-ed1cb455.js → Heading-e3332dcf.js} +2 -2
- package/dist/{MediaCard/MediaCard.cjs.d.ts → _shared/cjs/MediaCard-9483ad5f.d.ts} +3 -4
- package/dist/_shared/cjs/ProgressStepper-f740d7bb.d.ts +89 -0
- package/dist/_shared/cjs/ProgressStepper-f740d7bb.js +149 -0
- package/dist/_shared/{esm/RadioGroup-65b8c8bf.d.ts → cjs/RadioGroup-d7664b0c.d.ts} +1 -1
- package/dist/_shared/cjs/{RadioGroup-8e17de70.js → RadioGroup-d7664b0c.js} +1 -1
- package/dist/_shared/cjs/{SiteFooter-9f7f9c2d.js → SiteFooter-5da774e1.js} +1 -1
- package/dist/_shared/cjs/SiteHeader-c25ee36e.d.ts +2 -2
- package/dist/_shared/cjs/{SiteHeader.rehydrator-ccbebde6.js → SiteHeader.rehydrator-acc9d8c4.js} +2 -2
- package/dist/_shared/cjs/Tabs-fda49692.d.ts +75 -0
- package/dist/_shared/cjs/Tabs-fda49692.js +510 -0
- package/dist/_shared/{esm/Text-14deb70e.d.ts → cjs/Text-fa447e2d.d.ts} +4 -0
- package/dist/_shared/cjs/{Text-555a29a4.js → Text-fa447e2d.js} +2 -2
- package/dist/_shared/cjs/{TextInput-7ed03a48.d.ts → TextInput-13050538.d.ts} +3 -1
- package/dist/_shared/{esm/TextInput-62bb7dee.d.ts → cjs/TextInput-f4549637.d.ts} +1 -1
- package/dist/_shared/cjs/{TextInput-b768e346.js → TextInput-f4549637.js} +1 -1
- package/dist/_shared/cjs/Toast-0cb23cae.d.ts +52 -0
- package/dist/_shared/cjs/Toast-0cb23cae.js +739 -0
- package/dist/_shared/cjs/extends-bb8ffacd.js +21 -0
- package/dist/_shared/cjs/index-27b53d49.js +174 -0
- package/dist/_shared/cjs/index-699086a7.d.ts +1 -1
- package/dist/_shared/cjs/index-74488a9f.d.ts +1 -1
- package/dist/_shared/cjs/{index.module-9b87a34d.js → index-952918c9.js} +141 -33
- package/dist/_shared/cjs/index-96c4d581.js +289 -0
- package/dist/_shared/cjs/index-c81c9401.d.ts +3 -3
- package/dist/_shared/cjs/index-e340924e.d.ts +1 -1
- package/dist/_shared/cjs/index-e6d20018.d.ts +1 -1
- package/dist/_shared/cjs/index-eb06f640.d.ts +1 -1
- package/dist/_shared/cjs/{index-31fbb076.js → index-ec260f5e.js} +0 -547
- package/dist/_shared/cjs/index-f419cf04.d.ts +1 -1
- package/dist/_shared/cjs/index-fb4b8fda.js +47 -0
- package/dist/_shared/cjs/index.module-bbcc4e18.js +126 -0
- package/dist/_shared/esm/{Breadcrumbs-5dc0afa7.js → Breadcrumbs-dafa8dde.js} +9 -9
- package/dist/_shared/esm/BtIconTick-5fe50cc7.js +83 -0
- package/dist/_shared/{cjs/Button-b4d6ccc8.d.ts → esm/Button-d1dbcf79.d.ts} +4 -0
- package/dist/_shared/esm/{Button-9c3b0b11.js → Button-d1dbcf79.js} +2 -2
- package/dist/_shared/esm/{Card-79b6eae0.js → Card-e62c3ff6.js} +1 -1
- package/dist/_shared/esm/{Checkbox-2d144384.js → Checkbox-d8891198.js} +1 -1
- package/dist/_shared/esm/Columns-8704515b.d.ts +1 -1
- package/dist/_shared/esm/{Curve-3e87b1bc.d.ts → Curve-bbc5589c.d.ts} +5 -2
- package/dist/_shared/esm/{Curve-3e87b1bc.js → Curve-bbc5589c.js} +5 -2
- package/dist/_shared/esm/{DisclosureMini-78a8f392.js → DisclosureMini-9b819941.js} +1 -1
- package/dist/_shared/esm/{FormControl-2fa7aae5.js → FormControl-f18e2f59.js} +1 -1
- package/dist/_shared/esm/{Heading-ee6bec51.d.ts → Heading-0f629151.d.ts} +4 -0
- package/dist/_shared/esm/{Heading-ee6bec51.js → Heading-0f629151.js} +2 -2
- package/dist/{MediaCard/MediaCard.esm.d.ts → _shared/esm/MediaCard-9483ad5f.d.ts} +3 -4
- package/dist/_shared/esm/ProgressStepper-7ab88f4c.d.ts +89 -0
- package/dist/_shared/esm/ProgressStepper-7ab88f4c.js +143 -0
- package/dist/_shared/{cjs/RadioGroup-8e17de70.d.ts → esm/RadioGroup-be16d5d3.d.ts} +1 -1
- package/dist/_shared/esm/{RadioGroup-65b8c8bf.js → RadioGroup-be16d5d3.js} +1 -1
- package/dist/_shared/esm/{SiteFooter-51bdc7df.js → SiteFooter-a182cb18.js} +1 -1
- package/dist/_shared/esm/SiteHeader-c25ee36e.d.ts +2 -2
- package/dist/_shared/esm/{SiteHeader.rehydrator-382d1c03.js → SiteHeader.rehydrator-023b7b76.js} +2 -2
- package/dist/_shared/esm/Tabs-5af0b940.d.ts +75 -0
- package/dist/_shared/esm/Tabs-5af0b940.js +504 -0
- package/dist/_shared/{cjs/Text-555a29a4.d.ts → esm/Text-40457811.d.ts} +4 -0
- package/dist/_shared/esm/{Text-14deb70e.js → Text-40457811.js} +2 -2
- package/dist/_shared/esm/{TextInput-7ed03a48.d.ts → TextInput-13050538.d.ts} +3 -1
- package/dist/_shared/{cjs/TextInput-b768e346.d.ts → esm/TextInput-4424c195.d.ts} +3 -3
- package/dist/_shared/esm/{TextInput-62bb7dee.js → TextInput-4424c195.js} +1 -1
- package/dist/_shared/esm/Toast-43795e91.d.ts +52 -0
- package/dist/_shared/esm/Toast-43795e91.js +733 -0
- package/dist/_shared/esm/extends-4575346e.js +19 -0
- package/dist/_shared/esm/{index.module-216016b5.js → index-22aad354.js} +138 -29
- package/dist/_shared/esm/{index-4fa635bd.js → index-369dce7f.js} +2 -541
- package/dist/_shared/esm/index-699086a7.d.ts +1 -1
- package/dist/_shared/esm/index-74488a9f.d.ts +1 -1
- package/dist/_shared/esm/index-8000d9e3.js +168 -0
- package/dist/_shared/esm/index-94ecc5f8.js +280 -0
- package/dist/_shared/esm/index-bed18a88.js +26 -0
- package/dist/_shared/esm/index-c81c9401.d.ts +3 -3
- package/dist/_shared/esm/index-e340924e.d.ts +1 -1
- package/dist/_shared/esm/index-e6d20018.d.ts +1 -1
- package/dist/_shared/esm/index-eb06f640.d.ts +1 -1
- package/dist/_shared/esm/index-f419cf04.d.ts +1 -1
- package/dist/_shared/esm/index.module-5ed90b21.js +122 -0
- package/dist/index.es.js +5036 -1358
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +5358 -1668
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/components/Badge/Badge.d.ts +4 -0
- package/dist/types/components/Button/Button.d.ts +4 -0
- package/dist/types/components/Columns/Columns.d.ts +1 -1
- package/dist/types/components/Columns/index.d.ts +1 -1
- package/dist/types/components/Curve/Curve.d.ts +5 -2
- package/dist/types/components/Heading/Heading.d.ts +4 -0
- package/dist/types/components/Modal/Modal.d.ts +31 -9
- package/dist/types/components/Tabs/Tab/Tab.d.ts +22 -0
- package/dist/types/components/Tabs/Tab/index.d.ts +1 -0
- package/dist/types/components/Tabs/TabContent/TabContent.d.ts +12 -0
- package/dist/types/components/Tabs/TabContent/index.d.ts +1 -0
- package/dist/types/components/Tabs/Tabs.d.ts +27 -0
- package/dist/types/components/Tabs/TabsList/TabsList.d.ts +20 -0
- package/dist/types/components/Tabs/TabsList/index.d.ts +1 -0
- package/dist/types/components/Tabs/index.d.ts +1 -0
- package/dist/types/components/Text/Text.d.ts +4 -0
- package/dist/types/components/TextArea/TextArea.d.ts +3 -0
- package/dist/types/components/TextInput/TextInput.d.ts +2 -0
- package/dist/types/components/Toast/Toast.d.ts +14 -0
- package/dist/types/components/Toast/ToastNotification.d.ts +39 -0
- package/dist/types/components/Toast/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +18 -6
- package/dist/types/styles.d.ts +3 -2
- package/package.json +8 -6
- package/dist/MediaCard/MediaCard.cjs.js +0 -31
- package/dist/MediaCard/MediaCard.esm.js +0 -23
- package/dist/MediaCard/package.json +0 -7
- package/dist/_shared/cjs/Box-ebe2b7be.d.ts +0 -39
- package/dist/_shared/cjs/Box-ebe2b7be.js +0 -30
- package/dist/_shared/cjs/index.module-5ea728f4.js +0 -23
- package/dist/_shared/esm/Box-06d99d8a.d.ts +0 -39
- package/dist/_shared/esm/Box-06d99d8a.js +0 -24
- package/dist/_shared/esm/index.module-88179159.js +0 -21
- package/dist/types/components/Modal/Modal.stories-wip.d.ts +0 -9
- /package/dist/_shared/cjs/{Breadcrumbs-9f580f69.d.ts → Breadcrumbs-0906dd10.d.ts} +0 -0
- /package/dist/_shared/cjs/{Card-f1108bfe.d.ts → Card-fd189ba8.d.ts} +0 -0
- /package/dist/_shared/cjs/{Checkbox-c927b62f.d.ts → Checkbox-02c546ca.d.ts} +0 -0
- /package/dist/_shared/cjs/{DisclosureMini-2a10006e.d.ts → DisclosureMini-52706ee6.d.ts} +0 -0
- /package/dist/_shared/cjs/{FormControl-78b007b7.d.ts → FormControl-1e1bf2bf.d.ts} +0 -0
- /package/dist/_shared/cjs/{SiteFooter-9f7f9c2d.d.ts → SiteFooter-5da774e1.d.ts} +0 -0
- /package/dist/_shared/cjs/{SiteHeader.rehydrator-ccbebde6.d.ts → SiteHeader.rehydrator-acc9d8c4.d.ts} +0 -0
- /package/dist/_shared/esm/{Breadcrumbs-5dc0afa7.d.ts → Breadcrumbs-dafa8dde.d.ts} +0 -0
- /package/dist/_shared/esm/{Card-79b6eae0.d.ts → Card-e62c3ff6.d.ts} +0 -0
- /package/dist/_shared/esm/{Checkbox-2d144384.d.ts → Checkbox-d8891198.d.ts} +0 -0
- /package/dist/_shared/esm/{DisclosureMini-78a8f392.d.ts → DisclosureMini-9b819941.d.ts} +0 -0
- /package/dist/_shared/esm/{FormControl-2fa7aae5.d.ts → FormControl-f18e2f59.d.ts} +0 -0
- /package/dist/_shared/esm/{SiteFooter-51bdc7df.d.ts → SiteFooter-a182cb18.d.ts} +0 -0
- /package/dist/_shared/esm/{SiteHeader.rehydrator-382d1c03.d.ts → SiteHeader.rehydrator-023b7b76.d.ts} +0 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import React__default, { forwardRef, Children, isValidElement, createElement, cloneElement, Fragment } from 'react';
|
|
2
|
+
import { c as $6ed0406888f73fc4$export$43e446d32b3d21af, d as $c512c27ab02ef895$export$50c7b4e9d9f19c1, a as $6ed0406888f73fc4$export$c7b2cbe3552a0d05 } from './index-22aad354.js';
|
|
3
|
+
import { _ as _extends } from './extends-4575346e.js';
|
|
4
|
+
|
|
5
|
+
/* -------------------------------------------------------------------------------------------------
|
|
6
|
+
* Slot
|
|
7
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
8
|
+
const { children: children , ...slotProps } = props;
|
|
9
|
+
const childrenArray = Children.toArray(children);
|
|
10
|
+
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
|
11
|
+
if (slottable) {
|
|
12
|
+
// the new element to render is the one passed as a child of `Slottable`
|
|
13
|
+
const newElement = slottable.props.children;
|
|
14
|
+
const newChildren = childrenArray.map((child)=>{
|
|
15
|
+
if (child === slottable) {
|
|
16
|
+
// because the new element will be the one rendered, we are only interested
|
|
17
|
+
// in grabbing its children (`newElement.props.children`)
|
|
18
|
+
if (Children.count(newElement) > 1) return Children.only(null);
|
|
19
|
+
return /*#__PURE__*/ isValidElement(newElement) ? newElement.props.children : null;
|
|
20
|
+
} else return child;
|
|
21
|
+
});
|
|
22
|
+
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
23
|
+
ref: forwardedRef
|
|
24
|
+
}), /*#__PURE__*/ isValidElement(newElement) ? /*#__PURE__*/ cloneElement(newElement, undefined, newChildren) : null);
|
|
25
|
+
}
|
|
26
|
+
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
27
|
+
ref: forwardedRef
|
|
28
|
+
}), children);
|
|
29
|
+
});
|
|
30
|
+
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
|
|
31
|
+
/* -------------------------------------------------------------------------------------------------
|
|
32
|
+
* SlotClone
|
|
33
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
34
|
+
const { children: children , ...slotProps } = props;
|
|
35
|
+
if (/*#__PURE__*/ isValidElement(children)) return /*#__PURE__*/ cloneElement(children, {
|
|
36
|
+
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
|
37
|
+
ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
|
|
38
|
+
});
|
|
39
|
+
return Children.count(children) > 1 ? Children.only(null) : null;
|
|
40
|
+
});
|
|
41
|
+
$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';
|
|
42
|
+
/* -------------------------------------------------------------------------------------------------
|
|
43
|
+
* Slottable
|
|
44
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{
|
|
45
|
+
return /*#__PURE__*/ createElement(Fragment, null, children);
|
|
46
|
+
};
|
|
47
|
+
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {
|
|
48
|
+
return /*#__PURE__*/ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
|
|
49
|
+
}
|
|
50
|
+
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
|
51
|
+
// all child props should override
|
|
52
|
+
const overrideProps = {
|
|
53
|
+
...childProps
|
|
54
|
+
};
|
|
55
|
+
for(const propName in childProps){
|
|
56
|
+
const slotPropValue = slotProps[propName];
|
|
57
|
+
const childPropValue = childProps[propName];
|
|
58
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
59
|
+
if (isHandler) {
|
|
60
|
+
// if the handler exists on both, we compose them
|
|
61
|
+
if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{
|
|
62
|
+
childPropValue(...args);
|
|
63
|
+
slotPropValue(...args);
|
|
64
|
+
};
|
|
65
|
+
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
66
|
+
} else if (propName === 'style') overrideProps[propName] = {
|
|
67
|
+
...slotPropValue,
|
|
68
|
+
...childPropValue
|
|
69
|
+
};
|
|
70
|
+
else if (propName === 'className') overrideProps[propName] = [
|
|
71
|
+
slotPropValue,
|
|
72
|
+
childPropValue
|
|
73
|
+
].filter(Boolean).join(' ');
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
...slotProps,
|
|
77
|
+
...overrideProps
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// We have resorted to returning slots directly rather than exposing primitives that can then
|
|
82
|
+
// be slotted like `<CollectionItem as={Slot}>…</CollectionItem>`.
|
|
83
|
+
// This is because we encountered issues with generic types that cannot be statically analysed
|
|
84
|
+
// due to creating them dynamically via createCollection.
|
|
85
|
+
function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
|
|
86
|
+
/* -----------------------------------------------------------------------------------------------
|
|
87
|
+
* CollectionProvider
|
|
88
|
+
* ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider';
|
|
89
|
+
const [createCollectionContext, createCollectionScope] = $c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME);
|
|
90
|
+
const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {
|
|
91
|
+
collectionRef: {
|
|
92
|
+
current: null
|
|
93
|
+
},
|
|
94
|
+
itemMap: new Map()
|
|
95
|
+
});
|
|
96
|
+
const CollectionProvider = (props)=>{
|
|
97
|
+
const { scope: scope , children: children } = props;
|
|
98
|
+
const ref = React__default.useRef(null);
|
|
99
|
+
const itemMap = React__default.useRef(new Map()).current;
|
|
100
|
+
return /*#__PURE__*/ React__default.createElement(CollectionProviderImpl, {
|
|
101
|
+
scope: scope,
|
|
102
|
+
itemMap: itemMap,
|
|
103
|
+
collectionRef: ref
|
|
104
|
+
}, children);
|
|
105
|
+
};
|
|
106
|
+
/* -----------------------------------------------------------------------------------------------
|
|
107
|
+
* CollectionSlot
|
|
108
|
+
* ---------------------------------------------------------------------------------------------*/ const COLLECTION_SLOT_NAME = name + 'CollectionSlot';
|
|
109
|
+
const CollectionSlot = /*#__PURE__*/ React__default.forwardRef((props, forwardedRef)=>{
|
|
110
|
+
const { scope: scope , children: children } = props;
|
|
111
|
+
const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
|
|
112
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef);
|
|
113
|
+
return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
114
|
+
ref: composedRefs
|
|
115
|
+
}, children);
|
|
116
|
+
});
|
|
117
|
+
/* -----------------------------------------------------------------------------------------------
|
|
118
|
+
* CollectionItem
|
|
119
|
+
* ---------------------------------------------------------------------------------------------*/ const ITEM_SLOT_NAME = name + 'CollectionItemSlot';
|
|
120
|
+
const ITEM_DATA_ATTR = 'data-radix-collection-item';
|
|
121
|
+
const CollectionItemSlot = /*#__PURE__*/ React__default.forwardRef((props, forwardedRef)=>{
|
|
122
|
+
const { scope: scope , children: children , ...itemData } = props;
|
|
123
|
+
const ref = React__default.useRef(null);
|
|
124
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
125
|
+
const context = useCollectionContext(ITEM_SLOT_NAME, scope);
|
|
126
|
+
React__default.useEffect(()=>{
|
|
127
|
+
context.itemMap.set(ref, {
|
|
128
|
+
ref: ref,
|
|
129
|
+
...itemData
|
|
130
|
+
});
|
|
131
|
+
return ()=>void context.itemMap.delete(ref)
|
|
132
|
+
;
|
|
133
|
+
});
|
|
134
|
+
return /*#__PURE__*/ React__default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
|
|
135
|
+
[ITEM_DATA_ATTR]: '',
|
|
136
|
+
ref: composedRefs
|
|
137
|
+
}, children);
|
|
138
|
+
});
|
|
139
|
+
/* -----------------------------------------------------------------------------------------------
|
|
140
|
+
* useCollection
|
|
141
|
+
* ---------------------------------------------------------------------------------------------*/ function useCollection(scope) {
|
|
142
|
+
const context = useCollectionContext(name + 'CollectionConsumer', scope);
|
|
143
|
+
const getItems = React__default.useCallback(()=>{
|
|
144
|
+
const collectionNode = context.collectionRef.current;
|
|
145
|
+
if (!collectionNode) return [];
|
|
146
|
+
const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));
|
|
147
|
+
const items = Array.from(context.itemMap.values());
|
|
148
|
+
const orderedItems = items.sort((a, b)=>orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)
|
|
149
|
+
);
|
|
150
|
+
return orderedItems;
|
|
151
|
+
}, [
|
|
152
|
+
context.collectionRef,
|
|
153
|
+
context.itemMap
|
|
154
|
+
]);
|
|
155
|
+
return getItems;
|
|
156
|
+
}
|
|
157
|
+
return [
|
|
158
|
+
{
|
|
159
|
+
Provider: CollectionProvider,
|
|
160
|
+
Slot: CollectionSlot,
|
|
161
|
+
ItemSlot: CollectionItemSlot
|
|
162
|
+
},
|
|
163
|
+
useCollection,
|
|
164
|
+
createCollectionScope
|
|
165
|
+
];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export { $e02a7d9cb1dc128c$export$c74125a8e3af6bb2 as $ };
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import { _ as _extends } from './extends-4575346e.js';
|
|
2
|
+
import { useEffect, forwardRef, useContext, useState, createElement, useRef, createContext } from 'react';
|
|
3
|
+
import { $ as $b1b2314f5f9a1d84$export$25bec8c6f54ee79a, a as $6ed0406888f73fc4$export$c7b2cbe3552a0d05, b as $8927f6f2acc4f386$export$250ffa63cdc0d034, g as $e42e1063c40fb3ef$export$b9ecd428b558ff10, h as $8927f6f2acc4f386$export$6d1a0317bde7de7f } from './index-22aad354.js';
|
|
4
|
+
import $7SXl2$reactdom from 'react-dom';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Listens for when the escape key is down
|
|
8
|
+
*/ function $addc16e1bbe58fd0$export$3a72a57244d6e765(onEscapeKeyDownProp, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
9
|
+
const onEscapeKeyDown = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEscapeKeyDownProp);
|
|
10
|
+
useEffect(()=>{
|
|
11
|
+
const handleKeyDown = (event)=>{
|
|
12
|
+
if (event.key === 'Escape') onEscapeKeyDown(event);
|
|
13
|
+
};
|
|
14
|
+
ownerDocument.addEventListener('keydown', handleKeyDown);
|
|
15
|
+
return ()=>ownerDocument.removeEventListener('keydown', handleKeyDown)
|
|
16
|
+
;
|
|
17
|
+
}, [
|
|
18
|
+
onEscapeKeyDown,
|
|
19
|
+
ownerDocument
|
|
20
|
+
]);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const $5cb92bef7577960e$var$CONTEXT_UPDATE = 'dismissableLayer.update';
|
|
24
|
+
const $5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside';
|
|
25
|
+
const $5cb92bef7577960e$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside';
|
|
26
|
+
let $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
27
|
+
const $5cb92bef7577960e$var$DismissableLayerContext = /*#__PURE__*/ createContext({
|
|
28
|
+
layers: new Set(),
|
|
29
|
+
layersWithOutsidePointerEventsDisabled: new Set(),
|
|
30
|
+
branches: new Set()
|
|
31
|
+
});
|
|
32
|
+
const $5cb92bef7577960e$export$177fb62ff3ec1f22 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
33
|
+
var _node$ownerDocument;
|
|
34
|
+
const { disableOutsidePointerEvents: disableOutsidePointerEvents = false , onEscapeKeyDown: onEscapeKeyDown , onPointerDownOutside: onPointerDownOutside , onFocusOutside: onFocusOutside , onInteractOutside: onInteractOutside , onDismiss: onDismiss , ...layerProps } = props;
|
|
35
|
+
const context = useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
36
|
+
const [node1, setNode] = useState(null);
|
|
37
|
+
const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document;
|
|
38
|
+
const [, force] = useState({});
|
|
39
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, (node)=>setNode(node)
|
|
40
|
+
);
|
|
41
|
+
const layers = Array.from(context.layers);
|
|
42
|
+
const [highestLayerWithOutsidePointerEventsDisabled] = [
|
|
43
|
+
...context.layersWithOutsidePointerEventsDisabled
|
|
44
|
+
].slice(-1); // prettier-ignore
|
|
45
|
+
const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore
|
|
46
|
+
const index = node1 ? layers.indexOf(node1) : -1;
|
|
47
|
+
const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;
|
|
48
|
+
const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;
|
|
49
|
+
const pointerDownOutside = $5cb92bef7577960e$var$usePointerDownOutside((event)=>{
|
|
50
|
+
const target = event.target;
|
|
51
|
+
const isPointerDownOnBranch = [
|
|
52
|
+
...context.branches
|
|
53
|
+
].some((branch)=>branch.contains(target)
|
|
54
|
+
);
|
|
55
|
+
if (!isPointerEventsEnabled || isPointerDownOnBranch) return;
|
|
56
|
+
onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event);
|
|
57
|
+
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
58
|
+
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
59
|
+
}, ownerDocument);
|
|
60
|
+
const focusOutside = $5cb92bef7577960e$var$useFocusOutside((event)=>{
|
|
61
|
+
const target = event.target;
|
|
62
|
+
const isFocusInBranch = [
|
|
63
|
+
...context.branches
|
|
64
|
+
].some((branch)=>branch.contains(target)
|
|
65
|
+
);
|
|
66
|
+
if (isFocusInBranch) return;
|
|
67
|
+
onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event);
|
|
68
|
+
onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event);
|
|
69
|
+
if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
70
|
+
}, ownerDocument);
|
|
71
|
+
$addc16e1bbe58fd0$export$3a72a57244d6e765((event)=>{
|
|
72
|
+
const isHighestLayer = index === context.layers.size - 1;
|
|
73
|
+
if (!isHighestLayer) return;
|
|
74
|
+
onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event);
|
|
75
|
+
if (!event.defaultPrevented && onDismiss) {
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
onDismiss();
|
|
78
|
+
}
|
|
79
|
+
}, ownerDocument);
|
|
80
|
+
useEffect(()=>{
|
|
81
|
+
if (!node1) return;
|
|
82
|
+
if (disableOutsidePointerEvents) {
|
|
83
|
+
if (context.layersWithOutsidePointerEventsDisabled.size === 0) {
|
|
84
|
+
$5cb92bef7577960e$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;
|
|
85
|
+
ownerDocument.body.style.pointerEvents = 'none';
|
|
86
|
+
}
|
|
87
|
+
context.layersWithOutsidePointerEventsDisabled.add(node1);
|
|
88
|
+
}
|
|
89
|
+
context.layers.add(node1);
|
|
90
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
91
|
+
return ()=>{
|
|
92
|
+
if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $5cb92bef7577960e$var$originalBodyPointerEvents;
|
|
93
|
+
};
|
|
94
|
+
}, [
|
|
95
|
+
node1,
|
|
96
|
+
ownerDocument,
|
|
97
|
+
disableOutsidePointerEvents,
|
|
98
|
+
context
|
|
99
|
+
]);
|
|
100
|
+
/**
|
|
101
|
+
* We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect
|
|
102
|
+
* because a change to `disableOutsidePointerEvents` would remove this layer from the stack
|
|
103
|
+
* and add it to the end again so the layering order wouldn't be _creation order_.
|
|
104
|
+
* We only want them to be removed from context stacks when unmounted.
|
|
105
|
+
*/ useEffect(()=>{
|
|
106
|
+
return ()=>{
|
|
107
|
+
if (!node1) return;
|
|
108
|
+
context.layers.delete(node1);
|
|
109
|
+
context.layersWithOutsidePointerEventsDisabled.delete(node1);
|
|
110
|
+
$5cb92bef7577960e$var$dispatchUpdate();
|
|
111
|
+
};
|
|
112
|
+
}, [
|
|
113
|
+
node1,
|
|
114
|
+
context
|
|
115
|
+
]);
|
|
116
|
+
useEffect(()=>{
|
|
117
|
+
const handleUpdate = ()=>force({})
|
|
118
|
+
;
|
|
119
|
+
document.addEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate);
|
|
120
|
+
return ()=>document.removeEventListener($5cb92bef7577960e$var$CONTEXT_UPDATE, handleUpdate)
|
|
121
|
+
;
|
|
122
|
+
}, []);
|
|
123
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, layerProps, {
|
|
124
|
+
ref: composedRefs,
|
|
125
|
+
style: {
|
|
126
|
+
pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined,
|
|
127
|
+
...props.style
|
|
128
|
+
},
|
|
129
|
+
onFocusCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocusCapture, focusOutside.onFocusCapture),
|
|
130
|
+
onBlurCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlurCapture, focusOutside.onBlurCapture),
|
|
131
|
+
onPointerDownCapture: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture)
|
|
132
|
+
}));
|
|
133
|
+
});
|
|
134
|
+
const $5cb92bef7577960e$export$4d5eb2109db14228 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
135
|
+
const context = useContext($5cb92bef7577960e$var$DismissableLayerContext);
|
|
136
|
+
const ref = useRef(null);
|
|
137
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
138
|
+
useEffect(()=>{
|
|
139
|
+
const node = ref.current;
|
|
140
|
+
if (node) {
|
|
141
|
+
context.branches.add(node);
|
|
142
|
+
return ()=>{
|
|
143
|
+
context.branches.delete(node);
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}, [
|
|
147
|
+
context.branches
|
|
148
|
+
]);
|
|
149
|
+
return /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, props, {
|
|
150
|
+
ref: composedRefs
|
|
151
|
+
}));
|
|
152
|
+
});
|
|
153
|
+
/* -----------------------------------------------------------------------------------------------*/ /**
|
|
154
|
+
* Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup`
|
|
155
|
+
* to mimic layer dismissing behaviour present in OS.
|
|
156
|
+
* Returns props to pass to the node we want to check for outside events.
|
|
157
|
+
*/ function $5cb92bef7577960e$var$usePointerDownOutside(onPointerDownOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
158
|
+
const handlePointerDownOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onPointerDownOutside);
|
|
159
|
+
const isPointerInsideReactTreeRef = useRef(false);
|
|
160
|
+
const handleClickRef = useRef(()=>{});
|
|
161
|
+
useEffect(()=>{
|
|
162
|
+
const handlePointerDown = (event)=>{
|
|
163
|
+
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
164
|
+
const eventDetail = {
|
|
165
|
+
originalEvent: event
|
|
166
|
+
};
|
|
167
|
+
function handleAndDispatchPointerDownOutsideEvent() {
|
|
168
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, {
|
|
169
|
+
discrete: true
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* On touch devices, we need to wait for a click event because browsers implement
|
|
174
|
+
* a ~350ms delay between the time the user stops touching the display and when the
|
|
175
|
+
* browser executres events. We need to ensure we don't reactivate pointer-events within
|
|
176
|
+
* this timeframe otherwise the browser may execute events that should have been prevented.
|
|
177
|
+
*
|
|
178
|
+
* Additionally, this also lets us deal automatically with cancellations when a click event
|
|
179
|
+
* isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc.
|
|
180
|
+
*
|
|
181
|
+
* This is why we also continuously remove the previous listener, because we cannot be
|
|
182
|
+
* certain that it was raised, and therefore cleaned-up.
|
|
183
|
+
*/ if (event.pointerType === 'touch') {
|
|
184
|
+
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
185
|
+
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
|
|
186
|
+
ownerDocument.addEventListener('click', handleClickRef.current, {
|
|
187
|
+
once: true
|
|
188
|
+
});
|
|
189
|
+
} else handleAndDispatchPointerDownOutsideEvent();
|
|
190
|
+
}
|
|
191
|
+
isPointerInsideReactTreeRef.current = false;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* if this hook executes in a component that mounts via a `pointerdown` event, the event
|
|
195
|
+
* would bubble up to the document and trigger a `pointerDownOutside` event. We avoid
|
|
196
|
+
* this by delaying the event listener registration on the document.
|
|
197
|
+
* This is not React specific, but rather how the DOM works, ie:
|
|
198
|
+
* ```
|
|
199
|
+
* button.addEventListener('pointerdown', () => {
|
|
200
|
+
* console.log('I will log');
|
|
201
|
+
* document.addEventListener('pointerdown', () => {
|
|
202
|
+
* console.log('I will also log');
|
|
203
|
+
* })
|
|
204
|
+
* });
|
|
205
|
+
*/ const timerId = window.setTimeout(()=>{
|
|
206
|
+
ownerDocument.addEventListener('pointerdown', handlePointerDown);
|
|
207
|
+
}, 0);
|
|
208
|
+
return ()=>{
|
|
209
|
+
window.clearTimeout(timerId);
|
|
210
|
+
ownerDocument.removeEventListener('pointerdown', handlePointerDown);
|
|
211
|
+
ownerDocument.removeEventListener('click', handleClickRef.current);
|
|
212
|
+
};
|
|
213
|
+
}, [
|
|
214
|
+
ownerDocument,
|
|
215
|
+
handlePointerDownOutside
|
|
216
|
+
]);
|
|
217
|
+
return {
|
|
218
|
+
// ensures we check React component tree (not just DOM tree)
|
|
219
|
+
onPointerDownCapture: ()=>isPointerInsideReactTreeRef.current = true
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Listens for when focus happens outside a react subtree.
|
|
224
|
+
* Returns props to pass to the root (node) of the subtree we want to check.
|
|
225
|
+
*/ function $5cb92bef7577960e$var$useFocusOutside(onFocusOutside, ownerDocument = globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) {
|
|
226
|
+
const handleFocusOutside = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onFocusOutside);
|
|
227
|
+
const isFocusInsideReactTreeRef = useRef(false);
|
|
228
|
+
useEffect(()=>{
|
|
229
|
+
const handleFocus = (event)=>{
|
|
230
|
+
if (event.target && !isFocusInsideReactTreeRef.current) {
|
|
231
|
+
const eventDetail = {
|
|
232
|
+
originalEvent: event
|
|
233
|
+
};
|
|
234
|
+
$5cb92bef7577960e$var$handleAndDispatchCustomEvent($5cb92bef7577960e$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {
|
|
235
|
+
discrete: false
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
ownerDocument.addEventListener('focusin', handleFocus);
|
|
240
|
+
return ()=>ownerDocument.removeEventListener('focusin', handleFocus)
|
|
241
|
+
;
|
|
242
|
+
}, [
|
|
243
|
+
ownerDocument,
|
|
244
|
+
handleFocusOutside
|
|
245
|
+
]);
|
|
246
|
+
return {
|
|
247
|
+
onFocusCapture: ()=>isFocusInsideReactTreeRef.current = true
|
|
248
|
+
,
|
|
249
|
+
onBlurCapture: ()=>isFocusInsideReactTreeRef.current = false
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
function $5cb92bef7577960e$var$dispatchUpdate() {
|
|
253
|
+
const event = new CustomEvent($5cb92bef7577960e$var$CONTEXT_UPDATE);
|
|
254
|
+
document.dispatchEvent(event);
|
|
255
|
+
}
|
|
256
|
+
function $5cb92bef7577960e$var$handleAndDispatchCustomEvent(name, handler, detail, { discrete: discrete }) {
|
|
257
|
+
const target = detail.originalEvent.target;
|
|
258
|
+
const event = new CustomEvent(name, {
|
|
259
|
+
bubbles: false,
|
|
260
|
+
cancelable: true,
|
|
261
|
+
detail: detail
|
|
262
|
+
});
|
|
263
|
+
if (handler) target.addEventListener(name, handler, {
|
|
264
|
+
once: true
|
|
265
|
+
});
|
|
266
|
+
if (discrete) $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event);
|
|
267
|
+
else target.dispatchEvent(event);
|
|
268
|
+
}
|
|
269
|
+
const $5cb92bef7577960e$export$be92b6f5f03c0fe9 = $5cb92bef7577960e$export$177fb62ff3ec1f22;
|
|
270
|
+
const $5cb92bef7577960e$export$aecb2ddcb55c95be = $5cb92bef7577960e$export$4d5eb2109db14228;
|
|
271
|
+
|
|
272
|
+
const $f1701beae083dbae$export$602eac185826482c = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
273
|
+
var _globalThis$document;
|
|
274
|
+
const { container: container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body , ...portalProps } = props;
|
|
275
|
+
return container ? /*#__PURE__*/ $7SXl2$reactdom.createPortal(/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, portalProps, {
|
|
276
|
+
ref: forwardedRef
|
|
277
|
+
})), container) : null;
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
export { $f1701beae083dbae$export$602eac185826482c as $, $5cb92bef7577960e$export$177fb62ff3ec1f22 as a, $5cb92bef7577960e$export$aecb2ddcb55c95be as b, $5cb92bef7577960e$export$be92b6f5f03c0fe9 as c };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useLayoutEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* On the server, React emits a warning when calling `useLayoutEffect`.
|
|
6
|
+
* This is because neither `useLayoutEffect` nor `useEffect` run on the server.
|
|
7
|
+
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
|
8
|
+
*
|
|
9
|
+
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
10
|
+
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? useLayoutEffect : ()=>{};
|
|
11
|
+
|
|
12
|
+
const $1746a345f3d73bb7$var$useReactId = React['useId'.toString()] || (()=>undefined
|
|
13
|
+
);
|
|
14
|
+
let $1746a345f3d73bb7$var$count = 0;
|
|
15
|
+
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
|
|
16
|
+
const [id, setId] = React.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.
|
|
17
|
+
$9f79659886946c16$export$e5c5a5f917a5871c(()=>{
|
|
18
|
+
if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)
|
|
19
|
+
);
|
|
20
|
+
}, [
|
|
21
|
+
deterministicId
|
|
22
|
+
]);
|
|
23
|
+
return deterministicId || (id ? `radix-${id}` : '');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { $1746a345f3d73bb7$export$f680877a34711e37 as $ };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from "./FormControl-
|
|
2
|
-
export * from "./Card-
|
|
1
|
+
export * from "./FormControl-f18e2f59";
|
|
2
|
+
export * from "./Card-e62c3ff6";
|
|
3
3
|
export * from "./index.es-00cb3bcb";
|
|
4
|
-
export * from "./TextInput-
|
|
4
|
+
export * from "./TextInput-4424c195";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { ItemGroup } from "./ItemGroup-5af4d600";
|
|
2
|
-
export { default as ItemGroupRehydrator } from "./SiteHeader.rehydrator-
|
|
2
|
+
export { default as ItemGroupRehydrator } from "./SiteHeader.rehydrator-023b7b76";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { NavItem } from "./NavItem-df20237c";
|
|
2
|
-
export { default as NavItemRehydrator, default as NavItemWithSubNavRehydrator } from "./SiteHeader.rehydrator-
|
|
2
|
+
export { default as NavItemRehydrator, default as NavItemWithSubNavRehydrator } from "./SiteHeader.rehydrator-023b7b76";
|
|
3
3
|
export { NavItemWithSubNav } from "./NavItemWithSubNav-65f21828";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Panel } from "./SiteHeader.rehydrator-
|
|
1
|
+
export { Panel } from "./SiteHeader.rehydrator-023b7b76";
|
|
2
2
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Column } from "./SiteHeader.rehydrator-
|
|
1
|
+
export { Column } from "./SiteHeader.rehydrator-023b7b76";
|
|
2
2
|
export {};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { _ as _extends } from './extends-4575346e.js';
|
|
2
|
+
import { forwardRef, Children, isValidElement, createElement, cloneElement, Fragment, useLayoutEffect, useMemo, useRef } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Set a given ref to a given value
|
|
6
|
+
* This utility takes care of different types of refs: callback refs and RefObject(s)
|
|
7
|
+
*/ function $6ed0406888f73fc4$var$setRef(ref, value) {
|
|
8
|
+
if (typeof ref === 'function') ref(value);
|
|
9
|
+
else if (ref !== null && ref !== undefined) ref.current = value;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A utility to compose multiple refs together
|
|
13
|
+
* Accepts callback refs and RefObject(s)
|
|
14
|
+
*/ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {
|
|
15
|
+
return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)
|
|
16
|
+
)
|
|
17
|
+
;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* -------------------------------------------------------------------------------------------------
|
|
21
|
+
* Slot
|
|
22
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
23
|
+
const { children: children , ...slotProps } = props;
|
|
24
|
+
const childrenArray = Children.toArray(children);
|
|
25
|
+
const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
|
|
26
|
+
if (slottable) {
|
|
27
|
+
// the new element to render is the one passed as a child of `Slottable`
|
|
28
|
+
const newElement = slottable.props.children;
|
|
29
|
+
const newChildren = childrenArray.map((child)=>{
|
|
30
|
+
if (child === slottable) {
|
|
31
|
+
// because the new element will be the one rendered, we are only interested
|
|
32
|
+
// in grabbing its children (`newElement.props.children`)
|
|
33
|
+
if (Children.count(newElement) > 1) return Children.only(null);
|
|
34
|
+
return /*#__PURE__*/ isValidElement(newElement) ? newElement.props.children : null;
|
|
35
|
+
} else return child;
|
|
36
|
+
});
|
|
37
|
+
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
38
|
+
ref: forwardedRef
|
|
39
|
+
}), /*#__PURE__*/ isValidElement(newElement) ? /*#__PURE__*/ cloneElement(newElement, undefined, newChildren) : null);
|
|
40
|
+
}
|
|
41
|
+
return /*#__PURE__*/ createElement($5e63c961fc1ce211$var$SlotClone, _extends({}, slotProps, {
|
|
42
|
+
ref: forwardedRef
|
|
43
|
+
}), children);
|
|
44
|
+
});
|
|
45
|
+
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';
|
|
46
|
+
/* -------------------------------------------------------------------------------------------------
|
|
47
|
+
* SlotClone
|
|
48
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
49
|
+
const { children: children , ...slotProps } = props;
|
|
50
|
+
if (/*#__PURE__*/ isValidElement(children)) return /*#__PURE__*/ cloneElement(children, {
|
|
51
|
+
...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),
|
|
52
|
+
ref: $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref)
|
|
53
|
+
});
|
|
54
|
+
return Children.count(children) > 1 ? Children.only(null) : null;
|
|
55
|
+
});
|
|
56
|
+
$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';
|
|
57
|
+
/* -------------------------------------------------------------------------------------------------
|
|
58
|
+
* Slottable
|
|
59
|
+
* -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{
|
|
60
|
+
return /*#__PURE__*/ createElement(Fragment, null, children);
|
|
61
|
+
};
|
|
62
|
+
/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {
|
|
63
|
+
return /*#__PURE__*/ isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
|
|
64
|
+
}
|
|
65
|
+
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
|
|
66
|
+
// all child props should override
|
|
67
|
+
const overrideProps = {
|
|
68
|
+
...childProps
|
|
69
|
+
};
|
|
70
|
+
for(const propName in childProps){
|
|
71
|
+
const slotPropValue = slotProps[propName];
|
|
72
|
+
const childPropValue = childProps[propName];
|
|
73
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
74
|
+
if (isHandler) {
|
|
75
|
+
// if the handler exists on both, we compose them
|
|
76
|
+
if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{
|
|
77
|
+
childPropValue(...args);
|
|
78
|
+
slotPropValue(...args);
|
|
79
|
+
};
|
|
80
|
+
else if (slotPropValue) overrideProps[propName] = slotPropValue;
|
|
81
|
+
} else if (propName === 'style') overrideProps[propName] = {
|
|
82
|
+
...slotPropValue,
|
|
83
|
+
...childPropValue
|
|
84
|
+
};
|
|
85
|
+
else if (propName === 'className') overrideProps[propName] = [
|
|
86
|
+
slotPropValue,
|
|
87
|
+
childPropValue
|
|
88
|
+
].filter(Boolean).join(' ');
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
...slotProps,
|
|
92
|
+
...overrideProps
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* On the server, React emits a warning when calling `useLayoutEffect`.
|
|
98
|
+
* This is because neither `useLayoutEffect` nor `useEffect` run on the server.
|
|
99
|
+
* We use this safe version which suppresses the warning by replacing it with a noop on the server.
|
|
100
|
+
*
|
|
101
|
+
* See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect
|
|
102
|
+
*/ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? useLayoutEffect : ()=>{};
|
|
103
|
+
|
|
104
|
+
function $010c2913dbd2fe3d$export$5cae361ad82dce8b(value) {
|
|
105
|
+
const ref = useRef({
|
|
106
|
+
value: value,
|
|
107
|
+
previous: value
|
|
108
|
+
}); // We compare values before making an update to ensure that
|
|
109
|
+
// a change has been made. This ensures the previous value is
|
|
110
|
+
// persisted correctly between renders.
|
|
111
|
+
return useMemo(()=>{
|
|
112
|
+
if (ref.current.value !== value) {
|
|
113
|
+
ref.current.previous = ref.current.value;
|
|
114
|
+
ref.current.value = value;
|
|
115
|
+
}
|
|
116
|
+
return ref.current.previous;
|
|
117
|
+
}, [
|
|
118
|
+
value
|
|
119
|
+
]);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export { $5e63c961fc1ce211$export$8c6ed5c666ac1360 as $, $9f79659886946c16$export$e5c5a5f917a5871c as a, $010c2913dbd2fe3d$export$5cae361ad82dce8b as b };
|