@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,504 @@
|
|
|
1
|
+
import { _ as __rest, a as __assign, f as filterDataAttrs } from './filter-data-attrs-afdb7d32.js';
|
|
2
|
+
import React__default, { useContext, createContext, forwardRef, createElement, useRef, useState, useEffect, useCallback } from 'react';
|
|
3
|
+
import { _ as _extends } from './extends-4575346e.js';
|
|
4
|
+
import { d as $c512c27ab02ef895$export$50c7b4e9d9f19c1, a as $6ed0406888f73fc4$export$c7b2cbe3552a0d05, e as $71cd76cc60e0454e$export$6f32135080cb4c3, $ as $b1b2314f5f9a1d84$export$25bec8c6f54ee79a, b as $8927f6f2acc4f386$export$250ffa63cdc0d034, g as $e42e1063c40fb3ef$export$b9ecd428b558ff10, f as $921a889cee6df7e8$export$99c2b779aa4e8b8b } from './index-22aad354.js';
|
|
5
|
+
import { $ as $e02a7d9cb1dc128c$export$c74125a8e3af6bb2 } from './index-8000d9e3.js';
|
|
6
|
+
import { $ as $1746a345f3d73bb7$export$f680877a34711e37 } from './index-bed18a88.js';
|
|
7
|
+
import { I as Icon } from './Icon-c1af47bc.js';
|
|
8
|
+
import { C as Context } from './Surface-dde51789.js';
|
|
9
|
+
import { c as classNames } from './index-2ae58626.js';
|
|
10
|
+
|
|
11
|
+
const $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ createContext(undefined);
|
|
12
|
+
/* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
|
|
13
|
+
const globalDir = useContext($f631663db3294ace$var$DirectionContext);
|
|
14
|
+
return localDir || globalDir || 'ltr';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const $d7bdfb9eb0fdf311$var$ENTRY_FOCUS = 'rovingFocusGroup.onEntryFocus';
|
|
18
|
+
const $d7bdfb9eb0fdf311$var$EVENT_OPTIONS = {
|
|
19
|
+
bubbles: false,
|
|
20
|
+
cancelable: true
|
|
21
|
+
};
|
|
22
|
+
/* -------------------------------------------------------------------------------------------------
|
|
23
|
+
* RovingFocusGroup
|
|
24
|
+
* -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$GROUP_NAME = 'RovingFocusGroup';
|
|
25
|
+
const [$d7bdfb9eb0fdf311$var$Collection, $d7bdfb9eb0fdf311$var$useCollection, $d7bdfb9eb0fdf311$var$createCollectionScope] = $e02a7d9cb1dc128c$export$c74125a8e3af6bb2($d7bdfb9eb0fdf311$var$GROUP_NAME);
|
|
26
|
+
const [$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext, $d7bdfb9eb0fdf311$export$c7109489551a4f4] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($d7bdfb9eb0fdf311$var$GROUP_NAME, [
|
|
27
|
+
$d7bdfb9eb0fdf311$var$createCollectionScope
|
|
28
|
+
]);
|
|
29
|
+
const [$d7bdfb9eb0fdf311$var$RovingFocusProvider, $d7bdfb9eb0fdf311$var$useRovingFocusContext] = $d7bdfb9eb0fdf311$var$createRovingFocusGroupContext($d7bdfb9eb0fdf311$var$GROUP_NAME);
|
|
30
|
+
const $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
31
|
+
return /*#__PURE__*/ createElement($d7bdfb9eb0fdf311$var$Collection.Provider, {
|
|
32
|
+
scope: props.__scopeRovingFocusGroup
|
|
33
|
+
}, /*#__PURE__*/ createElement($d7bdfb9eb0fdf311$var$Collection.Slot, {
|
|
34
|
+
scope: props.__scopeRovingFocusGroup
|
|
35
|
+
}, /*#__PURE__*/ createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl, _extends({}, props, {
|
|
36
|
+
ref: forwardedRef
|
|
37
|
+
}))));
|
|
38
|
+
});
|
|
39
|
+
/* -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$RovingFocusGroupImpl = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
40
|
+
const { __scopeRovingFocusGroup: __scopeRovingFocusGroup , orientation: orientation , loop: loop = false , dir: dir , currentTabStopId: currentTabStopIdProp , defaultCurrentTabStopId: defaultCurrentTabStopId , onCurrentTabStopIdChange: onCurrentTabStopIdChange , onEntryFocus: onEntryFocus , ...groupProps } = props;
|
|
41
|
+
const ref = useRef(null);
|
|
42
|
+
const composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
|
|
43
|
+
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
44
|
+
const [currentTabStopId = null, setCurrentTabStopId] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
45
|
+
prop: currentTabStopIdProp,
|
|
46
|
+
defaultProp: defaultCurrentTabStopId,
|
|
47
|
+
onChange: onCurrentTabStopIdChange
|
|
48
|
+
});
|
|
49
|
+
const [isTabbingBackOut, setIsTabbingBackOut] = useState(false);
|
|
50
|
+
const handleEntryFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEntryFocus);
|
|
51
|
+
const getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup);
|
|
52
|
+
const isClickFocusRef = useRef(false);
|
|
53
|
+
const [focusableItemsCount, setFocusableItemsCount] = useState(0);
|
|
54
|
+
useEffect(()=>{
|
|
55
|
+
const node = ref.current;
|
|
56
|
+
if (node) {
|
|
57
|
+
node.addEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, handleEntryFocus);
|
|
58
|
+
return ()=>node.removeEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, handleEntryFocus)
|
|
59
|
+
;
|
|
60
|
+
}
|
|
61
|
+
}, [
|
|
62
|
+
handleEntryFocus
|
|
63
|
+
]);
|
|
64
|
+
return /*#__PURE__*/ createElement($d7bdfb9eb0fdf311$var$RovingFocusProvider, {
|
|
65
|
+
scope: __scopeRovingFocusGroup,
|
|
66
|
+
orientation: orientation,
|
|
67
|
+
dir: direction,
|
|
68
|
+
loop: loop,
|
|
69
|
+
currentTabStopId: currentTabStopId,
|
|
70
|
+
onItemFocus: useCallback((tabStopId)=>setCurrentTabStopId(tabStopId)
|
|
71
|
+
, [
|
|
72
|
+
setCurrentTabStopId
|
|
73
|
+
]),
|
|
74
|
+
onItemShiftTab: useCallback(()=>setIsTabbingBackOut(true)
|
|
75
|
+
, []),
|
|
76
|
+
onFocusableItemAdd: useCallback(()=>setFocusableItemsCount((prevCount)=>prevCount + 1
|
|
77
|
+
)
|
|
78
|
+
, []),
|
|
79
|
+
onFocusableItemRemove: useCallback(()=>setFocusableItemsCount((prevCount)=>prevCount - 1
|
|
80
|
+
)
|
|
81
|
+
, [])
|
|
82
|
+
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
83
|
+
tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
|
|
84
|
+
"data-orientation": orientation
|
|
85
|
+
}, groupProps, {
|
|
86
|
+
ref: composedRefs,
|
|
87
|
+
style: {
|
|
88
|
+
outline: 'none',
|
|
89
|
+
...props.style
|
|
90
|
+
},
|
|
91
|
+
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, ()=>{
|
|
92
|
+
isClickFocusRef.current = true;
|
|
93
|
+
}),
|
|
94
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, (event)=>{
|
|
95
|
+
// We normally wouldn't need this check, because we already check
|
|
96
|
+
// that the focus is on the current target and not bubbling to it.
|
|
97
|
+
// We do this because Safari doesn't focus buttons when clicked, and
|
|
98
|
+
// instead, the wrapper will get focused and not through a bubbling event.
|
|
99
|
+
const isKeyboardFocus = !isClickFocusRef.current;
|
|
100
|
+
if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
|
|
101
|
+
const entryFocusEvent = new CustomEvent($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, $d7bdfb9eb0fdf311$var$EVENT_OPTIONS);
|
|
102
|
+
event.currentTarget.dispatchEvent(entryFocusEvent);
|
|
103
|
+
if (!entryFocusEvent.defaultPrevented) {
|
|
104
|
+
const items = getItems().filter((item)=>item.focusable
|
|
105
|
+
);
|
|
106
|
+
const activeItem = items.find((item)=>item.active
|
|
107
|
+
);
|
|
108
|
+
const currentItem = items.find((item)=>item.id === currentTabStopId
|
|
109
|
+
);
|
|
110
|
+
const candidateItems = [
|
|
111
|
+
activeItem,
|
|
112
|
+
currentItem,
|
|
113
|
+
...items
|
|
114
|
+
].filter(Boolean);
|
|
115
|
+
const candidateNodes = candidateItems.map((item)=>item.ref.current
|
|
116
|
+
);
|
|
117
|
+
$d7bdfb9eb0fdf311$var$focusFirst(candidateNodes);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
isClickFocusRef.current = false;
|
|
121
|
+
}),
|
|
122
|
+
onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, ()=>setIsTabbingBackOut(false)
|
|
123
|
+
)
|
|
124
|
+
})));
|
|
125
|
+
});
|
|
126
|
+
/* -------------------------------------------------------------------------------------------------
|
|
127
|
+
* RovingFocusGroupItem
|
|
128
|
+
* -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$ITEM_NAME = 'RovingFocusGroupItem';
|
|
129
|
+
const $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
130
|
+
const { __scopeRovingFocusGroup: __scopeRovingFocusGroup , focusable: focusable = true , active: active = false , tabStopId: tabStopId , ...itemProps } = props;
|
|
131
|
+
const autoId = $1746a345f3d73bb7$export$f680877a34711e37();
|
|
132
|
+
const id = tabStopId || autoId;
|
|
133
|
+
const context = $d7bdfb9eb0fdf311$var$useRovingFocusContext($d7bdfb9eb0fdf311$var$ITEM_NAME, __scopeRovingFocusGroup);
|
|
134
|
+
const isCurrentTabStop = context.currentTabStopId === id;
|
|
135
|
+
const getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup);
|
|
136
|
+
const { onFocusableItemAdd: onFocusableItemAdd , onFocusableItemRemove: onFocusableItemRemove } = context;
|
|
137
|
+
useEffect(()=>{
|
|
138
|
+
if (focusable) {
|
|
139
|
+
onFocusableItemAdd();
|
|
140
|
+
return ()=>onFocusableItemRemove()
|
|
141
|
+
;
|
|
142
|
+
}
|
|
143
|
+
}, [
|
|
144
|
+
focusable,
|
|
145
|
+
onFocusableItemAdd,
|
|
146
|
+
onFocusableItemRemove
|
|
147
|
+
]);
|
|
148
|
+
return /*#__PURE__*/ createElement($d7bdfb9eb0fdf311$var$Collection.ItemSlot, {
|
|
149
|
+
scope: __scopeRovingFocusGroup,
|
|
150
|
+
id: id,
|
|
151
|
+
focusable: focusable,
|
|
152
|
+
active: active
|
|
153
|
+
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
|
|
154
|
+
tabIndex: isCurrentTabStop ? 0 : -1,
|
|
155
|
+
"data-orientation": context.orientation
|
|
156
|
+
}, itemProps, {
|
|
157
|
+
ref: forwardedRef,
|
|
158
|
+
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, (event)=>{
|
|
159
|
+
// We prevent focusing non-focusable items on `mousedown`.
|
|
160
|
+
// Even though the item has tabIndex={-1}, that only means take it out of the tab order.
|
|
161
|
+
if (!focusable) event.preventDefault(); // Safari doesn't focus a button when clicked so we run our logic on mousedown also
|
|
162
|
+
else context.onItemFocus(id);
|
|
163
|
+
}),
|
|
164
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, ()=>context.onItemFocus(id)
|
|
165
|
+
),
|
|
166
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
167
|
+
if (event.key === 'Tab' && event.shiftKey) {
|
|
168
|
+
context.onItemShiftTab();
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (event.target !== event.currentTarget) return;
|
|
172
|
+
const focusIntent = $d7bdfb9eb0fdf311$var$getFocusIntent(event, context.orientation, context.dir);
|
|
173
|
+
if (focusIntent !== undefined) {
|
|
174
|
+
event.preventDefault();
|
|
175
|
+
const items = getItems().filter((item)=>item.focusable
|
|
176
|
+
);
|
|
177
|
+
let candidateNodes = items.map((item)=>item.ref.current
|
|
178
|
+
);
|
|
179
|
+
if (focusIntent === 'last') candidateNodes.reverse();
|
|
180
|
+
else if (focusIntent === 'prev' || focusIntent === 'next') {
|
|
181
|
+
if (focusIntent === 'prev') candidateNodes.reverse();
|
|
182
|
+
const currentIndex = candidateNodes.indexOf(event.currentTarget);
|
|
183
|
+
candidateNodes = context.loop ? $d7bdfb9eb0fdf311$var$wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Imperative focus during keydown is risky so we prevent React's batching updates
|
|
187
|
+
* to avoid potential bugs. See: https://github.com/facebook/react/issues/20332
|
|
188
|
+
*/ setTimeout(()=>$d7bdfb9eb0fdf311$var$focusFirst(candidateNodes)
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
})
|
|
192
|
+
})));
|
|
193
|
+
});
|
|
194
|
+
/* -----------------------------------------------------------------------------------------------*/ // prettier-ignore
|
|
195
|
+
const $d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT = {
|
|
196
|
+
ArrowLeft: 'prev',
|
|
197
|
+
ArrowUp: 'prev',
|
|
198
|
+
ArrowRight: 'next',
|
|
199
|
+
ArrowDown: 'next',
|
|
200
|
+
PageUp: 'first',
|
|
201
|
+
Home: 'first',
|
|
202
|
+
PageDown: 'last',
|
|
203
|
+
End: 'last'
|
|
204
|
+
};
|
|
205
|
+
function $d7bdfb9eb0fdf311$var$getDirectionAwareKey(key, dir) {
|
|
206
|
+
if (dir !== 'rtl') return key;
|
|
207
|
+
return key === 'ArrowLeft' ? 'ArrowRight' : key === 'ArrowRight' ? 'ArrowLeft' : key;
|
|
208
|
+
}
|
|
209
|
+
function $d7bdfb9eb0fdf311$var$getFocusIntent(event, orientation, dir) {
|
|
210
|
+
const key = $d7bdfb9eb0fdf311$var$getDirectionAwareKey(event.key, dir);
|
|
211
|
+
if (orientation === 'vertical' && [
|
|
212
|
+
'ArrowLeft',
|
|
213
|
+
'ArrowRight'
|
|
214
|
+
].includes(key)) return undefined;
|
|
215
|
+
if (orientation === 'horizontal' && [
|
|
216
|
+
'ArrowUp',
|
|
217
|
+
'ArrowDown'
|
|
218
|
+
].includes(key)) return undefined;
|
|
219
|
+
return $d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT[key];
|
|
220
|
+
}
|
|
221
|
+
function $d7bdfb9eb0fdf311$var$focusFirst(candidates) {
|
|
222
|
+
const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
|
|
223
|
+
for (const candidate of candidates){
|
|
224
|
+
// if focus is already where we want to go, we don't want to keep going through the candidates
|
|
225
|
+
if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
226
|
+
candidate.focus();
|
|
227
|
+
if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Wraps an array around itself at a given start index
|
|
232
|
+
* Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`
|
|
233
|
+
*/ function $d7bdfb9eb0fdf311$var$wrapArray(array, startIndex) {
|
|
234
|
+
return array.map((_, index)=>array[(startIndex + index) % array.length]
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
const $d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9 = $d7bdfb9eb0fdf311$export$8699f7c8af148338;
|
|
238
|
+
const $d7bdfb9eb0fdf311$export$6d08773d2e66f8f2 = $d7bdfb9eb0fdf311$export$ab9df7c53fe8454;
|
|
239
|
+
|
|
240
|
+
/* -------------------------------------------------------------------------------------------------
|
|
241
|
+
* Tabs
|
|
242
|
+
* -----------------------------------------------------------------------------------------------*/ const $69cb30bb0017df05$var$TABS_NAME = 'Tabs';
|
|
243
|
+
const [$69cb30bb0017df05$var$createTabsContext, $69cb30bb0017df05$export$355f5bd209d7b13a] = $c512c27ab02ef895$export$50c7b4e9d9f19c1($69cb30bb0017df05$var$TABS_NAME, [
|
|
244
|
+
$d7bdfb9eb0fdf311$export$c7109489551a4f4
|
|
245
|
+
]);
|
|
246
|
+
const $69cb30bb0017df05$var$useRovingFocusGroupScope = $d7bdfb9eb0fdf311$export$c7109489551a4f4();
|
|
247
|
+
const [$69cb30bb0017df05$var$TabsProvider, $69cb30bb0017df05$var$useTabsContext] = $69cb30bb0017df05$var$createTabsContext($69cb30bb0017df05$var$TABS_NAME);
|
|
248
|
+
const $69cb30bb0017df05$export$b2539bed5023c21c = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
249
|
+
const { __scopeTabs: __scopeTabs , value: valueProp , onValueChange: onValueChange , defaultValue: defaultValue , orientation: orientation = 'horizontal' , dir: dir , activationMode: activationMode = 'automatic' , ...tabsProps } = props;
|
|
250
|
+
const direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
|
|
251
|
+
const [value, setValue] = $71cd76cc60e0454e$export$6f32135080cb4c3({
|
|
252
|
+
prop: valueProp,
|
|
253
|
+
onChange: onValueChange,
|
|
254
|
+
defaultProp: defaultValue
|
|
255
|
+
});
|
|
256
|
+
return /*#__PURE__*/ createElement($69cb30bb0017df05$var$TabsProvider, {
|
|
257
|
+
scope: __scopeTabs,
|
|
258
|
+
baseId: $1746a345f3d73bb7$export$f680877a34711e37(),
|
|
259
|
+
value: value,
|
|
260
|
+
onValueChange: setValue,
|
|
261
|
+
orientation: orientation,
|
|
262
|
+
dir: direction,
|
|
263
|
+
activationMode: activationMode
|
|
264
|
+
}, /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
265
|
+
dir: direction,
|
|
266
|
+
"data-orientation": orientation
|
|
267
|
+
}, tabsProps, {
|
|
268
|
+
ref: forwardedRef
|
|
269
|
+
})));
|
|
270
|
+
});
|
|
271
|
+
/* -------------------------------------------------------------------------------------------------
|
|
272
|
+
* TabsList
|
|
273
|
+
* -----------------------------------------------------------------------------------------------*/ const $69cb30bb0017df05$var$TAB_LIST_NAME = 'TabsList';
|
|
274
|
+
const $69cb30bb0017df05$export$9712d22edc0d78c1 = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
275
|
+
const { __scopeTabs: __scopeTabs , loop: loop = true , ...listProps } = props;
|
|
276
|
+
const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TAB_LIST_NAME, __scopeTabs);
|
|
277
|
+
const rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs);
|
|
278
|
+
return /*#__PURE__*/ createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9, _extends({
|
|
279
|
+
asChild: true
|
|
280
|
+
}, rovingFocusGroupScope, {
|
|
281
|
+
orientation: context.orientation,
|
|
282
|
+
dir: context.dir,
|
|
283
|
+
loop: loop
|
|
284
|
+
}), /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
285
|
+
role: "tablist",
|
|
286
|
+
"aria-orientation": context.orientation
|
|
287
|
+
}, listProps, {
|
|
288
|
+
ref: forwardedRef
|
|
289
|
+
})));
|
|
290
|
+
});
|
|
291
|
+
/* -------------------------------------------------------------------------------------------------
|
|
292
|
+
* TabsTrigger
|
|
293
|
+
* -----------------------------------------------------------------------------------------------*/ const $69cb30bb0017df05$var$TRIGGER_NAME = 'TabsTrigger';
|
|
294
|
+
const $69cb30bb0017df05$export$8114b9fdfdf9f3ba = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
295
|
+
const { __scopeTabs: __scopeTabs , value: value , disabled: disabled = false , ...triggerProps } = props;
|
|
296
|
+
const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TRIGGER_NAME, __scopeTabs);
|
|
297
|
+
const rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs);
|
|
298
|
+
const triggerId = $69cb30bb0017df05$var$makeTriggerId(context.baseId, value);
|
|
299
|
+
const contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value);
|
|
300
|
+
const isSelected = value === context.value;
|
|
301
|
+
return /*#__PURE__*/ createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2, _extends({
|
|
302
|
+
asChild: true
|
|
303
|
+
}, rovingFocusGroupScope, {
|
|
304
|
+
focusable: !disabled,
|
|
305
|
+
active: isSelected
|
|
306
|
+
}), /*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
|
|
307
|
+
type: "button",
|
|
308
|
+
role: "tab",
|
|
309
|
+
"aria-selected": isSelected,
|
|
310
|
+
"aria-controls": contentId,
|
|
311
|
+
"data-state": isSelected ? 'active' : 'inactive',
|
|
312
|
+
"data-disabled": disabled ? '' : undefined,
|
|
313
|
+
disabled: disabled,
|
|
314
|
+
id: triggerId
|
|
315
|
+
}, triggerProps, {
|
|
316
|
+
ref: forwardedRef,
|
|
317
|
+
onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, (event)=>{
|
|
318
|
+
// only call handler if it's the left button (mousedown gets triggered by all mouse buttons)
|
|
319
|
+
// but not when the control key is pressed (avoiding MacOS right click)
|
|
320
|
+
if (!disabled && event.button === 0 && event.ctrlKey === false) context.onValueChange(value);
|
|
321
|
+
else // prevent focus to avoid accidental activation
|
|
322
|
+
event.preventDefault();
|
|
323
|
+
}),
|
|
324
|
+
onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, (event)=>{
|
|
325
|
+
if ([
|
|
326
|
+
' ',
|
|
327
|
+
'Enter'
|
|
328
|
+
].includes(event.key)) context.onValueChange(value);
|
|
329
|
+
}),
|
|
330
|
+
onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, ()=>{
|
|
331
|
+
// handle "automatic" activation if necessary
|
|
332
|
+
// ie. activate tab following focus
|
|
333
|
+
const isAutomaticActivation = context.activationMode !== 'manual';
|
|
334
|
+
if (!isSelected && !disabled && isAutomaticActivation) context.onValueChange(value);
|
|
335
|
+
})
|
|
336
|
+
})));
|
|
337
|
+
});
|
|
338
|
+
/* -------------------------------------------------------------------------------------------------
|
|
339
|
+
* TabsContent
|
|
340
|
+
* -----------------------------------------------------------------------------------------------*/ const $69cb30bb0017df05$var$CONTENT_NAME = 'TabsContent';
|
|
341
|
+
const $69cb30bb0017df05$export$bd905d70e8fd2ebb = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
342
|
+
const { __scopeTabs: __scopeTabs , value: value , forceMount: forceMount , children: children , ...contentProps } = props;
|
|
343
|
+
const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$CONTENT_NAME, __scopeTabs);
|
|
344
|
+
const triggerId = $69cb30bb0017df05$var$makeTriggerId(context.baseId, value);
|
|
345
|
+
const contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value);
|
|
346
|
+
const isSelected = value === context.value;
|
|
347
|
+
const isMountAnimationPreventedRef = useRef(isSelected);
|
|
348
|
+
useEffect(()=>{
|
|
349
|
+
const rAF = requestAnimationFrame(()=>isMountAnimationPreventedRef.current = false
|
|
350
|
+
);
|
|
351
|
+
return ()=>cancelAnimationFrame(rAF)
|
|
352
|
+
;
|
|
353
|
+
}, []);
|
|
354
|
+
return /*#__PURE__*/ createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b, {
|
|
355
|
+
present: forceMount || isSelected
|
|
356
|
+
}, ({ present: present })=>/*#__PURE__*/ createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
|
|
357
|
+
"data-state": isSelected ? 'active' : 'inactive',
|
|
358
|
+
"data-orientation": context.orientation,
|
|
359
|
+
role: "tabpanel",
|
|
360
|
+
"aria-labelledby": triggerId,
|
|
361
|
+
hidden: !present,
|
|
362
|
+
id: contentId,
|
|
363
|
+
tabIndex: 0
|
|
364
|
+
}, contentProps, {
|
|
365
|
+
ref: forwardedRef,
|
|
366
|
+
style: {
|
|
367
|
+
...props.style,
|
|
368
|
+
animationDuration: isMountAnimationPreventedRef.current ? '0s' : undefined
|
|
369
|
+
}
|
|
370
|
+
}), present && children)
|
|
371
|
+
);
|
|
372
|
+
});
|
|
373
|
+
/* ---------------------------------------------------------------------------------------------- */ function $69cb30bb0017df05$var$makeTriggerId(baseId, value) {
|
|
374
|
+
return `${baseId}-trigger-${value}`;
|
|
375
|
+
}
|
|
376
|
+
function $69cb30bb0017df05$var$makeContentId(baseId, value) {
|
|
377
|
+
return `${baseId}-content-${value}`;
|
|
378
|
+
}
|
|
379
|
+
const $69cb30bb0017df05$export$be92b6f5f03c0fe9 = $69cb30bb0017df05$export$b2539bed5023c21c;
|
|
380
|
+
const $69cb30bb0017df05$export$54c2e3dc7acea9f5 = $69cb30bb0017df05$export$9712d22edc0d78c1;
|
|
381
|
+
const $69cb30bb0017df05$export$41fb9f06171c75f4 = $69cb30bb0017df05$export$8114b9fdfdf9f3ba;
|
|
382
|
+
const $69cb30bb0017df05$export$7c6e2c02157bb7d2 = $69cb30bb0017df05$export$bd905d70e8fd2ebb;
|
|
383
|
+
|
|
384
|
+
var Tab = function (_a) {
|
|
385
|
+
var label = _a.label, value = _a.value, icon = _a.icon, iconActive = _a.iconActive, props = __rest(_a, ["label", "value", "icon", "iconActive"]);
|
|
386
|
+
var surface = useContext(Context).surface;
|
|
387
|
+
return (React__default.createElement($69cb30bb0017df05$export$41fb9f06171c75f4, __assign({ className: classNames("arc-Tab-trigger", {
|
|
388
|
+
"arc-Tab-trigger--onDarkSurface": surface === "dark",
|
|
389
|
+
"arc-Tab-trigger--hasIcon": icon || iconActive
|
|
390
|
+
}), value: value }, filterDataAttrs(props)),
|
|
391
|
+
icon && (React__default.createElement("div", { className: "arc-Tab-triggerIcon", "data-testid": "arc-Tab-TriggerIcon" },
|
|
392
|
+
React__default.createElement(Icon, { icon: icon }))),
|
|
393
|
+
iconActive && (React__default.createElement("div", { className: "arc-Tab-triggerIcon arc-Tab-triggerIcon--active", "data-testid": "arc-Tab-TriggerIconActive" },
|
|
394
|
+
React__default.createElement(Icon, { icon: iconActive }))),
|
|
395
|
+
label));
|
|
396
|
+
};
|
|
397
|
+
|
|
398
|
+
var TabContent = function (_a) {
|
|
399
|
+
var children = _a.children, value = _a.value;
|
|
400
|
+
return (React__default.createElement($69cb30bb0017df05$export$7c6e2c02157bb7d2, { className: "arc-Tab-content", value: value }, children));
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
const React$1 = React__default;
|
|
404
|
+
const BtIconArrowRightFill = props =>
|
|
405
|
+
/*#__PURE__*/ React$1.createElement(
|
|
406
|
+
"svg",
|
|
407
|
+
Object.assign(
|
|
408
|
+
{
|
|
409
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
410
|
+
viewBox: "0 0 32 32"
|
|
411
|
+
},
|
|
412
|
+
props
|
|
413
|
+
),
|
|
414
|
+
/*#__PURE__*/ React$1.createElement("defs", null),
|
|
415
|
+
/*#__PURE__*/ React$1.createElement("path", {
|
|
416
|
+
d:
|
|
417
|
+
"M2,16A14,14,0,1,0,16,2,14,14,0,0,0,2,16Zm16.85352-4.35352L23.207,16l-4.35351,4.35352a.5.5,0,0,1-.707-.707L21.293,16.5H9.5a.5.5,0,0,1,0-1H21.293l-3.14649-3.14648a.5.5,0,0,1,.707-.707Z",
|
|
418
|
+
fill: "currentColor"
|
|
419
|
+
})
|
|
420
|
+
);
|
|
421
|
+
var BtIconArrowRightFill_2 = BtIconArrowRightFill;
|
|
422
|
+
|
|
423
|
+
const React = React__default;
|
|
424
|
+
const BtIconArrowLeftFill = props =>
|
|
425
|
+
/*#__PURE__*/ React.createElement(
|
|
426
|
+
"svg",
|
|
427
|
+
Object.assign(
|
|
428
|
+
{
|
|
429
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
430
|
+
viewBox: "0 0 32 32"
|
|
431
|
+
},
|
|
432
|
+
props
|
|
433
|
+
),
|
|
434
|
+
/*#__PURE__*/ React.createElement("defs", null),
|
|
435
|
+
/*#__PURE__*/ React.createElement("path", {
|
|
436
|
+
d:
|
|
437
|
+
"M30,16A14,14,0,1,0,16,30,14,14,0,0,0,30,16ZM13.14648,20.35352,8.793,16l4.35351-4.35352a.5.5,0,0,1,.707.707L10.707,15.5H22.5a.5.5,0,0,1,0,1H10.707l3.14649,3.14648a.5.5,0,0,1-.707.707Z",
|
|
438
|
+
fill: "currentColor"
|
|
439
|
+
})
|
|
440
|
+
);
|
|
441
|
+
var BtIconArrowLeftFill_2 = BtIconArrowLeftFill;
|
|
442
|
+
|
|
443
|
+
var TabsList = function (_a) {
|
|
444
|
+
var children = _a.children, type = _a.type, isJustified = _a.isJustified, ariaLabel = _a.ariaLabel, props = __rest(_a, ["children", "type", "isJustified", "ariaLabel"]);
|
|
445
|
+
var surface = useContext(Context).surface;
|
|
446
|
+
var tabsRef = useRef(null);
|
|
447
|
+
var _b = useState(false), rightOverflow = _b[0], setRightOverflow = _b[1];
|
|
448
|
+
var _c = useState(false), leftOverflow = _c[0], setLeftOverflow = _c[1];
|
|
449
|
+
var checkOverflow = function (element) {
|
|
450
|
+
if (element) {
|
|
451
|
+
if (element.scrollWidth > element.clientWidth) {
|
|
452
|
+
setRightOverflow(true);
|
|
453
|
+
}
|
|
454
|
+
if (element.scrollLeft + 10 >=
|
|
455
|
+
element.scrollWidth - element.clientWidth) {
|
|
456
|
+
setRightOverflow(false);
|
|
457
|
+
}
|
|
458
|
+
if (element.scrollLeft >= 1) {
|
|
459
|
+
setLeftOverflow(true);
|
|
460
|
+
}
|
|
461
|
+
else {
|
|
462
|
+
setLeftOverflow(false);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
useEffect(function () {
|
|
467
|
+
checkOverflow(tabsRef.current);
|
|
468
|
+
}, []);
|
|
469
|
+
var scrollTabs = function (scrollAmount) {
|
|
470
|
+
if (tabsRef.current) {
|
|
471
|
+
tabsRef.current.scrollLeft += scrollAmount;
|
|
472
|
+
}
|
|
473
|
+
};
|
|
474
|
+
var onScroll = function (event) {
|
|
475
|
+
checkOverflow(event.currentTarget);
|
|
476
|
+
};
|
|
477
|
+
return (React__default.createElement(React__default.Fragment, null,
|
|
478
|
+
React__default.createElement($69cb30bb0017df05$export$54c2e3dc7acea9f5, __assign({ onScroll: onScroll, className: classNames("arc-Tabs", {
|
|
479
|
+
"arc-Tabs--contained": type === "contained",
|
|
480
|
+
"arc-Tabs--isJustified": isJustified,
|
|
481
|
+
"arc-Tabs--onDarkSurface": surface === "dark"
|
|
482
|
+
}), ref: tabsRef, "aria-label": ariaLabel }, filterDataAttrs(props)), children),
|
|
483
|
+
leftOverflow && (React__default.createElement("button", { className: classNames("arc-Tabs-overflowIcon arc-Tabs-overflowIcon--left", {
|
|
484
|
+
"arc-Tabs-overflowIcon--onDarkSurface": surface === "dark"
|
|
485
|
+
}), onClick: function () { return scrollTabs(-300); }, "aria-label": "Scroll Tabs Left", "data-testid": "arc-Tabs-overflowIconLeft" },
|
|
486
|
+
React__default.createElement(Icon, { icon: BtIconArrowLeftFill_2, size: 40, color: "brand" }))),
|
|
487
|
+
rightOverflow && (React__default.createElement("button", { className: classNames("arc-Tabs-overflowIcon", {
|
|
488
|
+
"arc-Tabs-overflowIcon--onDarkSurface": surface === "dark"
|
|
489
|
+
}), onClick: function () { return scrollTabs(300); }, "aria-label": "Scroll Tabs Right", "data-testid": "arc-Tabs-overflowIconRight" },
|
|
490
|
+
React__default.createElement(Icon, { icon: BtIconArrowRightFill_2, size: 40, color: "brand" })))));
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
var Tabs = function (_a) {
|
|
494
|
+
var children = _a.children, defaultValue = _a.defaultValue, onValueChange = _a.onValueChange, activationMode = _a.activationMode, props = __rest(_a, ["children", "defaultValue", "onValueChange", "activationMode"]);
|
|
495
|
+
return (React__default.createElement($69cb30bb0017df05$export$be92b6f5f03c0fe9, __assign({ className: "arc-Tabs-root", defaultValue: defaultValue, onValueChange: onValueChange, activationMode: activationMode }, filterDataAttrs(props)), children));
|
|
496
|
+
};
|
|
497
|
+
Tab.displayName = "Tabs.Tab";
|
|
498
|
+
TabsList.displayName = "Tabs.List";
|
|
499
|
+
TabContent.displayName = "Tabs.Content";
|
|
500
|
+
Tabs.Tab = Tab;
|
|
501
|
+
Tabs.List = TabsList;
|
|
502
|
+
Tabs.Content = TabContent;
|
|
503
|
+
|
|
504
|
+
export { Tabs as T };
|
|
@@ -9,9 +9,9 @@ import { C as Context } from './Surface-dde51789.js';
|
|
|
9
9
|
*/
|
|
10
10
|
var Text = function (_a) {
|
|
11
11
|
var _b;
|
|
12
|
-
var _c = _a.align, align = _c === void 0 ? "left" : _c, children = _a.children, _d = _a.isInline, isInline = _d === void 0 ? false : _d, _e = _a.isMeasured, isMeasured = _e === void 0 ? false : _e, _f = _a.size, size = _f === void 0 ? "m" : _f, _g = _a.tone, tone = _g === void 0 ? "default" : _g, props = __rest(_a, ["align", "children", "isInline", "isMeasured", "size", "tone"]);
|
|
12
|
+
var _c = _a.align, align = _c === void 0 ? "left" : _c, children = _a.children, id = _a.id, _d = _a.isInline, isInline = _d === void 0 ? false : _d, _e = _a.isMeasured, isMeasured = _e === void 0 ? false : _e, _f = _a.size, size = _f === void 0 ? "m" : _f, _g = _a.tone, tone = _g === void 0 ? "default" : _g, props = __rest(_a, ["align", "children", "id", "isInline", "isMeasured", "size", "tone"]);
|
|
13
13
|
var surface = useContext(Context).surface;
|
|
14
|
-
return (React__default.createElement("span", __assign({ className: classNames((_b = {
|
|
14
|
+
return (React__default.createElement("span", __assign({ id: id, className: classNames((_b = {
|
|
15
15
|
"arc-Text": true
|
|
16
16
|
},
|
|
17
17
|
_b[suffixModifier("arc-Text--align", align)] = align !== "left",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { FC } from "react";
|
|
4
|
-
import { FormControlProps } from "./FormControl-
|
|
4
|
+
import { FormControlProps } from "./FormControl-f18e2f59";
|
|
5
5
|
type EventType = React.ChangeEvent<HTMLInputElement>;
|
|
6
6
|
/**
|
|
7
7
|
* Use `TextInput` to allow custom user text entry with a keyboard.
|
|
@@ -11,6 +11,8 @@ interface TextInputProps extends Omit<FormControlProps, "children" | "elementTyp
|
|
|
11
11
|
/**
|
|
12
12
|
* Uncontrolled default value of the TextInput. If the TextInput is controlled
|
|
13
13
|
* via `value`/`onChange`, `defaultValue` will be ignored.
|
|
14
|
+
*
|
|
15
|
+
* `defaultValue` is not to be used instead of helper text.
|
|
14
16
|
*/
|
|
15
17
|
defaultValue?: string;
|
|
16
18
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { TextInputProps } from "./TextInput-
|
|
1
|
+
import { TextInputProps } from "./TextInput-13050538";
|
|
2
2
|
/**
|
|
3
3
|
* Infer the correct inputMode, pattern and type if specifying a `number` type.
|
|
4
4
|
*/
|
|
5
5
|
declare const useNumericInput: (props: Pick<TextInputProps, "inputMode" | "pattern" | "type">) => {
|
|
6
|
-
inputMode: "
|
|
6
|
+
inputMode: "tel" | "url" | "email" | "numeric" | undefined;
|
|
7
7
|
pattern: string | undefined;
|
|
8
|
-
type: "text" | "
|
|
8
|
+
type: "text" | "tel" | "url" | "email" | "password" | undefined;
|
|
9
9
|
};
|
|
10
10
|
export { useNumericInput };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as __rest, a as __assign, f as filterDataAttrs } from './filter-data-attrs-afdb7d32.js';
|
|
2
2
|
import { c as classNames } from './index-2ae58626.js';
|
|
3
3
|
import React__default, { forwardRef, useContext, useState } from 'react';
|
|
4
|
-
import { u as useAriaDescribedby, F as FormControl } from './FormControl-
|
|
4
|
+
import { u as useAriaDescribedby, F as FormControl } from './FormControl-f18e2f59.js';
|
|
5
5
|
import { C as Context } from './Surface-dde51789.js';
|
|
6
6
|
import { V as VisuallyHidden } from './VisuallyHidden-b9eebf71.js';
|
|
7
7
|
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { FC } from "react";
|
|
4
|
+
declare const ToastNotification: FC<ToastNotificationProps>;
|
|
5
|
+
type ToastStatus = "general" | "error" | "warning" | "success";
|
|
6
|
+
interface ToastNotificationProps {
|
|
7
|
+
/**
|
|
8
|
+
* Title for `<Toast />`
|
|
9
|
+
*/
|
|
10
|
+
title: string;
|
|
11
|
+
/**
|
|
12
|
+
* Set open state for `<Toast />`
|
|
13
|
+
*/
|
|
14
|
+
isOpen: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Function to call when the open state of `<Toast />` changes. This needs to be supplied in order for the auto dismiss and the close button to work.
|
|
17
|
+
*/
|
|
18
|
+
onOpenChange: (isOpen: boolean) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Set whether close button shows
|
|
21
|
+
*/
|
|
22
|
+
isCloseButtonVisible?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Set whether to include a status icon
|
|
25
|
+
*/
|
|
26
|
+
isStatusIconVisible?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Link for `<Toast />`
|
|
29
|
+
*/
|
|
30
|
+
link?: {
|
|
31
|
+
text: string;
|
|
32
|
+
ariaLabel?: string;
|
|
33
|
+
href?: string;
|
|
34
|
+
onClick?: () => void;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Status of `<Toast />`
|
|
38
|
+
*/
|
|
39
|
+
status?: ToastStatus;
|
|
40
|
+
}
|
|
41
|
+
/** Use `Toast` to display temporary messages at the bottom of the viewport. */
|
|
42
|
+
declare const Toast: FC<ToastProps> & {
|
|
43
|
+
Notification: typeof ToastNotification;
|
|
44
|
+
};
|
|
45
|
+
interface ToastProps {
|
|
46
|
+
children: React.ReactNode;
|
|
47
|
+
/**
|
|
48
|
+
* Colour scheme for `Toast` - Use 'default' in almost all cases.
|
|
49
|
+
*/
|
|
50
|
+
colorScheme?: "default" | "alternative";
|
|
51
|
+
}
|
|
52
|
+
export { ToastNotification, ToastNotificationProps, Toast };
|